* 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>
* doc/install.texi (Particular Systems): For HP-UX, also recommend
-D_XOPEN_SOURCE=500. Needed for the declaration of mbstate_t on
HP-UX 11.11.
Signed-off-by: Eric Blake <ebb9@byu.net>
* doc/autoconf.texi (Number processing Macros)
<m4_version_prereq>: Add documentation.
* NEWS: Mention it.
Reported by Bruno Haible.
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>
* tests/local.at (AC_STATE_SAVE): Avoid ls -1, and use one less
process by hoisting the uniqueness check into sed.
* doc/autoconf.texi (Limitations of Usual Tools) <ls>: Mention
MacOS bug.
Signed-off-by: Eric Blake <ebb9@byu.net>
* tests/local.at (AC_STATE_SAVE): Avoid spurious failures due to
duplicated ls entries.
* THANKS: Update.
Reported by Bruce Dugan and others.
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>
* doc/autoconf.texi (Limitations of Builtins)
(Limitatations of Usual Tools): Add anchors for tools called out
by name. Adjust callers to narrow in on tool of interest.
Signed-off-by: Eric Blake <ebb9@byu.net>
* doc/autoconf.texi (Limitations of Builtins): Move comparison of
quoting styles...
(Balancing Parentheses): ...to this new node.
Suggested by 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>
* tests/local.at (AT_DATA_M4SUGAR, AT_DATA_M4SH)
(AT_DATA_AUTOCONF): Escape all quadrigraphs, not just @&t@. Use
fewer macros.
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>