]> git.ipfire.org Git - thirdparty/autoconf.git/log
thirdparty/autoconf.git
16 years agoDispatch on AC_LANG_CONFTEST
Paolo Bonzini [Mon, 3 Nov 2008 09:25:23 +0000 (10:25 +0100)] 
Dispatch on AC_LANG_CONFTEST

* lib/autoconf/c.m4 (AC_LANG_CONFTEST(C)): Define instead of
AC_LANG_SOURCE(C).
* lib/autoconf/general.m4 (_AC_INIT_PREPARE): Add a comment at the
top of confdefs.h, which also works around cpp deficiencies.
* lib/autoconf/lang.m4 (AC_LANG_DEFINE): Define AC_LANG_CONFTEST(xyz)
(AC_LANG_CONFTEST): Dispatch based on _AC_LANG.
(AC_LANG_CONFTEST()): New.

16 years agoReorganize definition of languages
Paolo Bonzini [Mon, 3 Nov 2008 09:20:11 +0000 (10:20 +0100)] 
Reorganize definition of languages

* lib/autoconf/c.m4 (AC_LANG(C), AC_LANG(C++), AC_LANG(Objective C),
_AC_LANG_ABBREV(C), _AC_LANG_ABBREV(C++), _AC_LANG_ABBREV(Objective C),
_AC_LANG_PREFIX(C), _AC_LANG_PREFIX(C++), _AC_LANG_PREFIX(Objective C)):
Replace definitions with usage of AC_LANG_DEFINE.
(Sections 2b, 2c): Delete.
(Sections 1b, 1c): Move after section 2a.
* lib/autoconf/erlang.m4 (AC_LANG(Erlang), _AC_LANG_ABBREV(Erlang),
_AC_LANG_PREFIX(Erlang), AC_LANG_SOURCE(Erlang)): Replace definitions
with usage of AC_LANG_DEFINE.
(AC_LANG_ERLANG): Define using AU_DEFUN.
* lib/autoconf/fortran.m4 (AC_LANG(Fortran), AC_LANG(Fortran 77),
_AC_LANG_ABBREV(Fortran), _AC_LANG_ABBREV(Fortran 77),
_AC_LANG_PREFIX(Fortran), _AC_LANG_PREFIX(Fortran 77),
_AC_LANG_SOURCE(Fortran), AC_LANG_SOURCE(Fortran 77)): Replace
definitions with usage of AC_LANG_DEFINE.
* lib/autoconf/lang.m4 (AC_LANG_DEFINE, AC_LANG_SOURCE()): New.

16 years agoCommit ChangeLog entry
Paolo Bonzini [Mon, 3 Nov 2008 09:43:35 +0000 (10:43 +0100)] 
Commit ChangeLog entry

16 years agoUse preprocessor in cpp tests.
Paolo Bonzini [Mon, 3 Nov 2008 09:19:44 +0000 (10:19 +0100)] 
Use preprocessor in cpp tests.

* tests/c.at (CPP tests): Use AC_CHECK_HEADERS(..., [-]).

16 years agoRename _AC_CHECK_HEADER_OLD and _AC_CHECK_HEADER_NEW.
Paolo Bonzini [Fri, 31 Oct 2008 15:53:17 +0000 (16:53 +0100)] 
Rename _AC_CHECK_HEADER_OLD and _AC_CHECK_HEADER_NEW.

* lib/autoconf/headers.m4 (AC_CHECK_HEADER): Adjust naming.
(_AC_CHECK_HEADER_PREPROC_BODY): New name of _AC_CHECK_HEADER_OLD_BODY.
(_AC_CHECK_HEADER_COMPILE_BODY): New name of _AC_CHECK_HEADER_NEW_BODY.
(_AC_CHECK_HEADER_PREPROC): New name of _AC_CHECK_HEADER_OLD.
(_AC_CHECK_HEADER_COMPILE): New name of _AC_CHECK_HEADER_NEW.
* tests/semantics.at (AC_CHECK_HEADERS_OLD, AC_CHECK_HEADER_NEW):
Give better name.

16 years agoSupport multiple undiverts and dumpdefs at once.
Eric Blake [Thu, 30 Oct 2008 21:51:26 +0000 (15:51 -0600)] 
Support multiple undiverts and dumpdefs at once.

* lib/m4sugar/m4sugar.m4 (m4_dumpdefs, m4_undivert): Allow extra
arguments.
* doc/autoconf.texi (Redefined M4 Macros) <m4_dumpdef>,
<m4_undivert>: Document argument list change.
* tests/m4sugar.at (m4@&t@_divert_stack, m4@&t@_dumpdef): Test
them.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoSimplify diversion stack handling.
Eric Blake [Thu, 30 Oct 2008 21:32:56 +0000 (15:32 -0600)] 
Simplify diversion stack handling.

* lib/m4sugar/m4sugar.m4 (m4_divert_stack): Use fewer macros, and
avoid extra newlines.
(m4_divert_stack_push): Compute location here, rather than caller.
(m4_divert_push): Update caller.
(m4_divert): Likewise, and also adjust current diversion name.
(m4_divert_pop): Simplify rule that diversion stack must never go
empty.
(_m4_require_call): Bypass diversion stack when collecting
required macro text.
(m4_init): Set current diversion without requiring m4_init.
* lib/m4sugar/m4sh.m4 (AS_INIT): Avoid too many pops.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/autoconf/general.m4 (_AC_INIT_DEFAULTS): Schedule wrapped
text to run prior to m4sugar cleanup.
* doc/autoconf.texi (Text processing Macros) <m4_newline>: Mention
optional argument.
(Conditional constructs) <m4_ifvaln, m4_n>: Mention use of dnl.
* NEWS: Undo blurb about m4_divert.
* tests/m4sugar.at (m4@&t@_divert_stack): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoSimplify expansion stack handling.
Eric Blake [Thu, 30 Oct 2008 18:16:15 +0000 (12:16 -0600)] 
Simplify expansion stack handling.

* lib/m4sugar/m4sugar.m4 (m4_expansion_stack): Use fewer macros;
always output 'top level'.
(_m4_expansion_stack_entry): New macro, to format the string only
when needed.
(m4_expansion_stack_push): Only push a macro name.
(m4_warn, _m4_defun_pro): Update callers.
(m4_expansion_stack_pop, m4_expansion_stack_dump): Delete.
(_m4_defun_epi, m4_fatal): Inline the calls.
* tests/m4sugar.at (m4@&t@_expansion_stack): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoBetter documentation of AC_CHECK_HEADER's fourth argument.
Eric Blake [Fri, 31 Oct 2008 04:05:55 +0000 (22:05 -0600)] 
Better documentation of AC_CHECK_HEADER's fourth argument.

