Commit Graph

609 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Eric Blake
ce0298d64e Optimize m4_bmatch.
* lib/m4sugar/foreach.m4 (m4_bmatch): Provide linear
implementation for m4 1.4.x.
* tests/m4sugar.at (m4@&t@_bmatch): New test.
(recursion): Test the linear nature.
* NEWS: Document the fix.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-12 15:29:39 -06:00
Eric Blake
430dd8892b Fix m4_cond corner case.
* lib/m4sugar/foreach.m4 (_m4_cond): Ensure alternate
implementation allows concatenation with subsequent text.
* tests/m4sugar.at (m4@&t@_cond): Enhance test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-12 09:18:53 -06:00
Eric Blake
694606d338 Add linear m4_cond for m4 1.4.x.
* lib/m4sugar/m4sugar.m4 (m4_cond): Split into...
(_m4_cond): ...this, for fewer macros per iteration.
* lib/m4sugar/foreach.m4 (_m4_cond): New implementation.
* tests/m4sugar.at (recursion): Test it.
* NEWS: Document the linear guarantee.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-06 09:57:08 -06:00
Eric Blake
565b34d33b Speed up diversion handling.
* lib/m4sugar/m4sugar.m4 (m4_divert, m4_divert_push)
(m4_divert_pop, m4_divert_text): Avoid dnl for fewer macro
expansions.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-06 09:56:59 -06:00
Eric Blake
550a531311 Fix bugs in previous version of m4_bpatsubsts.
* lib/m4sugar/foreach.m4 (_m4_bpatsubsts): Don't expand $1, and
allow concatenation with subsequent text.
* tests/m4sugar.at (m4@&t@_bpatsubsts): Enhance test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-30 09:45:21 -06:00
Eric Blake
8d81fd7f28 Add linear m4_bpatsubsts for m4 1.4.x.
* lib/m4sugar/m4sugar.m4 (m4_bpatsubsts): Match documentation
about anchors, even for only one substitution.
* lib/m4sugar/foreach.m4 (_m4_bpatsubsts): New implementation.
* doc/autoconf.texi (Conditional constructs) <m4_bpatsubsts>:
Clarify behavior with regard to quoting.
* tests/m4sugar.at (recursion): Test scaling of m4_bpatsubsts.
(m4@&t@_bpatsubsts): New test.
* NEWS: Document the linear guarantee.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-29 20:37:30 -06:00
Eric Blake
a40eef5129 Tweak m4_do semantics.
* lib/m4sugar/m4sugar.m4 (m4_do): Don't concat final argument with
subsequent text.
* lib/m4sugar/foreach.m4 (m4_do): Don't concat intermediate
arguments, and avoid infinite loop.
* doc/autoconf.texi (Evaluation Macros) <m4_do>: Document the
behavior.
* tests/m4sugar.at (m4@&t@_do): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-29 19:36:20 -06:00
Eric Blake
8f5c14ff91 Optimize m4_for.
* lib/m4sugar/m4sugar.m4 (m4_for): Use fewer macros.
(_m4_for): Take additional parameter, for fewer m4_indir calls.
* lib/m4sugar/foreach.m4 (_m4_foreach, _m4_shiftn, m4_do)
(m4_reverse, _m4_list_pad, _m4_list_cmp): Adjust all callers.
* doc/autoconf.texi (Looping constructs) <m4_for>: Document subtle
semantic change caused by the optimization.
* tests/m4sugar.at (M4 loops): Test the new semantics.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-29 19:36:18 -06:00
Eric Blake
c39d9a4678 One more m4_list_cmp tweak.
* lib/m4sugar/m4sugar.m4 (_m4_list_cmp_1): Don't defer shift.
* lib/m4sugar/foreach.m4 (m4_list_cmp): Fix comment.
* tests/m4sugar.at (recursion): Test both directions of list
disparity.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-29 08:28:01 -06:00
Eric Blake
4766c77f42 Add m4_reverse, and improve m4_list_cmp.
* lib/m4sugar/m4sugar.m4 (m4_reverse): New macro.
(m4_list_cmp): Rewrite to give linear behavior with M4 1.6 on an
m4_reverse'd list.
* lib/m4sugar/foreach.m4 (m4_reverse): Add the M4 1.4.x
counterpart.
* tests/m4sugar.at (recursion): Test it.
* doc/autoconf.texi (Evaluation Macros) <m4_reverse>: Document
it.
(Text processing Macros) <m4_append>: Cross-reference to m4_set.
* NEWS: Mention new macro.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-29 07:12:26 -06:00
Eric Blake
64474728e7 Avoid _m4_shiftn for m4 1.6 speedup.
* lib/m4sugar/m4sugar.m4 (m4_foreach, _m4_foreach, m4_map)
(_m4_map, m4_map_sep): Rewrite recursion to use one less m4_if.
* lib/m4sugar/foreach.m4 (_m4_map): Accomodate changed signature.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-28 11:42:14 -06:00
Eric Blake
3f1a601013 Implement O(n) unique element set creation.
* lib/m4sugar/m4sugar.m4 (m4_set_add, m4_set_add_all)
(m4_set_contains, m4_set_contents, m4_set_delete)
(m4_set_difference, m4_set_dump, m4_set_empty, m4_set_foreach)
(m4_set_intersection, m4_set_list, m4_set_listc, m4_set_remove)
(m4_set_size, m4_set_union): New macros.
* lib/m4sugar/foreach.m4 (m4_set_add_all): Add O(n) fallback for
m4 1.4.x.
* lib/autoconf/general.m4 (_AC_INIT_DEFAULTS, AC_SUBST): Use
new m4_set API for the set most likely to be large.
* doc/autoconf.texi (Set manipulation Macros): New node.
* NEWS: Mention new macros.
* tests/m4sugar.at (m4@&t@_set): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-28 06:35:34 -06:00
Eric Blake
e48d698fdc Avoid infinite aclocal loop.
* lib/m4sugar/m4sugar.m4 (m4_init): Bypass m4_include tracing, so
that aclocal doesn't insist on finding m4sugar/foreach.m4.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-25 21:13:23 -06:00
Eric Blake
dbb9fe36bf Provide O(n) replacement macros for M4 1.4.x.
* lib/m4sugar/foreach.m4: New file.
(m4_foreach, m4_case, _m4_shiftn, m4_do, m4_dquote_elt, _m4_map)
(m4_join, m4_joinall, m4_list_cmp, _m4_minmax): Replace m4sugar
macros based on $@ recursion [fast on M4 1.6, but quadratic on M4
1.4.x] with versions based on m4_for/m4_foreach [slow on 1.6, but
linear on 1.4.x].
* lib/m4sugar/m4sugar.m4 (m4_init): Dynamically load new file if
older M4 is assumed.
(m4_map_sep): Optimize.
(m4_max, m4_min): Refactor, by adding...
(_m4_max, _m4_min, _m4_minmax): ...more efficient helpers.
(m4_defn, m4_popdef, m4_undefine): Use foreach recursion.
* lib/m4sugar/Makefile.am (dist_m4sugarlib_DATA): Distribute new
file.
* tests/m4sugar.at (M4 loops): Add a stress test that takes
forever if m4_foreach and friends are quadratic.
* NEWS: Mention this.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-25 17:42:29 -06:00
Eric Blake
36d8106f6d Support multiple arguments to m4_defn, m4_popdef, and m4_undefine.
* lib/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine): Loop
through all variables, per POSIX and newer m4.
(_m4_text_wrap): Exploit the looping capabilities.
* tests/m4sugar.at (m4@&t@_defn): Test this.
* NEWS: Document it.
* doc/autoconf.texi (Redefined M4 Macros) <m4_defn, m4_popdef>
<m4_undefine>: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-19 13:11:45 -06:00
Eric Blake
8c938c72f0 Reduce overhead of m4_builtin([defn]).
* lib/m4sugar/m4sugar.m4 (_m4_defn, _m4_popdef, _m4_undefine): New
internal macros, which are slightly more efficient than
m4_builtin([defn]) and company.
(m4_defn, m4_popdef, m4_undefine, m4_warn, m4_ifset)
(_m4_dumpdefs_up, _m4_dumpdefs_down, _m4_wrap, m4_for)
(_m4_divert_n_stack, m4_divert_pop, m4_expansion_stack_push)
(m4_expansion_stack_dump, _m4_defun_pro, _m4_defun_epi)
(_m4_defun_epi_outer, _m4_require_call, m4_combine, m4_append)
(_m4_append_uniq, m4_append_uniq_w, _m4_text_wrap, m4_text_box)
(m4_version_prereq): Use them.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-19 10:53:10 -06:00
Eric Blake
434bdc105b Use warnings from m4 when available.
* lib/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine): Don't
define slower wrapper if m4 will warn on our behalf; key off of
__m4_version__, added alongside the new warnings in m4 1.6.
* tests/m4sugar.at (m4@&t@_defn): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-19 09:28:18 -06:00
Eric Blake
65ff0e8f88 Add m4_joinall.
* lib/m4sugar/m4sugar.m4 (m4_joinall, _m4_joinall): New macros.
* tests/m4sugar.at (m4@&t@_join): Test them.
* doc/autoconf.texi (Text processing Macros) <m4_join>: Document
m4_joinall.
* NEWS: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-18 20:18:37 -06:00
Eric Blake
ebe1f38cba Revert m4_prepend; it is less efficient, and unused by bison.
* lib/m4sugar/m4sugar.m4 (m4_prepend, m4_prepend_uniq)
(m4_prepend_uniq_w): Delete addition from 2008-07-11.
(_m4_grow_uniq_1): Rename back...
(_m4_append_uniq): ...to this.
* NEWS: Revert NEWS blurb.
* doc/autoconf.texi (Text processing Macros) <m4_prepend>: Delete.
* tests/m4sugar.at (m4@&t@_prepend): Delete.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-16 14:47:46 -06:00
Eric Blake
6eb7c48491 Avoid failure if version.m4 is omitted but m4_PACKAGE_* unused.
* lib/m4sugar/m4sugar.m4 (m4_version_compare): Provide alternate
definition for non-Autoconf clients of m4sugar.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-15 14:53:21 -06:00
Eric Blake
0bc266ef15 Tighten bound of potential speed of m4_append.
* doc/autoconf.texi (Text processing Macros) <m4_append>
<m4_prepend>: If m4 is fixed, m4_append can be linear rather than
O(n log n).
* lib/m4sugar/m4sugar.m4 (m4_append, m4_append_uniq): Fix comments.
Analysis by Bruno Haible.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-14 10:13:28 -06:00
Eric Blake
8d6a868692 Inherit improvements from bison's fork of m4sugar.
* lib/m4sugar/m4sugar.m4 (m4_PACKAGE_VERSION): Ignore failure to
find version.texi, since bison does not provide it.
(m4_prepend): Add new macro, from bison.
(m4_prepend_uniq, m4_prepend_uniq_w): Add new macros, for
completeness.
(_m4_append_uniq): Rename...
(_m4_grow_uniq_1): ...to this to share implementation, and
optimize initial assignment.
(m4_append_uniq_w): Adjust caller.
* NEWS: Document new macros.
* doc/autoconf.texi (Text processing Macros) <m4_append>: Mention
speed consideration.
<m4_prepend>: Document the new prepend variants.
* tests/m4sugar.at (m4@&t@_prepend): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-11 11:14:46 -06:00
Eric Blake
5fb9f9c1a2 Work around M4 1.6 warning on undefined macros.
* lib/m4sugar/m4sugar.m4 (changeword, symbols): Don't rename if
not already available as builtins.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-11 10:10:53 -06:00
Eric Blake
4d953cea64 Allow unbalanced () in m4_expand.
* lib/m4sugar/m4sugar.m4 (m4_expand, _m4_expand): Use more complex
quotes.
(m4_noquote, _m4_split): Use consistent complex quote.
* tests/autotest.at (Left paren, Right paren): Test this.
(Parentheses): Ensure new quadrigraphs still work.
(AT_CHECK_AT_TITLE_CHAR): All title char tests exercise m4_expand.
* NEWS: Mention the fix.
* doc/autoconf.texi (Quadrigraphs): Revert mention of macros that
require quadrigraphs for ().
(Evaluation Macros) <m4_expand>: Relax the restriction against
unbalanced ().
(Pretty Help Strings) <AS_HELP_STRING>: Likewise.
(Writing Testsuites) <AT_SETUP>: Likewise.
Reported by Joel E. Denny, fix suggested by Noah Misch.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-23 09:32:05 -06:00
Eric Blake
c60735fbb8 Support unbalanced () in AT_SETUP by adding two new quadrigraphs.
* bin/autom4te.in (handle_output): Substitute @{:@ and @:}@.
(handle_traces): Likewise.
* lib/m4sugar/m4sugar.m4 (m4_qlen): Account for new quadrigraphs.
* tests/autotest.at (AT_CHECK_AT_TITLE_CHAR): Add new tests.
* doc/autoconf.texi (Quadrigraphs): Document them.
(Evaluation Macros) <m4_expand>: Enhance documentation.
(Text processing Macros) <m4_text_box>: Document cases where
quadrigraphs can help for problemetic unbalanced parentheses.
(Pretty Help Strings) <AS_HELP_STRING>: Likewise.
(Writing Testsuites) <AT_SETUP>: Likewise.
(Limitations of Builtins) <case>: Consolidate text on unbalanced
parentheses, and add an example of creative comments.
* NEWS: Document the addition.
Reported by Joel E. Denny.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-22 16:28:14 -06:00
Eric Blake
a91e2a71d2 Use GPLv2+ plus exception as license for release.
Return back to GPLv2+, until the text of the exceptions is
finalized, reverting the change from 2007-07-03 and the first
part of the change from 2007-07-20.

