3 AT_BANNER([Executables (autoheader, autoupdate...).])
5 # Copyright (C) 2000, 2001, 2003, 2004, 2006, 2007, 2008 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 2, or (at your option)
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, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 ## ----------------------------- ##
25 ## Syntax of the shell scripts. ##
26 ## ----------------------------- ##
28 # We use `/bin/sh -n script' to check that there are no syntax errors
29 # in the scripts. Although incredible, there are /bin/sh that go into
30 # endless loops with `-n', e.g., SunOS's:
33 # SunOS ondine 4.1.3 2 sun4m unknown
40 # $ time sh endless.sh
41 # sh endless.sh 0,02s user 0,03s system 78% cpu 0,064 total
42 # $ time sh -nx endless.sh
43 # ^Csh -nx endless.sh 3,67s user 0,03s system 63% cpu 5,868 total
45 # So before using `/bin/sh -n' to check our scripts, we first check
46 # that `/bin/sh -n' is not broken to death.
48 AT_SETUP([Syntax of the shell scripts])
50 AT_CHECK([test "$ac_cv_sh_n_works" = yes || exit 77])
52 # Specify the absolute name of the tool, as some shells don't honor PATH when
55 AT_CHECK_SHELL_SYNTAX(["$abs_top_builddir/bin/autoconf"])
56 AT_CHECK_SHELL_SYNTAX(["$abs_top_builddir/tests/autoconf"])
57 AT_CHECK_SHELL_SYNTAX(["$abs_top_builddir/tests/testsuite"])
59 # These are not built, they are in the src tree.
60 AT_CHECK_SHELL_SYNTAX(["$abs_top_srcdir/build-aux/install-sh"])
61 AT_CHECK_SHELL_SYNTAX(["$abs_top_srcdir/build-aux/missing"])
68 ## ---------------------------- ##
69 ## Syntax of the Perl scripts. ##
70 ## ---------------------------- ##
72 AT_SETUP([Syntax of the Perl scripts])
74 AT_CHECK_PERL_SYNTAX([autoheader])
75 AT_CHECK_PERL_SYNTAX([autom4te])
76 AT_CHECK_PERL_SYNTAX([autoreconf])
77 AT_CHECK_PERL_SYNTAX([autoscan])
78 AT_CHECK_PERL_SYNTAX([autoupdate])
79 AT_CHECK_PERL_SYNTAX([ifnames])
86 ## ------------------ ##
87 ## autom4te's cache. ##
88 ## ------------------ ##
90 AT_SETUP([autom4te cache])
92 AT_DATA_M4SUGAR([[script.4s]],
100 # We moved a file: it should fail
103 AT_CHECK_M4SUGAR([], [1], [],
104 [m4:script.4s:1: cannot open `foo': No such file or directory
105 autom4te: m4 failed with exit status: 1
108 # But if we change the main file, then we should no longer complain of
110 AT_DATA_M4SUGAR([[script.4s]],
111 [[m4_include([sub/foo])
121 AT_SETUP([autom4te --force])
126 AT_CHECK_AUTOM4TE([-o file file.m4])
128 # Create a file whose time stamp is in the future.
129 # (next year)-01-01 00:01 UTC should always be in the future,
130 # even on slow machines.
132 this_year=`TZ=UTC0 date +%Y`
133 TZ=UTC0 touch -t `expr $this_year + 1`01010001 file
135 AT_CHECK_AUTOM4TE([--force -o file file.m4])
136 AT_CHECK([cat file], 0,
143 # autom4te and file names containing whitespace
144 # ---------------------------------------------
146 AT_SETUP([autom4te and whitespace in file names])
152 'with funny '\'' $x & #! name' \
153 'with funny \ '\'' \'\'' " <a >b * ? name ' # "restore font-lock
155 funny=`func_sanitize_file_name "$funny"`
158 dir=`func_sanitize_dir_name " dir $funny"`
159 cachedir=" cache$dir"
163 # skip if we cannot create such a file or directory
164 AT_CHECK([mkdir "$dir" "$cachedir" "$TMPDIR" && touch "$file" || exit 77])
167 [m4@&t@_include(foo.m4)
168 m4@&t@_divert(0)d@&t@nl
171 cat >"$dir"/foo.m4 <<'END'
172 [m4@&t@_define([FOO], [bar])]
175 AT_CHECK_AUTOM4TE([-C "$cachedir" -B "$dir" --language=m4sugar -o "$outfile" "$file"])
176 AT_CHECK([cat "$outfile"], [],
179 rm -rf "$outfile" "$cachedir"
180 AT_CHECK_AUTOM4TE([-C "$cachedir" -I "$dir" --language=m4sugar -o "$outfile" "$file"])
181 AT_CHECK([cat "$outfile"], [],
185 # This exercises a slightly different code path and will catch an open with
186 # trailing whitespace:
188 [m4@&t@_include(foo.m4)
189 m4@&t@_pattern_forbid([^bar$])
190 m4@&t@_divert(0)d@&t@nl
193 rm -rf "$outfile" "$cachedir"
194 AT_CHECK_AUTOM4TE([-C "$cachedir" -I "$dir" --language=m4sugar -o "$outfile" "$file"],
196 AT_CHECK([grep 'possibly undefined macro' stderr], [], [ignore])
199 [m4@&t@_include(foo.m4)
200 m4@&t@_divert(0)d@&t@nl]
203 AT_CHECK_AUTOM4TE([-C "$cachedir" -I "$dir" --language=m4sugar --freeze -o "$file.m4f" "$file"])
204 AT_CHECK([test -s "$file.m4f"])
206 # Check --reload-state
207 AT_CHECK_AUTOM4TE([-C "$cachedir" --language=m4sugar -o "$outfile" "$file.m4f" /dev/null])
215 ## ------------------ ##
216 ## autoconf --trace. ##
217 ## ------------------ ##
220 # autoconf --trace: user macros
221 # -----------------------------
222 AT_SETUP([autoconf --trace: user macros])
224 AT_DATA([configure.ac],
225 [[m4_define([active], [ACTIVE])
226 m4_define([TRACE1], [TRACE2(m4_shift($@))])
227 m4_define([TRACE2], [[$2], $1])
233 # With arguments, single line.
234 TRACE1(foo, @bar, @baz)
235 TRACE1(foo, TRACE1(bar, baz))
236 TRACE1(foo, active, baz)
237 TRACE1(foo, [active], TRACE1(active, [active]))
241 AT_CHECK_AUTOCONF([-t TRACE1 -t TRACE2], 0,
242 [[configure.ac:6:TRACE1:
243 configure.ac:6:TRACE2:
244 configure.ac:7:TRACE2:
245 configure.ac:10:TRACE1:foo:@bar:@baz
246 configure.ac:10:TRACE2:@bar:@baz
247 configure.ac:11:TRACE1:bar:baz
248 configure.ac:11:TRACE2:baz
249 configure.ac:11:TRACE1:foo::baz
250 configure.ac:11:TRACE2::baz
251 configure.ac:12:TRACE1:foo:ACTIVE:baz
252 configure.ac:12:TRACE2:ACTIVE:baz
253 configure.ac:13:TRACE1:ACTIVE:active
254 configure.ac:13:TRACE2:active
255 configure.ac:13:TRACE1:foo:active::ACTIVE
256 configure.ac:13:TRACE2:active::ACTIVE
259 # Several line requests.
260 AT_CHECK_AUTOCONF([[-t TRACE1:'
261 [$1], [$2], [$3].']], 0,
265 [foo], [@bar], [@baz].
271 [foo], [ACTIVE], [baz].
273 [ACTIVE], [active], [].
279 AT_CHECK_AUTOCONF([-t TRACE2:'${)===(}@'], 0,
287 [active])===([])===([ACTIVE]
290 # Arguments spanning multiple lines.
291 AT_DATA([configure.ac],
292 [[m4_define([TRACE], [])
299 AT_CHECK_AUTOCONF([-t TRACE:'$%'], 0,
306 # autoconf --trace: builtins
307 # --------------------------
308 AT_SETUP([autoconf --trace: builtins])
310 AT_DATA([configure.ac],
311 [[define([active], [ACTIVE])
314 AT_CHECK_AUTOCONF([[-t define | sed -n '$p']],
316 [[configure.ac:1:define:active:ACTIVE
319 # FIXME: Without `$1' the following test dies. Groumphf, once again to
320 # dive into obscure feature interaction...
321 # Note that using `-i' means we need the *.m4 files, not the *.m4f files,
322 # hence we need srcdir, not builddir.
323 AT_CHECK_AUTOCONF([[-t define:'$1' -i| sed -n '$p']],
332 ## ---------------------------- ##
333 ## autoconf: forbidden tokens. ##
334 ## ---------------------------- ##
337 # autoconf: forbidden tokens, basic
338 # ---------------------------------
339 AT_SETUP([autoconf: forbidden tokens,[] basic])
341 AT_DATA_M4SH([configure.ac],
350 AT_CHECK_AUTOCONF([], 1, [],
351 [[configure.ac:2: error: possibly undefined macro: m4@&t@_foo
352 If this token and others are legitimate, please use m4@&t@_pattern_allow.
353 See the Autoconf documentation.
354 configure.ac:3: error: possibly undefined macro: _m4@&t@_bar
355 configure.ac:4: error: possibly undefined macro: AS@&t@_FOO
356 configure.ac:5: error: possibly undefined macro: _AS@&t@_BAR
357 configure.ac:6: error: possibly undefined macro: d@&t@nl
359 # Second run should succeed and yield no output.
365 # autoconf: forbidden tokens, exceptions
366 # --------------------------------------
367 AT_SETUP([autoconf: forbidden tokens,[] exceptions])
369 AT_DATA_M4SH([configure.ac],
372 # This is allowed in spite of the name.
373 # It is on purpose that we check the case where there are several
374 # tokens on the same line.
375 m4_pattern_allow([^AS_ALLOWED$])
376 NOT_AS_ALLOWED AS_ALLOWED AS_ALLOWED_NOT
379 m4_pattern_forbid([^FORBIDDEN$])
380 NOT_FORBIDDEN FORBIDDEN FORBIDDEN_NOT
382 # Test Autoconf's patterns.
383 AS_THIS_IS_INVALID and _AS_THIS_IS_INVALID_TOO
384 BUT_AZ_THIS_IS_NOT ALTHOUGH_AS_THIS_IS
385 # This is legal, although there is `AS_DEFINE' in there.
387 # AS_THIS_IS_A_COMMENT so just shut up.
388 It would be very bad if Autoconf forgot to expand [AS_]INIT!
391 AT_CHECK_AUTOCONF([], 1, [],
392 [[configure.ac:1: error: possibly undefined macro: AS@&t@_INIT
393 If this token and others are legitimate, please use m4@&t@_pattern_allow.
394 See the Autoconf documentation.
395 configure.ac:7: error: possibly undefined macro: AS@&t@_ALLOWED_NOT
396 configure.ac:10: error: possibly undefined macro: FORBIDDEN
397 configure.ac:14: error: possibly undefined macro: AS@&t@_THIS_IS_INVALID
398 configure.ac:14: error: possibly undefined macro: _AS@&t@_THIS_IS_INVALID_TOO
404 # autoconf: automatically allowed tokens
405 # --------------------------------------
406 AT_SETUP([autoconf: automatically allowed tokens])
408 AT_DATA_M4SH([configure.ac],
410 m4_pattern_forbid([^FB_])
421 # autoconf: do not forbid the empty token
422 # ---------------------------------------
423 AT_SETUP([autoconf: the empty token])
425 AT_DATA_M4SH([configure.ac],
426 [[m4_pattern_allow([^foo$])
428 line that begins with a space
436 # autoconf: subdirectories
437 # ------------------------
438 AT_SETUP([autoconf: subdirectories])
440 AT_DATA([configure.ac],
443 AC_CONFIG_FILES(sub/foo)
449 AT_DATA([sub/foo.in],
453 AT_DATA([install-sh])
457 AT_CHECK([[grep '^[^/].*/mkdir -p' sub/foo]], 1)
462 # autoconf: input from stdin
463 # --------------------------
464 AT_SETUP([autoconf: input from stdin])
466 # Past Autoconf versions failed to read from stdin when other, non-frozen input
467 # files were present.
468 AT_DATA([aclocal.m4])
470 AT_CHECK([echo 'AC_INIT(X, 1.0, bug-autoconf@gnu.org)' | autoconf -t AC_INIT -],
471 0, [stdin:1:AC_INIT:X:1.0:bug-autoconf@gnu.org
473 AT_CHECK([echo 'AC_INIT(X, 2.0, bug-autoconf@gnu.org)' | autoconf -t AC_INIT -],
474 0, [stdin:1:AC_INIT:X:2.0:bug-autoconf@gnu.org
480 # autoconf: AC_AUTOCONF_VERSION
481 # --------------------------------------
482 AT_SETUP([autoconf: AC_AUTOCONF_VERSION])
484 AT_DATA([configure.ac],
486 version m4@&t@_defn([AC_AUTOCONF_VERSION]) version
491 AT_CHECK([[grep 'version ]]AT_PACKAGE_VERSION[[ version' configure]],
507 #if ! defined DEF3 && defined DEF4 /* but not defined DEF5 */
514 #if (VAL1*VAL2)==VAL3+VAL4 /* Not VAL5 !!! */
522 AT_CHECK([ifnames iftest1.c iftest2.c], 0,
532 VAL1 iftest1.c iftest2.c
546 # autoheader is intensively used in its modern form throughout this
547 # test suite. But we also have to check that acconfig.h still works.
548 # autoheader uses autoconf --trace, so traces first.
550 AT_SETUP([autoheader])
552 AT_DATA([acconfig.h],
553 [[/* Define this to whatever you want. */
558 # 1. Check that `acconfig.h' is still honored.
559 AT_DATA([configure.ac],
561 AC_CONFIG_HEADERS(config.h:config.hin)
562 AC_DEFINE(this, "whatever you want.")
565 AT_CHECK_AUTOHEADER([], [], [], [ignore])
566 AT_CHECK([cat config.hin], 0,
567 [[/* config.hin. Generated from configure.ac by autoheader. */
568 /* Define this to whatever you want. */
571 /* Define to the address where bug reports for this package should be sent. */
572 #undef PACKAGE_BUGREPORT
574 /* Define to the full name of this package. */
577 /* Define to the full name and version of this package. */
578 #undef PACKAGE_STRING
580 /* Define to the one symbol short name of this package. */
581 #undef PACKAGE_TARNAME
583 /* Define to the version of this package. */
584 #undef PACKAGE_VERSION
588 # 2. Check that missing templates are a fatal error.
589 AT_DATA([configure.ac],
591 AC_CONFIG_HEADERS(config.h:config.hin)
592 AC_DEFINE(that, "whatever you want.")
595 # The test suite goes too fast for the cache time stamps...
597 AT_CHECK_AUTOHEADER([--force], [1], [], [ignore])
600 # 3. Check TOP and BOTTOM.
601 AT_DATA([acconfig.h],
602 [[/* Top from acconfig.h. */
604 /* Middle from acconfig.h. */
606 /* Bottom from acconfig.h. */
609 AT_DATA([configure.ac],
611 AC_CONFIG_HEADERS(config.h:config.hin)
612 AH_TOP([Top1 from configure.ac.])
613 AH_TOP([Top2 from configure.ac.])
614 AH_TOP([The Cat in a h@t.])
615 AH_VERBATIM([Middle], [Middle from configure.ac.])
616 AH_VERBATIM([Mouse], [The Mouse in a h@t.])
617 AH_BOTTOM([Bottom1 from configure.ac.])
618 AH_BOTTOM([Bottom2 from configure.ac.])
619 AH_BOTTOM([The Dog in a h@t.])
621 AC_DEFINE([ANT], [@], [The Ant in a h@t.])
625 # Yes, that's right: the `middle' part of `acconfig.h' is still before
626 # the AH_TOP part. But so what, you're not supposed to use the two
628 # Ignore STDERR which is the longuish complaint against autoheader junk
630 AT_CHECK_AUTOHEADER([--force], [], [], [ignore])
631 AT_CHECK([cat config.hin], 0,
632 [[/* config.hin. Generated from configure.ac by autoheader. */
633 /* Top from acconfig.h. */
634 /* Middle from acconfig.h. */
636 Top1 from configure.ac.
638 Top2 from configure.ac.
642 /* The Ant in a h@t. */
645 Middle from configure.ac.
649 /* Define to the address where bug reports for this package should be sent. */
650 #undef PACKAGE_BUGREPORT
652 /* Define to the full name of this package. */
655 /* Define to the full name and version of this package. */
656 #undef PACKAGE_STRING
658 /* Define to the one symbol short name of this package. */
659 #undef PACKAGE_TARNAME
661 /* Define to the version of this package. */
662 #undef PACKAGE_VERSION
664 Bottom1 from configure.ac.
666 Bottom2 from configure.ac.
669 /* Bottom from acconfig.h. */
681 # Check that AC_CANONICAL_SYSTEM and AC_OUTPUT are properly updated.
682 AT_SETUP([autoupdate])
684 AT_DATA([configure.ac],
687 # The doc says 27 is a valid fubar.
689 AC_OUTPUT(Makefile, echo $fubar, fubar=$fubar)
693 [[AC_INIT([Test],[1.0])
695 # The doc says 27 is a valid fubar.
697 AC_CONFIG_FILES([Makefile])
698 AC_CONFIG_COMMANDS([default],[echo $fubar],[fubar=$fubar])
702 # Checking `autoupdate'.
704 AT_CHECK([cat configure.ac], 0, [expout])
705 # Checking that `autoupdate' is idempotent
707 AT_CHECK([cat configure.ac], 0, [expout])
712 # autoupdating AC_LINK_FILES
713 # --------------------------
714 AT_SETUP([autoupdating AC_LINK_FILES])
716 AT_DATA([configure.ac],
718 AC_LINK_FILES(dst1 dst2, src1 src2)
727 # Checking `autoupdate'.
728 AT_CHECK_AUTOUPDATE([], 0, [], ignore)
731 AT_CHECK([cat src1], 0, [dst1
733 AT_CHECK([cat src2], 0, [dst2
739 # autoupdating AC_PREREQ
740 # ----------------------
741 AT_SETUP([autoupdating AC_PREREQ])
743 # Produce `AC_PREREQ(<AUTOUPDATE VERSION>)'.
744 AT_CHECK([autoupdate --version | sed 's/.*) //;q'], 0, [stdout])
745 autoupdate_version=`cat stdout`
746 echo "AC_PREREQ($autoupdate_version)" >expout
748 AT_CHECK([echo "AC_PREREQ(1.0)" | autoupdate -],
751 AT_CHECK([echo "AC_PREREQ($autoupdate_version)" | autoupdate -],
754 AT_CHECK([echo "AC_PREREQ(999.99)" | autoupdate -],
760 # autoupdating AU_ALIAS
761 # ---------------------
762 AT_SETUP([autoupdating AU_ALIAS])
764 AT_DATA([configure.ac],
766 AC_DEFUN([FOO], [$#])
767 AU_ALIAS([BAZ],[FOO])
768 test "FOO:FOO():FOO(x) BAZ:BAZ():BAZ(x)" = "0:1:1 0:1:1" || exit 1
774 # Checking `autoupdate'.
778 AT_CHECK([grep 'AC_HEADER_STDC(' configure.ac], 1, [ignore], [ignore])
779 AT_CHECK([grep 'AC_HEADER_STDC' configure.ac], 0, [ignore], [ignore])
784 # autoupdating OLD to NEW
785 # -----------------------
787 # The example taken from the code comments.
788 AT_SETUP([autoupdating OLD to NEW])
790 AT_DATA([aclocal.m4],
791 [[AU_DEFUN([OLD], [NEW([$1, $2], m4@&t@_eval([$1 + $2]))])
792 AC_DEFUN([NEW], [echo "sum($1) = $2"])
795 AT_DATA([configure.ac],
801 # Checking `autoupdate'.
805 AT_CHECK([[grep 'NEW(\[1, 2], *\[3])' configure.ac]], 0, [ignore], [ignore])
806 AT_CHECK([[grep 'NEW(\[0, 0], *\[0])' configure.ac]], 0, [ignore], [ignore])
811 # autoupdating AC_HELP_STRING
812 # ---------------------------
813 AT_SETUP([autoupdating AC_HELP_STRING])
815 AT_DATA([configure.ac],
817 AC_ARG_ENABLE([foo], [AC_HELP_STRING([--enable-foo], [foo bar])], [:], [:])
820 # Checking `autoupdate'.
821 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
823 AT_CHECK_CONFIGURE([], [], [], [ignore])
824 AT_CHECK([[grep '\[--enable-foo], *\[foo bar]' configure.ac]], 0, [ignore], [ignore])
829 # autoupdating with m4sugar
830 # -------------------------
831 AT_SETUP([autoupdating with m4sugar])
833 AT_DATA([aclocal.m4],
835 [m4@&t@_pushdef([foo], [bar])dn@&t@l
837 m4@&t@_popdef([foo])dn@&t@l
843 AT_DATA([configure.ac],
845 m4_define([gnumeric_version_epoch], [1])
848 AC_FOREACH([name], [n1 n2],
851 AC_CHECKING([for feature])
852 AC_MSG_RESULT_UNQUOTED([`echo done`])
857 # Checking `autoupdate'.
858 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
860 AT_CHECK_CONFIGURE([], [], [], [ignore])
865 # autoupdating AC_LANG_SAVE
866 # -------------------------
867 AT_SETUP([autoupdating AC_LANG_SAVE])
869 AT_DATA([configure.ac],
877 # Checking `autoupdate'.
878 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
880 AT_CHECK_CONFIGURE([], [], [], [ignore])
885 # autoupdating AC_FOREACH
886 # -----------------------
887 AT_SETUP([autoupdating AC_FOREACH])
889 AT_DATA([aclocal.m4],
890 [[AU_DEFUN([OLD], [AC_FOREACH([myvar], [4 5 6], [' myvar'])])
893 AT_DATA([configure.ac],
895 echo AC_FOREACH([myvar], [1 2 3], [' myvar'])OLD
898 # Checking `autoupdate'.
900 AT_CHECK([[grep 'echo 1 2 3 4 5 6' configure.ac]], 1, [ignore], [ignore])
901 AT_CHECK([[grep 'm4@&t@_foreach_w' configure.ac]], 0, [ignore], [ignore])
903 AT_CHECK_CONFIGURE([], [0], [stdout])
904 AT_CHECK([[grep ' 1 2 3 4 5 6' stdout]], 0, [ignore], [ignore])
909 # autoupdating with aclocal and m4_include
910 # ----------------------------------------
911 AT_SETUP([autoupdating with aclocal and m4@&t@_include])
914 AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
917 AT_DATA([configure.in],
923 AT_DATA([m4/stuff.m4],
924 [[AU_ALIAS([AC_OLD_MACRO], [AC_NEW_MACRO])
925 AC_DEFUN([AC_NEW_MACRO], [echo hi])
926 AC_DEFUN([AC_UNCHANGED_MACRO], [echo one])
928 cp m4/stuff.m4 aclocal/stuff.m4
929 AT_CHECK([aclocal -I aclocal], [0], [ignore], [ignore])
930 # Checking `autoupdate'.
932 AT_CHECK([aclocal -I m4], [0], [ignore], [ignore])
938 # Keeping autom4te.cfg complete
939 # -----------------------------
941 AT_SETUP([autom4te preselections])
942 : ${sleep='sleep 1'} # Command to force different time stamps.
943 # If this test should run on FAT file systems and older w32,
944 # then setting $sleep correctly needs to be revisited.
946 # We use aclocal and automake.
947 AT_CHECK([automake --version || exit 77], [], [ignore], [ignore])
948 AT_CHECK([test ! -f $HOME/.autom4te.cfg || exit 77], [], [ignore], [ignore])
950 AT_DATA([configure.in],
951 [[AC_INIT(GNU foo, 1.0)
953 AC_CONFIG_FILES([Makefile])
957 AT_DATA([Makefile.am],
958 [[AUTOMAKE_OPTIONS = foreign
961 $sleep # `aclocal.m4' should be strictly younger than its inputs
963 # If Autoconf is too old, or the user has turned caching off, skip:
964 AT_CHECK([aclocal || { ret=$?; test $ret -eq 63 && ret=77; exit $ret; }],
966 AT_CHECK([test -d autom4te.cache || exit 77])
969 # If this test fails due to missing entries in lib/autom4te.in, then
970 # comparing the old and new requests is a good place to start debugging:
971 cp autom4te.cache/requests old-requests
973 $sleep # if `configure' is regenerated, we want it to be strictly newer,
974 # to catch the error consistently.
975 AT_CHECK([aclocal], [], [], [ignore])
976 AT_CHECK([automake --no-force --add-missing], [], [], [ignore])
978 AT_CHECK([test "`find configure -newer newer`" = "" ||
979 { diff old-requests autom4te.cache/requests; exit 1; }])
984 # autotools and file names containing whitespace
985 # ---------------------------------------------
987 AT_SETUP([autotools and whitespace in file names])
990 AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
996 'with funny '\'' $x & #! name ' \
997 'with funny \ '\'' \'\'' " <a >b * ? name '
999 funny=`func_sanitize_file_name "$funny"`
1001 dir=`func_sanitize_dir_name " dir $funny"`
1005 cat >"$file.in" <<'END'
1007 m4@&t@_include([foo.m4])
1008 AC_CONFIG_HEADERS([config.h:config.hin])
1012 # skip if we cannot create such a file or directory
1013 AT_CHECK([mkdir "$dir" "$TMPDIR" && test -f "$file.in" || exit 77])
1014 cat >"$dir"/foo.m4 <<'END'
1015 [AC_DEFUN([AC_MACRO], [echo hi])]
1018 AT_CHECK_AUTOHEADER([-B "$dir" "$file.in"])
1019 AT_CHECK_AUTOHEADER([-I "$dir" "$file.in"])
1020 AT_CHECK_AUTOUPDATE([-B "$dir" "$file.in"])
1021 AT_CHECK_AUTOUPDATE([-I "$dir" "$file.in"])
1022 AT_CHECK_AUTOUPDATE([-B "$dir" - < "$file.in"], [], [ignore])
1023 AT_CHECK_AUTOCONF([-B "$dir" -o "$file" "$file.in"])
1024 AT_CHECK_AUTOCONF([-I "$dir" -o "$file" "$file.in"])
1025 # In autoconf, these exercise a slightly different code path:
1026 AT_CHECK_AUTOCONF([--prepend-include="$dir" -o "$file" "$file.in"])
1027 AT_CHECK_AUTOCONF([--include="$dir" -o "$file" "$file.in"])
1028 AT_CHECK([autoscan -B "$dir"], [], [], [ignore])
1029 AT_CHECK([autoscan -I "$dir"], [], [], [ignore])
1030 # autoreconf requires a sane input file name. Also, disable aclocal.
1031 mv -f "$file.in" configure.in
1032 AT_DATA([aclocal.m4])
1033 AT_CHECK([autoreconf -B "$dir"])
1034 AT_CHECK([autoreconf -I "$dir"])
1036 cat >"$file.c" <<'END'
1040 AT_CHECK([ifnames "$file.c"], [], [ignore])