* doc/autoconf.texi (Writing configure.in): Explain what Autoconf
is. Explain how to use the quotation scheme used in Autoconf.
(Quoting): Update. Do not advocate changequote.
Fix F77 name-mangling macros to work with cached values (so
they don't break the second time you run configure).
* aclang.m4 (AC_F77_NAME_MANGLING): Extract f77_case,
f77_underscore from cache variable.
(AC_F77_WRAPPERS): Get rid of ac_cv_f77_wrappers, it's useless.
Simplify the nested case-esac into a single one.
Simplify the documentation strings of CPP symbols.
Akim Demaille [Wed, 29 Mar 2000 16:48:00 +0000 (16:48 +0000)]
Rewrite the autoheader chain on top of `autoconf --trace'.
* autoheader.m4: Dispatch the prototypes next to there AC_
siblings.
(AH_TEMPLATE, AH_VERBATIM): Move to...
* acgeneral.m4: here.
(AH_OUTPUT): New macro.
* autoheader.sh: Run `autoconf --trace' instead of `m4 autoheader.m4'.
* autoheader.m4: Remove.
* Makefile.am: Adjust.
* tests/tools.m4 (AH_DEFUN): Remove, no longer makes sense.
* tests/actests.m4 (autoheader::AC_TATOOINE): Remove, was used by
the test above.
Akim Demaille [Wed, 29 Mar 2000 11:09:59 +0000 (11:09 +0000)]
Use `mktemp -d' when possible to create securely a tmp work dir.
* autoconf.sh: Use it when possible to create the dir $tmp.
Stop using variables for tmp files, use their names in $tmp.
[install]: Use the new features of autoconf --trace.
Akim Demaille [Tue, 28 Mar 2000 14:48:56 +0000 (14:48 +0000)]
Probably all the versions of bash up to 2.04 fail on
fnmatch ("/tmp", "[/\\]")
The backslash must not be last.
* acgeneral.m4 (_AC_INIT_HELP, AC_PATH_PROG, _AC_OUTPUT_FILES,
_AC_OUTPUT_LINKS, _AC_OUTPUT_SUBDIRS): Always make `\' be the
first character in all the `[]' of `case' patterns.
Akim Demaille [Sat, 25 Mar 2000 09:24:16 +0000 (09:24 +0000)]
* acgeneral.m4 (_AC_CANONICAL_TARGET, _AC_CANONICAL_BUILD): Rename
as (AC_CANONICAL_TARGET, AC_CANONICAL_BUILD), although internal,
too much foreign code depends upon them.
Akim Demaille [Sat, 25 Mar 2000 09:17:40 +0000 (09:17 +0000)]
* autoconf.sh (translate_awk): `> "/dev/stderr"' is not portable
to systems without a real /dev/stderr in the file system or if not
using one of the three free awks. Use
print message | "cat >&2"
...
END { close("cat >&2") }
From Aharon Robbins.
Akim Demaille [Sat, 25 Mar 2000 09:16:53 +0000 (09:16 +0000)]
* autoheader.sh (checking completeness): Be ready to recognize
patterns with a value, and spaces between `#' and the directive, e.g.
# define FOO FIXME:
Reported by John Fortin.
Akim Demaille [Sat, 25 Mar 2000 09:05:22 +0000 (09:05 +0000)]
* acgeneral.m4 (AC_LANG_CALL, AC_LANG_CALL(C), AC_LANG_CALL(C++),
AC_LANG_CALL(FORTRAN77)): New macros.
(AC_TRY_LINK_FUNC): Use it.
(AC_TRY_CPP): Argument was output twice.
(AC_COMPILE_IFELSE, AC_LINK_IFELSE): Output $3 only if needed.
Akim Demaille [Sat, 25 Mar 2000 09:04:13 +0000 (09:04 +0000)]
* acgeneral.m4 (AC_TRY_COMPILER): Use AC_LINK_IFELSE.
(AC_TRY_LINK_FUNC, AC_CHECK_LIB, AC_CHECK_FUNC): Don't check that
the current language is C++ to output `extern "C"': the CPP
condition is enough.
Akim Demaille [Tue, 21 Mar 2000 12:41:22 +0000 (12:41 +0000)]
Provide a language independent means to generate language specific
programs.
* acgeneral.m4 (_AC_LANG_DISPATCH): New macro.
(AC_LANG): Use it.
(AC_LANG_SOURCE, AC_LANG_SOURCE(C), AC_LANG_SOURCE(C++),
AC_LANG_SOURCE(FORTRAN77)): New macros.
(AC_TRY_COMPILER, AC_EGREP_CPP, AC_TRY_RUN_NATIVE): Use
AC_LANG_SOURCE.
Akim Demaille [Tue, 21 Mar 2000 12:33:37 +0000 (12:33 +0000)]
Fix a bug: some macros (e.g., AC_REVISION, AC_COPYRIGHT etc.) can
be used before AC_INIT, but they do require it. But then, the
argument of the explicit AC_INIT call is lost.
* acgeneral.m4 (AC_CONFIG_SRCDIR): New macro.
(_AC_INIT_SRCDIR): Adjust.
(_AC_INIT): Pass your argument to AC_CONFIG_SRCDIR.
Akim Demaille [Tue, 21 Mar 2000 12:09:31 +0000 (12:09 +0000)]
Speed ups.
* libm4.m4 (m4_append, m4_list_append): Use m4_define, not define.
On my machine the former implementation takes 4mn 40s to run the
test suite. Using m4_define leads to 4mn 15s.
* acgeneral.m4 (_AC_SUBST): Use AC_EXPAND_ONCE (which uses
m4_define, not define). 4mn.
(_AC_DIVERT): Don't use m4_case. Starting from those 4mn, if you
just move NORMAL* first in m4_case, the test suite is run in 3mn.
If instead of using m4, you use an `associative array' plus a
wrapper (current implementation), it falls to 2mn.
Akim Demaille [Tue, 21 Mar 2000 12:06:30 +0000 (12:06 +0000)]
* autoconf.sh (task trace): Pipe the output of the first m4 into
the second one, instead of saving to a tmp file, so that we can
trace endless configure.in expansion.
Akim Demaille [Tue, 21 Mar 2000 12:03:55 +0000 (12:03 +0000)]
Uniform idioms.
* acgeneral.m4 (_AC_OUTPUT_FILES, _AC_OUTPUT_HEADERS,
_AC_OUTPUT_LINKS, _AC_OUTPUT_COMMANDS): Prefer
for i in : $is; do test $i = : && continue
over
for i in .. $is; do if test $i != ..; then
Akim Demaille [Tue, 21 Mar 2000 10:01:40 +0000 (10:01 +0000)]
Give a means to compute `srcdir' earlier in configure.
* acgeneral.m4 (_AC_INIT_SRCDIR): New macro, pulled out from...
(_AC_INIT_PREPARE): No longer compute `srcdir'.
(_AC_INIT): Use _AC_INIT_SRCDIR.
(AC_INIT): Don't forget to pass the argument to _AC_INIT.
Akim Demaille [Tue, 21 Mar 2000 09:07:15 +0000 (09:07 +0000)]
Give an identity to `configure' scripts.
* acgeneral.m4 (AC_PACKAGE): New macro.
(_AC_COPYRIGHT_SEPARATOR): Remove.
(AC_COPYRIGHT): Adjust.
(_AC_INIT_HELP, _AC_INIT_VERSION): Name the package you configure
when you want.
(_AC_INIT): Adjust.
* configure.in (AC_PACKAGE): Add.
Jim Meyering [Mon, 20 Mar 2000 11:16:40 +0000 (11:16 +0000)]
(AC_SYS_LONG_FILE_NAMES): Don't test for existence
of $ac_xdir. Not only is `test -e' not portable, but the test isn't
necessary at all; the following mkdir ends up accomplishing the
same goal. Suggestion from Alexandre Oliva.
Akim Demaille [Mon, 20 Mar 2000 10:30:54 +0000 (10:30 +0000)]
Don't rely on RS = "0" to swallow the whole input as a single
record, this is not portable: mawk and nawk understand it as RS =
"". gawk understands it as expected.
* autoconf.sh (translate_awk::BEGIN): No longer change RS.
(translate_awk::body): Move to the END.
Instead, accumulate the input in `request'.
Akim Demaille [Mon, 20 Mar 2000 10:10:06 +0000 (10:10 +0000)]
* doc/autoconf.texi (Testing Values and Files): Be a subsection of
`Portable Shell Programming'.
(Shell Substitutions, Limitations of Usual Tools): New subsections.
Akim Demaille [Fri, 17 Mar 2000 10:07:56 +0000 (10:07 +0000)]
In Autoconf 2.13, although AC_OUTPUT_COMMANDS did double quote its
arguments, AC_OUTPUT arguments 2 and 3 were not! Currently,
AC_OUTPUT over quotes too: stop that.
Reported by Martin Buchholz.
* doc/autoconf.texi (Output): Don't expand on the ternary
AC_OUTPUT.
* acgeneral.m4 (AC_OUTPUT): Don't over quote $2 and $3.
Akim Demaille [Fri, 17 Mar 2000 08:37:50 +0000 (08:37 +0000)]
Install the IFS we need once for all.
* acgeneral.m4 (_AC_INIT_PREPARE_ENVIRONMENT): New macro.
Handle the NLS envvars, and IFS.
(_AC_INIT_PREPARE): Use it, no longer set the NLS envvars.
(_AC_WHICH_A, AC_PATH_PROG): Rely on the default IFS.
* acspecific.m4 (AC_PROG_INSTALL, AC_FUNC_SELECT_ARGTYPES):
Likewise.
Akim Demaille [Fri, 17 Mar 2000 08:31:49 +0000 (08:31 +0000)]
* acgeneral.m4 (AC_TRY_CPP, AC_EGREP_CPP, AC_TRY_COMPILE,
AC_TRY_LINK, AC_TRY_RUN_NATIVE): Simplify the removal of the
contest files: don't remove them before running the actions, just
remove them at the end of the macro.
Akim Demaille [Thu, 16 Mar 2000 18:12:58 +0000 (18:12 +0000)]
* acspecific.m4 (AC_FUNC_SELECT_ARGTYPES): Use
: ${foo='some words'}
not
: ${foo=some words}
since this is not portable: Digital Unix v5.0: `bad substitution'.
From Nicolas Joly.
Akim Demaille [Thu, 16 Mar 2000 15:17:26 +0000 (15:17 +0000)]
* libm4.m4 (m4_assert, m4_shiftn): New macros.
(m4_case,m4_match): Rewrite to use m4_shiftn (for readability reasons).
(m4_for): Add the STEP argument and some argument-verifying asserts.
(m4_split): Correct spaces to tabulator in regexp.
Akim Demaille [Wed, 15 Mar 2000 09:55:21 +0000 (09:55 +0000)]
Revamp AC_FUNC_SELECT_ARGTYPES.
* acspecific.m4 (AC_FUNC_SELECT_ARGTYPES): Use a single cache
variable instead of three.
Use AC_CACHE_CHECK.
Shorten the name of the var loops, they are no longer cached.
Include sys/types.h unconditionally.
`select' returns an int, fixes Autoconf/46.
Don't display parens in the user messages.
Akim Demaille [Tue, 14 Mar 2000 08:37:27 +0000 (08:37 +0000)]
* acgeneral.m4 (_AC_INIT_PREPARE): Insert the Autoconf version in
config.log, and the command line which ran configure.
Kill a couple of useless quote around dollars.
Akim Demaille [Tue, 14 Mar 2000 08:32:35 +0000 (08:32 +0000)]
* acgeneral.m4 (_AC_INIT_BINSH): Remove, useless now that...
(AC_REVISION): Require AC_INIT, not _AC_INIT_BINSH.
(AC_INIT): Do what _AC_INIT_BINSH used to.
Don't require _AC_INIT_VERSION, just call it.
Rename as _AC_INIT.
(AC_INIT): New macro, single expansion wrapper around _AC_INIT.
(_AC_COPYRIGHT_SEPARATOR): New.
(AC_COPYRIGHT): Use it.
Require AC_INIT, not _AC_INIT_VERSION.
* doc/autoconf.texi (Versions): Promote as first section of
`Setup'.
Rename as `Notices'.
Document AC_COPYRIGHT.
Don't give false reasons for placing AC_REVISION before AC_INIT,
the place no longer matters.
Akim Demaille [Tue, 14 Mar 2000 08:27:19 +0000 (08:27 +0000)]
* acgeneral.m4 (_AC_OUTPUT_CONFIG_STATUS): When there were no
CONFIG_FILES, we had to expand _AC_OUTPUT_FILES into the KILL
diversion, because it is AC_OUTPUT_FILES which undiverted the
AC_SUBST sed script at its proper place, otherwise it would have
been undiverted at the end of `configure', leading to an sh syntax
error.
Now that we no longer use a diversion, we don't need to call
AC_OUTPUT_FILES if useless.
(AC_OUTPUT_FILES): Rename as _AC_OUTPUT_FILES.
(AC_OUTPUT_LINKS): Rename as _AC_OUTPUT_LINKS.
Akim Demaille [Tue, 14 Mar 2000 08:20:25 +0000 (08:20 +0000)]
AC_ARG_PROGRAM must not be expanded twice, which is likely since
Automake calls it, and usually users do too. If it happens,
`--program-prefix=g' actually prepend two (or more) `g'.
* acgeneral.m4 (AC_DEFUN_ONCE): New macro.
(AC_ARG_PROGRAM): AC_DEFUNed_ONCE. Or is it AC_DEFUN_ONCE'd? :).
No longer AC_EXPAND_ONCE the help string, the macro itself is
expanded at most once.
Rename the here-doc tag EOF_SED as EOF.
Akim Demaille [Tue, 14 Mar 2000 08:09:32 +0000 (08:09 +0000)]
Introduce AC_SUBST(VAR, VAL).
* acgeneral.m4 (_AC_INIT_PARSE_ARGS): Stop global double quoting,
failed experiment.
Merge all the var=val AC_SUBST(var) into AC_SUBST(var, val).
(AC_SUBST): Implement support for 2nd arg.
* doc/autoconf.texi (Setting Output Variables): Adjust.
Akim Demaille [Mon, 13 Mar 2000 17:52:26 +0000 (17:52 +0000)]
Simplify the diversions naming system.
Suggested by Alexandre Oliva and Lars J. Aas
* libm4.m4 (ifndef): New macro.
* acgeneral.m4 (AC_DIVERT): New macro, maps a diversion name to
its value. The diversions now have a short name, e.g., `NOTICE',
instead of the former macros which had long names, e.g.,
`AC_DIVERSION_NOTICE'.
(AC_DIVERT_PUSH): Adjust.
(AC_DIVERT_POP): Use ifndef.
(AC_DIVERSION_CURRENT): Rename as `AC_DIVERT_DIVERSION' to stay
within the `AC_DIVERT' name domain.
Adjust all callers.
* acspecific.m4: Adjust all callers.
Akim Demaille [Mon, 13 Mar 2000 17:30:32 +0000 (17:30 +0000)]
* autoconf.sh (tmpbase): New var. Adjust trap code and other tmp
file names.
(translate_awk::BEGIN): Set RS to "0" so that the whole file be a
single record.
(translate_awk::trans): Convert from array to function.
(translate_awk::error): New function.
(translate_awk::main action): Implement support for ${sep}@ and
${sep}*. Use trans() and error().
(translate_awk): Don't put space before user functions call, it is
not portable.
Remove trailing `;', this is not C :).
(task trace): Quote `$traces' when you eval it, to protect the
white spaces.
Propagate `translate_awk' failures to `autoconf.sh'.
Translate the quadrigraphs.
Akim Demaille [Mon, 13 Mar 2000 17:26:21 +0000 (17:26 +0000)]
More uniform style is scripts.
* autoheader.sh: s/-eq/=/.
Uniform ordering of variable initializations, option handling.
Don't use quotes where useless (foo=$1, not foo="$1").
Propagate `run_m4' and `run_m4f'.
Use `$0' in --help.
* autoconf.sh: Likewise.
* autoreconf.sh: Likewise.
* autoupdate.sh: Likewise.
* ifnames.sh: Likewise.
* autoupdate.m4: Small bug: at the end `dnl' is disabled, so use
`m4_dnl'.
Akim Demaille [Mon, 13 Mar 2000 15:28:55 +0000 (15:28 +0000)]
`autoconf --trace': faster.
* autoconf.sh (initialization): New var, new option.
(option loop): When you need an arg, make sure there is one.
(run_m4f): New var, which content is that of the former...
(run_m4): Don't use m4 frozen state files.
Change all callers.
Don't pass AC_LOCALDIR, not documented, and unused.
(task trace): Honor `--verbose' and `--initialization'.
(globally): Send `--verbose' messages in stderr.
Fix random typos.
Akim Demaille [Mon, 13 Mar 2000 15:18:20 +0000 (15:18 +0000)]
Start revamping `autoconf --trace'.
* autoconf.sh (debug): New var, new option.
Adjust the trap code.
(task trace): Instead of decoding `m4 --trace' with sed, decode it
with m4 itself.
($silent_m4): New file, which disables m4's `errprint'.
($trace_m4): New file. Logistic for the m4 which is in charge of
decoding the traces of the first.
($translate_awk): Transform a user trace request into $trace_m4
code.
Akim Demaille [Fri, 10 Mar 2000 15:22:13 +0000 (15:22 +0000)]
Multiple `-e' to egrep are not portable. On IRIX 6.5 and Solaris
2.5.1 only the last one is honored:
> echo "foonbar" | egrep -e 'foo' -e 'bar'
bar
> echo "foonbar" | egrep -e 'bar' -e 'foo'
foo
Reported by Nicolas Joly.
An alternative would have to use `sed', unfortunately alternation
is not portable.
* tests/actest.m4 (join): New macro.
(AC_ENV_SAVE): Join the egrep patterns into a single big one.
* tests/Makefile.am (EGREP_EXCLUDE): Rename as FILTER_MACROS.
Join the egrep patterns into a single big one.
Jim Meyering [Fri, 10 Mar 2000 11:32:08 +0000 (11:32 +0000)]
(_AC_CHECK_TOOL_PREFIX): Correct typos in definition:
add `_' prefix to make the function name match comments and existing
uses. Remove leading prefix from _AC_CANONICAL_HOST.
Akim Demaille [Thu, 9 Mar 2000 15:44:40 +0000 (15:44 +0000)]
* acspecific.m4 (AC_SYS_RESTARTABLE_SYSCALLS): Added some missing
headers if they exist (needed for some missing prototypes) and
corrects the signal handler prototype/definition. The signal
handler prototype is now prepended with an `extern "C"' for C++
compilers since some platforms explicitly require an `extern "C"'
signal handler.
Akim Demaille [Wed, 8 Mar 2000 18:38:53 +0000 (18:38 +0000)]
* autoheader.m4 (autoheader::AC_CHECK_HEADERS_DIRENT): Renamed as
(autoheader::_AC_CHECK_HEADERS_DIRENT): to cope with the new name
of the autoconf:: macro.
Fixes autoconf/119, reported by Raja R Harinath.
Akim Demaille [Wed, 8 Mar 2000 16:13:32 +0000 (16:13 +0000)]
The argument of AC_COPYRIGHT should be plain text, not an sh
comment.
* libm4.m4 (m4_quote): s/$@/$*/.
* acgeneral.m4 (AC_COPYRIGHT): Prepend `# ' to the lines that goes
on the top of `configure'. Actually, prepend `@%:@ ' so that
there are as many evaluations on both sides.
(_AC_INIT_VERSION): No longer strip `# '.
Akim Demaille [Wed, 8 Mar 2000 16:12:09 +0000 (16:12 +0000)]
* tests/Makefile.am (all-local): Remove. It wastes time to have
testsuite rebuilt each time an ac*.m4 file changes. It is enough
to build it for each `make check'.
Akim Demaille [Wed, 8 Mar 2000 13:22:42 +0000 (13:22 +0000)]
Provide a means to specify more Copyright information in
`configure'. And after all, it suits to `configure --version' too.
* acgeneral.m4 (AC_DIVERSION_DEFAULTS, AC_DIVERSION_INIT_PREPARE):
New diversion numbers.
(AC_DIVERSION_INIT): Renamed as...
(AC_DIVERSION_INIT_PARSE_ARGS): this.
(AC_DIVERT_POP): Instead of going into wild endless loops when
there are more pops than pushes, die with dignity.
(AC_COPYRIGHT): New macro.
(_AC_INIT_NOTICE): Move definition of `ac_includes_default' from
here...
(_AC_INIT_PREPARE): to here.
(_AC_INIT_NOTICE): Remove.
(AC_INIT): Use it to install Autoconf's Copyright.
(_AC_INIT_DEFAULTS): New macro.
(AC_INIT): Use it.
(AC_PREFIX_DEFAULTS): Dump in AC_DIVERSION_DEFAULTS.
(_AC_INIT_PARSE_ARGS): Dump in AC_DIVERSION_INIT_PREPARE.