Prefer HTTPS to FTP and HTTP
[autoconf.git] / tests / tools.at
bloba4a7dd77b9b68ef0547b138f2c9e52bd7952eb76
1 #                                                       -*- Autotest -*-
3 AT_BANNER([Executables (autoheader, autoupdate...).])
5 # Copyright (C) 2000-2001, 2003-2004, 2006-2017 Free Software
6 # Foundation, Inc.
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
22 ## ----------------------------- ##
23 ## Syntax of the shell scripts.  ##
24 ## ----------------------------- ##
26 # We use `/bin/sh -n script' to check that there are no syntax errors
27 # in the scripts.  Although incredible, there are /bin/sh that go into
28 # endless loops with `-n', e.g., SunOS's:
30 #   $ uname -a
31 #   SunOS ondine 4.1.3 2 sun4m unknown
32 #   $ cat endless.sh
33 #   while false
34 #   do
35 #     :
36 #   done
37 #   exit 0
38 #   $ time sh endless.sh
39 #   sh endless.sh  0,02s user 0,03s system 78% cpu 0,064 total
40 #   $ time sh -nx endless.sh
41 #   ^Csh -nx endless.sh  3,67s user 0,03s system 63% cpu 5,868 total
43 # So before using `/bin/sh -n' to check our scripts, we first check
44 # that `/bin/sh -n' is not broken to death.
46 AT_SETUP([Syntax of the shell scripts])
48 AT_CHECK([test "$ac_cv_sh_n_works" = yes || exit 77])
50 # Specify the absolute name of the tool, as some shells don't honor PATH when
51 # running `sh PROG'.
53 AT_CHECK_SHELL_SYNTAX(["$abs_top_builddir/bin/autoconf"])
54 AT_CHECK_SHELL_SYNTAX(["$abs_top_builddir/tests/autoconf"])
55 AT_CHECK_SHELL_SYNTAX(["$abs_top_builddir/tests/testsuite"])
57 # These are not built, they are in the src tree.
58 AT_CHECK_SHELL_SYNTAX(["$abs_top_srcdir/build-aux/install-sh"])
59 AT_CHECK_SHELL_SYNTAX(["$abs_top_srcdir/build-aux/missing"])
61 AT_CLEANUP
66 ## ---------------------------- ##
67 ## Syntax of the Perl scripts.  ##
68 ## ---------------------------- ##
70 AT_SETUP([Syntax of the Perl scripts])
72 AT_CHECK_PERL_SYNTAX([autoheader])
73 AT_CHECK_PERL_SYNTAX([autom4te])
74 AT_CHECK_PERL_SYNTAX([autoreconf])
75 AT_CHECK_PERL_SYNTAX([autoscan])
76 AT_CHECK_PERL_SYNTAX([autoupdate])
77 AT_CHECK_PERL_SYNTAX([ifnames])
79 AT_CLEANUP
84 ## ------------------ ##
85 ## autom4te's cache.  ##
86 ## ------------------ ##
88 AT_SETUP([autom4te cache])
90 AT_DATA_M4SUGAR([[script.4s]],
91 [[m4_include([foo])
92 ]])
94 # Everything is OK.
95 touch foo
96 AT_CHECK_M4SUGAR
98 # We moved a file: it should fail
99 mkdir sub
100 mv foo sub
101 AT_CHECK_M4SUGAR([], [1], [],
102 [m4:script.4s:1: cannot open `foo': No such file or directory
103 autom4te: m4 failed with exit status: 1
106 # But if we change the main file, then we should no longer complain of
107 # missing files.
108 AT_DATA_M4SUGAR([[script.4s]],
109 [[m4_include([sub/foo])
111 AT_CHECK_M4SUGAR
113 AT_CLEANUP
116 # autom4te --force
117 # ----------------
119 AT_SETUP([autom4te --force])
121 AT_DATA([file.m4],
122 [[right
124 AT_CHECK_AUTOM4TE([-o file file.m4])
126 # Create a file whose timestamp is in the future.
127 # (next year)-01-01 00:01 UTC should always be in the future,
128 # even on slow machines.
129 echo BAD >file
130 this_year=`TZ=UTC0 date +%Y`
131 AS_VAR_ARITH([next_year], [$this_year + 1])
132 TZ=UTC0 touch -t ${next_year}01010001 file
134 AT_CHECK_AUTOM4TE([--force -o file file.m4])
135 AT_CHECK([cat file], 0,
136 [[right
139 AT_CLEANUP
142 # autom4te and file names containing whitespace
143 # ---------------------------------------------
145 AT_SETUP([autom4te and whitespace in file names])
148 export x
149 rm -f a b
150 for funny in \
151   'with  funny '\'' $x & #! name' \
152   'with  funny \ '\'' \'\'' " <a >b * ? name ' # "restore font-lock
154   funny=`func_sanitize_file_name "$funny"`
155   file=" file $funny"
156   outfile="$file out "
157   dir=`func_sanitize_dir_name " dir $funny"`
158   cachedir=" cache$dir"
159   TMPDIR=" tmp$dir"
160   export TMPDIR
162   # skip if we cannot create such a file or directory
163   AT_CHECK([mkdir "$dir" "$cachedir" "$TMPDIR" && touch "$file" || exit 77])
165   cat >"$file" <<'END'
166 [m4@&t@_init[]m4@&t@_include(foo.m4)
167 m4@&t@_divert([])d@&t@nl
168 FOO]
170   cat >"$dir"/foo.m4 <<'END'
171 [m4@&t@_define([FOO], [bar])]
174   AT_CHECK_AUTOM4TE([-C "$cachedir" -B "$dir" --language=m4sugar -o "$outfile" "$file"])
175   AT_CHECK([cat "$outfile"], [],
176   [[bar
178   rm -rf "$outfile" "$cachedir"
179   AT_CHECK_AUTOM4TE([-C "$cachedir" -I "$dir" --language=m4sugar -o "$outfile" "$file"])
180   AT_CHECK([cat "$outfile"], [],
181   [[bar
184   # This exercises a slightly different code path and will catch an open with
185   # trailing whitespace:
186   cat >"$file" <<'END'
187 [m4@&t@_init[]m4@&t@_include(foo.m4)
188 m4@&t@_pattern_forbid([^bar$])
189 m4@&t@_divert([])d@&t@nl
190 FOO]
192   rm -rf "$outfile" "$cachedir"
193   AT_CHECK_AUTOM4TE([-C "$cachedir" -I "$dir" --language=m4sugar -o "$outfile" "$file"],
194                     [1], [], [stderr])
195   AT_CHECK([grep 'possibly undefined macro' stderr], [], [ignore])
197   cat >"$file" <<'END'
198 [m4@&t@_init[]m4@&t@_include(foo.m4)
199 m4@&t@_divert([])d@&t@nl]
201   rm -rf "$file.m4f"
202   AT_CHECK_AUTOM4TE([-C "$cachedir" -I "$dir" --language=m4sugar --freeze -o "$file.m4f" "$file"])
203   AT_CHECK([test -s "$file.m4f"])
205   # Check --reload-state
206   AT_CHECK_AUTOM4TE([-C "$cachedir" --language=m4sugar -o "$outfile" "$file.m4f" /dev/null])
208   test ! -f b
209 done
211 AT_CLEANUP
214 # autom4te --trace and unusual macro names
215 # ----------------------------------------
217 AT_SETUP([autom4te --trace and unusual macro names])
219 AT_DATA([file.m4],
222 AT_CHECK_AUTOM4TE([-t 'TR A CE' -t 'TR(A)CE' file.m4])
224 AT_CLEANUP
227 AT_SETUP([autom4te --trace and whitespace])
229 dnl line numbering differs between m4 1.4.6 and 1.4.13 if we don't
230 dnl go through a single line wrapper
231 AT_DATA_M4SUGAR([file.m4],
232 [[m4_define([foo], [m4_echo([  a
233 b       c  ], [\
235 ])])
238 AT_CHECK_AUTOM4TE([--language=m4sugar -t 'm4@&t@_echo' file.m4], [0],
239 [[file.m4:5:m4@&t@_echo: a b c :d
242 AT_CLEANUP
245 ## ------------------ ##
246 ## autoconf --trace.  ##
247 ## ------------------ ##
250 # autoconf --trace: user macros
251 # -----------------------------
252 AT_SETUP([autoconf --trace: user macros])
254 AT_DATA([configure.ac],
255 [[m4_define([active], [ACTIVE])
256 m4_define([TRACE1], [TRACE2(m4_shift($@))])
257 m4_define([TRACE2], [[$2], $1])
259 # No arguments.
260 TRACE1
261 TRACE2
263 # With arguments, single line.
264 TRACE1(foo, @bar, @baz)
265 TRACE1(foo, TRACE1(bar, baz))
266 TRACE1(foo, active, baz)
267 TRACE1(foo, [active], TRACE1(active, [active]))
270 # Several --traces.
271 AT_CHECK_AUTOCONF([-t TRACE1 -t TRACE2], 0,
272 [[configure.ac:6:TRACE1:
273 configure.ac:6:TRACE2:
274 configure.ac:7:TRACE2:
275 configure.ac:10:TRACE1:foo:@bar:@baz
276 configure.ac:10:TRACE2:@bar:@baz
277 configure.ac:11:TRACE1:bar:baz
278 configure.ac:11:TRACE2:baz
279 configure.ac:11:TRACE1:foo::baz
280 configure.ac:11:TRACE2::baz
281 configure.ac:12:TRACE1:foo:ACTIVE:baz
282 configure.ac:12:TRACE2:ACTIVE:baz
283 configure.ac:13:TRACE1:ACTIVE:active
284 configure.ac:13:TRACE2:active
285 configure.ac:13:TRACE1:foo:active::ACTIVE
286 configure.ac:13:TRACE2:active::ACTIVE
289 # Several line requests.
290 AT_CHECK_AUTOCONF([[-t TRACE1:'
291 [$1], [$2], [$3].']], 0,
293 [], [], [].
295 [foo], [@bar], [@baz].
297 [bar], [baz], [].
299 [foo], [], [baz].
301 [foo], [ACTIVE], [baz].
303 [ACTIVE], [active], [].
305 [foo], [active], [].
308 # ${sep}@.
309 AT_CHECK_AUTOCONF([-t TRACE2:'${)===(}@'], 0,
310 [[[]
312 [@bar])===([@baz]
313 [baz]
314 [])===([baz]
315 [ACTIVE])===([baz]
316 [active]
317 [active])===([])===([ACTIVE]
320 # Arguments spanning multiple lines.
321 AT_DATA([configure.ac],
322 [[m4_define([TRACE], [])
323 TRACE(foo
324 bar,
326 foo)
329 AT_CHECK_AUTOCONF([-t TRACE:'$%'], 0,
330 [[foo bar:bar foo
333 AT_CLEANUP
336 # autoconf --trace: builtins
337 # --------------------------
338 AT_SETUP([autoconf --trace: builtins])
340 AT_DATA([configure.ac],
341 [[define([active], [ACTIVE])
344 AT_CHECK_AUTOCONF([[-t define | sed -n '$p']],
345          0,
346 [[configure.ac:1:define:active:ACTIVE
349 # FIXME: Without `$1' the following test dies.  Groumphf, once again to
350 # dive into obscure feature interaction...
351 # Note that using `-i' means we need the *.m4 files, not the *.m4f files,
352 # hence we need srcdir, not builddir.
353 AT_CHECK_AUTOCONF([[-t define:'$1' -i| sed -n '$p']],
354          0,
355 [[active
358 AT_CLEANUP
361 # autoconf --trace: AC_CONFIG_MACRO_DIRS
362 # --------------------------------------
363 AT_SETUP([autoconf --trace: AC_CONFIG_MACRO_DIRS])
364 AT_KEYWORDS([AC_CONFIG_MACRO_DIR AC_CONFIG_MACRO_DIR_TRACE])
366 AT_DATA([configure.ac],
367 [[AC_INIT
368 AC_CONFIG_MACRO_DIR([dir1])
369 AC_CONFIG_MACRO_DIRS([dir2 dir3 \
370 dir4])
371 AC_CONFIG_MACRO_DIRS([dir5])
374 # Legacy tracing
375 AT_CHECK_AUTOCONF([-t AC_CONFIG_MACRO_DIR], 0,
376 [[configure.ac:2:AC_CONFIG_MACRO_DIR:dir1
379 # Preferred tracing
380 AT_CHECK_AUTOCONF([-t AC_CONFIG_MACRO_DIR_TRACE], 0,
381 [[configure.ac:2:AC_CONFIG_MACRO_DIR_TRACE:dir1
382 configure.ac:3:AC_CONFIG_MACRO_DIR_TRACE:dir2
383 configure.ac:3:AC_CONFIG_MACRO_DIR_TRACE:dir3
384 configure.ac:3:AC_CONFIG_MACRO_DIR_TRACE:dir4
385 configure.ac:5:AC_CONFIG_MACRO_DIR_TRACE:dir5
388 # Legacy macro can only be used once
389 AT_DATA([configure.ac],
390 [[AC_INIT
391 AC_CONFIG_MACRO_DIR([dir1])
392 AC_CONFIG_MACRO_DIR([dir2])
394 AT_CHECK_AUTOCONF([], [1], [], [stderr])
395 AT_CHECK([grep 'error: AC_CONFIG_MACRO_DIR can only be used once' stderr],
396 [], [ignore])
398 # Legacy macro must be used first, if present
399 AT_DATA([configure.ac],
400 [[AC_INIT
401 AC_CONFIG_MACRO_DIRS([dir1])
402 AC_CONFIG_MACRO_DIR([dir2])
404 AT_CHECK_AUTOCONF([], [1], [], [stderr])
405 AT_CHECK([grep 'error: AC_CONFIG_MACRO_DIR can only be used once' stderr],
406 [], [ignore])
408 # Only use the public macros
409 AT_DATA([configure.ac],
410 [[AC_INIT
411 AC_CONFIG_MACRO_DIR_TRACE([dir1])
413 AT_CHECK_AUTOCONF([], [1], [],
414 [[configure.ac:2: error: Do not invoke AC_CONFIG_MACRO_DIR_TRACE directly
415 configure.ac:2: the top level
416 autom4te: m4 failed with exit status: 1
419 # Legacy macro use is not required, but still gets traced
420 AT_DATA([configure.ac],
421 [[AC_INIT
422 AC_CONFIG_MACRO_DIRS([dir1])
423 AC_CONFIG_MACRO_DIRS([dir2])
425 AT_CHECK_AUTOCONF([], [0], [], [])
426 AT_CHECK_AUTOCONF([-t AC_CONFIG_MACRO_DIR], [0],
427 [[configure.ac:2:AC_CONFIG_MACRO_DIR:dir1
430 AT_CLEANUP
433 ## ---------------------------- ##
434 ## autoconf: forbidden tokens.  ##
435 ## ---------------------------- ##
438 # autoconf: forbidden tokens, basic
439 # ---------------------------------
440 AT_SETUP([autoconf: forbidden tokens,[] basic])
442 AT_DATA_M4SH([configure.ac],
443 [[AS_INIT
444 m4_foo
445 _m4_bar
446 AS_FOO
447 _AS_BAR
448 [dnl]
451 dnl This test needs autom4te's cache, in spite of any ~/.autom4te.cfg.
452 AT_DATA([.autom4te.cfg], [[
453 begin-language: "Autoconf"
454 args: --cache=autom4te.cache
455 end-language: "Autoconf"
456 begin-language: "Autoconf-without-aclocal-m4"
457 args: --cache=autom4te.cache
458 end-language: "Autoconf-without-aclocal-m4"
461 AT_CHECK_AUTOCONF([], 1, [],
462 [[configure.ac:2: error: possibly undefined macro: m4@&t@_foo
463       If this token and others are legitimate, please use m4@&t@_pattern_allow.
464       See the Autoconf documentation.
465 configure.ac:3: error: possibly undefined macro: _m4@&t@_bar
466 configure.ac:4: error: possibly undefined macro: AS@&t@_FOO
467 configure.ac:5: error: possibly undefined macro: _AS@&t@_BAR
468 configure.ac:6: error: possibly undefined macro: d@&t@nl
470 # Second run should succeed and yield no output.
471 AT_CHECK([autoconf])
473 AT_CLEANUP
476 # autoconf: forbidden tokens, exceptions
477 # --------------------------------------
478 AT_SETUP([autoconf: forbidden tokens,[] exceptions])
480 AT_DATA_M4SH([configure.ac],
481 [[AS_INIT
483 # This is allowed in spite of the name.
484 # It is on purpose that we check the case where there are several
485 # tokens on the same line.
486 m4_pattern_allow([^AS_ALLOWED$])
487 NOT_AS_ALLOWED AS_ALLOWED AS_ALLOWED_NOT
489 # Test forbidding.
490 m4_pattern_forbid([^FORBIDDEN$])
491 NOT_FORBIDDEN FORBIDDEN FORBIDDEN_NOT
493 # Test Autoconf's patterns.
494 AS_THIS_IS_INVALID and _AS_THIS_IS_INVALID_TOO
495 BUT_AZ_THIS_IS_NOT ALTHOUGH_AS_THIS_IS
496 # This is legal, although there is `AS_DEFINE' in there.
497 BAS_DEFINE
498 # AS_THIS_IS_A_COMMENT so just shut up.
499 It would be very bad if Autoconf forgot to expand [AS_]INIT!
502 AT_CHECK_AUTOCONF([], 1, [],
503 [[configure.ac:1: error: possibly undefined macro: AS@&t@_INIT
504       If this token and others are legitimate, please use m4@&t@_pattern_allow.
505       See the Autoconf documentation.
506 configure.ac:7: error: possibly undefined macro: AS@&t@_ALLOWED_NOT
507 configure.ac:10: error: possibly undefined macro: FORBIDDEN
508 configure.ac:14: error: possibly undefined macro: AS@&t@_THIS_IS_INVALID
509 configure.ac:14: error: possibly undefined macro: _AS@&t@_THIS_IS_INVALID_TOO
512 AT_CLEANUP
515 # autoconf: automatically allowed tokens
516 # --------------------------------------
517 AT_SETUP([autoconf: automatically allowed tokens])
519 AT_DATA_M4SH([configure.ac],
520 [[AC_INIT
521 m4_pattern_forbid([^FB_])
522 AC_DEFINE([FB_ONE])
523 AC_SUBST([FB_TWO])
524 AC_OUTPUT
527 AT_CHECK_AUTOCONF
529 AT_CLEANUP
532 # autoconf: do not forbid the empty token
533 # ---------------------------------------
534 AT_SETUP([autoconf: the empty token])
536 AT_DATA_M4SH([configure.ac],
537 [[m4_init[]m4_pattern_allow([^foo$])
538 m4_divert([])dnl
539  line that begins with a space
542 AT_CHECK_AUTOCONF
544 AT_CLEANUP
547 # autoconf: subdirectories
548 # ------------------------
549 AT_SETUP([autoconf: subdirectories])
551 AT_DATA([configure.ac],
552 [[AC_INIT
553 AC_PROG_MKDIR_P
554 AC_CONFIG_FILES(sub/foo)
555 AC_OUTPUT
558 mkdir sub
560 AT_DATA([sub/foo.in],
561 [[@MKDIR_P@
564 AT_DATA([install-sh])
566 AT_CHECK_AUTOCONF
567 AT_CHECK_CONFIGURE
568 AT_CHECK([[grep '^[^/].*/mkdir -p' sub/foo]], 1)
570 AT_CLEANUP
573 # autoconf: input from stdin
574 # --------------------------
575 AT_SETUP([autoconf: input from stdin])
577 # Past Autoconf versions failed to read from stdin when other, non-frozen input
578 # files were present.
579 AT_DATA([aclocal.m4])
581 AT_CHECK([echo 'AC_INIT(X, 1.0, bug-autoconf@gnu.org)' | autoconf -t AC_INIT -],
582          0, [stdin:1:AC_INIT:X:1.0:bug-autoconf@gnu.org
584 AT_CHECK([echo 'AC_INIT(X, 2.0, bug-autoconf@gnu.org)' | autoconf -t AC_INIT -],
585          0, [stdin:1:AC_INIT:X:2.0:bug-autoconf@gnu.org
588 AT_CLEANUP
591 # autoconf: AC_AUTOCONF_VERSION
592 # -----------------------------
593 AT_SETUP([autoconf: AC_AUTOCONF_VERSION])
595 AT_DATA([configure.ac],
596 [[AC_INIT
597 version m4@&t@_defn([AC_AUTOCONF_VERSION]) version
598 AC_OUTPUT
601 AT_CHECK_AUTOCONF
602 AT_CHECK([[grep 'version ]]AT_PACKAGE_VERSION[[ version' configure]],
603 0, [ignore])
605 AT_CLEANUP
609 # autoconf: AC_PRESERVE_HELP_ORDER
610 # --------------------------------
611 AT_SETUP([autoconf: AC_PRESERVE_HELP_ORDER])
612 AT_KEYWORDS([m4@&t@_divert_text])
614 AT_DATA_AUTOCONF([configure.ac],
615 [[AC_INIT
616 AC_PRESERVE_HELP_ORDER
617 AC_ARG_WITH([one], [  --with-one])
618 AC_ARG_ENABLE([two], [  --enable-two])
619 m4_divert_text([HELP_ENABLE], [arbitrary $text])
620 AC_ARG_WITH([three], [  --with-three])
621 AC_OUTPUT
624 AT_CHECK_AUTOCONF
625 AT_CHECK_CONFIGURE([--help], [], [stdout])
626 AT_CHECK([sed -n '/^Optional/,/^$/p' stdout], [],
627 [[Optional Features and Packages:
628   --disable-option-checking  ignore unrecognized --enable/--with options
629   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
630   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
631   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
632   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
633   --with-one
634   --enable-two
635 arbitrary $text
636   --with-three
640 AT_CLEANUP
644 ## --------- ##
645 ## ifnames.  ##
646 ## --------- ##
648 AT_SETUP([ifnames])
650 AT_DATA([iftest1.c],
651 [[#ifdef DEF1
652 #ifndef DEF2
653 #if ! defined DEF3 && defined DEF4 /* but not defined DEF5 */
654     # if SPACES
655         #       if      TABS
656 /* #if C_COMMENTS */
657 // #if CXX_COMMENTS
658 #if LINE1 = \
659 LINE2
660 #if (VAL1*VAL2)==VAL3+VAL4 /* Not VAL5 !!! */
663 AT_DATA([iftest2.c],
664 [[#ifdef IFTEST2
665 #if VAL1
668 AT_CHECK([ifnames iftest1.c iftest2.c], 0,
669 [DEF1 iftest1.c
670 DEF2 iftest1.c
671 DEF3 iftest1.c
672 DEF4 iftest1.c
673 IFTEST2 iftest2.c
674 LINE1 iftest1.c
675 LINE2 iftest1.c
676 SPACES iftest1.c
677 TABS iftest1.c
678 VAL1 iftest1.c iftest2.c
679 VAL2 iftest1.c
680 VAL3 iftest1.c
681 VAL4 iftest1.c
682 ], [])
684 AT_CLEANUP
688 ## ------------ ##
689 ## autoheader.  ##
690 ## ------------ ##
692 # autoheader is intensively used in its modern form throughout this
693 # test suite.  But we also have to check that acconfig.h still works.
694 # autoheader uses autoconf --trace, so traces first.
696 AT_SETUP([autoheader])
698 AT_DATA([acconfig.h],
699 [[/* Define this to whatever you want. */
700 #undef this
704 # 1. Check that `acconfig.h' is still honored.
705 AT_DATA([configure.ac],
706 [[AC_INIT
707 AC_CONFIG_HEADERS(config.h:config.hin)
708 AC_DEFINE(this, "whatever you want.")
711 AT_CHECK_AUTOHEADER([], [], [], [ignore])
712 AT_CHECK([cat config.hin], 0,
713 [[/* config.hin.  Generated from configure.ac by autoheader.  */
714 /* Define this to whatever you want. */
715 #undef this
717 /* Define to the address where bug reports for this package should be sent. */
718 #undef PACKAGE_BUGREPORT
720 /* Define to the full name of this package. */
721 #undef PACKAGE_NAME
723 /* Define to the full name and version of this package. */
724 #undef PACKAGE_STRING
726 /* Define to the one symbol short name of this package. */
727 #undef PACKAGE_TARNAME
729 /* Define to the home page for this package. */
730 #undef PACKAGE_URL
732 /* Define to the version of this package. */
733 #undef PACKAGE_VERSION
737 # 2. Check that missing templates are a fatal error.
738 AT_DATA([configure.ac],
739 [[AC_INIT
740 AC_CONFIG_HEADERS(config.h:config.hin)
741 AC_DEFINE(that, "whatever you want.")
744 # The test suite goes too fast for the cache timestamps...
745 # Pass --force.
746 AT_CHECK_AUTOHEADER([--force], [1], [], [ignore])
749 # 3. Check TOP and BOTTOM.
750 AT_DATA([acconfig.h],
751 [[/* Top from acconfig.h. */
752 @TOP@
753 /* Middle from acconfig.h. */
754 @BOTTOM@
755 /* Bottom from acconfig.h. */
758 AT_DATA([configure.ac],
759 [[AC_INIT
760 AC_CONFIG_HEADERS(config.h:config.hin)
761 AH_TOP([Top1 from configure.ac.])
762 AH_TOP([Top2 from configure.ac.])
763 AH_TOP([The Cat in a h@t.])
764 AH_VERBATIM([Middle], [Middle from configure.ac.])
765 AH_VERBATIM([Mouse],  [The Mouse in a h@t.])
766 AH_BOTTOM([Bottom1 from configure.ac.])
767 AH_BOTTOM([Bottom2 from configure.ac.])
768 AH_BOTTOM([The Dog in a h@t.])
770 AC_DEFINE([ANT], [@], [The Ant in a h@t.])
774 # Yes, that's right: the `middle' part of `acconfig.h' is still before
775 # the AH_TOP part.  But so what, you're not supposed to use the two
776 # together.
777 # Ignore STDERR which is the longish complaint against autoheader junk
778 # files.
779 AT_CHECK_AUTOHEADER([--force], [], [], [ignore])
780 AT_CHECK([cat config.hin], 0,
781 [[/* config.hin.  Generated from configure.ac by autoheader.  */
782 /* Top from acconfig.h. */
783 /* Middle from acconfig.h. */
785 Top1 from configure.ac.
787 Top2 from configure.ac.
789 The Cat in a h@t.
791 /* The Ant in a h@t. */
792 #undef ANT
794 Middle from configure.ac.
796 The Mouse in a h@t.
798 /* Define to the address where bug reports for this package should be sent. */
799 #undef PACKAGE_BUGREPORT
801 /* Define to the full name of this package. */
802 #undef PACKAGE_NAME
804 /* Define to the full name and version of this package. */
805 #undef PACKAGE_STRING
807 /* Define to the one symbol short name of this package. */
808 #undef PACKAGE_TARNAME
810 /* Define to the home page for this package. */
811 #undef PACKAGE_URL
813 /* Define to the version of this package. */
814 #undef PACKAGE_VERSION
816 Bottom1 from configure.ac.
818 Bottom2 from configure.ac.
820 The Dog in a h@t.
821 /* Bottom from acconfig.h. */
824 AT_CLEANUP
827 # autoheader should see through m4 macros, just like autoconf
828 # https://lists.gnu.org/archive/html/bug-autoconf/2009-06/msg00000.html
829 AT_SETUP([autoheader and macros])
831 AT_DATA([configure.ac],
832 [[AC_INIT
833 AC_CONFIG_HEADER([config.h])
834 m4_define([PETER], [SIMSALABIM])
835 m4_define([PAUL], [OPENSESAME])
836 AC_DEFINE([PETER], [10], [Peter's public info])
837 AC_DEFINE_UNQUOTED([PAUL], [`expr 4 + 6`], [Paul's public info])
838 AC_OUTPUT
841 AT_CHECK_AUTOCONF
842 AT_CHECK_AUTOHEADER
843 AT_CHECK([grep -c SIMSALABIM configure config.h.in], [0],
844 [[configure:1
845 config.h.in:1
847 AT_CHECK([grep -c OPENSESAME configure config.h.in], [0],
848 [[configure:1
849 config.h.in:1
851 AT_CHECK([grep -c PETER configure config.h.in], [1],
852 [[configure:0
853 config.h.in:0
855 AT_CHECK([grep -c PAUL configure config.h.in], [1],
856 [[configure:0
857 config.h.in:0
860 AT_CLEANUP
863 # autoheader should take all config header inputs into account when
864 # checking for missing templates.
865 AT_SETUP([autoheader with multiple headers])
867 AT_DATA([config-extra.h.in],
868 [[/* Define this to whatever you want. */
869 #undef HANNA
871 AT_DATA([configure.ac],
872 [[AC_INIT
873 AC_CONFIG_HEADERS([config.h config-extra.h])
874 AC_DEFINE([HANNA], ["Hanna"])
875 AC_DEFINE([SEAN], ["Sean"], [Sean's name])
876 AC_OUTPUT
879 AT_CHECK_AUTOCONF
880 AT_CHECK_AUTOHEADER
881 AT_CHECK([grep HANNA configure], [0], [ignore], [ignore])
882 AT_CHECK([grep HANNA config.h.in], [1], [ignore], [ignore])
883 AT_CHECK([grep SEAN configure], [0], [ignore], [ignore])
884 AT_CHECK([grep SEAN config.h.in], [0], [ignore], [ignore])
886 AT_CLEANUP
890 ## ------------ ##
891 ## autoupdate.  ##
892 ## ------------ ##
894 # Check that AC_CANONICAL_SYSTEM and AC_OUTPUT are properly updated.
895 AT_SETUP([autoupdate])
897 AT_DATA([configure.ac],
898 [[AC_INIT(Test, 1.0)
899 AC_CANONICAL_SYSTEM
900 # The doc says 27 is a valid fubar.
901 fubar=27
902 AC_OUTPUT(Makefile, echo $fubar, fubar=$fubar)
905 AT_DATA([expout],
906 [[AC_INIT([Test],[1.0])
907 AC_CANONICAL_TARGET
908 # The doc says 27 is a valid fubar.
909 fubar=27
910 AC_CONFIG_FILES([Makefile])
911 AC_CONFIG_COMMANDS([default],[echo $fubar],[fubar=$fubar])
912 AC_OUTPUT
915 # Checking `autoupdate'.
916 AT_CHECK_AUTOUPDATE
917 AT_CHECK([cat configure.ac], 0, [expout])
918 # Checking that `autoupdate' is idempotent
919 AT_CHECK_AUTOUPDATE
920 AT_CHECK([cat configure.ac], 0, [expout])
922 AT_CLEANUP
925 # autoupdating AC_LINK_FILES
926 # --------------------------
927 AT_SETUP([autoupdating AC_LINK_FILES])
929 AT_DATA([configure.ac],
930 [[AC_INIT
931 AC_LINK_FILES(dst1 dst2, src1 src2)
932 AC_OUTPUT
935 AT_DATA([dst1], dst1
937 AT_DATA([dst2], dst2
940 # Checking `autoupdate'.
941 AT_CHECK_AUTOUPDATE([], 0, [], ignore)
942 AT_CHECK_AUTOCONF
943 AT_CHECK_CONFIGURE
944 AT_CHECK([cat src1], 0, [dst1
946 AT_CHECK([cat src2], 0, [dst2
949 AT_CLEANUP
952 # autoupdating AC_PREREQ
953 # ----------------------
954 AT_SETUP([autoupdating AC_PREREQ])
956 # Produce `AC_PREREQ(<AUTOUPDATE VERSION>)'.
957 AT_CHECK([autoupdate --version | sed 's/.*) //;q'], 0, [stdout])
958 autoupdate_version=`cat stdout`
959 [echo "AC_PREREQ([$autoupdate_version])" >expout]
961 AT_CHECK([echo "AC_PREREQ(1.0)" | autoupdate -],
962          0, [expout], [])
964 AT_CHECK([echo "AC_PREREQ($autoupdate_version)" | autoupdate -],
965          0, [expout], [])
967 AT_CHECK([echo "AC_PREREQ(999.99)" | autoupdate -],
968          63, [], [ignore])
970 AT_CLEANUP
973 # autoupdating AU_ALIAS
974 # ---------------------
975 AT_SETUP([autoupdating AU_ALIAS])
977 AT_DATA([configure.ac],
978 [[AC_INIT
979 AC_DEFUN([FOO], [$#])
980 AU_ALIAS([BAZ],[FOO])
981 test "FOO:FOO():FOO(x) BAZ:BAZ():BAZ(x)" = "0:1:1 0:1:1" || exit 1
982 AC_PROG_CC
983 AC_WORDS_BIGENDIAN
984 AC_OUTPUT
987 # Checking `autoupdate'.
988 AT_CHECK_AUTOUPDATE
989 AT_CHECK_AUTOCONF
990 AT_CHECK_CONFIGURE
991 AT_CHECK([grep 'AC_C_BIGENDIAN[(]' configure.ac], 1, [ignore], [ignore])
992 AT_CHECK([grep 'AC_C_BIGENDIAN' configure.ac], 0, [ignore], [ignore])
994 AT_CLEANUP
997 # autoupdating OLD to NEW
998 # -----------------------
1000 # The example taken from the code comments.
1001 AT_SETUP([autoupdating OLD to NEW])
1003 AT_DATA([aclocal.m4],
1004 [[AU_DEFUN([OLD], [NEW([$1, $2], m4@&t@_eval([$1 + $2]))])
1005 AC_DEFUN([NEW], [echo "sum($1) = $2"])
1008 AT_DATA([configure.ac],
1009 [[AC_INIT
1010 OLD(1, 2)
1011 NEW([0, 0], [0])
1014 # Checking `autoupdate'.
1015 AT_CHECK_AUTOUPDATE
1016 AT_CHECK_AUTOCONF
1017 AT_CHECK_CONFIGURE
1018 AT_CHECK([[grep 'NEW(\[1, 2], *\[3])' configure.ac]], 0, [ignore], [ignore])
1019 AT_CHECK([[grep 'NEW(\[0, 0], *\[0])' configure.ac]], 0, [ignore], [ignore])
1021 AT_CLEANUP
1024 # autoupdating macros recursively
1025 # -------------------------------
1027 AT_SETUP([autoupdating macros recursively])
1029 AT_XFAIL_IF([:])
1031 AT_DATA([configure.ac],
1032 [[AC_INIT
1033 AC_PROG_CC
1034 AC_TRY_COMPILE([], [choke me], [echo bogus1],
1035                [AC_TRY_COMPILE([], [return 0;], [echo good], [echo bogus2])])
1036 AC_OUTPUT
1039 # Checking `autoupdate'.
1040 AT_CHECK_AUTOUPDATE
1041 AT_CHECK([grep changequote configure.ac], [1])
1042 AT_CHECK([grep TRY_COMPILE configure.ac], [1])
1043 AT_CHECK_AUTOCONF
1044 AT_CHECK_CONFIGURE
1046 AT_CLEANUP
1049 # autoupdating AC_HELP_STRING
1050 # ---------------------------
1051 AT_SETUP([autoupdating AC_HELP_STRING])
1053 AT_DATA([configure.ac],
1054 [[AC_INIT
1055 AC_ARG_ENABLE([foo], [AC_HELP_STRING([--enable-foo], [foo bar])], [:], [:])
1058 # Checking `autoupdate'.
1059 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
1060 AT_CHECK_AUTOCONF
1061 AT_CHECK_CONFIGURE([], [], [], [ignore])
1062 AT_CHECK([[grep '\[--enable-foo], *\[foo bar]' configure.ac]], 0, [ignore], [ignore])
1064 AT_CLEANUP
1067 # autoupdating with m4sugar
1068 # -------------------------
1069 AT_SETUP([autoupdating with m4sugar])
1071 AT_DATA([aclocal.m4],
1072 [[AU_DEFUN([OLD],
1073 [m4@&t@_pushdef([foo], [bar])dn@&t@l
1074 echo "foo $1 foo"
1075 m4@&t@_popdef([foo])dn@&t@l
1079 touch foo.in
1081 AT_DATA([configure.ac],
1082 [[AC_PREREQ(2.54)
1083 m4_define([gnumeric_version_epoch], [1])
1084 AC_INIT
1085 OLD([ bla  bla ])
1086 AC_FOREACH([name], [n1 n2],
1087            [echo name
1089 AC_CHECKING([for feature])
1090 AC_MSG_RESULT_UNQUOTED([`echo done`])
1092 AC_OUTPUT([foo])
1095 # Checking `autoupdate'.
1096 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
1097 AT_CHECK_AUTOCONF
1098 AT_CHECK_CONFIGURE([], [], [], [ignore])
1100 AT_CLEANUP
1103 # autoupdating with m4_pushdef
1104 # ----------------------------
1105 AT_SETUP([autoupdating with m4@&t@_pushdef])
1107 AT_XFAIL_IF([:])
1109 touch foo.in
1110 AT_DATA([configure.ac],
1111 [[AC_INIT
1112 AC_PROG_CC
1113 # temporarily override this macro
1114 m4@&t@_pushdef([AC_MSG_RESULT_UNQUOTED], [:])
1115 AC_C_BIGENDIAN
1116 m4@&t@_popdef([AC_MSG_RESULT_UNQUOTED])
1117 AC_OUTPUT
1120 # Checking `autoupdate'.
1121 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
1122 AT_CHECK([grep changequote configure.ac], [1])
1123 AT_CHECK([grep [pushdef.*AC_MSG_RESULT_UNQUOTED] configure.ac], [0], [ignore])
1124 AT_CHECK_AUTOCONF
1125 AT_CHECK_CONFIGURE([], [], [], [ignore])
1127 AT_CLEANUP
1130 # autoupdating with AC_REQUIRE
1131 # ----------------------------
1132 AT_SETUP([autoupdating with AC_REQUIRE])
1134 AT_XFAIL_IF([:])
1136 AT_DATA([configure.ac],
1137 [[AC_DEFUN([MACRO],
1138 [AC_REQUIRE([AC_DECL_SYS_SIGLIST])
1139 AC_CHECK_DECLS([_sys_siglist], [], [], [#include <signal.h>])
1142 AC_INIT
1143 MACRO
1144 AC_OUTPUT
1147 # Checking `autoupdate'.
1148 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
1149 AT_CHECK_AUTOCONF
1150 AT_CHECK_CONFIGURE([], [], [], [ignore])
1152 AT_CLEANUP
1155 # autoupdating with complex quoting
1156 # ---------------------------------
1157 AT_SETUP([autoupdating with complex quoting])
1159 AT_XFAIL_IF([:])
1161 AT_DATA([configure.ac],
1162 [[m4_define([MACRO],
1163 [[#define STRING "hello, world\n"
1166 AC_INIT
1167 AC_TRY_COMPILE([#include <stdio.h>
1168                ]MACRO[], [printf (STRING);],
1169                [], [AS_EXIT([1])])
1170 AC_OUTPUT
1173 # Checking `autoupdate'.
1174 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
1175 AT_CHECK_AUTOCONF
1176 AT_CHECK([grep MACRO configure], [1])
1177 AT_CHECK_CONFIGURE([], [], [], [ignore])
1179 AT_CLEANUP
1182 # autoupdating AC_LANG_SAVE
1183 # -------------------------
1184 AT_SETUP([autoupdating AC_LANG_SAVE])
1186 AT_DATA([configure.ac],
1187 [[AC_INIT
1188 AC_LANG_SAVE
1189 AC_LANG_RESTORE
1190 AC_LANG_SAVE
1191 AC_LANG_RESTORE
1194 # Checking `autoupdate'.
1195 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
1196 AT_CHECK_AUTOCONF
1197 AT_CHECK_CONFIGURE([], [], [], [ignore])
1199 AT_CLEANUP
1202 # autoupdating AC_FOREACH
1203 # -----------------------
1204 AT_SETUP([autoupdating AC_FOREACH])
1206 AT_DATA([aclocal.m4],
1207 [[AU_DEFUN([OLD], [AC_FOREACH([myvar], [4 5 6], [' myvar'])])
1210 AT_DATA([configure.ac],
1211 [[AC_INIT
1212 echo AC_FOREACH([myvar], [1 2 3], [' myvar'])OLD
1215 # Checking `autoupdate'.
1216 AT_CHECK_AUTOUPDATE
1217 AT_CHECK([[grep 'echo 1 2 3 4 5 6' configure.ac]], 1, [ignore], [ignore])
1218 AT_CHECK([[grep 'm4@&t@_foreach_w' configure.ac]], 0, [ignore], [ignore])
1219 AT_CHECK_AUTOCONF
1220 AT_CHECK_CONFIGURE([], [0], [stdout])
1221 AT_CHECK([[grep ' 1 2 3 4 5 6' stdout]], 0, [ignore], [ignore])
1223 AT_CLEANUP
1226 # autoupdating with aclocal and m4_include
1227 # ----------------------------------------
1228 AT_SETUP([autoupdating with aclocal and m4@&t@_include])
1230 # We use aclocal.
1231 AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
1233 mkdir m4 aclocal
1234 AT_DATA([configure.ac],
1235 [[AC_INIT(x,0)
1236 AC_UNCHANGED_MACRO
1237 AC_OLD_MACRO
1238 AC_OUTPUT
1240 AT_DATA([m4/stuff.m4],
1241 [[AU_ALIAS([AC_OLD_MACRO], [AC_NEW_MACRO])
1242 AC_DEFUN([AC_NEW_MACRO], [echo hi])
1243 AC_DEFUN([AC_UNCHANGED_MACRO], [echo one])
1245 cp m4/stuff.m4 aclocal/stuff.m4
1246 AT_CHECK([aclocal -I aclocal], [0], [ignore], [ignore])
1247 # Checking `autoupdate'.
1248 AT_CHECK_AUTOUPDATE
1249 AT_CHECK([aclocal -I m4], [0], [ignore], [ignore])
1250 AT_CHECK_AUTOUPDATE
1252 AT_CLEANUP
1255 # Keeping autom4te.cfg complete
1256 # -----------------------------
1258 AT_SETUP([autom4te preselections])
1259 : ${sleep='sleep 1'}    # Command to force different timestamps.
1260 # If this test should run on FAT file systems and older w32,
1261 # then setting $sleep correctly needs to be revisited.
1263 # We use aclocal and automake.  Skip broken automake wrappers.
1264 AT_CHECK([automake --version || exit 77], [], [stdout], [ignore])
1265 AT_CHECK([[grep '[1-9]\.[0-9]' stdout || exit 77]], [], [ignore])
1266 AT_CHECK([test ! -f $HOME/.autom4te.cfg || exit 77], [], [ignore], [ignore])
1268 AT_DATA([configure.ac],
1269 [[AC_INIT(GNU foo, 1.0)
1270 AM_INIT_AUTOMAKE
1271 AC_CONFIG_FILES([Makefile])
1272 AC_OUTPUT
1275 AT_DATA([Makefile.am],
1276 [[AUTOMAKE_OPTIONS = foreign
1279 $sleep # `aclocal.m4' should be strictly younger than its inputs
1281 # If Autoconf is too old, or the user has turned caching off, skip:
1282 AT_CHECK([aclocal || { ret=$?; test $ret -eq 63 && ret=77; exit $ret; }],
1283          [], [], [ignore])
1284 AT_CHECK([test -d autom4te.cache || exit 77])
1285 AT_CHECK([autoconf])
1287 # If this test fails due to missing entries in lib/autom4te.in, then
1288 # comparing the old and new requests is a good place to start debugging:
1289 sort autom4te.cache/requests >old-requests
1290 echo newer >newer
1291 $sleep # if `configure' is regenerated, we want it to be strictly newer,
1292        # to catch the error consistently.
1293 AT_CHECK([aclocal], [], [], [ignore])
1294 AT_CHECK([automake --no-force --add-missing], [], [], [ignore])
1295 AT_CHECK([autoconf])
1296 AT_CHECK([test "`find configure -newer newer`" = "" ||
1297           { sort autom4te.cache/requests | diff old-requests -; exit 1; }],
1298          [], [], [],
1299          [extract_version=['s/^[^0-9]*\([0-9][^ ]*\).*/\1/;q']
1300           automake_version=`automake --version | sed "$extract_version"`
1301           used_automake_version=`sed "$extract_version" "$abs_top_srcdir/Makefile.in"`
1302           AT_CHECK([if test "$automake_version" = "$used_automake_version"; ]dnl
1303                     [then exit 1; else exit 77; fi])])
1304 AT_CLEANUP
1307 # autom4te cache creation
1308 # -----------------------
1309 # Ensure autom4te fails when it cannot create the cache directory
1310 # or create files there.
1311 AT_SETUP([autom4te cache creation])
1313 AT_CHECK([test ! -f $HOME/.autom4te.cfg || exit 77], [], [ignore], [ignore])
1315 # Work in a subdirectory so autotest can scribble in the toplevel.
1316 mkdir sub
1317 chmod a-w sub
1319 AT_DATA([configure.ac],
1320 [[AC_INIT
1323 AT_DATA([.autom4te.cfg],
1324 [[begin-language: "Autoconf-without-aclocal-m4"
1325 args: --cache=sub/autom4te.cache
1326 end-language: "Autoconf-without-aclocal-m4"
1329 # Do not try this when we are root or on systems without permissions.
1330 # A failed redirection may cause a status of 2 with FreeBSD sh.
1331 AT_CHECK([(: > sub/some-file) || exit 1 && exit 77], 1, [ignore], [ignore])
1333 # Failure to create cache directory.
1334 AT_CHECK_AUTOCONF([], [1], [ignore], [stderr])
1335 AT_CHECK([grep 'cannot create .*autom4te.cache' stderr], [0], [ignore])
1336 AT_CHECK([test -f configure], [1])
1338 chmod u+w sub
1339 AT_CHECK_AUTOCONF
1341 rm -f configure sub/autom4te.cache/*
1342 chmod a-w sub/autom4te.cache
1344 # Failure to create a file in the cache directory.
1345 AT_CHECK_AUTOCONF([], [1], [ignore], [stderr])
1346 AT_CHECK([grep 'cannot open.*autom4te.cache' stderr], [0], [ignore])
1348 AT_CLEANUP
1351 # autom4te cache locking
1352 # ----------------------
1354 AT_SETUP([autom4te cache locking])
1356 # Cannot use AT_CHECK here, autotest internals could be messed up.
1358 (echo AC_INIT; sleep 2; echo) \
1359   | (autom4te --language=autoconf -o configure -; echo $? >&2 ) 2>errlog &
1360 AT_CHECK([echo AC_INIT | autom4te --language=autoconf -o configure -])
1361 wait
1363 # Ignore additional output from shell verbose or xtrace mode.
1364 AT_CHECK([grep 'cannot rename' errlog], [1])
1365 AT_CHECK([grep '^0$' errlog], [], [ignore])
1366 AT_CHECK_CONFIGURE
1368 AT_CLEANUP
1371 # autotools and file names containing whitespace
1372 # ----------------------------------------------
1374 AT_SETUP([autotools and whitespace in file names])
1376 # We use aclocal.
1377 AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
1380 export x
1381 rm -f a b
1382 for funny in \
1383   'with  funny '\'' $x & #! name ' \
1384   'with  funny \ '\'' \'\'' " <a >b * ? name ' #"
1386   funny=`func_sanitize_file_name "$funny"`
1387   file=" file $funny"
1388   dir=`func_sanitize_dir_name " dir $funny"`
1389   TMPDIR=" tmp$dir"
1390   export TMPDIR
1392   # skip if we cannot create such a file or directory
1393   AT_CHECK([mkdir "$dir" "$TMPDIR" && touch "$file.ac" || exit 77])
1395   cat >"$file.ac" <<'END'
1396 [AC_INIT(x,0)
1397 m4@&t@_include([foo.m4])
1398 AC_CONFIG_HEADERS([config.h:config.hin])
1399 AC_MACRO
1400 AC_OUTPUT]
1402   cat >"$dir"/foo.m4 <<'END'
1403 [AC_DEFUN([AC_MACRO], [echo hi])]
1406   AT_CHECK_AUTOHEADER([-B "$dir" "$file.ac"])
1407   AT_CHECK_AUTOHEADER([--force -I "$dir" "$file.ac"])
1408   AT_CHECK_AUTOUPDATE([-B "$dir" "$file.ac"])
1409   AT_CHECK_AUTOUPDATE([--force -I "$dir" "$file.ac"])
1410   AT_CHECK_AUTOUPDATE([-B "$dir" - < "$file.ac"], [], [ignore])
1411   AT_CHECK_AUTOCONF([-B "$dir" -o "$file" "$file.ac"])
1412   AT_CHECK_AUTOCONF([-I "$dir" -o "$file" "$file.ac"])
1413   # In autoconf, these exercise a slightly different code path:
1414   AT_CHECK_AUTOCONF([--prepend-include="$dir" -o "$file" "$file.ac"])
1415   AT_CHECK_AUTOCONF([--include="$dir" -o "$file" "$file.ac"])
1416   AT_CHECK([autoscan -B "$dir"], [], [], [ignore])
1417   AT_CHECK([autoscan --force -I "$dir"], [], [], [ignore])
1418   # autoreconf requires a sane input file name.  Also, disable aclocal.
1419   mv -f "$file.ac" configure.ac
1420   AT_DATA([aclocal.m4])
1421   AT_CHECK([autoreconf -B "$dir"])
1422   AT_CHECK([autoreconf --force -I "$dir"])
1424   cat >"$file.c" <<'END'
1425 #if FOO
1426 #endif
1428   AT_CHECK([ifnames "$file.c"], [], [ignore])
1430   test ! -f b
1431 done
1433 AT_CLEANUP