Commit Graph

2794 Commits

Author SHA1 Message Date
Eric Blake
6b22fb3155 Quote result of m4_toupper and m4_tolower.
* lib/m4sugar/m4sugar.m4 (m4_tolower, m4_toupper): Quote result.
* lib/autotest/general.m4 (AT_KEYWORDS): Adjust caller.
* tests/m4sugar.at (m4@&t@_toupper and m4@&t@_tolower): New test.
* NEWS: Document this.
* THANKS: Update.
Reported by Sam Steingold.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-09-14 13:05:46 -06:00
Ralf Wildenhues
ceff70a258 DJGPP fix: remove both conftest and conftest.exe.
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>
2009-09-14 19:33:57 +02:00
Ralf Wildenhues
d9226f650c DJGPP fix: do not try to source /dev/null as cache or site file.
* 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>
2009-09-14 19:32:55 +02:00
Ralf Wildenhues
b4113eba0c Improve autotest testsuite summary message.
* 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>
2009-09-13 10:05:10 +02:00
Ralf Wildenhues
bb09823ea7 New config.status option --config.
* 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>
2009-09-11 06:53:42 +02:00
Ralf Wildenhues
675a0c95df Update License to GPLv3+ including new Autoconf Exception.
* NEWS, README: Update licensing information.
* COPYING.EXCEPTION: New file.
* Makefile.am (EXTRA_DIST): Distribute it.
* cfg.mk (autom4te-update): Remove copyright change warning.
* lib/autoconf/autoconf.m4, lib/autoconf/autoheader.m4,
lib/autoconf/autoscan.m4, lib/autoconf/autotest.m4,
lib/autoconf/autoupdate.m4, lib/autoconf/c.m4,
lib/autoconf/erlang.m4, lib/autoconf/fortran.m4,
lib/autoconf/functions.m4, lib/autoconf/general.m4,
lib/autoconf/headers.m4, lib/autoconf/lang.m4,
lib/autoconf/libs.m4, lib/autoconf/oldnames.m4,
lib/autoconf/programs.m4, lib/autoconf/specific.m4,
lib/autoconf/status.m4, lib/autoconf/types.m4,
lib/autotest/autotest.m4, lib/autotest/general.m4,
lib/autotest/specific.m4, lib/m4sugar/foreach.m4,
lib/m4sugar/m4sh.m4, lib/m4sugar/m4sugar.m4: Update exception
statement, bump to GPLv3.
* bin/autoconf.as, bin/autoheader.in, bin/autom4te.in,
bin/autoreconf.in, bin/autoscan.in, bin/autoupdate.in,
bin/ifnames.in: Bump to GPLv3+, adjust --version output
to reflect the GPLv3+ and the Autoconf Exception.
* lib/Autom4te/C4che.pm, lib/Autom4te/ChannelDefs.pm,
lib/Autom4te/General.pm, lib/Autom4te/Request.pm,
lib/autom4te.in, lib/autoscan/autoscan.pre,
lib/emacs/autoconf-mode.el, lib/emacs/autotest-mode.el,
lib/freeze.mk, tests/atlocal.in, tests/autoscan.at,
tests/autotest.at, tests/base.at, tests/c.at,
tests/compile.at, tests/erlang.at, tests/foreign.at,
tests/fortran.at, tests/local.at, tests/m4sh.at,
tests/m4sugar.at, tests/mktests.sh, tests/semantics.at,
tests/statesave.m4, tests/suite.at, tests/tools.at,
tests/torture.at, tests/wrapper.as: Bump to GPLv3+.
2009-09-09 19:53:31 +02:00
Thomas Jahns
1fbc0eb114 Fix illegal tab character in Fortran source.
* lib/autoconf/fortran.m4 (AC_FC_SRCEXT): Change TAB back to
multiple spaces; regression introduced 2008-10-23.
* NEWS: Mention this.
* THANKS: Update.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-09-04 05:38:29 -06:00
Romain Lenglet
206564ac3e Fix AT_CHECK_EUNIT for versions of Erlang/OTP without init:stop/1.
* 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>
2009-08-22 10:49:19 +02:00
Ralf Wildenhues
62c0ca770a Fix build dependencies for Erlang macro files.
* lib/freeze.mk (autotest_m4f_dependencies): Add
$(src_libdir)/autotest/specific.m4.
* tests/Makefile.am (AUTOCONF_FILES): Add erlang.m4.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-08-22 10:43:51 +02:00
Paolo Bonzini
5c36d61f64 use a separate program to test whether the compiler works
* 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.
2009-08-19 15:01:39 +02:00
Eric Blake
4cdf58d4f0 Simplify version control metadata.
* .cvsignore: Delete.
* bin/.cvsignore: Likewise.
* config/.cvsignore: Likewise.
* doc/.cvsignore: Likewise.
* lib/.cvsignore: Likewise.
* lib/autoconf/.cvsignore: Likewise.
* lib/Autom4te/.cvsignore: Likewise.
* lib/autoscan/.cvsignore: Likewise.
* lib/autotest/.cvsignore: Likewise.
* lib/emacs/.cvsignore: Likewise.
* lib/m4sugar/.cvsignore: Likewise.
* man/.cvsignore: Likewise.
* tests/.cvsignore: Likewise.
* bin/.gitignore: Likewise.
* build-aux/.gitignore: Likewise.
* config/.gitignore: Likewise.
* doc/.gitignore: Likewise.
* lib/.gitignore: Likewise.
* lib/autoconf/.gitignore: Likewise.
* lib/Autom4te/.gitignore: Likewise.
* lib/autoscan/.gitignore: Likewise.
* lib/autotest/.gitignore: Likewise.
* lib/emacs/.gitignore: Likewise.
* lib/m4sugar/.gitignore: Likewise.
* man/.gitignore: Likewise.
* tests/.gitignore: Likewise.
* .gitignore: Consolidate all rules into one file.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-08-17 06:50:43 -06:00
Eric Blake
ac272f28c0 Normalize remaining copyright lines.
* BUGS: Reformat copyright line, using UPDATE_COPYRIGHT_FORCE.
* NEWS: Likewise.
* README-hacking: Likewise.
* TODO: Likewise.
* lib/Autom4te/ChannelDefs.pm: Likewise.
* lib/autoconf/fortran.m4: Likewise.
* lib/autoconf/general.m4: Likewise.
* lib/autoconf/lang.m4: Likewise.
* lib/autotest/general.m4: Likewise.
* maint.mk: Likewise.
* tests/compile.at: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-08-17 06:50:39 -06:00
Eric Blake
ff00dd00ea Improve copyright updating.
* build-aux/update-copyright: Resynchronize from upstream.
* maint.mk (update-copyright): Simplify based on gnulib.
(update-copyright-env): New variable.
* cfg.mk (update-copyright-exclude-regexp): Delete.
(update-copyright-env): New override.
* .x-update-copyright: New file.
* lib/Autom4te/Makefile.am: Add copyright.
* lib/Autom4te/Channels.pm: Revert copyright update to upstream
file.
* lib/Autom4te/Configure_ac.pm: Likewise.
* lib/Autom4te/FileUtils.pm: Likewise.
* lib/Autom4te/Struct.pm: Likewise.
* lib/Autom4te/XFile.pm: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-08-17 06:50:32 -06:00
Eric Blake
1c69422d88 Update copyright.
* AUTHORS: Include 2009 in copyright.
* lib/Autom4te/C4che.pm: Likewise.
* lib/Autom4te/Channels.pm: Likewise.
* lib/Autom4te/Configure_ac.pm: Likewise.
* lib/Autom4te/FileUtils.pm: Likewise.
* lib/Autom4te/General.pm: Likewise.
* lib/Autom4te/Request.pm: Likewise.
* lib/Autom4te/Struct.pm: Likewise.
* lib/autoconf/Makefile.am: Likewise.
* lib/autoconf/autoconf.m4: Likewise.
* lib/autoconf/autoscan.m4: Likewise.
* lib/autoconf/autoupdate.m4: Likewise.
* lib/autoconf/functions.m4: Likewise.
* lib/autoconf/libs.m4: Likewise.
* lib/autoconf/oldnames.m4: Likewise.
* lib/autoconf/types.m4: Likewise.
* lib/autoscan/Makefile.am: Likewise.
* lib/autoscan/autoscan.pre: Likewise.
* lib/autotest/Makefile.am: Likewise.
* lib/autotest/autotest.m4: Likewise.
* lib/emacs/autoconf-mode.el: Likewise.
* lib/emacs/autotest-mode.el: Likewise.
* lib/freeze.mk: Likewise.
* lib/m4sugar/foreach.m4: Likewise.
* man/Makefile.am: Likewise.
* tests/atlocal.in: Likewise.
* tests/autoscan.at: Likewise.
* tests/foreign.at: Likewise.
* tests/fortran.at: Likewise.
* tests/mktests.sh: Likewise.
* tests/semantics.at: Likewise.
* tests/suite.at: Likewise.
* tests/wrapper.as: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-08-14 07:31:43 -06:00
Eric Blake
f2b17001ac Prepare to bulk update copyright years.
* 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>
2009-08-14 07:23:24 -06:00
Paolo Bonzini
c6a777c434 Fix description of the macro generated by AC_CHECK_MEMBERS.
* lib/autoconf/types.m4 (_AC_CHECK_MEMBERS): Fix regex
replacement.  Reported by Bruno Haible.
2009-08-10 20:01:52 +02:00
Romain Lenglet
95af4dabfa Make AC_RUN_IFELSE fail for Erlang if the program doesn't compile.
* lib/autoconf/erlang.m4 (AC_LANG(Erlang)): Make AC_RUN_IFELSE
fail if the test module doesn't compile.
2009-08-07 17:47:29 +02:00
Romain Lenglet
dab22fbfe1 add AT_CHECK_EUNIT autotest macro
* lib/autotest/specific.m4: New file.
* lib/autotest/Makefile.am (dist_autotestlib_DATA): Add specific.m4.
* lib/autoconf/autotest.m4 (AC_CONFIG_TESTDIR): Add definitions of
variables used by AT_CHECK_EUNIT macro: ERL, ERLC, ERLCFLAGS.
* tests/autotest.at (Erlang Eunit unit tests): Add test for macro
AT_CHECK_EUNIT.
* doc/autoconf.texi (Writing Testsuites): Document macro AT_CHECK_EUNIT.
* NEWS: Mention macro AT_CHECK_EUNIT.
2009-08-02 08:20:57 +02:00
Paolo Bonzini
a19e829e67 Add back AH_CHECK_HEADERS.
* lib/autoconf/general.m4 (AH_CHECK_HEADERS): New.
* NEWS: Add new section.
2009-07-30 22:41:43 +02:00
Eric Blake
32440e1605 Recognize new m4sugar keywords.
* lib/emacs/autoconf-mode.el (autoconf-current-defun): Recognize
m4_define_default, m4_defun_init, m4_defun_once.
(autoconf-font-lock-keywords):  Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-07-25 20:56:52 -06:00
Eric Blake
77350bd98c Let autoheader see through m4 macros in AC_DEFINE.
* 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>
2009-07-25 06:00:38 -06:00
Eric Blake
3171783adb Fix AS_EXIT for FreeBSD sh.
* 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>
2009-07-24 19:00:49 -06:00
Romain Lenglet
8f3729e1a5 Clean up temporary files generated by Erlang macros.
* lib/autoconf/erlang.m4 (AC_ERLANG_CHECK_LIB)
(AC_ERLANG_SUBST_ROOT_DIR, AC_ERLANG_SUBST_LIB_DIR)
(AC_ERLANG_SUBST_ERTS_VER): Delete conftest.out; renamed
erlang_cv_* cache variables into ac_cv_erlang_*.
* lib/autoconf/general.m4 (AC_RUN_IFELSE): Delete conftest.beam
files generated by Erlang compiler.
* tests/local.at (AT_CHECK_ENV): Ignore variables defined by
Erlang macros.
* tests/erlang.at (AT_SETUP_ERLANG): Delete; replace all uses by
AT_CHECK_MACRO.
* tests/Makefile.am (AUTOCONF_FILES): Revert previous addition of
generated Erlang tests; they are all hand-tested.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-07-23 20:37:58 -06:00
Eric Blake
d8db042ad0 Disable asynchronous job notification for parallel tests.
* 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>
2009-07-13 22:19:15 -06:00
Paolo Bonzini
ac0fd199f9 introduce AT_SKIP_IF and AT_FAIL_IF
* 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.
2009-07-13 21:46:08 +02:00
Eric Blake
81abbb1137 Fix previous patch.
* lib/autotest/general.m4 (at_fn_check_prepare_notrace): Use
proper m4 quoting.
(_AT_DECIDE_TRACEABLE): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-07-13 12:55:54 -06:00
Paolo Bonzini
b22c5fde55 Simplify handling of autotest tracing
* 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.
2009-07-13 14:16:15 +02:00
Paolo Bonzini
877876da7c revert previous push 2009-07-13 13:39:25 +02:00
Paolo Bonzini
48e64006ce Simplify handling of autotest tracing
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.
2009-07-12 20:12:14 +02:00
Paolo Bonzini
967cf4d282 introduce AT_SKIP_IF and AT_FAIL_IF
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.
2009-07-12 16:31:14 +02:00
Eric Blake
26f07a3351 Make parallel testsuite more portable.
* 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>
2009-07-07 22:42:50 -06:00
Eric Blake
1ba58ec955 Avoid syntax error in ash.
* 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>
2009-07-03 06:42:30 -06:00
Jan Madzik
06aeca6abe Avoid AIX 6.1 ksh88 ECHO_C command substitution bug.
* 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>
2009-06-30 20:48:59 +02:00
Eric Blake
01660aaecc Fix AC_CHECK_HEADER infloop for gcc.
* 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>
2009-06-17 06:27:45 -06:00
Eric Blake
ba32f02aed Add m4_copy_force, m4_rename_force.
* lib/m4sugar/m4sugar.m4 (m4_copy_force, m4_rename_force): New
macros.
* tests/m4sugar.at (m4@&t@_defn): Test them.
* doc/autoconf.texi (Redefined M4 Macros) <m4_copy>: Document
them.
* NEWS: Likewise.
Suggested by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-06-15 06:59:03 -06:00
Eric Blake
a5a584d9e8 Reinstate _AC_CHECK_HEADER_OLD for gcc.
* 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>
2009-06-15 06:59:00 -06:00
Steven G. Johnson
ca47306861 Create a file in test program when detecting cross-compilation.
* 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>
2009-06-11 07:07:32 -06:00
Eric Blake
14c613a6c9 Simplify AC_LANG(Fortran).
* 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>
2009-06-11 06:59:57 -06:00
Jim Meyering
73d519a40a Improve testsuite's --help output.
* lib/autotest/general.m4: Correct the example in ./testsuite --help.
Improve wording.
2009-06-06 21:26:09 +02:00
Romain Lenglet
9e380c5ada New AC_ERLANG_SUBST_ERTS_VER macro.
* lib/autoconf/erlang.m4: Add macro AC_ERLANG_SUBST_ERTS_VER.
* doc/autoconf.texi (Erlang Libraries): Document
AC_ERLANG_SUBST_ERTS_VER.
* NEWS: Likewise.
* AUTHORS: Update Romain Lenglet's email address.
* THANKS: Update.
Suggested by Ruslan Babayev.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-05-28 06:19:57 -06:00
Eric Blake
5f19cfb878 Sanitize more problematic environment variables.
* 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>
2009-05-26 06:49:41 -06:00
Patrick Welche
80e62691c9 Also try X11R7 when looking for X11 files, for NetBSD.
* lib/autoconf/libs.m4 (_AC_PATH_X_DIRECT): Also try directories
with X11R7 in the name.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-05-11 20:34:09 +02:00
Ralf Wildenhues
b26d51caf9 Limit stderr logging for C compiler version.
* 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>
2009-05-01 10:58:58 +02:00
Eric Blake
3bec0c1d32 Fix quoting of m4 macros in AT_CHECK.
* 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>
2009-04-24 13:15:31 -06:00
Eric Blake
5da9f24d55 Make AT_CHECK_UNQUOTED more like AC_DEFINE_UNQUOTED.
* 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>
2009-04-24 13:15:25 -06:00
Eric Blake
bcb6b3180d Rename AT_CHECK_NOESCAPE to AT_CHECK_UNQUOTED.
* lib/autotest/general.m4 (AT_CHECK_NOESCAPE): Deprecate, in favor
of new spelling...
(AT_CHECK_UNQUOTED): ...for consistency with AC_DEFINE_UNQUOTED.
* doc/autoconf.texi (Writing Testsuites) <AT_CHECK>: Document the
rename.
* NEWS: Likewise.
* tests/autotest.at (Binary output, Cleanup): Adjust tests.
* tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
Likewise.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-04-24 13:15:22 -06:00
Eric Blake
46e87ded26 Add m4_argn.
* lib/m4sugar/m4sugar.m4 (m4_argn): New macro.
* NEWS: Document it.
* doc/autoconf.texi (Looping constructs) <m4_argn>: Likewise.
<m4_car, m4_cdr>: Improve documentation.
* tests/m4sugar.at (m4 lists): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-04-22 20:51:28 -06:00
Ralf Wildenhues
e430ff0ca6 Sync autom4te perl modules from Automake.
* lib/Autom4te/Channels.pm: Sync from Automake.
* lib/Autom4te/FileUtils.pm: Likewise.
* lib/Autom4te/XFile.pm: Likewise.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-04-19 12:54:45 +02:00
Ralf Wildenhues
737b9ddc1b Adjust channel definitions for new Automake `ordered' flag.
* 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>
2009-04-19 12:48:19 +02:00
Ralf Wildenhues
e7c7a4735f Improve and clarify `config.status' usage documentation.
* 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>
2009-04-19 01:12:43 +02:00
Eric Blake
c241057ad4 Add stdout-nolog and ignore-nolog to AT_CHECK.
* lib/autotest/general.m4 (AT_DIFF_STDERR(stderr-nolog))
(AT_DIFF_STDERR(ignore-nolog), AT_DIFF_STDOUT(stdout-nolog))
(AT_DIFF_STDOUT(ignore-nolog)): New macros.
* tests/autotest.at (Logging): New test.
* doc/autoconf.texi (Writing Testsuites) <AT_CHECK>: Document the
new logging actions.
* NEWS: Likewise.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-04-15 06:00:56 -06:00
Eric Blake
e8f34dca8c Teach AT_CHECK about hard failures.
* lib/autotest/general.m4 (AT_INIT) <at_fn_check_skip>
<at_fn_check_status, at_fn_group_postprocess>: Handle hard
failures.
* doc/autoconf.texi (Writing Testsuites) <AT_CHECK>: Document
AT_CHECK_NOESCAPE and exit status 99.
* NEWS: Likewise.
* tests/autotest.at (Hard fail, Cleanup): New tests.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-04-15 06:00:24 -06:00
Eric Blake
bc79643383 Fix yesterday's regression in AS_IF.
* 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>
2009-04-14 19:26:29 -06:00
Ralf Wildenhues
63d463427f Add traces for AM_SILENT_RULES.
* lib/autom4te.in (Automake-preselections): Trace
AM_SILENT_RULES.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-04-14 22:17:35 +02:00
Eric Blake
52b83b8c37 Make AS_IF, AS_CASE, and AS_FOR more robust to blank arguments.
* 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>
2009-04-13 13:15:34 -06:00
Eric Blake
723c9e5c0f Add m4_blank and friends.
* lib/m4sugar/m4sugar.m4 (m4_blank, m4_nblank, m4_default_nblank)
(m4_default_nblank_quoted): New macros.
* NEWS: Document them.
* doc/autoconf.texi (Conditional constructs): Likewise.
* tests/m4sugar.at (m4sugar shorthand conditionals): New test.
Suggested by Mike Frysinger.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-04-13 13:15:32 -06:00
Eric Blake
ef8940d9b5 Add undocumented _AS_CLEAN_DIR.
* 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>
2009-04-10 06:26:33 -06:00
Eric Blake
1c34e5113f Avoid problems caused by deleting in-use directory.
* 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>
2009-04-09 17:40:17 -06:00
Eric Blake
bd671cbd57 Fix regression in empty test.
* 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>
2009-04-09 17:40:15 -06:00
Paolo Bonzini
fc5c85a6b2 Make a less conservative cross-compilation guess for AC_FUNC_UTIME_NULL.
* lib/autoconf/functions.m4 (AC_FUNC_UTIME_NULL): Assume
not crosscompiling to an obsolete system.
2009-04-09 23:14:27 +02:00
Ralf Wildenhues
34163e58d4 Automake relies on the undocumented `_AC_COMPILER_EXEEXT' macro.
* lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT): Document that
Automake relies on this macro.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-04-09 00:00:30 +02:00
Eric Blake
c283f62edb Handle shell comments in AT_CHECK.
* 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>
2009-04-06 20:52:44 -06:00
Eric Blake
57e6f69b99 Hard fail any test with syntax errors.
* 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>
2009-04-06 20:52:41 -06:00
Andris Pavenis
bc9bc82a1e Fix awk substitution of carriage returns on DJGPP.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Fix typo in
generation of ac_cs_awk_cr.
* THANKS: Update.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-03-24 06:47:09 -06:00
Aaron W. LaFramboise
60e637d68f Work around cygwin bash igncr mode.
* 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>
2009-03-24 06:40:23 -06:00
Jim Meyering
8a54ca8043 Manual: fix a typo.
* lib/m4sugar/m4sh.m4: s/are/is/ => "there is no indirection"
2009-03-17 21:59:14 +01:00
Allan Caffee
286c51ccf3 Fix a typo in comment for AS_LITERAL_IF.
* 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>
2009-03-02 11:13:25 -07:00
Eric Blake
ba524e662f Improve wording for AS_ESCAPE.
* doc/autoconf.texi (Common Shell Constructs) <AS_ESCAPE>: Touch
up documentation.
* lib/m4sugar/m4sh.m4 (_AS_ESCAPE): Fix comment typos.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-03-02 11:12:16 -07:00
Eric Blake
b35598a688 Use pkgdatadir consistently.
* bin/Makefile.am (edit): Substitute pkgdatadir, not datadir.
* lib/Makefile.am (edit): Likewise.
* lib/autom4te.in (Autoconf-without-aclocal-m4, Autotest, M4sh)
(M4sugar): Use @pkgdatadir@, not @datadir@.
* bin/autoheader.in ($datadir): Likewise.
* bin/autom4te.in ($datadir): Likewise.
* bin/autoreconf.in ($datadir): Likewise.
* bin/autoscan.in ($datadir): Likewise.
* bin/autoupdate.in ($datadir): Likewise.
* bin/ifnames.in ($datadir): Likewise.
* doc/autoconf.texi (Installation Directory Variables): Update
example to be consistent; focus on $(bindir) as an autoconf
variable, and mention that $(pkgdatadir) comes from automake.
Reported by Reuben Thomas.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-02-24 09:38:01 -07:00
Eric Blake
4da1abd28b Use m4_translit more efficiently in AS_ESCAPE.
* 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>
2009-02-19 14:32:36 -07:00
Eric Blake
be5eef442d Fix m4_set speed regression introduced 2008-12-18.
* 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>
2009-02-12 08:27:18 -07:00
Eric Blake
cfb18d385b Use AC_DEFUN_ONCE for some one-shot AC_PROG macros.
* 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>
2009-02-03 09:37:53 -07:00
Eric Blake
f8fcfad146 Use AC_DEFUN_ONCE for uncontroversial one-shot macros.
* 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>
2009-01-28 17:04:52 -07:00
Eric Blake
876b3fbfdd Reduce blank lines in AC_DEFUN_ONCE macros.
* 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>
2009-01-28 17:04:43 -07:00
Eric Blake
9c4c7c5ca4 Silence another false positive expand-before-require.
* 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>
2009-01-28 15:08:11 -07:00
Eric Blake
aa30765d64 Fix AC_C_RESTRICT for Sun Studio 12 C++.
* 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>
2009-01-28 09:59:24 -07:00
Eric Blake
65c175502a Fix years in copyright notices.
* 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>
2009-01-28 06:12:52 -07:00
Eric Blake
758f763ddf Use URLs in --help output, part 3: testsuite.
* 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>
2009-01-27 16:58:21 -07:00
Eric Blake
d7cc80491d Use URLs in --help output, part 2: configure.
* lib/autoconf/general.m4 (_AC_INIT_COPYRIGHT): Bump copyright
date.
(_AC_INIT_PACKAGE): Support optional URL parameter, mapped to
AC_PACKAGE_URL.
(_AC_INIT_DEFAULTS, _AC_INIT_PREPARE): Substitute it.
(_AC_INIT_HELP): Use it in './configure --help' output.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Likewise, for
'./config.status --help'.  Bump copyright date.
* doc/autoconf.texi (Initializing configure) <AC_INIT>: Document
new parameter.
* NEWS: Likewise.
* tests/tools.at (autoheader): Adjust test.
* tests/torture.at (@%:@define header templates)
(Torturing config.status): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-01-27 16:57:52 -07:00
Eric Blake
9f32bcf860 Improve AC_DEFUN_ONCE semantics.
* 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>
2009-01-26 09:55:57 -07:00
Eric Blake
2cc17c497c Fix typos in recent patches.
* lib/m4sugar/m4sugar.m4: Improve m4_defun comments.
* doc/autoconf.texi (Expanded Before Required): Fix typos.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-01-24 06:33:41 -07:00
Eric Blake
3c75e4549b Revert change to AC_DIR_HEADER.
* 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>
2009-01-24 06:16:48 -07:00
Eric Blake
76b444921d Silence a false positive expand-before-require case.
* 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>
2009-01-22 08:08:06 -07:00
Eric Blake
46009205a9 Fix out-of-order expansion with expand-before-require.
* lib/m4sugar/m4sugar.m4 (m4_require): Redundantly expand a
required macro when issuing expand-before-require warning.
* doc/autoconf.texi (Prerequisite Macros): Adjust documentation.
(Expanded Before Required): New node.
* tests/m4sugar.at (m4@&t@_require: nested): Adjust test.
* NEWS: Mention this fix.
Suggested by Bruno Haible.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-01-21 08:57:42 -07:00
Eric Blake
cf7d7f2e82 Warn if macro is provided before indirectly required.
* 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>
2009-01-21 08:39:47 -07:00
Eric Blake
b1ba5448b6 Clean up some bugs caught by preliminary dependency validation.
* lib/autoconf/headers.m4 (AC_DIR_HEADER): Don't invoke
AC_HEADER_DIRENT, since AC_FUNC_CLOSEDIR_VOID requires it.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL)
(_AS_SHELL_SANITIZE): Fix quoting bugs.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-01-20 10:08:11 -07:00
Eric Blake
91d1870bb4 Speed up m4_require.
* 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>
2009-01-19 07:06:06 -07:00
Eric Blake
064ceeafb9 Make it easier to track diversion bugs.
* 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>
2008-12-30 08:32:08 -07:00
Bruno Haible
c7c8c45b6f Improve multiarch detection.
* lib/autoconf/c.m4 (AC_C_BIGENDIAN): Make detection of options
indicating a universal build more reliable.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-12-29 16:19:31 -07:00
Eric Blake
5f85192b80 Make m4_dumpdef more useful with M4 1.6.
* lib/m4sugar/m4sugar.m4 (_m4_dumpdef): New macro.
(m4_init): Install it for new enough m4.
* tests/m4sugar.at (m4@&t@_dumpdef): Enhance test.
* doc/autoconf.texi (Redefined M4 Macros) <m4_dumpdef>: Mention
lack of sorting.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-12-23 21:17:29 -07:00
Eric Blake
7f4d002958 Document some recently added macros.
* lib/m4sugar/m4sugar.m4 (m4_map_args_w): Add optional sep
parameter.
* doc/autoconf.texi (Looping constructs) <m4_map_args_sep>
<m4_map_args_w, m4_stack_foreach, m4_stack_foreach_sep>: Document
new macros.
(Set manipulation Macros) <m4_set_map_sep>: Likewise.
* tests/m4sugar.at (m4@&t@_stack, M4 loops): Enhance tests.
* NEWS: Document new macros.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-12-19 14:06:46 -07:00
Eric Blake
44579b8316 Fix separator in m4_stack_foreach_sep.
* lib/m4sugar/m4sugar.m4 (_m4_stack_reverse): Separate separator
from prefix.
* tests/m4sugar.at (m4@&t@_stack): Enhance test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-12-18 17:20:41 -07:00
Jim Meyering
9077bf12d8 AC_HEADER_ASSERT: don't say assertions are disabled when they're not
* 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.
2008-12-10 16:55:07 +01:00
Eric Blake
0aae415c0c Fix m4_location inside m4_wrap with m4 1.4.5.
* 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>
2008-12-09 10:47:19 -07:00
William Pursell
276044d355 Fix AC_HEADER_ASSERT w.r.t. --enable-assert.
* 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>
2008-12-08 16:30:50 -07:00
Paolo Bonzini
c32b3caff4 Fix AC_HEADER_ASSERT not to treat --enable-assert and --disable-assert the same.
* lib/autoconf/headers.m4 (AC_HEADER_ASSERT): Check value of $enableval.
2008-12-08 22:13:25 +01:00
Ralf Wildenhues
5857d07c98 Hide `set -m' error message, for zsh.
* lib/autotest/general.m4 (AT_JOB_FIFO_FD): Hide zsh 4.3.4
error messages about `set -m'.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-11-29 10:57:00 +01:00
Eric Blake
580ada8c2e Add m4_cleardivert.
* 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>
2008-11-25 09:28:43 -07:00
Eric Blake
fb70cde184 Add safety check for m4_expand vs. diversions.
* 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>
2008-11-25 09:10:25 -07:00
Eric Blake
b74085770f Fix typo in AS_MESSAGE_LOG_FD patch.
* lib/m4sugar/m4sh.m4 (AS_ERROR): Check correct condition.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-24 06:28:56 -07:00
Ralf Wildenhues
12ec1304fc More reliable signal handling in Autotest.
* 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>
2008-11-23 20:00:39 +01:00
Eric Blake
2cc7d57a17 Clean up AS_MESSAGE_LOG_FD usage.
* lib/m4sugar/m4sh.m4 (AS_MESSAGE_FD, AS_MESSAGE_LOG_FD)
(AS_ORIGINAL_STDIN_FD): Provide default M4sh values.
(_AS_ECHO_LOG, AS_MESSAGE, _AS_ERROR_PREPARE, AS_ERROR): Simplify
usage.
(AS_INIT_GENERATED): Don't shuffle an unchanged AS_MESSAGE_FD.
* tests/m4sh.at (AS@&t@_INIT_GENERATED): Update test.
(AS@&t@_MESSAGE_FD): New test.
* doc/autoconf.texi (Initialization Macros) <AS_INIT_GENERATED>:
Give more details about fd manipulation.
(File Descriptor Macros): Describe M4sh defaults for the fds.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-21 17:00:13 -07:00
Eric Blake
48d8391ff3 Use shell function for AS_ERROR.
* 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>
2008-11-21 13:52:21 -07:00
Eric Blake
a8a9b2148d Fix typos in recent testsuite improvements.
* 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>
2008-11-21 13:36:27 -07:00
Eric Blake
bbc3dc81cc Change the semantics of AS_EXIT without argument.
* 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>
2008-11-21 08:13:04 -07:00
Eric Blake
abe172f4ba Factor more common code out of AT_CHECK into shell function.
* 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>
2008-11-20 21:59:23 -07:00
Eric Blake
7811a6d5a9 Handle version numbers as decimal, even if they start with 0.
* lib/m4sugar/m4sugar.m4 (_m4_version_unletter): Avoid
interpreting leading zeros as octal.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-20 21:02:22 -07:00
Eric Blake
03118f36d9 Speed up AT_CHECK.
* 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>
2008-11-20 18:55:10 -07:00
Eric Blake
79042ea346 Fix XFAIL related to AT_CHECK.
* lib/autotest/general.m4 (AT_CHECK, AT_CHECK_UNQUOTED): Expand
first argument once.
(_AT_CHECK): Don't re-expand commands.
* tests/autotest.at (Multiline command from M4 expansion): Remove
XFAIL.
* tests/tools.at (autoupdating AU_ALIAS): Quote unbalanced paren.
* NEWS: Document the fallout.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-20 18:27:35 -07:00
Eric Blake
2d63737afb Reduce forks in AC_DEFINE.
* 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>
2008-11-20 16:18:28 -07:00
Eric Blake
7791129655 Improve m4_expand robustness, part 2.
* lib/m4sugar/m4sugar.m4 (m4_expand): Support unterminated
comments, by wrapping old implementation...
(_m4_expand): ...as this, and renaming old core...
(_m4_expand_): ...to this.
(m4_text_box): Use lighter-weight _m4_expand.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_EXPAND)
(_AS_DETECT_BETTER_SHELL, AS_FUNCTION_DESCRIBE): Likewise.
* lib/autotest/general.m4 (AT_KEYWORDS): Likewise.
* tests/m4sugar.at (m4@&t@_expand): Enhance test.
* tests/autotest.at (AT_CHECK_AT_TITLE_CHAR): Likewise.
* doc/autoconf.texi (Evaluation Macros) <m4_expand>: Mention new
functionality.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-20 16:05:04 -07:00
Eric Blake
bcef427e18 Improve m4_expand robustness, part 1.
* lib/m4sugar/m4sugar.m4 (_m4_expand): Tolerate unquoted
unbalanced `)'.
* tests/m4sugar.at (m4@&t@_expand): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-20 15:53:22 -07:00
Eric Blake
fa506f9116 Add m4_chomp, m4_esyscmd_s.
* lib/m4sugar/m4sugar.m4 (m4_esyscmd_e, m4_chomp, m4_chomp_all):
New macros.
* doc/autoconf.texi (Redefined M4 Macros) <m4_esyscmd_s>: Document
them.
(Text processing Macros) <m4_chomp>: Likewise.
* NEWS: Likewise.
* tests/m4sugar.at (m4@&t@_esyscmd_s): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-20 15:42:39 -07:00
Eric Blake
aa6c52d78a Remove _m4_index.
* 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>
2008-11-20 15:38:57 -07:00
Eric Blake
0a144bc25e Speed up _AS_QUOTE.
* lib/m4sugar/m4sh.m4 (_AS_QUOTE_IFELSE): Inline into...
(_AS_QUOTE): ...here, delete unused second paramenter, and factor
choice into...
(_AS_QUOTE_MODERN, _AS_QUOTE_OLD): ...new helpers.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-20 12:37:11 -07:00
Alfred G. de Wijn
f8185b3938 For consistency, make temporary variable match language name.
* 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>
2008-11-20 05:57:14 -07:00
Eric Blake
667dcc0c30 Use fn for shell functions, func for autoconf CHECK_FUNCS.
* lib/autoconf/functions.m4 (AC_CHECK_FUNC): Abbreviate shell
function names.
* lib/autoconf/general.m4 (_AC_PREPROC_IFELSE)
(_AC_COMPILE_IFELSE, _AC_LINK_IFELSE, _AC_RUN_IFELSE)
(AC_CHECK_DECL, AC_COMPUTE_INT): Likewise.
* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL)
(_AC_CHECK_HEADER_COMPILE, _AC_CHECK_HEADER_PREPROC): Likewise.
* lib/autoconf/types.m4 (_AC_CHECK_TYPE_NEW, _AC_TYPE_INT)
(_AC_TYPE_UNSIGNED_INT, AC_CHECK_MEMBER): Likewise.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/m4sugar/m4sh.m4 (_AS_SHELL_FN_WORK, _AS_EXIT_PREPARE)
(AS_EXIT, AS_SET_STATUS, _AS_UNSET_PREPARE, _AS_MKDIR_P)
(_AS_MKDIR_P_PREPARE, _AS_VAR_APPEND_PREPARE, AS_VAR_APPEND)
(_AS_VAR_ARITH_PREPARE, AS_VAR_ARITH): Likewise.
* doc/autoconf.texi (Shell Functions): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-18 21:33:46 -07:00
Eric Blake
e84b404ff0 Alter default value of AS_EXIT.
* 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>
2008-11-18 21:00:34 -07:00
Eric Blake
740062eb42 Add AS_SET_STATUS, make AS_EXIT more efficient.
* lib/m4sugar/m4sh.m4 (_AS_EXIT_PREPARE, AS_SET_STATUS): New
macros.
(AS_EXIT): Rewrite to avoid forks.
(_AS_SHELL_SANITIZE): Avoid AS_EXIT prior to shell functions.
(AS_PREPARE, _AS_PREPARE): Add new preparation.
* doc/autoconf.texi (Common Shell Constructs) <AS_SET_STATUS>:
Document.
* NEWS: Mention new macro.
* tests/m4sh.at (AS@&t@_EXIT): New test.
(BASENAME_TEST): Sort.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-18 09:57:19 -07:00
Eric Blake
7ad7019cf7 Detect empty list in AS_FOR.
* 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>
2008-11-17 06:20:27 -07:00
Ralf Wildenhues
fde7ee974a Simplify, avoid unbalanced parentheses from last change.
* 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>
2008-11-16 23:00:22 +01:00
Ralf Wildenhues
291d709efd Fix exit status of expr version of as_func_arith.
* 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>
2008-11-16 22:18:07 +01:00
Eric Blake
cc854cd040 Use the new AS_FOR function.
* 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>
2008-11-15 10:41:23 -07:00
Eric Blake
fdcbe002e9 Add AS_FOR, undocumented for now.
* 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>
2008-11-15 10:41:19 -07:00
Eric Blake
2db8890532 Optimize single-argument loop.
* 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>
2008-11-13 14:13:25 -07:00
Eric Blake
1a0a363042 Fix AS_ESCAPE usage bugs.
* lib/m4sugar/m4sh.m4 (_AS_VAR_APPEND_PREPARE)
(_AS_VAR_ARITH_PREPARE): Expand macros prior to adding shell
escapes.
(AS_TR_SH, AS_VAR_GET): Use _AS_ESCAPE for speed.
* doc/autoconf.texi (Polymorphic Variables) <AS_VAR_SET>: Document
caveat due to conditional AS_ESCAPE.
* tests/m4sh.at (AS@&t@_VAR basics): Enhance test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-13 12:21:40 -07:00
Eric Blake
d623082df6 Whitespace reduction in configure.
* 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>
2008-11-12 20:33:01 -07:00
Eric Blake
973149e014 Make M4sh, not autoconf, guarantee sane $SHELL.
* lib/autoconf/general.m4 (_AC_INIT_DEFAULTS): Move setting of
SHELL...
* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): ...to here.
* doc/autoconf.texi (Initialization Macros): Document the effect
on SHELL.
* tests/m4sh.at (AS@&t@_INIT_GENERATED): New test.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-12 20:32:51 -07:00
Ralf Wildenhues
1b1851ea3a Wrap keywords in `testsuite --list' output.
* lib/autotest/general.m4 (AT_INIT): Rewrite --list awk script,
avoid lint warnings from gawk, wrap keyword lists to stay below
80 characters per line if possible.
* tests/autotest.at (Keyword wrapping): New test.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-11-12 23:54:01 +01:00
Eric Blake
74bb1a450d Work around <=m4-1.4.9 bug in m4_format.
* 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>
2008-11-10 21:04:46 -07:00
Eric Blake
40f1a994e2 Avoid some regex uses.
* 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>
2008-11-10 11:38:41 -07:00
Eric Blake
3763dba27e Use more efficient macros in AC_CONFIG_SUBDIRS.
* 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>
2008-11-10 11:38:14 -07:00
Eric Blake
61055bdb3e Use more efficient macros in AC_CHECK_FILES and AC_CHECK_DECLS.
* 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>
2008-11-10 11:35:42 -07:00
Eric Blake
9187638237 Use more efficient macros in AC_CHECK_TYPES.
* 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>
2008-11-10 11:35:16 -07:00
Eric Blake
40dc2b77a4 Use more efficient macros in AC_CHECK_HEADERS.
* 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>
2008-11-10 11:34:47 -07:00
Eric Blake
1334bb1195 Use more efficient macros in AC_CHECK_FUNCS.
* 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>
2008-11-10 11:34:17 -07:00
Eric Blake
786427de58 Use more efficient macro in AT_INIT.
* lib/autotest/general.m4 (AT_INIT): Use m4_map_args.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 11:33:19 -07:00
Eric Blake
3b78b1ae08 Try 'print -r --' as a non-forking variant of 'printf %s\\n'.
* 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>
2008-11-10 09:06:39 -07:00
Paolo Bonzini
5544cc87ec Balance parentheses in _AC_CACHE_DUMP.
* lib/autoconf/general.m4 (_AC_CACHE_DUMP): Balance parentheses
without introducing \).
2008-11-09 14:46:12 +01:00
Eric Blake
7a4705cb7a Skip preprocessor check in AC_CHECK_HEADERS_ONCE.
* lib/autoconf/headers.m4 (_AC_HEADERS_EXPANSION): Provide fourth
argument to speed up check.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-06 16:43:24 -07:00
Eric Blake
3d6b5007ca Speed up AC_CHECK_TYPE.
* lib/autoconf/types.m4 (AC_CHECK_TYPE): Factor out $@, and avoid
regex when enough arguments are present.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-06 16:29:53 -07:00
Paolo Bonzini
359be416a7 Remove three forks per _AC_RUN_LOG_STDERR in the common case.
* 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.
2008-11-06 15:23:59 +01:00
Paolo Bonzini
c22cc67be7 Change `present but cannot be compiled' behavior to use compiler result.
* 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.
2008-11-06 10:55:31 +01:00
Eric Blake
b07a2b3d74 Add m4_map_args_w.
* 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>
2008-11-05 20:04:49 -07:00
Eric Blake
4e009d5228 Use m4_set_map_sep in more places.
* lib/m4sugar/m4sugar.m4 (m4_set_difference, m4_set_intersection)
(m4_set_union): Use m4_set_map_sep rather than m4_set_foreach.
* doc/autoconf.texi (Set manipulation Macros) <m4_set_map>:
Enhance documentation.
<m4_set_foreach>: Mention faster alternative.
(Looping constructs) <m4_foreach>: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-05 13:31:46 -07:00
Eric Blake
a8c4be749a Unify m4_set_foreach and m4_set_map.
* lib/m4sugar/m4sugar.m4 (m4_set_map_sep): New macro, undocumented
for now.
(m4_set_contents, m4_set_foreach, m4_set_list, m4_set_listc)
(m4_set_map): Adjust callers.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-05 13:27:39 -07:00
Eric Blake
641487fb34 Use _m4_foreach in more places.
* 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>
2008-11-05 13:27:30 -07:00
Eric Blake
aae086a2f7 Unify _m4_foreach and _m4_map.
* lib/m4sugar/m4sugar.m4 (_m4_map): Delete, merged with...
(_m4_foreach): ...this.
(m4_foreach, m4_map, m4_mapall, m4_map_sep, _m4_mapall_sep)
(m4_map_args, m4_map_args_sep): Adjust callers.
* lib/m4sugar/foreach.m4 (_m4_map): Rename...
(_m4_foreach): ...to this, overwriting old definition.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-05 10:32:47 -07:00
Eric Blake
1329287eb7 Add m4_map_args_sep, undocumented for now.
* 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>
2008-11-04 21:23:51 -07:00
Eric Blake
9a79ba954d Improve m4_for performance.
* 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>
2008-11-04 21:23:47 -07:00