* doc/autoconf.texi (Generic Headers) <AC_CHECK_HEADER>: Mention
how to suppress compiler or preprocessor header check.
Reported by Jeff Squyres.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoFix LINENO testsuite failure.
Eric Blake [Fri, 31 Oct 2008 00:50:39 +0000 (18:50 -0600)] 
Fix LINENO testsuite failure.

* tests/m4sh.at (AT_DATA_LINENO): Use AS_LINENO_PREPARE, not
undocumented _AS_PREPARE, and move unset earlier in script.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoUpdate LINENO documentation.
Eric Blake [Thu, 30 Oct 2008 16:56:11 +0000 (10:56 -0600)] 
Update LINENO documentation.

* doc/autoconf.texi (Initialization Macros) <AS_INIT_GENERATED>:
(Special Shell Variables) <LINENO>: Mention that LINENO support in
child scripts may be broken.  Modernize example.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoDo not check for $LINENO in generated scripts.
Paolo Bonzini [Thu, 30 Oct 2008 14:19:49 +0000 (15:19 +0100)] 
Do not check for $LINENO in generated scripts.

* lib/m4sugar/m4sh.m4 (_AS_PREPARE): Do not call _AS_LINENO_PREPARE,
and explain why.

16 years agoDon't check for non-POSIX extensions in suggested tests.
Eric Blake [Thu, 30 Oct 2008 15:39:57 +0000 (09:39 -0600)] 
Don't check for non-POSIX extensions in suggested tests.

* lib/m4sugar/m4sh.m4 (_AS_VAR_APPEND_WORKS): Remove suggestion;
we still use += if available, but should not reject shells (like
dash) that don't provide it.
(_AS_DETECT_SUGGESTED): Document a policy for m4sh.
Reported by Paolo Bonzini.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoPass CONFIG_SHELL down to generated scripts, and re-export SHELL.
Paolo Bonzini [Thu, 30 Oct 2008 14:13:56 +0000 (15:13 +0100)] 
Pass CONFIG_SHELL down to generated scripts, and re-export SHELL.

* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): If proceeding
with a given CONFIG_SHELL, move it to SHELL.
(AS_INIT_GENERATED): Re-export SHELL.

16 years agoWork around Solaris /bin/sh case bug.
Eric Blake [Thu, 30 Oct 2008 12:56:44 +0000 (06:56 -0600)] 
Work around Solaris /bin/sh case bug.

* lib/m4sugar/m4sh.m4 (_AS_CASE, _AS_CASE_DEFAULT): Always provide
a non-empty command list.
(AS_CASE): Always guarantee that a case will match.
* doc/autoconf.texi (Limitations of Builtins) <case>: Document the
Solaris bug, and mention AS_CASE.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoRequire _AS_CR_PREPARE where appropriate and fix ChangeLog.
Paolo Bonzini [Thu, 30 Oct 2008 12:54:27 +0000 (13:54 +0100)] 
Require _AS_CR_PREPARE where appropriate and fix ChangeLog.

* lib/m4sugar/m4sh.m4 (_AS_PREPARE): Call _AS_CR_PREPARE.
(AS_PREPARE): Require _AS_CR_PREPARE.

16 years agotrim down the length of the shell function test
Paolo Bonzini [Thu, 30 Oct 2008 09:23:40 +0000 (10:23 +0100)] 
trim down the length of the shell function test

* lib/m4sugar/m4sh.m4 (_AS_SHELL_FN_WORK): Condense.

16 years agoAvoid walking the entire PATH when looking for a better shell.
Paolo Bonzini [Thu, 30 Oct 2008 08:52:22 +0000 (09:52 +0100)] 
Avoid walking the entire PATH when looking for a better shell.

* lib/m4sugar/m4sh.m4 (_AS_SHELL_SANITIZE): Test shell characteristics
as the PATH is walked.

16 years agoAdd third argument to _AS_PATH_WALK
Paolo Bonzini [Thu, 30 Oct 2008 08:51:32 +0000 (09:51 +0100)] 
Add third argument to _AS_PATH_WALK

* lib/m4sugar/m4sh.m4 (_AS_SHELL_SANITIZE): Do not call _AS_CR_PREPARE.
(_AS_PATH_WALK): Add third optional argument.

16 years agoFix LINENO detection to work around bash and pdksh limitations.
Eric Blake [Wed, 29 Oct 2008 16:39:53 +0000 (10:39 -0600)] 
Fix LINENO detection to work around bash and pdksh limitations.

* lib/m4sugar/m4sh.m4 (_AS_LINENO_WORKS): Enhance the test, so
that we can choose which of two tests to trust.
(_AS_RUN): Set flag when alternate shell is running.
(_AS_DETECT_EXPAND): New macro.
(_AS_DETECT_BETTER_SHELL): Use it to massage LINENO tests.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoMention proper fix for zsh users.
Eric Blake [Wed, 29 Oct 2008 21:44:28 +0000 (15:44 -0600)] 
Mention proper fix for zsh users.

* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Recommend zsh
version known to work.
Suggested by Paolo Bonzini.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoDocument current beta-quality status.
Eric Blake [Wed, 29 Oct 2008 15:27:11 +0000 (09:27 -0600)] 
Document current beta-quality status.

* configure.ac: Reflect fact that change to git-version-gen
produces -, but not always a letter, on non-release builds.
* BUGS: Mention known issues.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Ask for help in
debugging platforms with deficient shells.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAlter signature of AS_INIT_GENERATED.
Eric Blake [Tue, 28 Oct 2008 22:37:54 +0000 (16:37 -0600)] 
Alter signature of AS_INIT_GENERATED.

* lib/m4sugar/m4sh.m4 (AS_INIT_GENERATED): Add parameters, and
manage here-doc and chmod in place.  This also allows future
changes for optimizing the child via diversion/m4_wrap magic.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Update
caller.
* doc/autoconf.texi (Initialization Macros) <AS_INIT_GENERATED>:
Update the documentation.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoUse _m4_stack_reverse in m4_set.
Eric Blake [Tue, 28 Oct 2008 21:35:23 +0000 (15:35 -0600)] 
Use _m4_stack_reverse in m4_set.

* lib/m4sugar/m4sugar.m4 (_m4_set_contents_1)
(_m4_set_contents_2): Rewrite to share _m4_stack_reverse
implementation.
(m4_set_contents, m4_set_foreach, m4_set_list, m4_set_listc)
(m4_set_map): Adjust callers to new API.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAdd m4_stack_foreach_sep.
Eric Blake [Tue, 28 Oct 2008 21:11:16 +0000 (15:11 -0600)] 
Add m4_stack_foreach_sep.

