autoconf-patches
[Top][All Lists]
Advanced

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

[PATCH 2/3] AC_REPLACE_FUNCS: invoke _AH_CHECK_FUNC and AC_LIBSOURCE unc


From: Zack Weinberg
Subject: [PATCH 2/3] AC_REPLACE_FUNCS: invoke _AH_CHECK_FUNC and AC_LIBSOURCE unconditionally.
Date: Wed, 25 Mar 2020 15:15:20 -0400

While investigating something else, I noticed that AC_REPLACE_FUNCS
calls _AH_CHECK_FUNC and AC_LIBSOURCE in the success branch of an
AC_CHECK_FUNC.  This doesn’t work; both of those are marker macros
that need to be expanded unconditionally at m4 time so that traces
(placed by autoheader and automake, respectively) will fire.  In order
to fix this while keeping the code readable, I would up doing a major
refactor.  There are now four internal macros implementing AC_REPLACE_FUNCS.

_AC_REPLACE_FUNC_U is called unconditionally for every shell word in
the list passed to AC_REPLACE_FUNCS, and does _AH_CHECK_FUNC +
AC_LIBSOURCE if it can, or issues a warning if it can’t.  (It could
make sense to make this a public function, if we think shell variables
in the AC_REPLACE_FUNCS list need to be supported long-term.  I dunno
if there’s a use case that can’t be handled by AC_REPLACE_FUNCS inside
a shell conditional just as well.)

_AC_REPLACE_FUNC_L and _AC_REPLACE_FUNC_NL implement the actual test
performed for each function to be replaced; the difference is that _L
(for literal) can only be used on a function whose name is known at m4
expansion time, _NL (nonliteral) works regardless.  _AC_REPLACE_FUNCS,
which already existed, handles looping either at m4 time or shell time
as appropriate.  AC_REPLACE_FUNCS remains a thin wrapper that runs
_AC_REPLACE_FUNCS(m4_flatten([$1])).

The _bulk_ of the patch is changes to the testsuite so that it notices
the original bug.  Specifically, AT_CHECK_AUTOHEADER now takes an
argument which is a whitespace-separated list of preprocessor macro
names that ought to appear in the generated config.h.in.  This can be
set to ‘ignore’ to skip the test, and unfortunately that’s what the
“trivial” per-macro tests have to do (AT_CHECK_MACRO and friends), so
coverage is not ideal, but it’s better than what we had.  Also,
AT_CHECK_M4 now normalizes the backtrace lines that appear in the
output of an AC_DIAGNOSE, e.g.

    configure.ac:6: warning: The macro `AC_LANG_SAVE' is obsolete.
    configure.ac:6: You should run autoupdate.
    ../../lib/autoconf/lang.m4:125: AC_LANG_SAVE is expanded from...
    configure.ac:6: the top level

becomes

    configure.ac:6: warning: The macro `AC_LANG_SAVE' is obsolete.
    configure.ac:6: You should run autoupdate.
    lang.m4: AC_LANG_SAVE is expanded from...
    configure.ac:6: the top level

