Commit Graph

5435 Commits

Author SHA1 Message Date
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
2c521d7fd6 Part two of GNUmakefile sync.
Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-21 21:49:58 -06:00
Eric Blake
4b8a55e1e0 Ignore undefined macros, necessary with m4 1.6.
* bin/autoupdate.in (_au___undefine): New macro,...
(_au__undefine): ...wrapped by ifdef to silence m4 warnings.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-21 16:41:10 -06:00
Eric Blake
46a7a43068 Resync with gnulib.
* GNUmakefile: Grab from upstream, to fix issue where 'make
install' would allow installation of stale version string.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-21 15:38:40 -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
Stepan Kasal
6d04538831 Improve documentation of config.h.in template rules.
* doc/autoconf.texi (Header Templates): Mention rules on comments
and whitespace, and that the user cannot rely on #undef to survive
through config.status.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-17 18:55:51 -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
Ralf Wildenhues
f89a680ac5 Fix texinfo macros @dvar, @ovar.
* doc/autoconf.texi (@dvar): Remove trailing newline.
(@ovar): Likewise.  Fix macro documentation.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-07-06 10:55:00 +02:00
Stepan Kasal
886a634111 Add quotes to the header of autoscan-generated source.
* bin/autoscan.in: Add quotes to AC_PREREQ and AC_INIT.