* lib/m4sugar/m4sugar.m4 (m4_stack_foreach_sep)
(m4_stack_foreach_sep_lifo): New macros.
(_m4_stack_reverse): Adjust prototype, to support it.
(m4_copy): Use fewer macros.
* tests/m4sugar.at (m4@&t@_stack_foreach): Rename...
(m4@&t@_stack): ...and add m4_stack_foreach_sep tests.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoMention Sun WorkShop 6.2 OpenMP bug.
Bruno Haible [Wed, 29 Oct 2008 10:47:23 +0000 (11:47 +0100)] 
Mention Sun WorkShop 6.2 OpenMP bug.

* doc/autoconf.texi (AC_OPENMP): Document portability pitfall.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoRewrite handling of diversion and expansion stack.
Paolo Bonzini [Tue, 28 Oct 2008 11:18:55 +0000 (12:18 +0100)] 
Rewrite handling of diversion and expansion stack.

* NEWS: Document stricter requirement on m4_init.
* lib/m4sugar/m4sugar.m4 (m4_divert_stack): New, replacing
_m4_divert_n_stack.
(_m4_divert_stack_push): New.
(m4_divert): Use _m4_divert_stack_push and replace m4_define with
m4_popdef.
(m4_divert_push): Use _m4_divert_stack_push.
(m4_divert_pop): Use m4_divert_stack instead of _m4_divert_n_stack,
pop _m4_divert_stack instead of m4_divert_stack.
(m4_expansion_stack): New.  Update comment above it.
(m4_expansion_stack_push, m4_expansion_stack_pop): Work on
_m4_expansion_stack instead of m4_expansion_stack.
(m4_expansion_stack_dump): Check presence of _m4_expansion_stack
instead of m4_expansion_stack.  Use m4_expansion_stack's expansion
instead of the definition, and compensate for the trailing newline
in the expansion.
(m4_warn, _m4_defun_pro, _m4_defun_epi): Check presence of
_m4_expansion_stack instead of m4_expansion_stack.
(m4_newline): Expand first argument after the newline.
(m4_init): Use m4_divert_stack instead of _m4_divert_n_stack,
* tests/m4sugar.at (m4_append, m4_text_wrap): Invoke m4_init.
* tests/tools.at (whitespace in file names, the empty token): Likewise.

16 years agoReduce forks while searching for better shell.
Eric Blake [Wed, 29 Oct 2008 03:31:12 +0000 (21:31 -0600)] 
Reduce forks while searching for better shell.

* lib/m4sugar/m4sh.m4 (_AS_DETECT_REQUIRED)
(_AS_DETECT_SUGGESTED): No need to provide extra subshell; _AS_RUN
already does the job.
(_AS_DETECT_BETTER_SHELL): Simplify AS_EXIT when not run in a trap
0 context.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoUndo needless efforts to protect $2 in $2_t.
Eric Blake [Wed, 29 Oct 2008 02:45:58 +0000 (20:45 -0600)] 
Undo needless efforts to protect $2 in $2_t.

* lib/autoconf/types.m4 (_AC_TYPE_INT_BODY)
(_AC_TYPE_UNSIGNED_INT_BODY): Reduce extra quoting.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoFix parallel test execution output lossage.
Ralf Wildenhues [Tue, 28 Oct 2008 21:04:36 +0000 (22:04 +0100)] 
Fix parallel test execution output lossage.

* lib/autotest/general.m4 (_AT_CHECK): Truncate files to hold
standard output and standard error before the test, use append
mode for writing.
* THANKS: Update.
Caught by Bob Proulx' build daemons, analysis and suggested fix
by Stéphane Chazelas.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
16 years agoUse m4_map_args in more places.
Eric Blake [Tue, 28 Oct 2008 19:44:53 +0000 (13:44 -0600)] 
Use m4_map_args in more places.

* lib/m4sugar/m4sugar.m4 (m4_defn, m4_dumpdef, m4_popdef)
(m4_undefine, m4_combine): Use m4_map_args, rather than
m4_foreach.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoOverride m4 1.4.x dumpdef, as it breaks autom4te.
Eric Blake [Tue, 28 Oct 2008 18:14:06 +0000 (12:14 -0600)] 
Override m4 1.4.x dumpdef, as it breaks autom4te.

* lib/m4sugar/m4sugar.m4 (m4_dumpdef): New implementation.
* doc/autoconf.texi (Redefined M4 Macros) <m4_dumpdef>: Mention
semantic differences as well as m4_dumpdefs.
* NEWS: Likewise.
* tests/m4sugar.at (m4@&t@_dumpdef): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAllow m4sugar to be used without autom4te, such as in bison.
Eric Blake [Tue, 28 Oct 2008 16:28:04 +0000 (10:28 -0600)] 
Allow m4sugar to be used without autom4te, such as in bison.

* lib/m4sugar/m4sugar.m4 (m4_text_wrap, m4_qlen): Document that
alternate escape sequences can be used.
(m4_text_box): Likewise.  Don't output quadrigraphs.
(m4_qdelta): Delete unused macro.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoadd m4_stack_foreach and m4_stack_foreach_lifo
Paolo Bonzini [Tue, 28 Oct 2008 10:27:31 +0000 (11:27 +0100)] 
add m4_stack_foreach and m4_stack_foreach_lifo

* lib/m4sugar/m4sugar.m4 (_m4_stack_reverse): New from _m4_copy.
(m4_stack_foreach, m4_stack_foreach_lifo): New.
(m4_copy): Use m4_stack_foreach and m4_curry.
(_m4_dumpdefs_down, _m4_dumpdefs_up): Remove.
(m4_dumpdefs): Rewrite using m4_stack_foreach_lifo.
* tests/m4sugar.at (m4_stack_foreach): New test.

16 years agouse a shell function for AC_TYPE_INTx_T
Paolo Bonzini [Mon, 20 Oct 2008 13:35:59 +0000 (15:35 +0200)] 
use a shell function for AC_TYPE_INTx_T

* lib/autoconf/types.m4 (_AC_TYPE_INT_BODY, _AC_TYPE_UNSIGNED_INT_BODY): New.
(_AC_TYPE_INT, _AC_TYPE_UNSIGNED_INT): Define and use a shell function.

16 years agoFix AS_ESCAPE usage together with AC_INCLUDES_DEFAULT.
Paolo Bonzini [Tue, 28 Oct 2008 13:47:39 +0000 (14:47 +0100)] 
Fix AS_ESCAPE usage together with AC_INCLUDES_DEFAULT.

