Commit Graph

2504 Commits

Author SHA1 Message Date
Eric Blake
66b8003184 More corner cases in testsuite VAR=VALUE handling.
* lib/autotest/general.m4 (AT_INIT) <PREPARE_TESTS): Fix quoting
bug.
<PARSE_ARGS_END>: Also detect leading digits in assignments.
* tests/autotest.at (Using atlocal): Enhance test to catch last
bug.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-01-29 10:24:12 -07:00
Eric Blake
372769ca9e Fix regression in handling VAR=VALUE arguments to testsuite.
* lib/autotest/general.m4 (AT_INIT) <PARSE_ARGS_END>: Detect
leading = as invalid.  Defer use of command-line variable
assignments...
<PREPARE_TESTS>: ...here, after atconfig has been sourced.  Fix
regression in sourcing files.
* tests/autotest.at (Using atlocal): New test to catch this.
(Debugging a successful test, Choosing where testsuite is run):
Use correct shell.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-01-28 22:49:22 -07:00
Eric Blake
c6c22af0e7 Minor testsuite improvements.
* lib/autotest/general.m4 (AT_INIT) <PREPARE_TESTS>: Use fewer
forks when sanitizing PATH.  Always output machine information,
not just when atconfig was located.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-01-28 07:02:43 -07:00
Eric Blake
b91a600e7f Add 'testsuite -C dir'.
* lib/autotest/general.m4 (_AT_ARG_OPTION): Move missing argument
detection...
(AT_INIT) <PARSE_ARGS_END>: ...here, since -k always takes
argument.
<DEFAULTS>: Delay computation of variables based on $at_dir...
<PREPARE_TESTS>: ...to here, since -C can change $at_dir.
<TESTS>: Re-invoke via absolute name, since -C may be in effect.
<PARSE_ARGS>: Parse new option.
<HELP_TUNING>: Document it.
* tests/autotest.at (Choosing where testsuite is run): New test
for this feature.
(Keywords and ranges): Add test for missing -k argument.
* NEWS: Document this.
* doc/autoconf.texi (testsuite Invocation): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-01-28 06:57:46 -07:00
Ralf Wildenhues
0fd647c636 Fix --help=recursive with multiple AC_CONFIG_SUBDIRS.
* lib/autoconf/general.m4 (_AC_INIT_HELP): If, for recursive help
mode, we change to the source directory, also set $ac_pwd so we
do not go back to the build tree for the next config subdir.
* tests/torture.at (Deep Package): Extend test to contain two
config subdirs on the top level.
2008-01-22 21:48:51 +01:00
Ralf Wildenhues
7fa2f766b8 Accept `+' in --enable and --with feature strings.
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ENABLE2): Accept `+'
in feature string for --enable/--with.  Convert to underscore
for variable name.
2008-01-22 21:40:50 +01:00
Ralf Wildenhues
4380a86978 AC_PROG_INSTALL: require installation of multiple files.
* lib/autoconf/programs.m4 (AC_PROG_INSTALL): Require that
`install -c file1 file2 dir' works.
* doc/autoconf.texi (Particular Programs): Document this.
* NEWS: Update.
2008-01-22 07:00:44 +01:00
Eric Blake
f4d0beaefa * lib/m4sugar/m4sugar.m4 (m4_qlen): Use fewer macros.
Signed-off-by: Eric Blake <ebb9@byu.net>
2008-01-15 08:49:08 -07:00
Ralf Wildenhues
4c2c793ed5 Fix some write failure cases in Autotest.
* lib/autotest/general.m4 (AT_INIT): Do not exit successfully
upon write failures for --help, --version, --list.
Guard against write failures for intermediate created scripts.
<at_func_create_debugging_script>: Do not make the debugging
script executable if it is not complete.
2007-12-16 22:24:14 +01:00
Eric Blake
af2f1f262c Fix thinko in earlier patch - m4_join isn't defined yet.
* lib/m4sugar/m4sugar.m4 (m4_expansion_stack_push, _m4_defun_pro)
(_m4_defun_pro_outer, _m4_defun_epi, _m4_defun_epi_outer)
(m4_require): Use m4_do, not m4_join.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-12-12 16:31:21 -07:00
Eric Blake
18e4a9e117 Optimize AC_REQUIRE.
* lib/m4sugar/m4sugar.m4 (m4_expansion_stack_push, _m4_defun_pro)
(_m4_defun_pro_outer, _m4_defun_epi, _m4_defun_epi_outer)
(m4_require): Avoid extra macro calls.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-12-12 14:18:25 -07:00
Ralf Wildenhues
ce429ecdc0 Proper config.status --file/--header and $srcdir escaping.
* lib/autoconf/status.m4 (_AC_OUTPUT_MAIN_LOOP): Quote special
characters in $ac_file_inputs.
(_AC_OUTPUT_FILE, _AC_OUTPUT_HEADER): eval $ac_file_inputs
accordingly.
* tests/torture.at (datarootdir workaround): Adjust.
(AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS): Extend test.
2007-12-08 11:50:48 +01:00
Ralf Wildenhues
064ce0b6be Fix Autotest for whitespace in pwd.
* lib/autotest/general.m4 (AT_INIT)
<at_func_create_debugging_script, Driver Loop>:
Quote $at_group_dir.
* tests/autotest.at (whitespace in absolute testdir): New test.
2007-12-08 11:49:15 +01:00
Ralf Wildenhues
7b092b1af3 * lib/autom4te.in: Quote @datadir@. 2007-12-08 11:48:10 +01:00
Ralf Wildenhues
449317f7ee Proper file name escaping in Autoconf programs and Perl modules.
This includes escaping of characters special to the shell
as well as special to Perl, e.g., leading `<' or `>'.
For example, when $file starts with `>', `open ">$file"'
wrongly tries to append to a different file.

* bin/autoconf.as: Fix quoting for autom4te options.
* lib/Autom4te/General.pm (shell_quote): New function, taken
from coreutils, written by Jim Meyering.
(mktmpdir): Use it.
* bin/autom4te.in (files_to_options, handle_m4): Use shell_quote
and open_quote.
* bin/autoreconf.in (parse_args): Likewise.
* bin/autoscan.in (main): Likewise.
* bin/autoupdate.in (main): Likewise.
* bin/autoheader.in: Likewise, fixing old insufficient escaping.
* bin/ifnames.in: Likewise, XFile usage fixes.
* tests/tools.at (autom4te and whitespace in file names): Extend
test.  Test twice, with special characters allowed on w32, and the
rest.  Test leading and trailing whitespace, for `open_quote'.
(autotools and whitespace in file names): New, analogous test.
Reported by Paul Eggert and Benoit Sigoure, additional suggestions
by Russ Allbery and Eric Blake.
2007-12-08 11:46:43 +01:00
Ralf Wildenhues
7fb34e3eec Sync from Automake.
* lib/Autom4te/Channels.pm, lib/Autom4te/Configure_ac.pm,
lib/Autom4te/Struct.pm, lib/Autom4te/XFile.pm: Likewise.
* lib/Autom4te/FileUtils.pm (open_quote): New function.
(update_file, contents): Use it.
2007-12-08 11:39:34 +01:00
Ralf Wildenhues
fefcc77fea Fix copyright years.
* Makefile.am, doc/install.texi, lib/autoconf/fortran.m4,
lib/autoconf/lang.m4, lib/freeze.mk: Likewise.
2007-12-04 22:30:33 +01:00
Paul Eggert
b524b0f996 Fix AC_C_BIGENDIAN bug caused by new awk method of substitution.
* lib/autoconf/c.m4 (AC_C_BIGENDIAN): Don't comment out the
#undef as this runs afoul of our new way of creating config.h.
Problem reported by Jim Meyering in
<http://lists.gnu.org/archive/html/autoconf-patches/2007-11/msg00164.html>.
2007-11-27 09:06:40 -08:00
Stepan Kasal
2fe86f6854 * lib/autotest/general.m4 (AT_INIT): Do not extract the
`#AT_STOP_...' line at the end of each test.
2007-11-24 00:35:16 +01:00
Ralf Wildenhues
ce4ff03763 Fix awk script optimization.
* lib/autotest/general.m4 (AT_INIT): For awk line number
extraction script, ensure `$at_group' has a defined value
even for the empty set, and properly quote its usage inside
the awk script.
2007-11-23 19:42:00 +01:00
Ralf Wildenhues
844f770885 * lib/autotest/general.m4 (AT_INIT): Exit awk script after
extracting the line numbers of the last needed test.
2007-11-22 08:09:03 +01:00
Ralf Wildenhues
33df9071f5 * lib/autotest/general.m4 (AT_INIT) <at_func_create_debugging_script>:
Fix quoting.
2007-11-20 22:11:47 +01:00
Ralf Wildenhues
4d8234a76c Fix IRIX testsuite debugging failures: $0 in functions.
* lib/autotest/general.m4 (AT_INIT) <at_func_create_debugging_script>:
Do not use $0 inside a function, as IRIX sh will set that to the
function name rather than the script invocation name.
2007-11-19 21:24:54 +01:00
Paolo Bonzini
22ced06229 * lib/autotest/general.m4 (at_func_test): Use cached line numbers
to extract test scripts.
(AT_INIT): Extract and cache test script line numbers.
2007-11-19 21:19:15 +01:00
Ralf Wildenhues
dad571f749 * lib/autotest/general.m4: Revert 2007-11-15 patch and
subsequent fixups; the awk -> here-document conversion trashes
performance too much with AIX sh.
2007-11-19 21:18:04 +01:00
Ralf Wildenhues
5ccf45a370 Diagnose and guard against write errors dealing with config.status.
The general idea is this: all write failures from `configure'
writing `config.status' are indicated by $ac_write_error, which
is only checked at the end.  This is safe because config.status
code is not executed before the file is complete.  Other write
failures, be they inside config.status, or in sub shell/awk
scripts spawned from configure or config.status, typically need
earlier checking, as their results are used right afterwards.
* lib/autoconf/status.m4 (AC_OUTPUT): Initialize `ac_write_fail'
before writing config.status, check afterwards.
(_AC_OUTPUT_FILES_PREPARE, _AC_OUTPUT_FILE)
(_AC_OUTPUT_HEADERS_PREPARE,_AC_OUTPUT_CONFIG_STATUS):
Set `ac_write_error' for write failures to config.status.  Barf
upon write failures to temporary files.
Adjust note about closing and reopening the here-document.
(_AC_OUTPUT_HEADER, _AC_OUTPUT_LINK, _AC_OUTPUT_COMMAND)
(_AC_OUTPUT_MAIN_LOOP): Likewise, adjust note about closing and
reopening the here-document.
* tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
Ensure `ac_write_error' does not escape into config.status.
Also, add a couple of code paths not yet exercised in the test
suite: a config file with input from stdin, and a config header
output to stdout.
Suggestion for catching write errors by Bruno Haible.
2007-11-18 14:03:06 +01:00
Ralf Wildenhues
90661f5cd9 Avoid error with Tru64 awk and testsuite lines with many words.
* lib/autotest/general.m4 (AT_INIT): In the awk script that
reads the testsuite, set the field separator to an unusual value,
in order to not run over the limit of 199 fields.  Tru64 4.0D awk
even splits the input if $i, i>0, was never accessed in the script.
2007-11-17 09:36:17 +01:00
Ralf Wildenhues
22000bf9f8 Diagnose write errors in config.status instantiations.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILE)
(_AC_OUTPUT_HEADER, _AC_OUTPUT_MAIN_LOOP): Bail out
on write errors.
* tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
Extend test to also check for some write error failures, using...
<AT_CHECK_CONFIG_CREATION_NOWRITE>: ...this new macro.
Report by Bruno Haible.
2007-11-16 07:51:10 +01:00
Ralf Wildenhues
c19717746b Indentation fixups.
* lib/autotest/general.m4 (AT_INIT) <at_func_log_failure>: Fix
indentation.
(_AT_CHECK): Use less indentation, to save space.
2007-11-16 07:48:55 +01:00
Ralf Wildenhues
94296894f0 Add witness macro for @top_build_prefix@ substitution.
* lib/autoconf/status.m4 (_AC_HAVE_TOP_BUILD_PREFIX): New macro.
(_AC_OUTPUT_FILE): Mention it here.
2007-11-15 22:30:15 +01:00
Ralf Wildenhues
8c29e96f9d * lib/autotest/general.m4 (at_func_test): Remove.
(AT_INIT): Pre-extract test groups into separate files.
(AT_CLEANUP): Source pre-extracted file instead of calling at_func_test.
Remove at-test-source files together with the $at_group_dir.
* tests/autotest.at (Long test source lines): New test.
2007-11-15 22:23:59 +01:00
Paul Eggert
675668479d * lib/autoconf/types.m4 (_AC_TYPE_LONG_LONG_SNIPPET): Make comment match
gnulib.
2007-11-14 15:42:59 -08:00
Ralf Wildenhues
f32d0d7753 * lib/autoconf/status.m4: Fix a couple of comment typos. 2007-11-14 21:57:37 +01:00
Ralf Wildenhues
5779945993 * lib/m4sugar/m4sh.m4 (AS_TMPDIR): Use $as_me, not $me. 2007-11-14 21:55:59 +01:00
Paul Eggert
9b0314cc93 Don't worry about preprocessor when testing long long.
See: http://lists.gnu.org/archive/html/bug-gnulib/2007-11/msg00075.html
* doc/autoconf.texi (Preprocessor Arithmetic): New section.
(AC_TYPE_LONG_LONG_INT, AC_TYPE_UNSIGNED_LONG_LONG_INT):
These no longer check for preprocessor flaws.
* lib/autoconf/types.m4 (_AC_TYPE_LONG_LONG_SNIPPET):
Do not check for preprocessor flows.
2007-11-13 00:16:19 -08:00
Jim Meyering
48520ed2f7 Adapt dependencies, now that a version change doesn't modify configure.ac
* GNUmakefile: Remove "make clean" kludge.
* lib/m4sugar/Makefile.am (version.m4): Depend on Makefile, not
configure.ac.
Don't redirect directly to target.
Use $@, not literal "version.m4".
2007-11-13 08:56:32 +01:00
Ralf Wildenhues
610817462b * doc/autoconf.texi (Making testsuite Scripts): Document
":;{" shorthand as in previous patch.

