Commit Graph

2565 Commits

Author SHA1 Message Date
Paolo Bonzini
29e6e30d37 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.
2008-10-28 14:58:23 +01:00
Paolo Bonzini
09012d045b 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.
2008-10-28 14:52:30 +01:00
Paolo Bonzini
37dd5e9c49 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.
2008-10-28 13:22:54 +01:00
Eric Blake
d783e51764 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>
2008-10-27 17:22:40 -06:00
Eric Blake
cb34ecf15c 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>
2008-10-27 16:34:58 -06:00
Eric Blake
cfa144a955 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>
2008-10-27 16:11:59 -06:00
Eric Blake
bc9d68de41 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>
2008-10-27 16:11:56 -06:00
Eric Blake
cf99ea9775 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>
2008-10-27 16:04:12 -06:00
Paolo Bonzini
281988f2e2 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.
2008-10-27 19:33:17 +01:00
Paolo Bonzini
c8cc5be07a 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.
2008-10-27 16:05:00 +01:00
Paolo Bonzini
e90bd84ac8 use a shell function for AC_CHECK_DECL
* lib/autoconf/general.m4 (_AC_CHECK_DECL_BODY): New.
(AC_CHECK_DECL): Use a shell function.
2008-10-27 16:04:56 +01:00
Paolo Bonzini
439f33b1c3 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.
2008-10-27 16:02:37 +01:00
Paolo Bonzini
57079f4e33 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>
2008-10-25 07:45:31 -06:00
Eric Blake
ce2d0f043c 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>
2008-10-25 06:45:57 -06:00
Eric Blake
8425d6363b 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>
2008-10-24 17:14:40 -06:00
Eric Blake
89e95fc78b Speed up AC_CHECK_HEADER.
* lib/autoconf/headers.m4 (AC_CHECK_HEADER): Factor out $@.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-24 16:41:20 -06:00
Paolo Bonzini
2509abe0dc 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>
2008-10-24 15:26:25 -06:00
Eric Blake
6369d61222 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>
2008-10-24 12:09:48 -06:00
Eric Blake
b4bb9caba2 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>
2008-10-24 11:24:32 -06:00
Eric Blake
d0c5f482d5 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>
2008-10-24 07:13:17 -06:00
Eric Blake
2922868b72 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>
2008-10-24 06:41:49 -06:00
Eric Blake
21bd2e490b 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>
2008-10-24 05:42:10 -06:00
Eric Blake
58a97ecfca Whitespace cleanup.
* lib/autoconf/fortran.m4: Consistently use tabs.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-23 19:58:40 -06:00
Chikama Masaki
3f38aadc7c 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>
2008-10-23 19:52:05 -06:00
Paolo Bonzini
c0866235e2 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.
2008-10-23 18:39:57 +02:00
Paolo Bonzini
db60987f02 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.
2008-10-23 18:37:08 +02:00
Paolo Bonzini
1cab7acd4a 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.
2008-10-23 18:02:14 +02:00
Eric Blake
f6ca9fec69 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>
2008-10-23 09:37:47 -06:00
Paolo Bonzini
f2f5427543 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>
2008-10-23 06:35:59 -06:00
Eric Blake
d7921337d3 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>
2008-10-23 06:13:06 -06:00
Jim Meyering
b218c046a6 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>.
2008-10-23 10:06:15 +02:00
Paolo Bonzini
30249d93c1 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>
2008-10-22 11:29:18 -06:00
Eric Blake
5042ddd81f 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>
2008-10-22 11:29:11 -06:00
Eric Blake
ca7380b2a8 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>
2008-10-21 21:04:20 -06:00
Eric Blake
0467924f24 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>
2008-10-21 21:04:11 -06:00
Eric Blake
e84e41e106 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>
2008-10-21 21:04:02 -06:00
Eric Blake
b837cd019d 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>
2008-10-21 21:03:57 -06:00
Paolo Bonzini
6d4ddfda94 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>
2008-10-21 21:00:00 -06:00
Eric Blake
6ae40b3dae 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>
2008-10-21 15:03:45 -06:00
Eric Blake
86ce15b622 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>
2008-10-21 15:03:17 -06:00
Paolo Bonzini
89839f42af 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>
2008-10-21 10:42:34 -06:00
Eric Blake
91fd5ef60a Add banners to generated files.
* lib/autotest/general.m4 (AT_INIT): Make banners consistent.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-21 08:27:07 -06:00
Eric Blake
b8b7615a43 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>
2008-10-21 08:00:57 -06:00
Paolo Bonzini
98c907d8de Add AC_REQUIRE_SHELL_FN and the SHELL_FN diversion.
* lib/autoconf/general.m4 (AC_REQUIRE_SHELL_FN): New.
(m4_divert(SHELL_FN)): New.
2008-10-20 18:58:59 -04:00
Paolo Bonzini
5969d90008 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.
2008-10-19 00:01:16 +02:00
Eric Blake
c6b172ee19 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>
2008-10-17 16:32:27 -06:00
Eric Blake
a00c4430ba 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>
2008-10-17 16:23:21 -06:00
Eric Blake
92f34215fc 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>
2008-10-17 16:02:48 -06:00
Eric Blake
f4ace96990 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>
2008-10-17 16:00:57 -06:00
Eric Blake
093eca1787 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>
2008-10-17 15:48:51 -06:00
Eric Blake
c7f3d4ef19 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>
2008-10-17 15:48:17 -06:00
Eric Blake
6e3761f85f 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>
2008-10-17 14:07:11 -06:00
Eric Blake
7fdde10b5f 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>
2008-10-17 14:01:49 -06:00
Eric Blake
29f8f14acd 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>
2008-10-16 20:25:28 -06:00
Eric Blake
d99fef0e1e 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>
2008-10-16 19:59:11 -06:00
Eric Blake
257a2a68d0 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>
2008-10-16 10:50:25 -06:00
Paolo Bonzini
a38c243f00 Fix Libtool's config.lt test.
* lib/m4sugar/m4sh.m4 (_AS_PREPARE): Disable AS_REQUIRE while
expanding it.
2008-10-16 10:41:51 +02:00
Eric Blake
7eba1c0ae0 Break circular require chain in _AS_LINENO_PREPARE.
* lib/m4sugar/m4sh.m4 (_AS_LINENO_PREPARE): Ensure that logging is
disabled when reporting LINENO failure, since logging requires
LINENO.
* doc/autoconf.texi (Initialization Macros): Recommend m4_pushdef,
not m4_rename, since the latter is undocumented.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Avoid
m4_rename, as it does not yet handle pushdef stacks.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-15 16:19:04 -06:00
Eric Blake
6edff90b47 Cleanups to previous patches.
* doc/autoconf.texi (Portable Shell): Minor edits.
(Limitations of Builtins): Touch up wording.
* lib/m4sugar/m4sh.m4 (AS_LINENO_PUSH): Nuke trailing whitespace.
(_AS_SHELL_SANITIZE): Wrap comments less than 80 columns.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-15 11:22:25 -06:00
Paolo Bonzini
26ba5ebd23 Assume a (possibly buggy) unset' is present after a better shell' was found.
* lib/autoconf/general.m4 (_AC_CACHE_DUMP): Use AS_UNSET.
* lib/autoconf/programs.m4 (AC_PROG_SED): Use AS_UNSET.
* lib/m4sugar/m4sh.m4 (_AS_UNSET_PREPARE): Provide $as_unset as an
alias for AS_UNSET, for backwards compatibility.
(_AS_DETECT_BETTER_SHELL): Set BASH_ENV and ENV to /dev/null in case
the shell does not support unset.
(_AS_SHELL_SANITIZE): Work around Bash 2.01 bugs.  Unset BASH_ENV.
(AS_INIT, _AS_PREPARE, AS_PREPARE): Call it.
(AS_UNSET): Assume it is there but it might fail if the variable is
not set.  Use it throughout instead of $as_unset.
2008-10-15 16:05:07 +02:00
Paolo Bonzini
d73b293fd3 Turn AS_SHELL_SANITIZE into a for-Libtool-only wrapper.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_REQUIRED, _AS_DETECT_SUGGESTED): Remove
m4_require of _AS_DETECT_BETTER_SHELL.
(_AS_CLEANUP): Add it here.
(_AS_DETECT_BETTER_SHELL): Just expand the test instead of appending it
to _AS_CLEANUP.
(_AS_SHELL_SANITIZE): New name of the old AS_SHELL_SANITIZE macro.
(AS_SHELL_SANITIZE): New macro hacking around Libtool misuse.
(AS_PREPARE): Use _AS_SHELL_SANITIZE.
(AS_INIT): Add m4_provide of itself.
2008-10-15 16:04:39 +02:00
Paolo Bonzini
cde022163b Use "test x$foo = xyes" to avoid upsetting Libtool's sh.test.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL, _AS_SHELL_FN_WORK): Use
"test x$foo = xyes".
2008-10-15 16:04:08 +02:00
Paolo Bonzini
6265de13fe Trim down the size of the better-shell test.
* lib/m4sugar/m4sh.at (_AT_DETECT_BETTER_SHELL): Store the common
snippets into shell variables.
(_AS_RUN): Rewrite.
2008-10-15 11:06:02 +02:00
Paolo Bonzini
270c996180 Support a stack of LINENO values for AS_MESSAGE.
* lib/m4sugar/m4sh.m4 (_AS_ECHO_LOG): If defined, use $as_lineno as
the line number emitted to the log file.
(AS_LINENO_PUSH, AS_LINENO_POP): New.
* tests/m4sh.at (LINENO Stack): New test.
2008-10-15 11:06:01 +02:00
Paolo Bonzini
920874ceda Use m4_require to implement AS_REQUIRE.
* lib/m4sugar/m4sugar.m4 (_m4_require_call): Accept a third argument.
(m4_require): Pass it.
(m4_divert_require): New.
* lib/m4sugar/m4sh.m4 (AS_REQUIRE): Rewrite using m4_divert_require.
Remove comment about differences with m4_require.
* tests/m4sh.at (AS_REQUIRE_SHELL_FN and m4_require): Update to test
the expected behavior.
(Nested AS_REQUIRE_SHELL_FN): New test.
2008-10-14 15:14:12 +02:00
Paolo Bonzini
45f473304f Add and document AS_INIT_GENERATED.
* lib/m4sugar/m4sh.m4 (AS_INIT_GENERATED): New.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Use it.
* doc/autoconf.texi (Initialization macros): Document it.
2008-10-13 18:01:21 +02:00
Eric Blake
0ba284a888 Use consistent shell function style.
* lib/m4sugar/m4sh.m4 (_AS_PREPARE, AS_REQUIRE_SHELL_FN)
(_AS_SHELL_FN_WORK): Imitate GNU Coding Standards for C
functions.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-13 08:50:25 -06:00
Paolo Bonzini
c04c47665c place names of contributors under m4 rather than shell comments
2008-10-12  Paolo Bonzini  <bonzini@gnu.org>

	* lib/m4sugar/m4sh.m4 (_AS_LINENO_PREPARE): Place names of
	contributors under m4 rather than shell comments.