* lib/autoconf/general.m4 (AC_CHECK_DECL): Fix AS_ESCAPE usage.
* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL,
_AC_CHECK_HEADER_NEW): Likewise.
* lib/autoconf/types.m4 (_AC_CHECK_TYPE_NEW, AC_CHECK_MEMBER): Likewise.

16 years agouse a shell function for AC_CHECK_MEMBER
Paolo Bonzini [Mon, 20 Oct 2008 13:35:47 +0000 (15:35 +0200)] 
use a shell function for AC_CHECK_MEMBER

* lib/autoconf/types.m4 (_AC_CHECK_MEMBER_BODY): New.
(AC_CHECK_MEMBER): Define and use a shell function.

16 years agoPrefer m4_fatal over AC_FATAL.
Eric Blake [Mon, 27 Oct 2008 23:22:40 +0000 (17:22 -0600)] 
Prefer m4_fatal over AC_FATAL.

* lib/autoconf/types.m4 (AC_CHECK_SIZEOF, AC_CHECK_ALIGNOF)
(AC_CHECK_MEMBER): Use non-obsolete macro name.
* lib/autoconf/fortran.m4 (_AC_LIST_MEMBER_IF): Likewise.
* lib/autoconf/general.m4 (AC_REQUIRE_AUX_FILE, AC_SUBST):
Likewise.
* lib/autoconf/lang.m4 (_AC_LANG_DISPATCH): Likewise.
* lib/autoconf/status.m4 (_AC_CONFIG_DEPENDENCY_DEFAULT)
(_AC_CONFIG_UNIQUE, _AC_CONFIG_REGISTER_DEST): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAvoid raw carriage return in scripts.
Eric Blake [Mon, 27 Oct 2008 22:34:58 +0000 (16:34 -0600)] 
Avoid raw carriage return in scripts.

* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Generate CR
via tr, rather than with literal byte.
* THANKS: Update.
Reported by Steven R. Loomis; patch suggested by Thomas Dickey.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoUse AS_VAR_ARITH.
Eric Blake [Mon, 27 Oct 2008 21:07:57 +0000 (15:07 -0600)] 
Use AS_VAR_ARITH.

* lib/autotest/general.m4 (at_func_arith): Delete; replace all
clients with AS_VAR_ARITH instead.
* lib/autoconf/general.m4 (_AC_COMPUTE_INT_COMPILE): Use new
macro.
* lib/autoconf/programs.m4 (_AC_FEATURE_CHECK_LENGTH): Likewise.
* tests/torture.at (Torturing config.status): Likewise.
* tests/tools.at (autom4te --force): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAdd AS_VAR_ARITH.
Eric Blake [Mon, 27 Oct 2008 20:26:57 +0000 (14:26 -0600)] 
Add AS_VAR_ARITH.

* lib/m4sugar/m4sh.m4 (_AS_VAR_ARITH_PREPARE, _AS_VAR_ARITH_WORKS)
(AS_VAR_ARITH): New macros.
(_AS_PREPARE, AS_PREPARE): Emit preparation.
* tests/m4sh.at (AS@&t@_VAR_ARITH): New test.
* doc/autoconf.texi (Polymorphic Variables) <AS_VAR_ARITH>:
Document new macro.
(Limitations of Usual Tools) <expr>: Mention portability problem
if first argument starts with -.
(Shell Substitutions) <$((expression))>: Mention it.
* NEWS: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoUse read, rather than `cat`, for safe one-line files.
Eric Blake [Mon, 27 Oct 2008 16:36:59 +0000 (10:36 -0600)] 
Use read, rather than `cat`, for safe one-line files.

* lib/autotest/general.m4 (AT_CLEANUP): Avoid a fork, since it is
known that the file has only one line and no \.
* lib/autoconf/general.m4 (_AC_COMPUTE_INT_RUN): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agouse a shell function for AC_COMPUTE_INT
Paolo Bonzini [Mon, 20 Oct 2008 13:35:47 +0000 (15:35 +0200)] 
use a shell function for AC_COMPUTE_INT

* lib/autoconf/general.m4 (_AC_COMPUTE_INT_COMPILE, _AC_COMPUTE_INT_RUN): Add
IF-SUCCESS argument.
(_AC_COMPUTE_INT_BODY): New.
(AC_COMPUTE_INT): Define and use a shell function.

16 years agouse a shell function for AC_CHECK_TYPE
Paolo Bonzini [Mon, 20 Oct 2008 13:35:47 +0000 (15:35 +0200)] 
use a shell function for AC_CHECK_TYPE

* lib/autoconf/types.m4 (_AC_CHECK_TYPE_NEW_BODY): Extract
test body here.  Move head comment of _AC_CHECK_TYPE_NEW here.
(_AC_CHECK_TYPE_NEW): Define a shell function and call it.

16 years agouse a shell function for AC_CHECK_DECL
Paolo Bonzini [Mon, 20 Oct 2008 13:35:47 +0000 (15:35 +0200)] 
use a shell function for AC_CHECK_DECL

* lib/autoconf/general.m4 (_AC_CHECK_DECL_BODY): New.
(AC_CHECK_DECL): Use a shell function.

16 years agouse a shell function for the rest of AC_CHECK_HEADER
Paolo Bonzini [Mon, 20 Oct 2008 13:35:19 +0000 (15:35 +0200)] 
use a shell function for the rest of AC_CHECK_HEADER

* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_OLD, _AC_CHECK_HEADER_NEW):
Use a shell function.

16 years agoTrack recent copyright assignments.
Eric Blake [Sat, 25 Oct 2008 15:35:18 +0000 (09:35 -0600)] 
Track recent copyright assignments.

* AUTHORS: Update.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoUse a shell function for _AC_CHECK_HEADER_MONGREL.
Paolo Bonzini [Mon, 20 Oct 2008 13:35:32 +0000 (15:35 +0200)] 
Use a shell function for _AC_CHECK_HEADER_MONGREL.

* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL_BODY): New
macro.
(_AC_CHECK_HEADER_MONGREL): Use a shell function.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoSimplify _AS_PREPARE handling of functions.
Eric Blake [Sat, 25 Oct 2008 12:37:43 +0000 (06:37 -0600)] 
Simplify _AS_PREPARE handling of functions.

* lib/m4sugar/m4sh.m4 (AS_REQUIRE_SHELL_FN): Factor...
(_AS_REQUIRE_SHELL_FN): ...into new helper macro.
(_AS_PREPARE): Temporarily redefine AS_REQUIRE_SHELL_FN to make
this task easier.
(_AS_LINENO_PREPARE): Make more efficient.
(_AS_MKDIR_P_PREPARE): Simplify use in _AS_PREPARE.
(_AS_UNSET_PREPARE): Avoid blank newline.
(AS_INIT): Emit as_func_unset alongside other functions.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoDocument AS_EXIT.
Eric Blake [Sat, 25 Oct 2008 12:29:37 +0000 (06:29 -0600)] 
Document AS_EXIT.

