bug-autoconf
[Top][All Lists]
Advanced

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

Autoheader should ignore m4 "dnl" comments


From: Kang-Che Sung
Subject: Autoheader should ignore m4 "dnl" comments
Date: Thu, 22 Feb 2018 10:07:21 +0800

This bug is a funny one, I think.

In flex (lexer) configure.ac, I use "dnl" comments within
AC_CHECK_FUNCS for inline notes, 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.
    ])
    # --------------------------------

But this syntax will make autoheader generate unneeded HAVE_ macros in
config.h.in:

    /* 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 dnl comments should be ignored when generating config.h.in header,
or at least document that users should not add comments from within
AC_CHECK_FUNCS.

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.



reply via email to

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