[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Autoheader should ignore m4 "dnl" comments
From: |
Kang-Che Sung |
Subject: |
Re: Autoheader should ignore m4 "dnl" comments |
Date: |
Thu, 22 Feb 2018 18:13:10 +0800 |
Allow me to re-describe the bug in a clearer way:
In the configure.ac in Flex (lexer) project, I used a quoted argument with
"dnl" comments in within AC_CHECK_FUNCS like this:
AC_CHECK_FUNCS([dnl
pow dnl Used only by "examples/manual/expr"
setlocale dnl Needed only if NLS is enabled
reallocarr dnl NetBSD function. Use reallocarray if not available.
reallocarray dnl OpenBSD function. We have replacement if not available.
])
After running autoreconf, the generated 'configure' script is correct:
for ac_func in dup2 memset pow regcomp setlocale strchr strdup strtol
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
fi
done
But config.h.in comes with unneeded HAVE_ macros such as:
/* Define to 1 if you have the `available.' function. */
#undef HAVE_AVAILABLE_
/* Define to 1 if you have the `by' function. */
#undef HAVE_BY
/* Define to 1 if you have the `dnl' function. */
#undef HAVE_DNL
The result I would expect is either:
(a.) Both 'configure' and 'config.h.in' generated correctly, without redundant
macros in the latter file.
(b.) Both files generated consistently, with 'dnl', 'by' and others
treated as function tokens in the former file. That is, the 'configure' script
"broken" like this.
for ac_func in dnl pow dnl Used only by "examples/manual/expr"
setlocale dnl Needed only if NLS is enabled
do :
#...
done
So that I would know I mustn't quote the argument if I had comments
within the AC_CHECK_FUNCS syntax.
> Note: Tested this with Autoconf 2.69 and Automake 1.15.1. Detailed
> steps to reproduce:
>
> $ git clone --depth 1 --branch v2.6.4 https://github.com/westes/flex flex
> $ cd flex
> $ autoheader
> $ cat src/config.h.in
>
> See the useless HAVE_ macros in the header.
That's it.