* 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>