Commit Graph

5672 Commits

Author SHA1 Message Date
Eric Blake
74bb1a450d Work around <=m4-1.4.9 bug in m4_format.
* lib/m4sugar/m4sugar.m4 (_m4_index): New internal macro.
(m4_init): Only use it in older m4.
* lib/autoconf/general.m4 (_AC_DEFINE_Q): Use it to avoid
m4_format bug in older m4.
* lib/autoconf/status.m4 (_AC_CONFIG_COMPUTE_DEST): Likewise.
Reported by Bob Proulx.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 21:04:46 -07:00
Eric Blake
5bf2204ddb Match upstream standards.texi.
* doc/standards.texi: Resync from upstream.
* doc/fdl-1.3.texi: Rename...
* doc/fdl.texi: ...to this.
* doc/Makefile.am (autoconf_TEXINFOS, standards_TEXINFOS): Update
users.
* doc/autoconf.texi (GNU Free Documentation License): Likewise.
* cfg.mk (fetch): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 19:38:05 -07:00
Eric Blake
463b59e84f Yet more FDL 1.3 fallout.
* NEWS: Mention manual license change.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 16:06:59 -07:00
Eric Blake
40f1a994e2 Avoid some regex uses.
* lib/autoconf/general.m4 (_AC_DEFINE_Q): Use m4_format rather
than m4_bpatsubst to grab string prefix.
* lib/autoconf/status.m4 (_AC_CONFIG_REGISTER)
(_AC_CONFIG_REGISTER_DEST, AC_CONFIG_SUBDIRS): Likewise.
(_AC_FILE_DEPENDENCY_TRACE_COLON): Use m4_translit instead of
m4_bpatsubst to change bytes.
(_AC_CONFIG_DEPENDENCY_DEFAULT): Use m4_index rather than
m4_bmatch to find byte.
(_AC_CONFIG_COMPUTE_DEST): New helper macro.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 11:38:41 -07:00
Eric Blake
3763dba27e Use more efficient macros in AC_CONFIG_SUBDIRS.
* lib/autoconf/status.m4 (_AC_CONFIG_FOOS, AC_CONFIG_SUBDIRS): Use
m4_map_args_w.
(_AC_OUTPUT_FILE): Use m4_map_args_sep and m4_map_args.
(_AC_OUTPUT_FILE_ADJUST_DIR): New helper macro.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 11:38:14 -07:00
Eric Blake
61055bdb3e Use more efficient macros in AC_CHECK_FILES and AC_CHECK_DECLS.
* lib/autoconf/general.m4 (AC_CHECK_FILES): Use m4_map_args_w,
and avoid typo.
(AC_CHECK_DECLS, AC_CHECK_DECLS_ONCE): Use m4_map_args_sep.
(_AC_CHECK_FILES, _AC_CHECK_DECLS, _AC_CHECK_DECL_ONCE): New
helper macros.
(AC_LIBSOURCES): Use m4_map_args.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 11:35:42 -07:00
Eric Blake
9187638237 Use more efficient macros in AC_CHECK_TYPES.
* lib/autoconf/types.m4 (AC_CHECK_TYPES, AC_CHECK_MEMBERS): Use
m4_map_args_sep.
(_AC_CHECK_TYPES, _AC_CHECK_MEMBERS): New helper macros.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 11:35:16 -07:00
Eric Blake
40dc2b77a4 Use more efficient macros in AC_CHECK_HEADERS.
* lib/autoconf/headers.m4 (AH_CHECK_HEADERS)
(AH_CHECK_HEADERS_DIRENT): Rename...
(_AH_CHECK_HEADER, _AH_CHECK_HEADER_DIRENT): ...and take only one
argument, rather than a list.
(AC_CHECK_HEADERS, AC_CHECK_HEADERS_ONCE):
Adjust callers to use m4_map_args_w.
(AC_HEADER_DIRENT): Adjust caller to use m4_map_args.
(_AC_CHECK_HEADER_ONCE): New helper macro.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 11:34:47 -07:00
Eric Blake
1334bb1195 Use more efficient macros in AC_CHECK_FUNCS.
* lib/autoconf/functions.m4 (_AH_CHECK_FUNCS): Rename...
(_AH_CHECK_FUNC): ...and take only one argument, rather than a
list.
(AC_CHECK_FUNCS, AC_CHECK_FUNCS_ONCE): Adjust callers to use
m4_map_args_w.
(_AC_CHECK_FUNC_ONCE): New helper macro.
(AC_REPLACE_FUNCS): Use m4_map_args_w.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 11:34:17 -07:00
Eric Blake
786427de58 Use more efficient macro in AT_INIT.
* lib/autotest/general.m4 (AT_INIT): Use m4_map_args.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 11:33:19 -07:00
Eric Blake
4fcbad6e13 More FDL 1.3 fallout.
* cfg.mk (fetch): Add gnu-oids.texi, drop fdl.texi.
* doc/Makefile.am (standards_TEXINFOS): Reflect upstream
dependency changes.
* doc/fdl.texi: Delete.
* doc/gnu-oids.texi: New upstream file.
* doc/standards.texi: Resync from upstream.
* doc/make-stds.texi: Likewise.
* build-aux/announce-gen: Likewise.
* build-aux/texinfo.tex: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 11:09:54 -07:00
Clinton Roy
44fbeef86d Pass autoreconf -I to aclocal -I
* bin/autoreconf.in (parse_args): Pass --include to aclocal.
* doc/autoconf.texi (autoreconf Invocation): Updates for above.
* NEWS: Document it.
* THANKS: Update.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 10:34:59 -07:00
Eric Blake
3b78b1ae08 Try 'print -r --' as a non-forking variant of 'printf %s\\n'.
* lib/m4sugar/m4sh.m4 (_AS_ECHO_PREPARE): Cater to Solaris ksh.
* doc/autoconf.texi (Limitations of Builtins) <printf>: Document
the print workaround.
Idea by Paolo Bonzini.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 09:06:39 -07:00
Eric Blake
3063ce9fd4 Provide a section on all tools allowed in GNU Coding Standards.
* doc/autoconf.texi (Limitations of Builtins) <read>: Sort.
<wait>: Add section.
(Limitations of Usual Tools) <awk>: Make table entry consistent.
<chgrp, mkfifo, rmdir, sleep, sort, tar> Add sections.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-10 07:20:57 -07:00
Paolo Bonzini
5544cc87ec Balance parentheses in _AC_CACHE_DUMP.
* lib/autoconf/general.m4 (_AC_CACHE_DUMP): Balance parentheses
without introducing \).
2008-11-09 14:46:12 +01:00
Eric Blake
0d8db08710 Further doc updates for AC_CHECK_HEADER change.
* doc/autoconf.texi (Generic Headers) <AC_CHECK_HEADER>: Mention
new default, and make it more obvious that using [-] is generally
broken.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-07 09:33:51 -07:00
Eric Blake
bd3cd44650 Use UTF-8 in ChangeLog.
* ChangeLog: Enforce UTF-8 encoding.
The file was converted from Latin-1 by commit b83aa7.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-07 08:57:34 -07:00
Eric Blake
7a4705cb7a Skip preprocessor check in AC_CHECK_HEADERS_ONCE.
* lib/autoconf/headers.m4 (_AC_HEADERS_EXPANSION): Provide fourth
argument to speed up check.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-06 16:43:24 -07:00
Eric Blake
3d6b5007ca Speed up AC_CHECK_TYPE.
* lib/autoconf/types.m4 (AC_CHECK_TYPE): Factor out $@, and avoid
regex when enough arguments are present.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-06 16:29:53 -07:00
Paolo Bonzini
359be416a7 Remove three forks per _AC_RUN_LOG_STDERR in the common case.
* lib/autoconf/general.m4 (_AC_RUN_LOG_STDERR): Avoid grep/rm/cat
sequence when the program's stderr was empty, while providing a
conftest.err file even in that case.
(_AC_CACHE_DUMP): Fix mismatched parenthesis.
2008-11-06 15:23:59 +01:00
Paolo Bonzini
c22cc67be7 Change `present but cannot be compiled' behavior to use compiler result.
* NEWS: Document it.
* doc/autoconf.texi (Present But Cannot Be Compiled): Document it.
* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL): Implement it
and adjust warning.
* tests/semantics.at (AC_CHECK_HEADERS): Test new semantics.
2008-11-06 10:55:31 +01:00
Eric Blake
b07a2b3d74 Add m4_map_args_w.
* lib/m4sugar/m4sugar.m4 (m4_map_args_w): New macro, undocumented
for now.
(_m4_split): Allow user control over separator.
(m4_split): Adjust caller.
(m4_foreach_w, m4_append_uniq_w, _m4_text_wrap): Rewrite to use
m4_map_args_w.
* tests/m4sugar.at (m4@&t@_append): Augment test keywords.
(M4 loops): Test new interface.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-05 20:04:49 -07:00
Eric Blake
4e009d5228 Use m4_set_map_sep in more places.
* lib/m4sugar/m4sugar.m4 (m4_set_difference, m4_set_intersection)
(m4_set_union): Use m4_set_map_sep rather than m4_set_foreach.
* doc/autoconf.texi (Set manipulation Macros) <m4_set_map>:
Enhance documentation.
<m4_set_foreach>: Mention faster alternative.
(Looping constructs) <m4_foreach>: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-05 13:31:46 -07:00
Eric Blake
a8c4be749a Unify m4_set_foreach and m4_set_map.
* lib/m4sugar/m4sugar.m4 (m4_set_map_sep): New macro, undocumented
for now.
(m4_set_contents, m4_set_foreach, m4_set_list, m4_set_listc)
(m4_set_map): Adjust callers.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-05 13:27:39 -07:00
Eric Blake
641487fb34 Use _m4_foreach in more places.
* lib/m4sugar/foreach.m4 (m4_dquote_elt, m4_join, m4_joinall)
(_m4_minmax, m4_set_add_all): Use _m4_foreach instead of
m4_foreach.
* lib/m4sugar/m4sugar.m4 (_m4_joinall): Use m4_map_args_sep
instead of m4_foreach or m4_map_args.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-05 13:27:30 -07:00
Eric Blake
aae086a2f7 Unify _m4_foreach and _m4_map.
* lib/m4sugar/m4sugar.m4 (_m4_map): Delete, merged with...
(_m4_foreach): ...this.
(m4_foreach, m4_map, m4_mapall, m4_map_sep, _m4_mapall_sep)
(m4_map_args, m4_map_args_sep): Adjust callers.
* lib/m4sugar/foreach.m4 (_m4_map): Rename...
(_m4_foreach): ...to this, overwriting old definition.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-05 10:32:47 -07:00
Eric Blake
1329287eb7 Add m4_map_args_sep, undocumented for now.
* lib/m4sugar/m4sugar.m4 (m4_map_args_sep): New macro.
(_m4_map): Change API to cover more of m4_map*.
* lib/m4sugar/foreach.m4 (_m4_map): Adjust to new API.
(m4_map_args): Delete.
* tests/m4sugar.at (m4@&t@_map_args and m4@&t@_curry): Enhance
test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-04 21:23:51 -07:00
Eric Blake
9a79ba954d Improve m4_for performance.
* lib/m4sugar/m4sugar.m4 (_m4_for): Alter API to make it easier to
avoid m4_define by some clients.
(m4_for): Adjust caller.
* lib/m4sugar/foreach.m4 (_m4_foreach, m4_case, m4_bmatch)
(_m4_cond, _m4_bpatsubsts, _m4_shiftn, m4_do, m4_reverse)
(_m4_map, m4_map_args, m4_map_args_pair, _m4_list_pad)
(_m4_list_cmp): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-04 21:23:47 -07:00
Eric Blake
ee0d4bd36b Adjust expected output.
* tests/torture.at (Missing templates): Reflect added quoting.
Detected by Bob Proulx's buildbot.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-04 21:22:16 -07:00
Eric Blake
62c045085d Reject arguments with leading =; test previous patch.
* tests/base.at (configure arguments): Test this.
Reported by Jeff Squyres.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-04 19:13:38 -07:00
Eric Blake
bc6676ed11 Reject arguments with leading =.
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Detect case of
missing variable name, with fewer forks.  Quote invalid arguments
in message, in case they include spaces.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS)
(_AC_OUTPUT_MAIN_LOOP): Quote invalid arguments.
* lib/autotest/general.m4 (AT_INIT): Likewise.
Reported by Jeff Squyres.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-04 08:20:00 -07:00
Eric Blake
a30e6f3f77 Upgrade to FDL 1.3.
* cfg.mk (fetch): Add fdl-1.3.texi.
* .gitattributes: Likewise.
* doc/autoconf.texi (GNU Free Documentation License): Point to new
upstream version.
* doc/Makefile.am (autoconf_TEXINFOS): Likewise.
(standards_TEXINFOS): Mention current dependence on older license.
* doc/fdl-1.3.texi: New upstream file.
* GNUmakefile: Resync from upstream.
* build-aux/announce-gen: Likewise.
* build-aux/texinfo.tex: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-04 06:36:20 -07:00
Ralf Wildenhues
d5445543c5 Point at AM_SUBST_NOTMAKE.
* doc/autoconf.texi (Setting Output Variables): Add cross
reference to new Automake macro AM_SUBST_NOTMAKE.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-11-03 22:52:43 +01:00
Paolo Bonzini
8e27cc7f52 Dispatch on AC_LANG_CONFTEST
* lib/autoconf/c.m4 (AC_LANG_CONFTEST(C)): Define instead of
AC_LANG_SOURCE(C).
* lib/autoconf/general.m4 (_AC_INIT_PREPARE): Add a comment at the
top of confdefs.h, which also works around cpp deficiencies.
* lib/autoconf/lang.m4 (AC_LANG_DEFINE): Define AC_LANG_CONFTEST(xyz)
(AC_LANG_CONFTEST): Dispatch based on _AC_LANG.
(AC_LANG_CONFTEST()): New.
2008-11-03 14:23:55 +01:00
Paolo Bonzini
cf5862afae Reorganize definition of languages
* lib/autoconf/c.m4 (AC_LANG(C), AC_LANG(C++), AC_LANG(Objective C),
_AC_LANG_ABBREV(C), _AC_LANG_ABBREV(C++), _AC_LANG_ABBREV(Objective C),
_AC_LANG_PREFIX(C), _AC_LANG_PREFIX(C++), _AC_LANG_PREFIX(Objective C)):
Replace definitions with usage of AC_LANG_DEFINE.
(Sections 2b, 2c): Delete.
(Sections 1b, 1c): Move after section 2a.
* lib/autoconf/erlang.m4 (AC_LANG(Erlang), _AC_LANG_ABBREV(Erlang),
_AC_LANG_PREFIX(Erlang), AC_LANG_SOURCE(Erlang)): Replace definitions
with usage of AC_LANG_DEFINE.
(AC_LANG_ERLANG): Define using AU_DEFUN.
* lib/autoconf/fortran.m4 (AC_LANG(Fortran), AC_LANG(Fortran 77),
_AC_LANG_ABBREV(Fortran), _AC_LANG_ABBREV(Fortran 77),
_AC_LANG_PREFIX(Fortran), _AC_LANG_PREFIX(Fortran 77),
_AC_LANG_SOURCE(Fortran), AC_LANG_SOURCE(Fortran 77)): Replace
definitions with usage of AC_LANG_DEFINE.
* lib/autoconf/lang.m4 (AC_LANG_DEFINE, AC_LANG_SOURCE()): New.
2008-11-03 14:23:55 +01:00
Paolo Bonzini
393513d18e Commit ChangeLog entry 2008-11-03 10:43:35 +01:00
Paolo Bonzini
d6777ebf7e Use preprocessor in cpp tests.
* tests/c.at (CPP tests): Use AC_CHECK_HEADERS(..., [-]).
2008-11-03 10:32:34 +01:00
Paolo Bonzini
c0e8d2d8ba Rename _AC_CHECK_HEADER_OLD and _AC_CHECK_HEADER_NEW.
* lib/autoconf/headers.m4 (AC_CHECK_HEADER): Adjust naming.
(_AC_CHECK_HEADER_PREPROC_BODY): New name of _AC_CHECK_HEADER_OLD_BODY.
(_AC_CHECK_HEADER_COMPILE_BODY): New name of _AC_CHECK_HEADER_NEW_BODY.
(_AC_CHECK_HEADER_PREPROC): New name of _AC_CHECK_HEADER_OLD.
(_AC_CHECK_HEADER_COMPILE): New name of _AC_CHECK_HEADER_NEW.
* tests/semantics.at (AC_CHECK_HEADERS_OLD, AC_CHECK_HEADER_NEW):
Give better name.
2008-10-31 17:48:03 +01:00
Eric Blake
9279a87aba Support multiple undiverts and dumpdefs at once.
* lib/m4sugar/m4sugar.m4 (m4_dumpdefs, m4_undivert): Allow extra
arguments.
* doc/autoconf.texi (Redefined M4 Macros) <m4_dumpdef>,
<m4_undivert>: Document argument list change.
* tests/m4sugar.at (m4@&t@_divert_stack, m4@&t@_dumpdef): Test
them.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-31 10:30:31 -06:00
Eric Blake
9f4363abb6 Simplify diversion stack handling.
* lib/m4sugar/m4sugar.m4 (m4_divert_stack): Use fewer macros, and
avoid extra newlines.
(m4_divert_stack_push): Compute location here, rather than caller.
(m4_divert_push): Update caller.
(m4_divert): Likewise, and also adjust current diversion name.
(m4_divert_pop): Simplify rule that diversion stack must never go
empty.
(_m4_require_call): Bypass diversion stack when collecting
required macro text.
(m4_init): Set current diversion without requiring m4_init.
* lib/m4sugar/m4sh.m4 (AS_INIT): Avoid too many pops.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/autoconf/general.m4 (_AC_INIT_DEFAULTS): Schedule wrapped
text to run prior to m4sugar cleanup.
* doc/autoconf.texi (Text processing Macros) <m4_newline>: Mention
optional argument.
(Conditional constructs) <m4_ifvaln, m4_n>: Mention use of dnl.
* NEWS: Undo blurb about m4_divert.
* tests/m4sugar.at (m4@&t@_divert_stack): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-31 10:25:24 -06:00
Eric Blake
852082f119 Simplify expansion stack handling.
* lib/m4sugar/m4sugar.m4 (m4_expansion_stack): Use fewer macros;
always output 'top level'.
(_m4_expansion_stack_entry): New macro, to format the string only
when needed.
(m4_expansion_stack_push): Only push a macro name.
(m4_warn, _m4_defun_pro): Update callers.
(m4_expansion_stack_pop, m4_expansion_stack_dump): Delete.
(_m4_defun_epi, m4_fatal): Inline the calls.
* tests/m4sugar.at (m4@&t@_expansion_stack): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-31 09:59:56 -06:00
Eric Blake
cd9fbb8453 Better documentation of AC_CHECK_HEADER's fourth argument.
* doc/autoconf.texi (Generic Headers) <AC_CHECK_HEADER>: Mention
how to suppress compiler or preprocessor header check.
Reported by Jeff Squyres.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-30 22:05:55 -06:00
Eric Blake
a4ca1ca266 Fix LINENO testsuite failure.
* tests/m4sh.at (AT_DATA_LINENO): Use AS_LINENO_PREPARE, not
undocumented _AS_PREPARE, and move unset earlier in script.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-30 18:50:39 -06:00
Eric Blake
10d26aa4a8 Update LINENO documentation.
* doc/autoconf.texi (Initialization Macros) <AS_INIT_GENERATED>:
(Special Shell Variables) <LINENO>: Mention that LINENO support in
child scripts may be broken.  Modernize example.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-30 11:18:09 -06:00
Paolo Bonzini
718151138d Do not check for $LINENO in generated scripts.
* lib/m4sugar/m4sh.m4 (_AS_PREPARE): Do not call _AS_LINENO_PREPARE,
and explain why.
2008-10-30 16:57:45 +01:00
Eric Blake
4f4ffdc6a6 Don't check for non-POSIX extensions in suggested tests.
* lib/m4sugar/m4sh.m4 (_AS_VAR_APPEND_WORKS): Remove suggestion;
we still use += if available, but should not reject shells (like
dash) that don't provide it.
(_AS_DETECT_SUGGESTED): Document a policy for m4sh.
Reported by Paolo Bonzini.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-30 09:50:46 -06:00
Paolo Bonzini
26e664439c Pass CONFIG_SHELL down to generated scripts, and re-export SHELL.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): If proceeding
with a given CONFIG_SHELL, move it to SHELL.
(AS_INIT_GENERATED): Re-export SHELL.
2008-10-30 15:27:42 +01:00
Eric Blake
a78b497413 Work around Solaris /bin/sh case bug.
* lib/m4sugar/m4sh.m4 (_AS_CASE, _AS_CASE_DEFAULT): Always provide
a non-empty command list.
(AS_CASE): Always guarantee that a case will match.
* doc/autoconf.texi (Limitations of Builtins) <case>: Document the
Solaris bug, and mention AS_CASE.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-10-30 07:40:59 -06:00
Paolo Bonzini
c55740c463 Require _AS_CR_PREPARE where appropriate and fix ChangeLog.
* lib/m4sugar/m4sh.m4 (_AS_PREPARE): Call _AS_CR_PREPARE.
(AS_PREPARE): Require _AS_CR_PREPARE.
2008-10-30 14:00:02 +01:00
Paolo Bonzini
4298bf09e4 trim down the length of the shell function test
* lib/m4sugar/m4sh.m4 (_AS_SHELL_FN_WORK): Condense.
2008-10-30 10:23:40 +01:00