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/configure.ac, 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/configure.ac:

    AC_REPLACE_FUNCS($funcs)

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
  _ACEOF
  $as_echo "#define \`\$as_echo \"HAVE_\$ac_func\" | \$as_tr_cpp\` 1"
  >>confdefs.h

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?

Thanks

-- 
k


_______________________________________________
Autoconf mailing list
Autoconf@gnu.org
http://lists.gnu.org/mailman/listinfo/autoconf

Reply via email to