blob: 762275e7f8720ec3901588274525375633d58ebb [file] [log] [blame]
Andrew Geissler635e0e42020-08-21 15:58:33 -05001Subject: build: Move dnl comments out of AC_CHECK_FUNCS
Andrew Geisslerb7d28612020-07-24 16:15:54 -05002
3Due to a bug, autoheader (2.69) will treat M4 dnl comments in a quoted
4argument of AC_CHECK_FUNCS as function tokens and generate a lot of
5redundant and useless HAVE_* macros in config.h.in.
6(Examples: HAVE_DNL, HAVE_AVAILABLE_, HAVE_BY)
7
8It seems to be this commit dbb4e94dc7bacbcfd4acef4f085ef752fe1aa03f of
9mine that revealed this autoheader bug, and the affected config.h.in
10had been shipped within flex-2.6.4 release tarball.
11
12I have reported the autoheader bug here:
13<https://lists.gnu.org/archive/html/bug-autoconf/2018-02/msg00005.html>
14
15As a workaround, let's move comments out of AC_CHECK_FUNCS.
16
Andrew Geissler635e0e42020-08-21 15:58:33 -050017Upstream-Status: Backport
18Signed-off-by: Ross Burton <ross.burton@arm.com>
19
Andrew Geisslerb7d28612020-07-24 16:15:54 -050020Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Andrew Geissler635e0e42020-08-21 15:58:33 -050021Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
Andrew Geisslerb7d28612020-07-24 16:15:54 -050022---
Andrew Geissler635e0e42020-08-21 15:58:33 -050023 configure.ac | 28 +++++++++++++---------------
24 1 file changed, 13 insertions(+), 15 deletions(-)
Andrew Geisslerb7d28612020-07-24 16:15:54 -050025
26diff --git a/configure.ac b/configure.ac
Andrew Geissler635e0e42020-08-21 15:58:33 -050027index 55e774b..5ea3a93 100644
Andrew Geisslerb7d28612020-07-24 16:15:54 -050028--- a/configure.ac
29+++ b/configure.ac
Andrew Geissler635e0e42020-08-21 15:58:33 -050030@@ -153,21 +153,19 @@ AC_FUNC_REALLOC
Andrew Geisslerb7d28612020-07-24 16:15:54 -050031 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 Geisslerb7d28612020-07-24 16:15:54 -050047-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 Geissler635e0e42020-08-21 15:58:33 -050065--
662.25.1
67