2007-11-12  Paul Eggert  <eggert@cs.ucla.edu>

* doc/autoconf.texi (Limitations of Builtins): Document problem
with { ... } a bit more clearly.  Suggest ":;{" as a shorthand
for the workaround.
* lib/m4sugar/Makefile.am (version.m4): Detect 'echo' failure.
Use ":;{" shorthand.
* tests/Makefile.am ($(srcdir)/package.m4): Likewise.
2007-11-12 23:30:58 -08:00
Ralf Wildenhues
fa8beeb3dc Avoid warnings about conftest.dSYM directories on Mac OS X Leopard.
* lib/autoconf/general.m4 (_AC_LINK_IFELSE, _AC_RUN_IFELSE):
Remove conftest.dSYM directory.
* lib/autoconf/fortran.m4 (_AC_PROG_FC_V_OUTPUT)
(_AC_LANG_PROGRAM_C_, _AC_FC_MAIN, __AC_FC_NAME_MANGLING):
Remove `conftest.*' recursively.
* lib/autoconf/lang.m4 (AC_LINK_IFELSE): Likewise.
* lib/autoconf/specific.m4 (_AC_SYS_LARGEFILE_MACRO_VALUE):
Likewise.
(_AC_COMPILER_OBJEXT_REJECT): Reject *.dSYM.
* THANKS: Update.
Report and analysis by Jeff Squyres and Peter O'Gorman.
2007-11-12 20:38:08 +01:00
Jim Meyering
20cb79c19f Remove two more generated files from version control.
* INSTALL: Remove generated file.
* lib/autoscan/autoscan.list: Remove generated file.
2007-11-11 09:22:43 +01:00
Ralf Wildenhues
feef9e7e7e New config files output variable `top_build_prefix'.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILE): Substitute
`top_build_prefix'.
* doc/autoconf.texi (Preset Output Variables): Document it.
* NEWS: Update.
Report by Bob Friesenhahn.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2007-11-09 07:51:19 +01:00
Ralf Wildenhues
83bd220b0c Avoid expr for arithmetic evaluation if the shell accepts $((...)).
* lib/autotest/general.m4 (AT_INIT) <at_func_arith>: New
function, to parametrize arithmetic with expr vs. the shell.
Use it where possible.
Suggestion by Benoit Sigoure.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2007-11-09 07:49:29 +01:00
Ralf Wildenhues
44fa054865 * lib/autoconf/functions.m4 (_AC_FUNC_MALLOC_IF): Fix comment typo. 2007-11-04 17:02:30 +01:00
Ralf Wildenhues
bf5fec7028 * lib/m4sugar/Makefile.am (version.m4): Another bash bug workaround. 2007-11-04 17:00:57 +01:00
Eric Blake
dd3c3f2e27 Adjust version comparison to account for git snapshot numbers.
* lib/m4sugar/m4sugar.m4 (_m4_version_unletter): Also treat - as a
component separator.
* doc/autoconf.texi (Number processing Macros)
<m4_version_compare>: Document this change.
* tests/m4sugar.at (m4@&t@_version_compare): Test it.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-11-03 07:20:47 -06:00
Bruno Haible
dc51583646 * lib/autoconf/types.m4 (_AC_TYPE_LONG_LONG_SNIPPET): New macro,
extracted from AC_TYPE_LONG_LONG_INT and AC_TYPE_UNSIGNED_LONG_LONG_INT.
(AC_TYPE_LONG_LONG_INT, AC_TYPE_UNSIGNED_LONG_LONG_INT): Use it.
Fixes problem with Sun C 5.[0-8] in 32-bit mode, reported in
<http://lists.gnu.org/archive/html/autoconf-patches/2007-10/msg00210.html>
Suggested by Paul Eggert.
2007-10-30 19:09:54 -07:00
Jim Meyering
7ffc555888 Remove all generated files from version control.
* aclocal.m4: Remove.
* configure: Remove.
* Makefile.in: Remove, along with all other Makefile.in in subdirs.
* .gitignore: Add aclocal.m4, configure and Makefile.in.  Sort.
* README-hacking: New file: how to build from just-checked-out sources.
2007-10-27 12:44:59 +02:00
Eric Blake
17b1f091f4 Improve corner case of m4_expand.
* lib/m4sugar/m4sugar.m4 (m4_expand, _m4_expand): Rewrite more
efficiently.
* tests/m4sh.at (AS@&t@_HELP_STRING): Test overquoted comma.
* doc/autoconf.texi (Evaluation Macros) <m4_expand>: Update
documentation.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-23 21:04:12 -06:00
Paul Eggert
8186482d97 * lib/autoconf/c.m4 (AC_C_RESTRICT): Work around Sun C++ compatibility
problem reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-autoconf/2007-10/msg00027.html>.
2007-10-22 14:29:02 -07:00
Paul Eggert
592eacfdc2 Don't check for bug in HP-UX 11.00 cpp.
* lib/autoconf/types.m4 (AC_TYPE_UNSIGNED_LONG_LONG_INT):
Use -1ull rather than -1u, since that causes problems with gnulib; see
<http://lists.gnu.org/archive/html/bug-gnulib/2007-10/msg00329.html>.
2007-10-22 09:55:30 -07:00
Ralf Wildenhues
b4b372d68e Fix config status generation with Tru64 ksh.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Fix
escaping of backslash in here-documents.
2007-10-21 20:49:50 +02:00
Ralf Wildenhues
da605a63cd Fix config header generation with AIX awk.
* lib/autoconf/status.m4 (_AC_OUTPUT_HEADERS_PREPARE): In awk
script, use helper array D_is_set, as `" 0"' does not evaluate
to true for AIX awk.
2007-10-21 19:41:00 +02:00
Ralf Wildenhues
92412a20d5 Validate testsuite range arguments.
* lib/autotest/general.m4 (Defaults): Validate input ranges ...
<at_func_validate_ranges>: ... using this new function.
* tests/autotest.at (Keywords and ranges): Test invalid ranges.
Test --list with ranges and keywords.
(Banners): Remove one now-failing test.
2007-10-21 17:34:44 +02:00
Eric Blake
9cd3a80e3c Fix testsuite --list subset.
* lib/autotest/general.m4 (AT_INIT) <at_list_p>: Swap newlines
back to spaces, before listing subset of tests.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-20 22:39:23 -06:00
Eric Blake
49d1c176cc s/parenthesis/parentheses/ where appropriate.
* doc/autoconf.texi: Fix typos.
* lib/m4sugar/m4sugar.m4: Likewise.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-19 07:08:59 -06:00
Eric Blake
8c73ae256c Document m4_expand limitation.
* lib/m4sugar/m4sugar.m4 (m4_expand): Mention problem with
unbalanced parse.
* doc/autoconf.texi (Pretty Help Strings, Evaluation Macros)
(Writing Testsuites): Mention limitations inherited from
m4_expand.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-19 06:38:48 -06:00
Eric Blake
f034d89307 Improve AT_BANNER handling.
* lib/autotest/general.m4 (BANNERS): New named diversion.
(TESTS_END): Diversion no longer used.
(AT_INIT) <at_func_banner, BANNERS>: Factor all banners into a
shell function, which prints only as needed, using an associative
array of banner text from a special diversion.
<PARSE_ARGS_END>: No longer need awk to find banners.
<TESTS>: Banners are no longer processed by main driver loop, so
we no longer need case statement.
(AT_BANNER): Rewrite to populate new diversion.
(AT_SETUP): Each test invokes its own banner.  No output is needed
to the TESTS diversion.
* doc/autoconf.texi (Writing Testsuites): Document slight
semantics change.
* tests/autotest.at (AT_BANNERS): Enhance test.
* NEWS: Document AT_BANNER.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-19 06:29:10 -06:00
Eric Blake
32d3effc40 Ignore `make dist' changelogs in testsuite.log.
* lib/autotest/general.m4 (AT_INIT) <ChangeLogs>: Prune
directories matching AT_PACKAGE_TARNAME-*.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-18 18:38:34 -06:00
Eric Blake
5b6f53e441 Fix AT_TESTED, AT_KEYWORDS.
* lib/m4sugar/m4sugar.m4 (m4_append_uniq): Warn if separator
occurs in string, as duplicates may be added.
(_m4_append_uniq): New helper macro.
(m4_append_uniq_w): New macro.
* lib/autotest/general.m4 (AT_TESTED, AT_KEYWORDS): Fix
duplication bug by using new macro.
(AT_INIT) <at_tested>: Restore newline separators.  Invoke tested
programs with stdin redirected, so programs that don't
understand --version won't try to behave interactively.
* tests/autotest.at (Tested programs): Catch this bug.
* tests/m4sugar.at (m4@&t@_append): Test new macro.
* tests/local.at (AT_TESTED): Add m4, perl.
* doc/autoconf.texi (Text processing Macros): Document
m4_append_uniq_w, and update text on m4_append.
* NEWS: Document the addition.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-18 09:46:19 -06:00
Eric Blake
78fd34e4f7 Function cleanup.
* lib/autotest/general.m4 (_AT_CREATE_DEBUGGING_SCRIPT): Convert
from m4 macro...
(AT_INIT) <at_func_create_debugging_script>: ...to shell
function.
(AT_INIT): Defer function declarations until after --help,
--version.  Format functions consistently, trying to fit in 80
columns.
(TEST_FUNCTIONS): Based on recent changes, rename...
(TEST_GROUPS): ...to this.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-18 08:23:10 -06:00
Eric Blake
99be329141 Kill trailing whitespace.
Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-17 14:41:41 -06:00
Ralf Wildenhues
b3aa97c727 Autotest: do not use shell functions for individual tests.
* lib/autotest/general.m4 (AT_INIT) <at_func_test>: Merely
extract the source test source, do not invoke it.
(AT_SETUP, AT_CLEANUP): Source test code outside shell function.
* tests/autotest.at (Fallacy): Actually let the inner suite fail,
expect exit status of 1.
* tests/autotest.at (Skip): New test, for bogus zsh exit status.
2007-10-17 21:12:36 +02:00
Ralf Wildenhues
e492685ef7 * lib/autotest/general.m4 (at_func_test): Fix test extraction script. 2007-10-17 21:11:07 +02:00
Eric Blake
0c0e7bbd41 Fix m4_combine for empty suffix list.
* lib/m4sugar/m4sugar.m4 (m4_combine): Check for suffix list.
* doc/autoconf.texi (Text processing Macros): Document this.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-17 10:02:04 -06:00
Eric Blake
f2ea75eb03 Add m4_combine, based on Libtool's lt_combine.
* lib/m4sugar/m4sugar.m4 (m4_combine): New macro.
* doc/autoconf.texi (Text processing Macros): Document it.
* NEWS: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-17 07:13:00 -06:00
Ralf Wildenhues
bbb9c9628d Fix `configure --help=recursive' in unconfigured/read-only trees.
* lib/m4sugar/m4sh.m4 (_AS_LN_S_PREPARE): Avoid errors when `.'
is not writable, use 'cp -p' in this case, in the hope that it
will not actually be needed.  Still try removing files, in case
of other write errors.
* lib/autoconf/general.m4 (_AC_INIT_SRCDIR): For ac_confdir,
use $as_myself, not $0.
(_AC_INIT_HELP): For --help=recursive, if the subdir does not
exist, try again in the the source tree.  This change assumes
that the subpackage configure script is capable of running
--help=recursive in the source tree.
* tests/torture.at (Configuring subdirectories, Deep Package):
Adjust tests to expose both issues, also try invocation as
`sh configure ...' and plain `configure ...' with PATH adjusted.
* NEWS, THANKS: Update.
Report by Hans Ulrich Niedermann.
2007-10-16 23:50:03 +02:00
Paul Eggert
3de08b50f2 Check for 64-bit int errors in HP-UX 10.20 preprocessor.
Problem reported by H.Merijn Brand in
<http://lists.gnu.org/archive/html/bug-tar/2007-10/msg00018.html>.
* lib/autoconf/types.m4 (AC_TYPE_LONG_LONG_INT):
(AC_TYPE_UNSIGNED_LONG_LONG_INT):
Check that preprocessor handles 64-bit ints, too.
2007-10-16 13:25:57 -07:00
Eric Blake
96a08a7ee4 m4_map is a looping construct.
* lib/m4sugar/m4sugar.m4 (m4_map, _m4_map, m4_map_sep): Move.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-16 12:18:24 -06:00
Eric Blake
33239cbd38 Fix m4_map, and add some more utility macros.
* lib/m4sugar/m4sugar.m4 (m4_apply, m4_count, m4_dquote_elt)
(m4_echo, m4_make_list): New documented macros.
(_m4_quote, _m4_shift2): New helper macros.
(m4_map): Change semantics to allow calling macro without
arguments.
(m4_map_sep): Likewise.  Also change semantics to quote separator,
to match m4_join and m4_append.
(m4_version_unletter): Fix use of m4_map.
* doc/autoconf.texi (Evaluation Macros): Document m4_apply,
m4_count, m4_dquote_elt, m4_echo, m4_make_list.
(Text processing Macros): Mention m4_dquote as a faster
alternative to joining with commas.
(Looping constructs): Document m4_map, m4_map_sep.
* NEWS: Mention new macros.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-16 12:00:00 -06:00
Eric Blake
f3b4cc104e A few more m4sugar improvements, to benefit libtool.
* lib/m4sugar/m4sugar.m4 (m4_bpatsubsts, _m4_shiftn): Reduce size
of expansion by avoiding extra uses of $@.
(m4_shiftn): Avoid extra dnl, and forbid shifting by 0.
(_m4_cdr): New helper macro.
(_m4_map, m4_map_sep): Use it to reduce size of expansion.
(_m4_shift3): New helper macro.
(_m4_foreach): Swap argument order, and use new macro to reduce
size of expansion.
* doc/autoconf.texi (Looping constructs) <m4_shiftn>: Mention that
count must be positive.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-16 06:23:10 -06:00
Eric Blake
10a850e84a Enhance AS_HELP_STRING.
* lib/m4sugar/m4sugar.m4 (m4_text_wrap): Don't expand arguments,
and reduce number of expansions.
* lib/m4sugar/m4sh.m4 (AS_HELP_STRING): Rework to use m4_expand,
and to take indent and wrap column numbers.
* tests/m4sh.at (AS@&t@_HELP_STRING): Update the test.
* doc/autoconf.texi (Pretty Help Strings): Document details about
arguments.
(Text processing Macros): Minor tweaks.
* NEWS: Document this change.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-15 12:18:24 -06:00
Eric Blake
fd1344033b Fix 2007-10-03 regression with AT_SETUP([a, b]).
* lib/m4sugar/m4sugar.m4 (m4_expand): New macro.
* lib/autotest/general.m4 (AT_SETUP): Use it to preserve
whitespace after single-quoted comma.
* tests/autotest.at (AT_CHECK_AT_TITLE_CHAR): Test this.
* NEWS: Revert caveat about semantics change on comma.
* doc/autoconf.texi (Programming in M4): Lighten the warning on
using m4sugar; it is stabilizing.
(Redefined M4 Macros): Touch up wording on M4 builtins.
(Evaluation Macros): Document m4_expand.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-15 08:43:21 -06:00
Eric Blake
72431d8c84 Change m4_join to match libtool's ltsugar semantics.
* lib/m4sugar/m4sugar.m4 (m4_join): Just define this, not defun.
Ignore empty arguments, using...
(_m4_join): ...this new helper.
* tests/m4sugar.at (m4@&t@_join): New test.
* doc/autoconf.texi (Text processing Macros): Document new
semantics of m4_join.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-13 11:11:44 -06:00
Eric Blake
6e1d6e2c5b Make AC_PREREQ faster and more robust.
* lib/m4sugar/m4sugar.m4 (m4_ignore, m4_unquote): New macros.
(m4_version_prereq): Inline constant expansions.
(m4_list_cmp): Reduce number of expansions, by avoiding m4_case.
Rewrite in terms of [] list, not () list.
(_m4_list_cmp, _m4_version_unletter): New helper macros.
(m4_version_unletter): Write wrapper around new implementation to
preserve old semantics.
(m4_version_compare): Pass correct type of list, and avoid
overhead of flattening expressions too early.
(m4_do): Move to be near other quoting macros.
(m4_max, m4_min): Always result in decimal output.
* doc/autoconf.texi (Looping constructs): Add m4_car, m4_cdr.
Move m4_do...
(Evaluation Macros): ...here.  Add m4_ignore, m4_unquote.
(Text processing Macros): Move m4_version_compare...
(Number processing Macros): ...to this new node; document m4_cmp,
m4_list_cmp, m4_sign, m4_max, m4_min.
* tests/m4sugar.at (m4@&t@_version_compare): Enhance test, to pick
up on bugs fixed by this patch.
* NEWS: Document new macros.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-13 08:09:08 -06:00
Eric Blake
b171ca4ed3 Some more m4sugar documentation.
* lib/m4sugar/m4sugar.m4: Clean up macro order.
* doc/autoconf.texi (Programming in M4): Lighten the warning on
using m4sugar; it is stabilizing and useful.
(Redefined M4 Macros): Touch up wording on M4 builtins; sort.  Add
m4_divert, m4_undivert, __file__, __line__, __oline__.
(Diagnostics): New node, documenting m4_assert, m4_errprintn,
m4_fatal, m4_location, m4_warn.
(Diversion support): New node, documenting m4_divert_push,
m4_divert_pop, m4_divert_text, m4_divert_once.
(Text processing Macros): Sort.  Add m4_flatten, m4_join,
m4_newline, m4_strip, m4_text_box, m4_text_wrap.
(Programming in M4sh, Macro Names): Document namespace
limitations.  Mention that non-Automake macros should not begin
with `AM_'.
(Reporting Messages): Mark AC_DIAGNOSE, AC_WARNING, and AC_FATAL
as obsolescent.
(Printing Messages): Change cross-reference.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-12 15:55:56 -06:00
Eric Blake
be938d2dec Document interaction of recent m4_append change with Libtool HEAD.
* lib/m4sugar/m4sugar.m4 (m4_append): Document semantics change.
(m4_append_uniq): Add new parameters, based on lt_append_uniq.
* tests/m4sugar.at (m4@&t@_append): New test.
* NEWS: Document semantics change.
* doc/autoconf.texi (Text processing Macros): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-12 15:01:31 -06:00
Eric Blake
408ce204ae s/AC_VERSION/AC_AUTOCONF_VERSION/.
* doc/autoconf.texi (Versioning): Change the name.
* NEWS: Likewise.
* lib/autoconf/general.m4 (AC_AUTOCONF_VERSION): Likewise.
* tests/tools.at (autoconf: AC_AUTOCONF_VERSION): Likewise.
Suggested by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-12 12:14:03 -06:00
Eric Blake
c9b048ee4d Namespace cleanup.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE)
(_AC_OUTPUT_HEADERS_PREPARE): Convert here-doc delimiters into
autoconf namespace.
* doc/autoconf.texi (Programming in M4sugar, Forbidden Patterns)
(Programming in M4sh, Macro Names): Beef up description of
namespaces reserved for autoconf.
* configure: Regenerate.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-12 10:34:27 -06:00
Eric Blake
2857151c76 Speed up execution of subset of testsuite.
* lib/autotest/general.m4 (TEST_FUNCTIONS): New diversion.
(AT_INIT) <at_func_test>: New shell function.
(AT_INIT) <at_myself>: New variable, set to absolute $as_myself.
(AT_INIT) <at_test_source> New variable, names file that holds
current test function definition.
(AT_SETUP): Start the shell function at_func_test_#, into the
TEST_FUNCTIONS diversion.
(AT_CLEANUP): End the shell function.  Simplify the TESTS
diversion to invoke the function.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-12 09:29:10 -06:00
Eric Blake
baa0ce0978 Config header generation followup.
* lib/autoconf/general.m4 (_AC_DEFINE_Q): Check for raw newlines,
which won't work with the preprocessor nor with the awk
implementation.
* tests/torture.at (Define a newline): Test raw newline detection,
removing the XFAIL.
* doc/autoconf.texi (Defining Symbols): Document recent change to
allow backslash-newline.
* THANKS: Update.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-11 08:06:35 -06:00
Ralf Wildenhues
392e227524 * lib/autotest/general.m4: Put function braces in separate line. 2007-10-11 01:49:50 +02:00
Eric Blake
b4df79e1ab Avoid some overhead from m4_defn and m4_popdef.
* lib/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine): Only
pass on first argument, since we are documented that way.
(m4_for, m4_append_uniq, m4_text_wrap): Optimize out defined-ness
check where it is safe to do so.
(m4_append): Likewise, and quote the separator.
(m4_text_box): Likewise, and avoid regex, also be robust to
expansion and quadrigraphs.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-10 16:04:01 -06:00
Eric Blake
45b46a7467 Another AC_DEFINE speedup.
* lib/autoconf/general.m4 (AC_DEFINE_TRACE): Move parameter
elision...
(_AC_DEFINE_Q): ...here, and only do it once.
* lib/autoconf/functions.m4 (AC_CHECK_FUNCS): Avoid overquoting.
* lib/m4sugar/m4sh.m4 (AS_LITERAL_IF): Fix m4_defn overquoting
introduced 2007-10-05.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-10 14:36:27 -06:00
Eric Blake
b2bde204cf Whitespace cleanup.
* lib/autoconf/general.m4: Use consistent indentation.
* configure: Regenerate.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-10 14:32:55 -06:00
Eric Blake
028272af52 Reduce number of forks at startup.
* lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Speed up NLS
sanitization.
* configure: Regenerate.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-10 07:13:39 -06:00
Ralf Wildenhues
c0b647a8c7 Use awk for config header generation.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Fix comments.
(_AC_OUTPUT_HEADERS_PREPARE): New macro.  Rewrite of the config
header machinery for use with awk and placement outside the main
config.status instantiation loop.  Retain multi-line defines
through backslash-newline combinations, do not split the script
any more.
(_AC_OUTPUT_HEADER): Simplify accordingly, use $AWK.
(_AC_OUTPUT_MAIN_LOOP): Call _AC_OUTPUT_HEADERS_PREPARE if
needed.
(AC_OUTPUT_MAKE_DEFS): Remove backslash-newline combinations
from define values.
* NEWS: Update.
* tests/torture.at (#define header templates): Extend test by
several more cases: white space before and after `#', macros
with parameters in config.hin and as defines, multi-line macro
values.
(Torturing config.status): Use a define value twice the length
in order to exercise the awk literal string limit.
(Substitute and define special characters): Also try special
delimiter, to exercise the special-case code.
Suggestion by Eric Lemings.
2007-10-10 07:18:34 +02:00
Eric Blake
2c63638e2b Improve header of bin/autoconf.
* lib/m4sugar/m4sh.m4 (AS_INIT): Add a 'generated from' notice.
* lib/autoconf/general.m4 (_AC_INIT_NOTICE): Override new notice
from M4sh.
* bin/autoconf.as: Put copyright up front in generated file.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-09 17:15:43 -06:00
Eric Blake
94a9faded7 Fix regression in m4_text_wrap from 2007-10-05.
* lib/m4sugar/m4sugar.m4 (m4_max, m4_min): New macros.
(m4_sign): Sort.
(m4_text_wrap): Fix off-by-one error in rewrite from m4_for to
m4_format.
* lib/autotest/general.m4 (AT_SETUP): Avoid negative width.
* tests/autotest.at (Long test title, Longer test title): Test
this fix, beyond what AS_HELP_STRING already tests.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-08 14:09:22 -06:00
Eric Blake
a83ac461c6 Avoid m4 warnings on bad m4_format usage.
* lib/m4sugar/m4sugar.m4 (m4_text_wrap): Use %*s, in case width
evaulates to 0.
* lib/autotest/general.m4 (AT_ordinal): Likewise; also ensure that
enough arguments are provided.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-08 10:46:21 -06:00
Paolo Bonzini
1020cacbe3 autotest speed improvements
2007-10-06  Paolo Bonzini  <bonzini@gnu.org>

	* lib/autotest/general.m4 (AT_INIT): Add at_func_diff_devnull,
	at_func_check_skip, at_func_check_status, at_func_filter_trace,
	at_func_log_failure shell functions.  Use test -s to avoid
	useless diff invocations.
	(AT_SETUP): Define AT_captured_files to empty.
	(AT_DIFF_STDERR(*), AT_DIFF_STDOUT(*)): New, extracted from _AT_CHECK.
	(_AT_CHECK): Replace m4_case with m4_ifdef/m4_indir.  Use all
	the shell functions.

