bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Messed up gl_COMPILER_PREPARE_CHECK_DECL


From: Bruno Haible
Subject: Re: Messed up gl_COMPILER_PREPARE_CHECK_DECL
Date: Mon, 13 Jan 2020 20:02:14 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-171-generic; KDE/5.18.0; x86_64; ; )

Hi Paul,

> that incorrect line comes because ac_compile_for_check_decl is used 
> before it is set. And this occurs because Emacs's configure.ac's first 
> use of AC_CHECK_DECL is executed only on alpha platforms (which my 
> platform is not), which means the initialization of 
> ac_compile_for_check_decl is skipped.

The Emacs configure.ac is not written in a robust way. It contains
'case' and 'if'/'test' statements which conditionally execute the Autoconf
macros

  AC_MSG_CHECKING
  AC_MSG_ERROR
  AC_MSG_WARN
  AC_MSG_RESULT
  AC_CACHE_CHECK
  AC_LINK_IFELSE
  AC_LANG_PROGRAM
  AC_PATH_PROG
  AC_CHECK_DECL
  AC_DEFINE
  AC_CHECK_HEADER
  AC_CHECK_PROG
  AC_CHECK_FUNCS
  AC_COMPILE_IFELSE
  AC_CHECK_LIB
  AC_TRY_LINK
  AC_PREPROC_IFELSE
  AC_CONFIG_FILES
  AC_MSG_NOTICE

If any of these macros, in its implementation, performs an AC_REQUIRE, you
may get a problem, as described in [1].

Do we have a statement in the Autoconf documentation that none of the built-in
macros does an AC_REQUIRE? I don't think so. Therefore I would suggest that
the particular 'case' and 'if'/'test' statements - or even the entire main body
of the configure.ac, from line 130 to line 5588 - gets wrapped in an AC_DEFUN
that gets invoked once.

The other alternative is to state formally that none of these AC_* macros do
an AC_REQUIRE. But then it's hard to find a proper place for the
gl_COMPILER_PREPARE_CHECK_DECL invocation (without adding extra code to 
configure
scripts that don't use AC_CHECK_DECL). What would you suggest?

Bruno

[1] 
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Prerequisite-Macros.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]