This allows us to write tests for these diagnostics that don’t depend
on the relationship between the source and build directories, and
won’t break when unrelated patches change the line number of a macro
definition.

        * lib/autoconf/functions.m4 (AC_REPLACE_FUNCS, _AC_REPLACE_FUNCS)
        (_AC_REPLACE_FUNC): Refactor into AC_REPLACE_FUNCS,
        _AC_REPLACE_FUNCS, _AC_REPLACE_FUNC_U, _AC_REPLACE_FUNC_L,
        _AC_REPLACE_FUNC_NL.  Ensure that _AH_CHECK_FUNC and
        AC_LIBSOURCE are invoked unconditionally at m4 expansion
        time for each literal function name in the argument to
        AC_CHECK_FUNCS.  Issue warnings about non-literal names.

        * tests/local.at (AT_CHECK_M4): Normalize backtrace lines from
        the output of AC_DIAGNOSE / m4_warn.
        (AT_CHECK_AUTOHEADER): Add arg EXPECTED-TMPLS
        giving a list of preprocessor macro names that should appear
        in the generated config.h.in.  Use AT_CHECK_M4 to invoke autoheader.
        (_AT_CHECK_AC_MACRO, AT_CHECK_MACRO, AT_CHECK_AU_MACRO):
        Update uses of AT_CHECK_AUTOHEADER.
        * tests/fortran.at, tests/semantics.at, tests/tools.at
        * tests/torture.at: Update all uses of AT_CHECK_AUTOHEADER.

        * tests/semantics.at (AC_REPLACE_FUNCS test): Make somewhat
        more thorough, using new functionality of AT_CHECK_M4 and
        AT_CHECK_AUTOHEADER.

Signed-off-by: Zack Weinberg <address@hidden>
---
 lib/autoconf/functions.m4 | 39 ++++++++++++++-----
 tests/fortran.at          | 40 +++++++++++++++++---
 tests/local.at            | 63 +++++++++++++++++++++++++++----
 tests/semantics.at        | 79 +++++++++++++++++++++++++++++++--------
 tests/tools.at            | 10 ++---
 tests/torture.at          | 13 ++++---
 6 files changed, 196 insertions(+), 48 deletions(-)

diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4
index 608641b3..44730096 100644
--- a/lib/autoconf/functions.m4
+++ b/lib/autoconf/functions.m4
@@ -141,14 +141,35 @@ do
 done])])
 
 
-# _AC_REPLACE_FUNC(FUNCTION)
-# --------------------------
+# _AC_REPLACE_FUNC_U(FUNCTION)
+# ----------------------------
+# Perform the actions that need to be performed unconditionally
+# for every FUNCTION that *could* be replaced by AC_REPLACE_FUNCS.
+m4_define([_AC_REPLACE_FUNC_U],
+[AS_LITERAL_WORD_IF([$1],
+  [_AH_CHECK_FUNC([$1])AC_LIBSOURCE([$1.c])],
+  [AC_DIAGNOSE([syntax], [AC_REPLACE_FUNCS($1): you should use literals])])])
+
+# _AC_REPLACE_FUNC_L(FUNCTION)
+# ----------------------------
 # If FUNCTION exists, define HAVE_FUNCTION; else add FUNCTION.c
 # to the list of library objects.  FUNCTION must be literal.
-m4_define([_AC_REPLACE_FUNC],
+m4_define([_AC_REPLACE_FUNC_L],
+[_AC_REPLACE_FUNC_U([$1])]dnl
 [AC_CHECK_FUNC([$1],
-  [_AH_CHECK_FUNC([$1])AC_DEFINE(AS_TR_CPP([HAVE_$1]))],
-  [_AC_LIBOBJ([$1])AC_LIBSOURCE([$1.c])])])
+  [AC_DEFINE(AS_TR_CPP([HAVE_$1]))],
+  [_AC_LIBOBJ([$1])])])
+
+# _AC_REPLACE_FUNC_NL(FUNCTION)
+# -----------------------------
+# If FUNCTION exists, define HAVE_FUNCTION; else add FUNCTION.c
+# to the list of library objects.  FUNCTION can be a shell variable.
+# (Because of this, neither _AH_CHECK_FUNC nor AC_LIBSOURCE is invoked
+# for FUNCTION.)
+m4_define([_AC_REPLACE_FUNC_NL],
+[AC_CHECK_FUNC([$1],
+               [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]$1))],
+               [_AC_LIBOBJ([$1])])])
 
 # AC_REPLACE_FUNCS(FUNCTION...)
 # -----------------------------