Signed-Off-By:  Paolo Bonzini  <bonzini@gnu.org>
2007-10-06 11:26:14 +02:00
Paul Eggert
df45b2a924 Don't assume "." is writeable, for commands like "autoconf --version".
* lib/m4sugar/m4sh.m4 (_AS_PATH_SEPARATOR_PREPARE): Use a
different heuristic instead, one that doesn't rely on creating
files.
2007-10-05 15:31:06 -07:00
Paul Eggert
c8765d53a0 * lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Handle "///"
correctly.
2007-10-05 13:52:01 -07:00
Eric Blake
35b65ec05c Resolve Python issue 1676135 regarding configure directory args.
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Strip trailing
slashes from directory arguments.
* tests/base.at (configure directories): New test.
* doc/autoconf.texi (Installation Directory Variables): Document
the change.
* NEWS: Likewise.
* THANKS: Update.
Reported by Björn Lindqvist.
http://bugs.python.org/issue1676135

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-05 11:57:09 -06:00
Eric Blake
4e9078ba0b Provide better short-circuiting operation.
* lib/m4sugar/m4sugar.m4 (m4_cond, m4_newline): New macros.
(m4_text_wrap): Use it.  Also avoid useless m4_for.
* lib/m4sugar/m4sh.m4 (_AS_QUOTE_IFELSE, AS_LITERAL_IF): Use
new macro.
(_AS_IDENTIFIER_IF): Likewise, and fix bug when $1 is [,].
* lib/autotest/general.m4 (_AT_DECIDE_TRACEABLE): Use new macros
to avoid regexps.
* doc/autoconf.texi (Redefined M4 Macros): Expand m4_if
documentation.  Sort m4_mkstemp, m4_undefine.  Move m4_ifndef...
(Conditional constructs): ...here, to new section.  Also document
m4_cond, m4_ifval, m4_n, m4_ifvaln, m4_ifset, m4_case, m4_bmatch,
m4_bpatsubsts, and m4_default.
(Looping constructs): Document m4_shiftn, m4_shift2, m4_shift3,
m4_do.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-05 11:25:20 -06:00
Eric Blake
2152c1e75f Fix recent testsuite failures.
* lib/autotest/general.m4 (AT_INIT, AT_SETUP): Double-quote text
that must not be re-expanded after AS_ESCAPE.
* lib/m4sugar/m4sh.m4 (_AS_IDENTIFIER_IF): Don't expand $1 when
checking if it is an identifier.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-04 17:07:42 -06:00
Eric Blake
c85ce295a0 Whitespace cleanup.
* lib/autotest/general.m4 (_AT_CREATE_DEBUGGING_SCRIPT): Avoid
leading whitespace, as it caused space-tab in testsuite.
(AT_INIT): Avoid trailing newlines in testsuite.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-04 14:35:14 -06:00
Paolo Bonzini
4b10ac1293 use shell functions to speed up autotest and produce slimmer testsuites
2007-10-04  Paolo Bonzini  <bonzini@gnu.org>

	* general.m4 (AT_INIT): Add at_check_newline function.
	(_AT_DECIDE_TRACEABLE): Include at_traceon test, use shell function.
	(_AT_CHECK): Don't use at_trace_this.