2008-10-13 14:27:35 +02:00
Paolo Bonzini
06bceefef2 Add and document AS_ME_PREPARE and AS_LINENO_PREPARE
2008-10-10  Paolo Bonzini  <bonzini@gnu.org>

	* lib/m4sugar/m4sh.m4 (AS_ME_PREPARE, AS_LINENO_PREPARE): New.
	* doc/autoconf.texi (Initialization macros): Document them.
	(Portable Shell): Refer to AS_LINENO_PREPARE.

	* bin/autoconf.as: Invoke AS_ME_PREPARE.
	* lib/autotest/general.m4: Likewise.
2008-10-11 13:30:38 +02:00
Eric Blake
523ee0e116 Fix _AS_MKDIR_P usage.
* lib/m4sugar/m4sh.m4 (_AS_MKDIR_P): Correct documentation to
match implementation.
(_AS_PREPARE, _AS_MKDIR_P_PREPARE): Adjust callers.
* doc/autoconf.texi (Programming in M4sh) <AS_MKDIR_P>: Tweak
wording to better match behavior.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-10 08:40:09 -06:00
Paolo Bonzini
b9de80b2dc use a shell function for AS_MKDIR_P
2008-10-10  Paolo Bonzini  <bonzini@gnu.org>

	* m4sugar/m4sh.m4 (_AS_MKDIR_P): New, from AS_MKDIR_P.  Adjust
	meaning of as_mkdir_p to be `false' or a full `mkdir -p' command.
	(AS_MKDIR_P): Just dispatch to as_func_mkdir_p.
	(_AS_PREPARE): Define shell functions.
	(_AS_MKDIR_P_PREPARE): Set as_mkdir_p according to the above change.
	Define shell functions.