@@ -160,11 +181,9 @@ AC_DEFUN([AC_REPLACE_FUNCS],
 
 m4_define([_AC_REPLACE_FUNCS],
 [AS_LITERAL_IF([$1],
-[m4_map_args_w([$1], [_AC_REPLACE_FUNC(], [)
-])],
-[AC_CHECK_FUNCS([$1],
-  [_AH_CHECK_FUNC([$ac_func])],
-  [_AC_LIBOBJ([$ac_func])])])])
+  [m4_map_args_w([$1], [_AC_REPLACE_FUNC_L(], [)])],
+  [m4_map_args_w([$1], [_AC_REPLACE_FUNC_U(], [)])]dnl
+  [AS_FOR([AC_func], [ac_func], [$1], [_AC_REPLACE_FUNC_NL(AC_func)])])])
 
 
 # AC_TRY_LINK_FUNC(FUNC, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
diff --git a/tests/fortran.at b/tests/fortran.at
index 10b06c5c..46ffadd8 100644
--- a/tests/fortran.at
+++ b/tests/fortran.at
@@ -237,7 +237,12 @@ int main(int argc, char *argv[])
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [
+  F77_DUMMY_MAIN
+  F77_FUNC
+  F77_FUNC_
+  FC_DUMMY_MAIN_EQ_F77
+])
 AT_CHECK_CONFIGURE
 : "${MAKE=make}"
 AT_CHECK([$MAKE], [], [ignore], [ignore])
@@ -315,7 +320,12 @@ int main (int argc, char *argv[])
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [
+  FC_DUMMY_MAIN
+  FC_DUMMY_MAIN_EQ_F77
+  FC_FUNC
+  FC_FUNC_
+])
 AT_CHECK_CONFIGURE
 : "${MAKE=make}"
 AT_CHECK([$MAKE], [], [ignore], [ignore])
@@ -391,7 +401,13 @@ int F77_MAIN (int argc, char *argv[])
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [
+  F77_DUMMY_MAIN
+  F77_FUNC
+  F77_FUNC_
+  F77_MAIN
+  FC_DUMMY_MAIN_EQ_F77
+])
 AT_CHECK_CONFIGURE
 : "${MAKE=make}"
 AT_CHECK([$MAKE], [], [ignore], [ignore])
@@ -470,7 +486,13 @@ int FC_MAIN (int argc, char *argv[])
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [
+  FC_DUMMY_MAIN
+  FC_DUMMY_MAIN_EQ_F77
+  FC_FUNC
+  FC_FUNC_
+  FC_MAIN
+])
 AT_CHECK_CONFIGURE
 : "${MAKE=make}"
 AT_CHECK([$MAKE], [], [ignore], [ignore])
@@ -547,7 +569,10 @@ int main(int argc, char *argv[])
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [
+  F77_DUMMY_MAIN
+  FC_DUMMY_MAIN_EQ_F77
+])
 AT_CHECK_CONFIGURE
 : "${MAKE=make}"
 AT_CHECK([$MAKE], [], [ignore], [ignore])
@@ -621,7 +646,10 @@ int main(int argc, char *argv[])
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [
+  FC_DUMMY_MAIN
+  FC_DUMMY_MAIN_EQ_F77
+])
 AT_CHECK_CONFIGURE
 : "${MAKE=make}"
 AT_CHECK([$MAKE], [], [ignore], [ignore])
