Commit Graph

2498 Commits

Author SHA1 Message Date
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