Signed-off-by:  Paolo Bonzini  <bonzini@gnu.org>
2007-10-04 21:49:16 +02:00
Eric Blake
10fa310839 One more round of m4_foreach_w speedups.
* lib/m4sugar/m4sugar.m4 (m4_flatten): Only use regex if newline
is present.
(_m4_split): Avoid useless expansions inside definition.  Move
argument defaulting...
(m4_split): ...here.  Change alternate quote to something less
likely to appear in $1.  Also, special case space as regexp...
(m4_foreach_w): ...to avoid regexp on single-term list.
(m4_default, m4_defn, m4_popdef, m4_undefine, _m4_foreach): Avoid
useless expansions inside definition.
* tests/m4sugar.at (m4@&t@_split): Add tests.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-04 10:09:38 -06:00
Paolo Bonzini
e6cf284ade Fix previous commit.
* lib/autotest/general.m4 (AT_LINE): Fix regex.

Signed-off-by:  Paolo Bonzini  <bonzini@gnu.org>
2007-10-04 17:15:21 +02:00
Eric Blake
4c7d289c7d Speed up building testsuites.
* lib/autotest/general.m4 (AT_LINE): Only use regex when file
changed since last time.  Use simpler regex.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-04 07:13:50 -06:00
Eric Blake
e76d30be25 Optimize checking for identifiers.
* lib/m4sugar/m4sh.m4 (AS_IDENTIFIER_IF, _AS_IDENTIFIER_IF): New
macros, more efficient than regex on m4_re_word.
* lib/autoconf/general.m4 (AC_SUBST, AC_DEFINE_TRACE_LITERAL):
Rewrite in terms of new macro.  As a side-effect, AC_DEFINE can
now use @&t@.
* configure: Regenerate.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-03 17:22:46 -06:00
Eric Blake
8b299b6d82 Remove some XFAILs, and make AT_SETUP output line up.
* lib/autotest/general.m4 (AT_SETUP): Only expand description
once; thereafter, use its expansion, properly quoted.
* tests/autotest.at (AT_CHECK_AT_TITLE): Also check macro
expansion with arguments, and check for aligned output.
(AT_CHECK_AT_TITLE_CHAR): Remove XFAILs for tests that now pass.
Add a test for macros with parameters.
* NEWS: Document the semantics change.
* tests/base.at: Fix test titles containing commas.
* tests/compile.at: Likewise.
* tests/tools.at: Likewise.
* tests/torture.at: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-03 16:20:45 -06:00
Eric Blake
987a333766 Another round of regex avoidance.
* lib/m4sugar/m4sugar.m4 (m4_cr_alnum, m4_cr_all)
(_m4_define_cr_not, m4_cr_not_letters, m4_cr_not_LETTERS)
(m4_cr_not_Letters, m4_cr_not_digits, m4_cr_not_alnum)
(m4_cr_not_symbols1, m4_cr_not_symbols2): New macros, implementing
character ranges useful in m4_translit.
(m4_toupper, m4_tolower): Optimize the constant portion of
definition.
* lib/m4sugar/m4sh.m4 (AS_LITERAL_IF): Also reject @S|@ because it
creates $, and reject [] thanks to AS_TR_SH rewrite.
(AS_TR_SH, AS_TR_CPP): Use just translit, not bpatsubst.
(AS_ESCAPE): Factor...
(_AS_ESCAPE): ...into new macro, with second argument required.
Avoid regex in common case.
(_AS_QUOTE): Use new macro.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-03 15:42:42 -06:00
Eric Blake
1a128bd6e6 Whitespace cleanup.
* lib/autoconf/types.m4: Avoid space-tab.
* lib/m4sugar/m4sh.m4: Use tab consistently.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-03 15:36:43 -06:00
Paul Eggert
9174b63f95 * lib/m4sugar/m4sugar.m4 (m4_shift2, m4_shift3): New macros.
(m4_shiftn): Remove no-longer-needed optimization.  Perhaps we
should remove m4_shiftn entirely?
(m4_case, b4_bmatch, m4_map_sep, m4_bpatsubsts, m4_join):
Prefer m4_shift2 and m4_shift3 to m4_shiftn.
* lib/autoconf/lang.m4 (_AC_LANG_DISPATCH): Likewise.
* lib/m4sugar/m4sh.m4 (AS_CASE, AS_IF): Likewise.
* tests/autotest.at (AT_CHECK_AT_TEST): Likewise.
2007-10-03 13:06:08 -07:00
Eric Blake
7b96e241f7 Comment touchups.
* lib/m4sugar/m4sugar.m4: Grammar fixes in comments.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-03 08:09:04 -06:00
Eric Blake
53b2e90b42 Optimize appending text.
* lib/m4sugar/m4sugar.m4 (m4_append_uniq): Use index, not regular
expressions.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-02 20:23:03 -06:00
Eric Blake
57e51969f0 Optimize recursion.
* lib/m4sugar/m4sugar.m4 (m4_shiftn): This macro is called in a
lot of hot spots; optimize it for 2 and 3 shifts.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-02 15:26:34 -06:00
Eric Blake
7113f1b07c Optimize AC_PREREQ and other m4sugar numerics.
* lib/m4sugar/m4sugar.m4 (m4_sign): Write with m4_eval.
(m4_cmp): Compare arbitrary expressions, without overflow.
(m4_version_unletter): Also recognize capital letters.
(m4_version_compare): Avoid regex when splitting version number
string.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-02 07:04:11 -06:00
Eric Blake
19a706a7ed Fix regression in AC_DEFINE([macro(with_arg)]).
* lib/autoconf/general.m4 (AC_DEFINE_TRACE): Don't chop off close
quotes with a careless m4_substr.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-01 10:10:42 -06:00
Eric Blake
615300a1d5 Allow nameless iteration.
* lib/m4sugar/m4sugar.m4 (m4_for, _m4_for): Access variable
indirectly.
* tests/m4sugar.at (myvar): Test this.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-30 06:45:33 -06:00
Eric Blake
b2dda0adc7 Speed optimization: avoid m4 regex when other algorithms work.
* lib/m4sugar/m4sh.m4 (AS_LITERAL_IF): Rewrite without regex.
(_AS_QUOTE_IFELSE): Likewise.
* lib/m4sugar/m4sugar.m4 (m4_strip): Reduce from 3 to 2 regex.
(m4_bpatsubsts): Split...
(_m4_bpatsubsts): ...so that recursion can avoid patsubst on empty
regex.
(_m4_divert()): Define, to avoid m4 warning on `m4_divert'.
(m4_qlen): Optimize on short strings, to avoid regex.
(m4_sign): Avoid regex, and fix bug with `01' and `-0'.
* lib/autoconf/general.m4 (AC_CACHE_VAL): Rewrite without regex.
(AC_DEFINE_TRACE): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-29 21:44:10 -06:00
Ralf Wildenhues
220fef66a8 Catch even more common AC_CACHE_VAL mistakes.
* lib/autoconf/general.m4 (AC_CACHE_VAL): Warn if cache variable
lacks '_cv_', or if AC_SUBST appears in body.
* tests/base.at (AC_CACHE_CHECK): Test this change.
2007-09-27 22:18:28 -06:00
Stepan Kasal
755596a7ae Autotest no longer caters to Ultrix redirection limitation.
* doc/autoconf.texi (Writing testsuite.at): Remove the
limitation that the first parameter of AT_CHECK cannot
contain redirection.
(File Descriptors): Mention that Ultrix limitation is no longer a
show-stopper in modern code.
* tests/local.at (AT_CHECK_M4): Fix for cases when the fourth
parameter is `stderr' or `experr'.  Optimize if it was `ignore'.
* lib/autotest/general.m4 (AT_CHECK): Update comment.
2007-09-27 21:09:18 -06:00
Eric Blake
b2e3fcf5bb Squelch changeword in m4sugar.
* lib/m4sugar/m4sugar.m4 (changeword): Disable this experimental
feature of m4 1.4.x.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-27 19:55:38 -06:00
Eric Blake
afdb9d6e9f Configure whitespace touchups.
* lib/autoconf/general.m4 (_AC_INIT_HELP): Fix alignment of
installation directories, and avoid TAB, in configure --help
output.
* configure.ac: Avoid extra trailing newline.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Avoid space-tab.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Avoid TAB in
config.status --help output.
* configure: Regenerate.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-27 19:35:55 -06:00
Eric Blake
f444a9fa8e Fix underquotation in AS_HELP_STRING.
* lib/m4sugar/m4sh.m4 (AS_HELP_STRING): Don't underquote lhs
argument.
* lib/m4sugar/m4sugar.m4 (m4_text_wrap): Don't underquote
first-prefix argument.
* tests/m4sh.at (AS@&t@_HELP_STRING): Test this fix.
* NEWS: Document AS_HELP_STRING fix.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-27 19:29:49 -06:00
Eric Blake
3b121ee688 Autotest formatting touchups.
* lib/autotest/general.m4 (HELP_TUNING): Avoid TAB in terminal
output.
(PATH): Simplify computation of new PATH.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-27 09:32:55 -06:00
Eric Blake
46d7a04b49 Typo fixes.
* lib/autoconf/general.m4 (AC_SUBST): Fix typo in comment.
* lib/m4sugar/m4sh.m4 (AS_VAR_PUSHDEF): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-25 17:05:50 -06:00
Eric Blake
50306359a4 Improve C99 detection.
* lib/autoconf/c.m4 (_AC_PROG_CC_C99): Add support for HP cc, and
avoid deprecation warning with icc.
* THANKS: Update.
Reported by Ted Bullock.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-25 06:24:55 -06:00
Jim Meyering
06f2cb9db6 Whenever possible, use the vertical bar as sed delimiter.
* lib/autoconf/functions.m4 (GETLOADAVG_LIBS) [AC_FUNC_GETLOADAVG]:
Use "|", not "!".
* lib/autoconf/status.m4 (_AC_SRCDIRS) [ac_top_builddir_sub]:
[ac_dir_suffix]: Use "|", not "," as sed delimiter.
* tests/mktests.sh (as_me): Likewise.
* lib/freeze.mk (check-forbidden-patterns): Likewise.
* lib/autoconf/fortran.m4 (_AC_PROG_FC_V_OUTPUT): Likewise.
* configure: Regenerate.
* doc/autoconf.texi (Shell Substitutions): Use "|", not "," in examples.
* lib/autotest/general.m4 (AT_INIT): Use "|", not "&" as sed delimiter
in the : -> $PATH_SEPARATOR transformation of $AUTOTEST_PATH.  This is fine,
as long as $PATH_SEPARATOR doesn't contain "|".
2007-09-24 21:57:21 +02:00
Jim Meyering
dc1679c9d2 Add a comment.
* lib/autoconf/headers.m4 (HAVE_STDBOOL_H): Document the
2004-05-31 change also with a comment in the code.
2007-09-22 14:19:10 +02:00
Eric Blake
5547b4a0f2 Provide AC_VERSION, not m4_AUTOCONF_VERSION.
* doc/autoconf.texi (Text processing Macros): Remove mention of
m4_AUTOCONF_VERSION, and leave m4_PACKAGE_VERSION undocumented
once again.
(Notices): Move AC_PREREQ...
(Versioning): ...to this new section, alongside the new AC_VERSION
alias for the undocumented m4_PACKAGE_VERSION.
* lib/m4sugar/m4sugar.m4 (m4_AUTOCONF_VERSION): Revert change.
* lib/autoconf/general.m4 (AC_VERSION): New macro.
* NEWS: Update to match this rename.
* tests/m4sugar.at (m4@&t@_version_compare): Remove tests of
m4_PACKAGE_VERSION.
* tests/tools.at (autoconf: AC_VERSION): New test.
Suggested by Paolo Bonzini and Benoit Sigoure.
2007-09-15 12:41:08 +00:00
Eric Blake
bf1af030e2 Prepare for conversion to git.
* doc/.cvsignore: Avoid multiple listings on one line.
* bin/.cvsignore: Likewise.
* .gitignore, bin/.gitignore, config/.gitignore, doc/.gitignore,
lib/.gitignore, lib/Autom4te/.gitignore, lib/autoconf/.gitignore,
lib/autoscan/.gitignore, lib/autotest/.gitignore,
lib/emacs/.gitignore, lib/m4sugar/.gitignore, man/.gitignore,
tests/.gitignore: New files, identical to .cvsignore counterpart.
2007-09-14 22:25:56 +00:00
Eric Blake
39f7ed183c Editing eye-candy.
* lib/autoconf/general.m4 (_AC_DO_ECHO): Likewise.
2007-09-13 23:39:07 +00:00
Eric Blake
3be109e22d Editing eye-candy.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Restore
font-lock balance.
* lib/m4sugar/m4sh.m4 (AS_MKDIR_P): Likewise.
* configure: Regenerate.
2007-09-13 21:51:19 +00:00
Eric Blake
b6ef3cc579 Publish m4_ifndef, m4_version_compare, m4_AUTOCONF_VERSION.
* doc/autoconf.texi (Text processing Macros): Document
m4_version_compare, m4_AUTOCONF_VERSION, m4_PACKAGE_VERSION.
(Redefined M4 Macros): Document m4_ifndef.
* lib/m4sugar/m4sugar.m4 (m4_AUTOCONF_VERSION): New macro; we
can't obsolete m4_PACKAGE_VERSION at this time since Autoconf 1.10
used it while it was undocumented.
* NEWS: Document this change.
* lib/m4sugar/Makefile.am (version.m4): Update copyright dates.
* lib/m4sugar/Makefile.in: Regenerate.
* tests/m4sugar.at (m4@&t@_version_compare): New test.
Reported by Bruno Haible.
2007-09-13 03:21:18 +00:00
Eric Blake
6add6e92a6 Centralize all system extensions checks.
* lib/autoconf/specific.m4 (AC_USE_SYSTEM_EXTENSIONS): Inline code
from AC_AIX, AC_GNU_SOURCE, AC_MINIX.  Add Interix support.
(AC_AIX, AC_GNU_SOURCE, AC_MINIX): Obsolete, and point to
AC_USE_SYSTEM_EXTENSIONS.
(AC_ISC_POSIX): Obsolete, and point to AC_SEARCH_LIBS.
(AC_XENIX_DIR, AC_IRIX_SUN): Promote proper quoting in AU_DEFUN.
* doc/autoconf.texi (Posix Variants): Reword this section,
emphasizing that AC_USE_SYSTEM_EXTENSIONS is the preferred method,
rather than a series of system-specific checks.
(Obsolete Macros): Add AC_AIX, AC_GNU_SOURCE, AC_ISC_POSIX,
AC_MINIX.
* NEWS: Document this change.
* THANKS: Update.
Reported by Martin Koeppe.
2007-09-11 17:13:13 +00:00
Eric Blake
f3aee13bfa Improve M4 path searching during configure.
* lib/autoconf/programs.m4 (AC_PATH_PROGS_FEATURE_CHECK): New
macro.
(_AC_PATH_PROG_FEATURE_CHECK): Rename...
(_AC_PATH_PROGS_FEATURE_CHECK): ...to this, add defaulted action
parameter, and kill side effects.
(_AC_PROG_GREP, AC_PROG_SED): Adjust callers.
(_AC_FEATURE_CHECK_LENGTH): Kill extra whitespace.
* m4/m4.m4 (AC_PROG_GNU_M4): Don't stop searching until working m4
is found.
(AC_PATH_PROGS_FEATURE_CHECK): Add backwards compatibility hack to
allow bootstrapping with autoconf 2.61.
* configure.ac (M4): AC_PROG_GNU_M4 now exits on failure.
* configure: Regenerate.
* doc/autoconf.texi (Generic Programs): Document new macro.
* tests/mktests.sh (au_exclude_script): Exclude auto-testing new
macro.
* tests/semantics.at (AC_PATH_PROGS_FEATURE_CHECK): New test.
* NEWS: Document the change.
* THANKS: Update.
Reported by Hans Aberg.
2007-09-08 14:48:49 +00:00
Ralf Wildenhues
ef81904136 * lib/autoconf/general.m4 (AC_SITE_LOAD): Guard against file
names beginning with `-' again.
2007-08-23 18:36:06 +00:00
Ralf Wildenhues
673d7738a4 * lib/autoconf/general.m4 (AC_SITE_LOAD): Do not overwrite "$@"
here, this macro is expanded by AC_INIT.  Fixes 2.60 regression.
* tests/base.at (configure arguments): New test.
* THANKS: Update.
Report by Olaf Lenz.
2007-08-21 20:23:16 +00:00
Ralf Wildenhues
220d051d92 * lib/autoconf/general.m4 (_AC_ENABLE_IF): Expand macro
arguments in comment.
Report by Vincent Torri <vtorri at univ minus evry dot fr>.
2007-08-21 17:32:39 +00:00
Ralf Wildenhues
acb069f9d2 * lib/autoconf/status.m4 (_AC_OUTPUT_LINK): Do not try to link a
file to itself if source and build trees coincide.
* tests/torture.at (AC_CONFIG_LINKS and identical files): New
test.
Report by Sebastian Freundt <hroptatyr@gna.org>.
2007-08-18 09:07:20 +00:00
Paul Eggert
b411b77358 Reword the copyright notices to match what's suggested in GPLv3. 2007-07-20 23:11:49 +00:00
Paul Eggert
f448ac9647 Update to GPLv3. 2007-07-03 20:28:58 +00:00
Noah Misch
aa643c7ef8 * lib/autotest/general.m4 (AT_INIT): Handle absolute `srcdir'.
* tests/autotest.at (srcdir propagation): Test absolute `srcdir' and
`srcdir' as subdirectory of `builddir'.
2007-06-19 19:49:05 +00:00
Noah Misch
fdb749cd8a * lib/autotest/general.m4 (AT_INIT): Compute $srcdir correctly.
* tests/autotest.at (srcdir propagation): New test.
* THANKS: Update.
Reported by Mike Frysinger.
2007-06-14 01:32:28 +00:00
Paul Eggert
48656aea07 * lib/m4sugar/m4sh.m4 (_AS_PATH_SEPARATOR_PREPARE): Set FPATH too.
Problem reported by Fred Kreek in
<http://lists.gnu.org/archive/html/bug-autoconf/2007-06/msg00009.html>.
* doc/autoconf.texi (Special Shell Variables): Warn about FPATH.
(Macro Names, Defining Directories): Don't mention PATH as a name
for a fully qualified file name, as this usage violates the GNU
coding standards and we shouldn't recommend it.