diff --git a/tests/local.at b/tests/local.at
index 8496f55c..8bbd7b06 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -90,6 +90,20 @@ m4_define([AT_CHECK_PERL_SYNTAX],
 #  m4:script.4s:1: cannot open `foo': No such file or directory
 #  autom4te: m4 failed with exit status: 1
 #
+# Also, this
+#
+#  configure.ac:6: warning: The macro `AC_LANG_SAVE' is obsolete.
+#  configure.ac:6: You should run autoupdate.
+#  ../../lib/autoconf/lang.m4:125: AC_LANG_SAVE is expanded from...
+#  configure.ac:6: the top level
+#
+# becomes
+#
+#  configure.ac:6: warning: The macro `AC_LANG_SAVE' is obsolete.
+#  configure.ac:6: You should run autoupdate.
+#  lang.m4: AC_LANG_SAVE is expanded from...
+#  configure.ac:6: the top level
+#
 # We use the following sed patterns:
 #
 #     (m4): ?(file): ?(line):
@@ -106,6 +120,10 @@ m4_define([AT_CHECK_PERL_SYNTAX],
 # or  autom4te: [^ ]m4.exe
 # to  autom4te: m4
 #
+# and
+#     (path)/(basename).m4: ?(line): (message)
+# to  (basename).m4: (message)
+#
 # Moreover, DJGPP error messages include the error code in brackets;
 # remove the error code during normalization.
 #
@@ -119,6 +137,7 @@ m4_case([$4], [], [], [ignore], [],
        s/: C\(annot open \)\([^`:]*\):/: c\1`\2'\'':/
        s/: include:\( cannot open\)/:\1/
        s/^autom4te: [^ ]*m4[.ex]* /autom4te: m4 /
+        s!^.*/\([^/][^/]*\)\.m4: *\([0-9][0-9]*:\)*!\1.m4:!
        s/ (E[A-Z]*)$//
     ' stderr-raw >&2]], [0], [], [$4])])
 ])
@@ -222,11 +241,41 @@ fi
 ])
 
 
-# AT_CHECK_AUTOHEADER(ARGS, [EXIT-STATUS = 0], STDOUT, STDERR)
-# ------------------------------------------------------------
+# AT_CHECK_AUTOHEADER(ARGS, EXPECTED_TMPLS, [EXIT-STATUS = 0], STDOUT, STDERR)
+# ----------------------------------------------------------------------------
+# EXPECTED_TMPLS is a whitespace-separated list of template
+# definitions that should appear in the generated config.hin.
+# The stock definitions made by AC_INIT are also checked for.
+# If EXPECTED_TMPLS is the single word `ignore', or if the
+# expected exit status is not 0, this test is skipped.
 m4_define([AT_CHECK_AUTOHEADER],
-[AT_CHECK([autoheader $1], [$2], [$3], [$4])
+[AT_CHECK_M4([autoheader $1], [$3], [$4], [$5])
+m4_if(m4_strip([$2]), [ignore], [],
+  [m4_if(m4_default_nblank([$3], [0]), [0], [dnl
+if test -f config.h.in
+then config_h_in=config.h.in
+elif test -f config.hin
+then config_h_in=config.hin
+else AT_FAIL_IF([: "Cannot find autoheader template file"])
+fi
+m4_set_add_all([ah_expected_tmpls],
+  [PACKAGE_BUGREPORT],
+  [PACKAGE_NAME],
+  [PACKAGE_STRING],
+  [PACKAGE_TARNAME],
+  [PACKAGE_URL],
+  [PACKAGE_VERSION])dnl
+m4_map_args_w([$2],
+  [m4_set_add([ah_expected_tmpls],], [)])dnl
+AT_DATA([expout.in],[m4_set_dump([ah_expected_tmpls],[
 ])
+])
+AT_CHECK([sort -o expout expout.in])
+AT_CHECK([[sed -ne 's/^[       ]*#[    ]*undef[        ][      ]*//p' \
+           $config_h_in | sort]],
+  [0], [expout], [])
+AS_UNSET([config_h_in])
+])])])
 
 
 # AT_CHECK_CONFIGURE(END-COMMAND,
@@ -429,7 +478,7 @@ m4_define([_AT_CHECK_AC_MACRO],
 [AT_CONFIGURE_AC([$1])
 $2
 AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [ignore])
 AT_CHECK_CONFIGURE
 AT_CHECK_ENV
 ])# _AT_CHECK_AC_MACRO
@@ -452,7 +501,7 @@ m4_define([AT_CHECK_MACRO],
 AT_CONFIGURE_AC([m4_default([$2], [$1])])
 
 AT_CHECK_AUTOCONF([m4_default([$4], [-W obsolete])])
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [ignore])
 
 for at_run in r1 r2
 do
@@ -506,7 +555,7 @@ AT_KEYWORDS([autoupdate])
 AT_CONFIGURE_AC([$1])
 
 AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [ignore])
 AT_CHECK_CONFIGURE
 AT_CHECK_ENV
 
