xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-devtools/flex/flex/check-funcs.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1Subject: build: Move dnl comments out of AC_CHECK_FUNCS
2
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
17Upstream-Status: Backport
18Signed-off-by: Ross Burton <ross.burton@arm.com>
19
20Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
21Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
22---
23 configure.ac | 28 +++++++++++++---------------
24 1 file changed, 13 insertions(+), 15 deletions(-)
25
26diff --git a/configure.ac b/configure.ac
27index 55e774b..5ea3a93 100644
28--- a/configure.ac
29+++ b/configure.ac
30@@ -153,21 +153,19 @@ AC_FUNC_REALLOC
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
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
65--
662.25.1
67
68