* doc/autoconf.texi (Common Shell Constructs) <AS_EXIT>: Document
this macro.
(Limitations of Builtins): Mention AS_EXIT.
* NEWS: Mention it.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoUse AS_EXIT in autoconf.as.
Eric Blake [Sat, 25 Oct 2008 12:26:49 +0000 (06:26 -0600)] 
Use AS_EXIT in autoconf.as.

* bin/autoconf.as: Consistently use AS_EXIT.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoFix m4 underquoting in AC_PROG_INSTALL.
Eric Blake [Fri, 24 Oct 2008 23:10:08 +0000 (17:10 -0600)] 
Fix m4 underquoting in AC_PROG_INSTALL.

* lib/autoconf/programs.m4 (AC_PROG_INSTALL): Produce accurate
character ranges.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoSpeed up AC_CHECK_HEADER.
Eric Blake [Fri, 24 Oct 2008 22:41:20 +0000 (16:41 -0600)] 
Speed up AC_CHECK_HEADER.

* lib/autoconf/headers.m4 (AC_CHECK_HEADER): Factor out $@.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoUse a shell function for AC_CHECK_FUNC.
Paolo Bonzini [Mon, 20 Oct 2008 13:35:17 +0000 (15:35 +0200)] 
Use a shell function for AC_CHECK_FUNC.

* lib/autoconf/functions.m4 (_AC_CHECK_FUNC_BODY): New macro.
(AC_CHECK_FUNC): Use a shell function.
* lib/autoconf/c.m4 (AC_LANG_SOURCE(C)): Reduce number of forks.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoWork around fact that gnulib-tool doesn't use m4_copy.
Eric Blake [Fri, 24 Oct 2008 18:09:48 +0000 (12:09 -0600)] 
Work around fact that gnulib-tool doesn't use m4_copy.

* lib/autoconf/general.m4 (AC_LIBOBJ, AC_LIBSOURCES): Defun, not
define, so that an initial location is present, to account for
fact that gnulib-tool pushes another AC_DEFUN'd macro on top.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoMake m4_defun_init more robust.
Eric Blake [Fri, 24 Oct 2008 17:24:32 +0000 (11:24 -0600)] 
Make m4_defun_init more robust.

* lib/m4sugar/m4sugar.m4 (m4_defun_init): Handle indirect macro
names, and correct number of arguments.
(m4_copy): Also set up location of the copy.
(m4_defun): When copied, use current macro name, not original.
* tests/m4sugar.at (m4@&t@_require: one-shot initialization):
Update test.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoOptimize clients of AS_REQUIRE.
Eric Blake [Thu, 23 Oct 2008 21:08:45 +0000 (15:08 -0600)] 
Optimize clients of AS_REQUIRE.

* lib/m4sugar/m4sugar.m4 (m4_defun): Add undocumented third
argument.
(m4_defun_init): New undocumented macro.
* lib/m4sugar/m4sh.m4 (_AS_ECHO_LOG, AS_MESSAGE, AS_BASENAME)
(_AS_DIRNAME_EXPR, AS_DIRNAME, AS_ECHO, AS_ECHO_N, AS_TEST_X)
(AS_LN_S, AS_MKDIR_P, _AS_PATH_WALK, AS_VERSION_COMPARE)
(AS_TR_SH, AS_TR_CPP, AS_VAR_APPEND, AS_VAR_PUSHDEF): Use it to
simplify these macros once the one-shot initialization is
complete.
* tests/m4sugar.at (m4@&t@_require: one-shot initialization): New
test.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoImprove m4_copy.
Eric Blake [Fri, 24 Oct 2008 03:17:25 +0000 (21:17 -0600)] 
Improve m4_copy.

* lib/m4sugar/m4sugar.m4 (m4_copy): Add second implementation for
public use.
(_m4_copy): New macro, which preserves pushdef stacks.
(_m4_defun_pro_outer): Bypass it, for speed.
(m4_init): Bypass new implementation, since it breaks on m4_defn.
* bin/autoupdate.in (handle_autoconf_macros): Likewise.
* lib/autoconf/general.m4 (AC_PREREQ): Undefine before redefining,
now that m4_copy checks this.
* doc/autoconf.texi (Redefined M4 Macros) <m4_copy>: Document
this, as well as m4_rename.
* lib/autoconf/autoconf.m4 (m4_copy): Temporarily redefine when
renaming builtins.
* NEWS: Likewise.
* tests/m4sugar.at (m4@&t@_defn): Enhance test.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAC_FUNC_GETGROUPS: Revert regression.
Eric Blake [Fri, 24 Oct 2008 11:42:10 +0000 (05:42 -0600)] 
AC_FUNC_GETGROUPS: Revert regression.

* lib/autoconf/functions.m4 (AC_FUNC_GETGROUPS): Only set
ac_cv_func_getgroups_works=no when it is not available.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoWhitespace cleanup.
Eric Blake [Fri, 24 Oct 2008 01:58:40 +0000 (19:58 -0600)] 
Whitespace cleanup.

* lib/autoconf/fortran.m4: Consistently use tabs.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoFor gfortran on sh, ignore -little.
Chikama Masaki [Fri, 24 Oct 2008 01:41:06 +0000 (19:41 -0600)] 
For gfortran on sh, ignore -little.

* lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS): Add -little to
list of ignored arguments.
* THANKS: Update.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoEliminate empty lines after AC_*_IFELSE.
Paolo Bonzini [Thu, 23 Oct 2008 16:39:57 +0000 (18:39 +0200)] 
Eliminate empty lines after AC_*_IFELSE.

* lib/autoconf/general.m4 (_AC_PREPROC_IFELSE, _AC_COMPILE_IFELSE,
_AC_LINK_IFELSE, _AC_RUN_IFELSE): Add a dnl at end.

16 years agoAvoid a fork in _AC_RUN_LOG and _AC_RUN_LOG_STDERR
Paolo Bonzini [Thu, 23 Oct 2008 16:36:17 +0000 (18:36 +0200)] 
Avoid a fork in _AC_RUN_LOG and _AC_RUN_LOG_STDERR

* lib/autoconf/general.m4 (_AC_RUN_LOG, _AC_RUN_LOG_STDERR):
Return a boolean status code based on $ac_status.