* lib/autotest/general.m4 (AT_INIT): Don't set PATH to the empty
string and then assume shell builtins like "test" will work.
2007-06-13 16:52:24 +00:00
Noah Misch
e7f613e8a8 * lib/autoconf/general.m4 (AC_SUBST): Raise a fatal error if VARIABLE is
not a valid shell variable name.
* tests/mktests.sh (ac_exclude_list): Add AC_ARG_VAR.
* tests/torture.at (AC_SUBST: variable name validation): New test.
Reported by Andreas Schwab.
2007-06-12 11:36:56 +00:00
Noah Misch
b336c6f28f * lib/autoconf/c.m4 (AC_OPENMP): Use a simple loop instead of compiler
brand tests.
2007-06-04 03:16:36 +00:00
Stepan Kasal
29c932691f * lib/autoconf/types.m4 (_AC_TYPE_UNSIGNED_INT): Fix a typo. 2007-05-29 11:46:29 +00:00
Paul Eggert
12bfe452a5 * lib/autoconf/c.m4 (AC_OPENMP): Don't echo --enable-openmp
choice, since that's what we do with --enable-largefile etc.
Redo indenting and assignments to simplify things a bit, and make
the parens work with Emacs.
2007-05-21 23:10:09 +00:00
Noah Misch
8593af460c * lib/autoconf/c.m4 (AC_OPENMP): Simplify use of AC_ARG_ENABLE.
* tests/local.at (AT_CHECK_ENV): Exempt OPENMP_CFLAGS.
2007-05-21 22:31:18 +00:00
Paul Eggert
19a9b3c937 * NEWS: Rename AC_C_OPENMP to AC_OPENMP.
* lib/autoconf/c.m4 (AC_OPENMP): Renamed from AC_C_OPENMP.
* doc/autoconf.texi (Generic Compiler Characteristics): Move
renamed AC_OPENMP documentation here, from "C compiler".
Mention C++ and Fortran.