Also:
* COPYING: Revert to GPLv2.
* COPYINGv3: New file, since some auxiliary build tools, used for
building autoconf and not installed, are GPLv3.
* Makefile.am (EXTRA_DIST): Distribute COPYINGv3.
* NEWS: Remove mention of GPLv3.
* README: Clarify situation regarding GPLv3.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-05 17:04:48 -06:00
Eric Blake
f6bc7b22d4 Don't swallow $1 in textual local variables.
* lib/m4sugar/m4sugar.m4 (m4_combine): Don't use overquoting and
expansion of text arguments, as that swallows $1.
(m4_text_wrap): Likewise, by splitting out...
(_m4_text_wrap): ...new helper macro.  Also, allow arbitrary
expression for width.
* tests/m4sugar.at (m4@&t@_text_wrap): Test this.
(m4@&t@_combine): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-21 11:32:46 -06:00
Eric Blake
3c108e5e9d Fix yesterday's regression in m4_wrap([$1]).
* lib/m4sugar/m4sugar.m4 (_m4_wrap): Don't directly invoke wrapped
text, since it may contain text that looks like parameters.
* tests/m4sh.at (AS@&t@_INIT cleanup): Enhance test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-11 20:05:49 -06:00
Eric Blake
39ed7a3e19 Tweak m4_wrap to force FIFO or LIFO semantics.
* lib/m4sugar/m4sugar.m4 (m4_wrap): Override M4 implementation.
(m4_wrap_lifo, _m4_wrap): New macros.
* lib/m4sugar/m4sh.m4 (AS_INIT): Combine all cleanup into known
order, prior to m4sugar's.
(_AS_DETECT_BETTER_SHELL): Use cleanup parameter, rather than
m4_wrap.
* lib/autotest/general.m4 (AT_INIT): Combine all cleanup into
known order, prior to m4sh's.
* doc/autoconf.texi (Diagnostic Macros) <m4_fatal>: Document
argument.
(Redefined M4 Macros) <m4_wrap>: Rewrite documentation to match
new behavior.
* tests/m4sh.at (AS_INIT cleanup): New test.
* NEWS: Document the change.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-11 18:58:31 -06:00
Eric Blake
e3d1e29bc3 Documentation improvements.
* doc/autoconf.texi (Looping constructs): s/recurses/repeats/.
(Evaluation Macros): Drop `1' suffix from metasyntax variable name
that preceeds @dots.  Improve wording.
(Text processing Macros): Drop `1' suffix from metasyntax variable
name that preceeds @dots.
(Number processing Macros): Drop `1' suffix from metasyntax
variable name that preceeds @dots.  Improve wording.
* lib/m4sugar/m4sugar.m4 (m4_cmp): Comment wording fix.
Suggested by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-03 06:29:00 -07:00
Eric Blake
f4d0beaefa * lib/m4sugar/m4sugar.m4 (m4_qlen): Use fewer macros.
Signed-off-by: Eric Blake <ebb9@byu.net>
2008-01-15 08:49:08 -07:00
Eric Blake
af2f1f262c Fix thinko in earlier patch - m4_join isn't defined yet.
* lib/m4sugar/m4sugar.m4 (m4_expansion_stack_push, _m4_defun_pro)
(_m4_defun_pro_outer, _m4_defun_epi, _m4_defun_epi_outer)
(m4_require): Use m4_do, not m4_join.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-12-12 16:31:21 -07:00
Eric Blake
18e4a9e117 Optimize AC_REQUIRE.
* lib/m4sugar/m4sugar.m4 (m4_expansion_stack_push, _m4_defun_pro)
(_m4_defun_pro_outer, _m4_defun_epi, _m4_defun_epi_outer)
(m4_require): Avoid extra macro calls.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-12-12 14:18:25 -07:00
Ralf Wildenhues
5779945993 * lib/m4sugar/m4sh.m4 (AS_TMPDIR): Use $as_me, not $me. 2007-11-14 21:55:59 +01:00
Jim Meyering
48520ed2f7 Adapt dependencies, now that a version change doesn't modify configure.ac
* GNUmakefile: Remove "make clean" kludge.
* lib/m4sugar/Makefile.am (version.m4): Depend on Makefile, not
configure.ac.
Don't redirect directly to target.
Use $@, not literal "version.m4".
2007-11-13 08:56:32 +01:00
Ralf Wildenhues
610817462b * doc/autoconf.texi (Making testsuite Scripts): Document
":;{" shorthand as in previous patch.

2007-11-12  Paul Eggert  <eggert@cs.ucla.edu>

* doc/autoconf.texi (Limitations of Builtins): Document problem
with { ... } a bit more clearly.  Suggest ":;{" as a shorthand
for the workaround.
* lib/m4sugar/Makefile.am (version.m4): Detect 'echo' failure.
Use ":;{" shorthand.
* tests/Makefile.am ($(srcdir)/package.m4): Likewise.
2007-11-12 23:30:58 -08:00
Ralf Wildenhues
bf5fec7028 * lib/m4sugar/Makefile.am (version.m4): Another bash bug workaround. 2007-11-04 17:00:57 +01:00
Eric Blake
dd3c3f2e27 Adjust version comparison to account for git snapshot numbers.
* lib/m4sugar/m4sugar.m4 (_m4_version_unletter): Also treat - as a
component separator.
* doc/autoconf.texi (Number processing Macros)
<m4_version_compare>: Document this change.
* tests/m4sugar.at (m4@&t@_version_compare): Test it.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-11-03 07:20:47 -06:00
Jim Meyering
7ffc555888 Remove all generated files from version control.
* aclocal.m4: Remove.
* configure: Remove.
* Makefile.in: Remove, along with all other Makefile.in in subdirs.
* .gitignore: Add aclocal.m4, configure and Makefile.in.  Sort.
* README-hacking: New file: how to build from just-checked-out sources.
2007-10-27 12:44:59 +02:00
Eric Blake
17b1f091f4 Improve corner case of m4_expand.
* lib/m4sugar/m4sugar.m4 (m4_expand, _m4_expand): Rewrite more
efficiently.
* tests/m4sh.at (AS@&t@_HELP_STRING): Test overquoted comma.
* doc/autoconf.texi (Evaluation Macros) <m4_expand>: Update
documentation.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-23 21:04:12 -06:00
Eric Blake
49d1c176cc s/parenthesis/parentheses/ where appropriate.
* doc/autoconf.texi: Fix typos.
* lib/m4sugar/m4sugar.m4: Likewise.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-19 07:08:59 -06:00
Eric Blake
8c73ae256c Document m4_expand limitation.
* lib/m4sugar/m4sugar.m4 (m4_expand): Mention problem with
unbalanced parse.
* doc/autoconf.texi (Pretty Help Strings, Evaluation Macros)
(Writing Testsuites): Mention limitations inherited from
m4_expand.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-19 06:38:48 -06:00
Eric Blake
5b6f53e441 Fix AT_TESTED, AT_KEYWORDS.
* lib/m4sugar/m4sugar.m4 (m4_append_uniq): Warn if separator
occurs in string, as duplicates may be added.
(_m4_append_uniq): New helper macro.
(m4_append_uniq_w): New macro.
* lib/autotest/general.m4 (AT_TESTED, AT_KEYWORDS): Fix
duplication bug by using new macro.
(AT_INIT) <at_tested>: Restore newline separators.  Invoke tested
programs with stdin redirected, so programs that don't
understand --version won't try to behave interactively.
* tests/autotest.at (Tested programs): Catch this bug.
* tests/m4sugar.at (m4@&t@_append): Test new macro.
* tests/local.at (AT_TESTED): Add m4, perl.
* doc/autoconf.texi (Text processing Macros): Document
m4_append_uniq_w, and update text on m4_append.
* NEWS: Document the addition.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-18 09:46:19 -06:00
Eric Blake
0c0e7bbd41 Fix m4_combine for empty suffix list.
* lib/m4sugar/m4sugar.m4 (m4_combine): Check for suffix list.
* doc/autoconf.texi (Text processing Macros): Document this.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-17 10:02:04 -06:00
Eric Blake
f2ea75eb03 Add m4_combine, based on Libtool's lt_combine.
* lib/m4sugar/m4sugar.m4 (m4_combine): New macro.
* doc/autoconf.texi (Text processing Macros): Document it.
* NEWS: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-17 07:13:00 -06:00
Ralf Wildenhues
bbb9c9628d Fix `configure --help=recursive' in unconfigured/read-only trees.
* lib/m4sugar/m4sh.m4 (_AS_LN_S_PREPARE): Avoid errors when `.'
is not writable, use 'cp -p' in this case, in the hope that it
will not actually be needed.  Still try removing files, in case
of other write errors.
* lib/autoconf/general.m4 (_AC_INIT_SRCDIR): For ac_confdir,
use $as_myself, not $0.
(_AC_INIT_HELP): For --help=recursive, if the subdir does not
exist, try again in the the source tree.  This change assumes
that the subpackage configure script is capable of running
--help=recursive in the source tree.
* tests/torture.at (Configuring subdirectories, Deep Package):
Adjust tests to expose both issues, also try invocation as
`sh configure ...' and plain `configure ...' with PATH adjusted.
* NEWS, THANKS: Update.
Report by Hans Ulrich Niedermann.
2007-10-16 23:50:03 +02:00
Eric Blake
96a08a7ee4 m4_map is a looping construct.
* lib/m4sugar/m4sugar.m4 (m4_map, _m4_map, m4_map_sep): Move.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-16 12:18:24 -06:00
Eric Blake
33239cbd38 Fix m4_map, and add some more utility macros.
* lib/m4sugar/m4sugar.m4 (m4_apply, m4_count, m4_dquote_elt)
(m4_echo, m4_make_list): New documented macros.
(_m4_quote, _m4_shift2): New helper macros.
(m4_map): Change semantics to allow calling macro without
arguments.
(m4_map_sep): Likewise.  Also change semantics to quote separator,
to match m4_join and m4_append.
(m4_version_unletter): Fix use of m4_map.
* doc/autoconf.texi (Evaluation Macros): Document m4_apply,
m4_count, m4_dquote_elt, m4_echo, m4_make_list.
(Text processing Macros): Mention m4_dquote as a faster
alternative to joining with commas.
(Looping constructs): Document m4_map, m4_map_sep.
* NEWS: Mention new macros.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-16 12:00:00 -06:00
Eric Blake
f3b4cc104e A few more m4sugar improvements, to benefit libtool.
* lib/m4sugar/m4sugar.m4 (m4_bpatsubsts, _m4_shiftn): Reduce size
of expansion by avoiding extra uses of $@.
(m4_shiftn): Avoid extra dnl, and forbid shifting by 0.
(_m4_cdr): New helper macro.
(_m4_map, m4_map_sep): Use it to reduce size of expansion.
(_m4_shift3): New helper macro.
(_m4_foreach): Swap argument order, and use new macro to reduce
size of expansion.
* doc/autoconf.texi (Looping constructs) <m4_shiftn>: Mention that
count must be positive.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-16 06:23:10 -06:00
Eric Blake
10a850e84a Enhance AS_HELP_STRING.
* lib/m4sugar/m4sugar.m4 (m4_text_wrap): Don't expand arguments,
and reduce number of expansions.
* lib/m4sugar/m4sh.m4 (AS_HELP_STRING): Rework to use m4_expand,
and to take indent and wrap column numbers.
* tests/m4sh.at (AS@&t@_HELP_STRING): Update the test.
* doc/autoconf.texi (Pretty Help Strings): Document details about
arguments.
(Text processing Macros): Minor tweaks.
* NEWS: Document this change.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-15 12:18:24 -06:00
Eric Blake
fd1344033b Fix 2007-10-03 regression with AT_SETUP([a, b]).
* lib/m4sugar/m4sugar.m4 (m4_expand): New macro.
* lib/autotest/general.m4 (AT_SETUP): Use it to preserve
whitespace after single-quoted comma.
* tests/autotest.at (AT_CHECK_AT_TITLE_CHAR): Test this.
* NEWS: Revert caveat about semantics change on comma.
* doc/autoconf.texi (Programming in M4): Lighten the warning on
using m4sugar; it is stabilizing.
(Redefined M4 Macros): Touch up wording on M4 builtins.
(Evaluation Macros): Document m4_expand.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-15 08:43:21 -06:00
Eric Blake
72431d8c84 Change m4_join to match libtool's ltsugar semantics.
* lib/m4sugar/m4sugar.m4 (m4_join): Just define this, not defun.
Ignore empty arguments, using...
(_m4_join): ...this new helper.
* tests/m4sugar.at (m4@&t@_join): New test.
* doc/autoconf.texi (Text processing Macros): Document new
semantics of m4_join.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-13 11:11:44 -06:00
Eric Blake
6e1d6e2c5b Make AC_PREREQ faster and more robust.
* lib/m4sugar/m4sugar.m4 (m4_ignore, m4_unquote): New macros.
(m4_version_prereq): Inline constant expansions.
(m4_list_cmp): Reduce number of expansions, by avoiding m4_case.
Rewrite in terms of [] list, not () list.
(_m4_list_cmp, _m4_version_unletter): New helper macros.
(m4_version_unletter): Write wrapper around new implementation to
preserve old semantics.
(m4_version_compare): Pass correct type of list, and avoid
overhead of flattening expressions too early.
(m4_do): Move to be near other quoting macros.
(m4_max, m4_min): Always result in decimal output.
* doc/autoconf.texi (Looping constructs): Add m4_car, m4_cdr.
Move m4_do...
(Evaluation Macros): ...here.  Add m4_ignore, m4_unquote.
(Text processing Macros): Move m4_version_compare...
(Number processing Macros): ...to this new node; document m4_cmp,
m4_list_cmp, m4_sign, m4_max, m4_min.
* tests/m4sugar.at (m4@&t@_version_compare): Enhance test, to pick
up on bugs fixed by this patch.
* NEWS: Document new macros.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-13 08:09:08 -06:00
Eric Blake
b171ca4ed3 Some more m4sugar documentation.
* lib/m4sugar/m4sugar.m4: Clean up macro order.
* doc/autoconf.texi (Programming in M4): Lighten the warning on
using m4sugar; it is stabilizing and useful.
(Redefined M4 Macros): Touch up wording on M4 builtins; sort.  Add
m4_divert, m4_undivert, __file__, __line__, __oline__.
(Diagnostics): New node, documenting m4_assert, m4_errprintn,
m4_fatal, m4_location, m4_warn.
(Diversion support): New node, documenting m4_divert_push,
m4_divert_pop, m4_divert_text, m4_divert_once.
(Text processing Macros): Sort.  Add m4_flatten, m4_join,
m4_newline, m4_strip, m4_text_box, m4_text_wrap.
(Programming in M4sh, Macro Names): Document namespace
limitations.  Mention that non-Automake macros should not begin
with `AM_'.
(Reporting Messages): Mark AC_DIAGNOSE, AC_WARNING, and AC_FATAL
as obsolescent.
(Printing Messages): Change cross-reference.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-12 15:55:56 -06:00
Eric Blake
be938d2dec Document interaction of recent m4_append change with Libtool HEAD.
* lib/m4sugar/m4sugar.m4 (m4_append): Document semantics change.
(m4_append_uniq): Add new parameters, based on lt_append_uniq.
* tests/m4sugar.at (m4@&t@_append): New test.
* NEWS: Document semantics change.
* doc/autoconf.texi (Text processing Macros): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-12 15:01:31 -06:00
Eric Blake
b4df79e1ab Avoid some overhead from m4_defn and m4_popdef.
* lib/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine): Only
pass on first argument, since we are documented that way.
(m4_for, m4_append_uniq, m4_text_wrap): Optimize out defined-ness
check where it is safe to do so.
(m4_append): Likewise, and quote the separator.
(m4_text_box): Likewise, and avoid regex, also be robust to
expansion and quadrigraphs.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-10 16:04:01 -06:00
Eric Blake
45b46a7467 Another AC_DEFINE speedup.
* lib/autoconf/general.m4 (AC_DEFINE_TRACE): Move parameter
elision...
(_AC_DEFINE_Q): ...here, and only do it once.
* lib/autoconf/functions.m4 (AC_CHECK_FUNCS): Avoid overquoting.
* lib/m4sugar/m4sh.m4 (AS_LITERAL_IF): Fix m4_defn overquoting
introduced 2007-10-05.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-10 14:36:27 -06:00
Eric Blake
028272af52 Reduce number of forks at startup.
* lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Speed up NLS
sanitization.
* configure: Regenerate.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-10 07:13:39 -06:00
Eric Blake
2c63638e2b Improve header of bin/autoconf.
* lib/m4sugar/m4sh.m4 (AS_INIT): Add a 'generated from' notice.
* lib/autoconf/general.m4 (_AC_INIT_NOTICE): Override new notice
from M4sh.
* bin/autoconf.as: Put copyright up front in generated file.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-09 17:15:43 -06:00
Eric Blake
94a9faded7 Fix regression in m4_text_wrap from 2007-10-05.
* lib/m4sugar/m4sugar.m4 (m4_max, m4_min): New macros.
(m4_sign): Sort.
(m4_text_wrap): Fix off-by-one error in rewrite from m4_for to
m4_format.
* lib/autotest/general.m4 (AT_SETUP): Avoid negative width.
* tests/autotest.at (Long test title, Longer test title): Test
this fix, beyond what AS_HELP_STRING already tests.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-08 14:09:22 -06:00
Eric Blake
a83ac461c6 Avoid m4 warnings on bad m4_format usage.
* lib/m4sugar/m4sugar.m4 (m4_text_wrap): Use %*s, in case width
evaulates to 0.
* lib/autotest/general.m4 (AT_ordinal): Likewise; also ensure that
enough arguments are provided.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-08 10:46:21 -06:00
Paul Eggert
df45b2a924 Don't assume "." is writeable, for commands like "autoconf --version".
* lib/m4sugar/m4sh.m4 (_AS_PATH_SEPARATOR_PREPARE): Use a
different heuristic instead, one that doesn't rely on creating
files.
2007-10-05 15:31:06 -07:00
Eric Blake
4e9078ba0b Provide better short-circuiting operation.
* lib/m4sugar/m4sugar.m4 (m4_cond, m4_newline): New macros.
(m4_text_wrap): Use it.  Also avoid useless m4_for.
* lib/m4sugar/m4sh.m4 (_AS_QUOTE_IFELSE, AS_LITERAL_IF): Use
new macro.
(_AS_IDENTIFIER_IF): Likewise, and fix bug when $1 is [,].
* lib/autotest/general.m4 (_AT_DECIDE_TRACEABLE): Use new macros
to avoid regexps.
* doc/autoconf.texi (Redefined M4 Macros): Expand m4_if
documentation.  Sort m4_mkstemp, m4_undefine.  Move m4_ifndef...
(Conditional constructs): ...here, to new section.  Also document
m4_cond, m4_ifval, m4_n, m4_ifvaln, m4_ifset, m4_case, m4_bmatch,
m4_bpatsubsts, and m4_default.
(Looping constructs): Document m4_shiftn, m4_shift2, m4_shift3,
m4_do.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-05 11:25:20 -06:00
Eric Blake
2152c1e75f Fix recent testsuite failures.
* lib/autotest/general.m4 (AT_INIT, AT_SETUP): Double-quote text
that must not be re-expanded after AS_ESCAPE.
* lib/m4sugar/m4sh.m4 (_AS_IDENTIFIER_IF): Don't expand $1 when
checking if it is an identifier.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-04 17:07:42 -06:00
Eric Blake
10fa310839 One more round of m4_foreach_w speedups.
* lib/m4sugar/m4sugar.m4 (m4_flatten): Only use regex if newline
is present.
(_m4_split): Avoid useless expansions inside definition.  Move
argument defaulting...
(m4_split): ...here.  Change alternate quote to something less
likely to appear in $1.  Also, special case space as regexp...
(m4_foreach_w): ...to avoid regexp on single-term list.
(m4_default, m4_defn, m4_popdef, m4_undefine, _m4_foreach): Avoid
useless expansions inside definition.
* tests/m4sugar.at (m4@&t@_split): Add tests.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-04 10:09:38 -06:00
Eric Blake
e76d30be25 Optimize checking for identifiers.
* lib/m4sugar/m4sh.m4 (AS_IDENTIFIER_IF, _AS_IDENTIFIER_IF): New
macros, more efficient than regex on m4_re_word.
* lib/autoconf/general.m4 (AC_SUBST, AC_DEFINE_TRACE_LITERAL):
Rewrite in terms of new macro.  As a side-effect, AC_DEFINE can
now use @&t@.
* configure: Regenerate.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-03 17:22:46 -06:00
Eric Blake
987a333766 Another round of regex avoidance.
* lib/m4sugar/m4sugar.m4 (m4_cr_alnum, m4_cr_all)
(_m4_define_cr_not, m4_cr_not_letters, m4_cr_not_LETTERS)
(m4_cr_not_Letters, m4_cr_not_digits, m4_cr_not_alnum)
(m4_cr_not_symbols1, m4_cr_not_symbols2): New macros, implementing
character ranges useful in m4_translit.
(m4_toupper, m4_tolower): Optimize the constant portion of
definition.
* lib/m4sugar/m4sh.m4 (AS_LITERAL_IF): Also reject @S|@ because it
creates $, and reject [] thanks to AS_TR_SH rewrite.
(AS_TR_SH, AS_TR_CPP): Use just translit, not bpatsubst.
(AS_ESCAPE): Factor...
(_AS_ESCAPE): ...into new macro, with second argument required.
Avoid regex in common case.
(_AS_QUOTE): Use new macro.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-03 15:42:42 -06:00
Eric Blake
1a128bd6e6 Whitespace cleanup.
* lib/autoconf/types.m4: Avoid space-tab.
* lib/m4sugar/m4sh.m4: Use tab consistently.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-03 15:36:43 -06:00
Paul Eggert
9174b63f95 * lib/m4sugar/m4sugar.m4 (m4_shift2, m4_shift3): New macros.
(m4_shiftn): Remove no-longer-needed optimization.  Perhaps we
should remove m4_shiftn entirely?
(m4_case, b4_bmatch, m4_map_sep, m4_bpatsubsts, m4_join):
Prefer m4_shift2 and m4_shift3 to m4_shiftn.
* lib/autoconf/lang.m4 (_AC_LANG_DISPATCH): Likewise.
* lib/m4sugar/m4sh.m4 (AS_CASE, AS_IF): Likewise.
* tests/autotest.at (AT_CHECK_AT_TEST): Likewise.
2007-10-03 13:06:08 -07:00
Eric Blake
7b96e241f7 Comment touchups.
* lib/m4sugar/m4sugar.m4: Grammar fixes in comments.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-03 08:09:04 -06:00
Eric Blake
53b2e90b42 Optimize appending text.
* lib/m4sugar/m4sugar.m4 (m4_append_uniq): Use index, not regular
expressions.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-02 20:23:03 -06:00
Eric Blake
57e51969f0 Optimize recursion.
* lib/m4sugar/m4sugar.m4 (m4_shiftn): This macro is called in a
lot of hot spots; optimize it for 2 and 3 shifts.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-02 15:26:34 -06:00
Eric Blake
7113f1b07c Optimize AC_PREREQ and other m4sugar numerics.
* lib/m4sugar/m4sugar.m4 (m4_sign): Write with m4_eval.
(m4_cmp): Compare arbitrary expressions, without overflow.
(m4_version_unletter): Also recognize capital letters.
(m4_version_compare): Avoid regex when splitting version number
string.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-02 07:04:11 -06:00
Eric Blake
615300a1d5 Allow nameless iteration.
* lib/m4sugar/m4sugar.m4 (m4_for, _m4_for): Access variable
indirectly.
* tests/m4sugar.at (myvar): Test this.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-30 06:45:33 -06:00
Eric Blake
b2dda0adc7 Speed optimization: avoid m4 regex when other algorithms work.
* lib/m4sugar/m4sh.m4 (AS_LITERAL_IF): Rewrite without regex.
(_AS_QUOTE_IFELSE): Likewise.
* lib/m4sugar/m4sugar.m4 (m4_strip): Reduce from 3 to 2 regex.
(m4_bpatsubsts): Split...
(_m4_bpatsubsts): ...so that recursion can avoid patsubst on empty
regex.
(_m4_divert()): Define, to avoid m4 warning on `m4_divert'.
(m4_qlen): Optimize on short strings, to avoid regex.
(m4_sign): Avoid regex, and fix bug with `01' and `-0'.
* lib/autoconf/general.m4 (AC_CACHE_VAL): Rewrite without regex.
(AC_DEFINE_TRACE): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-29 21:44:10 -06:00
Eric Blake
b2e3fcf5bb Squelch changeword in m4sugar.
* lib/m4sugar/m4sugar.m4 (changeword): Disable this experimental
feature of m4 1.4.x.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-27 19:55:38 -06:00
Eric Blake
afdb9d6e9f Configure whitespace touchups.
* lib/autoconf/general.m4 (_AC_INIT_HELP): Fix alignment of
installation directories, and avoid TAB, in configure --help
output.
* configure.ac: Avoid extra trailing newline.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Avoid space-tab.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Avoid TAB in
config.status --help output.
* configure: Regenerate.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-27 19:35:55 -06:00
Eric Blake
f444a9fa8e Fix underquotation in AS_HELP_STRING.
* lib/m4sugar/m4sh.m4 (AS_HELP_STRING): Don't underquote lhs
argument.
* lib/m4sugar/m4sugar.m4 (m4_text_wrap): Don't underquote
first-prefix argument.
* tests/m4sh.at (AS@&t@_HELP_STRING): Test this fix.
* NEWS: Document AS_HELP_STRING fix.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-27 19:29:49 -06:00
Eric Blake
46d7a04b49 Typo fixes.
* lib/autoconf/general.m4 (AC_SUBST): Fix typo in comment.
* lib/m4sugar/m4sh.m4 (AS_VAR_PUSHDEF): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-25 17:05:50 -06:00
Jim Meyering
06f2cb9db6 Whenever possible, use the vertical bar as sed delimiter.
* lib/autoconf/functions.m4 (GETLOADAVG_LIBS) [AC_FUNC_GETLOADAVG]:
Use "|", not "!".
* lib/autoconf/status.m4 (_AC_SRCDIRS) [ac_top_builddir_sub]:
[ac_dir_suffix]: Use "|", not "," as sed delimiter.
* tests/mktests.sh (as_me): Likewise.
* lib/freeze.mk (check-forbidden-patterns): Likewise.
* lib/autoconf/fortran.m4 (_AC_PROG_FC_V_OUTPUT): Likewise.
* configure: Regenerate.
* doc/autoconf.texi (Shell Substitutions): Use "|", not "," in examples.
* lib/autotest/general.m4 (AT_INIT): Use "|", not "&" as sed delimiter
in the : -> $PATH_SEPARATOR transformation of $AUTOTEST_PATH.  This is fine,
as long as $PATH_SEPARATOR doesn't contain "|".
2007-09-24 21:57:21 +02:00
Eric Blake
5547b4a0f2 Provide AC_VERSION, not m4_AUTOCONF_VERSION.
* doc/autoconf.texi (Text processing Macros): Remove mention of
m4_AUTOCONF_VERSION, and leave m4_PACKAGE_VERSION undocumented
once again.
(Notices): Move AC_PREREQ...
(Versioning): ...to this new section, alongside the new AC_VERSION
alias for the undocumented m4_PACKAGE_VERSION.
* lib/m4sugar/m4sugar.m4 (m4_AUTOCONF_VERSION): Revert change.
* lib/autoconf/general.m4 (AC_VERSION): New macro.
* NEWS: Update to match this rename.
* tests/m4sugar.at (m4@&t@_version_compare): Remove tests of
m4_PACKAGE_VERSION.
* tests/tools.at (autoconf: AC_VERSION): New test.
Suggested by Paolo Bonzini and Benoit Sigoure.
2007-09-15 12:41:08 +00:00
Eric Blake
bf1af030e2 Prepare for conversion to git.
* doc/.cvsignore: Avoid multiple listings on one line.
* bin/.cvsignore: Likewise.
* .gitignore, bin/.gitignore, config/.gitignore, doc/.gitignore,
lib/.gitignore, lib/Autom4te/.gitignore, lib/autoconf/.gitignore,
lib/autoscan/.gitignore, lib/autotest/.gitignore,
lib/emacs/.gitignore, lib/m4sugar/.gitignore, man/.gitignore,
tests/.gitignore: New files, identical to .cvsignore counterpart.
2007-09-14 22:25:56 +00:00
Eric Blake
3be109e22d Editing eye-candy.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Restore
font-lock balance.
* lib/m4sugar/m4sh.m4 (AS_MKDIR_P): Likewise.
* configure: Regenerate.
2007-09-13 21:51:19 +00:00
Eric Blake
b6ef3cc579 Publish m4_ifndef, m4_version_compare, m4_AUTOCONF_VERSION.
* doc/autoconf.texi (Text processing Macros): Document
m4_version_compare, m4_AUTOCONF_VERSION, m4_PACKAGE_VERSION.
(Redefined M4 Macros): Document m4_ifndef.
* lib/m4sugar/m4sugar.m4 (m4_AUTOCONF_VERSION): New macro; we
can't obsolete m4_PACKAGE_VERSION at this time since Autoconf 1.10
used it while it was undocumented.
* NEWS: Document this change.
* lib/m4sugar/Makefile.am (version.m4): Update copyright dates.
* lib/m4sugar/Makefile.in: Regenerate.
* tests/m4sugar.at (m4@&t@_version_compare): New test.
Reported by Bruno Haible.
2007-09-13 03:21:18 +00:00
Paul Eggert
b411b77358 Reword the copyright notices to match what's suggested in GPLv3. 2007-07-20 23:11:49 +00:00
Paul Eggert
f448ac9647 Update to GPLv3. 2007-07-03 20:28:58 +00:00
Paul Eggert
48656aea07 * lib/m4sugar/m4sh.m4 (_AS_PATH_SEPARATOR_PREPARE): Set FPATH too.
Problem reported by Fred Kreek in
<http://lists.gnu.org/archive/html/bug-autoconf/2007-06/msg00009.html>.
* doc/autoconf.texi (Special Shell Variables): Warn about FPATH.
(Macro Names, Defining Directories): Don't mention PATH as a name
for a fully qualified file name, as this usage violates the GNU
coding standards and we shouldn't recommend it.

