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 dnl This test needs autom4te's cache, in spite of any ~/.autom4te.cfg.
351 AT_DATA([.autom4te.cfg], [[
352 begin-language: "Autoconf"
353 args: --cache=autom4te.cache
354 end-language: "Autoconf"
355 begin-language: "Autoconf-without-aclocal-m4"
356 args: --cache=autom4te.cache
357 end-language: "Autoconf-without-aclocal-m4"
360 AT_CHECK_AUTOCONF([], 1, [],
361 [[configure.ac:2: error: possibly undefined macro: m4@&t@_foo
362 If this token and others are legitimate, please use m4@&t@_pattern_allow.
363 See the Autoconf documentation.
364 configure.ac:3: error: possibly undefined macro: _m4@&t@_bar
365 configure.ac:4: error: possibly undefined macro: AS@&t@_FOO
366 configure.ac:5: error: possibly undefined macro: _AS@&t@_BAR
367 configure.ac:6: error: possibly undefined macro: d@&t@nl
369 # Second run should succeed and yield no output.
375 # autoconf: forbidden tokens, exceptions
376 # --------------------------------------
377 AT_SETUP([autoconf: forbidden tokens,[] exceptions])
379 AT_DATA_M4SH([configure.ac],
382 # This is allowed in spite of the name.
383 # It is on purpose that we check the case where there are several
384 # tokens on the same line.
385 m4_pattern_allow([^AS_ALLOWED$])
386 NOT_AS_ALLOWED AS_ALLOWED AS_ALLOWED_NOT
389 m4_pattern_forbid([^FORBIDDEN$])
390 NOT_FORBIDDEN FORBIDDEN FORBIDDEN_NOT
392 # Test Autoconf's patterns.
393 AS_THIS_IS_INVALID and _AS_THIS_IS_INVALID_TOO
394 BUT_AZ_THIS_IS_NOT ALTHOUGH_AS_THIS_IS
395 # This is legal, although there is `AS_DEFINE' in there.
397 # AS_THIS_IS_A_COMMENT so just shut up.
398 It would be very bad if Autoconf forgot to expand [AS_]INIT!
401 AT_CHECK_AUTOCONF([], 1, [],
402 [[configure.ac:1: error: possibly undefined macro: AS@&t@_INIT
403 If this token and others are legitimate, please use m4@&t@_pattern_allow.
404 See the Autoconf documentation.
405 configure.ac:7: error: possibly undefined macro: AS@&t@_ALLOWED_NOT
406 configure.ac:10: error: possibly undefined macro: FORBIDDEN
407 configure.ac:14: error: possibly undefined macro: AS@&t@_THIS_IS_INVALID
408 configure.ac:14: error: possibly undefined macro: _AS@&t@_THIS_IS_INVALID_TOO
414 # autoconf: automatically allowed tokens
415 # --------------------------------------
416 AT_SETUP([autoconf: automatically allowed tokens])
418 AT_DATA_M4SH([configure.ac],
420 m4_pattern_forbid([^FB_])
431 # autoconf: do not forbid the empty token
432 # ---------------------------------------
433 AT_SETUP([autoconf: the empty token])
435 AT_DATA_M4SH([configure.ac],
436 [[m4_pattern_allow([^foo$])
438 line that begins with a space
446 # autoconf: subdirectories
447 # ------------------------
448 AT_SETUP([autoconf: subdirectories])
450 AT_DATA([configure.ac],
453 AC_CONFIG_FILES(sub/foo)
459 AT_DATA([sub/foo.in],
463 AT_DATA([install-sh])
467 AT_CHECK([[grep '^[^/].*/mkdir -p' sub/foo]], 1)
472 # autoconf: input from stdin
473 # --------------------------
474 AT_SETUP([autoconf: input from stdin])
476 # Past Autoconf versions failed to read from stdin when other, non-frozen input
477 # files were present.
478 AT_DATA([aclocal.m4])
480 AT_CHECK([echo 'AC_INIT(X, 1.0, bug-autoconf@gnu.org)' | autoconf -t AC_INIT -],
481 0, [stdin:1:AC_INIT:X:1.0:bug-autoconf@gnu.org
483 AT_CHECK([echo 'AC_INIT(X, 2.0, bug-autoconf@gnu.org)' | autoconf -t AC_INIT -],
484 0, [stdin:1:AC_INIT:X:2.0:bug-autoconf@gnu.org
490 # autoconf: AC_AUTOCONF_VERSION
491 # --------------------------------------
492 AT_SETUP([autoconf: AC_AUTOCONF_VERSION])
494 AT_DATA([configure.ac],
496 version m4@&t@_defn([AC_AUTOCONF_VERSION]) version
501 AT_CHECK([[grep 'version ]]AT_PACKAGE_VERSION[[ version' configure]],
517 #if ! defined DEF3 && defined DEF4 /* but not defined DEF5 */
524 #if (VAL1*VAL2)==VAL3+VAL4 /* Not VAL5 !!! */
532 AT_CHECK([ifnames iftest1.c iftest2.c], 0,
542 VAL1 iftest1.c iftest2.c
556 # autoheader is intensively used in its modern form throughout this
557 # test suite. But we also have to check that acconfig.h still works.
558 # autoheader uses autoconf --trace, so traces first.
560 AT_SETUP([autoheader])
562 AT_DATA([acconfig.h],
563 [[/* Define this to whatever you want. */
568 # 1. Check that `acconfig.h' is still honored.
569 AT_DATA([configure.ac],
571 AC_CONFIG_HEADERS(config.h:config.hin)
572 AC_DEFINE(this, "whatever you want.")
575 AT_CHECK_AUTOHEADER([], [], [], [ignore])
576 AT_CHECK([cat config.hin], 0,
577 [[/* config.hin. Generated from configure.ac by autoheader. */
578 /* Define this to whatever you want. */
581 /* Define to the address where bug reports for this package should be sent. */
582 #undef PACKAGE_BUGREPORT
584 /* Define to the full name of this package. */
587 /* Define to the full name and version of this package. */
588 #undef PACKAGE_STRING
590 /* Define to the one symbol short name of this package. */
591 #undef PACKAGE_TARNAME
593 /* Define to the version of this package. */
594 #undef PACKAGE_VERSION
598 # 2. Check that missing templates are a fatal error.
599 AT_DATA([configure.ac],
601 AC_CONFIG_HEADERS(config.h:config.hin)
602 AC_DEFINE(that, "whatever you want.")
605 # The test suite goes too fast for the cache time stamps...
607 AT_CHECK_AUTOHEADER([--force], [1], [], [ignore])
610 # 3. Check TOP and BOTTOM.
611 AT_DATA([acconfig.h],
612 [[/* Top from acconfig.h. */
614 /* Middle from acconfig.h. */
616 /* Bottom from acconfig.h. */
619 AT_DATA([configure.ac],
621 AC_CONFIG_HEADERS(config.h:config.hin)
622 AH_TOP([Top1 from configure.ac.])
623 AH_TOP([Top2 from configure.ac.])
624 AH_TOP([The Cat in a h@t.])
625 AH_VERBATIM([Middle], [Middle from configure.ac.])
626 AH_VERBATIM([Mouse], [The Mouse in a h@t.])
627 AH_BOTTOM([Bottom1 from configure.ac.])
628 AH_BOTTOM([Bottom2 from configure.ac.])
629 AH_BOTTOM([The Dog in a h@t.])
631 AC_DEFINE([ANT], [@], [The Ant in a h@t.])
635 # Yes, that's right: the `middle' part of `acconfig.h' is still before
636 # the AH_TOP part. But so what, you're not supposed to use the two
638 # Ignore STDERR which is the longuish complaint against autoheader junk
640 AT_CHECK_AUTOHEADER([--force], [], [], [ignore])
641 AT_CHECK([cat config.hin], 0,
642 [[/* config.hin. Generated from configure.ac by autoheader. */
643 /* Top from acconfig.h. */
644 /* Middle from acconfig.h. */
646 Top1 from configure.ac.
648 Top2 from configure.ac.
652 /* The Ant in a h@t. */
655 Middle from configure.ac.
659 /* Define to the address where bug reports for this package should be sent. */
660 #undef PACKAGE_BUGREPORT
662 /* Define to the full name of this package. */
665 /* Define to the full name and version of this package. */
666 #undef PACKAGE_STRING
668 /* Define to the one symbol short name of this package. */
669 #undef PACKAGE_TARNAME
671 /* Define to the version of this package. */
672 #undef PACKAGE_VERSION
674 Bottom1 from configure.ac.
676 Bottom2 from configure.ac.
679 /* Bottom from acconfig.h. */
691 # Check that AC_CANONICAL_SYSTEM and AC_OUTPUT are properly updated.
692 AT_SETUP([autoupdate])
694 AT_DATA([configure.ac],
697 # The doc says 27 is a valid fubar.
699 AC_OUTPUT(Makefile, echo $fubar, fubar=$fubar)
703 [[AC_INIT([Test],[1.0])
705 # The doc says 27 is a valid fubar.
707 AC_CONFIG_FILES([Makefile])
708 AC_CONFIG_COMMANDS([default],[echo $fubar],[fubar=$fubar])
712 # Checking `autoupdate'.
714 AT_CHECK([cat configure.ac], 0, [expout])
715 # Checking that `autoupdate' is idempotent
717 AT_CHECK([cat configure.ac], 0, [expout])
722 # autoupdating AC_LINK_FILES
723 # --------------------------
724 AT_SETUP([autoupdating AC_LINK_FILES])
726 AT_DATA([configure.ac],
728 AC_LINK_FILES(dst1 dst2, src1 src2)
737 # Checking `autoupdate'.
738 AT_CHECK_AUTOUPDATE([], 0, [], ignore)
741 AT_CHECK([cat src1], 0, [dst1
743 AT_CHECK([cat src2], 0, [dst2
749 # autoupdating AC_PREREQ
750 # ----------------------
751 AT_SETUP([autoupdating AC_PREREQ])
753 # Produce `AC_PREREQ(<AUTOUPDATE VERSION>)'.
754 AT_CHECK([autoupdate --version | sed 's/.*) //;q'], 0, [stdout])
755 autoupdate_version=`cat stdout`
756 echo "AC_PREREQ($autoupdate_version)" >expout
758 AT_CHECK([echo "AC_PREREQ(1.0)" | autoupdate -],
761 AT_CHECK([echo "AC_PREREQ($autoupdate_version)" | autoupdate -],
764 AT_CHECK([echo "AC_PREREQ(999.99)" | autoupdate -],
770 # autoupdating AU_ALIAS
771 # ---------------------
772 AT_SETUP([autoupdating AU_ALIAS])
774 AT_DATA([configure.ac],
776 AC_DEFUN([FOO], [$#])
777 AU_ALIAS([BAZ],[FOO])
778 test "FOO:FOO():FOO(x) BAZ:BAZ():BAZ(x)" = "0:1:1 0:1:1" || exit 1
784 # Checking `autoupdate'.
788 AT_CHECK([grep 'AC_HEADER_STDC(' configure.ac], 1, [ignore], [ignore])
789 AT_CHECK([grep 'AC_HEADER_STDC' configure.ac], 0, [ignore], [ignore])
794 # autoupdating OLD to NEW
795 # -----------------------
797 # The example taken from the code comments.
798 AT_SETUP([autoupdating OLD to NEW])
800 AT_DATA([aclocal.m4],
801 [[AU_DEFUN([OLD], [NEW([$1, $2], m4@&t@_eval([$1 + $2]))])
802 AC_DEFUN([NEW], [echo "sum($1) = $2"])
805 AT_DATA([configure.ac],
811 # Checking `autoupdate'.
815 AT_CHECK([[grep 'NEW(\[1, 2], *\[3])' configure.ac]], 0, [ignore], [ignore])
816 AT_CHECK([[grep 'NEW(\[0, 0], *\[0])' configure.ac]], 0, [ignore], [ignore])
821 # autoupdating AC_HELP_STRING
822 # ---------------------------
823 AT_SETUP([autoupdating AC_HELP_STRING])
825 AT_DATA([configure.ac],
827 AC_ARG_ENABLE([foo], [AC_HELP_STRING([--enable-foo], [foo bar])], [:], [:])
830 # Checking `autoupdate'.
831 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
833 AT_CHECK_CONFIGURE([], [], [], [ignore])
834 AT_CHECK([[grep '\[--enable-foo], *\[foo bar]' configure.ac]], 0, [ignore], [ignore])
839 # autoupdating with m4sugar
840 # -------------------------
841 AT_SETUP([autoupdating with m4sugar])
843 AT_DATA([aclocal.m4],
845 [m4@&t@_pushdef([foo], [bar])dn@&t@l
847 m4@&t@_popdef([foo])dn@&t@l
853 AT_DATA([configure.ac],
855 m4_define([gnumeric_version_epoch], [1])
858 AC_FOREACH([name], [n1 n2],
861 AC_CHECKING([for feature])
862 AC_MSG_RESULT_UNQUOTED([`echo done`])
867 # Checking `autoupdate'.
868 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
870 AT_CHECK_CONFIGURE([], [], [], [ignore])
875 # autoupdating AC_LANG_SAVE
876 # -------------------------
877 AT_SETUP([autoupdating AC_LANG_SAVE])
879 AT_DATA([configure.ac],
887 # Checking `autoupdate'.
888 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
890 AT_CHECK_CONFIGURE([], [], [], [ignore])
895 # autoupdating AC_FOREACH
896 # -----------------------
897 AT_SETUP([autoupdating AC_FOREACH])
899 AT_DATA([aclocal.m4],
900 [[AU_DEFUN([OLD], [AC_FOREACH([myvar], [4 5 6], [' myvar'])])
903 AT_DATA([configure.ac],
905 echo AC_FOREACH([myvar], [1 2 3], [' myvar'])OLD
908 # Checking `autoupdate'.
910 AT_CHECK([[grep 'echo 1 2 3 4 5 6' configure.ac]], 1, [ignore], [ignore])
911 AT_CHECK([[grep 'm4@&t@_foreach_w' configure.ac]], 0, [ignore], [ignore])
913 AT_CHECK_CONFIGURE([], [0], [stdout])
914 AT_CHECK([[grep ' 1 2 3 4 5 6' stdout]], 0, [ignore], [ignore])
919 # autoupdating with aclocal and m4_include
920 # ----------------------------------------
921 AT_SETUP([autoupdating with aclocal and m4@&t@_include])
924 AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
927 AT_DATA([configure.in],
933 AT_DATA([m4/stuff.m4],
934 [[AU_ALIAS([AC_OLD_MACRO], [AC_NEW_MACRO])
935 AC_DEFUN([AC_NEW_MACRO], [echo hi])
936 AC_DEFUN([AC_UNCHANGED_MACRO], [echo one])
938 cp m4/stuff.m4 aclocal/stuff.m4
939 AT_CHECK([aclocal -I aclocal], [0], [ignore], [ignore])
940 # Checking `autoupdate'.
942 AT_CHECK([aclocal -I m4], [0], [ignore], [ignore])
948 # Keeping autom4te.cfg complete
949 # -----------------------------
951 AT_SETUP([autom4te preselections])
952 : ${sleep='sleep 1'} # Command to force different time stamps.
953 # If this test should run on FAT file systems and older w32,
954 # then setting $sleep correctly needs to be revisited.
956 # We use aclocal and automake.
957 AT_CHECK([automake --version || exit 77], [], [ignore], [ignore])
958 AT_CHECK([test ! -f $HOME/.autom4te.cfg || exit 77], [], [ignore], [ignore])
960 AT_DATA([configure.in],
961 [[AC_INIT(GNU foo, 1.0)
963 AC_CONFIG_FILES([Makefile])
967 AT_DATA([Makefile.am],
968 [[AUTOMAKE_OPTIONS = foreign
971 $sleep # `aclocal.m4' should be strictly younger than its inputs
973 # If Autoconf is too old, or the user has turned caching off, skip:
974 AT_CHECK([aclocal || { ret=$?; test $ret -eq 63 && ret=77; exit $ret; }],
976 AT_CHECK([test -d autom4te.cache || exit 77])
979 # If this test fails due to missing entries in lib/autom4te.in, then
980 # comparing the old and new requests is a good place to start debugging:
981 cp autom4te.cache/requests old-requests
983 $sleep # if `configure' is regenerated, we want it to be strictly newer,
984 # to catch the error consistently.
985 AT_CHECK([aclocal], [], [], [ignore])
986 AT_CHECK([automake --no-force --add-missing], [], [], [ignore])
988 AT_CHECK([test "`find configure -newer newer`" = "" ||
989 { diff old-requests autom4te.cache/requests; exit 1; }])
994 # autotools and file names containing whitespace
995 # ---------------------------------------------
997 AT_SETUP([autotools and whitespace in file names])
1000 AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
1006 'with funny '\'' $x & #! name ' \
1007 'with funny \ '\'' \'\'' " <a >b * ? name '
1009 funny=`func_sanitize_file_name "$funny"`
1011 dir=`func_sanitize_dir_name " dir $funny"`
1015 cat >"$file.in" <<'END'
1017 m4@&t@_include([foo.m4])
1018 AC_CONFIG_HEADERS([config.h:config.hin])
1022 # skip if we cannot create such a file or directory
1023 AT_CHECK([mkdir "$dir" "$TMPDIR" && test -f "$file.in" || exit 77])
1024 cat >"$dir"/foo.m4 <<'END'
1025 [AC_DEFUN([AC_MACRO], [echo hi])]
1028 AT_CHECK_AUTOHEADER([-B "$dir" "$file.in"])
1029 AT_CHECK_AUTOHEADER([--force -I "$dir" "$file.in"])
1030 AT_CHECK_AUTOUPDATE([-B "$dir" "$file.in"])
1031 AT_CHECK_AUTOUPDATE([--force -I "$dir" "$file.in"])
1032 AT_CHECK_AUTOUPDATE([-B "$dir" - < "$file.in"], [], [ignore])
1033 AT_CHECK_AUTOCONF([-B "$dir" -o "$file" "$file.in"])
1034 AT_CHECK_AUTOCONF([-I "$dir" -o "$file" "$file.in"])
1035 # In autoconf, these exercise a slightly different code path:
1036 AT_CHECK_AUTOCONF([--prepend-include="$dir" -o "$file" "$file.in"])
1037 AT_CHECK_AUTOCONF([--include="$dir" -o "$file" "$file.in"])
1038 AT_CHECK([autoscan -B "$dir"], [], [], [ignore])
1039 AT_CHECK([autoscan --force -I "$dir"], [], [], [ignore])
1040 # autoreconf requires a sane input file name. Also, disable aclocal.
1041 mv -f "$file.in" configure.in
1042 AT_DATA([aclocal.m4])
1043 AT_CHECK([autoreconf -B "$dir"])
1044 AT_CHECK([autoreconf --force -I "$dir"])
1046 cat >"$file.c" <<'END'
1050 AT_CHECK([ifnames "$file.c"], [], [ignore])