Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 1 | Subject: build: Move dnl comments out of AC_CHECK_FUNCS |
Andrew Geissler | b7d2861 | 2020-07-24 16:15:54 -0500 | [diff] [blame] | 2 | |
| 3 | Due to a bug, autoheader (2.69) will treat M4 dnl comments in a quoted |
| 4 | argument of AC_CHECK_FUNCS as function tokens and generate a lot of |
| 5 | redundant and useless HAVE_* macros in config.h.in. |
| 6 | (Examples: HAVE_DNL, HAVE_AVAILABLE_, HAVE_BY) |
| 7 | |
| 8 | It seems to be this commit dbb4e94dc7bacbcfd4acef4f085ef752fe1aa03f of |
| 9 | mine that revealed this autoheader bug, and the affected config.h.in |
| 10 | had been shipped within flex-2.6.4 release tarball. |
| 11 | |
| 12 | I have reported the autoheader bug here: |
| 13 | <https://lists.gnu.org/archive/html/bug-autoconf/2018-02/msg00005.html> |
| 14 | |
| 15 | As a workaround, let's move comments out of AC_CHECK_FUNCS. |
| 16 | |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 17 | Upstream-Status: Backport |
| 18 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
| 19 | |
Andrew Geissler | b7d2861 | 2020-07-24 16:15:54 -0500 | [diff] [blame] | 20 | Signed-off-by: Kang-Che Sung <explorer09@gmail.com> |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 21 | Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com> |
Andrew Geissler | b7d2861 | 2020-07-24 16:15:54 -0500 | [diff] [blame] | 22 | --- |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 23 | configure.ac | 28 +++++++++++++--------------- |
| 24 | 1 file changed, 13 insertions(+), 15 deletions(-) |
Andrew Geissler | b7d2861 | 2020-07-24 16:15:54 -0500 | [diff] [blame] | 25 | |
| 26 | diff --git a/configure.ac b/configure.ac |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 27 | index 55e774b..5ea3a93 100644 |
Andrew Geissler | b7d2861 | 2020-07-24 16:15:54 -0500 | [diff] [blame] | 28 | --- a/configure.ac |
| 29 | +++ b/configure.ac |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 30 | @@ -153,21 +153,19 @@ AC_FUNC_REALLOC |
Andrew Geissler | b7d2861 | 2020-07-24 16:15:54 -0500 | [diff] [blame] | 31 | AS_IF([test "$cross_compiling" = yes], |
| 32 | AC_MSG_WARN([result $ac_cv_func_realloc_0_nonnull guessed because of cross compilation])) |
| 33 | |
| 34 | -AC_CHECK_FUNCS([dup2 dnl |
| 35 | -memset dnl |
| 36 | -regcomp dnl |
| 37 | -strcasecmp dnl |
| 38 | -strchr dnl |
| 39 | -strdup dnl |
| 40 | -strtol dnl |
| 41 | -], [], [AC_MSG_ERROR(required library function not found on your system)]) |
| 42 | - |
| 43 | -# Optional library functions |
| 44 | -AC_CHECK_FUNCS([dnl |
| 45 | -pow dnl Used only by "examples/manual/expr" |
| 46 | -setlocale dnl Needed only if NLS is enabled |
Andrew Geissler | b7d2861 | 2020-07-24 16:15:54 -0500 | [diff] [blame] | 47 | -reallocarray dnl OpenBSD function. We have replacement if not available. |
| 48 | -]) |
| 49 | +dnl Autoheader (<= 2.69) bug: "dnl" comments in a quoted argument of |
| 50 | +dnl AC_CHECK_FUNCS will expand wierdly in config.h.in. |
| 51 | +dnl (https://lists.gnu.org/archive/html/bug-autoconf/2018-02/msg00005.html) |
| 52 | + |
| 53 | +AC_CHECK_FUNCS([dup2 memset regcomp strcasecmp strchr strdup strtol], [], |
| 54 | + [AC_MSG_ERROR(required library function not found on your system)]) |
| 55 | + |
| 56 | +# Optional library functions: |
| 57 | +# pow - Used only by "examples/manual/expr". |
| 58 | +# setlocale - Needed only if NLS is enabled. |
| 59 | +# reallocarr - NetBSD function. Use reallocarray if not available. |
| 60 | +# reallocarray - OpenBSD function. We have replacement if not available. |
| 61 | +AC_CHECK_FUNCS([pow setlocale reallocarr reallocarray]) |
| 62 | |
| 63 | AC_CONFIG_FILES( |
| 64 | Makefile |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 65 | -- |
| 66 | 2.25.1 |
| 67 | |