* tests/base.at, tests/compile.at, tests/foreign.at,
* tests/m4sh.at, tests/m4sugar.at, tests/mktests.sh,
* tests/semantics.at, tests/suite.at, tests/tools.at,
* tests/torture.at: Ask Autotest mode, not Autoconf mode.
2001-08-20 22:44:38 +08:00
|
|
|
# -*- Autotest -*-
|
2000-02-09 16:36:01 +08:00
|
|
|
|
2000-11-29 18:12:05 +08:00
|
|
|
AT_BANNER([Executables (autoheader, autoupdate...).])
|
2000-02-09 16:36:01 +08:00
|
|
|
|
2006-01-24 08:20:15 +08:00
|
|
|
# Copyright (C) 2000, 2001, 2003, 2004, 2006 Free Software Foundation, Inc.
|
* AUTHORS, BUGS, ChangeLog, ChangeLog.0, ChangeLog.1,
ChangeLog.2, GNUmakefile, Makefile.maint, NEWS, README,
README-alpha, TODO, configure.ac, lib/autoconf/Makefile.am,
m4/atconfig.m4, m4/init.m4, m4/m4.m4, m4/missing.m4,
m4/sanity.m4, tests/README, tests/aclocal.m4,
tests/atspecific.m4, tests/base.at, tests/compile.at,
tests/foreign.at, tests/m4sh.at, tests/m4sugar.at,
tests/semantics.at, tests/suite.at, tests/tools.at,
tests/torture.at: Add copyright notice.
* tests/mktests.sh: Update year in copyright notice.
2001-08-12 21:05:11 +08:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
# any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
2005-05-14 15:00:38 +08:00
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
# 02110-1301, USA.
|
* AUTHORS, BUGS, ChangeLog, ChangeLog.0, ChangeLog.1,
ChangeLog.2, GNUmakefile, Makefile.maint, NEWS, README,
README-alpha, TODO, configure.ac, lib/autoconf/Makefile.am,
m4/atconfig.m4, m4/init.m4, m4/m4.m4, m4/missing.m4,
m4/sanity.m4, tests/README, tests/aclocal.m4,
tests/atspecific.m4, tests/base.at, tests/compile.at,
tests/foreign.at, tests/m4sh.at, tests/m4sugar.at,
tests/semantics.at, tests/suite.at, tests/tools.at,
tests/torture.at: Add copyright notice.
* tests/mktests.sh: Update year in copyright notice.
2001-08-12 21:05:11 +08:00
|
|
|
|
|
|
|
|
2001-08-01 21:56:52 +08:00
|
|
|
## ----------------------------- ##
|
|
|
|
## Syntax of the shell scripts. ##
|
|
|
|
## ----------------------------- ##
|
2000-02-09 16:36:01 +08:00
|
|
|
|
2000-02-18 17:25:46 +08:00
|
|
|
# We use `/bin/sh -n script' to check that there are no syntax errors
|
|
|
|
# in the scripts. Although incredible, there are /bin/sh that go into
|
|
|
|
# endless loops with `-n', e.g., SunOS's:
|
|
|
|
#
|
|
|
|
# $ uname -a
|
|
|
|
# SunOS ondine 4.1.3 2 sun4m unknown
|
|
|
|
# $ cat endless.sh
|
|
|
|
# while false
|
|
|
|
# do
|
|
|
|
# :
|
|
|
|
# done
|
|
|
|
# exit 0
|
|
|
|
# $ time sh endless.sh
|
|
|
|
# sh endless.sh 0,02s user 0,03s system 78% cpu 0,064 total
|
|
|
|
# $ time sh -nx endless.sh
|
|
|
|
# ^Csh -nx endless.sh 3,67s user 0,03s system 63% cpu 5,868 total
|
|
|
|
#
|
|
|
|
# So before using `/bin/sh -n' to check our scripts, we first check
|
|
|
|
# that `/bin/sh -n' is not broken to death.
|
|
|
|
|
2001-08-01 21:56:52 +08:00
|
|
|
AT_SETUP([Syntax of the shell scripts])
|
2000-02-15 17:15:22 +08:00
|
|
|
|
2006-04-19 12:13:48 +08:00
|
|
|
AT_CHECK([test "$ac_cv_sh_n_works" = yes || exit 77])
|
|
|
|
|
2004-08-21 03:58:06 +08:00
|
|
|
# Specify the absolute name of the tool, as some shells don't honor PATH when
|
2001-02-28 17:33:30 +08:00
|
|
|
# running `sh PROG'.
|
|
|
|
|
2006-04-19 12:13:48 +08:00
|
|
|
AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/bin/autoconf])
|
|
|
|
AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/tests/autoconf])
|
|
|
|
AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/tests/testsuite])
|
2001-02-28 17:33:30 +08:00
|
|
|
|
|
|
|
# These are not built, they are in the src tree.
|
2006-04-19 12:13:48 +08:00
|
|
|
AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/install-sh])
|
|
|
|
AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/mkinstalldirs])
|
|
|
|
AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/missing])
|
2000-02-15 17:15:22 +08:00
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-08-01 21:56:52 +08:00
|
|
|
## ---------------------------- ##
|
|
|
|
## Syntax of the Perl scripts. ##
|
|
|
|
## ---------------------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([Syntax of the Perl scripts])
|
|
|
|
|
2001-09-13 14:54:35 +08:00
|
|
|
AT_CHECK_PERL_SYNTAX([autoheader])
|
|
|
|
AT_CHECK_PERL_SYNTAX([autom4te])
|
2001-10-08 16:26:43 +08:00
|
|
|
AT_CHECK_PERL_SYNTAX([autoreconf])
|
2001-09-13 14:54:35 +08:00
|
|
|
AT_CHECK_PERL_SYNTAX([autoscan])
|
|
|
|
AT_CHECK_PERL_SYNTAX([autoupdate])
|
|
|
|
AT_CHECK_PERL_SYNTAX([ifnames])
|
2000-10-24 02:58:43 +08:00
|
|
|
|
2001-08-01 21:56:52 +08:00
|
|
|
AT_CLEANUP
|
2000-10-24 02:58:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-10-17 01:06:57 +08:00
|
|
|
## ------------------ ##
|
|
|
|
## autom4te's cache. ##
|
|
|
|
## ------------------ ##
|
|
|
|
|
|
|
|
AT_SETUP([autom4te cache])
|
|
|
|
|
|
|
|
AT_DATA_M4SUGAR([[script.4s]],
|
|
|
|
[[m4_include([foo])
|
|
|
|
]])
|
|
|
|
|
|
|
|
# Everything is OK.
|
|
|
|
touch foo
|
|
|
|
AT_CHECK_M4SUGAR
|
|
|
|
|
|
|
|
# We moved a file: it should fail
|
|
|
|
mkdir sub
|
|
|
|
mv foo sub
|
2002-10-18 23:20:46 +08:00
|
|
|
AT_CHECK_M4SUGAR([], [1], [],
|
2002-10-17 01:06:57 +08:00
|
|
|
[m4: script.4s: 1: Cannot open foo: No such file or directory
|
2002-10-18 23:20:46 +08:00
|
|
|
autom4te: m4 failed with exit status: 1
|
2002-10-17 01:06:57 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
# But if we change the main file, then we should no longer complain of
|
|
|
|
# missing files.
|
|
|
|
AT_DATA_M4SUGAR([[script.4s]],
|
|
|
|
[[m4_include([sub/foo])
|
|
|
|
]])
|
|
|
|
AT_CHECK_M4SUGAR
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-10-24 02:58:43 +08:00
|
|
|
|
2000-03-21 20:08:24 +08:00
|
|
|
## ------------------ ##
|
|
|
|
## autoconf --trace. ##
|
|
|
|
## ------------------ ##
|
|
|
|
|
2000-11-02 23:32:23 +08:00
|
|
|
|
2000-12-06 18:53:58 +08:00
|
|
|
# autoconf --trace: user macros
|
|
|
|
# -----------------------------
|
|
|
|
AT_SETUP([autoconf --trace: user macros])
|
2001-09-10 15:18:17 +08:00
|
|
|
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([configure.ac],
|
2001-01-18 17:16:08 +08:00
|
|
|
[[m4_define([active], [ACTIVE])
|
|
|
|
m4_define([TRACE1], [TRACE2(m4_shift($@))])
|
|
|
|
m4_define([TRACE2], [[$2], $1])
|
2001-08-04 21:13:36 +08:00
|
|
|
|
|
|
|
# No arguments.
|
|
|
|
TRACE1
|
|
|
|
TRACE2
|
|
|
|
|
|
|
|
# With arguments, single line.
|
2002-10-22 16:20:19 +08:00
|
|
|
TRACE1(foo, @bar, @baz)
|
Various cleanups and consistency checks.
* m4sugar.m4: Formatting changes.
* acgeneral.m4 (AC_DIVERT_PUSH, AC_DIVERT_POP, AC_REQUIRE)
(AC_DIAGNOSE, AC_FATAL, AC_MSG_WARN, AC_MSG_NOTICE, AC_MSG_ERROR):
Use m4_copy to define them, in order to keep a good $0.
(AC_INIT): AC_LANG_PUSH C, not AC_LANG, to initialize the stack.
* aclang.m4 (AC_LANG_PUSH): Dont't use m4_defn on undefined macros.
(AC_LANG_POP): Admit an argument specifying the language we quit
when popping.
Adjust Autoconf's AC_LANG_POPs.
* tests/tools.at (AWK portability): Don't depend on AC_INIT.
(autoconf --trace: user macros): Obviously I
meant TRACE1, not AC_TRACE1.
2001-01-18 17:15:31 +08:00
|
|
|
TRACE1(foo, TRACE1(bar, baz))
|
2000-03-21 20:08:24 +08:00
|
|
|
TRACE1(foo, active, baz)
|
|
|
|
TRACE1(foo, [active], TRACE1(active, [active]))
|
2001-08-04 21:13:36 +08:00
|
|
|
|
|
|
|
# With arguments, multiple lines.
|
|
|
|
TRACE1(foo
|
|
|
|
bar,
|
|
|
|
bar
|
|
|
|
foo)
|
2000-03-21 20:08:24 +08:00
|
|
|
]])
|
|
|
|
|
|
|
|
# Several --traces.
|
2001-08-01 21:56:52 +08:00
|
|
|
AT_CHECK_AUTOCONF([-t TRACE1 -t TRACE2], 0,
|
2001-08-04 21:13:36 +08:00
|
|
|
[[configure.ac:6:TRACE1:
|
|
|
|
configure.ac:6:TRACE2:
|
|
|
|
configure.ac:7:TRACE2:
|
2002-10-22 16:20:19 +08:00
|
|
|
configure.ac:10:TRACE1:foo:@bar:@baz
|
|
|
|
configure.ac:10:TRACE2:@bar:@baz
|
2001-08-04 21:13:36 +08:00
|
|
|
configure.ac:11:TRACE1:bar:baz
|
|
|
|
configure.ac:11:TRACE2:baz
|
|
|
|
configure.ac:11:TRACE1:foo::baz
|
|
|
|
configure.ac:11:TRACE2::baz
|
|
|
|
configure.ac:12:TRACE1:foo:ACTIVE:baz
|
|
|
|
configure.ac:12:TRACE2:ACTIVE:baz
|
|
|
|
configure.ac:13:TRACE1:ACTIVE:active
|
|
|
|
configure.ac:13:TRACE2:active
|
|
|
|
configure.ac:13:TRACE1:foo:active::ACTIVE
|
|
|
|
configure.ac:13:TRACE2:active::ACTIVE
|
|
|
|
configure.ac:19:TRACE1:foo bar:bar foo
|
|
|
|
configure.ac:19:TRACE2:bar foo
|
2000-03-21 20:08:24 +08:00
|
|
|
]])
|
|
|
|
|
|
|
|
# Several line requests.
|
2001-08-01 21:56:52 +08:00
|
|
|
AT_CHECK_AUTOCONF([[-t TRACE1:'
|
2000-03-21 20:08:24 +08:00
|
|
|
[$1], [$2], [$3].']], 0,
|
|
|
|
[[
|
2001-08-04 21:13:36 +08:00
|
|
|
[], [], [].
|
|
|
|
|
2002-10-22 16:20:19 +08:00
|
|
|
[foo], [@bar], [@baz].
|
2000-03-21 20:08:24 +08:00
|
|
|
|
Various cleanups and consistency checks.
* m4sugar.m4: Formatting changes.
* acgeneral.m4 (AC_DIVERT_PUSH, AC_DIVERT_POP, AC_REQUIRE)
(AC_DIAGNOSE, AC_FATAL, AC_MSG_WARN, AC_MSG_NOTICE, AC_MSG_ERROR):
Use m4_copy to define them, in order to keep a good $0.
(AC_INIT): AC_LANG_PUSH C, not AC_LANG, to initialize the stack.
* aclang.m4 (AC_LANG_PUSH): Dont't use m4_defn on undefined macros.
(AC_LANG_POP): Admit an argument specifying the language we quit
when popping.
Adjust Autoconf's AC_LANG_POPs.
* tests/tools.at (AWK portability): Don't depend on AC_INIT.
(autoconf --trace: user macros): Obviously I
meant TRACE1, not AC_TRACE1.
2001-01-18 17:15:31 +08:00
|
|
|
[bar], [baz], [].
|
|
|
|
|
|
|
|
[foo], [], [baz].
|
2000-03-21 20:08:24 +08:00
|
|
|
|
|
|
|
[foo], [ACTIVE], [baz].
|
|
|
|
|
|
|
|
[ACTIVE], [active], [].
|
|
|
|
|
|
|
|
[foo], [active], [].
|
2001-08-04 21:13:36 +08:00
|
|
|
|
|
|
|
[foo
|
|
|
|
bar], [bar
|
|
|
|
foo], [].
|
2000-03-21 20:08:24 +08:00
|
|
|
]])
|
|
|
|
|
|
|
|
# ${sep}@.
|
2001-08-01 21:56:52 +08:00
|
|
|
AT_CHECK_AUTOCONF([-t TRACE2:'${)===(}@'], 0,
|
2001-08-04 21:13:36 +08:00
|
|
|
[[[]
|
|
|
|
[]
|
2002-10-22 16:20:19 +08:00
|
|
|
[@bar])===([@baz]
|
Various cleanups and consistency checks.
* m4sugar.m4: Formatting changes.
* acgeneral.m4 (AC_DIVERT_PUSH, AC_DIVERT_POP, AC_REQUIRE)
(AC_DIAGNOSE, AC_FATAL, AC_MSG_WARN, AC_MSG_NOTICE, AC_MSG_ERROR):
Use m4_copy to define them, in order to keep a good $0.
(AC_INIT): AC_LANG_PUSH C, not AC_LANG, to initialize the stack.
* aclang.m4 (AC_LANG_PUSH): Dont't use m4_defn on undefined macros.
(AC_LANG_POP): Admit an argument specifying the language we quit
when popping.
Adjust Autoconf's AC_LANG_POPs.
* tests/tools.at (AWK portability): Don't depend on AC_INIT.
(autoconf --trace: user macros): Obviously I
meant TRACE1, not AC_TRACE1.
2001-01-18 17:15:31 +08:00
|
|
|
[baz]
|
|
|
|
[])===([baz]
|
2000-03-21 20:08:24 +08:00
|
|
|
[ACTIVE])===([baz]
|
|
|
|
[active]
|
|
|
|
[active])===([])===([ACTIVE]
|
2001-08-04 21:13:36 +08:00
|
|
|
[bar
|
|
|
|
foo]
|
2000-03-21 20:08:24 +08:00
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CLEANUP
|
2000-08-07 20:07:43 +08:00
|
|
|
|
|
|
|
|
2000-12-06 18:53:58 +08:00
|
|
|
# autoconf --trace: builtins
|
|
|
|
# --------------------------
|
|
|
|
AT_SETUP([autoconf --trace: builtins])
|
2000-11-02 23:32:23 +08:00
|
|
|
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-11-02 23:32:23 +08:00
|
|
|
[[define([active], [ACTIVE])
|
|
|
|
]])
|
|
|
|
|
2001-08-01 21:56:52 +08:00
|
|
|
AT_CHECK_AUTOCONF([[-t define | sed -n '$p']],
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 21:24:04 +08:00
|
|
|
0,
|
2000-12-23 18:11:57 +08:00
|
|
|
[[configure.ac:1:define:active:ACTIVE
|
2000-11-02 23:32:23 +08:00
|
|
|
]])
|
|
|
|
|
|
|
|
# FIXME: Without `$1' the following test dies. Groumphf, once again to
|
|
|
|
# dive into obscure feature interaction...
|
2000-11-14 21:25:35 +08:00
|
|
|
# Note that using `-i' means we need the *.m4 files, not the *.m4f files,
|
|
|
|
# hence we need srcdir, not builddir.
|
* configure.ac: Also find tested executables in bin.
* bin/autoconf.in, bin/autoheader.in, bin/autoreconf.in,
* bin/autoscan.in, autoupdate.in: Use exclusively the name of the
installed peer executables, only PATH is allowed to resolve it.
Pass `autoconf_dir' via options, not via invisible envvars.
* lib/Autom4te/General.pm (&find_peer): Remove.
* lib/autotest/general.m4 (AT_INIT): `AUTOTEST_PATH=a:b' gives
`abuild:asrc:bbuild:bsrc', not `abuild:bbuild:asrc:bsrc'.
* man/Makefile.am: Let help2man rely on PATH instead of trying to
find the executables for it.
* tests/Makefile.am: Major cleanup. Too lazy to document...
* tests/atlocal.in: Remove all the obscure envvar manipulations.
We only need PERL.
* tests/atspecific.m4, tests/tools.at: Passing --localdir is
indeed related to running the test suite, while passing
--autoconf-dir and others is related to running non installed
Autoconf executables. So don't do that, leave it to...
* tests/autoconf, tests/autoheader, tests/autom4te, tests/autoupdate,
* tests/autoscan: New.
* tests/atspecific.m4 (AT_CHECK_M4SUGAR, AT_CHECK_M4SH): Don't
refer to library files: rely on --language.
2001-08-31 21:30:11 +08:00
|
|
|
AT_CHECK_AUTOCONF([[-t define:'$1' -i| sed -n '$p']],
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 21:24:04 +08:00
|
|
|
0,
|
2000-11-02 23:32:23 +08:00
|
|
|
[[active
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
2000-08-07 20:07:43 +08:00
|
|
|
|
2000-12-06 23:00:45 +08:00
|
|
|
## ---------------------------- ##
|
|
|
|
## autoconf: forbidden tokens. ##
|
|
|
|
## ---------------------------- ##
|
2000-08-07 20:07:43 +08:00
|
|
|
|
2001-10-08 16:20:59 +08:00
|
|
|
|
2000-12-16 03:23:16 +08:00
|
|
|
# autoconf: forbidden tokens, basic
|
|
|
|
# ---------------------------------
|
|
|
|
AT_SETUP([autoconf: forbidden tokens, basic])
|
|
|
|
|
2001-10-08 16:21:54 +08:00
|
|
|
AT_DATA_M4SH([configure.ac],
|
2001-10-08 16:20:59 +08:00
|
|
|
[[AS_INIT
|
2000-12-16 03:23:16 +08:00
|
|
|
m4_foo
|
|
|
|
_m4_bar
|
|
|
|
AS_FOO
|
|
|
|
_AS_BAR
|
2001-10-08 16:22:49 +08:00
|
|
|
[dnl]
|
2000-12-16 03:23:16 +08:00
|
|
|
]])
|
|
|
|
|
2001-10-08 16:21:54 +08:00
|
|
|
AT_DATA_M4SH([experr],
|
2001-10-08 16:20:59 +08:00
|
|
|
[[configure.ac:2: error: possibly undefined macro: m4_foo
|
2002-06-07 19:20:19 +08:00
|
|
|
If this token and others are legitimate, please use m4_pattern_allow.
|
|
|
|
See the Autoconf documentation.
|
2001-10-08 16:20:59 +08:00
|
|
|
configure.ac:3: error: possibly undefined macro: _m4_bar
|
|
|
|
configure.ac:4: error: possibly undefined macro: AS_FOO
|
|
|
|
configure.ac:5: error: possibly undefined macro: _AS_BAR
|
2001-11-13 23:18:26 +08:00
|
|
|
configure.ac:6: error: possibly undefined macro: dnl
|
2000-12-16 03:23:16 +08:00
|
|
|
]])
|
|
|
|
|
2001-10-08 16:20:59 +08:00
|
|
|
AT_CHECK_AUTOCONF([], 1, [], experr)
|
|
|
|
|
2001-08-03 17:09:45 +08:00
|
|
|
AT_CLEANUP
|
2000-12-16 03:23:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
# autoconf: forbidden tokens, exceptions
|
|
|
|
# --------------------------------------
|
|
|
|
AT_SETUP([autoconf: forbidden tokens, exceptions])
|
2000-08-07 20:07:43 +08:00
|
|
|
|
2001-10-08 16:21:54 +08:00
|
|
|
AT_DATA_M4SH([configure.ac],
|
2001-10-08 16:20:59 +08:00
|
|
|
[[AS_INIT
|
* m4sugar.m4 (m4_dquote, m4_pattern_forbid, m4_pattern_allow)
(m4_cr_letters, m4_cr_LETTERS, m4_cr_Letters, m4_cr_digits)
(m4_cr_symbols1, m4_cr_symbols2, m4_re_string, m4_re_word)
(m4_init): New macros.
(m4_token_allow): Remove.
* acgeneral.m4: Don't push BODY into the diversion stack.
(AC_PLAIN_SCRIPT): Do it.
Call m4_init, define the Autoconf patterns.
(AC_INIT): Use AC_PLAIN_SCRIPT.
Remove the useless `dnl' (those where the current diversion is
KILL).
* autoconf.sh (m4_common): Fix quotation.
(finalize.awk): Load forbidden.rx and allowed.rx.
Split the line into tokens, and check their validity.
* tests/tools.at (Forbidden tokens): Adjust.
2000-12-06 16:58:13 +08:00
|
|
|
|
|
|
|
# This is allowed in spite of the name.
|
2000-12-06 23:00:45 +08:00
|
|
|
# It is on purpose that we check the case where there are several
|
|
|
|
# tokens on the same line.
|
2001-10-08 16:20:59 +08:00
|
|
|
m4_pattern_allow([^AS_ALLOWED$])
|
|
|
|
NOT_AS_ALLOWED AS_ALLOWED AS_ALLOWED_NOT
|
* m4sugar.m4 (m4_dquote, m4_pattern_forbid, m4_pattern_allow)
(m4_cr_letters, m4_cr_LETTERS, m4_cr_Letters, m4_cr_digits)
(m4_cr_symbols1, m4_cr_symbols2, m4_re_string, m4_re_word)
(m4_init): New macros.
(m4_token_allow): Remove.
* acgeneral.m4: Don't push BODY into the diversion stack.
(AC_PLAIN_SCRIPT): Do it.
Call m4_init, define the Autoconf patterns.
(AC_INIT): Use AC_PLAIN_SCRIPT.
Remove the useless `dnl' (those where the current diversion is
KILL).
* autoconf.sh (m4_common): Fix quotation.
(finalize.awk): Load forbidden.rx and allowed.rx.
Split the line into tokens, and check their validity.
* tests/tools.at (Forbidden tokens): Adjust.
2000-12-06 16:58:13 +08:00
|
|
|
|
|
|
|
# Test forbidding.
|
2001-10-08 16:20:59 +08:00
|
|
|
m4_pattern_forbid([^FORBIDDEN$])
|
* m4sugar.m4 (m4_dquote, m4_pattern_forbid, m4_pattern_allow)
(m4_cr_letters, m4_cr_LETTERS, m4_cr_Letters, m4_cr_digits)
(m4_cr_symbols1, m4_cr_symbols2, m4_re_string, m4_re_word)
(m4_init): New macros.
(m4_token_allow): Remove.
* acgeneral.m4: Don't push BODY into the diversion stack.
(AC_PLAIN_SCRIPT): Do it.
Call m4_init, define the Autoconf patterns.
(AC_INIT): Use AC_PLAIN_SCRIPT.
Remove the useless `dnl' (those where the current diversion is
KILL).
* autoconf.sh (m4_common): Fix quotation.
(finalize.awk): Load forbidden.rx and allowed.rx.
Split the line into tokens, and check their validity.
* tests/tools.at (Forbidden tokens): Adjust.
2000-12-06 16:58:13 +08:00
|
|
|
NOT_FORBIDDEN FORBIDDEN FORBIDDEN_NOT
|
|
|
|
|
|
|
|
# Test Autoconf's patterns.
|
2001-10-08 16:20:59 +08:00
|
|
|
AS_THIS_IS_INVALID and _AS_THIS_IS_INVALID_TOO
|
|
|
|
BUT_AZ_THIS_IS_NOT ALTHOUGH_AS_THIS_IS
|
|
|
|
# This is legal, although there is `AS_DEFINE' in there.
|
|
|
|
BAS_DEFINE
|
|
|
|
# AS_THIS_IS_A_COMMENT so just shut up.
|
|
|
|
It would be very bad if Autoconf forgot to expand [AS_]INIT!
|
2000-08-07 20:07:43 +08:00
|
|
|
]])
|
|
|
|
|
2001-10-08 16:21:54 +08:00
|
|
|
AT_DATA_M4SH([experr],
|
2001-10-08 16:20:59 +08:00
|
|
|
[[configure.ac:1: error: possibly undefined macro: AS_INIT
|
2002-06-07 19:20:19 +08:00
|
|
|
If this token and others are legitimate, please use m4_pattern_allow.
|
|
|
|
See the Autoconf documentation.
|
2001-10-08 16:20:59 +08:00
|
|
|
configure.ac:7: error: possibly undefined macro: AS_ALLOWED_NOT
|
2001-08-03 17:09:45 +08:00
|
|
|
configure.ac:10: error: possibly undefined macro: FORBIDDEN
|
2001-10-08 16:20:59 +08:00
|
|
|
configure.ac:14: error: possibly undefined macro: AS_THIS_IS_INVALID
|
|
|
|
configure.ac:14: error: possibly undefined macro: _AS_THIS_IS_INVALID_TOO
|
2000-08-07 20:07:43 +08:00
|
|
|
]])
|
|
|
|
|
2001-10-08 16:20:59 +08:00
|
|
|
AT_CHECK_AUTOCONF([], 1, [], [experr])
|
|
|
|
|
2001-08-03 17:09:45 +08:00
|
|
|
AT_CLEANUP
|
2000-08-09 14:53:07 +08:00
|
|
|
|
|
|
|
|
2006-05-22 23:54:09 +08:00
|
|
|
# autoconf: automatically allowed tokens
|
|
|
|
# --------------------------------------
|
|
|
|
AT_SETUP([autoconf: automatically alowed tokens])
|
|
|
|
|
|
|
|
AT_DATA_M4SH([configure.ac],
|
|
|
|
[[AC_INIT
|
|
|
|
m4_pattern_forbid([^FB_])
|
|
|
|
AC_DEFINE([FB_ONE])
|
|
|
|
AC_SUBST([FB_TWO])
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
2006-05-19 12:14:13 +08:00
|
|
|
# autoconf: subdirectories
|
|
|
|
# --------------------------------------
|
|
|
|
AT_SETUP([autoconf: subdirectories])
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
|
|
|
AC_PROG_MKDIR_P
|
|
|
|
AC_CONFIG_FILES(sub/foo)
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
mkdir sub
|
|
|
|
|
|
|
|
AT_DATA([sub/foo.in],
|
|
|
|
[[@MKDIR_P@
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([install-sh])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE
|
2006-05-27 10:54:33 +08:00
|
|
|
AT_CHECK([[grep '^[^/].*/mkdir -p' sub/foo]], 1)
|
2006-05-19 12:14:13 +08:00
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
2000-08-09 14:53:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2000-11-03 01:03:32 +08:00
|
|
|
## --------- ##
|
|
|
|
## ifnames. ##
|
|
|
|
## --------- ##
|
|
|
|
|
2000-11-14 21:25:35 +08:00
|
|
|
AT_SETUP([ifnames])
|
2000-11-03 01:03:32 +08:00
|
|
|
|
|
|
|
AT_DATA([iftest1.c],
|
|
|
|
[[#ifdef DEF1
|
|
|
|
#ifndef DEF2
|
2006-01-24 08:20:15 +08:00
|
|
|
#if ! defined DEF3 && defined DEF4 /* but not defined DEF5 */
|
2000-11-03 01:03:32 +08:00
|
|
|
# if SPACES
|
|
|
|
# if TABS
|
|
|
|
/* #if C_COMMENTS */
|
|
|
|
// #if CXX_COMMENTS
|
|
|
|
#if LINE1 = \
|
|
|
|
LINE2
|
|
|
|
#if (VAL1*VAL2)==VAL3+VAL4 /* Not VAL5 !!! */
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([iftest2.c],
|
|
|
|
[[#ifdef IFTEST2
|
|
|
|
#if VAL1
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK([ifnames iftest1.c iftest2.c], 0,
|
|
|
|
[DEF1 iftest1.c
|
|
|
|
DEF2 iftest1.c
|
|
|
|
DEF3 iftest1.c
|
|
|
|
DEF4 iftest1.c
|
|
|
|
IFTEST2 iftest2.c
|
|
|
|
LINE1 iftest1.c
|
|
|
|
LINE2 iftest1.c
|
|
|
|
SPACES iftest1.c
|
|
|
|
TABS iftest1.c
|
|
|
|
VAL1 iftest1.c iftest2.c
|
|
|
|
VAL2 iftest1.c
|
|
|
|
VAL3 iftest1.c
|
|
|
|
VAL4 iftest1.c
|
|
|
|
], [])
|
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CLEANUP
|
2000-12-06 18:53:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## ------------ ##
|
|
|
|
## autoheader. ##
|
|
|
|
## ------------ ##
|
|
|
|
|
2001-11-25 23:13:03 +08:00
|
|
|
# autoheader is intensively used in its modern form throughout this
|
2000-12-06 18:53:58 +08:00
|
|
|
# test suite. But we also have to check that acconfig.h still works.
|
|
|
|
# autoheader uses autoconf --trace, so traces first.
|
|
|
|
|
|
|
|
AT_SETUP([autoheader])
|
|
|
|
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([acconfig.h],
|
2000-12-06 18:53:58 +08:00
|
|
|
[[/* Define this to whatever you want. */
|
|
|
|
#undef this
|
|
|
|
]])
|
|
|
|
|
|
|
|
|
|
|
|
# 1. Check that `acconfig.h' is still honored.
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-12-06 18:53:58 +08:00
|
|
|
[[AC_INIT
|
2001-08-31 21:33:10 +08:00
|
|
|
AC_CONFIG_HEADERS(config.h:config.hin)
|
2000-12-06 18:53:58 +08:00
|
|
|
AC_DEFINE(this, "whatever you want.")
|
|
|
|
]])
|
|
|
|
|
2001-08-31 21:33:10 +08:00
|
|
|
AT_CHECK_AUTOHEADER([], [], [], [ignore])
|
|
|
|
AT_CHECK([cat config.hin], 0,
|
|
|
|
[[/* config.hin. Generated from configure.ac by autoheader. */
|
2000-12-06 18:53:58 +08:00
|
|
|
/* Define this to whatever you want. */
|
|
|
|
#undef this
|
2002-01-07 04:48:10 +08:00
|
|
|
|
|
|
|
/* Define to the address where bug reports for this package should be sent. */
|
|
|
|
#undef PACKAGE_BUGREPORT
|
|
|
|
|
|
|
|
/* Define to the full name of this package. */
|
|
|
|
#undef PACKAGE_NAME
|
|
|
|
|
|
|
|
/* Define to the full name and version of this package. */
|
|
|
|
#undef PACKAGE_STRING
|
|
|
|
|
|
|
|
/* Define to the one symbol short name of this package. */
|
|
|
|
#undef PACKAGE_TARNAME
|
|
|
|
|
|
|
|
/* Define to the version of this package. */
|
|
|
|
#undef PACKAGE_VERSION
|
2001-08-31 21:33:10 +08:00
|
|
|
]])
|
2000-12-06 18:53:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
# 2. Check that missing templates are a fatal error.
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-12-06 18:53:58 +08:00
|
|
|
[[AC_INIT
|
2001-08-31 21:33:10 +08:00
|
|
|
AC_CONFIG_HEADERS(config.h:config.hin)
|
2000-12-06 18:53:58 +08:00
|
|
|
AC_DEFINE(that, "whatever you want.")
|
|
|
|
]])
|
|
|
|
|
2001-08-31 21:33:10 +08:00
|
|
|
# The test suite goes too fast for the cache time stamps...
|
|
|
|
# Pass --force.
|
|
|
|
AT_CHECK_AUTOHEADER([--force], [1], [], [ignore])
|
2000-12-06 18:53:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
# 3. Check TOP and BOTTOM.
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([acconfig.h],
|
2000-12-06 18:53:58 +08:00
|
|
|
[[/* Top from acconfig.h. */
|
|
|
|
@TOP@
|
|
|
|
/* Middle from acconfig.h. */
|
|
|
|
@BOTTOM@
|
|
|
|
/* Bottom from acconfig.h. */
|
|
|
|
]])
|
|
|
|
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-12-06 18:53:58 +08:00
|
|
|
[[AC_INIT
|
2001-08-31 21:33:10 +08:00
|
|
|
AC_CONFIG_HEADERS(config.h:config.hin)
|
2000-12-23 18:11:57 +08:00
|
|
|
AH_TOP([Top1 from configure.ac.])
|
|
|
|
AH_TOP([Top2 from configure.ac.])
|
2002-10-22 16:20:19 +08:00
|
|
|
AH_TOP([The Cat in a h@t.])
|
2000-12-23 18:11:57 +08:00
|
|
|
AH_VERBATIM([Middle], [Middle from configure.ac.])
|
2002-10-22 16:20:19 +08:00
|
|
|
AH_VERBATIM([Mouse], [The Mouse in a h@t.])
|
2000-12-23 18:11:57 +08:00
|
|
|
AH_BOTTOM([Bottom1 from configure.ac.])
|
|
|
|
AH_BOTTOM([Bottom2 from configure.ac.])
|
2002-10-22 16:20:19 +08:00
|
|
|
AH_BOTTOM([The Dog in a h@t.])
|
2002-10-17 17:57:31 +08:00
|
|
|
|
2002-10-22 16:20:19 +08:00
|
|
|
AC_DEFINE([ANT], [@], [The Ant in a h@t.])
|
2000-12-06 18:53:58 +08:00
|
|
|
]])
|
|
|
|
|
|
|
|
|
|
|
|
# Yes, that's right: the `middle' part of `acconfig.h' is still before
|
|
|
|
# the AH_TOP part. But so what, you're not supposed to use the two
|
|
|
|
# together.
|
2001-08-31 21:32:54 +08:00
|
|
|
# Ignore STDERR which is the longuish complaint against autoheader junk
|
|
|
|
# files.
|
2001-08-31 21:33:10 +08:00
|
|
|
AT_CHECK_AUTOHEADER([--force], [], [], [ignore])
|
|
|
|
AT_CHECK([cat config.hin], 0,
|
|
|
|
[[/* config.hin. Generated from configure.ac by autoheader. */
|
2000-12-06 18:53:58 +08:00
|
|
|
/* Top from acconfig.h. */
|
|
|
|
/* Middle from acconfig.h. */
|
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
Top1 from configure.ac.
|
2000-12-06 18:53:58 +08:00
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
Top2 from configure.ac.
|
2000-12-06 18:53:58 +08:00
|
|
|
|
2002-10-22 16:20:19 +08:00
|
|
|
The Cat in a h@t.
|
2002-10-17 17:57:31 +08:00
|
|
|
|
2002-10-22 16:20:19 +08:00
|
|
|
/* The Ant in a h@t. */
|
2002-10-17 17:57:31 +08:00
|
|
|
#undef ANT
|
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
Middle from configure.ac.
|
2000-12-06 18:53:58 +08:00
|
|
|
|
2002-10-22 16:20:19 +08:00
|
|
|
The Mouse in a h@t.
|
2002-10-17 17:57:31 +08:00
|
|
|
|
2002-01-07 04:48:10 +08:00
|
|
|
/* Define to the address where bug reports for this package should be sent. */
|
|
|
|
#undef PACKAGE_BUGREPORT
|
|
|
|
|
|
|
|
/* Define to the full name of this package. */
|
|
|
|
#undef PACKAGE_NAME
|
|
|
|
|
|
|
|
/* Define to the full name and version of this package. */
|
|
|
|
#undef PACKAGE_STRING
|
|
|
|
|
|
|
|
/* Define to the one symbol short name of this package. */
|
|
|
|
#undef PACKAGE_TARNAME
|
|
|
|
|
|
|
|
/* Define to the version of this package. */
|
|
|
|
#undef PACKAGE_VERSION
|
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
Bottom1 from configure.ac.
|
2000-12-06 18:53:58 +08:00
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
Bottom2 from configure.ac.
|
2002-10-17 17:57:31 +08:00
|
|
|
|
2002-10-22 16:20:19 +08:00
|
|
|
The Dog in a h@t.
|
2000-12-06 18:53:58 +08:00
|
|
|
/* Bottom from acconfig.h. */
|
2001-08-31 21:33:10 +08:00
|
|
|
]])
|
2000-12-06 18:53:58 +08:00
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## ------------ ##
|
|
|
|
## autoupdate. ##
|
|
|
|
## ------------ ##
|
|
|
|
|
|
|
|
# Check that AC_CANONICAL_SYSTEM and AC_OUTPUT are properly updated.
|
|
|
|
AT_SETUP([autoupdate])
|
|
|
|
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-12-06 18:53:58 +08:00
|
|
|
[[AC_INIT(Test, 1.0)
|
|
|
|
AC_CANONICAL_SYSTEM
|
2001-08-20 22:45:00 +08:00
|
|
|
# The doc says 27 is a valid fubar.
|
2000-12-06 18:53:58 +08:00
|
|
|
fubar=27
|
|
|
|
AC_OUTPUT(Makefile, echo $fubar, fubar=$fubar)
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([expout],
|
|
|
|
[[AC_INIT([Test],[1.0])
|
2006-02-15 07:18:51 +08:00
|
|
|
AC_CANONICAL_TARGET
|
2001-08-20 22:45:00 +08:00
|
|
|
# The doc says 27 is a valid fubar.
|
2000-12-06 18:53:58 +08:00
|
|
|
fubar=27
|
|
|
|
AC_CONFIG_FILES([Makefile])
|
Rewrite substantial part of lib/autoconf/status.m4.
The main change is that CONFIG_FILES, CONFIG_HEADERS, CONFIG_LINKS,
and CONFIG_COMMANDS are not processed in four separate loops.
Instead, there is one main loop. This alows that the common code
is expanded only once, thus config.status (and configure) is smaller.
The registration mechnism in AC_CONFIG_FILES and cousins also changed;
the AC_LIST_FILES and cousins macros are no longer used.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES, _AC_OUTPUT_HEADERS,
_AC_OUTPUT_LINKS, _AC_OUTPUT_COMMANDS): Renamed to ...
(_AC_OUTPUT_FILE, _AC_OUTPUT_HEADER, _AC_OUTPUT_LINK,
_AC_OUTPUT_COMMAND): ..., respectively. These macros no longer
contains the initialization, nor the for loop, nor the associated
commands; all these go to ...
(_AC_OUTPUT_MAIN_LOOP): ... this new macro, called from
_AC_OUTPUT_CONFIG_STATUS.
(_AC_CONFIG_SPLIT, _AC_CONFIG_SPLIT_SOURCE_DEST, _AC_CONFIG_SPLIT_FILE_IN):
Nuked; the code was merged into _AC_OUTPUT_MAIN_LOOP.
(_AC_OUTPUT_FILE): The creation of the sed script ...
(AC_OUTPUT): ... and the setup of ac_vpsub goes to ...
(_AC_OUTPUT_FILES_PREPARE): ... a new macro, also called from
_AC_OUTPUT_MAIN_LOOP.
(_AC_CONFIG_FILES, _AC_CONFIG_HEADERS, _AC_CONFIG_LINKS,
_AC_CONFIG_COMMANDS): Use ...
(_AC_CONFIG_FOOS): ... this new macro, which uses these ...
(_AC_CONFIG_REGISTER, _AC_CONFIG_REGISTER_DEST): ... new macros.
(_AC_CONFIG_FILE, _AC_CONFIG_HEADER, _AC_CONFIG_LINK,
_AC_CONFIG_COMMAND, _AC_CONFIG_DEPENDENCIES): No longer needed.
(_AC_CONFIG_DEPENDENCY): Update, it uses these ...
(_AC_CONFIG_DEPENDENCY_DEFAULT, _AC_FILE_DEPENDENCY_TRACE_COLON):
... new macros.
(_AC_CONFIG_UNIQUE): Update.
(AC_LIST_FILES, AC_LIST_HEADERS, AC_LIST_LINKS, AC_LIST_COMMANDS):
Replaced by this ...
(_AC_LIST_TAGS): ... new common macro.
(AC_LIST_FILE_COMMANDS, AC_LIST_HEADER_COMMANDS, AC_LIST_LINK_COMMANDS,
AC_LIST_COMMAND_COMMANDS): Replaced by this ...
(_AC_LIST_TAG_COMMANDS): ... new common macro.
(_AC_CONFIG_COMMANDS_INIT): Moved top to the `registration' section;
this didn't belong to the `config commands' section.
(_AC_OUTPUT_COMMANDS_INIT): Don't initialize, m4_ifdef is our friend.
(AC_CONFIG_COMMANDS_PRE, AC_OUTPUT_COMMANDS_PRE,
AC_CONFIG_COMMANDS_POST): Moved to a new section, these didn't belong
to the `config commands' section either.
(AC_CONFIG_SUBDIRS): Don't touch diversion DEFAULTS.
(_AC_LIST_SUBDIRS): Don't initialize, m4_ifdef is our friend.
... and many changes to the comments nearby.
* lib/autoconf/general.m4 (_AC_INIT_DEFAULTS): At the end of the day,
set ac_subdirs_all='_AC_LIST_SUBDIRS'.
* tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
AC_CONFIG_COMMANDS(command:input,...) is no longer allowed.
(#define header templates): The comment at the top of the generated
header now includes the name(s) of the source file(s).
Several unrelated small changes:
* lib/autoconf/general.m4 (AC_CACHE_VAL): Be didactic, quote the first
parameter to AC_DIAGNOSE.
* lib/autoconf/status.m4 (AC_CONFIG_SUBDIRS): Likewise.
(_AC_LINK_FILES_CNT): Don't AU_DEFUN this; it causes confusing messages
with autoupdate; use m4_define_default inside AU_DEFUNed AC_LINK_FILES.
(AC_OUTPUT): In the compatibility code, use m4_ifvaln, to be consistent
with AU::AC_OUTPUT.
(AU::AC_OUTPUT): Don't double-quote $2 and $3, the compatibility code
in AC_OUTPUT doesn't double-quote it either.
* tests/tools.at (autoupdate): AU::AC_OUTPUT no longer double-quotes the
parameters.
2005-07-26 02:10:25 +08:00
|
|
|
AC_CONFIG_COMMANDS([default],[echo $fubar],[fubar=$fubar])
|
2000-12-06 18:53:58 +08:00
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
# Checking `autoupdate'.
|
2001-04-20 21:07:09 +08:00
|
|
|
AT_CHECK_AUTOUPDATE
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_CHECK([cat configure.ac], 0, [expout])
|
2000-12-06 18:53:58 +08:00
|
|
|
# Checking that `autoupdate' is idempotent
|
2002-10-16 14:38:50 +08:00
|
|
|
AT_CHECK_AUTOUPDATE
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_CHECK([cat configure.ac], 0, [expout])
|
2000-12-06 18:53:58 +08:00
|
|
|
|
2001-03-13 20:09:22 +08:00
|
|
|
AT_CLEANUP(configure.ac~)
|
2000-12-06 18:53:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
# autoupdating AC_LINK_FILES
|
|
|
|
# --------------------------
|
|
|
|
AT_SETUP([autoupdating AC_LINK_FILES])
|
|
|
|
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-12-06 18:53:58 +08:00
|
|
|
[[AC_INIT
|
|
|
|
AC_LINK_FILES(dst1 dst2, src1 src2)
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([dst1], dst1
|
2000-12-06 18:53:58 +08:00
|
|
|
)
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([dst2], dst2
|
2000-12-06 18:53:58 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# Checking `autoupdate'.
|
* bin/autoupdate.in: Trace AU_DEFINE instead of AU_DEFUN.
* doc/autoconf.texi: Don't say that the third parameter
is broken.
* lib/autoconf/autoupdate.m4 (AU_DEFINE): New dummy macro.
(AU_DEFUN): Honor the third parameter, create autoupdate
macros with AU_DEFINE.
* lib/autoconf/headers.m4 (AC_USG, AC_MEMORY_H,
AC_DIR_HEADER): Use AU_DEFUN's third parameter.
* lib/autoconf/lang.m4 (AC_LANG_SAVE): Likewise.
* lib/autoconf/programs.m4 (AC_RSH): Likewise.
* lib/autoconf/specific.m4 (AC_HAVE_POUNDBANG,
AC_ARG_ARRAY, AC_CYGWIN, AC_EMXOS2, AC_MINGW32,
AC_XENIX_DIR): Likewise.
* lib/autoconf/types.m4 (AC_INT_16_BITS, AC_LONG_64_BITS,
AC_STRUCT_ST_BLKSIZE, AC_STRUCT_ST_RDEV): Likewise.
* lib/autoconf/status.m4: Remove FIXME.
* tests/local.at (AT_CHECK_AU_MACRO): Ignore stderr, check
that the macro is not present anymore in the updated
configure.ac.
* tests/tools.at (autoupdate AC_LINK_FILES): Ignore stderr
of autoupdate.
2004-01-30 22:21:35 +08:00
|
|
|
AT_CHECK_AUTOUPDATE([], 0, [], ignore)
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CHECK_AUTOCONF
|
2000-12-06 18:53:58 +08:00
|
|
|
AT_CHECK_CONFIGURE
|
|
|
|
AT_CHECK([cat src1], 0, [dst1
|
|
|
|
])
|
|
|
|
AT_CHECK([cat src2], 0, [dst2
|
|
|
|
])
|
|
|
|
|
2001-03-13 20:09:22 +08:00
|
|
|
AT_CLEANUP(src1 src2 configure.ac~)
|
2000-12-06 18:53:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
# autoupdating AC_PREREQ
|
|
|
|
# ----------------------
|
|
|
|
AT_SETUP([autoupdating AC_PREREQ])
|
|
|
|
|
2001-09-07 16:26:57 +08:00
|
|
|
# Produce `AC_PREREQ(<AUTOUPDATE VERSION>)'.
|
|
|
|
AT_CHECK([autoupdate --version | sed 's/.*) //;q'], 0, [stdout])
|
|
|
|
autoupdate_version=`cat stdout`
|
|
|
|
echo "AC_PREREQ($autoupdate_version)" >expout
|
2000-12-06 18:53:58 +08:00
|
|
|
|
* configure.ac: Also find tested executables in bin.
* bin/autoconf.in, bin/autoheader.in, bin/autoreconf.in,
* bin/autoscan.in, autoupdate.in: Use exclusively the name of the
installed peer executables, only PATH is allowed to resolve it.
Pass `autoconf_dir' via options, not via invisible envvars.
* lib/Autom4te/General.pm (&find_peer): Remove.
* lib/autotest/general.m4 (AT_INIT): `AUTOTEST_PATH=a:b' gives
`abuild:asrc:bbuild:bsrc', not `abuild:bbuild:asrc:bsrc'.
* man/Makefile.am: Let help2man rely on PATH instead of trying to
find the executables for it.
* tests/Makefile.am: Major cleanup. Too lazy to document...
* tests/atlocal.in: Remove all the obscure envvar manipulations.
We only need PERL.
* tests/atspecific.m4, tests/tools.at: Passing --localdir is
indeed related to running the test suite, while passing
--autoconf-dir and others is related to running non installed
Autoconf executables. So don't do that, leave it to...
* tests/autoconf, tests/autoheader, tests/autom4te, tests/autoupdate,
* tests/autoscan: New.
* tests/atspecific.m4 (AT_CHECK_M4SUGAR, AT_CHECK_M4SH): Don't
refer to library files: rely on --language.
2001-08-31 21:30:11 +08:00
|
|
|
AT_CHECK([echo "AC_PREREQ(1.0)" | autoupdate -],
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 21:24:04 +08:00
|
|
|
0, [expout], [])
|
2000-12-06 18:53:58 +08:00
|
|
|
|
2001-09-07 16:26:57 +08:00
|
|
|
AT_CHECK([echo "AC_PREREQ($autoupdate_version)" | autoupdate -],
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 21:24:04 +08:00
|
|
|
0, [expout], [])
|
2000-12-06 18:53:58 +08:00
|
|
|
|
* configure.ac: Also find tested executables in bin.
* bin/autoconf.in, bin/autoheader.in, bin/autoreconf.in,
* bin/autoscan.in, autoupdate.in: Use exclusively the name of the
installed peer executables, only PATH is allowed to resolve it.
Pass `autoconf_dir' via options, not via invisible envvars.
* lib/Autom4te/General.pm (&find_peer): Remove.
* lib/autotest/general.m4 (AT_INIT): `AUTOTEST_PATH=a:b' gives
`abuild:asrc:bbuild:bsrc', not `abuild:bbuild:asrc:bsrc'.
* man/Makefile.am: Let help2man rely on PATH instead of trying to
find the executables for it.
* tests/Makefile.am: Major cleanup. Too lazy to document...
* tests/atlocal.in: Remove all the obscure envvar manipulations.
We only need PERL.
* tests/atspecific.m4, tests/tools.at: Passing --localdir is
indeed related to running the test suite, while passing
--autoconf-dir and others is related to running non installed
Autoconf executables. So don't do that, leave it to...
* tests/autoconf, tests/autoheader, tests/autom4te, tests/autoupdate,
* tests/autoscan: New.
* tests/atspecific.m4 (AT_CHECK_M4SUGAR, AT_CHECK_M4SH): Don't
refer to library files: rely on --language.
2001-08-31 21:30:11 +08:00
|
|
|
AT_CHECK([echo "AC_PREREQ(999.99)" | autoupdate -],
|
2003-05-24 02:16:56 +08:00
|
|
|
63, [], [ignore])
|
2000-12-06 18:53:58 +08:00
|
|
|
|
|
|
|
AT_CLEANUP
|
2006-02-15 07:18:51 +08:00
|
|
|
|
|
|
|
|
|
|
|
# autoupdating AU_ALIAS
|
|
|
|
# ---------------------
|
|
|
|
AT_SETUP([autoupdating AU_ALIAS])
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
|
|
|
AC_DEFUN([FOO], [$#])
|
|
|
|
AU_ALIAS([BAZ],[FOO])
|
|
|
|
test "FOO:FOO():FOO(x) BAZ:BAZ():BAZ(x)" = "0:1:1 0:1:1" || exit 1
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_STDC_HEADERS
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
# Checking `autoupdate'.
|
|
|
|
AT_CHECK_AUTOUPDATE
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE
|
|
|
|
AT_CHECK([grep 'AC_HEADER_STDC(' configure.ac], 1, [ignore], [ignore])
|
|
|
|
AT_CHECK([grep 'AC_HEADER_STDC' configure.ac], 0, [ignore], [ignore])
|
|
|
|
|
|
|
|
AT_CLEANUP
|
2006-04-01 23:57:02 +08:00
|
|
|
|
|
|
|
|
|
|
|
# autoupdating OLD to NEW
|
|
|
|
# -----------------------
|
|
|
|
|
|
|
|
# The example taken from the code comments.
|
|
|
|
AT_SETUP([autoupdating OLD to NEW])
|
|
|
|
|
|
|
|
AT_DATA([aclocal.m4],
|
|
|
|
[[AU_DEFUN([OLD], [NEW([$1, $2], m4@&t@_eval([$1 + $2]))])
|
|
|
|
AC_DEFUN([NEW], [echo "sum($1) = $2"])
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
|
|
|
OLD(1, 2)
|
|
|
|
NEW([0, 0], [0])
|
|
|
|
]])
|
|
|
|
|
|
|
|
# Checking `autoupdate'.
|
|
|
|
AT_CHECK_AUTOUPDATE
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE
|
|
|
|
AT_CHECK([[grep 'NEW(\[1, 2], *\[3])' configure.ac]], 0, [ignore], [ignore])
|
|
|
|
AT_CHECK([[grep 'NEW(\[0, 0], *\[0])' configure.ac]], 0, [ignore], [ignore])
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
# autoupdating AC_HELP_STRING
|
|
|
|
# ---------------------------
|
|
|
|
AT_SETUP([autoupdating AC_HELP_STRING])
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
|
|
|
AC_ARG_ENABLE([foo], [AC_HELP_STRING([--enable-foo], [foo bar])], [:], [:])
|
|
|
|
]])
|
|
|
|
|
|
|
|
# Checking `autoupdate'.
|
|
|
|
AT_CHECK_AUTOUPDATE([], [], [], [ignore])
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE([], [], [], [ignore])
|
|
|
|
AT_CHECK([[grep '\[--enable-foo], *\[foo bar]' configure.ac]], 0, [ignore], [ignore])
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
# autoupdating with m4sugar
|
|
|
|
# -------------------------
|
|
|
|
AT_SETUP([autoupdating with m4sugar])
|
|
|
|
|
|
|
|
AT_DATA([aclocal.m4],
|
|
|
|
[[AU_DEFUN([OLD],
|
|
|
|
[m4@&t@_pushdef([foo], [bar])dn@&t@l
|
|
|
|
echo "foo $1 foo"
|
|
|
|
m4@&t@_popdef([foo])dn@&t@l
|
|
|
|
])
|
|
|
|
]])
|
|
|
|
|
|
|
|
touch foo.in
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_PREREQ(2.54)
|
|
|
|
m4_define([gnumeric_version_epoch], [1])
|
|
|
|
AC_INIT
|
|
|
|
OLD([ bla bla ])
|
|
|
|
AC_FOREACH([name], [n1 n2],
|
|
|
|
[echo name
|
|
|
|
])
|
|
|
|
AC_CHECKING([for feature])
|
|
|
|
AC_MSG_RESULT_UNQUOTED([`echo done`])
|
|
|
|
|
|
|
|
AC_OUTPUT([foo])
|
|
|
|
]])
|
|
|
|
|
|
|
|
# Checking `autoupdate'.
|
|
|
|
AT_CHECK_AUTOUPDATE([], [], [], [ignore])
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE([], [], [], [ignore])
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
# autoupdating AC_LANG_SAVE
|
|
|
|
# -------------------------
|
|
|
|
AT_SETUP([autoupdating AC_LANG_SAVE])
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
|
|
|
AC_LANG_SAVE
|
|
|
|
AC_LANG_RESTORE
|
|
|
|
AC_LANG_SAVE
|
|
|
|
AC_LANG_RESTORE
|
|
|
|
]])
|
|
|
|
|
|
|
|
# Checking `autoupdate'.
|
|
|
|
AT_CHECK_AUTOUPDATE([], [], [], [ignore])
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE([], [], [], [ignore])
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
# autoupdating AC_FOREACH
|
|
|
|
# -----------------------
|
|
|
|
AT_SETUP([autoupdating AC_FOREACH])
|
|
|
|
|
|
|
|
AT_DATA([aclocal.m4],
|
|
|
|
[[AU_DEFUN([OLD], [AC_FOREACH([myvar], [4 5 6], [' myvar'])])
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
|
|
|
echo AC_FOREACH([myvar], [1 2 3], [' myvar'])OLD
|
|
|
|
]])
|
|
|
|
|
|
|
|
# Checking `autoupdate'.
|
|
|
|
AT_CHECK_AUTOUPDATE
|
|
|
|
AT_CHECK([[grep 'echo 1 2 3 4 5 6' configure.ac]], 1, [ignore], [ignore])
|
|
|
|
AT_CHECK([[grep 'm4@&t@_foreach_w' configure.ac]], 0, [ignore], [ignore])
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE([], [0], [stdout])
|
|
|
|
AT_CHECK([[grep ' 1 2 3 4 5 6' stdout]], 0, [ignore], [ignore])
|
|
|
|
|
|
|
|
AT_CLEANUP
|
2006-04-08 02:25:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
# autoupdating with aclocal and m4_include
|
|
|
|
# ----------------------------------------
|
|
|
|
AT_SETUP([autoupdating with aclocal and m4@&t@_include])
|
|
|
|
|
|
|
|
# We use aclocal.
|
|
|
|
AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
|
|
|
|
|
|
|
|
mkdir m4 aclocal
|
|
|
|
AT_DATA([configure.in],
|
|
|
|
[[AC_INIT(x,0)
|
|
|
|
AC_UNCHANGED_MACRO
|
|
|
|
AC_OLD_MACRO
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
AT_DATA([m4/stuff.m4],
|
|
|
|
[[AU_ALIAS([AC_OLD_MACRO], [AC_NEW_MACRO])
|
|
|
|
AC_DEFUN([AC_NEW_MACRO], [echo hi])
|
|
|
|
AC_DEFUN([AC_UNCHANGED_MACRO], [echo one])
|
|
|
|
]])
|
|
|
|
cp m4/stuff.m4 aclocal/stuff.m4
|
|
|
|
AT_CHECK([aclocal -I aclocal], [0], [ignore], [ignore])
|
|
|
|
# Checking `autoupdate'.
|
|
|
|
AT_CHECK_AUTOUPDATE
|
|
|
|
AT_CHECK([aclocal -I m4], [0], [ignore], [ignore])
|
|
|
|
AT_CHECK_AUTOUPDATE
|
|
|
|
|
|
|
|
AT_CLEANUP
|