* 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-08 01:15:51 +08:00
|
|
|
|
2003-03-29 01:10:27 +08:00
|
|
|
# Copyright (C) 2000, 2001, 2002, 2003 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
|
|
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
# 02111-1307, USA.
|
|
|
|
|
2000-02-08 01:15:51 +08:00
|
|
|
|
2002-02-07 01:51:01 +08:00
|
|
|
AT_BANNER([[Testing config.status.]])
|
|
|
|
|
|
|
|
|
|
|
|
## ---------------------------------------- ##
|
|
|
|
## AC_CONFIG_COMMANDS with empty commands. ##
|
|
|
|
## ---------------------------------------- ##
|
|
|
|
|
|
|
|
AT_CHECK_MACRO([AC_CONFIG_COMMANDS with empty commands],
|
|
|
|
[[AC_CONFIG_COMMANDS([foo], [], [:])
|
|
|
|
]])
|
|
|
|
|
|
|
|
|
* lib/autoconf/status.m4 (_AC_CONFIG_FILE, _AC_CONFIG_HEADER)
(_AC_CONFIG_COMMAND, _AC_CONFIG_LINK): New.
Use dnl, not the KILL diversion.
Extracted from...
(AC_CONFIG_FILES, AC_CONFIG_HEADERS, AC_CONFIG_COMMANDS)
(AC_CONFIG_LINKS): here.
Adjust.
Don't use the KILL diversion, as it kills spurious output, which
results in failures being hidden.
Use m4_defn where appropriate.
(AC_CONFIG_IF_MEMBER): Kill the real bug: a spurious parenthesis
after the second argument.
Use m4_defn.
* lib/autom4te.in (Autoconf, Autotest, M4sh): Don't pass --warning
syntax, as it is provided by M4sugar.
* tests/torture.at (Multiple AC_CONFIG_FILES): New.
2002-04-03 21:35:59 +08:00
|
|
|
## -------------------------- ##
|
|
|
|
## Multiple AC_CONFIG_FILES. ##
|
|
|
|
## -------------------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([Multiple AC_CONFIG_FILES])
|
|
|
|
|
|
|
|
AT_CONFIGURE_AC([[AC_CONFIG_FILES([foo foo])]])
|
|
|
|
AT_CHECK_AUTOCONF([], 1, [], [ignore])
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-06-18 02:14:27 +08:00
|
|
|
## ------------ ##
|
|
|
|
## AC_ARG_VAR. ##
|
|
|
|
## ------------ ##
|
|
|
|
|
2001-06-24 01:14:34 +08:00
|
|
|
# AT_CHECK_AC_ARG_VAR(FIRST-VALUE, SECOND-VALUE)
|
|
|
|
# ----------------------------------------------
|
2001-06-18 02:14:27 +08:00
|
|
|
# Check that AC_ARG_VAR caches the latest values, diagnoses
|
2002-04-20 14:09:01 +08:00
|
|
|
# inconsistencies, and arms config.status.
|
2001-06-21 18:56:21 +08:00
|
|
|
m4_define([AT_CHECK_AC_ARG_VAR],
|
2001-06-24 01:14:34 +08:00
|
|
|
[rm -f config.cache
|
|
|
|
|
|
|
|
# Initial value.
|
|
|
|
m4_ifval([$1],
|
|
|
|
[precious='$1'; export precious],
|
|
|
|
[unset precious])
|
2002-10-11 20:05:39 +08:00
|
|
|
AT_CHECK_CONFIGURE([--config-cache -q])
|
2001-06-24 01:14:34 +08:00
|
|
|
AT_CHECK([cat file], [], [`$1'
|
|
|
|
])
|
|
|
|
|
2002-10-11 20:05:39 +08:00
|
|
|
# Testing --recheck: 1. have the environment `forget' about PRECIOUS.
|
2001-06-24 01:14:34 +08:00
|
|
|
unset precious
|
2002-10-11 20:05:39 +08:00
|
|
|
# 2. Rerun config.status to recreate `file'.
|
2001-06-24 01:14:34 +08:00
|
|
|
AT_CHECK([./config.status --recheck], [], [ignore])
|
|
|
|
AT_CHECK([./config.status], [], [ignore])
|
2002-10-11 20:05:39 +08:00
|
|
|
# 3. Check that file contains the old value of PRECIOUS.
|
2001-06-24 01:14:34 +08:00
|
|
|
AT_CHECK([cat file], [], [`$1'
|
|
|
|
])
|
|
|
|
|
2002-10-11 20:05:39 +08:00
|
|
|
# Second value: we should issue an error here: the value
|
|
|
|
# has changed!
|
2001-06-24 01:14:34 +08:00
|
|
|
m4_ifval([$2],
|
|
|
|
[precious='$2'; export precious],
|
|
|
|
[unset precious])
|
|
|
|
AT_CHECK_CONFIGURE([--config-cache], [1], [], [ignore])
|
|
|
|
|
|
|
|
])# AT_CHECK_AC_ARG_VAR
|
|
|
|
|
|
|
|
|
|
|
|
AT_SETUP([AC_ARG_VAR])
|
2001-06-18 02:14:27 +08:00
|
|
|
|
|
|
|
# We don't want to run this test if this shell doesn't support
|
|
|
|
# `unset'.
|
|
|
|
AT_CHECK([
|
|
|
|
if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 77
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
|
|
|
AC_ARG_VAR([precious], [this variable costs a lot])
|
2002-10-11 20:05:39 +08:00
|
|
|
echo "precious:$precious"
|
2001-06-18 02:14:27 +08:00
|
|
|
AC_OUTPUT(file)
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([file.in],
|
|
|
|
[[`@precious@'
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
|
2001-06-24 01:14:34 +08:00
|
|
|
# Set a precious variable
|
|
|
|
AT_CHECK_AC_ARG_VAR([], [apple of my eye])
|
2001-06-18 02:14:27 +08:00
|
|
|
|
2001-06-24 01:14:34 +08:00
|
|
|
# Unset a precious variable
|
|
|
|
AT_CHECK_AC_ARG_VAR([apple of my eye], [])
|
2001-06-18 02:14:27 +08:00
|
|
|
|
2001-06-24 01:14:34 +08:00
|
|
|
# Change a precious variable
|
|
|
|
AT_CHECK_AC_ARG_VAR([apple of my eye], [orange of my eye])
|
2001-06-18 02:14:27 +08:00
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2001-06-23 23:04:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2000-11-16 22:56:17 +08:00
|
|
|
## ---------------------------------------------- ##
|
|
|
|
## AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS. ##
|
|
|
|
## ---------------------------------------------- ##
|
2000-02-08 01:15:51 +08:00
|
|
|
|
2000-11-16 22:56:17 +08:00
|
|
|
AT_SETUP([AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS])
|
2000-02-08 01:15:51 +08:00
|
|
|
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-11-16 22:56:17 +08:00
|
|
|
[[AC_INIT
|
2001-06-23 23:04:14 +08:00
|
|
|
rm -rf header var-header file var-file link var-link command var-command
|
|
|
|
echo 'OK' >input
|
|
|
|
|
|
|
|
# Be sure to also stress the associated INIT-CMDS.
|
2000-11-16 22:56:17 +08:00
|
|
|
case $what_to_test in
|
2001-06-23 23:04:14 +08:00
|
|
|
header)
|
|
|
|
AC_CONFIG_HEADERS(header:input);;
|
|
|
|
var-header)
|
|
|
|
AC_CONFIG_HEADERS(var-header:$header_in, [], [header_in=input]);;
|
|
|
|
|
|
|
|
file)
|
|
|
|
AC_CONFIG_FILES(file:input);;
|
|
|
|
var-file)
|
|
|
|
AC_CONFIG_FILES(var-file:$file_in, [], [file_in=input]);;
|
|
|
|
|
|
|
|
command)
|
|
|
|
AC_CONFIG_COMMANDS(command:input,
|
|
|
|
[cp input command]);;
|
|
|
|
var-command)
|
|
|
|
AC_CONFIG_COMMANDS(var-command:$command_in,
|
|
|
|
[cp $command_in var-command], [command_in=input]);;
|
|
|
|
|
|
|
|
link)
|
|
|
|
AC_CONFIG_LINKS(link:input);;
|
|
|
|
var-link)
|
|
|
|
AC_CONFIG_LINKS(var-link:$link_in, [], [link_in=input]);;
|
2000-11-16 22:56:17 +08:00
|
|
|
esac
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
2000-02-08 01:15:51 +08:00
|
|
|
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CHECK_AUTOCONF
|
2000-02-08 01:15:51 +08:00
|
|
|
|
2001-06-23 23:04:14 +08:00
|
|
|
|
|
|
|
# AT_CHECK_CONFIG_CREATION(THING = (header | link | file | command))
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
# Check that THING and var-THING (which uses variables in AC_CONFIG_THING)
|
|
|
|
# are properly created, with the right content.
|
|
|
|
# Use `grep OK' instead of a simple `cat' to avoid banners such as in
|
|
|
|
# AC_CONFIG_HEADERS.
|
|
|
|
m4_define([AT_CHECK_CONFIG_CREATION],
|
|
|
|
[AT_CHECK_CONFIGURE([what_to_test=$1])
|
|
|
|
AT_CHECK([ls header var-header file var-file command var-command link var-link 2>/dev/null],
|
|
|
|
[ignore], [$1
|
|
|
|
])
|
|
|
|
AT_CHECK([grep OK $1], [], [OK
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_CHECK_CONFIGURE([what_to_test=var-$1 --no-create])
|
|
|
|
# config.status might be stupidly expecting data on stdin, if it's
|
|
|
|
# really broken...
|
|
|
|
AT_CHECK([./config.status var-$1 </dev/null], [], [ignore])
|
|
|
|
AT_CHECK([ls header var-header file var-file command var-command link var-link 2>/dev/null],
|
|
|
|
[ignore], [var-$1
|
|
|
|
])
|
|
|
|
AT_CHECK([grep OK var-$1], [], [OK
|
|
|
|
])
|
|
|
|
])# AT_CHECK_CONFIG_CREATION
|
|
|
|
|
2000-02-17 17:31:34 +08:00
|
|
|
|
2000-11-16 22:56:17 +08:00
|
|
|
# Create a file
|
2001-06-23 23:04:14 +08:00
|
|
|
AT_CHECK_CONFIG_CREATION(file)
|
|
|
|
|
|
|
|
# Create a header
|
|
|
|
AT_CHECK_CONFIG_CREATION(header)
|
2000-02-17 17:31:34 +08:00
|
|
|
|
2000-11-16 22:56:17 +08:00
|
|
|
# Execute a command
|
2001-06-23 23:04:14 +08:00
|
|
|
AT_CHECK_CONFIG_CREATION(command)
|
2000-02-17 17:31:34 +08:00
|
|
|
|
2000-11-16 22:56:17 +08:00
|
|
|
# Create a link
|
2001-06-23 23:04:14 +08:00
|
|
|
AT_CHECK_CONFIG_CREATION(link)
|
2000-11-16 22:56:17 +08:00
|
|
|
|
2002-02-07 01:51:01 +08:00
|
|
|
AT_CLEANUP
|
2000-02-08 01:15:51 +08:00
|
|
|
|
2000-02-17 17:31:34 +08:00
|
|
|
|
2000-11-16 22:56:17 +08:00
|
|
|
|
2000-11-29 18:12:05 +08:00
|
|
|
## ------------------- ##
|
|
|
|
## Missing templates. ##
|
|
|
|
## ------------------- ##
|
2000-11-16 22:56:17 +08:00
|
|
|
|
2000-11-29 18:12:05 +08:00
|
|
|
# Check that config.status detects missing input files
|
|
|
|
AT_SETUP([Missing templates])
|
2000-02-08 01:15:51 +08:00
|
|
|
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-11-16 22:56:17 +08:00
|
|
|
[[AC_INIT
|
|
|
|
AC_CONFIG_FILES([nonexistent])
|
2000-02-17 17:31:34 +08:00
|
|
|
AC_OUTPUT
|
2000-11-16 22:56:17 +08:00
|
|
|
]])
|
2000-02-17 17:31:34 +08:00
|
|
|
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CHECK_AUTOCONF
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CHECK_CONFIGURE([], [1], [],
|
2000-11-30 00:08:43 +08:00
|
|
|
[[config.status: error: cannot find input file: nonexistent.in
|
2000-11-16 22:56:17 +08:00
|
|
|
]])
|
|
|
|
# Make sure that the output file doesn't exist
|
|
|
|
AT_CHECK([test -f nonexistent], 1)
|
2000-02-17 17:31:34 +08:00
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CLEANUP
|
2000-02-10 02:08:37 +08:00
|
|
|
|
2000-02-10 02:24:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2000-11-29 18:12:05 +08:00
|
|
|
## ---------------------- ##
|
|
|
|
## configure invocation. ##
|
|
|
|
## ---------------------- ##
|
2000-02-10 02:24:24 +08:00
|
|
|
|
2000-11-29 18:12:05 +08:00
|
|
|
# Check that `configure' and `config.status' honor their interface.
|
|
|
|
#
|
2000-05-22 16:05:40 +08:00
|
|
|
# We run `./configure one=val1 --enable-two=val2 --with-three=val3'
|
|
|
|
# and verify that (i) `configure' correctly receives the arguments and
|
|
|
|
# (ii) correctly passes them to `config.status', which we check by
|
|
|
|
# running `config.status --recheck'.
|
2000-02-10 02:24:24 +08:00
|
|
|
|
2000-11-29 18:12:05 +08:00
|
|
|
AT_SETUP([configure invocation])
|
2000-02-10 02:24:24 +08:00
|
|
|
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-02-10 02:24:24 +08:00
|
|
|
[[AC_INIT
|
2000-05-22 16:05:40 +08:00
|
|
|
echo "result=$one$enable_two$with_three"
|
2000-02-10 02:24:24 +08:00
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CHECK_AUTOCONF
|
2000-02-10 02:24:24 +08:00
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CHECK_CONFIGURE([one=one --enable-two=two --with-three=three |
|
|
|
|
sed -n -e 's/^result=//p'], 0,
|
|
|
|
[onetwothree
|
|
|
|
])
|
|
|
|
AT_CHECK([./config.status --recheck | sed -n 's/^result=//p'], 0,
|
2000-05-22 16:05:40 +08:00
|
|
|
[onetwothree
|
2000-12-19 16:15:48 +08:00
|
|
|
])
|
2000-02-10 02:24:24 +08:00
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CHECK_CONFIGURE([one="\"'$ " --enable-two="\" ' $" --with-three=" \"'$"|
|
|
|
|
sed -n -e 's/^result=//p'], 0,
|
|
|
|
["'$ " ' $ "'$
|
|
|
|
])
|
|
|
|
AT_CHECK([./config.status --recheck | sed -n 's/^result=//p'], 0,
|
2000-05-22 16:05:40 +08:00
|
|
|
["'$ " ' $ "'$
|
2000-12-19 16:15:48 +08:00
|
|
|
])
|
2000-02-10 02:24:24 +08:00
|
|
|
|
2002-02-07 01:51:01 +08:00
|
|
|
AT_CLEANUP
|
Honor properly the `#define' config.h.in templates.
Test it.
* acgeneral.m4 (AC_OUTPUT_HEADERS): Renamed as...
(_AC_OUTPUT_HEADERS): this. All callers changed.
Don't mess with changequote, just quote properly.
Bug 1. Because of the `#' in `ac_dA', the quotes <<>> were not
removed, and therefore the sed script contained `<<define>>'
instead of `define'. Now that the block is properly quoted, there
is no need to quote `define'.
Bug 2. Once a `#define' substitution performed, we were branching
to the top of the sed script (`t top'). This resulted in an
endless substitution of `#define foo 1' to `#define foo 1'.
Branching is not enough: you also have to fetch the next input
line, i.e., use `t' instead of `t t' in ac_dD, and don't output
`: top' in `config.defines'.
Though it was correct for `#undef' templates, just apply the same
transformation to `ac_uD' and `config.undefs'.
Bug 3. Don't try to preserve what was behind the value in the
template, since on
#define NAME "bar baz"
it leads to
#define NAME 1 baz"
Now `ac_dB' catches everything behind the NAME (making sure there
is at least a space) and `ac_dC' only outputs a space.
* tests/torture.m4: Check that various forms of `#define' header
templates are properly handled.
2000-02-10 18:38:59 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## -------------------------------------------- ##
|
|
|
|
## Check that `#define' templates are honored. ##
|
|
|
|
## -------------------------------------------- ##
|
|
|
|
|
|
|
|
# Use various forms of `#define' templates, and make sure there are no
|
|
|
|
# problems when a symbol is prefix of another.
|
|
|
|
|
|
|
|
AT_SETUP([#define header templates])
|
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_DATA([configure.ac],
|
Honor properly the `#define' config.h.in templates.
Test it.
* acgeneral.m4 (AC_OUTPUT_HEADERS): Renamed as...
(_AC_OUTPUT_HEADERS): this. All callers changed.
Don't mess with changequote, just quote properly.
Bug 1. Because of the `#' in `ac_dA', the quotes <<>> were not
removed, and therefore the sed script contained `<<define>>'
instead of `define'. Now that the block is properly quoted, there
is no need to quote `define'.
Bug 2. Once a `#define' substitution performed, we were branching
to the top of the sed script (`t top'). This resulted in an
endless substitution of `#define foo 1' to `#define foo 1'.
Branching is not enough: you also have to fetch the next input
line, i.e., use `t' instead of `t t' in ac_dD, and don't output
`: top' in `config.defines'.
Though it was correct for `#undef' templates, just apply the same
transformation to `ac_uD' and `config.undefs'.
Bug 3. Don't try to preserve what was behind the value in the
template, since on
#define NAME "bar baz"
it leads to
#define NAME 1 baz"
Now `ac_dB' catches everything behind the NAME (making sure there
is at least a space) and `ac_dC' only outputs a space.
* tests/torture.m4: Check that various forms of `#define' header
templates are properly handled.
2000-02-10 18:38:59 +08:00
|
|
|
[[AC_INIT
|
|
|
|
AC_CONFIG_HEADERS(config.h:config.hin)
|
2001-01-31 03:29:38 +08:00
|
|
|
|
Honor properly the `#define' config.h.in templates.
Test it.
* acgeneral.m4 (AC_OUTPUT_HEADERS): Renamed as...
(_AC_OUTPUT_HEADERS): this. All callers changed.
Don't mess with changequote, just quote properly.
Bug 1. Because of the `#' in `ac_dA', the quotes <<>> were not
removed, and therefore the sed script contained `<<define>>'
instead of `define'. Now that the block is properly quoted, there
is no need to quote `define'.
Bug 2. Once a `#define' substitution performed, we were branching
to the top of the sed script (`t top'). This resulted in an
endless substitution of `#define foo 1' to `#define foo 1'.
Branching is not enough: you also have to fetch the next input
line, i.e., use `t' instead of `t t' in ac_dD, and don't output
`: top' in `config.defines'.
Though it was correct for `#undef' templates, just apply the same
transformation to `ac_uD' and `config.undefs'.
Bug 3. Don't try to preserve what was behind the value in the
template, since on
#define NAME "bar baz"
it leads to
#define NAME 1 baz"
Now `ac_dB' catches everything behind the NAME (making sure there
is at least a space) and `ac_dC' only outputs a space.
* tests/torture.m4: Check that various forms of `#define' header
templates are properly handled.
2000-02-10 18:38:59 +08:00
|
|
|
# I18n of dummy variables: their French translations.
|
|
|
|
AC_DEFINE(foo, toto)
|
|
|
|
AC_DEFINE(bar, tata)
|
|
|
|
AC_DEFINE(baz, titi)
|
|
|
|
AC_DEFINE(fubar, tutu)
|
2001-01-31 03:29:38 +08:00
|
|
|
|
Honor properly the `#define' config.h.in templates.
Test it.
* acgeneral.m4 (AC_OUTPUT_HEADERS): Renamed as...
(_AC_OUTPUT_HEADERS): this. All callers changed.
Don't mess with changequote, just quote properly.
Bug 1. Because of the `#' in `ac_dA', the quotes <<>> were not
removed, and therefore the sed script contained `<<define>>'
instead of `define'. Now that the block is properly quoted, there
is no need to quote `define'.
Bug 2. Once a `#define' substitution performed, we were branching
to the top of the sed script (`t top'). This resulted in an
endless substitution of `#define foo 1' to `#define foo 1'.
Branching is not enough: you also have to fetch the next input
line, i.e., use `t' instead of `t t' in ac_dD, and don't output
`: top' in `config.defines'.
Though it was correct for `#undef' templates, just apply the same
transformation to `ac_uD' and `config.undefs'.
Bug 3. Don't try to preserve what was behind the value in the
template, since on
#define NAME "bar baz"
it leads to
#define NAME 1 baz"
Now `ac_dB' catches everything behind the NAME (making sure there
is at least a space) and `ac_dC' only outputs a space.
* tests/torture.m4: Check that various forms of `#define' header
templates are properly handled.
2000-02-10 18:38:59 +08:00
|
|
|
# Symbols which are prefixes of another.
|
|
|
|
AC_DEFINE(a, A)
|
|
|
|
AC_DEFINE(aaa, AAA)
|
|
|
|
AC_DEFINE(aa, AA)
|
2000-02-10 18:41:52 +08:00
|
|
|
AC_CONFIG_FILES(defs)
|
2001-01-31 03:29:38 +08:00
|
|
|
|
|
|
|
# Things included in confdefs.h, but which make no sense in
|
|
|
|
# config.h, nor in $DEFS.
|
|
|
|
cat <<\EOF >>confdefs.h
|
|
|
|
/* Hi Mum! Look, I'm doing C++! */
|
|
|
|
#ifdef __cplusplus
|
|
|
|
void exit (int status);
|
|
|
|
#endif
|
|
|
|
EOF
|
|
|
|
|
2000-02-10 18:41:52 +08:00
|
|
|
# In addition of config.h output a full DEFS
|
|
|
|
AC_OUTPUT_MAKE_DEFS
|
|
|
|
DEFS_SAVED=$DEFS
|
|
|
|
AC_SUBST(DEFS_SAVED)
|
Honor properly the `#define' config.h.in templates.
Test it.
* acgeneral.m4 (AC_OUTPUT_HEADERS): Renamed as...
(_AC_OUTPUT_HEADERS): this. All callers changed.
Don't mess with changequote, just quote properly.
Bug 1. Because of the `#' in `ac_dA', the quotes <<>> were not
removed, and therefore the sed script contained `<<define>>'
instead of `define'. Now that the block is properly quoted, there
is no need to quote `define'.
Bug 2. Once a `#define' substitution performed, we were branching
to the top of the sed script (`t top'). This resulted in an
endless substitution of `#define foo 1' to `#define foo 1'.
Branching is not enough: you also have to fetch the next input
line, i.e., use `t' instead of `t t' in ac_dD, and don't output
`: top' in `config.defines'.
Though it was correct for `#undef' templates, just apply the same
transformation to `ac_uD' and `config.undefs'.
Bug 3. Don't try to preserve what was behind the value in the
template, since on
#define NAME "bar baz"
it leads to
#define NAME 1 baz"
Now `ac_dB' catches everything behind the NAME (making sure there
is at least a space) and `ac_dC' only outputs a space.
* tests/torture.m4: Check that various forms of `#define' header
templates are properly handled.
2000-02-10 18:38:59 +08:00
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_DATA([defs.in],
|
2000-02-10 18:41:52 +08:00
|
|
|
[[@DEFS_SAVED@
|
|
|
|
]])
|
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_DATA([config.hin],
|
Honor properly the `#define' config.h.in templates.
Test it.
* acgeneral.m4 (AC_OUTPUT_HEADERS): Renamed as...
(_AC_OUTPUT_HEADERS): this. All callers changed.
Don't mess with changequote, just quote properly.
Bug 1. Because of the `#' in `ac_dA', the quotes <<>> were not
removed, and therefore the sed script contained `<<define>>'
instead of `define'. Now that the block is properly quoted, there
is no need to quote `define'.
Bug 2. Once a `#define' substitution performed, we were branching
to the top of the sed script (`t top'). This resulted in an
endless substitution of `#define foo 1' to `#define foo 1'.
Branching is not enough: you also have to fetch the next input
line, i.e., use `t' instead of `t t' in ac_dD, and don't output
`: top' in `config.defines'.
Though it was correct for `#undef' templates, just apply the same
transformation to `ac_uD' and `config.undefs'.
Bug 3. Don't try to preserve what was behind the value in the
template, since on
#define NAME "bar baz"
it leads to
#define NAME 1 baz"
Now `ac_dB' catches everything behind the NAME (making sure there
is at least a space) and `ac_dC' only outputs a space.
* tests/torture.m4: Check that various forms of `#define' header
templates are properly handled.
2000-02-10 18:38:59 +08:00
|
|
|
[[#define foo 0
|
|
|
|
# define bar bar
|
|
|
|
# define baz "Archimedes was sinking in his baz"
|
|
|
|
# define fubar tutu
|
|
|
|
#define a B
|
|
|
|
#define aa BB
|
|
|
|
#define aaa BBB
|
|
|
|
#undef a
|
|
|
|
#undef aa
|
|
|
|
#undef aaa
|
|
|
|
]])
|
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CHECK_AUTOCONF
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CHECK_CONFIGURE
|
2000-02-10 18:41:52 +08:00
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_DATA([expout],
|
2001-10-20 01:34:53 +08:00
|
|
|
[[/* config.h. Generated by configure. */
|
Honor properly the `#define' config.h.in templates.
Test it.
* acgeneral.m4 (AC_OUTPUT_HEADERS): Renamed as...
(_AC_OUTPUT_HEADERS): this. All callers changed.
Don't mess with changequote, just quote properly.
Bug 1. Because of the `#' in `ac_dA', the quotes <<>> were not
removed, and therefore the sed script contained `<<define>>'
instead of `define'. Now that the block is properly quoted, there
is no need to quote `define'.
Bug 2. Once a `#define' substitution performed, we were branching
to the top of the sed script (`t top'). This resulted in an
endless substitution of `#define foo 1' to `#define foo 1'.
Branching is not enough: you also have to fetch the next input
line, i.e., use `t' instead of `t t' in ac_dD, and don't output
`: top' in `config.defines'.
Though it was correct for `#undef' templates, just apply the same
transformation to `ac_uD' and `config.undefs'.
Bug 3. Don't try to preserve what was behind the value in the
template, since on
#define NAME "bar baz"
it leads to
#define NAME 1 baz"
Now `ac_dB' catches everything behind the NAME (making sure there
is at least a space) and `ac_dC' only outputs a space.
* tests/torture.m4: Check that various forms of `#define' header
templates are properly handled.
2000-02-10 18:38:59 +08:00
|
|
|
#define foo toto
|
|
|
|
# define bar tata
|
|
|
|
# define baz titi
|
|
|
|
# define fubar tutu
|
|
|
|
#define a A
|
|
|
|
#define aa AA
|
|
|
|
#define aaa AAA
|
|
|
|
#define a A
|
|
|
|
#define aa AA
|
|
|
|
#define aaa AAA
|
|
|
|
]])
|
|
|
|
AT_CHECK([cat config.h], 0, expout)
|
|
|
|
|
2002-01-07 04:48:10 +08:00
|
|
|
# Check the value of DEFS.
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_DATA([expout],
|
2002-01-07 04:48:10 +08:00
|
|
|
[[-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -Dfoo=toto -Dbar=tata -Dbaz=titi -Dfubar=tutu -Da=A -Daaa=AAA -Daa=AA
|
|
|
|
]])
|
2000-02-10 18:41:52 +08:00
|
|
|
|
2000-02-15 17:03:36 +08:00
|
|
|
# Because we strip trailing spaces in `testsuite' we can't leave one in
|
|
|
|
# expout, hence nuke the one left by AC_OUTPUT_MAKE_DEFS.
|
|
|
|
AT_CHECK([sed -e 's/ $//' defs], 0, expout)
|
2000-02-10 18:41:52 +08:00
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CLEANUP
|
2000-11-16 22:56:17 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## ------------------------- ##
|
|
|
|
## Torturing config.status. ##
|
|
|
|
## ------------------------- ##
|
|
|
|
|
|
|
|
## Require 100 AC_DEFINE and AC_SUBST with a significantly big value.
|
|
|
|
## This is mostly to check that Autoconf produces portable sed scripts
|
|
|
|
## in config.status. sed is used to skip the first two lines
|
|
|
|
## `Generated by...'.
|
|
|
|
|
2001-08-20 22:45:00 +08:00
|
|
|
# We use m4_for many times.
|
|
|
|
m4_pattern_allow([^m4_for$])
|
|
|
|
|
2001-01-18 17:15:52 +08:00
|
|
|
AT_SETUP([Torturing config.status])
|
|
|
|
|
2000-11-16 22:56:17 +08:00
|
|
|
dnl The value used as a big value for AC_DEFINE.
|
|
|
|
dnl Don't use sh active chars here, below it is also used in a sh
|
|
|
|
dnl assignment.
|
2001-01-18 17:15:52 +08:00
|
|
|
m4_define([AT_BIG_VALUE],
|
2000-11-16 22:56:17 +08:00
|
|
|
[This value should be long enough to torture the various limits of sed and other tools used by Autoconf.])
|
|
|
|
|
2001-01-18 17:15:52 +08:00
|
|
|
m4_define([AT_DESCRIPTION],
|
2000-11-16 22:56:17 +08:00
|
|
|
[Define to a long string if your `Autoconf' works properly.])
|
|
|
|
|
|
|
|
|
|
|
|
# AT_DUMMY_VAR(NUMBER)
|
|
|
|
# --------------------
|
|
|
|
# Build a name used for AC_SUBST and AC_DEFINE. Put ac_ in it
|
|
|
|
# so that the check for user name space invasion does not complain
|
|
|
|
# of the new variables defined.
|
|
|
|
#
|
|
|
|
# Note that you should not use the name ac_dummy, because it will be
|
|
|
|
# turned into ac_uummy during the construction of config.status. Yes,
|
|
|
|
# this is admittedly a bug, but it would be too hard to fix this.
|
|
|
|
# There is really no point in AC_DEFINE a var named ac_d.*.
|
* lib/autoconf/autoconf.m4, lib/autoconf/general.m4,
* lib/autoconf/libs.m4, lib/autoconf/status.m4,
* lib/autoconf/types.m4, lib/autotest/general.m4,
* lib/m4sugar/m4sh.m4, lib/m4sugar/m4sugar.m4, tests/atspecific.m4,
* tests/torture.at: Rename m4_regexp, m4_patsubst, and m4_match to
m4_bregexp, m4_bpatsubst, and m4_bmatch.
* doc/autoconf.texi (Redefined M4 Macros): Adjust.
2001-10-08 16:22:33 +08:00
|
|
|
m4_pattern_allow([^m4_bpatsubst$])
|
2000-11-23 17:45:48 +08:00
|
|
|
m4_define([AT_DUMMY_VAR],
|
* lib/autoconf/autoconf.m4, lib/autoconf/general.m4,
* lib/autoconf/libs.m4, lib/autoconf/status.m4,
* lib/autoconf/types.m4, lib/autotest/general.m4,
* lib/m4sugar/m4sh.m4, lib/m4sugar/m4sugar.m4, tests/atspecific.m4,
* tests/torture.at: Rename m4_regexp, m4_patsubst, and m4_match to
m4_bregexp, m4_bpatsubst, and m4_bmatch.
* doc/autoconf.texi (Redefined M4 Macros): Adjust.
2001-10-08 16:22:33 +08:00
|
|
|
[ac_Dummy_[]m4_bpatsubst([000$1], [.*\(...\)$], [\1])])
|
2000-11-16 22:56:17 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2000-11-23 17:45:48 +08:00
|
|
|
AT_DATA([dummy.in],
|
|
|
|
[m4_for([AT_Count], 1, 100, 1,
|
2000-11-16 22:56:17 +08:00
|
|
|
[@AT_DUMMY_VAR(AT_Count)@
|
|
|
|
])])
|
|
|
|
|
2001-01-18 17:15:52 +08:00
|
|
|
|
|
|
|
# ------------ #
|
|
|
|
# configure.ac #
|
|
|
|
# ------------ #
|
|
|
|
|
2001-08-20 22:46:02 +08:00
|
|
|
m4_pattern_allow([^m4_(define|defun)$])
|
2001-08-20 22:45:00 +08:00
|
|
|
AT_DATA([configure.ac],
|
2001-01-18 17:15:52 +08:00
|
|
|
dnl The following lines transfer AT_DUMMY_VAR, AT_DESCRIPTION, and
|
|
|
|
dnl AT_BIG_VALUE into the configure.ac as AC_DUMMY_VAR etc.
|
|
|
|
[[m4_define([AC_DUMMY_VAR],]
|
|
|
|
m4_dquote(m4_defn([AT_DUMMY_VAR]))[)]]
|
|
|
|
|
|
|
|
[[m4_define([AC_DESCRIPTION],]
|
|
|
|
m4_dquote(m4_defn([AT_DESCRIPTION]))[)]]
|
|
|
|
|
|
|
|
[[m4_define([AC_BIG_VALUE],]
|
|
|
|
m4_dquote(m4_defn([AT_BIG_VALUE]))[)]]
|
|
|
|
|
|
|
|
[[# AC_DEFUBST(NAME)
|
|
|
|
# ----------------
|
|
|
|
# Related VALUE to NAME both with AC_SUBST and AC_DEFINE. This is
|
|
|
|
# used in the torture tests.
|
|
|
|
m4_defun([AC_DEFUBST],
|
|
|
|
[AC_DUMMY_VAR($1)="AC_BIG_VALUE"
|
|
|
|
AC_DEFINE_UNQUOTED(AC_DUMMY_VAR($1), "$AC_DUMMY_VAR($1)",
|
|
|
|
AC_DESCRIPTION)
|
|
|
|
AC_SUBST(AC_DUMMY_VAR($1))])
|
|
|
|
|
|
|
|
AC_INIT
|
2000-11-16 22:56:17 +08:00
|
|
|
AC_CONFIG_HEADERS(config.h:config.hin)
|
|
|
|
AC_CONFIG_FILES(dummy)
|
2001-01-18 17:15:52 +08:00
|
|
|
m4_for(AC_Count, 1, 100, 1,
|
|
|
|
[AC_DEFUBST(AC_Count)])
|
2000-11-16 22:56:17 +08:00
|
|
|
AC_OUTPUT
|
2001-01-18 17:15:52 +08:00
|
|
|
]])# configure.ac
|
2000-11-16 22:56:17 +08:00
|
|
|
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_AUTOHEADER
|
|
|
|
AT_CHECK_CONFIGURE
|
2000-11-16 22:56:17 +08:00
|
|
|
|
|
|
|
# Checking that AC_DEFINE worked properly.
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([expout],
|
2002-01-07 04:48:10 +08:00
|
|
|
[/* Define to the address where bug reports for this package should be sent. */
|
|
|
|
#define PACKAGE_BUGREPORT ""
|
|
|
|
|
|
|
|
/* Define to the full name of this package. */
|
|
|
|
#define PACKAGE_NAME ""
|
|
|
|
|
|
|
|
/* Define to the full name and version of this package. */
|
|
|
|
#define PACKAGE_STRING ""
|
|
|
|
|
|
|
|
/* Define to the one symbol short name of this package. */
|
|
|
|
#define PACKAGE_TARNAME ""
|
|
|
|
|
|
|
|
/* Define to the version of this package. */
|
|
|
|
#define PACKAGE_VERSION ""
|
|
|
|
m4_for(AT_Count, 1, 100, 1,
|
2000-11-16 22:56:17 +08:00
|
|
|
[
|
2001-01-18 17:15:52 +08:00
|
|
|
/* AT_DESCRIPTION */
|
|
|
|
[#define] AT_DUMMY_VAR(AT_Count) "AT_BIG_VALUE"
|
2000-11-16 22:56:17 +08:00
|
|
|
])])
|
2002-01-07 04:48:10 +08:00
|
|
|
AT_CHECK([sed -n '4,$ p' config.h], 0, expout)
|
2000-11-16 22:56:17 +08:00
|
|
|
|
|
|
|
# Checking that AC_SUBST worked properly.
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([expout],
|
2000-11-23 17:45:48 +08:00
|
|
|
[m4_for(AT_Count, 1, 100, 1,
|
2001-01-18 17:15:52 +08:00
|
|
|
[AT_BIG_VALUE
|
2000-11-16 22:56:17 +08:00
|
|
|
])])
|
|
|
|
|
2002-02-07 01:51:01 +08:00
|
|
|
AT_CLEANUP
|
2001-01-24 21:19:10 +08:00
|
|
|
|
|
|
|
|
|
|
|
## -------- ##
|
|
|
|
## srcdir. ##
|
|
|
|
## -------- ##
|
|
|
|
|
|
|
|
AT_SETUP([srcdir])
|
|
|
|
|
|
|
|
rm -rf at-dir
|
|
|
|
mkdir at-dir
|
|
|
|
: >at-dir/bar.in
|
|
|
|
: >foo.in
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([foo at-dir/bar])
|
|
|
|
|
|
|
|
AC_CONFIG_COMMANDS([report],
|
|
|
|
[test -f $srcdir/configure.ac ||
|
|
|
|
AC_MSG_ERROR([cannot find $srcdir/configure.ac])],
|
|
|
|
[srcdir=$srcdir])
|
|
|
|
|
|
|
|
AC_OUTPUT
|
|
|
|
rm -rf foo at-dir/bar
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
|
|
|
|
# In place.
|
|
|
|
AT_CHECK([./configure], [], [ignore])
|
|
|
|
|
|
|
|
# Relative path.
|
|
|
|
AT_CHECK([cd at-dir && ../configure], [], [ignore])
|
|
|
|
|
|
|
|
# Absolute path.
|
|
|
|
at_here=`pwd`
|
|
|
|
AT_CHECK([cd at-dir && $at_here/configure], [], [ignore])
|
|
|
|
|
2002-02-07 01:51:01 +08:00
|
|
|
AT_CLEANUP
|
2001-06-02 13:49:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
## ----------------- ##
|
|
|
|
## Signal handling. ##
|
|
|
|
## ----------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([Signal handling])
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
|
|
|
kill -2 $$
|
|
|
|
exit 77
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE([], 1, ignore, ignore)
|
|
|
|
|
|
|
|
AT_CLEANUP
|
2001-08-20 22:46:02 +08:00
|
|
|
|
|
|
|
|
|
|
|
## ---------------------------- ##
|
|
|
|
## Configuring subdirectories. ##
|
|
|
|
## ---------------------------- ##
|
|
|
|
|
|
|
|
# .
|
|
|
|
# |-- builddir
|
|
|
|
# | |-- config.log
|
|
|
|
# | |-- config.status
|
|
|
|
# | `-- inner
|
|
|
|
# | |-- config.log
|
|
|
|
# | |-- config.status
|
|
|
|
# | `-- innermost
|
|
|
|
# | `-- config
|
|
|
|
# |-- configure
|
|
|
|
# |-- configure.ac
|
|
|
|
# |-- inner
|
|
|
|
# | |-- configure
|
|
|
|
# | |-- configure.ac
|
|
|
|
# | `-- innermost
|
|
|
|
# | `-- config.in
|
|
|
|
# `-- install-sh
|
|
|
|
#
|
|
|
|
AT_SETUP([Configuring subdirectories])
|
2001-11-09 00:15:20 +08:00
|
|
|
AT_KEYWORDS(autoreconf)
|
|
|
|
|
2002-02-06 17:39:54 +08:00
|
|
|
# We use aclocal (via autoreconf).
|
2003-03-29 01:10:27 +08:00
|
|
|
AT_CHECK([aclocal --version || exit 77], [], [stdout], [ignore])
|
|
|
|
# It should understand configure.ac.
|
2003-04-02 01:33:59 +08:00
|
|
|
AT_CHECK([[grep '1.[01234]' stdout && exit 77]], [1], [ignore])
|
2002-02-06 17:39:54 +08:00
|
|
|
|
2001-08-20 22:46:02 +08:00
|
|
|
# The contents of `inner/', and `inner/innermost/'.
|
|
|
|
AS_MKDIR_P([inner/innermost])
|
|
|
|
|
2002-01-30 01:19:29 +08:00
|
|
|
# We have to use configure.in, not configure.ac, if we still want to
|
|
|
|
# be compatible with Automake 1.4: aclocal (run by autoreconf) would
|
|
|
|
# die because it can't find configure.in.
|
|
|
|
AT_DATA([inner/configure.in],
|
2002-10-29 16:09:40 +08:00
|
|
|
[[AC_INIT(GNU Inner, 1.0)
|
2001-08-20 22:46:02 +08:00
|
|
|
AC_CONFIG_SRCDIR([innermost/config.in])
|
|
|
|
AC_ARG_VAR([INNER], [an inner variable])
|
2002-09-09 23:51:52 +08:00
|
|
|
AC_SUBST([INNER])
|
|
|
|
if test "x$INNER" = x; then
|
|
|
|
INNER=inner
|
|
|
|
fi
|
2001-08-20 22:46:02 +08:00
|
|
|
AC_CONFIG_FILES([innermost/config])
|
|
|
|
AC_OUTPUT
|
2002-10-29 16:09:40 +08:00
|
|
|
]])
|
2001-08-20 22:46:02 +08:00
|
|
|
|
|
|
|
AT_DATA([inner/innermost/config.in],
|
|
|
|
[INNER=@INNER@
|
|
|
|
srcdir=@srcdir@
|
|
|
|
top_srcdir=@top_srcdir@
|
2002-09-09 23:51:52 +08:00
|
|
|
prefix=@prefix@
|
2001-08-20 22:46:02 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
# The contents of `.'
|
|
|
|
AT_DATA([install-sh], [])
|
|
|
|
|
2001-11-09 00:15:20 +08:00
|
|
|
# nonexistent is allowed not to exist.
|
2002-01-30 01:19:29 +08:00
|
|
|
AT_DATA([configure.in],
|
2002-10-29 16:09:40 +08:00
|
|
|
[[AC_INIT(GNU Outer, 1.0)
|
2001-08-20 22:46:02 +08:00
|
|
|
AC_ARG_VAR([OUTER], [an outer variable])
|
2001-11-09 00:15:20 +08:00
|
|
|
if false; then
|
|
|
|
AC_CONFIG_SUBDIRS([nonexistent])
|
|
|
|
fi
|
2001-08-20 22:46:02 +08:00
|
|
|
AC_CONFIG_SUBDIRS([inner])
|
|
|
|
AC_OUTPUT
|
2002-10-29 16:09:40 +08:00
|
|
|
]])
|
2001-08-20 22:46:02 +08:00
|
|
|
|
2001-11-09 00:15:20 +08:00
|
|
|
AT_CHECK([autoreconf])
|
2001-08-20 22:46:02 +08:00
|
|
|
AT_CHECK([test -f inner/configure])
|
|
|
|
|
|
|
|
# Running the outer configure recursively should provide the innermost
|
|
|
|
# help strings.
|
|
|
|
AT_CHECK([./configure --help=recursive | grep INNER], 0, [ignore])
|
|
|
|
|
|
|
|
# Running the outer configure should trigger the inner.
|
|
|
|
AT_CHECK_CONFIGURE
|
|
|
|
AT_CHECK([cat inner/innermost/config], 0,
|
|
|
|
[INNER=inner
|
|
|
|
srcdir=.
|
|
|
|
top_srcdir=..
|
2002-09-09 23:51:52 +08:00
|
|
|
prefix=/usr/local
|
2001-08-20 22:46:02 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
# The same, but from a builddir.
|
|
|
|
AS_MKDIR_P([builddir])
|
|
|
|
AT_CHECK([cd builddir && ../configure], 0, [ignore])
|
|
|
|
AT_CHECK([cat builddir/inner/innermost/config], 0,
|
|
|
|
[INNER=inner
|
|
|
|
srcdir=../../../inner/innermost
|
|
|
|
top_srcdir=../../../inner
|
2002-09-09 23:51:52 +08:00
|
|
|
prefix=/usr/local
|
2001-08-20 22:46:02 +08:00
|
|
|
])
|
|
|
|
|
2002-09-09 23:51:52 +08:00
|
|
|
# Make sure precious variables and command line options are properly
|
2002-09-28 22:10:45 +08:00
|
|
|
# passed, even when there are duplicates. Run another directory so
|
|
|
|
# that if the user has set config.site to have a config.cache, then
|
|
|
|
# the two runs don't have colliding caches.
|
|
|
|
AS_MKDIR_P([builddir2])
|
|
|
|
AT_CHECK([cd builddir2 && ../configure --prefix /bad --prefix /good INNER=bad INNER=good], 0, [ignore])
|
|
|
|
AT_CHECK([cat builddir2/inner/innermost/config], 0,
|
2002-09-09 23:51:52 +08:00
|
|
|
[INNER=good
|
|
|
|
srcdir=../../../inner/innermost
|
|
|
|
top_srcdir=../../../inner
|
|
|
|
prefix=/good
|
|
|
|
])
|
2001-08-20 22:46:02 +08:00
|
|
|
|
2002-01-30 01:19:29 +08:00
|
|
|
AT_CLEANUP
|
2002-10-29 16:09:40 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## -------------- ##
|
|
|
|
## Deep Package. ##
|
|
|
|
## -------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([Deep Package])
|
|
|
|
AT_KEYWORDS(autoreconf)
|
|
|
|
|
|
|
|
# We use aclocal (via autoreconf).
|
|
|
|
AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
|
|
|
|
|
|
|
|
# The contents of `.'
|
|
|
|
AT_DATA([install-sh], [])
|
|
|
|
AT_DATA([configure.in],
|
|
|
|
[[AC_INIT(GNU Outer, 1.0)
|
|
|
|
AC_ARG_VAR([OUTER], [an outer variable])
|
|
|
|
AC_CONFIG_SUBDIRS([inner])
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
# The contents of `inner/', and `inner/innermost/'.
|
|
|
|
AS_MKDIR_P([inner/innermost])
|
|
|
|
|
|
|
|
AT_DATA([inner/configure.ac],
|
|
|
|
[[AC_INIT(GNU Inner, 1.0)
|
|
|
|
AC_ARG_VAR([INNER], [an inner variable])
|
|
|
|
AC_CONFIG_SUBDIRS(innermost)
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([inner/innermost/configure.ac],
|
|
|
|
[[AC_INIT(GNU Innermost, 1.0)
|
|
|
|
AC_ARG_VAR([INNERMOST], [an innermost variable])
|
|
|
|
AC_CONFIG_HEADERS(config.h:config.hin)
|
|
|
|
AC_DEFINE_UNQUOTED([INNERMOST], [$INNERMOST], [an innermost variable])
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK([autoreconf -Wall -v], [0], [ignore], [ignore])
|
|
|
|
AT_CHECK([test -f inner/configure])
|
|
|
|
AT_CHECK([test -f inner/innermost/configure])
|
|
|
|
AT_CHECK([test -f inner/innermost/config.hin])
|
|
|
|
|
|
|
|
# Running the outer configure recursively should provide the innermost
|
|
|
|
# help strings.
|
2002-11-06 18:29:21 +08:00
|
|
|
AT_CHECK([./configure --help=recursive | grep " INNER "], 0, [ignore])
|
|
|
|
AT_CHECK([./configure --help=recursive | grep " INNERMOST "], 0, [ignore])
|
2002-10-29 16:09:40 +08:00
|
|
|
|
|
|
|
# Running the outer configure should trigger the inner.
|
|
|
|
AT_CHECK_CONFIGURE([INNERMOST=tsomrenni])
|
|
|
|
AT_CHECK([grep INNERMOST inner/innermost/config.h], 0,
|
|
|
|
[[#define INNERMOST tsomrenni
|
|
|
|
]])
|
|
|
|
|
|
|
|
# The same, but from a builddir.
|
|
|
|
AS_MKDIR_P([builddir])
|
|
|
|
AT_CHECK([cd builddir && ../configure INNERMOST=build/tsomrenni], 0, [ignore])
|
|
|
|
AT_CHECK([grep INNERMOST builddir/inner/innermost/config.h], 0,
|
|
|
|
[[#define INNERMOST build/tsomrenni
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CLEANUP
|