[Top][All Lists]

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

Invalid expansion of AC_CHECK_FUNCS in 2.64+?

From: autoconf
Subject: Invalid expansion of AC_CHECK_FUNCS in 2.64+?
Date: Thu, 09 Dec 2010 15:52:35 +0100

Hi all,

as part of a research project I am performing changes to the GNU
binutils 2.18. 

When using Autoconf 2.68 on libiberty/, I get the following
error during configure:

  conftest.c:40:9: error: macro names must be identifiers
  configure: failed program was:
  | /* confdefs.h */
  | #define HAVE_ASPRINTF 1
  | #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
  | /* end confdefs.h.  */

This #define does not look good... 

With 2.63, this issue does not happen.  I traced the problem to the
following call in src/libiberty/


where $funcs is being set earlier. In the generated configure script,
the following is generated by Autoconf 2.68:

    for ac_func in $funcs
  do :
    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
  ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
  if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
    cat >>confdefs.h <<_ACEOF
  #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
  $as_echo "#define \`\$as_echo \"HAVE_\$ac_func\" | \$as_tr_cpp\` 1"

Why the duplicate append to confdefs.h? The first one based on "cat"
seems correct, but the second one has onle level of quoting too much.

The code generated by Autoconf 2.63 looks entirely different, and does
not cause this problem.

Could you explain what was changed since 2.63? Is this a known bug?
Otherwise, what extra information should I provide to investigate?



reply via email to

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