2008-10-10 15:03:22 +02:00
Eric Blake
01dd2bedd0 Only prepare $as_me if it will be used.
* lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Avoid unconditional
preparation.
(_AS_ECHO_LOG): Depend on $LINENO preparation.
(AS_MESSAGE): Depend on $as_me preparation.
(AS_TMPDIR): Use AS_ERROR, rather than a hand-rolled copy.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-09 10:58:11 -06:00
Paolo Bonzini
dd0654cc13 more cleanup before adding shell functions
2008-10-09  Paolo Bonzini  <bonzini@gnu.org>

	* m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Delay setting as_me
	until the M4SH-INIT diversion using _AS_ME_PREPARE.
	(_AS_PREPARE): Invoke _AS_EXPR_PREPARE before _AS_BASENAME_PREPARE
	and _AS_DIRNAME_PREPARE, and _AS_BASENAME_PREPARE and _AS_ME_PREPARE
	before _AS_LINENO_PREPARE.
	(AS_PREPARE): Include all the AS_REQUIREs manually.
	(_AS_ME_PREPARE): New.
	(_AS_LINENO_PREPARE): Use m4_defun.
2008-10-09 16:04:59 +02:00
Paolo Bonzini
34b79a8a83 avoid problems when _AS_BASENAME_EXPR are invoked before _AS_EXPR_PREPARE
2008-10-09  Paolo Bonzini  <bonzini@gnu.org>

	* m4sugar/m4sh.m4 (_AS_BASENAME_EXPR, _AS_DIRNAME_EXPR): Do not
	require _AS_EXPR_PREPARE.
	(_AS_BASENAME_PREPARE, _AS_DIRNAME_PREPARE): Do it here.
	(_AS_PREPARE): Add _AS_BASENAME_PREPARE.
