3 AT_BANNER([Executables (autoheader, autoupdate...).])
5 # Copyright (C) 2000, 2001, 2003, 2004, 2006, 2007 Free Software
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 <http://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:
31 # SunOS ondine 4.1.3 2 sun4m unknown
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
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"])
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])
84 ## ------------------ ##
85 ## autom4te's cache. ##
86 ## ------------------ ##
88 AT_SETUP([autom4te cache])
90 AT_DATA_M4SUGAR([[script.4s]],
98 # We moved a file: it should fail
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
108 AT_DATA_M4SUGAR([[script.4s]],
109 [[m4_include([sub/foo])
119 AT_SETUP([autom4te --force])
124 AT_CHECK_AUTOM4TE([-o file file.m4])
126 # Create a file whose time stamp is in the future.
127 # (next year)-01-01 00:01 UTC should always be in the future,
128 # even on slow machines.
130 this_year=`TZ=UTC0 date +%Y`
131 TZ=UTC0 touch -t `expr $this_year + 1`01010001 file
133 AT_CHECK_AUTOM4TE([--force -o file file.m4])
134 AT_CHECK([cat file], 0,
141 # autom4te and file names containing whitespace
142 # ---------------------------------------------
144 AT_SETUP([autom4te and whitespace in file names])
150 'with funny '\'' $x & #! name' \
151 'with funny \ '\'' \'\'' " <a >b * ? name ' # "restore font-lock
153 funny=`func_sanitize_file_name "$funny"`
156 dir=`func_sanitize_dir_name " dir $funny"`
157 cachedir=" cache$dir"
161 # skip if we cannot create such a file or directory
162 AT_CHECK([mkdir "$dir" "$cachedir" "$TMPDIR" && touch "$file" || exit 77])
165 [m4@&t@_include(foo.m4)
166 m4@&t@_divert(0)d@&t@nl
169 cat >"$dir"/foo.m4 <<'END'
170 [m4@&t@_define([FOO], [bar])]
173 AT_CHECK_AUTOM4TE([-C "$cachedir" -B "$dir" --language=m4sugar -o "$outfile" "$file"])
174 AT_CHECK([cat "$outfile"], [],
177 rm -rf "$outfile" "$cachedir"
178 AT_CHECK_AUTOM4TE([-C "$cachedir" -I "$dir" --language=m4sugar -o "$outfile" "$file"])
179 AT_CHECK([cat "$outfile"], [],
183 # This exercises a slightly different code path and will catch an open with
184 # trailing whitespace:
186 [m4@&t@_include(foo.m4)
187 m4@&t@_pattern_forbid([^bar$])
188 m4@&t@_divert(0)d@&t@nl
191 rm -rf "$outfile" "$cachedir"
192 AT_CHECK_AUTOM4TE([-C "$cachedir" -I "$dir" --language=m4sugar -o "$outfile" "$file"],
194 AT_CHECK([grep 'possibly undefined macro' stderr], [], [ignore])
197 [m4@&t@_include(foo.m4)
198 m4@&t@_divert(0)d@&t@nl]
201 AT_CHECK_AUTOM4TE([-C "$cachedir" -I "$dir" --language=m4sugar --freeze -o "$file.m4f" "$file"])
202 AT_CHECK([test -s "$file.m4f"])
204 # Check --reload-state
205 AT_CHECK_AUTOM4TE([-C "$cachedir" --language=m4sugar -o "$outfile" "$file.m4f" /dev/null])
213 ## ------------------ ##
214 ## autoconf --trace. ##
215 ## ------------------ ##
218 # autoconf --trace: user macros
219 # -----------------------------
220 AT_SETUP([autoconf --trace: user macros])
222 AT_DATA([configure.ac],
223 [[m4_define([active], [ACTIVE])
224 m4_define([TRACE1], [TRACE2(m4_shift($@))])
225 m4_define([TRACE2], [[$2], $1])
231 # With arguments, single line.
232 TRACE1(foo, @bar, @baz)
233 TRACE1(foo, TRACE1(bar, baz))
234 TRACE1(foo, active, baz)
235 TRACE1(foo, [active], TRACE1(active, [active]))
239 AT_CHECK_AUTOCONF([-t TRACE1 -t TRACE2], 0,
240 [[configure.ac:6:TRACE1:
241 configure.ac:6:TRACE2:
242 configure.ac:7:TRACE2:
243 configure.ac:10:TRACE1:foo:@bar:@baz
244 configure.ac:10:TRACE2:@bar:@baz
245 configure.ac:11:TRACE1:bar:baz
246 configure.ac:11:TRACE2:baz
247 configure.ac:11:TRACE1:foo::baz
248 configure.ac:11:TRACE2::baz
249 configure.ac:12:TRACE1:foo:ACTIVE:baz
250 configure.ac:12:TRACE2:ACTIVE:baz
251 configure.ac:13:TRACE1:ACTIVE:active
252 configure.ac:13:TRACE2:active
253 configure.ac:13:TRACE1:foo:active::ACTIVE
254 configure.ac:13:TRACE2:active::ACTIVE
257 # Several line requests.
258 AT_CHECK_AUTOCONF([[-t TRACE1:'
259 [$1], [$2], [$3].']], 0,
263 [foo], [@bar], [@baz].
269 [foo], [ACTIVE], [baz].
271 [ACTIVE], [active], [].
277 AT_CHECK_AUTOCONF([-t TRACE2:'${)===(}@'], 0,
285 [active])===([])===([ACTIVE]
288 # Arguments spanning multiple lines.
289 AT_DATA([configure.ac],
290 [[m4_define([TRACE], [])
297 AT_CHECK_AUTOCONF([-t TRACE:'$%'], 0,
304 # autoconf --trace: builtins
305 # --------------------------
306 AT_SETUP([autoconf --trace: builtins])
308 AT_DATA([configure.ac],
309 [[define([active], [ACTIVE])
312 AT_CHECK_AUTOCONF([[-t define | sed -n '$p']],
314 [[configure.ac:1:define:active:ACTIVE
317 # FIXME: Without `$1' the following test dies. Groumphf, once again to
318 # dive into obscure feature interaction...
319 # Note that using `-i' means we need the *.m4 files, not the *.m4f files,
320 # hence we need srcdir, not builddir.
321 AT_CHECK_AUTOCONF([[-t define:'$1' -i| sed -n '$p']],
330 ## ---------------------------- ##
331 ## autoconf: forbidden tokens. ##
332 ## ---------------------------- ##
335 # autoconf: forbidden tokens, basic
336 # ---------------------------------
337 AT_SETUP([autoconf: forbidden tokens,[] basic])
339 AT_DATA_M4SH([configure.ac],
348 AT_CHECK_AUTOCONF([], 1, [],
349 [[configure.ac:2: error: possibly undefined macro: m4@&t@_foo
350 If this token and others are legitimate, please use m4@&t@_pattern_allow.
351 See the Autoconf documentation.
352 configure.ac:3: error: possibly undefined macro: _m4@&t@_bar
353 configure.ac:4: error: possibly undefined macro: AS@&t@_FOO
354 configure.ac:5: error: possibly undefined macro: _AS@&t@_BAR
355 configure.ac:6: error: possibly undefined macro: d@&t@nl
357 # Second run should succeed and yield no output.
363 # autoconf: forbidden tokens, exceptions
364 # --------------------------------------
365 AT_SETUP([autoconf: forbidden tokens,[] exceptions])
367 AT_DATA_M4SH([configure.ac],
370 # This is allowed in spite of the name.
371 # It is on purpose that we check the case where there are several
372 # tokens on the same line.
373 m4_pattern_allow([^AS_ALLOWED$])
374 NOT_AS_ALLOWED AS_ALLOWED AS_ALLOWED_NOT
377 m4_pattern_forbid([^FORBIDDEN$])
378 NOT_FORBIDDEN FORBIDDEN FORBIDDEN_NOT
380 # Test Autoconf's patterns.
381 AS_THIS_IS_INVALID and _AS_THIS_IS_INVALID_TOO
382 BUT_AZ_THIS_IS_NOT ALTHOUGH_AS_THIS_IS
383 # This is legal, although there is `AS_DEFINE' in there.
385 # AS_THIS_IS_A_COMMENT so just shut up.
386 It would be very bad if Autoconf forgot to expand [AS_]INIT!
389 AT_CHECK_AUTOCONF([], 1, [],
390 [[configure.ac:1: error: possibly undefined macro: AS@&t@_INIT
391 If this token and others are legitimate, please use m4@&t@_pattern_allow.
392 See the Autoconf documentation.
393 configure.ac:7: error: possibly undefined macro: AS@&t@_ALLOWED_NOT
394 configure.ac:10: error: possibly undefined macro: FORBIDDEN
395 configure.ac:14: error: possibly undefined macro: AS@&t@_THIS_IS_INVALID
396 configure.ac:14: error: possibly undefined macro: _AS@&t@_THIS_IS_INVALID_TOO
402 # autoconf: automatically allowed tokens
403 # --------------------------------------
404 AT_SETUP([autoconf: automatically allowed tokens])
406 AT_DATA_M4SH([configure.ac],
408 m4_pattern_forbid([^FB_])
419 # autoconf: do not forbid the empty token
420 # ---------------------------------------
421 AT_SETUP([autoconf: the empty token])
423 AT_DATA_M4SH([configure.ac],
424 [[m4_pattern_allow([^foo$])
426 line that begins with a space
434 # autoconf: subdirectories
435 # ------------------------
436 AT_SETUP([autoconf: subdirectories])
438 AT_DATA([configure.ac],
441 AC_CONFIG_FILES(sub/foo)
447 AT_DATA([sub/foo.in],
451 AT_DATA([install-sh])
455 AT_CHECK([[grep '^[^/].*/mkdir -p' sub/foo]], 1)
460 # autoconf: input from stdin
461 # --------------------------
462 AT_SETUP([autoconf: input from stdin])
464 # Past Autoconf versions failed to read from stdin when other, non-frozen input
465 # files were present.
466 AT_DATA([aclocal.m4])
468 AT_CHECK([echo 'AC_INIT(X, 1.0, bug-autoconf@gnu.org)' | autoconf -t AC_INIT -],
469 0, [stdin:1:AC_INIT:X:1.0:bug-autoconf@gnu.org
471 AT_CHECK([echo 'AC_INIT(X, 2.0, bug-autoconf@gnu.org)' | autoconf -t AC_INIT -],
472 0, [stdin:1:AC_INIT:X:2.0:bug-autoconf@gnu.org
478 # autoconf: AC_AUTOCONF_VERSION
479 # --------------------------------------
480 AT_SETUP([autoconf: AC_AUTOCONF_VERSION])
482 AT_DATA([configure.ac],
484 version AC_AUTOCONF_VERSION version
489 AT_CHECK([[grep 'version ]]AT_PACKAGE_VERSION[[ version' configure]],
505 #if ! defined DEF3 && defined DEF4 /* but not defined DEF5 */
512 #if (VAL1*VAL2)==VAL3+VAL4 /* Not VAL5 !!! */
520 AT_CHECK([ifnames iftest1.c iftest2.c], 0,
530 VAL1 iftest1.c iftest2.c
544 # autoheader is intensively used in its modern form throughout this
545 # test suite. But we also have to check that acconfig.h still works.
546 # autoheader uses autoconf --trace, so traces first.
548 AT_SETUP([autoheader])
550 AT_DATA([acconfig.h],
551 [[/* Define this to whatever you want. */
556 # 1. Check that `acconfig.h' is still honored.
557 AT_DATA([configure.ac],
559 AC_CONFIG_HEADERS(config.h:config.hin)
560 AC_DEFINE(this, "whatever you want.")
563 AT_CHECK_AUTOHEADER([], [], [], [ignore])
564 AT_CHECK([cat config.hin], 0,
565 [[/* config.hin. Generated from configure.ac by autoheader. */
566 /* Define this to whatever you want. */
569 /* Define to the address where bug reports for this package should be sent. */
570 #undef PACKAGE_BUGREPORT
572 /* Define to the full name of this package. */
575 /* Define to the full name and version of this package. */
576 #undef PACKAGE_STRING
578 /* Define to the one symbol short name of this package. */
579 #undef PACKAGE_TARNAME
581 /* Define to the version of this package. */
582 #undef PACKAGE_VERSION
586 # 2. Check that missing templates are a fatal error.
587 AT_DATA([configure.ac],
589 AC_CONFIG_HEADERS(config.h:config.hin)
590 AC_DEFINE(that, "whatever you want.")
593 # The test suite goes too fast for the cache time stamps...
595 AT_CHECK_AUTOHEADER([--force], [1], [], [ignore])
598 # 3. Check TOP and BOTTOM.
599 AT_DATA([acconfig.h],
600 [[/* Top from acconfig.h. */
602 /* Middle from acconfig.h. */
604 /* Bottom from acconfig.h. */
607 AT_DATA([configure.ac],
609 AC_CONFIG_HEADERS(config.h:config.hin)
610 AH_TOP([Top1 from configure.ac.])
611 AH_TOP([Top2 from configure.ac.])
612 AH_TOP([The Cat in a h@t.])
613 AH_VERBATIM([Middle], [Middle from configure.ac.])
614 AH_VERBATIM([Mouse], [The Mouse in a h@t.])
615 AH_BOTTOM([Bottom1 from configure.ac.])
616 AH_BOTTOM([Bottom2 from configure.ac.])
617 AH_BOTTOM([The Dog in a h@t.])
619 AC_DEFINE([ANT], [@], [The Ant in a h@t.])
623 # Yes, that's right: the `middle' part of `acconfig.h' is still before
624 # the AH_TOP part. But so what, you're not supposed to use the two
626 # Ignore STDERR which is the longuish complaint against autoheader junk
628 AT_CHECK_AUTOHEADER([--force], [], [], [ignore])
629 AT_CHECK([cat config.hin], 0,
630 [[/* config.hin. Generated from configure.ac by autoheader. */
631 /* Top from acconfig.h. */
632 /* Middle from acconfig.h. */
634 Top1 from configure.ac.
636 Top2 from configure.ac.
640 /* The Ant in a h@t. */
643 Middle from configure.ac.
647 /* Define to the address where bug reports for this package should be sent. */
648 #undef PACKAGE_BUGREPORT
650 /* Define to the full name of this package. */
653 /* Define to the full name and version of this package. */
654 #undef PACKAGE_STRING
656 /* Define to the one symbol short name of this package. */
657 #undef PACKAGE_TARNAME
659 /* Define to the version of this package. */
660 #undef PACKAGE_VERSION
662 Bottom1 from configure.ac.
664 Bottom2 from configure.ac.
667 /* Bottom from acconfig.h. */
679 # Check that AC_CANONICAL_SYSTEM and AC_OUTPUT are properly updated.
680 AT_SETUP([autoupdate])
682 AT_DATA([configure.ac],
685 # The doc says 27 is a valid fubar.
687 AC_OUTPUT(Makefile, echo $fubar, fubar=$fubar)
691 [[AC_INIT([Test],[1.0])
693 # The doc says 27 is a valid fubar.
695 AC_CONFIG_FILES([Makefile])
696 AC_CONFIG_COMMANDS([default],[echo $fubar],[fubar=$fubar])
700 # Checking `autoupdate'.
702 AT_CHECK([cat configure.ac], 0, [expout])
703 # Checking that `autoupdate' is idempotent
705 AT_CHECK([cat configure.ac], 0, [expout])
710 # autoupdating AC_LINK_FILES
711 # --------------------------
712 AT_SETUP([autoupdating AC_LINK_FILES])
714 AT_DATA([configure.ac],
716 AC_LINK_FILES(dst1 dst2, src1 src2)
725 # Checking `autoupdate'.
726 AT_CHECK_AUTOUPDATE([], 0, [], ignore)
729 AT_CHECK([cat src1], 0, [dst1
731 AT_CHECK([cat src2], 0, [dst2
737 # autoupdating AC_PREREQ
738 # ----------------------
739 AT_SETUP([autoupdating AC_PREREQ])
741 # Produce `AC_PREREQ(<AUTOUPDATE VERSION>)'.
742 AT_CHECK([autoupdate --version | sed 's/.*) //;q'], 0, [stdout])
743 autoupdate_version=`cat stdout`
744 echo "AC_PREREQ($autoupdate_version)" >expout
746 AT_CHECK([echo "AC_PREREQ(1.0)" | autoupdate -],
749 AT_CHECK([echo "AC_PREREQ($autoupdate_version)" | autoupdate -],
752 AT_CHECK([echo "AC_PREREQ(999.99)" | autoupdate -],
758 # autoupdating AU_ALIAS
759 # ---------------------
760 AT_SETUP([autoupdating AU_ALIAS])
762 AT_DATA([configure.ac],
764 AC_DEFUN([FOO], [$#])
765 AU_ALIAS([BAZ],[FOO])
766 test "FOO:FOO():FOO(x) BAZ:BAZ():BAZ(x)" = "0:1:1 0:1:1" || exit 1
772 # Checking `autoupdate'.
776 AT_CHECK([grep 'AC_HEADER_STDC(' configure.ac], 1, [ignore], [ignore])
777 AT_CHECK([grep 'AC_HEADER_STDC' configure.ac], 0, [ignore], [ignore])
782 # autoupdating OLD to NEW
783 # -----------------------
785 # The example taken from the code comments.
786 AT_SETUP([autoupdating OLD to NEW])
788 AT_DATA([aclocal.m4],
789 [[AU_DEFUN([OLD], [NEW([$1, $2], m4@&t@_eval([$1 + $2]))])
790 AC_DEFUN([NEW], [echo "sum($1) = $2"])
793 AT_DATA([configure.ac],
799 # Checking `autoupdate'.
803 AT_CHECK([[grep 'NEW(\[1, 2], *\[3])' configure.ac]], 0, [ignore], [ignore])
804 AT_CHECK([[grep 'NEW(\[0, 0], *\[0])' configure.ac]], 0, [ignore], [ignore])
809 # autoupdating AC_HELP_STRING
810 # ---------------------------
811 AT_SETUP([autoupdating AC_HELP_STRING])
813 AT_DATA([configure.ac],
815 AC_ARG_ENABLE([foo], [AC_HELP_STRING([--enable-foo], [foo bar])], [:], [:])
818 # Checking `autoupdate'.
819 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
821 AT_CHECK_CONFIGURE([], [], [], [ignore])
822 AT_CHECK([[grep '\[--enable-foo], *\[foo bar]' configure.ac]], 0, [ignore], [ignore])
827 # autoupdating with m4sugar
828 # -------------------------
829 AT_SETUP([autoupdating with m4sugar])
831 AT_DATA([aclocal.m4],
833 [m4@&t@_pushdef([foo], [bar])dn@&t@l
835 m4@&t@_popdef([foo])dn@&t@l
841 AT_DATA([configure.ac],
843 m4_define([gnumeric_version_epoch], [1])
846 AC_FOREACH([name], [n1 n2],
849 AC_CHECKING([for feature])
850 AC_MSG_RESULT_UNQUOTED([`echo done`])
855 # Checking `autoupdate'.
856 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
858 AT_CHECK_CONFIGURE([], [], [], [ignore])
863 # autoupdating AC_LANG_SAVE
864 # -------------------------
865 AT_SETUP([autoupdating AC_LANG_SAVE])
867 AT_DATA([configure.ac],
875 # Checking `autoupdate'.
876 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
878 AT_CHECK_CONFIGURE([], [], [], [ignore])
883 # autoupdating AC_FOREACH
884 # -----------------------
885 AT_SETUP([autoupdating AC_FOREACH])
887 AT_DATA([aclocal.m4],
888 [[AU_DEFUN([OLD], [AC_FOREACH([myvar], [4 5 6], [' myvar'])])
891 AT_DATA([configure.ac],
893 echo AC_FOREACH([myvar], [1 2 3], [' myvar'])OLD
896 # Checking `autoupdate'.
898 AT_CHECK([[grep 'echo 1 2 3 4 5 6' configure.ac]], 1, [ignore], [ignore])
899 AT_CHECK([[grep 'm4@&t@_foreach_w' configure.ac]], 0, [ignore], [ignore])
901 AT_CHECK_CONFIGURE([], [0], [stdout])
902 AT_CHECK([[grep ' 1 2 3 4 5 6' stdout]], 0, [ignore], [ignore])
907 # autoupdating with aclocal and m4_include
908 # ----------------------------------------
909 AT_SETUP([autoupdating with aclocal and m4@&t@_include])
912 AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
915 AT_DATA([configure.in],
921 AT_DATA([m4/stuff.m4],
922 [[AU_ALIAS([AC_OLD_MACRO], [AC_NEW_MACRO])
923 AC_DEFUN([AC_NEW_MACRO], [echo hi])
924 AC_DEFUN([AC_UNCHANGED_MACRO], [echo one])
926 cp m4/stuff.m4 aclocal/stuff.m4
927 AT_CHECK([aclocal -I aclocal], [0], [ignore], [ignore])
928 # Checking `autoupdate'.
930 AT_CHECK([aclocal -I m4], [0], [ignore], [ignore])
936 # Keeping autom4te.cfg complete
937 # -----------------------------
939 AT_SETUP([autom4te preselections])
940 : ${sleep='sleep 1'} # Command to force different time stamps.
941 # If this test should run on FAT file systems and older w32,
942 # then setting $sleep correctly needs to be revisited.
944 # We use aclocal and automake.
945 AT_CHECK([automake --version || exit 77], [], [ignore], [ignore])
946 AT_CHECK([test ! -f $HOME/.autom4te.cfg || exit 77], [], [ignore], [ignore])
948 AT_DATA([configure.in],
949 [[AC_INIT(GNU foo, 1.0)
951 AC_CONFIG_FILES([Makefile])
955 AT_DATA([Makefile.am],
956 [[AUTOMAKE_OPTIONS = foreign
959 $sleep # `aclocal.m4' should be strictly younger than its inputs
961 # If Autoconf is too old, or the user has turned caching off, skip:
962 AT_CHECK([aclocal || { ret=$?; test $ret -eq 63 && ret=77; exit $ret; }],
964 AT_CHECK([test -d autom4te.cache || exit 77])
967 # If this test fails due to missing entries in lib/autom4te.in, then
968 # comparing the old and new requests is a good place to start debugging:
969 cp autom4te.cache/requests old-requests
971 $sleep # if `configure' is regenerated, we want it to be strictly newer,
972 # to catch the error consistently.
973 AT_CHECK([aclocal], [], [], [ignore])
974 AT_CHECK([automake --no-force --add-missing], [], [], [ignore])
976 AT_CHECK([test "`find configure -newer newer`" = "" ||
977 { diff old-requests autom4te.cache/requests; exit 1; }])
982 # autotools and file names containing whitespace
983 # ---------------------------------------------
985 AT_SETUP([autotools and whitespace in file names])
991 'with funny '\'' $x & #! name ' \
992 'with funny \ '\'' \'\'' " <a >b * ? name '
994 funny=`func_sanitize_file_name "$funny"`
996 dir=`func_sanitize_dir_name " dir $funny"`
1000 cat >"$file.in" <<'END'
1002 m4@&t@_include([foo.m4])
1003 AC_CONFIG_HEADERS([config.h:config.hin])
1007 # skip if we cannot create such a file or directory
1008 AT_CHECK([mkdir "$dir" "$TMPDIR" && test -f "$file.in" || exit 77])
1009 cat >"$dir"/foo.m4 <<'END'
1010 [AC_DEFUN([AC_MACRO], [echo hi])]
1013 AT_CHECK_AUTOHEADER([-B "$dir" "$file.in"])
1014 AT_CHECK_AUTOHEADER([-I "$dir" "$file.in"])
1015 AT_CHECK_AUTOUPDATE([-B "$dir" "$file.in"])
1016 AT_CHECK_AUTOUPDATE([-I "$dir" "$file.in"])
1017 AT_CHECK_AUTOUPDATE([-B "$dir" - < "$file.in"], [], [ignore])
1018 AT_CHECK_AUTOCONF([-B "$dir" -o "$file" "$file.in"])
1019 AT_CHECK_AUTOCONF([-I "$dir" -o "$file" "$file.in"])
1020 # In autoconf, these exercise a slightly different code path:
1021 AT_CHECK_AUTOCONF([--prepend-include="$dir" -o "$file" "$file.in"])
1022 AT_CHECK_AUTOCONF([--include="$dir" -o "$file" "$file.in"])
1023 AT_CHECK([autoscan -B "$dir"], [], [], [ignore])
1024 AT_CHECK([autoscan -I "$dir"], [], [], [ignore])
1025 # autoreconf requires a sane input file name. Also, disable aclocal.
1026 mv -f "$file.in" configure.in
1027 AT_DATA([aclocal.m4])
1028 AT_CHECK([autoreconf -B "$dir"])
1029 AT_CHECK([autoreconf -I "$dir"])
1031 cat >"$file.c" <<'END'
1035 AT_CHECK([ifnames "$file.c"], [], [ignore])