Signed-off-by: Stepan Kasal <skasal@redhat.com>
2008-07-02 15:38:24 +02:00
Andreas Schwab
8f052f4c5a Replace @item with @itemx where appropriate.
* doc/autoconf.texi (autoscan Invocation): Fix spacing.
(autoconf Invocation): Likewise.
(autoreconf Invocation): Likewise.
(autoheader Invocation): Likewise.
(autom4te Invocation): Likewise.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-06-28 11:30:16 +02:00
Eric Blake
a8eb896999 Add comment explaining recent patch.
* lib/autotest/general.m4 (AT_INIT) <at_pass_list>: Explain choice
of * vs. ? globbing.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-19 07:02:20 -06:00
Ralf Wildenhues
e8422963df config.status should not warn when it does not link.
* lib/autoconf/status.m4 (_AC_OUTPUT_LINK): Do not warn when not
linking a file to itself.
Report by Bruno Haible.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-06-19 07:55:16 +02:00
Eric Blake
b077f0d2d6 Resync with gnulib.
* GNUmakefile: Grab from upstream, to fix VPATH 'make dist' bug.
Reported by Stepan Kasal.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-18 23:10:59 -06:00
Ralf Wildenhues
ea2e96c4ac Reorganize autotest files, factorize for parallel execution.
* lib/autotest/general.m4 (AS_MESSAGE_LOG_FD): Move definition
earlier in the file.
(AT_INIT): Create line number cache in
$at_suite_dir/at-source-lines.
<at_helper_dir>: New directory at-groups below $at_suite_dir.
Add comment explaining the new directory structure.
(at_func_group_prepare, at_func_group_postprocess): New shell
functions to factorize per-test group work.  Keep the actual
test execution outside of a shell function in order to avoid
zsh 4.x exit status bugs.
<at_check_line_file, at_status_file, at_stdout, at_stder1>
<at_stderr, at_test_source>: Turn these into per-group files
below $at_helper_dir.  Also store test results there in files
named pass, fail, xpass, xfail, skip.  Let the parent collect
results from $at_helper_dir.  Adjust summary statistics
computation and result output.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-06-18 21:22:36 +02:00
Ralf Wildenhues
c87512b5ae Fix '#undef variable /* comment */' transform in config headers.
* lib/autoconf/status.m4 (_AC_OUTPUT_HEADERS_PREPARE): For
undefined preprocessor macros that are followed by a comment
in the header template, do not create nested comments in the
output.
* tests/torture.at (@%:@define header templates): Extend test.
* NEWS: Update.
Report by Karsten Hopp <karsten@redhat.com>.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-06-17 08:42:14 +02:00
Eric Blake
7f53c24967 Mark AC_TYPE_SIGNAL as obsolete in NEWS, too.
* NEWS: Mention the change.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-09 06:30:17 -06:00
Eric Blake
7bedbd5be1 Mark AC_TYPE_SIGNAL as obsolete.
* lib/autoconf/types.m4 (AC_TYPE_SIGNAL): Switch to AU_DEFUN.
* doc/autoconf.texi (Function Portability): Update documentation.
(Particular Types): Move AC_TYPE_SIGNAL...
(Obsolete Macros): ...here, and mention why.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-09 06:25:35 -06:00
Eric Blake
7758a34286 Allow lib64 as a default X library location.
* lib/autoconf/libs.m4 (_AC_PATH_X_XMKMF): Add lib64.
* NEWS: Mention the change.
* THANKS: Update.
Reported by Brad Walker.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-09 06:19:17 -06:00
Eric Blake
ceb74d5021 Add URL to previous commit.
Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-06 08:00:07 -06:00
Eric Blake
3ac7ceb0c2 Fix regression in AT_KEYWORDS([Macro]), from 2007-10-18.
* lib/autotest/general.m4 (AT_KEYWORDS): Expand argument prior to
converting it to lower case.
* tests/autotest.at (Keywords and ranges): Test this.
* NEWS: Document the fix.
* THANKS: Update.
Reported by Karsten Hopp.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-05 15:18:11 -06:00
Eric Blake
d4c52d5b15 Fix 'make dist' regression from 2008-05-08.
* Makefile.am (INSTALL): Add rule, to accomodate 'make dist' after
GNUmakefile's _autoconf rule removes INSTALL.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-03 13:24:37 -06:00
Eric Blake
f15bc5b04c Document Solaris /bin/sh redirection pitfall.
* doc/autoconf.texi (File Descriptors): Mention redirection bug.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-27 11:10:33 -06:00
Eric Blake
95dfc19749 Improve documentation of ! issues.
* doc/autoconf.texi (Limitations of Builtins) <!>: Touch up.
Reported by Noah Misch.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-14 13:41:18 -06:00
Eric Blake
3ca7a51d0f Document some FreeBSD shell bugs.
* doc/autoconf.texi (Limitations of Builtins) <!>: Mention ! issue
in compound pipe commands.
<export>: Mention difference of exporting an undefined variable.
(Shell Functions): Mention loss of $? in entry to shell functions.
Extracted from the git mailing list.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-14 08:25:01 -06:00
Stepan Kasal
809b3e5353 Work around MSYS and Cygwin bugs when dealing with trailing space.
* tests/atlocal.in (func_sanitize_dir_name): Let atlocal succeed,
even when platform bugs are tickled.
Reported by Keith Marshall and Eric Blake.
2008-05-13 13:40:55 -06:00
Ralf Wildenhues
4bd87562dc Let AC_MSG_FAILURE report pwd.
* lib/autoconf/general.m4 (_AC_ARG_VAR_VALIDATE, AC_MSG_FAILURE):
Output $ac_pwd along with fatal failure.
* tests/torture.at (Deep Package): Extend test.
Reported numerous times against GCC, and probably other packages.
2008-05-12 07:57:20 -06:00
Eric Blake
e7232d49ca Enforce --help and --version compliance.
* configure.ac (AM_INIT_AUTOMAKE): Add std-options option.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-12 07:45:03 -06:00
Keith Marshall
822c5bbf02 Avoid case-insensitive make install' vs. INSTALL' conflict.
* Makefile.am ($(srcdir)/INSTALL): Replace all references...
($(abs_srcdir)/INSTALL): ...with this.
2008-05-12 06:41:51 -06:00
Eric Blake
684d299c1d Fix typo.
* doc/autoconf.texi (Shell Substitutions): Drop at_ prefix.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-06 09:57:48 -06:00
Eric Blake
cc73f00e18 Avoid overfull \hbox.
* doc/autoconf.texi (Versioning): Reword to fit line size.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-06 09:46:35 -06:00
Eric Blake
2811da8583 Document $(( )) pitfalls.
* doc/autoconf.texi (Shell Substitutions): Mention octal
vs. decimal.  Mention autotest's at_func_arith.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-06 09:46:34 -06:00
Eric Blake
d92dcf1e03 Improve behavior of './testsuite 01'.
* lib/autotest/general.m4 (AT_INIT) <at_func_validate_ranges>:
Alter usage to eval its arguments, in order to normalize away
leading zero.  All callers updated.
* tests/autotest.at (Keywords and ranges): Test range
normalization with leading 0.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-06 06:17:41 -06:00
Eric Blake
c242f622dc Mention Solaris /usr/ucb/tr pitfall.
* doc/autoconf.texi (Limitations of Usual Tools) <tr>: Add section.
Reported by Bruno Haible and Jim Meyering.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-26 06:34:24 -06:00
Eric Blake
c11e71ae56 Mention m4sugar's internal quote strings.
* doc/autoconf.texi (Quadrigraphs): Mention alternate quote used
in m4sugar, and how to still output it literally.
* tests/m4sugar.at (m4@&t@_split): And test it.
Reported by Joel E. Denny.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-24 09:31:16 -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
9651f4a0e1 Document pdksh exec behavior.
* doc/autoconf.texi (Limitations of Builtins) <exec>: New
subsection.
Discovered by Jim Meyering.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-16 12:03:45 -06:00
Eric Blake
c48d3a706f Mention more details about git usage in bootstrap.
Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-15 06:56:56 -06:00
Ralf Wildenhues
c1cd13960d New tests: errexit, input from stdin.
* tests/autotest.at (AT_CHECK_AT): Allow to pass additional
arguments to the inner suite.
(errexit, input from stdin): New tests.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-04-14 23:10:01 +02:00
Ralf Wildenhues
ee2d064528 * NEWS: Post-release update.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-04-13 15:06:31 +02:00
Eric Blake
af1e1f2b9d AC_AUTOCONF_VERSION might contain arbitrary macro names.
* doc/autoconf.texi (Versioning): Mention problem with expansion.
* tests/tools.at (autoconf: AC_AUTOCONF_VERSION): Adjust test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-10 14:09:18 -06:00
Slava Sysoltsev
1ee48b2c8b Flush buffered output before exit.
* bin/autom4te.in (handle_output): Explicitly close file.
* THANKS: Update.
See http://lists.gnu.org/archive/html/autoconf/2008-04/msg00026.html.
2008-04-09 10:46:08 -06:00
Eric Blake
f8bb7242a1 Update various hacking notes.
* HACKING: Add more maintainer-specific details.
* README-hacking: Add more general-contributor details.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-09 10:23:26 -06:00