* lib/autotest/general.m4 (AT_INIT): Don't set PATH to the empty
string and then assume shell builtins like "test" will work.
2007-06-13 16:52:24 +00:00
Paul Eggert
43e384db53 Fix typo in previous message. 2007-04-30 17:11:50 +00:00
Paul Eggert
e53160abef * lib/m4sugar/m4sh.m4 (_AS_SHELL_FN_SPY): Don't imply that
'configure' will fail if the shell lacks proper support for shell
functions.  Suggested by RMS.
2007-04-30 17:08:07 +00:00
Paul Eggert
d7884b4e29 * lib/m4sugar/m4sh.m4 (_AS_ECHO_PREPARE): Use a longer test
string for more reliable failure.  Wrap the entire test that
causes the broken Solaris printf to dump core, in a subshell,
so the segmentation fault message is reliably suppressed.
Fix shell expansion errors by using /usr/ucb/echo always;
avoid an error on systems without it by another subshell.
Avoid m4 expansion of `$1'.  Set the zeroth argument of the
subshell-$as_echo to `as_echo', for better error message.
2006-12-01 18:32:34 +00:00
Paul Eggert
6c4b6b50d8 Regenerate. 2006-11-27 21:39:32 +00:00
Paul Eggert
a3787fd48a * Makefile.am: Put only a single '#' into the copyright notice,
so that it's also present in the output file.  Standardize wording
in makefile copyright notices to match GNU coding standards.
* bin/Makefile.am: Likewise.
* doc/Makefile.am: Likewise.
* lib/Makefile.am: Likewise.
* lib/freeze.mk: Likewise.
* lib/autoconf/Makefile.am: Likewise.
* lib/autoscan/Makefile.am: Likewise.
* lib/autotest/Makefile.am: Likewise.
* lib/m4sugar/Makefile.am: Likewise.
* man/Makefile.am: Likewise.
* tests/Makefile.am: Likewise.
* lib/emacs/Makefile.am: Remove copyright notice; it's just a
one-line file.
2006-11-27 21:35:37 +00:00
Paul Eggert
ab54e97802 * lib/autotest/general.m4 (AT_INIT): Undo recent changes
that replaced echo with AS_ECHO where this wasn't necessary.
Problem reportd by Ralf Wildenhues.
* lib/m4sugar/m4sh.m4 (_AS_ECHO_PREPARE): Port to Solaris 7,
where "/usr/bin/printf '%s\n' S" dumps core if S is long.
This is Sun bug 4206210.  Problem reportd by Ralf Wildenhues.
2006-11-25 09:57:34 +00:00
Paul Eggert
1be64afa5b 'echo' has some portability problems, when given a first argument
with a leading '-', or when given any argument containing '\'.
Avoid using 'echo' in these cases.
* bin/Makefile.am $(bin_SCRIPTS): Rewrite to avoid 'echo' entirely.
* lib/autoconf/c.m4 (AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC): Likewise.
* lib/autoconf/fortran.m4 (_AC_PROG_FC): Likewise.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* bin/autoconf.as: Use AS_ECHO rather than plain echo, when the
argument might be unportable.
* lib/autoconf/c.m4 (AC_PROG_CC_C_O): Likewise.
* lib/autoconf/erlang.m4 (AC_LANG(Erlang)): Likewise.
* lib/autoconf/fortran.m4 (_AC_PROG_FC_V_OUTPUT):
(_AC_FC_LIBRARY_LDFLAGS): Likewise.
* lib/autoconf/functions.m4 (AC_FUNC_GETLOADAVG): Likewise.
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ENABLE, _AC_INIT_PREPARE):
(_AC_ARG_VAR_VALIDATE, AC_ARG_PROGRAM, _AC_MSG_LOG_CONFTEST):
(AC_RUN_LOG, _AC_RUN_IFELSE, _AC_LIBOBJS_NORMALIZE): Likewise.
* lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Likewise.
* lib/autoconf/libs.m4 (_AC_PATH_X_DIRECT): Likewise.
* lib/autoconf/programs.m4 (_AC_FEATURE_CHECK_LENGTH):
(AC_PROG_MAKE_SET): Likewise.
* lib/autoconf/status.m4 (_AC_SRCDIRS, _AC_OUTPUT_HEADER):
(_AC_OUTPUT_SUBDIRS, _AC_OUTPUT_CONFIG_STATUS): Likewise.
* lib/autotest/general.m4 (_AT_CREATE_DEBUGGING_SCRIPT, AT_INIT):
(AT_CLEANUP, _AT_DECIDE_TRACEABLE, _AT_CHECK): Likewise.
* lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE, _AS_ECHO_UNQUOTED):
(_AS_BASENAME_SED, _AS_DIRNAME_SED, AS_MKDIR_P, AS_TMPDIR, AS_UNAME):
(AS_TR_SH, AS_TR_CPP, AS_VAR_GET): Likewise.
* bin/autoconf.as: Redo verbose flag implementation, as the old
scheme wouldn't work with AS_ECHO.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/autoconf/general.m4 (AC_MSG_RESULT, AC_MSG_RESULT_UNQUOTED):
Don't use ECHO_T, since ECHO_N is now reliable.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/autoconf/general.m4 (AC_ARG_PROGRAM): Use sed "$script"
rather than using a here-document to put the script into a file.
(_AC_DO_ECHO): Hoist the eval out of the echo, so that we can
use AS_ECHO.
* lib/m4sugar/m4sh.m4 (AS_VAR_GET): Likewise.
* lib/autoconf/programs.m4 (_AC_FEATURE_CHECK_LENGTH): Use
AS_ECHO_N rather than ECHO_N and ECHO_C.  This doesn't fix any
bug, but we might as well stop using ECHO_N and ECHO_C internally.
* lib/autotest/general.m4 (AT_SETUP): Likewise.
* lib/m4sugar/m4sh.m4 (_AS_ECHO_N): Likewise.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS):
(_AC_OUTPUT_MAIN_LOOP): Rework echo so that it has just one
operand, as AS_ECHO requires.  Avoid double file name expansion.
* lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Invoke _AS_ECHO_PREPARE.
Don't set as_nl, since _AS_ECHO_PREPARE does that now.
(_AS_PREPARE): Comment that _AS_ECHO_N_PREPARE is just for user code.
(AS_ECHO, AS_ECHO_N, _AS_ECHO_PREPARE): New macros.
* tests/c.at (AC_PROG_CPP without warnings, AC_PROG_CPP via CC):
Double-quote strings that would otherwise contain M4 comments.
* tests/m4sh.at (AS_ECHO and AS_ECHO_N): New test.
2006-11-17 21:04:54 +00:00
Eric Blake
a542d202ed * lib/m4sugar/m4sugar.m4 (m4_mkstemp): New macro.
(m4_maketemp): Avoid warnings with M4 1.9a.
* lib/emacs/autoconf-mode.el (autoconf-font-lock-keywords): Color
m4_mkstemp.
* doc/autoconf.texi (Redefined M4 Macros): Document m4_mkstemp.
* NEWS: Likewise.
2006-10-20 01:34:32 +00:00
Eric Blake
c94a138300 * bin/autoconf.as (version): Reword to match GNU Coding
Standards.
* bin/autoheader.in (version): Likewise.
* bin/autom4te.in (version): Likewise.
* bin/autoreconf.in (version): Likewise.
* bin/autoscan.in (version): Likewise.
* bin/autoupdate.in (version): Likewise.
* bin/ifnames.in (version): Likewise.
2006-10-16 20:58:44 +00:00
Paul Eggert
25cb6b0862 * lib/m4sugar/m4sh.m4 (AS_LITERAL_IF): Expand $1 before
looking for special shell characters.
* lib/autoconf/functions.m4 (AC_CHECK_FUNC): Do not expand the
macro defined by AS_VAR_PUSHDEF before passing it as a
parameter.
* lib/autoconf/general.m4 (AC_CHECK_FILE, AC_CHECK_DECL):
* lib/autoconf/libs.m4 (AC_SEARCH_LIBS, AC_CHECK_LIB):
* lib/autoconf/types.m4 (_AC_CHECK_TYPE_NEW, AC_CHECK_MEMBER):
* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL):
(_AC_CHECK_HEADER_NEW, _AC_CHECK_HEADER_OLD, _AC_CHECK_HEADER_DIRENT):
Likewise.
* lib/autotest/general.m4 (AT_INIT): Quote parameters of
AS_VAR_* properly.
* tests/m4sh.at (AS_LITERAL_IF): New test.
2006-10-15 01:12:02 +00:00
Paul Eggert
ccf4393e35 * lib/m4sugar/m4sh.m4 (_AS_TEST_PREPARE): Set as_executable_p,
for backward compatibility with Libtool 1.5.22.  Problem reported
by Ralf Wildenhues.
2006-10-12 19:44:22 +00:00
Stepan Kasal
20ee2eb203 Fix a typo in comment 2006-10-12 12:01:10 +00:00
Paul Eggert
1681d462cb * lib/m4sugar/m4sh.m4 (AS_TEST_X): New macro.
(AS_EXECUTABLE_P): Use as_test_x rather than as_executable_p.
(_AS_TEST_PREPARE): Set as_test_x rather than as_executable_p.
Use a better substitute, by inspecting the output of "ls"
rather than just using ":".
* lib/autoconf/general.m4 (_AC_LINK_IFELSE): Use AS_TEST_X
rather than AS_EXECUTABLE_P, since we needn't worry about
non-regular files here.
2006-10-11 21:50:57 +00:00
Paul Eggert
520f7f02ed * NEWS: Autoconf-generated shell scripts no longer export BIN_SH,
due to configuration hassles with this.  See Tonya Underwood's report
<http://lists.gnu.org/archive/html/bug-autoconf/2006-10/msg00003.html>.
* doc/autoconf.texi (Special Shell Variables): Likewise.