16 years agoEnsure actions can look at conftest* files.
Paolo Bonzini [Thu, 23 Oct 2008 15:58:53 +0000 (17:58 +0200)] 
Ensure actions can look at conftest* files.

* lib/autoconf/general.m4 (_AC_PREPROC_IFELSE_BODY,
_AC_COMPILE_IFELSE_BODY, _AC_LINK_IFELSE_BODY, _AC_RUN_IFELSE_BODY):
Move rm commands, except IPA files and Apple debug symbols...
(_AC_PREPROC_IFELSE, __AC_COMPILE_IFELSE, _AC_LINK_IFELSE,
_AC_RUN_IFELSE): ...in here.
* tests/compile.at: Add regression test.

16 years agoRemove excess dnl from m4sh.
Eric Blake [Thu, 23 Oct 2008 13:07:59 +0000 (07:07 -0600)] 
Remove excess dnl from m4sh.

* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL, _AS_PREPARE)
(_AS_SHELL_FN_WORK, _AS_SHELL_SANITIZE, AS_IF, _AS_ECHO_LOG)
(AS_MESSAGE, AS_ERROR, AS_BASENAME, _AS_BASENAME_PREPARE)
(_AS_DIRNAME_EXPR, AS_DIRNAME, _AS_DIRNAME_PREPARE, AS_ECHO)
(AS_ECHO_N, AS_TEST_X, AS_EXECUTABLE_P, _AS_ME_PREPARE)
(_AS_LINENO_PREPARE, AS_LN_S, AS_MKDIR_P, _AS_PATH_WALK)
(AS_SET_CATFILE, AS_HELP_STRING, AS_TMPDIR, AS_VERSION_COMPARE)
(_AS_TR_SH_PREPARE, AS_TR_SH, _AS_TR_CPP_PREPARE, AS_TR_CPP)
(_AS_TR_PREPARE, AS_VAR_APPEND, AS_VAR_PUSHDEF)
(AS_INIT_GENERATED): Use fewer dnl in m4sh macro bodies.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoUse a shell function for _AC_RUN_IFELSE.
Paolo Bonzini [Mon, 20 Oct 2008 13:35:43 +0000 (15:35 +0200)] 
Use a shell function for _AC_RUN_IFELSE.

* lib/autoconf/general.m4 (_AC_RUN_IFELSE_BODY): New macro.
(_AC_RUN_IFELSE): Use a shell function.
(_AC_RUN_LOG): Avoid subshell for logging.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoFormatting tweak: balance () with m4sh case statements.
Eric Blake [Wed, 22 Oct 2008 20:24:02 +0000 (14:24 -0600)] 
Formatting tweak: balance () with m4sh case statements.

* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL)
(_AS_SHELL_SANITIZE, _AS_ECHO_N_PREPARE, _AS_ECHO_PREPARE)
(AS_SET_CATFILE, _AS_TEST_PREPARE): Add strategic shell comments.
(_AS_CASE, _AS_CASE_DEFAULT, AS_CASE): Rearrange newlines, to
allow output of strategic shell comments.
(AS_VERSION_COMPARE): Use AS_CASE.
* tests/m4sh.at (AS@&t@_IF and AS@&t@_CASE): Enhance test.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAC_FUNC_GETGROUPS: always define $ac_cv_func_getgroups_works
Jim Meyering [Wed, 22 Oct 2008 15:25:46 +0000 (17:25 +0200)] 
AC_FUNC_GETGROUPS: always define $ac_cv_func_getgroups_works

* lib/autoconf/functions.m4 (AC_FUNC_GETGROUPS): Always define
the shell variable, $ac_cv_func_getgroups_works.  Otherwise, if
it is set to "yes" in the environment and configure is run on
a system like mingw that lacks the getgroups function, it would
mistakenly define HAVE_GETGROUPS.  Reported by Simon Josefsson in
<http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/15354>.

16 years agoUse a shell function for _AC_LINK_IFELSE.
Paolo Bonzini [Mon, 20 Oct 2008 13:35:42 +0000 (15:35 +0200)] 
Use a shell function for _AC_LINK_IFELSE.

* lib/autoconf/general.m4 (_AC_LINK_IFELSE_BODY): New macro.
(_AC_LINK_IFELSE): Use a shell function.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoFix autoconf logging commands.
Eric Blake [Wed, 22 Oct 2008 16:50:26 +0000 (10:50 -0600)] 
Fix autoconf logging commands.

* lib/autoconf/general.m4 (AC_MSG_RESULT_UNQUOTED, _AC_EVAL)
(_AC_EVAL_STDERR, AC_RUN_LOG): Respect as_lineno.
(_AC_DO_ECHO): Likewise, and use fewer dnl.
(_AC_RUN_LOG_STDERR): Avoid subshell for logging.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoFix testsuite failure.
Eric Blake [Wed, 22 Oct 2008 11:16:58 +0000 (05:16 -0600)] 
Fix testsuite failure.

* tests/mktests.sh (ac_exclude_list): Don't generate test for
AC_REQUIRE_SHELL_FN.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoImprove wording related to automake and autotest.
Eric Blake [Thu, 16 Oct 2008 13:38:07 +0000 (07:38 -0600)] 
Improve wording related to automake and autotest.

* doc/autoconf.texi (Making testsuite Scripts): Clarify wording in
relation to automake.  Mention dependency on package.m4.
Consolidate examples.  Define AUTOM4TE.
* THANKS: Update.
Reported by William Pursell.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAllow AS_VAR_SET_IF in shell lists.
Eric Blake [Mon, 20 Oct 2008 23:14:03 +0000 (17:14 -0600)] 
Allow AS_VAR_SET_IF in shell lists.

* lib/m4sugar/m4sh.m4 (AS_VAR_SET_IF): Allow continuation of
line.
* lib/autoconf/general.m4 (AC_CACHE_VAL): Supply newline no longer
provided by AS_VAR_SET_IF.
* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL): Adjust
clients.
* lib/autoconf/libs.m4 (AC_SEARCH_LIBS): Likewise.
* tests/m4sh.at (AS@&t@_VAR basics): Enhance test.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAllow AS_VAR_IF in shell lists.
Eric Blake [Mon, 20 Oct 2008 22:56:12 +0000 (16:56 -0600)] 
Allow AS_VAR_IF in shell lists.