@@ -515,7 +564,7 @@ AT_CHECK_AUTOUPDATE([], 0, [], ignore)
 AT_CHECK([grep '^$1$' configure.ac], 1)
 
 AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [ignore])
 AT_CHECK_CONFIGURE
 AT_CHECK_ENV
 
diff --git a/tests/semantics.at b/tests/semantics.at
index a6e2d08b..29c1f749 100644
--- a/tests/semantics.at
+++ b/tests/semantics.at
@@ -183,32 +183,54 @@ AT_DATA([config.in],
 [@LIBOBJS@
 ])
 
+# AC_REPLACE_FUNCS has an AS_LITERAL_IF optimization; test both paths.
+# Manual invocation of AH_TEMPLATE should only be necessary for functions
+# whose names are hidden inside a shell variable at m4 expansion time.
 AT_CONFIGURE_AC(
-[AC_CONFIG_FILES([config.libobjs:config.in])
-AC_REPLACE_FUNCS([printf \
-autoconf_ftnirp])
-funcs='fprintf fopen autoconf_ftnirpf'
-AH_TEMPLATE([HAVE_FOPEN], [])
+[[AC_CONFIG_FILES([config.libobjs:config.in])
+AC_REPLACE_FUNCS([printf autoconf_ftnirp])
+funcs='fprintf autoconf_ftnirpf'
 AH_TEMPLATE([HAVE_FPRINTF], [])
 AH_TEMPLATE([HAVE_AUTOCONF_FTNIRPF], [])
 AC_REPLACE_FUNCS([\
-$funcs])
-AS_UNSET([funcs])])
+$funcs \
+fopen \
+autoconf_nepof])
+AS@&t@_UNSET([funcs])]])
 
-AT_CHECK_AUTOCONF([-W obsolete])
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOCONF([], [], [],
+[[configure.ac:9: warning: AC_REPLACE_FUNCS($funcs): you should use literals
+functions.m4: AC_REPLACE_FUNCS is expanded from...
+configure.ac:9: the top level
+]])
+AT_CHECK_AUTOHEADER([], [
+  HAVE_AUTOCONF_FTNIRP
+  HAVE_AUTOCONF_FTNIRPF
+  HAVE_AUTOCONF_NEPOF
+  HAVE_FOPEN
+  HAVE_FPRINTF
+  HAVE_PRINTF
+], [], [],
+[[configure.ac:9: warning: AC_REPLACE_FUNCS($funcs): you should use literals
+functions.m4: AC_REPLACE_FUNCS is expanded from...
+configure.ac:9: the top level
+]])
 AT_CHECK_CONFIGURE
 AT_CHECK_ENV
 AT_CHECK_DEFINES(
 [/* #undef HAVE_AUTOCONF_FTNIRP */
 /* #undef HAVE_AUTOCONF_FTNIRPF */
+/* #undef HAVE_AUTOCONF_NEPOF */
 #define HAVE_FOPEN 1
 #define HAVE_FPRINTF 1
 #define HAVE_PRINTF 1
 ])
 