2006-10-11  Paul Eggert  <eggert@cs.ucla.edu>
    Stepan Kasal  <kasal@ucw.cz>

* lib/m4sugar/m4sh.m4 (AS_BOURNE_COMPATIBLE): Don't set BIN_SH.
(_AS_DETECT_BETTER_SHELL): Don't look in /usr/bin/posix.

2006-10-11  Stepan Kasal  <kasal@ucw.cz>

* lib/m4sugar/m4sh.m4 (AS_BOURNE_COMPATIBLE): Move the
  initialization which is not inherited through the environment
(_AS_BOURNE_COMPATIBLE): ... to this new macro.
(_AS_RUN): Call _AS_BOURNE_COMPATIBLE, not AS_BOURNE_COMPATIBLE.
2006-10-11 19:35:57 +00:00
Stepan Kasal
ee62b2bba5 Cancel the previous change for now. 2006-10-06 15:31:26 +00:00
Paul Eggert
71e8fdea43 * doc/autoconf.texi (Special Shell Variables): Autoconf-generated
shel scripts no longer export BIN_SH, due to configuration
hassles with this.
* lib/m4sugar/m4sh.m4 (AS_BOURNE_COMPATIBLE): Don't set BIN_SH
or DUALCASE.
(_AS_DETECT_BETTER_SHELL): Don't look in /usr/bin/posix.
Use AS_EXECUTABLE_P rather than test -f.
(AS_SHELL_SANITIZE): Set DUALCASE.
(AS_EXECUTABLE_P): Just invoke as_executable_p.
(_AS_TEST_PREPARE): Default to test -f, rather than to nothing.
2006-10-04 21:16:06 +00:00
Paul Eggert
6fd58f160c * lib/m4sugar/m4sh.m4 (_AS_TEST_PREPARE): Use "test -x /" rather
than creating a file to use with test -x; this is much faster.
2006-10-04 18:53:19 +00:00
Eric Blake
18be0ccecf * m4/m4.m4: Change copyright.
* configure: Regenerate.
* Makefile.in: Likewise.
* bin/Makefile.in: Likewise.
* doc/Makefile.in: Likewise.
* lib/Makefile.in: Likewise.
* lib/Autom4te/Makefile.in: Likewise.
* lib/autoconf/Makefile.in: Likewise.
* lib/autoscan/Makefile.in: Likewise.
* lib/autotest/Makefile.in: Likewise.
* lib/emacs/Makefile.in: Likewise.
* lib/m4sugar/Makefile.in: Likewise.
* man/Makefile.in: Likewise.
* tests/Makefile.in: Likewise.
2006-09-20 03:08:08 +00:00
Paul Eggert
5bb58ce196 (_AS_TEST_PREPARE): Avoid bug in UnixWare
7.1.4 /usr/bin/posix/sh described by Tim Rice in
<http://lists.gnu.org/archive/html/bug-autoconf/2006-09/msg00017.html>.
2006-09-12 07:07:32 +00:00
Paul Eggert
2db42f6613 Regenerate. 2006-08-24 22:57:30 +00:00
Paul Eggert
f2a9d6f3a7 Regenerate. 2006-08-24 22:57:30 +00:00
Paul Eggert
345806cfca Rework to use more-modern build style.
Many files are renamed; all uses of their names were changed.
* .x-sc_trailing_blank: Renamed from .x-sc_trailing_blank.
* .x-sc_useless_cpp_parens: New file.
* build-aux/config.guess: Renamed from config/config.guess.  Update.
* build-aux/config.sub: Renamed from config/config.sub.  Update.
* build-aux/elisp-comp: Renamed from config/elisp-comp.
* build-aux/install-sh: Renamed from config/install-sh.  Update.
* build-aux/mdate-sh: Renamed from config/mdate-sh.
* build-aux/missing: Renamed from config/missing.
* build-aux/texinfo.tex: Renamed from config/texinfo.tex.  Update.
* build-aux/vc-list-files: Renamed from config/vc-list-files.
* config/Makefile.am: Removed.
* config/mkinstalldirs: Removed.
* config/move-if-change: Removed.
* m4/m4.m4: Renamed from config/m4.m4.  Add (C) to copyright notice.
* Makefile.am (SUBDIRS): Remove config.
(ACLOCAL_AMFLAGS): Include from m4, not config.
(EXTRA_DIST): Add config/announce-gen, config/prev-version.txt.
(WGET, WGETFLAGS): New macros, since Makefile.maint no longer does this.
(autom4te-update): Rewrite with a loop.  Get from gnulib, not automake.
Fail if there's an error.
* Makefile.cfg (move_if_change): Remove.
(wget_files): Remove.
(cvs_executable_files): New macro.
(cvs_files): Use it.  Remove mkinstalldirs.  Add fdl.texi.
(executable-update): Use $(cvs_executable_files).
(local-checks-to-skip): Remove.
* Makefile.maint: Merge from coreutils, plus add our own changes
(gzip_rsyncable): New macro.
(GZIP_ENV): Use it.
(CVS_LIST): Use build-aux/vc-list-files.
(VERSION_REGEXP): New macro.
(local-checks-available): Add patch-check, $(syntax-check-rules),
check-AUTHORS.
(syntax-check-rules): Compute dynamically.
(sc_cast_of_x_alloc_return_value): Work even if no source files.
(sc_cast_of_alloca_return_value): Likewise.
(sc_prohibit_atoi_atof): Simplify regexp.
(sc_no_if_have_config_h, sc_require_config_h):
(sc_prohibit_assert_without_use,
(sc_obsolete_symbols): Check for O_NDELAY.
(sc_texi_notab): Remove.
(sc-changelog): Don't make an exception for '----' lines.
(.re-list): Remove, so we don't have a junk file behind.
(sc_system_h_headers): Remove the need for .re-list.
(sc_the_the):  New rule.
(sc_tight_scope): Simplify.
(sc_trailing_space): Renamed from sc_trailing_blank.
(longopt_re): New macro.
(sc_two_space_separator_in_usage): New rule.
(sc_unmarked_diagnostics): Look at all files under CVS.
(sc_useless_cpp_parens, patch-check, check-AUTHORS): New rules.
(news-date-check, changelog-check): Version is OK.
(po-check): Look for lib files even if not in CVS.
(copyright-check): Use $() not ``.
(maintainer-distcheck): Do not depend on changelog-check.
(my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
Also check for -Wpointer-arith.
(WGET, WGETFLAGS, tgz-md5, tgz-sha1, bz2-md5, bz2-sha1):
(xdelta-md5, xdelta-sha1, tgz-size, bz2-size, xd-size, rel-check):
Remove.
(announcement): Add --gpg-key-id arg.
(cvs-sv): Remove.
(move_if_change): Just use mv.
(local_updates: Remove wget-update, po-update.
(po_repo, do-po-update, po-update, wget_files, get-targets): Remove.
(config.guess-url_prefix, config.sub-url_prefix): Remove.
(ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
(standards.texi-url_prefix, make-stds.texi-url_prefix, target, url):
($(get-targets)): Remove.
(cvs_files): Remove missing, mkinstalldirs, ansi2knr.c.
(gnulib_repo): Renamed from automake_repo.  Get from gnulib now.
(cvs-update): Get from gnulib.
(emut_upload_commands): gnupload is in build-aux now.
(alpha beta major): Add changelog-check.  Check version.
* configure.ac (AC_CONFIG_AUX_DIR): Renamed from config to build-aux.
(AC_CONFIG_FILES): Remove.
* bin/autoconf.as: Add spaces to avoid distcheck warning.
* config/announce-gen: Sync from coreutils.
* doc/make-stds.texi: Sync from gnulib.
* doc/standards.texi: Likewise.
* man/Makefile.am: Adjust for config -> build-aux renaming.
* tests/Makefile.am: Prefer $(FOO) to @FOO@.
* tests/local.at: Adjust from config -> build-aux renaming.
* tests/tools.at: Likewise.
* tests/torture.at: Likewise.
2006-08-24 22:56:47 +00:00
Ralf Wildenhues
66931ce882 * lib/m4sugar/m4sugar.m4 (m4_init): Merge the two m4_wrap
calls, so that we do not care whether they are LIFO or FIFO;
in the m4_wrap, do not check which diversion is the topmost
one, just check that the stack is balanced at the end.
* lib/m4sugar/m4sh.m4 (AS_INIT): We are going to change the
base diversion forever--pop the previous diversion before
opening the new one; consequently, remove the m4_wrap call.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* tests/m4sugar.at: Do not use
m4_wrap([m4_diversion_pop([..])]), for educational purposes.
2006-06-20 05:35:38 +00:00
Paul Eggert
58716edd69 * lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Look for
$as_shell.exe too.  Problem reported by Andreas Buening in
<http://lists.gnu.org/archive/html/autoconf/2006-06/msg00038.html>.
2006-06-07 23:46:47 +00:00
Ralf Wildenhues
7b022ff9eb * lib/freeze.mk: Quiet check-forbidden-patterns so the string
"ERROR" only shows up in "make check" output if there is an
error.
2006-06-06 20:31:55 +00:00
Ralf Wildenhues
8cf341a6dc * lib/m4sugar/m4sugar.m4 (m4_require): Modify the error
message issued by AC_REQUIRE.
* tests/m4sugar.at: Check m4_require's error message.
* tests/base.at: Check AC_REQUIRE's error message.
* tests/local.at (AT_CHECK_M4): New macro, almost identical
to...
(AT_CHECK_AUTOM4TE): ... which is now a thin wrapper around
AT_CHECK_M4.
(AT_CHECK_AUTOCONF): Use AT_CHECK_M4; no longer support
`expout' as the last parameter.
* tests/tools.at: Adapt to the above change.
2006-06-05 08:18:33 +00:00
Ralf Wildenhues
c148c4af82 * lib/m4sugar/m4sh.m4 (_AS_DIRNAME_PREPARE): Guard against test
argument with leading hyphen.  Problem reported by Paul Eggert.
2006-05-31 09:44:39 +00:00
Ralf Wildenhues
7548e5acd6 * lib/m4sugar/m4sh.m4 (_AS_DIRNAME_PREPARE): Check whether
`dirname -- /' returns `/', for SunOS dirname scripts that escaped.
Report by Sam Sirlin <sam@kalessin.jpl.nasa.gov>.
2006-05-30 23:24:55 +00:00
Paul Eggert
922c98ee7d * NEWS: Mention that AC_TRY_COMMAND and AC_TRY_EVAL may be removed.
* doc/autoconf.texi (Special Chars in Variables): New section.
(Preset Output Variables): Warn about special chars in CPPFLAGS.
(Installation Directory Variables): Quote $(datadir) better.
(Limitations of Builtins): Describe some of eval's trickiness.
* lib/autoconf/c.m4 (AC_PROG_CC_C_O): Simplify quoting.
* lib/autoconf/fortram.m4 (_AC_PROG_FC_V_OUTPUT): Likewise.
* lib/autoconf/general.m4 (_AC_INIT_PREPARE): Put leading space
in front of every arg, not just trailing args.  Quote apostrophes.
(_AC_EVAL_ECHO): New macro.
(_AC_EVAL, AC_EVAL_STDERR): Use it.  Quote arg of eval.
(AC_TRY_EVAL, AC_TRY_COMMAND): Mention that these macros might get
removed.
(_AC_LINK_IFELSE): Use proper rule for shell continuation lines,
exposed by quoting of eval argument.  Put the command on line line
so it logs better.
* lib/autoconf/libs.m4 (_AC_PATH_X_XMKMF): Use eval more safely.
(_AC_PATH_X, AC_PATH_X): Quote more safely.
* lib/autoconf/programs.m4 (AC_PROG_MAKE_SET): Use eval more safely.
* lib/autoconf/specific.m4 (AC_SYS_LONG_FILE_NAMES): Don't use eval.
* lib/autoconf/status.m4 (_AC_OUTPUT_SUBDIRS): Minor style change.
Handle special chars in prefix, ac_srcdir, ac_aux_dir.
Use eval more safely.
(_AC_OUTPUT_CONFIG_STATUS): Adjust to above changes.
* lib/m4sugar/m4sh.m4 (AS_VAR_GET): Note that this API needs
to be replaced.
* tests/base.at (AC_TRY_COMMAND): Use proper rule for shell continuation
lines, exposed by quoting of eval argument.
2006-05-26 22:29:50 +00:00
Paul Eggert
a5272ddcec * lib/autoconf/functions.m4 (AC_REPLACE_FNMATCH, AC_FUNC_FNMATCH_GNU):
Quote some uses of shell variables if they might suffer unexpected
globbing.  This doesn't fix all instances of quoting problems that
I found, just the easy ones that look safe.
* lib/autoconf/general.m4 (_AC_INIT_SRCDIR, _AC_INIT_HELP):
(AC_CONFIG_AUX_DIR, AC_CONFIG_AUX_DIR_DEFAULT, AC_CONFIG_AUX_DIRS):
(AC_CANONICAL_BUILD, AC_CANONICAL_HOST, AC_CANONICAL_TARGET):
(AC_CACHE_LOAD, AC_CACHE_SAVE): Likewise.
* lib/autoconf/libs.m4 (_AC_PATH_X_XMKMF, _AC_PATH_X_DIRECT): Likewise.
* lib/autoconf/specific.m4 (AC_SYS_LONG_FILE_NAMES): Likewise.
* lib/autoconf/status.m4 (_AC_OUTPUT_LINK, _AC_OUTPUT_SUBDIRS):
Likewise.
* lib/autotest/general.m4 (_AC_INIT_PARSE_ARGS): Likewise.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Likewise.
2006-05-19 02:57:45 +00:00
Paul Eggert
9479591b3e * doc/autoconf.texi (Particular Programs): AC_PROG_MKDIR_P now
sets MKDIR_P, not mkdir_p, to avoid collisions with Automake.
Warn about obsolete install-sh files.  Remove stray sentence
fragment and fix cross reference.
* lib/autoconf/programs.m4 (AC_PROG_INSTALL): Don't insist on
install -d; this undoes the 2006-05-10 change.
(MKDIR_P): Mark with AN_MAKEVAR.
(AC_PROG_MKDIR_P): Fall back on $ac_install_sh, not $INSTALL, so
that we don't require $INSTALL to be thread-safe.  Move comments
out of generated code.  Require AC_CONFIG_AUX_DIR_DEFAULT instead
of AC_PROG_INSTALL.  Output a message saying that we're checking
mkdir -p.  Set MKDIR_P rather than mkdir_p.  Do special magic for
MKDIR_P instead of AC_SUBST.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILE, _AC_OUTPUT_CONFIG_STATUS):
Special magic for MKDIR_P, too.
* lib/m4sugar/m4sh.m4 (AS_MKDIR_P): Remove comment that defeated
a dnl.
* tests/local.at (AT_CHECK_ENV): mkdir_p -> MKDIR_P.
2006-05-13 09:54:51 +00:00
Paul Eggert
0f696b8be5 * NEWS: New macro AC_PROG__MKDIR_P. AS_MKDIR_P is now more robust.
* config/install-sh: Don't use 'path' to talk about file names,
as per GNU coding standards.  Close a race condition reported by Ralf
Wildenhues and Stepan Kasal.  There is still a race condition
on hosts that predate POSIX 1003.1-1992, but we can't help this.
Don't mishandle weird characters like space on pre-POSIX hosts.
Invoke mkdir at most once per dir arg on pre-POSIX hosts.
* doc/autoconf.texi (Programming in M4sh): Cross-reference to
AC_PROG_MKDIR_P from AS_MKDIR_P.
(Limitations of Usual Tools): Cross-reference to AC_PROG_MKDIR_P
from mkdir.  Mention that Autoconf 2.60 install-sh is safe but
earlier editions are not (including Automake 1.8.3).
Do not suggest mkinstalldirs for thread-safety.
* lib/m4sugar/m4sh.m4 (AS_MKDIR_P): Make it more robust in the
presence of special characters and race conditions.
* tests/local.at (AT_CHECK_ENV): Add mkdir_p to the list of variables
in Autoconf's name space.

* lib/autoconf/programs.m4 (AC_PROG_MKDIR_P): New macro, taken
from Automake with minor changes.
* doc/autoconf.texi (Particular Programs): Document AC_PROG_MKDIR_P.
2006-05-10 23:05:15 +00:00
Paul Eggert
a87d7437dc * lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Don't use AS_ERROR,
since as_me isn't set yet.
2006-04-25 12:27:45 +00:00
Paul Eggert
9aed71b2ec Undo many of the recent changes, substituting these instead:
* doc/autoconf.texi (Programming in M4sh): Comment out the
documentation of AS_BASENAME, for now.
(Shell Substitutions): Do not use AS_DIRNAME in an example.
(Limitations of Builtins) <basename>: Do not refer to
AS_BASENAME.
* bin/autoconf.as (me): Don't use AS_BASENAME.
(dir): Remove the unused variable.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_REQUIRED): Renamed from
AS_DETECT_REQUIRED.  All uses changed.
(_AS_DETECT_SUGGESTED): Renamed from AS_DETECT_SUGGESTED.
All uses changed.
(_AS_DETECT_BETTER_SHELL): Put ;; at the end of a case.
(AS_BASENAME): Use "basename --" to protect against leading "-".
(_AS_BASENAME_EXPR): Renamed from AS_BASENAME_EXPR.  All uses changed.
(_AS_BASENAME_SED): Renamed from AS_BASENAME_SED.  All uses changed.
(_AS_BASENAME_PREPARE): Reject implementations that cannot handle "--".
(_AS_DIRNAME_PREPARE): Likewise.
(_AS_DIRNAME_EXPR): Renamed from AS_DIRNAME_EXPR.  All uses changed.
(_AS_DIRNAME_SED): Renamed from AS_DIRNAME_SED.  All uses changed.
(AS_DIRNAME): Use "dirname --".
2006-04-24 19:36:01 +00:00
Paul Eggert
24a8c2d4a5 * NEWS: Update wording to say merely "should" for AS_DIRNAME
and AS_BASENAME.
* lib/m4sugar/m4sh.m4 (AS_BASENAME, AS_DIRNAME): Bring these
back, albeit undocumented.  Programs now have a grace period
to switch to AS_VAR_SET_DIRNAME and AS_VAR_SET_BASENAME.
2006-04-23 08:13:43 +00:00
Paul Eggert
52d54c54e3 * NEWS: Remove AS_DIRNAME and AS_BASENAME, replacing them with
AS_VAR_SET_DIRNAME and AS_VAR_SET_BASENAME.
* doc/autoconf.texi (Programming in M4sh): Document this.  All uses
changed.  The newer interfaces are more reliable, as they allow
implementations that handle trailing newline correctly.  For now,
we're in a freeze, so I did not include the more-reliable
implementations, but I wanted to correct the interface before 2.60
goes out.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_REQUIRED): Renamed from
AS_DETECT_REQUIRED.  All uses changed.
(_AS_DETECT_SUGGESTED): Renamed from AS_DETECT_SUGGESTED.
All uses changed.
(_AS_DETECT_BETTER_SHELL): Put ;; at the end of a case.
(_AS_BASENAME): Renamed from AS_BASENAME.  All uses changed.
Use "basename --" to protect against leading "-".
(_AS_BASENAME_EXPR): Renamed from AS_BASENAME_EXPR.  All uses changed.
(_AS_BASENAME_SED): Renamed from AS_BASENAME_SED.  All uses changed.
(_AS_BASENAME_PREPARE): Reject implementations that cannot handle "--".
(_AS_DIRNAME_PREPARE): Likewise.
(_AS_DIRNAME): Renamed from AS_DIRNAME.  All uses changed.
(_AS_DIRNAME_EXPR): Renamed from AS_DIRNAME_EXPR.  All uses changed.
(_AS_DIRNAME_SED): Renamed from AS_DIRNAME_SED.  All uses changed.
Use "dirname --".
(AS_VAR_SET_BASENAME, AS_VAR_SET_DIRNAME): New macros.
* tests/m4sh.at (AS_VAR_SET_DIRNAME): Renamed from AS_DIRNAME.
Test the new API.  Don't test internals, since they're probably
going to change anyway.
(AS_VAR_SET_BASENAME): Likewise, renamed from AS_BASENAME.

* bin/autoconf.as: Don't use AS_BASENAME or AS_DIRNAME.  This
removes a bootstrapping problem with the changes described above.
The AS_DIRNAME part wasn't used, anyway, and the AS_BASENAME
part can be done portably without all the deep Autoconf magic.
2006-04-23 06:49:53 +00:00
Stepan Kasal
b3c78a065b * lib/m4sugar/m4sh.m4 (_AS_LN_S_PREPARE): Simplify the summary of
all the changes since 2006-04-07.
2006-04-12 12:20:13 +00:00
Ralf Wildenhues
f05b9c77f0 * lib/m4sugar/m4sh.m4 (_AS_LN_S_PREPARE): If `ln -s file1 file2'
succeeded, but `ln -s file dir' failed, take care to remove the
leftover target before the next test, to prevent its spurious
failure; also make sure `ln file dir' works before selecting it.
Thanks to Keith Marshall for pointing this out.
* THANKS: Update.
2006-04-11 17:34:03 +00:00
Ralf Wildenhues
6d2c0bd7e5 Regenerate. 2006-04-10 20:40:49 +00:00
Ralf Wildenhues
6ca1cfdde2 * lib/m4sugar/m4sh.m4 (_AS_LN_S_PREPARE): MSYS `ln -s' fails
with a target directory; it's internally implemented as `cp'
anyway, but since Autoconf advertises the possibility to use
a target directory when LN_S is `ln -s', we need to find out.
Reported by Rolf Ebert <rolf.ebert.gcc@gmx.de> against MSYS,
analyzed by Keith Marshall <keith.marshall@total.com>.
2006-04-10 17:55:33 +00:00
Ralf Wildenhues
9e365d1e0b Revert the patch from 2006-04-01 and only improve
_AS_DETECT_BETTER_SHELL:

* lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Do not optimize; do not
skip nonexistent directories.
(_AS_DETECT_BETTER_SHELL): The optimization is moved here--try
only shell candidates which exist.
(AS_UNAME): No need to give three parameters to _AS_PATH_WALK.
* lib/autotest/general.m4 (AT_INIT): No need to give three
parameters to _AS_PATH_WALK.
2006-04-07 18:31:09 +00:00
Stepan Kasal
67b61ef700 Revert my change from 2006-03-17, in other words:
* lib/m4sugar/m4sh.m4 (AS_BOURNE_COMPATIBLE): Insert BIN_SH=xpg4
  and DUALCASE=1.
(AS_SHELL_SANITIZE): Remove DUALCASE=1.
* doc/autoconf.texi (Special Shell Variables) <BIN_SH>: Say that
  it is set.
2006-04-07 18:00:55 +00:00
Paul Eggert
cf298164fe * lib/m4sugar/m4sh.m4 (AS_BASENAME_EXPR, AS_DIRNAME_EXPR):
Use simplified args that Eric Blake originally suggested.
2006-04-05 08:01:04 +00:00
Stepan Kasal
e5c9d58fcb Add _AS_DIRNAME_PREPARE to _AS_PREPARE. 2006-04-01 22:55:15 +00:00
Stepan Kasal
2af85b096a _AS_DIRNAME_PREPARE 2006-04-01 20:06:12 +00:00
Stepan Kasal
a7ee4bb357 back out _AS_DIRNAME_PREPARE 2006-04-01 19:54:55 +00:00
Stepan Kasal
0435cce62a _AS_DIRNAME_PREPARE 2006-04-01 19:48:14 +00:00
Stepan Kasal
784f54dfcd Fix typos. 2006-04-01 19:38:07 +00:00
Stepan Kasal
6f39626778 _AS_PATH_WALK: Skip nonexistent dirs, unless told otherwise. 2006-04-01 18:32:10 +00:00
Stepan Kasal
a9b857317c Sort the macros and fix typos. 2006-04-01 18:26:46 +00:00
Stepan Kasal
1a74a211bc Be tolerant if rm was not able to remove the test directory. 2006-04-01 16:09:13 +00:00
Paul Eggert
e4913c88f3 * lib/m4sugar/m4sh.m4 (AS_BASENAME_EXPR): Handle ///, ////, etc.
correctly.  Problem reported by Eric Blake.
(_AS_EXPR_PREPARE): Detect Tru64 expr bug.  Problem reported by
Ralf Wildenhues.
2006-03-31 18:46:47 +00:00
Ralf Wildenhues
ff15ef7a2c * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Quote
`$0' to protect against spaces.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/m4sugar/m4sh.m4 (_AS_LINENO_PREPARE): Likewise, for
`$0', $as_me.
2006-03-27 17:42:17 +00:00
Stepan Kasal
13324b1dfd Removed BIN_SH=xpg4, moved DUALCASE=1 to AS_SHELL_SANITIZE. 2006-03-17 19:32:53 +00:00
Ralf Wildenhues
c5982aeff4 * lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Prepend
the directory `/usr/bin/posix' in the shell search, to prefer
the Posix shell not only in subsequent spawns as with `$BIN_SH'
on Tru64.
2006-03-17 17:09:21 +00:00
Stepan Kasal
a7791c7782 Move the IFS setup and CDPATH sanitizing to AS_SHELL_SANITIZE. 2006-03-16 13:33:18 +00:00
Ralf Wildenhues
6f4a6a0740 * lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Do not forget to reset
IFS even in case of empty `$PATH'.
2006-03-14 07:18:18 +00:00
Ralf Wildenhues
a628e04465 * lib/m4sugar/m4sh.m4 (AS_IF): Extend to allow more than one
test, as in `if tests; then cmd1; elif ...; else ...; fi'.
* doc/autoconf.texi (Programming in M4sh): Adjusted.
* tests/m4sh.at (AS_IF and AS_CASE): Test this.  Also make sure
both macros are defun'ed so that required macros are evaluated
outside.
2006-02-21 09:30:01 +00:00
Ralf Wildenhues
14f61daa3c * doc/autoconf.texi (Looping constructs): New node, to
document m4_for, m4_foreach, m4_foreach_w, and mention
obsolete AC_FOREACH.
(Obsolete Macros): Document AC_FOREACH.
* lib/m4sugar/m4sugar.m4 (_m4_for): Fix declaration comment.
(m4_for): Fix to never loop (almost) endlessly, work correctly
with arithmetic expressions in arguments, a step of zero or
non-integer multiple of the interval, and avoid integer
overflow.
* tests/m4sugar.at: New test for m4_for, m4_foreach, and
m4_foreach_w.
2006-02-20 21:43:05 +00:00
Paul Eggert
cf77d083f0 Regenerate. 2006-02-20 19:46:52 +00:00
Paul Eggert
b7484c4c76 Regenerate. 2006-02-20 08:59:37 +00:00
Ralf Wildenhues
6fab15fe41 * lib/m4sugar/m4sh.m4 (AS_CASE): New macro.
(_AS_CASE): Private helper macro.
* tests/m4sh.at: Basic tests for AS_IF and AS_CASE.
* doc/autoconf.texi (Programming in M4sh): Document AS_CASE.
Fix syntax of AS_IF description
(Prerequisite Macros): Mention AS_IF and AS_CASE as workarounds
for the AC_REQUIRE mess.
* NEWS: Mention AS_CASE, AS_BOURNE_COMPATIBLE, and
AS_SHELL_SANITIZE.
2006-02-15 07:00:29 +00:00
Paul Eggert
9a0e3a3558 * doc/autoconf.texi (Programming in M4sh): Document
AS_BOURNE_COMPATIBLE and AS_SHELL_SANITIZE.
* lib/m4sugar/m4sh.m4 (_AS_BOURNE_COMPATIBLE): Renamed to..
(AS_BOURNE_COMPATIBLE): ..this.
(_AS_RUN, AS_SHELL_SANITIZE): Adjusted all callers.
2006-02-13 18:46:04 +00:00
Paul Eggert
cec2431f10 * lib/m4sugar/m4sh.m4 (_AS_BOURNE_COMPATIBLE): Look at the output
of (set -o) rather than testing whether (set -o posix) succeeds,
to work around a bug in the AIX 5.3 shell.
2006-02-13 07:45:03 +00:00
Ralf Wildenhues
72c832bf54 * lib/m4sugar/m4sh.m4 (AS_TMPDIR): Do not pass `-q' to mktemp.
* lib/Autom4te/General.pm (mktmpdir): Likewise.
(END): Improve error message a bit.
Reported by Bruce Korb <bkorb@gnu.org>.
2006-01-21 09:09:46 +00:00
Ralf Wildenhues
f124168ce6 * lib/m4sugar/m4sugar.m4 (m4_text_wrap): Handle quadrigraphs
correctly: pad with spaces after FIRST_PREFIX if necessary,
and compute string lenghts with `m4_qlen' instead of `m4_len'.
* lib/m4sugar/m4sh.m4 (AS_HELP_STRING): Comments updated.
* tests/m4sh.at (AS_HELP_STRING): Test extended.
* NEWS: Updated.
Reported by numerous people, numerous times.
2006-01-11 08:05:55 +00:00
Paul Eggert
f292fd9dd5 * Makefile.maint (sc_root_tests): Use recommend style s/a/b/ for
sed substitutions.
* doc/autoconf.texi (Installation Directory Variables): Use s|a|b|
for file names, again.  Reported by Noah Misch.
(Coding Style): Explain that s|a|b| is preferred for file names.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Prefer s/a/b/.
(AC_OUTPUT_MAKE_DEFS): Likewise.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/m4sugar/m4sh.m4 (_AS_LINENO_PREPARE): Likewise.
* tests/local.at (AT_CHECK_AUTOM4TE): Likewise.
2006-01-06 00:02:26 +00:00
Paul Eggert
0ee621917a Fix Posix-conformance bugs re use of { command in sed scripts,
and improve the sed-related documentation a bit.
* doc/autoconf.texi (Installation Directory Variables): Use
our own style advice re 's,a,b,' versus 's|a|b|'.  Use "Sed"
rather than "sed" when talking about Sed in general.
(Particular Programs): Likewise.
(Coding Style): y is like s with respect to / and ,.
(Limitations of Usual Tools): Document the weird restrictions
that Posix has about { }.  Use better quoting.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE, _AC_OUTPUT_HEADER):
Rewrite to conform to Posix rules about { } in sed scripts.
* lib/m4sugar/m4sh.m4 (AS_DIRNAME_SED, AS_BASENAME_SED): Likewise.
* tests/foreign.at (Libtool): Likewise.
* tests/semantics.at (AC_CHECK_PROG & AC_CHECK_PROGS):
Use our own style advice re 's,a,b,' versus 's|a|b|'.
2006-01-05 21:43:44 +00:00
Paul Eggert
93f53cfee7 (_AS_BOURNE_COMPATIBLE): Try `set -o
posix' unconditionally, for pdksh in `native sh' emulation.
2005-12-02 19:22:49 +00:00
Paul Eggert
cf3b3ede92 * lib/m4sugar/m4sugar.m4 (_m4_map): New macro.
(m4_map, m4_map_sep): Use it.  Handle the empty list correctly.
2005-10-05 21:27:43 +00:00
Stepan Kasal
d8e678e2d0 (AS_IF): Use m4_default. 2005-09-06 15:37:55 +00:00
Paul Eggert
7385854c54 (_AS_VERSION_COMPARE_PREPARE):
The previous patch didn't work, so try a better one.
2005-08-26 18:49:23 +00:00
Paul Eggert
7753b867c0 Regenerate. 2005-08-25 21:33:19 +00:00
Paul Eggert
ffea2f0089 * lib/m4sugar/m4sh.m4 (_AS_VERSION_COMPARE_PREPARE):
Work around bug in Solaris 9 (and 10) /usr/xpg4/bin/awk.
2005-08-25 21:29:54 +00:00
Paul Eggert
3774d96668 Comment fix: change tab to "<tab>" in comment, so that the point is
understandable.
2005-07-25 17:47:08 +00:00
Stepan Kasal
8c60c99222 Obsolete AC_FOREACH. 2005-07-01 08:45:22 +00:00
Paul Eggert
124c037f3d Regenerate. 2005-06-23 20:11:18 +00:00
Stepan Kasal
0ed02e1aa5 fix m4split([]) 2005-06-21 15:38:24 +00:00
Paul Eggert
f149ecd2b8 * lib/m4sugar/m4sh.m4 (as_awk_strverscmp): Port to Solaris /bin/awk.
* doc/autoconf.texi:
Don't mention Solaris versions so much, if a
problem is common to all extant versions of Solaris.  Say "SunOS
4" instead of "SunOS" for SunOS 4.
(awk): Mention more of the limitations of traditional Awk.
(cat): Don't talk about cat -v.
2005-06-17 20:37:36 +00:00
Paul Eggert
9e1a1f1400 * lib/m4sugar/m4sh.m4 (_AS_VERSION_COMPARE_PREPARE): New macro.
(AS_VERSION_COMPARE): New macro.  The API is taken from CVS,
but the implementation is entirely different and is designed
to be compatible with glibc strverscmp.
* tests/m4sh.at (AS_VERSION_COMPARE): New test.
2005-06-16 21:03:47 +00:00
Paul Eggert
2fb1b97ad0 * doc/autoconf.texi: "filesystem" -> "file system".
"behavior" -> "behavior".
Warn about \(...\)* in Solaris sed (written by Ralf Menzel).
* lib/autoconf/general.m4: Omit blank after ":" sed command,
as per POSIX.
* lib/m4sugar/m4sh.m4: Likewise.
* lib/autoconf/status.m4 (_AC_OUTPUT_HEADERS): Work around problem
with Solaris sed.  Fix by Stepan Kasal.
2005-06-11 06:05:11 +00:00
Paul Eggert
bf9df8d65a * lib/m4sugar/m4sh.m4 (AS_VAR_TEST_SET): Work even if $1 contains
quotes and backslashes.  Patch from Derek Price.
2005-06-10 17:19:02 +00:00
Derek Price
505d062d8f * lib/m4sugar/m4sugar.m4: Undefine include & sinclude rather than
renaming them since they are about to be redefined anyhow.
2005-06-08 18:54:23 +00:00
Stepan Kasal
d354edbe65 Fix m4_cdr for one-member lists. 2005-06-06 08:47:02 +00:00
Paul Eggert
102586d8e0 * lib/m4sugar/m4sh.m4 (_AS_SHELL_FN_WORK): Fix diagnostics.
From Ralf Menzel (trivial change).
2005-05-27 22:21:44 +00:00
Stepan Kasal
e96830f886 (_AS_ECHO_LOG): New macro 2005-05-24 07:29:57 +00:00
Stepan Kasal
9f639eb48d (AS_ESCAPE): Make the pattern a bit simpler 2005-05-24 07:27:55 +00:00
Stepan Kasal
e7d74c4c5d Move _AS_ECHO_UNQUOTED lower; no code change. 2005-05-24 07:27:15 +00:00
Stepan Kasal
f014f06e6b (m4_ifset): Use m4_ifval. 2005-05-24 07:25:32 +00:00
Stepan Kasal
53466e6d2b typo 2005-05-20 12:07:02 +00:00
Stepan Kasal
ae53380796 (m4_text_wrap): Don't m4_quote the second argument to m4_foreach. 2005-05-17 09:49:36 +00:00
Paul Eggert
681d17dce2 Update FSF postal mail address. 2005-05-14 07:00:38 +00:00