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.
* 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.
* 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.
(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.
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.
* 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".
":;{" 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.
* man/Makefile.am (.x.1): Now that scripts in bin/ and tests/
are guaranteed to be built, remove the rules that tried to build
them. Before, with a parallel build, these rules could lead to
two processes writing tests/wrapper.in concurrently.
* tests/torture.at (Configuring subdirectories, Deep Package):
In the --help* tests in read-only trees, make `.' temporarily
writable again for the `stderr' file, and ignore errors due to
the attempt to write configure.lineno.
Report by Patrick Welche.
* tests/Makefile.am (package.m4): Adjust target.
Don't redirect directly to $@.
(CLEANFILES): Add package.m4.
($(TESTSUITE)): Depend on just-built package.m4, not the one
in $(srcdir).
When running $(AUTOTEST), search "." before searching $(srcdir).
* tests/Makefile.am (distclean-generic): Replace the default,
automake-provided rule with an identical one, but with an additional
dependency on distclean-local. Simply adding the dependency would
cause automake not to emit the rule at all.
* BUGS: Building with -jN works, now.
* 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>
* doc/autoconf.texi (Making testsuite Scripts): It is not necessary,
when using Automake, to write a rule to produce atlocal, since it's
an AC_CONFIG_FILES. Mention that atlocal.in needs to be
distributed, not atconfig.in.
Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
* doc/autoconf.texi (Limitations of Builtins): Mention that GNU
Bash doesn't properly set $? when `{ ... } >/bad' fails, and give
workaround.
Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Signed-off-by: Eric Blake <ebb9@byu.net>