* lib/m4sugar/m4sh.m4 (AS_VAR_IF): Allow continuation of line.
* lib/autoconf/functions.m4 (AC_CHECK_FUNC): Adjust clients.
* lib/autoconf/general.m4 (AC_CHECK_FILE, AC_CHECK_DECL):
Likewise.
* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL)
(_AC_CHECK_HEADER_NEW, _AC_CHECK_HEADER_OLD)
(_AC_CHECK_HEADER_DIRENT): Likewise.
* lib/autoconf/libs.m4 (AC_CHECK_LIB): Likewise.
* lib/autoconf/types.m4 (_AC_CHECK_TYPE_NEW, AC_CHECK_MEMBER):
Likewise.
* tests/m4sh.at (AS@&t@_VAR basics): Enhance test.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAllow AS_CASE in shell lists.
Eric Blake [Mon, 20 Oct 2008 22:43:41 +0000 (16:43 -0600)] 
Allow AS_CASE in shell lists.

* lib/m4sugar/m4sh.m4 (AS_CASE): Always execute test, in case of
side effects.  Allow continuation of script on same line as esac.
* lib/autoconf/c.m4 (AC_PROG_CC_STDC): Adjust client.
* tests/m4sh.at (AS@&t@_IF and AS@&t@_CASE): Enhance test.
* NEWS: Document the subtle change.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAllow AS_IF in shell lists.
Eric Blake [Mon, 20 Oct 2008 22:18:05 +0000 (16:18 -0600)] 
Allow AS_IF in shell lists.

* lib/m4sugar/m4sh.m4 (AS_IF): Always execute test, in case of
side effects.  Allow continuation of script on same line as fi.
(_AS_DETECT_BETTER_SHELL): Adjust clients.
(AS_VAR_IF, AS_VAR_SET_IF): For now, supply newline no longer
given by AS_IF.
* lib/autoconf/c.m4 (_AC_PROG_PREPROC_WORKS_IFELSE): Likewise.
* lib/autoconf/general.m4 (_AC_ENABLE_IF): Likewise.
(AC_EGREP_CPP, _AC_RUN_IFELSE): Adjust client.
* lib/autoconf/libs.m4 (AC_SEARCH_LIBS): Likewise.
* doc/autoconf.texi (Common Shell Constructs) <AS_IF>: Fix typo.
(Polymorphic Variables): Move mention of dnl to the only two
AS_VAR functions that need it.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoUse a shell function for _AC_COMPILE_IFELSE.
Paolo Bonzini [Mon, 20 Oct 2008 13:35:24 +0000 (15:35 +0200)] 
Use a shell function for _AC_COMPILE_IFELSE.

* lib/autoconf/general.m4 (_AC_COMPILE_IFELSE_BODY): New macro.
(_AC_COMPILE_IFELSE): Use a shell function.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoUse AS_VAR_APPEND.
Eric Blake [Tue, 21 Oct 2008 16:28:19 +0000 (10:28 -0600)] 
Use AS_VAR_APPEND.

* lib/autoconf/functions.m4 (AC_CHECK_FUNCS_ONCE): Use new macro.
* lib/autoconf/general.m4 (_AC_INIT_PREPARE)
(_AC_LIBOBJS_NORMALIZE): Likewise.
* lib/autoconf/headers.m4 (AC_CHECK_HEADERS_ONCE): Likewise.
* lib/autoconf/status.m4 (_AC_OUTPUT_SUBDIRS)
(_AC_OUTPUT_CONFIG_STATUS, _AC_OUTPUT_MAIN_LOOP): Likewise.
* lib/autotest/general.m4 (AT_INIT): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAdd AS_VAR_APPEND.
Eric Blake [Mon, 20 Oct 2008 11:50:01 +0000 (05:50 -0600)] 
Add AS_VAR_APPEND.

* lib/m4sugar/m4sh.m4 (_AS_VAR_APPEND_PREPARE)
(_AS_VAR_APPEND_WORKS, AS_VAR_APPEND): New macros.
(AS_PREPARE, _AS_PREPARE): Emit preparation.
* tests/m4sh.at (AS@&t@_VAR_APPEND): New test.
* doc/autoconf.texi (Polymorphic Variables) <AS_VAR_APPEND>:
Document new macro.
<AS_VAR_SET>: Mention ramification of `""` rules.
* NEWS: Mention new macro.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoUse a shell function for _AC_PREPROC_IFELSE.
Paolo Bonzini [Tue, 21 Oct 2008 14:55:05 +0000 (08:55 -0600)] 
Use a shell function for _AC_PREPROC_IFELSE.

* lib/autoconf/general.m4 (_AC_PREPROC_IFELSE_BODY): New macro.
(_AC_PREPROC_IFELSE): Use a shell function.
* lib/m4sugar/m4sh.m4 (AS_REQUIRE): Factor for faster execution.
(AS_REQUIRE_SHELL_FN): Bypass AS_REQUIRE if function has already
been provided.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAdd banners to generated files.
Eric Blake [Tue, 21 Oct 2008 14:27:07 +0000 (08:27 -0600)] 
Add banners to generated files.

* lib/autotest/general.m4 (AT_INIT): Make banners consistent.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAdd banners to generated files.
Eric Blake [Tue, 21 Oct 2008 14:00:57 +0000 (08:00 -0600)] 
Add banners to generated files.

* lib/m4sugar/m4sh.m4 (_AS_SHELL_SANITIZE): Use m4_text_box for
existing banner.
(AS_INIT): Add new banners at strategic points.
* lib/autoconf/general.m4 (AC_INIT): Alter banner location, and
make consistent with other banners.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAdd AC_REQUIRE_SHELL_FN and the SHELL_FN diversion.
Paolo Bonzini [Sat, 18 Oct 2008 12:37:11 +0000 (14:37 +0200)] 
Add AC_REQUIRE_SHELL_FN and the SHELL_FN diversion.

* lib/autoconf/general.m4 (AC_REQUIRE_SHELL_FN): New.
(m4_divert(SHELL_FN)): New.

16 years agoAvoid unportable use of echo in testsuite.
Eric Blake [Mon, 20 Oct 2008 20:03:36 +0000 (22:03 +0200)] 
Avoid unportable use of echo in testsuite.

* tests/m4sh.at (AS@&t@_VAR basics): Use AS_ECHO, since string
contains backslash.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoMake sure that nested AS_REQUIRE do not lose the desired diversion.
Paolo Bonzini [Sat, 18 Oct 2008 13:08:17 +0000 (15:08 +0200)] 
Make sure that nested AS_REQUIRE do not lose the desired diversion.

* lib/m4sugar/m4sh.m4 (AS_REQUIRE): Expand _m4_divert_desired before
passing it to m4_divert_require, so that its content is not used
anymore.
* tests/m4sh.at (Nested AS_REQUIRE): New testcase.

16 years agoDocument bugs in { } handling.
Eric Blake [Sat, 18 Oct 2008 13:27:45 +0000 (07:27 -0600)] 
Document bugs in { } handling.