* NEWS: Mention AC_C_OPENMP.
2007-05-21 17:50:57 +00:00
Paul Eggert
c31d039a4e * doc/autoconf.texi (C Compiler): Tweak OpenMP documentation a bit.
2007-05-21  Bruno Haible  <bruno@clisp.org>

* lib/autoconf/c.m4 (AC_C_OPENMP): New macro.
* doc/autoconf.texi (C Compiler): Document AC_C_OPENMP.
* NEWS: Mention AC_C_OPENMP.
2007-05-21 17:39:09 +00:00
Paul Eggert
d15e584f46 * NEWS: Document that AC_C_RESTRICT checks 'restrict' last.
* doc/autoconf.texi (C Compiler): Likewise.

2007-05-14  Noah Misch  <noah@cs.caltech.edu>

* lib/autoconf/c.m4 (AC_C_RESTRICT): Check `restrict' last.

* doc/autoconf.texi (Caching Results): The CACHE-ID variable
2007-05-14 16:54:55 +00:00
Noah Misch
9492c4ce65 * lib/autotest/general.m4 (_AT_NORMALIZE_TEST_GROUP_NUMBER): Use `eval'.
* doc/autoconf.texi ($@, case): Document Zsh limitations.
2007-05-07 19:56:56 +00:00
Paul Eggert
18d78d3a55 * lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Put a.out first.
Reorganize the comments before and in the macro.
2007-05-03 17:23:39 +00:00
Stepan Kasal
4e11a505ac * lib/autoconf/lang.m4, lib/autoconf/c.m4,
lib/autoconf/fortran.m4, lib/autoconf/erlang.m4: Cleanup of
section titles and other comments; no code change.
2007-05-03 14:47:12 +00:00
Paul Eggert
43e384db53 Fix typo in previous message. 2007-04-30 17:11:50 +00:00
Paul Eggert
e53160abef * lib/m4sugar/m4sh.m4 (_AS_SHELL_FN_SPY): Don't imply that
'configure' will fail if the shell lacks proper support for shell
functions.  Suggested by RMS.
2007-04-30 17:08:07 +00:00
Paul Eggert
cadaf30a72 * lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Don't look
for a.* when searching for executables, as this prevents users
from having files like a.c.  Problem reported by Ralf Wildenhues in:
http://lists.gnu.org/archive/html/autoconf-patches/2007-04/msg00029.html
This fixes a problem introduced on 2000-12-19.
2007-04-29 05:50:27 +00:00
Paul Eggert
4ccb447218 * NEWS: Document recent changes to AC_CHECK_ALIGNOF, AC_CHECK_SIZEOF,
AC_CHECK_TYPE, AC_CHECK_TYPES.
* doc/autoconf.texi (Generic types): C types must be type-names
(the C terminology), not type-ids (the C++ term).  C++ types
must not be anonymous.
* lib/autoconf/types.m4 (_AC_CHECK_TYPE_NEW): Remove special case
for C++; this drops support for anonymous struct and union types,
which were problematic anyway.
* tests/semantics.at (AC_CHECK_HEADERS_NEW): Adjust test to work even
for C++.
2007-04-13 07:52:57 +00:00
Ralf Wildenhues
d09b879309 * lib/autoconf/status.m4 (_AC_OUTPUT_LINK): Fix AC_CONFIG_LINKS
to prefer a link source from the build tree, if it exists.
Report by Pallav Gupta <pallavgupta@gmail.com>.
2007-04-12 05:39:00 +00:00
Paul Eggert
fb82e1a122 * doc/autoconf.texi (Generic Types): Document the restrictions
on types imposed by AC_CHECK_TYPE, AC_CHECK_TYPES.
(Generic Compiler Characteristics): AC_CHECK_SIZEOF now works
with objects too.  Document the restrictions on its use.
Document the restrictions on AC_CHECK_ALIGNOF's type argument.
* lib/autoconf/types.m4 (_AC_CHECK_TYPE_NEW):
For C, just try sizeof (TYPE) and sizeof ((TYPE)); if the former
works but the latter doesn't, then it's a valid type.
This lets people use function types and so forth.
For C++ there doesn't seem to be a simple solution, so leave it alone.
(AC_CHECK_SIZEOF): Allow argument to be a variable.
(AC_CHECK_SIZEOF, AC_CHECK_ALIGNOF): Don't bother to invoke
AC_CHECK_TYPE; that wasn't documented or necessary.
2007-04-12 00:12:06 +00:00
Paul Eggert
3d917d1923 * lib/autoconf/general.m4 (_AC_LINK_IFELSE): Skip AS_TEST_X
when cross-compiling.

