The DJGPP compiler may create both `a.out' and `a.exe' without -o,
and both `conftest' and `conftest.exe' with `-o conftest', but not
with `-o conftest.exe'.
* lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_O): Also remove
`conftest' without $ac_exeext suffix.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* lib/autoconf/general.m4 (AC_SITE_LOAD, AC_CACHE_LOAD): Do not
load the cache or site file if it is `/dev/null', as DJGPP treats
it as a regular file, but the shell then warns about it later.
Fixes several test suite failures on DJGPP.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* lib/autotest/general.m4 (AT_INIT): Hint at the toplevel log
only if not $at_debug_p. Always hint at the per-test output.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Implement
--config.
* doc/autoconf.texi (config.status Invocation): Document it.
* NEWS: Update.
* tests/torture.at (configure invocation): Test it.
Suggested several times, by several people, in the past.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* lib/autotest/specific.m4 (AT_CHECK_EUNIT): Support older
versions of Erlang/OTP with an erlang:stop() function that doesn't
take arguments.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* lib/autoconf/erlang.m4 (_AC_LANG_NULL_PROGRAM(Erlang)): New.
* lib/autoconf/lang.m4 (AC_LANG_DEFINE): Copy _AC_LANG_NULL_PROGRAM.
(_AC_LANG_NULL_PROGRAM(), _AC_LANG_NULL_PROGRAM): New.
(_AC_COMPILER_EXEEXT_DEFAULT): Print here "whether the xyz compiler works",
before exiting.
(_AC_COMPILER_EXEEXT_WORKS): Merge into _AC_COMPILER_EXEEXT_CROSS, remove
the "whether the xyz compiler works" message, use conftest$ac_cv_exeext
instead of $ac_file.
(_AC_COMPILER_EXEEXT): Try _AC_COMPILER_EXEEXT_DEFAULT using the
null program, and clean conftest.out only after _AC_COMPILER_EXEEXT_CROSS.
(AC_NO_EXECUTABLES): Use _AC_LANG_NULL_PROGRAM.
(_AC_COMPILER_OBJEXT): Use _AC_LANG_NULL_PROGRAM.
* build-aux/update-copyright: New file.
* cfg.mk (gnulib-update): Sync it from gnulib.
(update-copyright-exclude-regexp): New varialbe.
(web-manual): Move...
* maint.mk (web-manual): ...here, to match gnulib.
(update-copyright): New target, copied from gnulib's
maint.mk (it would be nice to sync this file...).
(build_aux): New macro.
(VC_LIST, emit_upload_commands): Use it.
* build-aux/texinfo.tex: Resynchronize from upstream.
* lib/autoconf/general.m4 (_AC_COPYRIGHT_YEARS): Reformat to meet
expected pattern.
* lib/autotest/general.m4 (_AT_COPYRIGHT_YEARS): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/general.m4 (AC_DEFINE_TRACE): Expand macro before
tracing its name.
* lib/autoconf/autoheader.m4 (AH_VERBATIM, AH_TEMPLATE): Likewise,
for using the macro in a template file.
* tests/tools.at (autoheader and macros): New test.
* NEWS: Mention this.
Reported by Bruno Haible.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sh.m4 (AS_EXIT): Always supply an argument to the
shell function, since $? is not reliable on function entry.
(_AS_EXIT_PREPARE): Simplify to assume argument.
Reported by Ralf Wildenhues.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autotest/general.m4 (AT_INIT) <Driver loop>: Turn off notify
mode, since zsh leaves it on after 'emulate sh'.
* doc/autoconf.texi (Limitations of Builtins) <set>: Document that
job control options are not portable.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autotest/general.m4 (at_fn_check_prepare_notrace): Use
$at_trace_echo. Add new REASON argument.
(at_fn_check_prepare_trace): Do not call at_fn_check_prepare_notrace.
Use $at_check_filter_trace.
(at_fn_check_prepare_dynamic): Use at_fn_check_prepare_notrace.
(at_traceon): Initialize to ':'.
(at_traceoff): Remove, use 'set +x' instead throughout.
(at_check_filter_trace, at_trace_echo): New shell variables.
Initialize them if tracing is requested.
(_AT_DECIDE_TRACEABLE): Adjust call to at_fn_check_prepare_notrace.
This patch simplifies at_fn_check_prepare_trace by noting that it
need not call at_fn_check_prepare_notrace. Instead we can make
$at_traceon be ':' or 'set -x' instead of being empty when tracing
is disabled.
A similar approach is used for other variables set by
at_fn_check_prepare_trace and to conditionalize the message
about disabling tracing in at_fn_check_prepare_dynamic.
In addition, I changed $at_traceoff to 'set +x' throughout and
eliminated the variable.
2009-07-12 Paolo Bonzini <bonzini@gnu.org>
* lib/autotest/general.m4 (at_fn_check_prepare_notrace): Use
$at_trace_echo. Add new REASON argument.
(at_fn_check_prepare_trace): Do not call at_fn_check_prepare_notrace.
Use $at_check_filter_trace.
(at_fn_check_prepare_dynamic): Use at_fn_check_prepare_notrace.
(at_traceon): Initialize to ':'.
(at_traceoff): Remove, use 'set -x' instead throughout.
(at_check_filter_trace, at_trace_echo): New shell variables.
Initialize them if tracing is requested.
(_AT_DECIDE_TRACEABLE): Adjust call to at_fn_check_prepare_notrace.
These are lightweight versions of AT_CHECK that automatically
add the equivalent of ! in front of the command and change a
failure exit status to 77 resp. 99. They expand to just
two lines of shell code at the expense of not supporting
tracing (but then so does AT_XFAIL_IF).
2009-07-12 Paolo Bonzini <bonzini@gnu.org>
* NEWS: Mention AT_SKIP_IF and AT_FAIL_IF.
* doc/autoconf.texi (Autotest): Document them.
* lib/autotest/general.m4 (_AT_LINE_ESCAPED, AT_SKIP_IF,
AT_FAIL_IF, _AT_CHECK_EXIT): New.
(AT_CHECK): Use _AT_LINE_ESCAPED.
* tests/autotest.st: Add tests for AT_SKIP_IF and AT_FAIL_IF.
Use AT_SKIP_IF.
* tests/local.st: Use AT_SKIP_IF.
* lib/autotest/general.m4 (AT_INIT) <AT_JOB_FIFO_FD>: Avoid <>;
instead open write descriptor in each group and read descriptor in
main driver.
* tests/autotest.at (AT_SKIP_PARALLEL_TESTS): Relax condition.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autotest/general.m4 (AT_INIT) <driver loop>: Avoid syntax
errors on shells that don't recognize <>.
* tests/autotest.at (AT_SKIP_PARALLEL_TESTS): Also skip parallel
tests for this reason. Skip based on the shell to be tested,
not the shell driving the testsuite.
(parallel syntax error): Rearrange similar to previous patch.
(parallel test execution): Defer skip until after serial tests.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sh.m4 (_AS_ECHO_N_PREPARE): Ensure more than
one character is output with `\c'; reset echo output state
if buggy ksh was detected, and set ECHO_T instead of ECHO_C.
* doc/autoconf.texi (Limitations of Builtins): Document it.
* tests/m4sh.at (ECHO_C): New test.
* THANKS: Update.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_NEW)
(_AC_CHECK_HEADER_OLD): Give up on AU_DEFUN, and manually warn
about obsoletion, to avoid infinite loop in gcc.
Reported by Ralf Wildenhues.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_NEW)
(_AC_CHECK_HEADER_OLD): Provide autoupdate versions, since gcc and
others used these undocumented macros.
Reported by Ralf Wildenhues.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/lang.m4 (_AC_LANG_IO_PROGRAM): New macro, returns
program that creates a file.
(_AC_COMPILER_EXEEXT,_AC_COMPILER_EXEEXT_WORKS): Call new macro
and document why it's needed to robustly detect cross-compiling.
(AC_LANG_DEFINE): Copy implementation across similar languages.
* lib/autoconf/c.m4 (_AC_LANG_IO_PROGRAM(C)): Implement new macro.
* lib/autoconf/fortran.m4 (_AC_LANG_IO_PROGRAM(Fortran 77)):
Likewise.
* lib/autoconf/erlang.m4 (_AC_LANG_IO_PROGRAM(Erlang)): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/fortran.m4 (AC_LANG(Fortran)): Borrow from Fortran
77, which requires reordering portions of the file.
(AC_LANG_PROGRAM(Fortran), AC_LANG_CALL(Fortran)): Now defined
automatically.
Signed-off-by: Eric Blake <ebb9@byu.net>
* doc/autoconf.texi (Environment Variable Index): Add more
entries, particularly for precious variables and known culprit
variables. Needed to avoid overfull vbox.
(Special Shell Variables) <CLICOLOR_FORCE, GREP_OPTIONS>: Add
variables known to cause misbehavior.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Unset variables
known to cause problems.
* THANKS: Update.
Based on reports from Ilya Bobir and Joey Mingrone.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/general.m4 (_AC_RUN_LOG_LIMIT, _AC_DO_LIMIT): New
internal macros, equivalent to _AC_RUN_LOG and _AC_DO, but with
an optional additional argument to limit the number of lines of
stderr output logged, defaulting to 10.
* lib/autoconf/c.m4 (AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC): Use
_AC_DO_LIMIT for capturing compiler version output. Also test
-qversion, for the IBM xlc compiler.
* lib/autoconf/fortran.m4 (_AC_PROG_FC): Likewise.
* THANKS: Update.
Report by Christian Rössel and John R. Cary against Libtool.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* lib/autotest/general.m4 (AT_CHECK): Expand prior to adding
escapes, to avoid shell syntax errors caused by late macro
expansion.
* NEWS: Document this change.
* tests/autotest.at (Metacharacters in command from M4 expansion):
New test.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autotest/general.m4 (AT_CHECK_NOESCAPE): Keep older,
undocumented semantics, where unbalanced " cannot be used in the
stdout/stderr argument.
(AT_CHECK_UNQUOTED): Treat " in stdout/stderr as a literal, since
the text is used in double-quoted context.
* tests/autotest.at (unquoted output): New test.
* doc/autoconf.texi (Writing Testsuites) <AT_CHECK>: Mention which
shell expansions are handled.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/Autom4te/ChannelDefs.pm (Autom4te::ChannelDefs): Set
`ordered' flag to zero for channels `fatal', `automake', and
`verb'. This has currently no effect on actual semantics but
avoids a consistency check needed for Automake's usage of the
Channels.pm code.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* doc/autoconf.texi (config.status Invocation): Fix markup in
synopsis. Use `tag' instead of `file' notation for the
non-option arguments, to be consistent with the documentation
of the AC_CONFIG_* macros.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Likewise,
use `tag' notation for non-option arguments.
Report by John Calcote.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* lib/m4sugar/m4sh.m4 (_AS_IF_ELSE): Don't corrupt $? in else
branch; it is up to the user to avoid syntax errors.
* tests/m4sh.at (AS@&t@_IF and AS@&t@_CASE): Adjust test.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sh.m4 (_AS_CASE, _AS_CASE_DEFAULT, AS_FOR, _AS_IF)
(_AS_IF_ELSE, AS_IF): Avoid syntax error on blank argument,
including a macro with an empty expansion.
* NEWS: Mention this.
* tests/m4sh.at (AS@&t@_IF and AS@&t@_CASE, AS@&t@_FOR): Update
tests.
Reported by Mike Frysinger.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sh.m4 (_AS_CLEAN_DIR): New macro; fixes m4 quoting
in previous patch.
* lib/autotest/general.m4 (AT_INIT) <at_fn_group_prepare>: Use new
macro.
* tests/m4sh.at (_AS@&t@_CLEAN_DIR): New test.
Reported by Ralf Wildenhues.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autotest/general.m4 (AT_INIT) <at_fn_group_prepare>: Only
remove the contents of $at_group_dir, not the directory itself.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autotest/general.m4 (AT_SETUP): Prep AT_ingroup for fallback
use in empty test. Fixes regression introduced 2009-04-06.
(_AT_CHECK): Undo fallback when a test is not empty.
(AT_CLEANUP): Expand AT_ingroup before deleting.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autotest/general.m4 (_AT_DECIDE_TRACEABLE): Handle # in
test correctly. Latent bug in handling shell comment was first
fixed 2008-11-20, but regressed two patches later.
* tests/autotest.at (Shell comment in command): New test.
* NEWS: Document the fix.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autotest/general.m4 (AT_INIT) <at_fn_group_postprocess>:
Guarantee test failure on syntax error, rather than inheriting
status from previous test.
* tests/autotest.at (Syntax error): New test.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Fall back to
bash carriage returns if ac_cr lost \r from ``.
* THANKS: Update.
Suggested by Eric Blake.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sh.m4 (AS_LITERAL_IF): Update a comment that fell
out of date when this function was moved/renamed in 59ecd766.
* THANKS: Update.
Signed-off-by: Allan Caffee <allan.caffee@gmail.com>
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sh.m4 (_AS_ESCAPE): Alter API to take first byte
of set separately from rest.
(AS_ESCAPE, _AS_QUOTE_MODERN, AS_TR_SH, AS_VAR_GET): Adjust
callers.
* lib/autoconf/autoheader.m4 (AH_VERBATIM): Avoid duplicate
characters in translit request.
* doc/autoconf.texi (Common Shell Constructs) <AS_ESCAPE>:
Document the macro.
* NEWS: Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (_m4_stack_reverse): Alter API to avoid
creating larger argument on each iteration.
(m4_stack_foreach_sep, m4_stack_foreach_sep_lifo)
(_m4_set_contents_2): Adjust all four-argument callers.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/programs.m4 (AC_PROG_MKDIR_P): Switch to
AC_DEFUN_ONCE, since this is a one-shot macro.
(AC_PROG_INSTALL): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/headers.m4 (AC_HEADER_ASSERT): Switch to
AC_DEFUN_ONCE, since this is a one-shot macro.
* lib/autoconf/specific.m4 (AC_USE_SYSTEM_EXTENSIONS): Likewise.
* lib/autoconf/general.m4 (AC_CANONICAL_BUILD)
(AC_CANONICAL_HOST, AC_CANONICAL_TARGET): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (m4_defun_once): Avoid redundant blank
line when a defun_once macro is required.
(_m4_defun_once): New helper macro, for less memory use.
* tests/m4sugar.at (m4@&t@_require: nested): Adjust test.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (_m4_defun_pro_outer)
(_m4_defun_epi_outer, _m4_require_call, m4_provide): Track name
that caused a diversion change, not just diversion number.
(m4_require): Factor...
(_m4_require_check): ...into new macro, which also checks whether
diversion that performed the expansion has been collected.
* tests/m4sugar.at (m4@&t@_require: nested): Enhance test.
Reported by Ralf Wildenhues.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/c.m4 (AC_C_RESTRICT): Newer Sun Studio C provides
__restrict__ rather than _Restrict, which still trips up Sun
Studio 12 C++.
* THANKS: Update.
Reported by Rolf Vandevaart.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (m4_copyright_condense): New macro,
undocumented for now.
* lib/m4sugar/Makefile.am (version.m4): Add m4_PACKAGE_YEAR,
m4_PACKAGE_URL.
(RELEASE_YEAR): New macro, copied from bin/Makefile.am.
* lib/autoconf/general.m4 (_AC_COPYRIGHT_YEARS): New macro.
(AC_COPYRIGHT): Add undocumented third parameter.
(_AC_INIT_COPYRIGHT): Avoid need to bump copyright years.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Likewise.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/autoconf/autotest.m4 (AC_CONFIG_TESTDIR): Likewise.
(AT_COPYRIGHT): Add undocumented third parameter.
* tests/local.at (AT_COPYRIGHT): Don't add an extra copyright
parameter; the generic copyright given by autotest is sufficient
since we are the package that owns autotest.
Signed-off-by: Eric Blake <ebb9@byu.net>
* doc/autoconf.texi (Writing Testsuites): Mention autotest
namespace.
(Writing Testsuites) <AT_INIT>: Mention mandatory macros.
(Making testsuite Scripts): Document AT_PACKAGE_URL.
* tests/Makefile.am (package.m4): Follow our own advice.
* lib/autotest/general.m4 (AT_INIT): Give the user a hint about
package.m4. Enhance --help output.
(_AT_COPYRIGHT_YEARS): New macro, to make copyright bump easier.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (m4_defun_once): Rewrite to be no-op,
rather than warning, on second use, and make sure first use never
occurs out of order.
* tests/m4sugar.at (m4@&t@_require: one-shot initialization):
Enhance test.
* tests/base.at (AC_REQUIRE & AC_DEFUN_ONCE: [Require, expand],
(AC_REQUIRE & AC_DEFUN_ONCE: [Expand, require]): Adjust tests.
* NEWS: Document this.
* doc/autoconf.texi (Macro Definitions) <AC_DEFUN>: Mention
AC_DEFUN_ONCE.
(Prerequisite Macros) <AC_REQUIRE>: Likewise.
(Expanded Before Required): Likewise.
(One-Shot Macros) <AC_DEFUN_ONCE>: Document new semantics.
Reported by Bruno Haible, with suggestion by Paolo Bonzini.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/headers.m4 (AC_DIR_HEADER): Explicitly expanding
AC_HEADER_DIRENT no longer triggers a warning, and helps the user
who decides they don't need the obsolete AC_FUNC_CLOSEDIR_VOID.
Reported by Paolo Bonzini.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (m4_provide): Track the diversion in
which a macro was provided.
(m4_require): Compare diversion numbers, rather than m4_require
nesting, when determining direct requires.
* tests/m4sugar.at (m4@&t@_require: nested): Test it.
Reported by Ralf Wildenhues, affecting Libtool.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (m4_provide): Track the set of all macros
provided since last outermost defun.
(_m4_defun_pro_outer): Empty the set.
(_m4_require_call): Distinguish between direct and indirect
requires, and remove required macros from the set.
(m4_require): Check the set, in order to warn.
* tests/m4sugar.at (m4@&t@_require: nested): Remove xfail, and add
test case for direct requires.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (_m4_divert_dump): Change semantics to
always be defined, as either empty or a number.
(_m4_defun_pro_outer, _m4_defun_epi_outer): Treat _m4_divert_dump
as a stack, rather than a one-shot macro.
(_m4_require_call): Expect third argument to be pre-expanded.
(m4_divert_require, m4_require): Adjust clients accordingly.
* lib/m4sugar/m4sh.m4 (AS_REQUIRE): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (_m4_divert_raw, _m4_undivert): New
internal macros, which are easier to trace than m4_builtin.
(m4_cleardivert, m4_divert, m4_divert_push, m4_divert_pop)
(m4_undivert): Use them.
(_m4_require_call): Likewise. Use fewer macros.
* lib/autotest/general.m4 (_AT_DECIDE_TRACEABLE): Fix typo.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/headers.m4 (AC_HEADER_ASSERT): Do not make configure
report "checking whether to enable assertions... no", when they are
in fact enabled. This is solely a bug in the output of configure.
In spite of saying "no", NDEBUG was not defined in that case.
Also, as noted by Eric Blake, leave assertions enabled upon
--enable-assert=INVALID.
* lib/m4sugar/m4sugar.m4 (m4_undefine): Redefine m4_location
inside wrapped text if older m4 is detected.
Reported by William Pursell.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/headers.m4 (AC_HEADER_ASSERT): Honor --enable-assert,
rather than treating it as a synonym for --disable-assert.
* NEWS: Document the fix.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (m4_cleardivert): New macro.
* lib/autotest/general.m4 (AT_INIT): Use it.
* lib/autoconf/general.m4 (_AC_INIT_NOTICE): Likewise.
* tests/m4sugar.at (m4@&t@_divert_stack): Test it.
* doc/autoconf.texi (Diversion support) <m4_cleardivert>: Document
it.
* NEWS: Likewise.
Suggested by Paolo Bonzini.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (m4_expand): Make more robust against
diverted text.
* doc/autoconf.texi (Evaluation Macros) <m4_expand>: Document new
safety check.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autotest/general.m4 (Driver loop): Rewrite signal handler.
Start parallel jobs in their own process group, enabling job
control in the shell if possible, for better signal handling.
Deal with INT, TERM, and HUP in the testsuite driver. In the
parallel driver, propagate TSTP to jobs either as TSTP or as
STOP (to avoid fork bombs with ksh).
Inside the job processes, add PIPE handler to write back the
job token, so the master process does not hang.
Disable the parallel driver if job control is not provided or if
trap does not understand signal names.
* tests/autotest.at (parallel autotest and signals): New test,
exercises INT, TERM, and PIPE, serial and parallel, with and
without `make' in the loop.
Kudos to Richard Stevens for writing APUE.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* lib/m4sugar/m4sh.m4 (_AS_ERROR_PREPARE): New macro, defining a
new shell function.
(AS_ERROR): Use it.
(_AS_LINENO_PREPARE): Break circular dependency.
(AS_PREPARE, _AS_PREPARE): Initialize for child scripts.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autotest/general.m4 (AT_INIT) <at_fn_check_prepare_dynamic>:
Fix typo.
* NEWS: Clarify the potential impact to users.
* tests/autotest.at (AT_DATA_AUTOTEST): New macro, patterned after
AT_DATA_M4SUGAR.
(AT_CHECK_AT_PREP, AT_CHECK_AT_TITLE): Use it.
(unusual file names): Test that the recent echo fix does not
regress. Fix quoting bug that made the test a no-op.
Reported by Paolo Bonzini and Ralf Wildenhues.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sh.m4 (_AS_EXIT_PREPARE): When defaulting, use $?
even if it is 0.
(AS_ERROR): Guarantee non-zero status.
* bin/autoconf.as (exit_missing_arg, getopt): Revert prior change;
we want non-zero status.
* tests/m4sh.at (AS@&t@_EXIT): Update test accordingly.
* doc/autoconf.texi (Common Shell Constructs) <AS_EXIT>: Update
the documentation.
<AS_SET_STATUS>: Don't overly restrict implementation.
(Printing Messages) <AC_MSG_ERROR>: Describe better default.
Suggestions by Paolo Bonzini and Ralf Wildenhues.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autotest/general.m4 (_AT_CHECK): Avoid echo bug if AT_LINE
starts with -. Move preparations...
(AT_INIT) <at_fn_check_prepare_trace>
<at_fn_check_prepare_notrace, at_fn_check_prepare_dynamic>:
...into these new shell functions.
<at_fn_check_newline>: Inline into only caller.
(_AT_DECIDE_TRACEABLE): Use them to condense testsuite size.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autotest/general.m4 (AT_CHECK, AT_CHECK_UNQUOTED): Expand
third and fourth arguments once.
(_AT_CHECK): Don't re-expand expected output. Rearrange code for
fewer scans of arguments.
(AT_CHECK): Update caller.
(AT_INIT) <at_fn_filter_trace>: Drop parameter.
* tests/m4sugar.at (m4@&t@_split): Protect test with
quadrigraphs.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/general.m4 (_AC_DEFINE_Q_PRINT): New macro.
(_AC_DEFINE_Q): Use it to avoid forks for all AC_DEFINE and most
AC_DEFINE_UNQUOTED.
* lib/autoconf/fortran.m4 (_AC_FC_WRAPPERS): Properly quote #.
* tests/torture.at (Substitute and define special characters):
(Define to a 2000-byte string): Enhance tests to cover
AC_DEFINE_UNQUOTED.
(@%:@define header templates): Enhance test to cover #.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (_m4_index): Delete; it is more efficient
to make callers guarantee a match.
(m4_init): Adjust caller.
* lib/autoconf/status.m4 (_AC_CONFIG_COMPUTE_DEST): Likewise.
* lib/autoconf/general.m4 (_AC_DEFINE_Q): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/fortran.m4 (_AC_PROG_FC_G, _AC_PROG_FC_V_OUTPUT):
Match the save/test variables' names to the FFLAGS/FCFLAGS being
saved.
* THANKS: Update.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sh.m4 (_AS_EXIT_PREPARE): Let as_func_exit
parameter be optional.
(AS_EXIT): Use it to make better default.
(_AS_DETECT_BETTER_SHELL): Use new default.
* bin/autoconf.as (exit_missing_arg, getopt): Likewise.
* lib/autoconf/status.m4 (AC_OUTPUT): Likewise.
* tests/m4sh.at (AS@&t@_EXIT): Update test.
* doc/autoconf.texi (Common Shell Constructs) <AS_EXIT>: Mention
new default behavior.
(Limitations of Builtins) <trap>: Adjust to use new default.
* NEWS: Mention the semantic change.
Suggested by Ralf Wildenhues.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sh.m4 (AS_FOR): Handle iteration over $@
properly.
* tests/m4sh.at (AS@&t@_FOR): Enhance test to catch it.
Reported by Paolo Bonzini.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sh.m4 (_AS_VAR_ARITH_PREPARE): Simplify, avoid
unbalanced parentheses from last change.
Spotted by Eric Blake, fix suggested by Paolo Bonzini.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* lib/m4sugar/m4sh.m4 (_AS_VAR_ARITH_PREPARE): Count an exit
status of 1 of expr also as success, to avoid failure if the
computation result is zero. Fixes test failures with IRIX sh,
where the expr variant of as_func_arith is used.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* lib/autoconf/functions.m4 (AC_CHECK_FUNCS): Use new
abstraction for cleaner code.
* lib/autoconf/headers.m4 (AC_CHECK_HEADERS): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sh.m4 (AS_FOR): New macro.
* tests/m4sh.at (AS@&t@_FOR): New test.
Suggested by Paolo Bonzini.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/functions.m4 (AC_CHECK_FUNCS): Avoid forks when
loop only has one argument.
* lib/autoconf/headers.m4 (AC_CHECK_HEADERS): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/autoheader.m4 (AH_VERBATIM): Avoid empty lines.
* lib/autoconf/general.m4 (_AC_INIT_PREPARE, AC_CHECK_FILES):
Likewise.
(_AC_DEFINE_Q): Restore empty line, since some clients in the wild
depend on it.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (_m4_index): New internal macro.
(m4_init): Only use it in older m4.
* lib/autoconf/general.m4 (_AC_DEFINE_Q): Use it to avoid
m4_format bug in older m4.
* lib/autoconf/status.m4 (_AC_CONFIG_COMPUTE_DEST): Likewise.
Reported by Bob Proulx.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/general.m4 (_AC_DEFINE_Q): Use m4_format rather
than m4_bpatsubst to grab string prefix.
* lib/autoconf/status.m4 (_AC_CONFIG_REGISTER)
(_AC_CONFIG_REGISTER_DEST, AC_CONFIG_SUBDIRS): Likewise.
(_AC_FILE_DEPENDENCY_TRACE_COLON): Use m4_translit instead of
m4_bpatsubst to change bytes.
(_AC_CONFIG_DEPENDENCY_DEFAULT): Use m4_index rather than
m4_bmatch to find byte.
(_AC_CONFIG_COMPUTE_DEST): New helper macro.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/status.m4 (_AC_CONFIG_FOOS, AC_CONFIG_SUBDIRS): Use
m4_map_args_w.
(_AC_OUTPUT_FILE): Use m4_map_args_sep and m4_map_args.
(_AC_OUTPUT_FILE_ADJUST_DIR): New helper macro.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/general.m4 (AC_CHECK_FILES): Use m4_map_args_w,
and avoid typo.
(AC_CHECK_DECLS, AC_CHECK_DECLS_ONCE): Use m4_map_args_sep.
(_AC_CHECK_FILES, _AC_CHECK_DECLS, _AC_CHECK_DECL_ONCE): New
helper macros.
(AC_LIBSOURCES): Use m4_map_args.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/types.m4 (AC_CHECK_TYPES, AC_CHECK_MEMBERS): Use
m4_map_args_sep.
(_AC_CHECK_TYPES, _AC_CHECK_MEMBERS): New helper macros.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/headers.m4 (AH_CHECK_HEADERS)
(AH_CHECK_HEADERS_DIRENT): Rename...
(_AH_CHECK_HEADER, _AH_CHECK_HEADER_DIRENT): ...and take only one
argument, rather than a list.
(AC_CHECK_HEADERS, AC_CHECK_HEADERS_ONCE):
Adjust callers to use m4_map_args_w.
(AC_HEADER_DIRENT): Adjust caller to use m4_map_args.
(_AC_CHECK_HEADER_ONCE): New helper macro.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/functions.m4 (_AH_CHECK_FUNCS): Rename...
(_AH_CHECK_FUNC): ...and take only one argument, rather than a
list.
(AC_CHECK_FUNCS, AC_CHECK_FUNCS_ONCE): Adjust callers to use
m4_map_args_w.
(_AC_CHECK_FUNC_ONCE): New helper macro.
(AC_REPLACE_FUNCS): Use m4_map_args_w.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sh.m4 (_AS_ECHO_PREPARE): Cater to Solaris ksh.
* doc/autoconf.texi (Limitations of Builtins) <printf>: Document
the print workaround.
Idea by Paolo Bonzini.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/autoconf/general.m4 (_AC_RUN_LOG_STDERR): Avoid grep/rm/cat
sequence when the program's stderr was empty, while providing a
conftest.err file even in that case.
(_AC_CACHE_DUMP): Fix mismatched parenthesis.
* NEWS: Document it.
* doc/autoconf.texi (Present But Cannot Be Compiled): Document it.
* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL): Implement it
and adjust warning.
* tests/semantics.at (AC_CHECK_HEADERS): Test new semantics.
* lib/m4sugar/m4sugar.m4 (m4_map_args_w): New macro, undocumented
for now.
(_m4_split): Allow user control over separator.
(m4_split): Adjust caller.
(m4_foreach_w, m4_append_uniq_w, _m4_text_wrap): Rewrite to use
m4_map_args_w.
* tests/m4sugar.at (m4@&t@_append): Augment test keywords.
(M4 loops): Test new interface.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/foreach.m4 (m4_dquote_elt, m4_join, m4_joinall)
(_m4_minmax, m4_set_add_all): Use _m4_foreach instead of
m4_foreach.
* lib/m4sugar/m4sugar.m4 (_m4_joinall): Use m4_map_args_sep
instead of m4_foreach or m4_map_args.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (m4_map_args_sep): New macro.
(_m4_map): Change API to cover more of m4_map*.
* lib/m4sugar/foreach.m4 (_m4_map): Adjust to new API.
(m4_map_args): Delete.
* tests/m4sugar.at (m4@&t@_map_args and m4@&t@_curry): Enhance
test.
Signed-off-by: Eric Blake <ebb9@byu.net>
* lib/m4sugar/m4sugar.m4 (_m4_for): Alter API to make it easier to
avoid m4_define by some clients.
(m4_for): Adjust caller.
* lib/m4sugar/foreach.m4 (_m4_foreach, m4_case, m4_bmatch)
(_m4_cond, _m4_bpatsubsts, _m4_shiftn, m4_do, m4_reverse)
(_m4_map, m4_map_args, m4_map_args_pair, _m4_list_pad)
(_m4_list_cmp): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>