-AT_CHECK([sed 's/  */ /g;s/^ //;s/ $//' config.libobjs], [],
-        [${LIBOBJDIR}autoconf_ftnirp$U.o ${LIBOBJDIR}autoconf_ftnirpf$U.o
+AT_CHECK([sed 's/  */ /g;s/^ //;s/ $//' config.libobjs | tr ' ' '
+' | sort], [],
+[${LIBOBJDIR}autoconf_ftnirp$U.o
+${LIBOBJDIR}autoconf_ftnirpf$U.o
+${LIBOBJDIR}autoconf_nepof$U.o
 ])
 
 AT_CLEANUP
@@ -226,7 +248,19 @@ AT_DATA([autoconf_io.h],
 
 AT_CONFIGURE_AC([AC_CHECK_HEADERS(stdio.h autoconf_io.h)])
 AT_CHECK_AUTOCONF([-W obsolete])
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [
+  HAVE_AUTOCONF_IO_H
+  HAVE_INTTYPES_H
+  HAVE_STDINT_H
+  HAVE_STDIO_H
+  HAVE_STDLIB_H
+  HAVE_STRINGS_H
+  HAVE_STRING_H
+  HAVE_SYS_STAT_H
+  HAVE_SYS_TYPES_H
+  HAVE_UNISTD_H
+  STDC_HEADERS
+])
 AT_CHECK_CONFIGURE([CPPFLAGS=-I.])
 AT_CHECK_ENV
 AT_CHECK_DEFINES(
@@ -263,7 +297,7 @@ configure.ac:4: something passes the preprocessor but not 
the compiler,
 configure.ac:4: use AC_PREPROC_IFELSE.)
 configure.ac:4: the top level
 ])
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [HAVE_HEADER2_H])
 AT_CHECK_CONFIGURE([CPPFLAGS=-I.])
 AT_CHECK_ENV
 AT_CHECK_DEFINES(
@@ -295,7 +329,10 @@ AT_CONFIGURE_AC(
 [AC_CHECK_HEADERS(header2.h header3.h, [], [], [[@%:@include "header1.h"]])])
 
 AT_CHECK_AUTOCONF([-W obsolete])
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [
+  HAVE_HEADER2_H
+  HAVE_HEADER3_H
+])
 AT_CHECK_CONFIGURE([CPPFLAGS=-I.])
 AT_CHECK_ENV
 AT_CHECK_DEFINES(
@@ -602,7 +639,19 @@ _AT_CHECK_AC_MACRO(
 # containing "WORDS_BIGENDIAN".
 AT_CONFIGURE_AC([[AC_C_BIGENDIAN]])
 # --force is necessary, the computer might be too fast.
-AT_CHECK_AUTOHEADER([--force])
+AT_CHECK_AUTOHEADER([--force], [
+  AC_APPLE_UNIVERSAL_BUILD
+  HAVE_INTTYPES_H
+  HAVE_STDINT_H
+  HAVE_STDLIB_H
+  HAVE_STRINGS_H
+  HAVE_STRING_H
+  HAVE_SYS_STAT_H
+  HAVE_SYS_TYPES_H
+  HAVE_UNISTD_H
+  STDC_HEADERS
+  WORDS_BIGENDIAN
+])
 AT_CHECK([grep WORDS_BIGENDIAN config.hin], [], [ignore])
 
 AT_CLEANUP
diff --git a/tests/tools.at b/tests/tools.at
index 9d3c7183..7341811a 100644
--- a/tests/tools.at
+++ b/tests/tools.at
@@ -708,7 +708,7 @@ AC_CONFIG_HEADERS(config.h:config.hin)
 AC_DEFINE(this, "whatever you want.")
 ]])
 