2007-04-11  Stepan Kasal  <kasal@ucw.cz>
2007-04-11 17:32:27 +00:00
Stepan Kasal
a48a8158f2 * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Fix a
comment in the generated config.status.
2007-03-28 19:16:30 +00:00
Stepan Kasal
c2b51bf315 * lib/autoconf/status.m4 (AC_CONFIG_SUBDIRS): Update comment. 2007-03-27 12:58:17 +00:00
Paul Eggert
e3c6e14afc * doc/autoconf.texi (C Compiler): Warn that AC_C_BIGENDIAN
suggests AC_CONFIG_HEADERS.
* lib/autoconf/c.m4 (AC_C_BIGENDIAN): Warn if not using
AC_CONFIG_HEADERS.  Problem reported by
Peter O'Gorman.
2007-03-06 07:30:17 +00:00
Paul Eggert
b99a9b898d * lib/autoconf/c.m4 (AC_C_BIGENDIAN): Fix typo "__LITLE_ENDIAN__".
Problem reported by Paolo Bonzini in:
http://lists.gnu.org/archive/html/autoconf-patches/2007-02/msg00024.html
* tests/semantics.at (AC_C_BIGENDIAN): Don't reject hosts that have
universal binaries.  Problem reported by Elias Pipping.
2007-03-01 00:18:28 +00:00
Paul Eggert
a49bbf7a83 * NEWS: AC_C_BIGENDIAN now supports universal binaries a la Mac OS X.
* doc/autoconf.texi (C Compiler): Document this.  There is a new
extra argument ACTION-IF-UNIVERSAL.
* lib/autoconf/c.m4 (AC_C_BIGENDIAN): Implement this.
Add support for Solaris-style _LITTLE_ENDIAN and _BIG_ENDIAN.
Reindent for sanity's sake.
2007-02-28 00:03:33 +00:00
Eric Blake
74416a3598 * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Update
copyright.
* lib/autoconf/general.m4 (_AC_INIT_COPYRIGHT): Likewise.
* lib/autotest/general.m4 (AT_INIT): Likewise.
(_AT_DECIDE_TRACEABLE): Fix syntax highlighting.
2007-02-24 21:48:24 +00:00
Ralf Wildenhues
b76181e460 * lib/autotest/general.m4 (AT_INIT): With --clean, return exit
status of rm so we know when it failed.
If cleaning of test dir failed before running the test, warn.
Output the line separator in verbose mode before the warning
to make clear the warning belongs to the following test.
2007-02-13 06:22:45 +00:00
Paul Eggert
039348cde8 * lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Fix quoting
errors introduced in last change.
2007-02-08 04:26:44 +00:00
Paul Eggert
6fb99317ff * lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Prefer \r to
an actual carriage return.  Use "ac_cr" to contain the actual
carriage return.
* doc/autoconf.texi (Limitations of Usual Tools): Document problem
with traditional Awk and begin.
* tests/torture.at (Limitations of Builtins): Document the problem
with Bash 2.03 printf.
(Substitute and define special characters):
Remove trailing white space.  Work around a bug in Solaris 8 /bin/bash.
2007-02-07 17:45:37 +00:00
Ralf Wildenhues
c538d56624 * lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Redirect
input from /dev/null in awk test, so even Solaris /usr/bin/awk
will not wait for input with a script containing only a BEGIN
rule.
2007-02-06 18:52:33 +00:00
Ralf Wildenhues
d9b0257f67 * lib/autoconf/programs.m4 (AC_PROG_MKDIR_P): Also
AC_SUBST([MKDIR_P]), so that Automake < 1.10 will pick up its
trace, if a package uses AC_PROG_MKDIR_P explicitly.  The actual
substitution will still be done by the special code.
Report by Jim Meyering.
2007-01-23 18:54:37 +00:00
Ralf Wildenhues
bb7dd74777 * doc/autoconf.texi (Setting Output Variables): Mention that
all non-NUL characters are ok in substituted values.
* lib/autoconf/status.m4 (_AC_SED_CMD_LIMIT): Fix comment typo.
(_AC_OUTPUT_FILES_PREPARE): Test and use backslash escaping of
carriage return for $AWK, needed for BSD awk.
* tests/torture.at (Substitute and define special characters):
Test all 8 bit non-NUL characters.
Report against Automake by Patrick Welche.
2007-01-19 06:54:34 +00:00
Ralf Wildenhues
af97d7255d * lib/autoconf/programs.m4 (AC_PROG_SED): When closing a pipe
early on the reader side, drop stderr of the input to avoid
`broken pipe' error output; this may happen even with shell
builtin `echo' of some bash versions.  Reports by Ian Macdonald
<iamacdo@telkomsa.net> and Sam Sexton <Sam.Sexton@reuters.com>.
2007-01-11 21:17:37 +00:00
Ralf Wildenhues
a7454f4e4e * lib/autoconf/general.m4 (_AC_INIT_DEFAULTS): Use newlines to
separate items of `ac_user_opts', to avoid long lines.
(_AC_INIT_PARSE_ENABLE2, _AC_ENABLE_IF_ACTION): Adjust.
2007-01-10 17:59:57 +00:00
Paul Eggert
2a7761f95f * lib/autoconf/general.m4 (AC_DEFINE_TRACE): Don't include
preprocessor macro arguments in traced name.
* doc/autoconf.texi (Defining symbols): Document longstanding
support for AC_DEFINE-ing macros with arguments, and document
behavior when the same variable has multiple AC_DEFINEs.
* lib/autoconf/fortran.m4 (_AC_FC_WRAPPERS): Revert to the
old implementation which AC_DEFINEs the FC_FUNC and FC_FUNC_
macros directly, giving much shorter and simpler code.
2006-12-29 06:44:41 +00:00
Paul Eggert
38a668a9aa * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Insert a
space before "$ac_configure_args" to prevent a 'config.status
--recheck' failure if ac_configure_args doesn't contain a leading
space.  This works around a problem with the XEmacs configure.ac,
which uses the (undocumented) ac_configure_args variable
inconsistently with Autoconf.
2006-12-28 23:20:18 +00:00
Paul Eggert
7bd79987b0 * lib/autoconf/functions.m4 (AC_FUNC_MKTIME):
Include <limits.h>, and use its INT_MAX to rewrite the
j loop so that it does not overflow 'int'.  Problem reported by
Ralf Wildenhues in
<http://lists.gnu.org/archive/html/bug-gnulib/2006-12/msg00084.html>.
Play it safe by shifting left by 1 rather than multiplying by 2,
as GCC is less likely to optimize this away when the value
is signed (when it assumes overflow leads to undefined behavior).
Also, don't assume time_t uses two's complement.
2006-12-22 08:42:17 +00:00
Paul Eggert
4a51103c6c * lib/autoconf/general.m4 (AC_ARG_ENABLE): Print help about
--disable-option-checking to --help output even when
AC_PRESERVE_HELP_ORDER is not used.
(_AC_INIT_PARSE_ENABLE2): Print warnings using actual --enable or
--with argument, rather than argument with [-.] replaced by
underscores.
* NEWS: Fix typo in previous change; the news was in the
wrong section.
2006-12-19 05:41:18 +00:00
Paul Eggert
2d75dbd53e * NEWS: Warnings are now generated by default for unknown
--enable-* and --with-* options.
* doc/autoconf.texi (Option Checking): Renamed from
(Configure Option Checking).  Tighten up the wording a bit.
(External Software, Package Options): Cross-reference to Option
Checking, and use this to shorten our section.
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Prefer test -n
"$x" to test "x$foo" != x.
* lib/autoconf/status.m4 (AC_OUTPUT): Likewise.
Don't warn if $enable_option_checking is "no".
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Initialize
ac_unrecognized_opts to the empty string.
Don't echo the unrecognized opts, as this might mishandle
backslashes or leading -.
(AC_PRESERVE_HELP_ORDER): Put the --disable-option-checking
usage next to the other --disable-FEATURE options in the
help string.

2006-12-18  Steven G. Johnson  <stevenj@alum.mit.edu>

* lib/autoconf/general.m4 (_AC_INIT_DEFAULTS, _AC_INIT_PARSE_ARGS):
(_AC_INIT_PARSE_ENABLE2, _AC_INIT_HELP, _AC_ENABLE_IF):
Print warning for unrecognized --with and --enable options
(AC_DISABLE_OPTION_CHECKING): New macro to disable warnings.
* lib/autoconf/status.m4 (AC_CONFIG_SUBDIRS, _AC_OUTPUT_SUBDIRS):
Disable option checking when subdirs are configured.
(AC_OUTPUT): If warnings are enabled, print warning about
unrecognized --with and --enable options at the end of
the configure output (as well as at the beginning).
* doc/autoconf.texi (Option Checking): New node.
Document new option warning functionality.
2006-12-18 20:10:05 +00:00
Paul Eggert
a152d40158 * lib/autoconf/functions.m4 (AC_FUNC_GETMNTENT):
Define HAVE_GETMNTENT to 1, not to the empty string.
Problem originally reported by Jochen Friedrich in
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=403243>.
2006-12-16 05:38:41 +00:00
Paul Eggert
4f54be9442 (_AC_FC_WRAPPERS): Fix typos in previous patch. 2006-12-15 18:34:20 +00:00
Paul Eggert
6a575d434f This change prompted by a problem report by Andrey Simonenko in
<http://lists.gnu.org/archive/html/bug-autoconf/2006-12/msg00026.html>.
* doc/autoconf.texi (Defining Symbols): AC_DEFINE works for
object-like macros only, in the traditional portable character
set.
* lib/autoconf/general.m4 (AC_DEFINE_TRACE_LITERAL):
Warn about attempts to define things that are not identifiers.
* lib/autoconf/fortran.m4 (_AC_FC_WRAPPERS): Rewrite to avoid
awful hack that AC_DEFINEd macro names containing parentheses.
2006-12-15 18:25:23 +00:00
Paul Eggert
caf889e96e * lib/autoconf/c.m4 (_AC_PROG_CC_C89): Also try -xc99=all, for Sun
C 5.8 on Solaris 10.  Using -xc99=all rather than -xc99 bypasses
the buggy -xc99 option of Forte Developer 7 C on Solaris 9.
2006-12-07 06:39:40 +00:00
Ralf Wildenhues
e6c5fd0d0a * lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Drop the
`CEOF$ac_eof' special marker, the awk script cannot contain a
line matching `^CEOF', so this is not needed any more.
* tests/torture.at (Substitute a newline): Expose the `%!_!# '
special marker in the test.
2006-12-07 05:16:59 +00:00
Stepan Kasal
4f4da8a1a4 * lib/autoconf/general.m4 (_AC_INIT_PARSE_ENABLE): Make it
more readable, using ...
(_AC_INIT_PARSE_ENABLE2): ... this new helper macro.
2006-12-06 21:17:48 +00:00
Ralf Wildenhues
d254f8694e * lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): When
creating the awk substitution script, handle one input line at a
time, so that the maximum length of a substituted (multi-line)
value is not limited by the size of the sed pattern space.
The trade-off is a slightly repetitive sed script.
* doc/autoconf.texi (Limitations of Usual Tools): Branch labels
can only have up to 7 characters, due to Solaris 10 /bin/sed.
* tests/torture.at (Substitute a 2000-byte string): Increase the
test with several long lines, they should not be caught by sed
limits any more.
2006-12-05 21:36:25 +00:00
Ralf Wildenhues
396c94b277 * lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Use `$AWK'
instead of `awk' consistently.
(_AC_OUTPUT_CONFIG_STATUS): Initialize $AWK.
* tests/torture.at (Torturing config.status): Test both the
result of AC_PROG_AWK and plain awk.
(Substitute a 2000-byte string): Likewise.
(Substitute and define special characters): Likewise.
(Substitute a newline): Likewise.
2006-12-05 06:00:42 +00:00
Paul Eggert
f0c325537a * lib/autoconf/functions.m4 (AC_FUNC_FSEEKO): Check that fseeko
can be assigned to a function pointer.  Problem reported by
Peter Palfrader in <http://bugs.debian.org/401377>.  Based on
part of a patch by Ralf Wildenhues in that same bug report.
2006-12-04 23:54:25 +00:00
Paul Eggert
78dc34d5eb * lib/autoconf/c.m4 (AC_LANG_INT_SAVE): Avoid newline, to aid in
cross-compiling from cygwin to mingw.
Reported by Bob Rossi.  This resurrects the 2000-11-30 patch to
aclang.m4, which was mistakenly removed in the 2001-09-17 patch
to lib/autoconf/c.m4.
2006-12-01 19:21:03 +00:00
Paul Eggert
d7884b4e29 * lib/m4sugar/m4sh.m4 (_AS_ECHO_PREPARE): Use a longer test
string for more reliable failure.  Wrap the entire test that
causes the broken Solaris printf to dump core, in a subshell,
so the segmentation fault message is reliably suppressed.
Fix shell expansion errors by using /usr/ucb/echo always;
avoid an error on systems without it by another subshell.
Avoid m4 expansion of `$1'.  Set the zeroth argument of the
subshell-$as_echo to `as_echo', for better error message.
2006-12-01 18:32:34 +00:00
Ralf Wildenhues
4c76be934e * lib/autoconf/general.m4 (_AC_CACHE_DUMP): If `BASH_ARGV' or
`BASH_SOURCE' contain a newline, set them to empty, as they may
not be unset.
2006-11-28 06:20:17 +00:00
Paul Eggert
cd8deae8ca Regenerate. 2006-11-28 03:34:48 +00:00
Paul Eggert
7e86fc26ec Turn AC_FUNC_SETVBUF_REVERSED into a noop. It's been obsolete for
years and is too hard to maintain now.  The last straw was
reported by Jerker Baeck in
<http://lists.gnu.org/archive/html/autoconf/2006-11/msg00102.html>.
* NEWS: AC_FUNC_SETVBUF_REVERSED is now obsolete.
* doc/autoconf.texi (Particular Functions): Move
AC_FUNC_SETVBUF_REVERSED from here...
(Obsolete Macros): ... to here.  Say that it does nothing now.
* lib/autoconf/functions.m4 (AC_FUNC_SETVBUF_REVERSED):
Turn into (almost) a no-op.
2006-11-28 03:29:47 +00:00
Paul Eggert
0cc7da2efc * lib/autoconf/c.m4 (AC_PROG_GCC_TRADITIONAL, AC_C_CONST):
(AC_C_VOLATILE):
Do not recommend via AN_FUNCTION, AN_IDENTIFIER, or AN_HEADER.
These macros are obsolescent and new applications shouldn't need them.
* lib/autoconf/functions.m4 (AC_FUNC_CLOSEDIR_VOID, AC_REPLACE_FNMATCH):
(AC_FUNC_GETLOADAVG, AC_FUNC_GETPGRP, AC_FUNC_MEMCMP):
(AC_FUNC_SELECT_ARGTYPES, AC_FUNC_SETPGRP, AC_FUNC_STAT, AC_FUNC_LSTAT):
(AC_FUNC_STRFTIME, AC_FUNC_SETVBUF_REVERSED, AC_FUNC_UTIME_NULL):
(AC_FUNC_VPRINTF): Likewise.
* lib/autoconf/headers.m4 (AC_HEADER_DIRENT, AC_HEADER_STAT):
(AC_HEADER_STDC, AC_HEADER_SYS_WAIT, AC_HEADER_TIME): Likewise.
* lib/autoconf/types.m4 (AC_STRUCT_TM): Likewise.
2006-11-28 00:26:45 +00:00
Paul Eggert
6c4b6b50d8 Regenerate. 2006-11-27 21:39:32 +00:00
Paul Eggert
a3787fd48a * Makefile.am: Put only a single '#' into the copyright notice,
so that it's also present in the output file.  Standardize wording
in makefile copyright notices to match GNU coding standards.
* bin/Makefile.am: Likewise.
* doc/Makefile.am: Likewise.
* lib/Makefile.am: Likewise.
* lib/freeze.mk: Likewise.
* lib/autoconf/Makefile.am: Likewise.
* lib/autoscan/Makefile.am: Likewise.
* lib/autotest/Makefile.am: Likewise.
* lib/m4sugar/Makefile.am: Likewise.
* man/Makefile.am: Likewise.
* tests/Makefile.am: Likewise.
* lib/emacs/Makefile.am: Remove copyright notice; it's just a
one-line file.
2006-11-27 21:35:37 +00:00
Ralf Wildenhues
e11dbac90f * lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Fix error
in the sed script that mangles the awk script: delete up to the
first exclamation mark only.
* tests/torture.at (Substitute and define special characters):
Test '!' too.
2006-11-27 18:59:43 +00:00
Paul Eggert
6d759252cd 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-26 17:53:10 +00:00
Paul Eggert
ab54e97802 * lib/autotest/general.m4 (AT_INIT): Undo recent changes
that replaced echo with AS_ECHO where this wasn't necessary.
Problem reportd by Ralf Wildenhues.
* lib/m4sugar/m4sh.m4 (_AS_ECHO_PREPARE): Port to Solaris 7,
where "/usr/bin/printf '%s\n' S" dumps core if S is long.
This is Sun bug 4206210.  Problem reportd by Ralf Wildenhues.
2006-11-25 09:57:34 +00:00
Ralf Wildenhues
34b6628f1e * lib/freeze.mk (GREP): Removed, no need to initialize this. 2006-11-24 18:42:24 +00:00
Paul Eggert
1be64afa5b 'echo' has some portability problems, when given a first argument
with a leading '-', or when given any argument containing '\'.
Avoid using 'echo' in these cases.
* bin/Makefile.am $(bin_SCRIPTS): Rewrite to avoid 'echo' entirely.
* lib/autoconf/c.m4 (AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC): Likewise.
* lib/autoconf/fortran.m4 (_AC_PROG_FC): Likewise.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* bin/autoconf.as: Use AS_ECHO rather than plain echo, when the
argument might be unportable.
* lib/autoconf/c.m4 (AC_PROG_CC_C_O): Likewise.
* lib/autoconf/erlang.m4 (AC_LANG(Erlang)): Likewise.
* lib/autoconf/fortran.m4 (_AC_PROG_FC_V_OUTPUT):
(_AC_FC_LIBRARY_LDFLAGS): Likewise.
* lib/autoconf/functions.m4 (AC_FUNC_GETLOADAVG): Likewise.
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ENABLE, _AC_INIT_PREPARE):
(_AC_ARG_VAR_VALIDATE, AC_ARG_PROGRAM, _AC_MSG_LOG_CONFTEST):
(AC_RUN_LOG, _AC_RUN_IFELSE, _AC_LIBOBJS_NORMALIZE): Likewise.
* lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Likewise.
* lib/autoconf/libs.m4 (_AC_PATH_X_DIRECT): Likewise.
* lib/autoconf/programs.m4 (_AC_FEATURE_CHECK_LENGTH):
(AC_PROG_MAKE_SET): Likewise.
* lib/autoconf/status.m4 (_AC_SRCDIRS, _AC_OUTPUT_HEADER):
(_AC_OUTPUT_SUBDIRS, _AC_OUTPUT_CONFIG_STATUS): Likewise.
* lib/autotest/general.m4 (_AT_CREATE_DEBUGGING_SCRIPT, AT_INIT):
(AT_CLEANUP, _AT_DECIDE_TRACEABLE, _AT_CHECK): Likewise.
* lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE, _AS_ECHO_UNQUOTED):
(_AS_BASENAME_SED, _AS_DIRNAME_SED, AS_MKDIR_P, AS_TMPDIR, AS_UNAME):
(AS_TR_SH, AS_TR_CPP, AS_VAR_GET): Likewise.
* bin/autoconf.as: Redo verbose flag implementation, as the old
scheme wouldn't work with AS_ECHO.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/autoconf/general.m4 (AC_MSG_RESULT, AC_MSG_RESULT_UNQUOTED):
Don't use ECHO_T, since ECHO_N is now reliable.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/autoconf/general.m4 (AC_ARG_PROGRAM): Use sed "$script"
rather than using a here-document to put the script into a file.
(_AC_DO_ECHO): Hoist the eval out of the echo, so that we can
use AS_ECHO.
* lib/m4sugar/m4sh.m4 (AS_VAR_GET): Likewise.
* lib/autoconf/programs.m4 (_AC_FEATURE_CHECK_LENGTH): Use
AS_ECHO_N rather than ECHO_N and ECHO_C.  This doesn't fix any
bug, but we might as well stop using ECHO_N and ECHO_C internally.
* lib/autotest/general.m4 (AT_SETUP): Likewise.
* lib/m4sugar/m4sh.m4 (_AS_ECHO_N): Likewise.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS):
(_AC_OUTPUT_MAIN_LOOP): Rework echo so that it has just one
operand, as AS_ECHO requires.  Avoid double file name expansion.
* lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Invoke _AS_ECHO_PREPARE.
Don't set as_nl, since _AS_ECHO_PREPARE does that now.
(_AS_PREPARE): Comment that _AS_ECHO_N_PREPARE is just for user code.
(AS_ECHO, AS_ECHO_N, _AS_ECHO_PREPARE): New macros.
* tests/c.at (AC_PROG_CPP without warnings, AC_PROG_CPP via CC):
Double-quote strings that would otherwise contain M4 comments.
* tests/m4sh.at (AS_ECHO and AS_ECHO_N): New test.
2006-11-17 21:04:54 +00:00
Paul Eggert
7f650f671a * lib/autoconf/general.m4 (_AC_INIT_PARSE_ENABLE): Fix some typos
in previous change, which caused test failures.
2006-11-17 00:37:17 +00:00
Paul Eggert
ac3beb3155 * lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Factor out
code for --enable, --disable, --with, and --without to...
(_AC_INIT_PARSE_ENABLE): ... a new macro.
* doc/autoconf.texi (Package Options):
* NEWS: Document that AC_ARG_ENABLE allows dots, too.
2006-11-17 00:16:27 +00:00
Paul Eggert
0e4acb04cc * NEWS: Document the AC_ARG_WITH change.
2006-11-13  Bruno Haible  <bruno@clisp.org>

* lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): For --with, --without
options, transliterate also dots to underscores.
(_AC_ENABLE_IF): Transliterate also dots to underscores.
* doc/autoconf.texi (External Software): Document that AC_ARG_WITH's
first argument may also contain dots.
2006-11-13 20:40:06 +00:00
Paul Eggert
b8454422fa * lib/autoconf/types.m4 (AC_TYPE_LONG_LONG_INT): Set
ac_cv_type_long_long_int to 'yes' instead of 'cross-compiling'.
Imported from a similar patch to gnulib by Bruno Haible.

2006-11-08  Paul Eggert  <eggert@cs.ucla.edu>
2006-11-08 21:44:32 +00:00