2000-02-09 16:36:01 +08:00
|
|
|
# -*- autoconf -*-
|
|
|
|
|
2000-11-29 18:12:05 +08:00
|
|
|
AT_BANNER([Executables (autoheader, autoupdate...).])
|
2000-02-09 16:36:01 +08:00
|
|
|
|
2000-02-15 17:15:22 +08:00
|
|
|
## -------------------------------------------------------- ##
|
|
|
|
## Check that the shell scripts are syntactically correct. ##
|
|
|
|
## -------------------------------------------------------- ##
|
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.
|
|
|
|
|
2000-11-14 21:25:35 +08:00
|
|
|
AT_SETUP([Syntax of the scripts])
|
2000-02-15 17:15:22 +08:00
|
|
|
|
2000-02-18 17:25:46 +08:00
|
|
|
# A script that never returns. We don't care that it never returns,
|
|
|
|
# broken /bin/sh loop equally with `false', but it makes it easier to
|
|
|
|
# test the robusteness in a good environment: just remove the `-n'.
|
|
|
|
AT_DATA(endless.sh,
|
2000-11-10 02:59:18 +08:00
|
|
|
[[while :
|
2000-02-18 17:25:46 +08:00
|
|
|
do
|
|
|
|
:
|
|
|
|
done
|
2000-02-15 17:15:22 +08:00
|
|
|
]])
|
|
|
|
|
2000-02-18 17:25:46 +08:00
|
|
|
# A script in charge of testing `/bin/sh -n'.
|
|
|
|
AT_DATA(syntax.sh,
|
2000-02-21 20:57:47 +08:00
|
|
|
[[(/bin/sh -n endless.sh) &
|
|
|
|
sleep 2
|
|
|
|
if kill $! >/dev/null 2>&1; then
|
|
|
|
# We managed to kill the child, which means that we probably
|
|
|
|
# can't trust `/bin/sh -n', hence the test failed.
|
2001-02-28 17:33:30 +08:00
|
|
|
exit 77
|
2000-02-21 20:57:47 +08:00
|
|
|
fi
|
2000-02-18 17:25:46 +08:00
|
|
|
]])
|
2000-02-15 17:15:22 +08:00
|
|
|
|
2001-02-28 17:33:30 +08:00
|
|
|
# If we can't trust sh, just skip.
|
|
|
|
AT_CHECK([/bin/sh ./syntax.sh])
|
|
|
|
|
|
|
|
# Specify the path to the tool, some shells don't honor PATH when
|
|
|
|
# running `sh PROG'.
|
|
|
|
|
|
|
|
AT_CHECK([/bin/sh -n ../autoconf], 0)
|
|
|
|
AT_CHECK([/bin/sh -n ../autoreconf], 0)
|
|
|
|
AT_CHECK([/bin/sh -n ../ifnames], 0)
|
|
|
|
|
|
|
|
# These are not built, they are in the src tree.
|
|
|
|
AT_CHECK([/bin/sh -n $top_srcdir/install-sh], 0)
|
|
|
|
AT_CHECK([/bin/sh -n $top_srcdir/mkinstalldirs], 0)
|
|
|
|
AT_CHECK([/bin/sh -n $top_srcdir/missing], 0)
|
2000-02-15 17:15:22 +08:00
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-12-06 18:53:58 +08:00
|
|
|
## ----------------- ##
|
|
|
|
## AWK portability. ##
|
|
|
|
## ----------------- ##
|
2000-02-15 17:15:22 +08:00
|
|
|
|
2000-12-06 18:53:58 +08:00
|
|
|
AT_SETUP([AWK portability])
|
2000-10-17 15:55:44 +08:00
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_DATA([configure.ac],
|
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
|
|
|
[])
|
2000-10-17 15:55:44 +08:00
|
|
|
|
2000-12-06 18:53:58 +08:00
|
|
|
if (gawk --version) >/dev/null 2>&1; then
|
|
|
|
# Generation of the script.
|
|
|
|
AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir .. -l $at_srcdir], 0,
|
|
|
|
[], [])
|
|
|
|
# Tracing.
|
|
|
|
AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir .. -l $at_srcdir -t AC_INIT], 0,
|
|
|
|
ignore, [])
|
|
|
|
# Syntax correctness of ifnames.
|
|
|
|
AT_CHECK([AWK='gawk --posix' ifnames empty], 0,
|
|
|
|
[], [])
|
|
|
|
fi
|
2000-10-24 02:58:43 +08:00
|
|
|
|
2000-12-06 18:53:58 +08:00
|
|
|
AT_CLEANUP(configure)
|
2000-10-24 02:58:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-11-03 19:59:39 +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])
|
2000-03-21 20:08:24 +08:00
|
|
|
|
2000-12-23 18:11:57 +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])
|
2000-03-21 20:08:24 +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]))
|
|
|
|
]])
|
|
|
|
|
|
|
|
# Several --traces.
|
2000-10-24 02:58:43 +08:00
|
|
|
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -t TRACE1 -t TRACE2], 0,
|
2000-12-23 18:11:57 +08:00
|
|
|
[[configure.ac:4:TRACE1:foo:bar:baz
|
|
|
|
configure.ac:4:TRACE2: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
|
|
|
configure.ac:5:TRACE1:bar:baz
|
|
|
|
configure.ac:5:TRACE2:baz
|
|
|
|
configure.ac:5:TRACE1:foo::baz
|
|
|
|
configure.ac:5:TRACE2::baz
|
2000-12-23 18:11:57 +08:00
|
|
|
configure.ac:6:TRACE1:foo:ACTIVE:baz
|
|
|
|
configure.ac:6:TRACE2:ACTIVE:baz
|
|
|
|
configure.ac:7:TRACE1:ACTIVE:active
|
|
|
|
configure.ac:7:TRACE2:active
|
|
|
|
configure.ac:7:TRACE1:foo:active::ACTIVE
|
|
|
|
configure.ac:7:TRACE2:active::ACTIVE
|
2000-03-21 20:08:24 +08:00
|
|
|
]])
|
|
|
|
|
|
|
|
# Several line requests.
|
2000-10-24 02:58:43 +08:00
|
|
|
AT_CHECK([[autoconf --autoconf-dir .. -l $at_srcdir -t TRACE1:'
|
2000-03-21 20:08:24 +08:00
|
|
|
[$1], [$2], [$3].']], 0,
|
|
|
|
[[
|
|
|
|
[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
|
|
|
[bar], [baz], [].
|
|
|
|
|
|
|
|
[foo], [], [baz].
|
2000-03-21 20:08:24 +08:00
|
|
|
|
|
|
|
[foo], [ACTIVE], [baz].
|
|
|
|
|
|
|
|
[ACTIVE], [active], [].
|
|
|
|
|
|
|
|
[foo], [active], [].
|
|
|
|
]])
|
|
|
|
|
|
|
|
# ${sep}@.
|
2000-10-24 02:58:43 +08:00
|
|
|
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -t TRACE2:'${)===(}@'], 0,
|
2000-03-21 20:08:24 +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]
|
|
|
|
]])
|
|
|
|
|
|
|
|
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
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_DATA(configure.ac,
|
2000-11-02 23:32:23 +08:00
|
|
|
[[define([active], [ACTIVE])
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK([[autoconf --autoconf-dir .. -l $at_srcdir -t define |
|
|
|
|
sed -n '$p']],
|
|
|
|
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.
|
|
|
|
AT_CHECK([[autoconf --autoconf-dir $top_srcdir -l $at_srcdir -t define:'$1' -i|
|
2000-11-02 23:32:23 +08:00
|
|
|
sed -n '$p']],
|
|
|
|
0,
|
|
|
|
[[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
|
|
|
|
2000-12-16 03:23:16 +08:00
|
|
|
# autoconf: forbidden tokens, basic
|
|
|
|
# ---------------------------------
|
|
|
|
AT_SETUP([autoconf: forbidden tokens, basic])
|
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-12-16 03:23:16 +08:00
|
|
|
[[AC_PLAIN_SCRIPT()dnl
|
|
|
|
AC_FOO
|
|
|
|
_AC_BAR
|
|
|
|
m4_foo
|
|
|
|
_m4_bar
|
|
|
|
BAC_FOO
|
|
|
|
B_AC_FOO
|
|
|
|
AS_FOO
|
|
|
|
_AS_BAR
|
|
|
|
]])
|
|
|
|
|
2001-01-22 16:59:02 +08:00
|
|
|
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 1, [], [stderr])
|
2000-12-16 03:23:16 +08:00
|
|
|
# The output of autoconf is not deterministic here because it
|
|
|
|
# uses `for (ind in array)'. So be sure to have a unique representation.
|
2001-01-22 16:59:02 +08:00
|
|
|
AT_CHECK([sort stderr], 0,
|
2000-12-23 18:11:57 +08:00
|
|
|
[[configure.ac:2: error: undefined macro: AC_FOO
|
|
|
|
configure.ac:3: error: undefined macro: _AC_BAR
|
|
|
|
configure.ac:4: error: undefined macro: m4_foo
|
|
|
|
configure.ac:7: error: undefined macro: B_AC_FOO
|
|
|
|
configure.ac:8: error: undefined macro: AS_FOO
|
2001-01-19 22:35:06 +08:00
|
|
|
configure.ac:9: error: undefined macro: _AS_BAR
|
2000-12-16 03:23:16 +08:00
|
|
|
]])
|
|
|
|
|
2001-01-22 16:59:02 +08:00
|
|
|
AT_CLEANUP(configure)
|
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
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-08-07 20:07:43 +08:00
|
|
|
[[AC_PLAIN_SCRIPT()dnl
|
* 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.
|
* 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
|
|
|
m4_pattern_allow([^AC_ALLOWED$])
|
|
|
|
NOT_AC_ALLOWED AC_ALLOWED AC_ALLOWED_NOT
|
|
|
|
|
|
|
|
# Test forbidding.
|
|
|
|
m4_pattern_forbid([^FORBIDDEN$])
|
|
|
|
NOT_FORBIDDEN FORBIDDEN FORBIDDEN_NOT
|
|
|
|
|
|
|
|
# Test Autoconf's patterns.
|
2001-01-19 22:35:06 +08:00
|
|
|
AC_THIS_IS_INVALID and _AC_THIS_IS_INVALID_TOO
|
* 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
|
|
|
BUT_AZ_THIS_IS_NOT ALTHOUGH_AC_THIS_IS
|
|
|
|
# This is legal, although there is `AC_DEFINE' in there.
|
2000-11-03 23:08:28 +08:00
|
|
|
BAC_DEFINE
|
2000-08-07 20:07:43 +08:00
|
|
|
# AC_THIS_IS_A_COMMENT so just shut up.
|
|
|
|
It would be very bad if Autoconf forgot to expand [AC_]OUTPUT!
|
|
|
|
]])
|
|
|
|
|
2001-01-22 16:59:02 +08:00
|
|
|
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 1, [], [stderr])
|
2000-12-06 23:00:45 +08:00
|
|
|
# The output of autoconf is not deterministic here because it
|
|
|
|
# uses `for (ind in array)'. So be sure to have a unique representation.
|
2001-01-22 16:59:02 +08:00
|
|
|
AT_CHECK([sort stderr], 0,
|
2000-12-23 18:11:57 +08:00
|
|
|
[[configure.ac:10: error: undefined macro: FORBIDDEN
|
|
|
|
configure.ac:14: error: undefined macro: AC_THIS_IS_INVALID
|
2001-01-19 22:35:06 +08:00
|
|
|
configure.ac:14: error: undefined macro: _AC_THIS_IS_INVALID_TOO
|
2000-12-23 18:11:57 +08:00
|
|
|
configure.ac:15: error: undefined macro: ALTHOUGH_AC_THIS_IS
|
|
|
|
configure.ac:7: error: undefined macro: AC_ALLOWED_NOT
|
|
|
|
configure.ac:7: error: undefined macro: NOT_AC_ALLOWED
|
2000-12-07 00:06:34 +08:00
|
|
|
configure:18: error: undefined macro: AC_OUTPUT
|
2000-08-07 20:07:43 +08:00
|
|
|
]])
|
|
|
|
|
2000-12-06 23:00:45 +08:00
|
|
|
AT_CLEANUP(configure err)
|
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
|
|
|
|
#if !defined(DEF3) && defined(DEF4) /* but not defined(DEF5) */
|
|
|
|
# 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. ##
|
|
|
|
## ------------ ##
|
|
|
|
|
|
|
|
# autoheader is intensively used in its modern form throught this
|
|
|
|
# test suite. But we also have to check that acconfig.h still works.
|
|
|
|
# autoheader uses autoconf --trace, so traces first.
|
|
|
|
|
|
|
|
AT_SETUP([autoheader])
|
|
|
|
|
|
|
|
AT_DATA(acconfig.h,
|
|
|
|
[[/* Define this to whatever you want. */
|
|
|
|
#undef this
|
|
|
|
]])
|
|
|
|
|
|
|
|
|
|
|
|
# 1. Check that `acconfig.h' is still honored.
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_DATA(configure.ac,
|
2000-12-06 18:53:58 +08:00
|
|
|
[[AC_INIT
|
|
|
|
AC_CONFIG_HEADERS(config.h)
|
|
|
|
AC_DEFINE(this, "whatever you want.")
|
|
|
|
]])
|
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_CHECK([autoheader --autoconf-dir .. -<configure.ac], 0,
|
2000-12-06 18:53:58 +08:00
|
|
|
[[/* config.h.in. Generated automatically from - by autoheader. */
|
|
|
|
/* Define this to whatever you want. */
|
|
|
|
#undef this
|
|
|
|
]], ignore)
|
|
|
|
|
|
|
|
|
|
|
|
# 2. Check that missing templates are a fatal error.
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_DATA(configure.ac,
|
2000-12-06 18:53:58 +08:00
|
|
|
[[AC_INIT
|
|
|
|
AC_CONFIG_HEADERS(config.h)
|
|
|
|
AC_DEFINE(that, "whatever you want.")
|
|
|
|
]])
|
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_CHECK([autoheader --autoconf-dir .. -<configure.ac], 1, [],
|
2000-12-06 18:53:58 +08:00
|
|
|
[autoheader: No template for symbol `that'
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
# 3. Check TOP and BOTTOM.
|
|
|
|
AT_DATA(acconfig.h,
|
|
|
|
[[/* Top from acconfig.h. */
|
|
|
|
@TOP@
|
|
|
|
/* Middle from acconfig.h. */
|
|
|
|
@BOTTOM@
|
|
|
|
/* Bottom from acconfig.h. */
|
|
|
|
]])
|
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_DATA(configure.ac,
|
2000-12-06 18:53:58 +08:00
|
|
|
[[AC_INIT
|
|
|
|
AC_CONFIG_HEADERS(config.h)
|
2000-12-23 18:11:57 +08:00
|
|
|
AH_TOP([Top1 from configure.ac.])
|
|
|
|
AH_TOP([Top2 from configure.ac.])
|
|
|
|
AH_VERBATIM([Middle], [Middle from configure.ac.])
|
|
|
|
AH_BOTTOM([Bottom1 from configure.ac.])
|
|
|
|
AH_BOTTOM([Bottom2 from configure.ac.])
|
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.
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_CHECK([autoheader --autoconf-dir .. -<configure.ac], 0,
|
2000-12-06 18:53:58 +08:00
|
|
|
[[/* config.h.in. Generated automatically from - by autoheader. */
|
|
|
|
/* 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
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
Middle from configure.ac.
|
2000-12-06 18:53:58 +08:00
|
|
|
|
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.
|
2000-12-06 18:53:58 +08:00
|
|
|
/* Bottom from acconfig.h. */
|
|
|
|
]], [])
|
|
|
|
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## ------------ ##
|
|
|
|
## autoupdate. ##
|
|
|
|
## ------------ ##
|
|
|
|
|
|
|
|
# Check that AC_CANONICAL_SYSTEM and AC_OUTPUT are properly updated.
|
|
|
|
AT_SETUP([autoupdate])
|
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_DATA(configure.ac,
|
2000-12-06 18:53:58 +08:00
|
|
|
[[AC_INIT(Test, 1.0)
|
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
dnl The doc says 27 is a valid fubar.
|
|
|
|
fubar=27
|
|
|
|
AC_OUTPUT(Makefile, echo $fubar, fubar=$fubar)
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([expout],
|
|
|
|
[[AC_INIT([Test],[1.0])
|
|
|
|
AC_CANONICAL_TARGET([])
|
|
|
|
dnl The doc says 27 is a valid fubar.
|
|
|
|
fubar=27
|
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_CONFIG_COMMANDS([default],[[echo $fubar]],[[fubar=$fubar]])
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
# Checking `autoupdate'.
|
|
|
|
AT_CHECK([autoupdate --autoconf-dir $top_srcdir], 0, [],
|
2000-12-23 18:11:57 +08:00
|
|
|
[autoupdate: `configure.ac' is updated
|
2000-12-06 18:53:58 +08:00
|
|
|
])
|
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
|
|
|
|
AT_CHECK([autoupdate --autoconf-dir $top_srcdir], 0, [],
|
2000-12-23 18:11:57 +08:00
|
|
|
[autoupdate: `configure.ac' is unchanged
|
2000-12-06 18:53:58 +08:00
|
|
|
])
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_CHECK([cat configure.ac], 0, [expout])
|
2000-12-06 18:53:58 +08:00
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
# autoupdating AC_LINK_FILES
|
|
|
|
# --------------------------
|
|
|
|
AT_SETUP([autoupdating AC_LINK_FILES])
|
|
|
|
|
2000-12-23 18:11:57 +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
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA(dst1, dst1
|
|
|
|
)
|
|
|
|
AT_DATA(dst2, dst2
|
|
|
|
)
|
|
|
|
|
|
|
|
# Checking `autoupdate'.
|
|
|
|
AT_CHECK([autoupdate --autoconf-dir $top_srcdir], 0, [],
|
2000-12-23 18:11:57 +08:00
|
|
|
[autoupdate: `configure.ac' is updated
|
2000-12-06 18:53:58 +08:00
|
|
|
])
|
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
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_CLEANUP(src1 src2)
|
|
|
|
|
|
|
|
|
|
|
|
# autoupdating AC_PREREQ
|
|
|
|
# ----------------------
|
|
|
|
AT_SETUP([autoupdating AC_PREREQ])
|
|
|
|
|
|
|
|
cat >expout <<EOF
|
|
|
|
AC_PREREQ($at_version)
|
|
|
|
EOF
|
|
|
|
|
|
|
|
AT_CHECK([echo "AC_PREREQ(1.0)" |
|
|
|
|
autoupdate --autoconf-dir $top_srcdir -],
|
|
|
|
0, [expout], [])
|
|
|
|
|
|
|
|
AT_CHECK([echo "AC_PREREQ($at_version)" |
|
|
|
|
autoupdate --autoconf-dir $top_srcdir -],
|
|
|
|
0, [expout], [])
|
|
|
|
|
|
|
|
AT_CHECK([echo "AC_PREREQ(999.99)" |
|
|
|
|
autoupdate --autoconf-dir $top_srcdir -],
|
|
|
|
1, [], [ignore])
|
|
|
|
|
|
|
|
AT_CLEANUP
|