2008-10-09 15:41:14 +02:00
Paolo Bonzini
734abde3de remove shell function "spy" 2008-10-08 06:17:43 -06:00
Paolo Bonzini
926ed6a975 place _AS_UNSET_PREPARE in the right diversion 2008-10-08 06:10:10 -06:00
Eric Blake
f789b40e97 Avoid repeating required shell tests in suggested set.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_REQUIRED, _AS_DETECT_SUGGESTED):
Use m4_set, rather than m4_expand_once/m4_append.
(_AS_DETECT_SUGGESTED): Adjust to new storage layout, and filter
required tests out of suggested tests.
Reported by Paolo Bonzini.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-08 05:53:45 -06:00
Ralf Wildenhues
4da97747ef Do not write to testsuite log fd before initialization.
* lib/autotest/general.m4 (AS_MESSAGE_LOG_FD, AT_JOB_FIFO_FD):
Define fds only when initializing the log fd so early error
messages do not try to write to it.
* tests/autotest.at (Startup error messages): New test.
* NEWS: Document this 2.63 regression.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-10-08 07:24:06 +02:00
Eric Blake
6f106cdead Ensure _AS_CLEANUP is defined.
* lib/m4sugar/m4sh.m4 (_AS_CLEANUP): Give initial definition.
* tests/m4sh.at (AS@&t@_INIT cleanup): Expose the need for this.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-07 12:11:01 -06:00
Eric Blake
7e1c6397cc Improve m4sh maintainability.
* lib/m4sugar/m4sh.m4: Sort macros for sanitizing the shell; no
code change.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-07 10:55:05 -06:00
Eric Blake
a2f7e1aa97 Fix m4 quoting in previous patch.
* lib/m4sugar/m4sh.m4 (AS_REQUIRE_SHELL_FN): Determine diversion
name prior to invoking AS_REQUIRE.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-07 06:14:34 -06:00
Paolo Bonzini
95268678f0 add a separate diversion for shell functions
* lib/m4sugar/m4sh.m4 (M4SH-INIT-FN): New diversion.
(AS_REQUIRE): Accept diversion parameter.
(AS_REQUIRE_SHELL_FN): Use it.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-06 21:35:11 -06:00
Eric Blake
b30850a851 Add m4_default_quoted.
* lib/m4sugar/m4sugar.m4 (m4_default_quoted): New macro.
(m4_for, m4_expand_once, m4_text_wrap, m4_text_box): Use it.
* doc/autoconf.texi (Conditional constructs): Document it.
* NEWS: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-06 20:19:32 -06:00
Ralf Wildenhues
22e3751d19 Fix more testsuite hang corner cases.
* lib/autotest/general.m4: Use the serial code path if no test
is to be run.
* tests/autotest.at (parallel test execution): Test -j and -jN
with `-k notmatched'.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-10-03 07:21:25 +02:00
Ralf Wildenhues
1d8609399d Fix hang with `testsuite -k notmatched'.
* lib/autotest/general.m4: Do not reset $at_jobs if it is equal
to one.  Fixes hang with `-k notmatched'.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-10-02 20:44:22 +02:00
Ralf Wildenhues
f108ed8925 Implement parallel Autotest test execution: testsuite --jobs.
* lib/autotest/general.m4 (AT_JOB_FIFO_FD): New macro.
(AT_INIT): <at_jobs>: New variable.
Accept -j, -jN, --jobs[=N], document them in --help output.
Implement parallel driver loop using a FIFO, enabled with --jobs
and if mkfifo works; otherwise, fall back to sequential loop.
(AT_SETUP): Store, do not output summary progress line if
parallel.
* tests/autotest.at (parallel test execution, parallel truth)
(parallel fallacy, parallel skip): New tests.
* doc/autoconf.texi (testsuite Invocation): Document -j, --jobs,
the mkfifo requirement, and that --errexit may cause concurrent
jobs to finish.
* NEWS: Update.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-10-02 07:52:25 +02:00
Eric Blake
20c24928ab Fix Erlang regression, introduced 2006-11-17.
* lib/autoconf/erlang.m4 (AC_LANG(Erlang)): Avoid M4 comment
caused by underquoting.
* NEWS: Mention this fix.
* THANKS: Update.
Reported by BJ Terry.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-09-16 06:41:46 -06:00
Ralf Wildenhues
93d9386de9 Improve AC_CONFIG_AUX_DIRS a bit.
* lib/autoconf/general.m4 (AC_CONFIG_AUX_DIRS): Improve a bit.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-09-13 15:19:25 +02:00
Eric Blake
69a905148d Relax tone when warning about cross-compiler names.
* lib/autoconf/programs.m4 (_AC_TOOL_WARN): Support cross-compiles
with poorly named tools; the issue has been reported too many
times in the last four years to pull support.
* doc/autoconf.texi (Specifying Names, Generic Programs): Update
documentation accordingly.
* THANKS: Update.
Reported by Josef Tran and others, wording suggested by Ralf
Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-09-06 13:51:00 -06:00
Eric Blake
7bb64f8f94 Improve AC_C_BIGENDIAN.
* doc/autoconf.texi (C Compiler) <AC_C_BIGENDIAN>: Mention that
universal builds require a config header.
* lib/autoconf/c.m4 (AC_C_BIGENDIAN): Enhance comments.  Check
AH_HEADER at the last possible moment, so that users can use
AC_CONFIG_HEADER after this macro.
Reported by Stepan Kasal.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-09-01 19:48:41 -06:00
Eric Blake
d0098d52bc Fix off-by-one bug in _m4_shiftn.
* lib/m4sugar/foreach.m4 (_m4_shiftn): Handle case when shifting
all arguments.
* tests/m4sugar.at (M4 loops): Test it.
Reported by Akim Demaille.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-27 20:30:25 -06:00
Eric Blake
f4df9b9b40 Update invocation documentation.
* doc/autoconf.texi (autoscan Invocation): Mention --debug.
(autoreconf Invocation): Mention -v.
(autom4te Invocation): Tie --freeze to -F, not -f.
(autoupdate Invocation): Mention --prepend-include.
* doc/install.texi (configure Invocation): Mention --help=short,
--help=recursive, -n/--no-create, --prefix.  Avoid TABs.
* bin/autoscan.in ($help): Omit space before `...'.
* bin/ifnames.in ($help): Likewise.
* bin/autoconf.as (Usage): Likewise.
* bin/autoreconf.in ($help): Likewise.
* bin/autoheader.in ($help): Likewise.
* bin/autom4te.in ($help): Likewise.
* bin/autoupdate.in ($help): Likewise.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Use
`[OPTION]...', rather than `[OPTIONS]'.  Mention --silent.  Indent
--file correctly.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-26 09:28:15 -06:00
Eric Blake
5391c02b40 Adjust to recent m4 1.6 change to support m4_debugmode(d).
* lib/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine): Move
freeze-time decision of using faster 1.6 implementation...
(m4_init): ...to a runtime decision, and add use of new debugmode
flag.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-25 16:28:29 -06:00
Peter O'Gorman
b0e687ef42 Limit AC_C_BIGENDIAN univeral checks to Mac OS X.
* lib/autoconf/c.m4 (AC_C_BIGENDIAN): Limit the check to
__APPLE_CC__ with possible -arch flags.
* NEWS: Document it.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-08-22 18:18:25 +02:00
Eric Blake
ce818dc20b Add reminder to keep dual implementations in sync.
* lib/m4sugar/m4sugar.m4: Add comments.
* lib/m4sugar/foreach.m4: Likewise.
Suggested by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-22 07:26:33 -06:00
Peter Eisentraut
e25b72286f Format warning and error messages to match GCS.
* lib/autoconf/general.m4 (_AC_INIT_DIRCHECK)
(_AC_INIT_PARSE_ARGS, _AC_CACHE_DUMP): Start warning and error
messages with a lowercase letter, end them without punctuation.
* lib/autoconf/lang.m4 (AC_NO_EXECUTABLES): Likewise.
* lib/autoconf/libs.m4 (AC_PATH_X): Likewise.
* lib/autoconf/status.m4 (AC_OUTPUT, _AC_OUTPUT_MAIN_LOOP):
Likewise.
* tests/fortran.at (GNU Fortran): Likewise.
* tests/torture.at (Deep Package): Likewise.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-08-22 08:51:53 +02:00
Eric Blake
550a9fa1e1 Avoid extra side effects in m4sugar list expansion.
* lib/m4sugar/m4sugar.m4 (m4_mapall_sep, m4_list_cmp): Wrap
around...
(_m4_mapall_sep, _m4_list_cmp_raw): ...new helpers, to avoid
duplicate side effects.
(m4_version_compare): Adjust caller.
* lib/m4sugar/foreach.m4 (m4_list_cmp): Rename...
(_m4_list_cmp_raw): ...to match m4sugar.
* doc/autoconf.texi (Looping constructs): Document the behavior of
side effects.
* tests/m4sugar.at (M4 loops, m4@&t@_map, m4@&t@_version_compare):
Ensure only one side effect.
(recursion): Fix test typo.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-21 22:17:33 -06:00
Jim Meyering
f5de6cdf5a Avoid shell parse errors after interrupt due to empty ``.
* doc/autoconf.texi (Shell Substitutions): Document the issue.
* lib/m4sugar/m4sh.m4 (AS_VAR_IF): New function.
* lib/autoconf/functions.m4 (AC_CHECK_FUNC): Use it in place of
"test AS_VAR_GET([...]) = yes"
* lib/autoconf/general.m4 (AC_CHECK_FILE, AC_CHECK_DECL): Likewise.
* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL): Likewise.
(_AC_CHECK_HEADER_NEW, _AC_CHECK_HEADER_OLD): Likewise.
(_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.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Use
temporary variable to work around the issue.
* tests/foreign.at (Libtool): Quote result of command
substitution.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-08-19 23:00:51 +02:00
Eric Blake
aeff96ce94 Fix m4_map regression from 2007-10-16.
* lib/m4sugar/m4sugar.m4 (_m4_apply): New macro.
(m4_map): Ignore empty sublists.  For a list consisting of only an
empty sublist, this restores 2.61 behavior of being a no-op.
(m4_map_sep): Likewise, and expand separator.
(m4_mapall, m4_mapall_sep): New macros, to regain 2.62 behavior.
(_m4_map): Rewrite, to be common base for all four variants.
* lib/m4sugar/foreach.m4 (_m4_map): Adjust to new prototype.
* tests/m4sugar.at (m4@&t@_map): Add tests.
* doc/autoconf.texi (Looping constructs) <m4_map>: Document new
macros, and mention ramifications of expanded separator.
* NEWS: Mention the change.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-15 07:06:39 -06:00
Eric Blake
903b58ef95 Implement m4_transform_pair, to speed up AS_IF.
* lib/m4sugar/m4sugar.m4 (m4_transform, m4_transform_pair): New
macros, undocumented for now.
* lib/m4sugar/foreach.m4 (m4_transform, m4_transform_pair): Also
the m4 1.4.x counterparts.
* lib/m4sugar/m4sh.m4 (AS_IF, AS_CASE): Use it.
* tests/m4sh.at (AS@&t@_IF and AS@&t@_CASE): Test it.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-14 21:51:40 -06:00