Commit Graph

5173 Commits

Author SHA1 Message Date
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
c85ce295a0 Whitespace cleanup.
* lib/autotest/general.m4 (_AT_CREATE_DEBUGGING_SCRIPT): Avoid
leading whitespace, as it caused space-tab in testsuite.
(AT_INIT): Avoid trailing newlines in testsuite.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-04 14:35:14 -06:00
Paolo Bonzini
4b10ac1293 use shell functions to speed up autotest and produce slimmer testsuites
2007-10-04  Paolo Bonzini  <bonzini@gnu.org>

	* general.m4 (AT_INIT): Add at_check_newline function.
	(_AT_DECIDE_TRACEABLE): Include at_traceon test, use shell function.
	(_AT_CHECK): Don't use at_trace_this.

Signed-off-by:  Paolo Bonzini  <bonzini@gnu.org>
2007-10-04 21:49:16 +02: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
Paolo Bonzini
e6cf284ade Fix previous commit.
* lib/autotest/general.m4 (AT_LINE): Fix regex.

Signed-off-by:  Paolo Bonzini  <bonzini@gnu.org>
2007-10-04 17:15:21 +02:00
Eric Blake
4c7d289c7d Speed up building testsuites.
* lib/autotest/general.m4 (AT_LINE): Only use regex when file
changed since last time.  Use simpler regex.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-04 07:13:50 -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
8b299b6d82 Remove some XFAILs, and make AT_SETUP output line up.
* lib/autotest/general.m4 (AT_SETUP): Only expand description
once; thereafter, use its expansion, properly quoted.
* tests/autotest.at (AT_CHECK_AT_TITLE): Also check macro
expansion with arguments, and check for aligned output.
(AT_CHECK_AT_TITLE_CHAR): Remove XFAILs for tests that now pass.
Add a test for macros with parameters.
* NEWS: Document the semantics change.
* tests/base.at: Fix test titles containing commas.
* tests/compile.at: Likewise.
* tests/tools.at: Likewise.
* tests/torture.at: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-03 16:20:45 -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
83294abba1 Once again, reject IRIX m4.
* m4/m4.m4 (AC_PROG_GNU_M4): Use indir builtin to root out non-GNU
implementations that ignore --trace.
* configure: Regenerate.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-01 16:22:54 -06:00
Eric Blake
19a706a7ed Fix regression in AC_DEFINE([macro(with_arg)]).
* lib/autoconf/general.m4 (AC_DEFINE_TRACE): Don't chop off close
quotes with a careless m4_substr.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-01 10:10:42 -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
3655680863 Oops - my earlier 'optimization' caused a regression.
* tests/local.at (AT_CHECK_M4): Fix typo.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-28 06:14:11 -06:00
Ralf Wildenhues
220fef66a8 Catch even more common AC_CACHE_VAL mistakes.
* lib/autoconf/general.m4 (AC_CACHE_VAL): Warn if cache variable
lacks '_cv_', or if AC_SUBST appears in body.
* tests/base.at (AC_CACHE_CHECK): Test this change.
2007-09-27 22:18:28 -06:00
Stepan Kasal
755596a7ae Autotest no longer caters to Ultrix redirection limitation.
* doc/autoconf.texi (Writing testsuite.at): Remove the
limitation that the first parameter of AT_CHECK cannot
contain redirection.
(File Descriptors): Mention that Ultrix limitation is no longer a
show-stopper in modern code.
* tests/local.at (AT_CHECK_M4): Fix for cases when the fourth
parameter is `stderr' or `experr'.  Optimize if it was `ignore'.
* lib/autotest/general.m4 (AT_CHECK): Update comment.
2007-09-27 21:09:18 -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
3b121ee688 Autotest formatting touchups.
* lib/autotest/general.m4 (HELP_TUNING): Avoid TAB in terminal
output.
(PATH): Simplify computation of new PATH.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-27 09:32:55 -06:00
Eric Blake
1e9958daa7 Fix testsuite breakage in last patch.
* tests/autotest.at (AT_CHECK_AT_TITLE): Properly quote the
font-lock fix.
* tests/torture.at (@%:@define header templates): Rename, so that
output lines up correctly.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-26 11:13:08 -06:00
Eric Blake
0e9efd51ce More font-lock happiness.
* tests/autotest.at (AT_CHECK_AT_TITLE_CHAR): Clean up font
confusion.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-26 06:14:09 -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
Eric Blake
3659cc2756 Improve documentation of M4 parameter expansion.
* doc/autoconf.texi (Quoting and Parameters): New section.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-25 14:25:28 -06:00
Eric Blake
bc4dab1cee Avoid committing editor backup files.
Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-25 06:31:43 -06:00
Eric Blake
50306359a4 Improve C99 detection.
* lib/autoconf/c.m4 (_AC_PROG_CC_C99): Add support for HP cc, and
avoid deprecation warning with icc.
* THANKS: Update.
Reported by Ted Bullock.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-25 06:24:55 -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
Jim Meyering
dc1679c9d2 Add a comment.
* lib/autoconf/headers.m4 (HAVE_STDBOOL_H): Document the
2004-05-31 change also with a comment in the code.
2007-09-22 14:19:10 +02:00
Eric Blake
4abe9e321c More contribution housekeeping.
* THANKS: Sort.
* AUTHORS: Sort, reflect recent assignment from Helge Deller.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-20 09:51:48 -06:00
Eric Blake
2746ed2fc0 Ignore additional files, when copying cross-repository.
* .gitignore: Ignore CVS directories, emacs edits.
* .cvsignore: Ignore .git directory, emacs edits.
2007-09-20 09:06:28 -06: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
e970c53e89 Avoid parallel 'make check' issue.
* tests/.cvsignore (mktests.stamp): Ignore the witness.
2007-09-14 17:50:37 +00:00
Eric Blake
39f7ed183c Editing eye-candy.
* lib/autoconf/general.m4 (_AC_DO_ECHO): Likewise.
2007-09-13 23:39:07 +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
01b1013546 Clean up 'make dist' of previous patch.
* tests/Makefile.am (EXTRA_DIST): Distribute mktests.stamp.
(CLEANFILES): Don't clean the stamp, since we distribute the
generated files pre-built.
(MAINTAINERCLEANFILES): Clean it here instead.
* tests/Makefile.in: Regenerate.
2007-09-13 20:39:33 +00:00
Eric Blake
f58a63325c Avoid parallel 'make check' issue.
* tests/Makefile.am (mktests.stamp): New witness.
(TESTSUITE_GENERATED_AT): Use it.
(CLEANFILES): Clean the witness.
* tests/.cvsignore (mktests.stamp): Ignore the witness.
2007-09-13 19:59:18 +00:00
Eric Blake
097669a284 Document another awk pitfall.
* doc/autoconf.texi (Limitations of Usual Tools) <awk>: Document
limitation of field variables in END.
Reported by Gary V. Vaughan.
2007-09-13 16:50:38 +00:00
Eric Blake
26073149c1 * AUTHORS: Add missing entries. 2007-09-13 14:13:13 +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
Eric Blake
89b411a893 * doc/autoconf.texi (Generic Compiler Characteristics): Add
missing index entries.
2007-09-13 02:35:41 +00:00
Eric Blake
6add6e92a6 Centralize all system extensions checks.
* lib/autoconf/specific.m4 (AC_USE_SYSTEM_EXTENSIONS): Inline code
from AC_AIX, AC_GNU_SOURCE, AC_MINIX.  Add Interix support.
(AC_AIX, AC_GNU_SOURCE, AC_MINIX): Obsolete, and point to
AC_USE_SYSTEM_EXTENSIONS.
(AC_ISC_POSIX): Obsolete, and point to AC_SEARCH_LIBS.
(AC_XENIX_DIR, AC_IRIX_SUN): Promote proper quoting in AU_DEFUN.
* doc/autoconf.texi (Posix Variants): Reword this section,
emphasizing that AC_USE_SYSTEM_EXTENSIONS is the preferred method,
rather than a series of system-specific checks.
(Obsolete Macros): Add AC_AIX, AC_GNU_SOURCE, AC_ISC_POSIX,
AC_MINIX.
* NEWS: Document this change.
* THANKS: Update.
Reported by Martin Koeppe.
2007-09-11 17:13:13 +00:00
Eric Blake
1579d78cda Clean up obsolete macros references.
* doc/autoconf.texi: Add anchors to support better
cross-referencing.
(Particular Structures): Move obsolete macros descriptions...
(External Software): Likewise.
(Package Options): Likewise.
(Obsolete Macros): ...to here.  Add cross-references to
documentation on replacements.
* NEWS: Mention that these macros have been obsolete for a while
now: AC_STRUCT_ST_BLKSIZE AC_STRUCT_ST_RDEV AC_WITH AC_ENABLE.
2007-09-08 21:47:37 +00:00