-AT_CHECK_AUTOHEADER([], [], [], [ignore])
+AT_CHECK_AUTOHEADER([], [this], [0], [], [ignore])
 AT_CHECK([cat config.hin], 0,
 [[/* config.hin.  Generated from configure.ac by autoheader.  */
 /* Define this to whatever you want. */
@@ -743,7 +743,7 @@ AC_DEFINE(that, "whatever you want.")
 
 # The test suite goes too fast for the cache timestamps...
 # Pass --force.
-AT_CHECK_AUTOHEADER([--force], [1], [], [ignore])
+AT_CHECK_AUTOHEADER([--force], [], [1], [], [ignore])
 
 
 # 3. Check TOP and BOTTOM.
@@ -776,7 +776,7 @@ AC_DEFINE([ANT], [@], [The Ant in a h@t.])
 # together.
 # Ignore STDERR which is the longish complaint against autoheader junk
 # files.
-AT_CHECK_AUTOHEADER([--force], [], [], [ignore])
+AT_CHECK_AUTOHEADER([--force], [ANT], [], [], [ignore])
 AT_CHECK([cat config.hin], 0,
 [[/* config.hin.  Generated from configure.ac by autoheader.  */
 /* Top from acconfig.h. */
@@ -839,7 +839,7 @@ AC_OUTPUT
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [OPENSESAME SIMSALABIM])
 AT_CHECK([grep -c SIMSALABIM configure config.h.in], [0],
 [[configure:1
 config.h.in:1
@@ -877,7 +877,7 @@ AC_OUTPUT
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [SEAN])
 AT_CHECK([grep HANNA configure], [0], [ignore], [ignore])
 AT_CHECK([grep HANNA config.h.in], [1], [ignore], [ignore])
 AT_CHECK([grep SEAN configure], [0], [ignore], [ignore])
diff --git a/tests/torture.at b/tests/torture.at
index 5bc740ab..b50dfebc 100644
--- a/tests/torture.at
+++ b/tests/torture.at
@@ -716,7 +716,9 @@ AC_OUTPUT
 ]])# configure.ac
 
 AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([],
+  m4_for(AT_Count, 1, 100, 1, [ AT_DUMMY_VAR(AT_Count)]))
+
 # Check both awk and the result of AC_PROG_AWK.
 # Quote the first word in the for list for Solaris sh.
 for awk_arg in "FOO=" AWK=awk; do
@@ -864,7 +866,7 @@ AC_DEFINE([fooq], ]m4_for([n], 1, 100,, 
....................)[, [desc])
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [foo fooq])
 AT_CHECK_CONFIGURE
 AT_CHECK_DEFINES([@%:@define foo m4_for([n], 1, 100,, ....................)
 @%:@define fooq m4_for([n], 1, 100,, ....................)
@@ -946,7 +948,8 @@ AC_PROG_AWK
 AC_CONFIG_FILES([Foo Zardoz])]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([],
+   [foo fooq bar barq unq1 unq2 unq2 unq3 unq4 unq5 unq6 unq7])
 # Check both awk and the result of AC_PROG_AWK
 # Quote the first word in the for list for Solaris sh.
 for awk_arg in "FOO=" AWK=awk; do
@@ -1038,7 +1041,7 @@ AT_CHECK([[sed 's/^configure.ac:[45]: //' stderr]], [],
 [[warning: AC_DEFINE: `one
 two' is not a valid preprocessor define value
 ]])
-AT_CHECK_AUTOHEADER([], [], [], [stderr])
+AT_CHECK_AUTOHEADER([], [foo], [], [], [stderr])
 AT_CHECK([[sed 's/^configure.ac:[45]: //' stderr]], [],
 [[warning: AC_DEFINE: `one
 two' is not a valid preprocessor define value
@@ -1055,7 +1058,7 @@ AT_CHECK([[sed 's/^configure.ac:[45]: //' stderr]], [],
 [[warning: AC_DEFINE_UNQUOTED: `one
 two' is not a valid preprocessor define value
 ]])
-AT_CHECK_AUTOHEADER([], [], [], [stderr])
+AT_CHECK_AUTOHEADER([], [foo], [], [], [stderr])
 AT_CHECK([[sed 's/^configure.ac:[45]: //' stderr]], [],
 [[warning: AC_DEFINE_UNQUOTED: `one
 two' is not a valid preprocessor define value
-- 
2.26.0.rc2




reply via email to

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