* doc/autoconf.texi (Limitations of Builtins): Mention bug on
empty list.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoFix some testsuite failures introduced two days ago.
Eric Blake [Sat, 18 Oct 2008 12:48:55 +0000 (06:48 -0600)] 
Fix some testsuite failures introduced two days ago.

* tests/m4sh.at (Nested AS@&t@_REQUIRE_SHELL_FN)
(AS@&t@_REQUIRE_SHELL_FN and m4@&t@_require): Adjust to changed
API.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoShow how to extract single substitutions from config.status.
Ralf Wildenhues [Sat, 18 Oct 2008 12:40:56 +0000 (14:40 +0200)] 
Show how to extract single substitutions from config.status.

* doc/autoconf.texi (config.status Invocation): Show example
using `--file=-'.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
16 years agoAdd m4_curry.
Eric Blake [Wed, 15 Oct 2008 17:55:45 +0000 (11:55 -0600)] 
Add m4_curry.

* lib/m4sugar/m4sugar.m4 (m4_curry, _m4_curry): New macros.
* tests/m4sugar.at (m4@&t@_map_args): Rename...
(m4@&t@_map_args and m4@&t@_curry): ...and add currying tests.
* doc/autoconf.texi (Looping constructs) <m4_map_args>: Document
currying as a way to add parameters.
(Evaluation Macros) <m4_curry>: Document the new macro.
* NEWS: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoImprove suggested test filtering.
Eric Blake [Fri, 17 Oct 2008 22:12:17 +0000 (16:12 -0600)] 
Improve suggested test filtering.

* lib/m4sugar/m4sh.m4 (_AS_DETECT_SUGGESTED_PRUNE): New macro,
extracted from...
(_AS_DETECT_BETTER_SHELL): ...here, to use faster API.  No need to
check for an empty required set.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAdd m4_set_map.
Eric Blake [Mon, 13 Oct 2008 21:37:31 +0000 (15:37 -0600)] 
Add m4_set_map.

* lib/m4sugar/m4sugar.m4 (m4_set_foreach): New macro.
* tests/m4sugar.at (m4@&t@_set): Enhance test.
* doc/autoconf.texi (Set manipulation Macros) <m4_set_map>:
Document it.
* NEWS: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoDocument m4_map_args.
Eric Blake [Mon, 13 Oct 2008 16:46:40 +0000 (10:46 -0600)] 
Document m4_map_args.

* lib/m4sugar/m4sugar.m4 (m4_transform, m4_transform_pair):
Rename...
(m4_map_args, m4_map_args_pair): ...to these names, and document.
(m4_version_unletter): Use the interface.
* lib/m4sugar/foreach.m4 (m4_map_args, m4_map_args_pair)
(_m4_map_args_, _m4_map_args_pair_, _m4_map_args_pair_end):
Perform same renames.
* lib/m4sugar/m4sh.m4 (AS_CASE, AS_IF): Adjust callers.
* tests/m4sugar.at (m4@&t@_map_args): New test.
(recursion): Adjust caller.
* tests/m4sh.at (AS@&t@_IF and AS@&t@_CASE): Likewise.
* doc/autoconf.texi (Looping constructs) <m4_map_args>: Document
this interface.
* NEWS: Mention the new macros.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoReduce vertical whitespace in configure.
Eric Blake [Fri, 17 Oct 2008 19:27:20 +0000 (13:27 -0600)] 
Reduce vertical whitespace in configure.

* lib/autoconf/general.m4 (AC_INIT): Silence newline output during
m4 side effect initializations.
* lib/m4sugar/m4sh.m4 (AS_PREPARE): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoDocument AS_VAR interfaces.
Eric Blake [Fri, 17 Oct 2008 16:36:18 +0000 (10:36 -0600)] 
Document AS_VAR interfaces.

* doc/autoconf.texi (Programming in M4sh): M4sh is now prime-time.
(Polymorphic Variables): New node.
* NEWS: Update accordingly.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoTest AS_VAR interfaces.
Eric Blake [Fri, 17 Oct 2008 13:31:06 +0000 (07:31 -0600)] 
Test AS_VAR interfaces.

* tests/m4sh.at (AS@&t@_VAR): New test.
* lib/m4sugar/m4sh.m4 (AS_VAR_PUSHDEF): Force expansion of
_AS_TR_SH_PREPARE at top level, rather than argument collection.
(AS_TR_SH): Support command substitution.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAdd AS_VAR_COPY.
Eric Blake [Fri, 17 Oct 2008 20:07:11 +0000 (14:07 -0600)] 
Add AS_VAR_COPY.

* lib/m4sugar/m4sh.m4 (AS_VAR_COPY): New macro.
(AS_VAR_IF): Use it, instead of the broken AS_VAR_GET.
* lib/autoconf/general.m4 (AC_CACHE_CHECK): Likewise.
* lib/autoconf/libs.m4 (AC_SEARCH_LIBS): Likewise.
* lib/autotest/general.m4 (_AT_FINISH): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoSort AS_VAR_* interfaces.
Eric Blake [Fri, 17 Oct 2008 20:01:49 +0000 (14:01 -0600)] 
Sort AS_VAR_* interfaces.

* lib/m4sugar/m4sh.m4 (AS_VAR_GET): Reduce output to one line.
(AS_VAR_TEST_SET, AS_VAR_SET, AS_VAR_SET_IF, AS_VAR_POPDEF): Sort,
no code changes.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAllow comments before functions emitted by m4sh.
Eric Blake [Fri, 17 Oct 2008 02:08:06 +0000 (20:08 -0600)] 
Allow comments before functions emitted by m4sh.

* lib/m4sugar/m4sh.m4 (AS_REQUIRE_SHELL_FN): Add comment
argument.  Supply closing comment, to ease readability.
(_AS_MKDIR_P_PREPARE): Adjust caller.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAdd AS_FUNCTION_DESCRIBE.
Eric Blake [Fri, 17 Oct 2008 01:59:11 +0000 (19:59 -0600)] 
Add AS_FUNCTION_DESCRIBE.

* lib/m4sugar/m4sh.m4 (AS_FUNCTION_DESCRIBE): New macro.
* lib/autotest/general.m4 (AT_INIT): Use it.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoSpeed up m4_qlen with caching.
Eric Blake [Thu, 16 Oct 2008 16:14:09 +0000 (10:14 -0600)] 
Speed up m4_qlen with caching.

* lib/m4sugar/m4sugar.m4 (_m4_qlen): Renamed from old m4_qlen.
(m4_qlen): Cache results for speed.

Signed-off-by: Eric Blake <ebb9@byu.net>