* 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
|
|
|
|
2006-05-27 06:29:50 +08:00
|
|
|
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
|
2005-02-05 15:34:54 +08:00
|
|
|
# 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
|
|
|
|
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],
|
2006-05-06 13:53:50 +08:00
|
|
|
[precious='m4_bpatsubst($1, [[']], ['\\''])'; export precious],
|
* 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
|
|
|
[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],
|
* 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
|
|
|
[precious='$2'; export precious],
|
|
|
|
[unset precious])
|
2001-06-24 01:14:34 +08:00
|
|
|
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
|
|
|
|
2006-04-08 17:07:05 +08:00
|
|
|
# Change a precious variable that contains braces
|
|
|
|
AT_CHECK_AC_ARG_VAR([apple of my {eye}], [orange of my eye])
|
|
|
|
|
2006-05-06 13:53:50 +08:00
|
|
|
# Change a precious variable that contains all kinds of fun
|
|
|
|
AT_CHECK_AC_ARG_VAR(['p r ec"iou$], [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
|
2004-01-05 15:05:22 +08:00
|
|
|
rm -f -r header var-header file var-file link var-link command var-command
|
2001-06-23 23:04:14 +08:00
|
|
|
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)
|
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(command,
|
* 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
|
|
|
[cp input command]);;
|
2001-06-23 23:04:14 +08:00
|
|
|
var-command)
|
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(var-command,
|
* 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
|
|
|
[cp $command_in var-command], [command_in=input]);;
|
2001-06-23 23:04:14 +08:00
|
|
|
|
|
|
|
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],
|
* 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
|
|
|
[ignore], [$1
|
2001-06-23 23:04:14 +08:00
|
|
|
])
|
|
|
|
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],
|
* 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
|
|
|
[ignore], [var-$1
|
2001-06-23 23:04:14 +08:00
|
|
|
])
|
|
|
|
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
|
|
|
|
2006-04-05 22:20:37 +08:00
|
|
|
## ---------------------------------------- ##
|
|
|
|
## Macro calls in AC_CONFIG_COMMANDS tags. ##
|
|
|
|
## ---------------------------------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([Macro calls in AC_CONFIG_COMMANDS tags])
|
|
|
|
|
|
|
|
AT_DATA_M4SUGAR([configure.ac],
|
|
|
|
[[AC_INIT
|
|
|
|
AC_CONFIG_COMMANDS([m4_if(1,1,mytag)])
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
|
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'
|
2006-05-06 13:53:50 +08:00
|
|
|
# and verify that (i) `configure' correctly receives the arguments,
|
2000-05-22 16:05:40 +08:00
|
|
|
# (ii) correctly passes them to `config.status', which we check by
|
2006-05-06 13:53:50 +08:00
|
|
|
# running `config.status --recheck', and (iii) correctly passes them
|
|
|
|
# to sub-configure scripts.
|
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
|
|
|
|
2006-05-06 13:53:50 +08:00
|
|
|
mkdir sub
|
|
|
|
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-02-10 02:24:24 +08:00
|
|
|
[[AC_INIT
|
2006-05-06 13:53:50 +08:00
|
|
|
AC_CONFIG_SUBDIRS([sub])
|
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
|
|
|
|
]])
|
|
|
|
|
2006-05-06 13:53:50 +08:00
|
|
|
AT_DATA([sub/configure.ac],
|
|
|
|
[[AC_INIT
|
|
|
|
echo "result=$one$enable_two$with_three"
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
echo fake install-sh script >install-sh
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
cd sub
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CHECK_AUTOCONF
|
2006-05-06 13:53:50 +08:00
|
|
|
cd ..
|
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 |
|
* 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
|
|
|
sed -n -e 's/^result=//p'], 0,
|
2006-05-06 13:53:50 +08:00
|
|
|
[m4_do([onetwothree
|
|
|
|
], [onetwothree
|
|
|
|
])])
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CHECK([./config.status --recheck | sed -n 's/^result=//p'], 0,
|
* 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
|
|
|
[onetwothree
|
2000-12-19 16:15:48 +08:00
|
|
|
])
|
2000-02-10 02:24:24 +08:00
|
|
|
|
2006-05-06 13:53:50 +08:00
|
|
|
AT_CHECK_CONFIGURE([one="\"'$ " --enable-two="\" ' $" --with-three=" \"'$"|
|
* 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
|
|
|
sed -n -e 's/^result=//p'], 0,
|
2006-05-06 13:53:50 +08:00
|
|
|
[m4_do(["'$ " ' $ "'$
|
|
|
|
], ["'$ " ' $ "'$
|
|
|
|
])])
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CHECK([./config.status --recheck | sed -n 's/^result=//p'], 0,
|
2006-05-06 13:53:50 +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.
|
|
|
|
|
2006-10-28 07:05:33 +08:00
|
|
|
AT_SETUP([[#define header templates]])
|
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
|
|
|
|
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
|
2003-06-23 22:34:48 +08:00
|
|
|
/* Hi Mum! Look, I am doing C++! */
|
2001-01-31 03:29:38 +08:00
|
|
|
#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"
|
* TODO, config/Makefile.am, lib/freeze.mk, lib/autoconf/c.m4,
lib/autoconf/specific.m4, lib/autoconf/status.m4,
lib/autoconf/types.m4, lib/autotest/general.m4,
tests/mktests.sh, tests/torture.at: White space cleanup:
remove some SPACE before TAB, or add quoting ('' or @&t@).
2006-04-06 04:55:14 +08:00
|
|
|
# define fubar tutu
|
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 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],
|
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
|
|
|
[[/* config.h. Generated from config.hin 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. ##
|
|
|
|
## ------------------------- ##
|
|
|
|
|
2006-03-07 06:34:34 +08:00
|
|
|
## Require 100 AC_DEFINE and AC_SUBST and AC_SUBST_FILE 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
|
2000-11-16 22:56:17 +08:00
|
|
|
## `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)@
|
2006-03-07 06:34:34 +08:00
|
|
|
@[f]AT_Count@
|
2000-11-16 22:56:17 +08:00
|
|
|
])])
|
|
|
|
|
2001-01-18 17:15:52 +08:00
|
|
|
|
2006-03-07 06:34:34 +08:00
|
|
|
i=1
|
|
|
|
while test $i != 101; do
|
|
|
|
echo "content of file $i" > file_$i
|
|
|
|
i=`expr $i + 1`
|
|
|
|
done
|
|
|
|
|
|
|
|
|
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)",
|
* 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
|
|
|
AC_DESCRIPTION)
|
2006-03-07 06:34:34 +08:00
|
|
|
AC_SUBST(AC_DUMMY_VAR($1))
|
|
|
|
AC_SUBST_FILE([f]$1)
|
|
|
|
f$1=file_$1
|
|
|
|
])
|
2001-01-18 17:15:52 +08:00
|
|
|
|
|
|
|
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)])
|
2006-12-05 14:00:42 +08:00
|
|
|
AC_PROG_AWK
|
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
|
2006-12-05 14:00:42 +08:00
|
|
|
# Check both awk and the result of AC_PROG_AWK
|
|
|
|
for awk_arg in FOO= AWK=awk; do
|
|
|
|
AT_CHECK_CONFIGURE([$awk_arg])
|
2000-11-16 22:56:17 +08:00
|
|
|
|
2006-12-05 14:00:42 +08:00
|
|
|
# Checking that AC_DEFINE worked properly.
|
|
|
|
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
|
|
|
])])
|
|
|
|
|
2006-12-05 14:00:42 +08:00
|
|
|
AT_CHECK([sed -n '4,$ p' config.h], 0, expout)
|
|
|
|
|
|
|
|
# Checking that AC_SUBST worked properly.
|
|
|
|
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
|
2006-03-07 06:34:34 +08:00
|
|
|
content of file AT_Count
|
2000-11-16 22:56:17 +08:00
|
|
|
])])
|
|
|
|
|
2006-12-05 14:00:42 +08:00
|
|
|
AT_CHECK([cat dummy], 0, expout)
|
|
|
|
done
|
2006-03-07 06:34:34 +08:00
|
|
|
|
2002-02-07 01:51:01 +08:00
|
|
|
AT_CLEANUP
|
2001-01-24 21:19:10 +08:00
|
|
|
|
|
|
|
|
2005-02-05 15:34:54 +08:00
|
|
|
## ------------------------------- ##
|
|
|
|
## Substitute a 2000-byte string. ##
|
|
|
|
## ------------------------------- ##
|
|
|
|
|
|
|
|
# Solaris 9 /usr/ucb/sed that rejects commands longer than 4000 bytes. HP/UX
|
|
|
|
# sed dumps core around 8 KiB. However, POSIX says that sed need not
|
|
|
|
# handle lines longer than 2048 bytes (including the trailing newline).
|
Rewrite config files generation: avoid quadratic growth in
the number of substituted variables by using awk instead of sed
for the bulk of the substitutions.
* NEWS: Mention this.
* doc/autoconf.texi (Setting Output Variables): `|#_!!_#|' is also
forbidden in the output (and thus input) file.
* lib/autoconf/status.m4 (_AC_AWK_LITERAL_LIMIT): New macro.
(_AC_OUTPUT_FILES_PREPARE): Instead of several sed scripts,
generate just one large awk script for substitutions,
eliminating much of the earlier complexity, while adding some
new complexity. Only expand the substitution templates at
configure time, for smaller configure script size. If
_AC_SUBST_FILES are used, test 'awk' for working getline support
at config.status time. If absent, interpolate through the
shell. The awk script was written with much help
from Paolo Bonzini and Paul Eggert.
(_AC_SED_CMD_NUM, _AC_SED_DELIM_NUM, _AC_SED_FRAG): Removed.
(_AC_SED_FRAG_NUM): Likewise.
(_AC_SUBST_CMDS): Renamed from...
(_AC_SED_CMDS): ...this.
(_AC_OUTPUT_FILE): Use _AC_SUBST_CMDS.
* tests/torture.at (Substitute a 2000-byte string): Also
substitute a line with 1000 words, and a variable with several
long lines.
(Substitute and define special characters): Test awk special
characters, and put substitution input strings `@foo@' in the
output, to test that no recursion happens; test several other
combinations from Paolo Bonzini.
2006-11-27 01:53:10 +08:00
|
|
|
# So we'll just test a 2000-byte value, and for awk, we test a line with
|
2006-12-06 05:36:25 +08:00
|
|
|
# almost 1000 words, and one variable with 5 lines of 2000 bytes each:
|
|
|
|
# multi-line values should allow to get around the limitations.
|
2005-02-05 15:34:54 +08:00
|
|
|
|
|
|
|
AT_SETUP([Substitute a 2000-byte string])
|
|
|
|
|
|
|
|
AT_DATA([Foo.in], [@foo@
|
|
|
|
])
|
Rewrite config files generation: avoid quadratic growth in
the number of substituted variables by using awk instead of sed
for the bulk of the substitutions.
* NEWS: Mention this.
* doc/autoconf.texi (Setting Output Variables): `|#_!!_#|' is also
forbidden in the output (and thus input) file.
* lib/autoconf/status.m4 (_AC_AWK_LITERAL_LIMIT): New macro.
(_AC_OUTPUT_FILES_PREPARE): Instead of several sed scripts,
generate just one large awk script for substitutions,
eliminating much of the earlier complexity, while adding some
new complexity. Only expand the substitution templates at
configure time, for smaller configure script size. If
_AC_SUBST_FILES are used, test 'awk' for working getline support
at config.status time. If absent, interpolate through the
shell. The awk script was written with much help
from Paolo Bonzini and Paul Eggert.
(_AC_SED_CMD_NUM, _AC_SED_DELIM_NUM, _AC_SED_FRAG): Removed.
(_AC_SED_FRAG_NUM): Likewise.
(_AC_SUBST_CMDS): Renamed from...
(_AC_SED_CMDS): ...this.
(_AC_OUTPUT_FILE): Use _AC_SUBST_CMDS.
* tests/torture.at (Substitute a 2000-byte string): Also
substitute a line with 1000 words, and a variable with several
long lines.
(Substitute and define special characters): Test awk special
characters, and put substitution input strings `@foo@' in the
output, to test that no recursion happens; test several other
combinations from Paolo Bonzini.
2006-11-27 01:53:10 +08:00
|
|
|
AT_DATA([Bar.in], [@bar@
|
|
|
|
])
|
|
|
|
AT_DATA([Baz.in], [@baz@
|
|
|
|
])
|
2005-02-05 15:34:54 +08:00
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
Rework to use more-modern build style.
Many files are renamed; all uses of their names were changed.
* .x-sc_trailing_blank: Renamed from .x-sc_trailing_blank.
* .x-sc_useless_cpp_parens: New file.
* build-aux/config.guess: Renamed from config/config.guess. Update.
* build-aux/config.sub: Renamed from config/config.sub. Update.
* build-aux/elisp-comp: Renamed from config/elisp-comp.
* build-aux/install-sh: Renamed from config/install-sh. Update.
* build-aux/mdate-sh: Renamed from config/mdate-sh.
* build-aux/missing: Renamed from config/missing.
* build-aux/texinfo.tex: Renamed from config/texinfo.tex. Update.
* build-aux/vc-list-files: Renamed from config/vc-list-files.
* config/Makefile.am: Removed.
* config/mkinstalldirs: Removed.
* config/move-if-change: Removed.
* m4/m4.m4: Renamed from config/m4.m4. Add (C) to copyright notice.
* Makefile.am (SUBDIRS): Remove config.
(ACLOCAL_AMFLAGS): Include from m4, not config.
(EXTRA_DIST): Add config/announce-gen, config/prev-version.txt.
(WGET, WGETFLAGS): New macros, since Makefile.maint no longer does this.
(autom4te-update): Rewrite with a loop. Get from gnulib, not automake.
Fail if there's an error.
* Makefile.cfg (move_if_change): Remove.
(wget_files): Remove.
(cvs_executable_files): New macro.
(cvs_files): Use it. Remove mkinstalldirs. Add fdl.texi.
(executable-update): Use $(cvs_executable_files).
(local-checks-to-skip): Remove.
* Makefile.maint: Merge from coreutils, plus add our own changes
(gzip_rsyncable): New macro.
(GZIP_ENV): Use it.
(CVS_LIST): Use build-aux/vc-list-files.
(VERSION_REGEXP): New macro.
(local-checks-available): Add patch-check, $(syntax-check-rules),
check-AUTHORS.
(syntax-check-rules): Compute dynamically.
(sc_cast_of_x_alloc_return_value): Work even if no source files.
(sc_cast_of_alloca_return_value): Likewise.
(sc_prohibit_atoi_atof): Simplify regexp.
(sc_no_if_have_config_h, sc_require_config_h):
(sc_prohibit_assert_without_use,
(sc_obsolete_symbols): Check for O_NDELAY.
(sc_texi_notab): Remove.
(sc-changelog): Don't make an exception for '----' lines.
(.re-list): Remove, so we don't have a junk file behind.
(sc_system_h_headers): Remove the need for .re-list.
(sc_the_the): New rule.
(sc_tight_scope): Simplify.
(sc_trailing_space): Renamed from sc_trailing_blank.
(longopt_re): New macro.
(sc_two_space_separator_in_usage): New rule.
(sc_unmarked_diagnostics): Look at all files under CVS.
(sc_useless_cpp_parens, patch-check, check-AUTHORS): New rules.
(news-date-check, changelog-check): Version is OK.
(po-check): Look for lib files even if not in CVS.
(copyright-check): Use $() not ``.
(maintainer-distcheck): Do not depend on changelog-check.
(my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
Also check for -Wpointer-arith.
(WGET, WGETFLAGS, tgz-md5, tgz-sha1, bz2-md5, bz2-sha1):
(xdelta-md5, xdelta-sha1, tgz-size, bz2-size, xd-size, rel-check):
Remove.
(announcement): Add --gpg-key-id arg.
(cvs-sv): Remove.
(move_if_change): Just use mv.
(local_updates: Remove wget-update, po-update.
(po_repo, do-po-update, po-update, wget_files, get-targets): Remove.
(config.guess-url_prefix, config.sub-url_prefix): Remove.
(ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
(standards.texi-url_prefix, make-stds.texi-url_prefix, target, url):
($(get-targets)): Remove.
(cvs_files): Remove missing, mkinstalldirs, ansi2knr.c.
(gnulib_repo): Renamed from automake_repo. Get from gnulib now.
(cvs-update): Get from gnulib.
(emut_upload_commands): gnupload is in build-aux now.
(alpha beta major): Add changelog-check. Check version.
* configure.ac (AC_CONFIG_AUX_DIR): Renamed from config to build-aux.
(AC_CONFIG_FILES): Remove.
* bin/autoconf.as: Add spaces to avoid distcheck warning.
* config/announce-gen: Sync from coreutils.
* doc/make-stds.texi: Sync from gnulib.
* doc/standards.texi: Likewise.
* man/Makefile.am: Adjust for config -> build-aux renaming.
* tests/Makefile.am: Prefer $(FOO) to @FOO@.
* tests/local.at: Adjust from config -> build-aux renaming.
* tests/tools.at: Likewise.
* tests/torture.at: Likewise.
2006-08-25 06:56:47 +08:00
|
|
|
AC_CONFIG_AUX_DIR($top_srcdir/build-aux)
|
2005-02-05 15:34:54 +08:00
|
|
|
AC_SUBST([foo], ]m4_for([n], 1, 100,, ....................)[)
|
Rewrite config files generation: avoid quadratic growth in
the number of substituted variables by using awk instead of sed
for the bulk of the substitutions.
* NEWS: Mention this.
* doc/autoconf.texi (Setting Output Variables): `|#_!!_#|' is also
forbidden in the output (and thus input) file.
* lib/autoconf/status.m4 (_AC_AWK_LITERAL_LIMIT): New macro.
(_AC_OUTPUT_FILES_PREPARE): Instead of several sed scripts,
generate just one large awk script for substitutions,
eliminating much of the earlier complexity, while adding some
new complexity. Only expand the substitution templates at
configure time, for smaller configure script size. If
_AC_SUBST_FILES are used, test 'awk' for working getline support
at config.status time. If absent, interpolate through the
shell. The awk script was written with much help
from Paolo Bonzini and Paul Eggert.
(_AC_SED_CMD_NUM, _AC_SED_DELIM_NUM, _AC_SED_FRAG): Removed.
(_AC_SED_FRAG_NUM): Likewise.
(_AC_SUBST_CMDS): Renamed from...
(_AC_SED_CMDS): ...this.
(_AC_OUTPUT_FILE): Use _AC_SUBST_CMDS.
* tests/torture.at (Substitute a 2000-byte string): Also
substitute a line with 1000 words, and a variable with several
long lines.
(Substitute and define special characters): Test awk special
characters, and put substitution input strings `@foo@' in the
output, to test that no recursion happens; test several other
combinations from Paolo Bonzini.
2006-11-27 01:53:10 +08:00
|
|
|
AC_SUBST([bar], "]m4_for([n], 1, 100,, @ @ @ @ @ @ @ @ @ @@)[")
|
2006-12-06 05:36:25 +08:00
|
|
|
AC_SUBST([baz], "]m4_for([n], 1, 5,, m4_for([m], 1, 100,, ... ... ... ... ....)
|
Rewrite config files generation: avoid quadratic growth in
the number of substituted variables by using awk instead of sed
for the bulk of the substitutions.
* NEWS: Mention this.
* doc/autoconf.texi (Setting Output Variables): `|#_!!_#|' is also
forbidden in the output (and thus input) file.
* lib/autoconf/status.m4 (_AC_AWK_LITERAL_LIMIT): New macro.
(_AC_OUTPUT_FILES_PREPARE): Instead of several sed scripts,
generate just one large awk script for substitutions,
eliminating much of the earlier complexity, while adding some
new complexity. Only expand the substitution templates at
configure time, for smaller configure script size. If
_AC_SUBST_FILES are used, test 'awk' for working getline support
at config.status time. If absent, interpolate through the
shell. The awk script was written with much help
from Paolo Bonzini and Paul Eggert.
(_AC_SED_CMD_NUM, _AC_SED_DELIM_NUM, _AC_SED_FRAG): Removed.
(_AC_SED_FRAG_NUM): Likewise.
(_AC_SUBST_CMDS): Renamed from...
(_AC_SED_CMDS): ...this.
(_AC_OUTPUT_FILE): Use _AC_SUBST_CMDS.
* tests/torture.at (Substitute a 2000-byte string): Also
substitute a line with 1000 words, and a variable with several
long lines.
(Substitute and define special characters): Test awk special
characters, and put substitution input strings `@foo@' in the
output, to test that no recursion happens; test several other
combinations from Paolo Bonzini.
2006-11-27 01:53:10 +08:00
|
|
|
)[")
|
2006-12-06 02:57:06 +08:00
|
|
|
AC_PROG_AWK
|
Rewrite config files generation: avoid quadratic growth in
the number of substituted variables by using awk instead of sed
for the bulk of the substitutions.
* NEWS: Mention this.
* doc/autoconf.texi (Setting Output Variables): `|#_!!_#|' is also
forbidden in the output (and thus input) file.
* lib/autoconf/status.m4 (_AC_AWK_LITERAL_LIMIT): New macro.
(_AC_OUTPUT_FILES_PREPARE): Instead of several sed scripts,
generate just one large awk script for substitutions,
eliminating much of the earlier complexity, while adding some
new complexity. Only expand the substitution templates at
configure time, for smaller configure script size. If
_AC_SUBST_FILES are used, test 'awk' for working getline support
at config.status time. If absent, interpolate through the
shell. The awk script was written with much help
from Paolo Bonzini and Paul Eggert.
(_AC_SED_CMD_NUM, _AC_SED_DELIM_NUM, _AC_SED_FRAG): Removed.
(_AC_SED_FRAG_NUM): Likewise.
(_AC_SUBST_CMDS): Renamed from...
(_AC_SED_CMDS): ...this.
(_AC_OUTPUT_FILE): Use _AC_SUBST_CMDS.
* tests/torture.at (Substitute a 2000-byte string): Also
substitute a line with 1000 words, and a variable with several
long lines.
(Substitute and define special characters): Test awk special
characters, and put substitution input strings `@foo@' in the
output, to test that no recursion happens; test several other
combinations from Paolo Bonzini.
2006-11-27 01:53:10 +08:00
|
|
|
AC_CONFIG_FILES([Foo Bar Baz])
|
2005-02-05 15:34:54 +08:00
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
2006-12-05 14:00:42 +08:00
|
|
|
# Check both awk and the result of AC_PROG_AWK
|
|
|
|
for awk_arg in Foo= AWK=awk; do
|
|
|
|
AT_CHECK_CONFIGURE([$awk_arg])
|
|
|
|
AT_CHECK([cat Foo], 0, m4_for([n], 1, 100,, ....................)
|
2005-02-05 15:34:54 +08:00
|
|
|
)
|
2006-12-05 14:00:42 +08:00
|
|
|
AT_CHECK([cat Bar], 0, m4_for([n], 1, 100,, @ @ @ @ @ @ @ @ @ @@)
|
Rewrite config files generation: avoid quadratic growth in
the number of substituted variables by using awk instead of sed
for the bulk of the substitutions.
* NEWS: Mention this.
* doc/autoconf.texi (Setting Output Variables): `|#_!!_#|' is also
forbidden in the output (and thus input) file.
* lib/autoconf/status.m4 (_AC_AWK_LITERAL_LIMIT): New macro.
(_AC_OUTPUT_FILES_PREPARE): Instead of several sed scripts,
generate just one large awk script for substitutions,
eliminating much of the earlier complexity, while adding some
new complexity. Only expand the substitution templates at
configure time, for smaller configure script size. If
_AC_SUBST_FILES are used, test 'awk' for working getline support
at config.status time. If absent, interpolate through the
shell. The awk script was written with much help
from Paolo Bonzini and Paul Eggert.
(_AC_SED_CMD_NUM, _AC_SED_DELIM_NUM, _AC_SED_FRAG): Removed.
(_AC_SED_FRAG_NUM): Likewise.
(_AC_SUBST_CMDS): Renamed from...
(_AC_SED_CMDS): ...this.
(_AC_OUTPUT_FILE): Use _AC_SUBST_CMDS.
* tests/torture.at (Substitute a 2000-byte string): Also
substitute a line with 1000 words, and a variable with several
long lines.
(Substitute and define special characters): Test awk special
characters, and put substitution input strings `@foo@' in the
output, to test that no recursion happens; test several other
combinations from Paolo Bonzini.
2006-11-27 01:53:10 +08:00
|
|
|
)
|
2006-12-06 05:36:25 +08:00
|
|
|
AT_CHECK([cat Baz], 0, m4_for([n], 1, 5,, m4_for([m], 1, 100,, ... ... ... ... ....)
|
Rewrite config files generation: avoid quadratic growth in
the number of substituted variables by using awk instead of sed
for the bulk of the substitutions.
* NEWS: Mention this.
* doc/autoconf.texi (Setting Output Variables): `|#_!!_#|' is also
forbidden in the output (and thus input) file.
* lib/autoconf/status.m4 (_AC_AWK_LITERAL_LIMIT): New macro.
(_AC_OUTPUT_FILES_PREPARE): Instead of several sed scripts,
generate just one large awk script for substitutions,
eliminating much of the earlier complexity, while adding some
new complexity. Only expand the substitution templates at
configure time, for smaller configure script size. If
_AC_SUBST_FILES are used, test 'awk' for working getline support
at config.status time. If absent, interpolate through the
shell. The awk script was written with much help
from Paolo Bonzini and Paul Eggert.
(_AC_SED_CMD_NUM, _AC_SED_DELIM_NUM, _AC_SED_FRAG): Removed.
(_AC_SED_FRAG_NUM): Likewise.
(_AC_SUBST_CMDS): Renamed from...
(_AC_SED_CMDS): ...this.
(_AC_OUTPUT_FILE): Use _AC_SUBST_CMDS.
* tests/torture.at (Substitute a 2000-byte string): Also
substitute a line with 1000 words, and a variable with several
long lines.
(Substitute and define special characters): Test awk special
characters, and put substitution input strings `@foo@' in the
output, to test that no recursion happens; test several other
combinations from Paolo Bonzini.
2006-11-27 01:53:10 +08:00
|
|
|
)
|
|
|
|
)
|
2006-12-05 14:00:42 +08:00
|
|
|
done
|
2005-02-05 15:34:54 +08:00
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
## ------------------------------ ##
|
|
|
|
## Define to a 2000-byte string. ##
|
|
|
|
## ------------------------------ ##
|
|
|
|
|
|
|
|
AT_SETUP([Define to a 2000-byte string])
|
|
|
|
|
|
|
|
AT_CONFIGURE_AC(
|
|
|
|
[[
|
|
|
|
AC_DEFINE([foo], ]m4_for([n], 1, 100,, ....................)[, [desc])
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_AUTOHEADER
|
|
|
|
AT_CHECK_CONFIGURE
|
|
|
|
AT_CHECK_DEFINES([@%:@define foo m4_for([n], 1, 100,, ....................)
|
|
|
|
])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
## ------------------------------------------ ##
|
|
|
|
## Substitute and define special characters. ##
|
|
|
|
## ------------------------------------------ ##
|
|
|
|
|
Rewrite config files generation: avoid quadratic growth in
the number of substituted variables by using awk instead of sed
for the bulk of the substitutions.
* NEWS: Mention this.
* doc/autoconf.texi (Setting Output Variables): `|#_!!_#|' is also
forbidden in the output (and thus input) file.
* lib/autoconf/status.m4 (_AC_AWK_LITERAL_LIMIT): New macro.
(_AC_OUTPUT_FILES_PREPARE): Instead of several sed scripts,
generate just one large awk script for substitutions,
eliminating much of the earlier complexity, while adding some
new complexity. Only expand the substitution templates at
configure time, for smaller configure script size. If
_AC_SUBST_FILES are used, test 'awk' for working getline support
at config.status time. If absent, interpolate through the
shell. The awk script was written with much help
from Paolo Bonzini and Paul Eggert.
(_AC_SED_CMD_NUM, _AC_SED_DELIM_NUM, _AC_SED_FRAG): Removed.
(_AC_SED_FRAG_NUM): Likewise.
(_AC_SUBST_CMDS): Renamed from...
(_AC_SED_CMDS): ...this.
(_AC_OUTPUT_FILE): Use _AC_SUBST_CMDS.
* tests/torture.at (Substitute a 2000-byte string): Also
substitute a line with 1000 words, and a variable with several
long lines.
(Substitute and define special characters): Test awk special
characters, and put substitution input strings `@foo@' in the
output, to test that no recursion happens; test several other
combinations from Paolo Bonzini.
2006-11-27 01:53:10 +08:00
|
|
|
# Use characters special to the shell, sed, awk, and M4.
|
2005-02-05 15:34:54 +08:00
|
|
|
|
|
|
|
AT_SETUP([Substitute and define special characters])
|
|
|
|
|
|
|
|
AT_DATA([Foo.in], [@foo@
|
Rewrite config files generation: avoid quadratic growth in
the number of substituted variables by using awk instead of sed
for the bulk of the substitutions.
* NEWS: Mention this.
* doc/autoconf.texi (Setting Output Variables): `|#_!!_#|' is also
forbidden in the output (and thus input) file.
* lib/autoconf/status.m4 (_AC_AWK_LITERAL_LIMIT): New macro.
(_AC_OUTPUT_FILES_PREPARE): Instead of several sed scripts,
generate just one large awk script for substitutions,
eliminating much of the earlier complexity, while adding some
new complexity. Only expand the substitution templates at
configure time, for smaller configure script size. If
_AC_SUBST_FILES are used, test 'awk' for working getline support
at config.status time. If absent, interpolate through the
shell. The awk script was written with much help
from Paolo Bonzini and Paul Eggert.
(_AC_SED_CMD_NUM, _AC_SED_DELIM_NUM, _AC_SED_FRAG): Removed.
(_AC_SED_FRAG_NUM): Likewise.
(_AC_SUBST_CMDS): Renamed from...
(_AC_SED_CMDS): ...this.
(_AC_OUTPUT_FILE): Use _AC_SUBST_CMDS.
* tests/torture.at (Substitute a 2000-byte string): Also
substitute a line with 1000 words, and a variable with several
long lines.
(Substitute and define special characters): Test awk special
characters, and put substitution input strings `@foo@' in the
output, to test that no recursion happens; test several other
combinations from Paolo Bonzini.
2006-11-27 01:53:10 +08:00
|
|
|
@bar@@notsubsted@@baz@ stray @ and more@@@baz@
|
|
|
|
abc@bar@baz@baz
|
|
|
|
abc@bar@@baz@baz
|
|
|
|
abc@bar@@baz@baz@
|
|
|
|
abc@bar @baz@baz
|
|
|
|
abc@bar @baz@baz@
|
|
|
|
abc@bar @baz@@baz@
|
|
|
|
@file@
|
|
|
|
@file@
|
|
|
|
X@file@
|
|
|
|
@file@X
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_DATA([File],
|
|
|
|
[@foo@@bar@
|
2005-02-05 15:34:54 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
AT_CONFIGURE_AC(
|
2006-11-28 02:59:43 +08:00
|
|
|
[[foo="AS@&t@_ESCAPE([[X*'[]+ ",& &`\($foo \& \\& \\\& \\\\& \ \\ \\\ !]])"
|
Rewrite config files generation: avoid quadratic growth in
the number of substituted variables by using awk instead of sed
for the bulk of the substitutions.
* NEWS: Mention this.
* doc/autoconf.texi (Setting Output Variables): `|#_!!_#|' is also
forbidden in the output (and thus input) file.
* lib/autoconf/status.m4 (_AC_AWK_LITERAL_LIMIT): New macro.
(_AC_OUTPUT_FILES_PREPARE): Instead of several sed scripts,
generate just one large awk script for substitutions,
eliminating much of the earlier complexity, while adding some
new complexity. Only expand the substitution templates at
configure time, for smaller configure script size. If
_AC_SUBST_FILES are used, test 'awk' for working getline support
at config.status time. If absent, interpolate through the
shell. The awk script was written with much help
from Paolo Bonzini and Paul Eggert.
(_AC_SED_CMD_NUM, _AC_SED_DELIM_NUM, _AC_SED_FRAG): Removed.
(_AC_SED_FRAG_NUM): Likewise.
(_AC_SUBST_CMDS): Renamed from...
(_AC_SED_CMDS): ...this.
(_AC_OUTPUT_FILE): Use _AC_SUBST_CMDS.
* tests/torture.at (Substitute a 2000-byte string): Also
substitute a line with 1000 words, and a variable with several
long lines.
(Substitute and define special characters): Test awk special
characters, and put substitution input strings `@foo@' in the
output, to test that no recursion happens; test several other
combinations from Paolo Bonzini.
2006-11-27 01:53:10 +08:00
|
|
|
bar="@foo@ @baz@"
|
|
|
|
baz=bla
|
2005-02-05 15:34:54 +08:00
|
|
|
AC_SUBST([foo])
|
Rewrite config files generation: avoid quadratic growth in
the number of substituted variables by using awk instead of sed
for the bulk of the substitutions.
* NEWS: Mention this.
* doc/autoconf.texi (Setting Output Variables): `|#_!!_#|' is also
forbidden in the output (and thus input) file.
* lib/autoconf/status.m4 (_AC_AWK_LITERAL_LIMIT): New macro.
(_AC_OUTPUT_FILES_PREPARE): Instead of several sed scripts,
generate just one large awk script for substitutions,
eliminating much of the earlier complexity, while adding some
new complexity. Only expand the substitution templates at
configure time, for smaller configure script size. If
_AC_SUBST_FILES are used, test 'awk' for working getline support
at config.status time. If absent, interpolate through the
shell. The awk script was written with much help
from Paolo Bonzini and Paul Eggert.
(_AC_SED_CMD_NUM, _AC_SED_DELIM_NUM, _AC_SED_FRAG): Removed.
(_AC_SED_FRAG_NUM): Likewise.
(_AC_SUBST_CMDS): Renamed from...
(_AC_SED_CMDS): ...this.
(_AC_OUTPUT_FILE): Use _AC_SUBST_CMDS.
* tests/torture.at (Substitute a 2000-byte string): Also
substitute a line with 1000 words, and a variable with several
long lines.
(Substitute and define special characters): Test awk special
characters, and put substitution input strings `@foo@' in the
output, to test that no recursion happens; test several other
combinations from Paolo Bonzini.
2006-11-27 01:53:10 +08:00
|
|
|
AC_SUBST([bar])
|
|
|
|
AC_SUBST([baz])
|
|
|
|
file=File
|
|
|
|
AC_SUBST_FILE([file])
|
2006-11-28 02:59:43 +08:00
|
|
|
AC_DEFINE([foo], [[X*'[]+ ",& &`\($foo !]], [Awful value.])
|
2006-12-06 02:57:06 +08:00
|
|
|
AC_PROG_AWK
|
2005-02-05 15:34:54 +08:00
|
|
|
AC_CONFIG_FILES([Foo])]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_AUTOHEADER
|
2006-12-05 14:00:42 +08:00
|
|
|
# Check both awk and the result of AC_PROG_AWK
|
|
|
|
for awk_arg in FOO= AWK=awk; do
|
|
|
|
AT_CHECK_CONFIGURE([$awk_arg])
|
|
|
|
AT_CHECK([cat Foo], 0, [[X*'[]+ ",& &`\($foo \& \\& \\\& \\\\& \ \\ \\\ !
|
Rewrite config files generation: avoid quadratic growth in
the number of substituted variables by using awk instead of sed
for the bulk of the substitutions.
* NEWS: Mention this.
* doc/autoconf.texi (Setting Output Variables): `|#_!!_#|' is also
forbidden in the output (and thus input) file.
* lib/autoconf/status.m4 (_AC_AWK_LITERAL_LIMIT): New macro.
(_AC_OUTPUT_FILES_PREPARE): Instead of several sed scripts,
generate just one large awk script for substitutions,
eliminating much of the earlier complexity, while adding some
new complexity. Only expand the substitution templates at
configure time, for smaller configure script size. If
_AC_SUBST_FILES are used, test 'awk' for working getline support
at config.status time. If absent, interpolate through the
shell. The awk script was written with much help
from Paolo Bonzini and Paul Eggert.
(_AC_SED_CMD_NUM, _AC_SED_DELIM_NUM, _AC_SED_FRAG): Removed.
(_AC_SED_FRAG_NUM): Likewise.
(_AC_SUBST_CMDS): Renamed from...
(_AC_SED_CMDS): ...this.
(_AC_OUTPUT_FILE): Use _AC_SUBST_CMDS.
* tests/torture.at (Substitute a 2000-byte string): Also
substitute a line with 1000 words, and a variable with several
long lines.
(Substitute and define special characters): Test awk special
characters, and put substitution input strings `@foo@' in the
output, to test that no recursion happens; test several other
combinations from Paolo Bonzini.
2006-11-27 01:53:10 +08:00
|
|
|
@foo@ @baz@@notsubsted@bla stray @ and more@@bla
|
|
|
|
abc@foo@ @baz@baz@baz
|
|
|
|
abc@foo@ @baz@blabaz
|
|
|
|
abc@foo@ @baz@blabaz@
|
|
|
|
abc@bar blabaz
|
|
|
|
abc@bar blabaz@
|
|
|
|
abc@bar blabla
|
|
|
|
@foo@@bar@
|
|
|
|
@foo@@bar@
|
|
|
|
X@file@
|
|
|
|
@file@X
|
2005-02-05 15:34:54 +08:00
|
|
|
]])
|
2006-12-05 14:00:42 +08:00
|
|
|
AT_CHECK_DEFINES([[#define foo X*'[]+ ",& &`\($foo !
|
2005-02-05 15:34:54 +08:00
|
|
|
]])
|
2006-12-05 14:00:42 +08:00
|
|
|
done
|
2005-02-05 15:34:54 +08:00
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
## ---------------------- ##
|
|
|
|
## Substitute a newline. ##
|
|
|
|
## ---------------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([Substitute a newline])
|
|
|
|
|
|
|
|
AT_DATA([Foo.in],
|
|
|
|
[@foo@
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
Rework to use more-modern build style.
Many files are renamed; all uses of their names were changed.
* .x-sc_trailing_blank: Renamed from .x-sc_trailing_blank.
* .x-sc_useless_cpp_parens: New file.
* build-aux/config.guess: Renamed from config/config.guess. Update.
* build-aux/config.sub: Renamed from config/config.sub. Update.
* build-aux/elisp-comp: Renamed from config/elisp-comp.
* build-aux/install-sh: Renamed from config/install-sh. Update.
* build-aux/mdate-sh: Renamed from config/mdate-sh.
* build-aux/missing: Renamed from config/missing.
* build-aux/texinfo.tex: Renamed from config/texinfo.tex. Update.
* build-aux/vc-list-files: Renamed from config/vc-list-files.
* config/Makefile.am: Removed.
* config/mkinstalldirs: Removed.
* config/move-if-change: Removed.
* m4/m4.m4: Renamed from config/m4.m4. Add (C) to copyright notice.
* Makefile.am (SUBDIRS): Remove config.
(ACLOCAL_AMFLAGS): Include from m4, not config.
(EXTRA_DIST): Add config/announce-gen, config/prev-version.txt.
(WGET, WGETFLAGS): New macros, since Makefile.maint no longer does this.
(autom4te-update): Rewrite with a loop. Get from gnulib, not automake.
Fail if there's an error.
* Makefile.cfg (move_if_change): Remove.
(wget_files): Remove.
(cvs_executable_files): New macro.
(cvs_files): Use it. Remove mkinstalldirs. Add fdl.texi.
(executable-update): Use $(cvs_executable_files).
(local-checks-to-skip): Remove.
* Makefile.maint: Merge from coreutils, plus add our own changes
(gzip_rsyncable): New macro.
(GZIP_ENV): Use it.
(CVS_LIST): Use build-aux/vc-list-files.
(VERSION_REGEXP): New macro.
(local-checks-available): Add patch-check, $(syntax-check-rules),
check-AUTHORS.
(syntax-check-rules): Compute dynamically.
(sc_cast_of_x_alloc_return_value): Work even if no source files.
(sc_cast_of_alloca_return_value): Likewise.
(sc_prohibit_atoi_atof): Simplify regexp.
(sc_no_if_have_config_h, sc_require_config_h):
(sc_prohibit_assert_without_use,
(sc_obsolete_symbols): Check for O_NDELAY.
(sc_texi_notab): Remove.
(sc-changelog): Don't make an exception for '----' lines.
(.re-list): Remove, so we don't have a junk file behind.
(sc_system_h_headers): Remove the need for .re-list.
(sc_the_the): New rule.
(sc_tight_scope): Simplify.
(sc_trailing_space): Renamed from sc_trailing_blank.
(longopt_re): New macro.
(sc_two_space_separator_in_usage): New rule.
(sc_unmarked_diagnostics): Look at all files under CVS.
(sc_useless_cpp_parens, patch-check, check-AUTHORS): New rules.
(news-date-check, changelog-check): Version is OK.
(po-check): Look for lib files even if not in CVS.
(copyright-check): Use $() not ``.
(maintainer-distcheck): Do not depend on changelog-check.
(my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
Also check for -Wpointer-arith.
(WGET, WGETFLAGS, tgz-md5, tgz-sha1, bz2-md5, bz2-sha1):
(xdelta-md5, xdelta-sha1, tgz-size, bz2-size, xd-size, rel-check):
Remove.
(announcement): Add --gpg-key-id arg.
(cvs-sv): Remove.
(move_if_change): Just use mv.
(local_updates: Remove wget-update, po-update.
(po_repo, do-po-update, po-update, wget_files, get-targets): Remove.
(config.guess-url_prefix, config.sub-url_prefix): Remove.
(ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
(standards.texi-url_prefix, make-stds.texi-url_prefix, target, url):
($(get-targets)): Remove.
(cvs_files): Remove missing, mkinstalldirs, ansi2knr.c.
(gnulib_repo): Renamed from automake_repo. Get from gnulib now.
(cvs-update): Get from gnulib.
(emut_upload_commands): gnupload is in build-aux now.
(alpha beta major): Add changelog-check. Check version.
* configure.ac (AC_CONFIG_AUX_DIR): Renamed from config to build-aux.
(AC_CONFIG_FILES): Remove.
* bin/autoconf.as: Add spaces to avoid distcheck warning.
* config/announce-gen: Sync from coreutils.
* doc/make-stds.texi: Sync from gnulib.
* doc/standards.texi: Likewise.
* man/Makefile.am: Adjust for config -> build-aux renaming.
* tests/Makefile.am: Prefer $(FOO) to @FOO@.
* tests/local.at: Adjust from config -> build-aux renaming.
* tests/tools.at: Likewise.
* tests/torture.at: Likewise.
2006-08-25 06:56:47 +08:00
|
|
|
AC_CONFIG_AUX_DIR($top_srcdir/build-aux)
|
2005-02-05 15:34:54 +08:00
|
|
|
foo='one
|
|
|
|
two'
|
|
|
|
AC_SUBST([foo])
|
|
|
|
AC_CONFIG_FILES([Foo])
|
2006-12-06 02:57:06 +08:00
|
|
|
AC_PROG_AWK
|
2005-02-05 15:34:54 +08:00
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
2006-12-05 14:00:42 +08:00
|
|
|
# Check both awk and the result of AC_PROG_AWK
|
|
|
|
for awk_arg in FOO= AWK=awk; do
|
|
|
|
AT_CHECK_CONFIGURE([$awk_arg])
|
|
|
|
AT_CHECK([cat Foo], 0, [one
|
2005-02-05 15:34:54 +08:00
|
|
|
two
|
|
|
|
])
|
2006-12-05 14:00:42 +08:00
|
|
|
done
|
2005-02-05 15:34:54 +08:00
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
## ------------------ ##
|
|
|
|
## Define a newline. ##
|
|
|
|
## ------------------ ##
|
|
|
|
|
|
|
|
AT_SETUP([Define a newline])
|
|
|
|
AT_XFAIL_IF(:)
|
|
|
|
AT_CONFIGURE_AC([[AC_DEFINE([foo], [one
|
|
|
|
two], [This spans two lines.])
|
|
|
|
]])
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_AUTOHEADER
|
|
|
|
AT_CHECK_CONFIGURE
|
|
|
|
AT_CHECK_DEFINES([[#define foo one
|
|
|
|
two
|
|
|
|
]])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
2006-04-13 04:40:21 +08:00
|
|
|
## ------------------------ ##
|
|
|
|
## datarootdir workaround. ##
|
|
|
|
## ------------------------ ##
|
|
|
|
|
|
|
|
AT_SETUP([datarootdir workaround])
|
|
|
|
|
|
|
|
AT_DATA([Foo.in],
|
|
|
|
[@datadir@
|
|
|
|
@docdir@
|
|
|
|
@infodir@
|
|
|
|
@localedir@
|
|
|
|
@mandir@
|
|
|
|
])
|
|
|
|
|
2006-05-28 20:38:49 +08:00
|
|
|
AT_DATA([Bar.in],
|
|
|
|
[@mydatadir@
|
|
|
|
])
|
|
|
|
|
2006-04-13 04:40:21 +08:00
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
2006-06-23 22:56:30 +08:00
|
|
|
d@&t@nl The following line silences the warnings, if uncommented:
|
|
|
|
d@&t@nl AC_DEFUN([AC_DATAROOTDIR_CHECKED])
|
Rework to use more-modern build style.
Many files are renamed; all uses of their names were changed.
* .x-sc_trailing_blank: Renamed from .x-sc_trailing_blank.
* .x-sc_useless_cpp_parens: New file.
* build-aux/config.guess: Renamed from config/config.guess. Update.
* build-aux/config.sub: Renamed from config/config.sub. Update.
* build-aux/elisp-comp: Renamed from config/elisp-comp.
* build-aux/install-sh: Renamed from config/install-sh. Update.
* build-aux/mdate-sh: Renamed from config/mdate-sh.
* build-aux/missing: Renamed from config/missing.
* build-aux/texinfo.tex: Renamed from config/texinfo.tex. Update.
* build-aux/vc-list-files: Renamed from config/vc-list-files.
* config/Makefile.am: Removed.
* config/mkinstalldirs: Removed.
* config/move-if-change: Removed.
* m4/m4.m4: Renamed from config/m4.m4. Add (C) to copyright notice.
* Makefile.am (SUBDIRS): Remove config.
(ACLOCAL_AMFLAGS): Include from m4, not config.
(EXTRA_DIST): Add config/announce-gen, config/prev-version.txt.
(WGET, WGETFLAGS): New macros, since Makefile.maint no longer does this.
(autom4te-update): Rewrite with a loop. Get from gnulib, not automake.
Fail if there's an error.
* Makefile.cfg (move_if_change): Remove.
(wget_files): Remove.
(cvs_executable_files): New macro.
(cvs_files): Use it. Remove mkinstalldirs. Add fdl.texi.
(executable-update): Use $(cvs_executable_files).
(local-checks-to-skip): Remove.
* Makefile.maint: Merge from coreutils, plus add our own changes
(gzip_rsyncable): New macro.
(GZIP_ENV): Use it.
(CVS_LIST): Use build-aux/vc-list-files.
(VERSION_REGEXP): New macro.
(local-checks-available): Add patch-check, $(syntax-check-rules),
check-AUTHORS.
(syntax-check-rules): Compute dynamically.
(sc_cast_of_x_alloc_return_value): Work even if no source files.
(sc_cast_of_alloca_return_value): Likewise.
(sc_prohibit_atoi_atof): Simplify regexp.
(sc_no_if_have_config_h, sc_require_config_h):
(sc_prohibit_assert_without_use,
(sc_obsolete_symbols): Check for O_NDELAY.
(sc_texi_notab): Remove.
(sc-changelog): Don't make an exception for '----' lines.
(.re-list): Remove, so we don't have a junk file behind.
(sc_system_h_headers): Remove the need for .re-list.
(sc_the_the): New rule.
(sc_tight_scope): Simplify.
(sc_trailing_space): Renamed from sc_trailing_blank.
(longopt_re): New macro.
(sc_two_space_separator_in_usage): New rule.
(sc_unmarked_diagnostics): Look at all files under CVS.
(sc_useless_cpp_parens, patch-check, check-AUTHORS): New rules.
(news-date-check, changelog-check): Version is OK.
(po-check): Look for lib files even if not in CVS.
(copyright-check): Use $() not ``.
(maintainer-distcheck): Do not depend on changelog-check.
(my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
Also check for -Wpointer-arith.
(WGET, WGETFLAGS, tgz-md5, tgz-sha1, bz2-md5, bz2-sha1):
(xdelta-md5, xdelta-sha1, tgz-size, bz2-size, xd-size, rel-check):
Remove.
(announcement): Add --gpg-key-id arg.
(cvs-sv): Remove.
(move_if_change): Just use mv.
(local_updates: Remove wget-update, po-update.
(po_repo, do-po-update, po-update, wget_files, get-targets): Remove.
(config.guess-url_prefix, config.sub-url_prefix): Remove.
(ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
(standards.texi-url_prefix, make-stds.texi-url_prefix, target, url):
($(get-targets)): Remove.
(cvs_files): Remove missing, mkinstalldirs, ansi2knr.c.
(gnulib_repo): Renamed from automake_repo. Get from gnulib now.
(cvs-update): Get from gnulib.
(emut_upload_commands): gnupload is in build-aux now.
(alpha beta major): Add changelog-check. Check version.
* configure.ac (AC_CONFIG_AUX_DIR): Renamed from config to build-aux.
(AC_CONFIG_FILES): Remove.
* bin/autoconf.as: Add spaces to avoid distcheck warning.
* config/announce-gen: Sync from coreutils.
* doc/make-stds.texi: Sync from gnulib.
* doc/standards.texi: Likewise.
* man/Makefile.am: Adjust for config -> build-aux renaming.
* tests/Makefile.am: Prefer $(FOO) to @FOO@.
* tests/local.at: Adjust from config -> build-aux renaming.
* tests/tools.at: Likewise.
* tests/torture.at: Likewise.
2006-08-25 06:56:47 +08:00
|
|
|
AC_CONFIG_AUX_DIR($top_srcdir/build-aux)
|
2006-05-28 20:38:49 +08:00
|
|
|
|
|
|
|
# This substitution is wrong and bogus! Don't use it in your own code!
|
|
|
|
# Read `info Autoconf "Defining Directories"'!
|
|
|
|
AC_SUBST([mydatadir], [${datadir}/my])
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([Foo Bar])
|
2006-04-13 04:40:21 +08:00
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE([], [], [],
|
|
|
|
[config.status: WARNING: Foo.in seems to ignore the --datarootdir setting
|
2006-05-28 20:38:49 +08:00
|
|
|
config.status: WARNING: Bar contains a reference to the variable `datarootdir'
|
|
|
|
which seems to be undefined. Please make sure it is defined.
|
2006-04-13 04:40:21 +08:00
|
|
|
])
|
|
|
|
AT_CHECK([grep datarootdir Foo], 1, [])
|
2006-06-23 22:56:30 +08:00
|
|
|
|
|
|
|
rm configure
|
|
|
|
sed '/AC_DEFUN/s/^d@&t@nl //' configure.ac >t
|
|
|
|
mv t configure.ac
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE
|
|
|
|
|
2006-04-13 04:40:21 +08:00
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
2001-01-24 21:19:10 +08:00
|
|
|
## -------- ##
|
|
|
|
## srcdir. ##
|
|
|
|
## -------- ##
|
|
|
|
|
|
|
|
AT_SETUP([srcdir])
|
|
|
|
|
2004-01-05 15:05:22 +08:00
|
|
|
rm -f -r at-dir
|
2001-01-24 21:19:10 +08:00
|
|
|
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])],
|
* 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
|
|
|
[srcdir=$srcdir])
|
2001-01-24 21:19:10 +08:00
|
|
|
|
|
|
|
AC_OUTPUT
|
2004-01-05 15:05:22 +08:00
|
|
|
rm -f -r foo at-dir/bar
|
2001-01-24 21:19:10 +08:00
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
|
|
|
|
# In place.
|
|
|
|
AT_CHECK([./configure], [], [ignore])
|
|
|
|
|
2004-08-21 03:58:06 +08:00
|
|
|
# Relative name.
|
2001-01-24 21:19:10 +08:00
|
|
|
AT_CHECK([cd at-dir && ../configure], [], [ignore])
|
|
|
|
|
2004-08-21 03:58:06 +08:00
|
|
|
# Absolute name.
|
2001-01-24 21:19:10 +08:00
|
|
|
at_here=`pwd`
|
2005-03-23 09:01:58 +08:00
|
|
|
AT_CHECK([cd at-dir && "$at_here/configure"], [], [ignore])
|
2001-01-24 21:19:10 +08:00
|
|
|
|
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
|
|
|
|
|
|
|
|
2005-01-03 01:15:40 +08:00
|
|
|
|
|
|
|
AT_BANNER([autoreconf.])
|
|
|
|
|
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.
|
2006-10-28 17:41:07 +08:00
|
|
|
AT_CHECK([[grep '[^0-9]1.[01234][^0-9]' stdout && exit 77]], [1], [ignore])
|
2002-02-06 17:39:54 +08:00
|
|
|
|
2006-07-08 01:56:16 +08:00
|
|
|
# Set CONFIG_SITE to a nonexistent file, so that there are
|
|
|
|
# no worries about nonstandard values for 'prefix'.
|
|
|
|
CONFIG_SITE=no-such-file
|
|
|
|
export CONFIG_SITE
|
|
|
|
|
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
|
|
|
|
2003-09-25 17:30:34 +08:00
|
|
|
# If there are improperly quoted AC_DEFUN installed in share/aclocal,
|
|
|
|
# they trigger warnings from aclocal 1.8, so ignore stderr.
|
|
|
|
AT_CHECK([autoreconf], [], [], [ignore])
|
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.
|
2006-07-08 01:56:16 +08:00
|
|
|
AT_CHECK([./configure --help=recursive | grep INNER], 0, [ignore])
|
2001-08-20 22:46:02 +08:00
|
|
|
|
|
|
|
# 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])
|
2006-07-08 01:56:16 +08:00
|
|
|
AT_CHECK([cd builddir && ../configure], 0, [ignore])
|
2001-08-20 22:46:02 +08:00
|
|
|
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
|
2006-07-08 01:56:16 +08:00
|
|
|
# passed, even when there are duplicates.
|
|
|
|
AT_CHECK([cd builddir && ../configure --prefix /bad --prefix /good INNER=bad INNER=good], 0, [ignore])
|
|
|
|
AT_CHECK([cat builddir/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
|
|
|
|
2006-09-13 12:48:23 +08:00
|
|
|
# Make sure --prefix is properly quoted
|
|
|
|
AT_CHECK([cd builddir && ../configure --prefix "/a b c$ 'd"], 0, [ignore])
|
|
|
|
AT_CHECK([cat builddir/inner/innermost/config], 0,
|
|
|
|
[INNER=inner
|
|
|
|
srcdir=../../../inner/innermost
|
|
|
|
top_srcdir=../../../inner
|
|
|
|
prefix=/a b c$ 'd
|
|
|
|
])
|
|
|
|
|
|
|
|
# Make sure --silent is properly passed...
|
|
|
|
AT_CHECK([cd builddir && ../configure --silent], 0, [])
|
|
|
|
# ...but not stored in config.status.
|
|
|
|
AT_CHECK([cd builddir && ./config.status --recheck], 0, [stdout])
|
|
|
|
AT_CHECK([grep 'creating \./config.status' stdout], 0, [ignore])
|
|
|
|
|
2006-05-17 10:20:15 +08:00
|
|
|
# Make sure we can run autoreconf on a subdirectory
|
|
|
|
rm -f configure configure.in
|
|
|
|
AT_CHECK([autoreconf inner], [], [], [ignore])
|
|
|
|
|
|
|
|
# Make sure we can pass a configure.ac name
|
|
|
|
AT_CHECK([cd inner && autoreconf configure.in], [], [], [ignore])
|
|
|
|
AT_CHECK([autoreconf inner/configure.in], [], [], [ignore])
|
|
|
|
|
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])
|
|
|
|
|
2004-08-10 07:13:50 +08:00
|
|
|
AT_DATA([inner/configure.in],
|
2002-10-29 16:09:40 +08:00
|
|
|
[[AC_INIT(GNU Inner, 1.0)
|
|
|
|
AC_ARG_VAR([INNER], [an inner variable])
|
|
|
|
AC_CONFIG_SUBDIRS(innermost)
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
2004-08-10 07:13:50 +08:00
|
|
|
AT_DATA([inner/innermost/configure.in],
|
2002-10-29 16:09:40 +08:00
|
|
|
[[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
|
2005-01-03 01:15:40 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## -------------------------------- ##
|
|
|
|
## Non-Autoconf AC_CONFIG_SUBDIRS. ##
|
|
|
|
## -------------------------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([Non-Autoconf AC_CONFIG_SUBDIRS])
|
|
|
|
AT_KEYWORDS([autoreconf])
|
|
|
|
|
|
|
|
# We use aclocal (via autoreconf).
|
|
|
|
AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
|
|
|
|
|
|
|
|
AT_DATA([install-sh], [])
|
|
|
|
AT_DATA([configure.in],
|
|
|
|
[[AC_INIT(GNU Outer, 1.0)
|
|
|
|
AC_CONFIG_SUBDIRS([inner])
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
AS_MKDIR_P([inner])
|
|
|
|
|
|
|
|
AT_DATA([inner/configure],
|
|
|
|
[[#! /bin/sh
|
|
|
|
case "$*" in
|
|
|
|
*--help*) echo 'No Autoconf here, folks!' ;;
|
|
|
|
*) echo got_it >myfile ;;
|
|
|
|
esac
|
|
|
|
exit 0
|
|
|
|
]])
|
|
|
|
chmod +x inner/configure
|
|
|
|
|
|
|
|
AT_CHECK([autoreconf -Wall -v], 0, [ignore], [ignore])
|
|
|
|
|
|
|
|
# Running the outer configure recursively should provide the innermost
|
|
|
|
# help strings.
|
|
|
|
AT_CHECK([./configure --help=recursive | grep "folks"], 0, [ignore])
|
|
|
|
|
|
|
|
# Running the outer configure should trigger the inner.
|
|
|
|
AT_CHECK([./configure], 0, [ignore])
|
|
|
|
AT_CHECK([test -f inner/myfile], 0)
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## ----------------- ##
|
|
|
|
## Empty directory. ##
|
|
|
|
## ----------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([Empty directory])
|
|
|
|
AT_KEYWORDS([autoreconf])
|
|
|
|
|
|
|
|
# We use aclocal (via autoreconf).
|
|
|
|
AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
|
|
|
|
|
|
|
|
# The test group directory is not necessarily _empty_, but it does not contain
|
|
|
|
# files meaningful to `autoreconf'.
|
|
|
|
|
|
|
|
AT_CHECK([autoreconf -Wall -v], 1, [ignore], [ignore])
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## ------------------------------ ##
|
|
|
|
## Unusual Automake input files. ##
|
|
|
|
## ------------------------------ ##
|
|
|
|
|
|
|
|
# This parallels gnumake.test in Automake.
|
|
|
|
|
|
|
|
AT_SETUP([Unusual Automake input files])
|
|
|
|
AT_KEYWORDS([autoreconf])
|
|
|
|
|
|
|
|
# We use aclocal and automake via autoreconf.
|
|
|
|
AT_CHECK([automake --version || exit 77], [], [ignore], [ignore])
|
|
|
|
|
|
|
|
AT_DATA([configure.in],
|
|
|
|
[[AC_INIT(GNU foo, 1.0)
|
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
AC_CONFIG_FILES([HeeHee])
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([HeeHee.am],
|
|
|
|
[[# Humans do no worse than `GNUmakefile.am'.
|
2006-05-10 05:25:42 +08:00
|
|
|
AUTOMAKE_OPTIONS = foreign 1.8
|
2005-01-03 01:15:40 +08:00
|
|
|
]])
|
|
|
|
|
2006-05-10 05:25:42 +08:00
|
|
|
AT_CHECK([autoreconf -Wall -v -i], 0, [ignore], [stderr],
|
|
|
|
[AT_CHECK([grep 'require.*1\.8' stderr && exit 77], [1])])
|
2005-01-03 01:15:40 +08:00
|
|
|
AT_CHECK([test -f HeeHee.in])
|
|
|
|
|
|
|
|
AT_CLEANUP
|