Commit Graph

115 Commits

Author SHA1 Message Date
Paul Eggert
39afca425e Don't default to /bin/sh. 2004-05-03 03:49:22 +00:00
Paul Eggert
42970c489e (_AS_DETECT_BETTER_SHELL): Consult $SHELL last, not first. 2004-05-03 03:47:19 +00:00
Paolo Bonzini
7c1b2b4c78 * lib/m4sugar/m4sh.m4 (M4SH-SANITIZE): New diversion.
(AS_INIT): Output shell initialization there. Removed optional
parameter. Expand _AS_SHELL_FN_SPY.
(AS_INIT_WITH_SHELL_FN): Removed.
(_AS_SHELL_FN_SPY): New macro.
(AS_DETECT_REQUIRED, AS_DETECT_SUGGESTED): New
macros.
(AS_SHELL_SANITIZE): Remove loop to find better shell
and documentation for the parameter.
(_AS_DETECT_BETTER_SHELL): Move it here.
(_AS_SHELL_FN_WORK): Remove shell invocation, reformat.
(_AS_RUN): Move it here, support testing with eval.
(AS_REQUIRE_SHELL_FN): Require shell functions when
it is used.
(_AS_LINENO_WORKS): Put around braces, we do not
trigger the bash bug anymore.
* lib/autotest/general.m4: Document M4SH-SANITIZE, do not
use AS_INIT_WITH_SHELL_FN.
* bin/autoconf.in, tests/wrapper.in: Regenerated.
2004-01-30 14:29:18 +00:00
Paul Eggert
3cbad6e408 * lib/m4sugar/m4sh.m4 (AS_MKDIR_P):
Test for dir before calling mkdir -p.  (trivial changes)
* doc/autoconf.texi: Document this.
2004-01-14 20:27:30 +00:00
Paul Eggert
c1556b819b Speed up sed scripts by doing lineno substitution only on lines with "$LINENO". 2004-01-05 07:43:48 +00:00
Paul Eggert
12475c8947 Replace "rm -rf" and "rm -fr" with "rm -f -r", as POSIX requires. 2004-01-05 07:05:22 +00:00
Paolo Bonzini
063d705adf 2003-12-03 Paolo Bonzini <bonzini@gnu.org>
* lib/m4sugar/m4sh.m4 (_AS_SHELL_FN_WORK): Redirect
        stderr to /dev/null.
        * bin/autoconf.in: Regenerate.
        * bin/wrapper.in: Regenerate.
2003-12-25 15:43:01 +00:00
Paolo Bonzini
0723ac047b 2003-11-26 Paolo Bonzini <bonzini@gnu.org>
* lib/m4sugar/m4sh.m4 (_AS_BOURNE_COMPATIBLE):
        Extracted from AS_SHELL_SANITIZE.
        (_AS_SHELL_FN_WORK, AS_INIT_WITH_SHELL_FN): New
        macros.
        (AS_SHELL_SANITIZE): Move reinvocation code from
        _AS_LINENO_WORKS, use it to find out if shell
        functions work.
        (_AS_LINENO_WORKS): Don't find another shell if $LINENO
        does not work.
        (AS_INIT): Pass parameter down to AS_SHELL_SANITIZE.
        (AS_REQUIRE_SHELL_FN): Test that AS_INIT_WITH_SHELL_FN
        was called.
        * lib/autotest/general.m4: Use AS_INIT_WITH_SHELL_FN.
        * bin/autoconf.in: Regenerate.
        * tests/wrapper.in: Regenerate.
        * tests/tools.at: Test the syntax of tests/autoconf
        and tests/testsuite.
2003-11-27 10:04:12 +00:00
Paolo Bonzini
f2193aa86c 2003-11-24 Paolo Bonzini <bonzini@gnu.org>
* lib/m4sugar/m4sh.m4 (AS_REQUIRE_SHELL_FN): New macro.
        * tests/m4sh.at (AS_REQUIRE_SHELL_FN and m4_require): New test.

Approved by Paul Eggert.
2003-11-24 10:44:52 +00:00
Alexandre Duret-Lutz
727294e819 * lib/autoconf/status.m4 (_AC_SRCPATHS): Fix use of AS_SET_CATFILE
so that ac_abs_builddir, ac_abs_top_builddir, ac_abs_srcdir,
and ac_abs_top_srcdir are absolute paths.
* lib/m4sugar/m4sh.m4 (AS_SET_CATFILE): Remove misleading comment.
2003-11-05 11:58:43 +00:00
Akim Demaille
610c228914 AC_CONFIG_FILE([d1/foo:d2/foo]) triggers error messages when
computing the absolute path to d1 in the source hierarchy: it may
not exist at all.  So don't cd into it.
From Alexandre Duret-Lutz.
http://mail.gnu.org/archive/html/bug-autoconf/2003-10/msg00205.html
* lib/m4sugar/m4sh.m4 (AS_SET_CATFILE): New.
From Paul Eggert, but named after Perl's IO::Spec->catfile.
* doc/autoconf.texi (Programming in M4sh): Document.
* lib/autoconf/status.m4 (_AC_SRCPATHS): Use it.
2003-11-04 08:32:06 +00:00
Paul Eggert
828da4a04c Use 'eval', so that the resulting configure scripts work even if
the current directory has a weird file name like 'y%s+%pp%;s%@%_%g'.
2003-10-20 23:24:37 +00:00
Paul Eggert
fb37a3ec82 Work around a bug in pdksh 5.2.14.
Document ksh better.
2003-10-15 22:56:22 +00:00
Paul Eggert
69460e86e0 (_AS_MKDIR_P_PREPARE): Change "rm -fr ./-p" to "test -d ./-p && rmdir ./-p". 2003-09-28 19:02:41 +00:00
Paul Eggert
857ba94761 (AS_SHELL_SANITIZE): Set DUALCASE=1, for MKS sh. 2003-09-28 18:53:50 +00:00
Paul Eggert
403b1490b8 (_AS_MKDIR_P_PREPARE): If mkdir -p . fails,
rm -fr ./-p to remove junk left behind on NextStep and OpenStep.
2003-09-26 08:24:30 +00:00
Paul Eggert
a0efe16f10 (_AS_UNSET_PREPARE): Work around a bug in Bash 2.01. Problem reported
by Brian Gough in
<http://mail.gnu.org/archive/html/bug-autoconf/2003-07/msg00106.html>.
2003-08-01 01:10:58 +00:00
Paolo Bonzini
2f7d336646 * lib/m4sugar/m4sh.m4: actually use the 2nd parameter to AS_REQUIRE 2003-05-22 21:39:45 +00:00
Akim Demaille
3cb00cdb8b * aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 13:24:04 +00:00
Paolo Bonzini
f16c8d206e * lib/m4sugar/m4sh.m4: protect RHS of AS_VAR_SET against expansion of
quotes (it is delayed to after the eval).
2003-05-21 19:04:41 +00:00
Akim Demaille
8624a70899 * lib/m4sugar/m4sh.m4 (_AS_UNSET_PREPARE): s/FOO/as_foo/ to avoid
user name space clashes.
Reported by Bruno Haible.
2003-05-16 09:59:15 +00:00
Derek Price
ed71ef7fc3 * lib/autoconf/general.m4 (AC_ARG_VAR): Use AS_HELP_STRING instead of
obsolete AC_HELP_STRING.
(AC_HELP_STRING): AU_DEFUN to...
* lib/m4sugar/m4sh.m4 (AS_HELP_STRING): ...here.
* tests/m4sh.at (AS_HELP_STRING): New test.

* tests/acgeneral.at: Regenerated.
2003-03-27 13:18:34 +00:00
Paul Eggert
36685d590f (AS_SHELL_SANITIZE): Fix typo in
2002-09-01 patch by replacing "test -n" with "test -z".
This fixes a bug reported by Tom Epperly in
<http://mail.gnu.org/archive/html/autoconf/2003-02/msg00139.html>.
2003-02-25 06:45:05 +00:00
Paul Eggert
11894d8bfc (AS_SHELL_SANITIZE): Set the following variables,
too: LC_ADDRESS, LC_IDENTIFICATION, LC_MEASUREMENT, LC_MONETARY,
LC_NAME, LC_PAPER, LC_TELEPHONE.
2002-11-05 07:09:14 +00:00
Akim Demaille
f77ff8f591 * lib/m4sugar/m4sh.m4 (_AS_QUOTE): The warning about quoted
characters is a back as an `obsolete' warning now.
Reported by Ralf Corsepius.
2002-10-29 08:06:36 +00:00
Akim Demaille
33c894c0bf * lib/m4sugar/m4sh.m4 (_AS_QUOTE): The warning about quoted
characters is a syntax warning now.
(_AS_QUOTE): Accept $2 as list of characters to quote.
* lib/autoconf/autoheader.m4 (AH_VERBATIM, _AH_VERBATIM_OLD):
Quote for Perl, not sh.
* bin/autoheader.in: When $debug, report the file which is
`do'ne.
* tests/tools.at (autom4te, autoheader): Exercise @bar, not merely
`@', to tickle Perl's lists.
Reported by Carlos Velasco.
2002-10-22 08:20:19 +00:00
Akim Demaille
7260b1d3c2 * lib/m4sugar/m4sh.m4 (_AS_PATH_SEPARATOR_PREPARE): Use $$ in the
file name to enable parallel executions.
From Sam Varshavchik.
2002-10-11 09:49:31 +00:00
Akim Demaille
9a56bdde71 * doc/autoconf.texi (Limitations of Usual Tools): Some about mv
from /tmp.
Thanks to Bill Moseley and Paul Eggert.
* lib/m4sugar/m4sh.m4 (AS_TMPDIR): $2 is the directory into which
the tmpdir must be created.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Have the tmp
dir be in the build tree, instead of $TMPDIR.
2002-09-27 08:20:26 +00:00
Paul Eggert
24e7c10e7f (AS_SHELL_SANITIZE): Unset ENV, MAIL,
MAILPATH and set PS1, PS2, PS4 to default values, to work
around bug in pre-3.0 UWIN ksh reported by Bruce Lilly.
For LC_ALL etc, first try to set to "C" as POSIX requires and as
the Autoconf documentation specifies; fall back to "unset" only if
this fails.  Use a shell for-loop for this rather than an m4 loop,
to shorten the output script.
2002-09-01 08:24:04 +00:00
Paul Eggert
f27d2995ab (AS_SHELL_SANITIZE): Use AS_UNSET instead
of rolling our own unset.
(_AS_PREPARE): $as_unset CDPATH instead of AS_UNSETting it, since
in practice we needn't worry about CDPATH if unset doesn't work.
2002-08-31 05:48:04 +00:00
Paul Eggert
a8ead8a326 (_AS_PATH_SEPARATOR_PREPARE):
Use PATH="/nonexistent;.", not PATH=".;.", as FreeBSD ksh2002
apparently treats PATH="nonexistent" as if it contained ".".
Bug reported by Stefan `Sec' Zehl.
2002-07-23 22:17:19 +00:00
Paul Eggert
dd756ac977 Minor spelling and grammar fixes. 2002-04-20 06:09:01 +00:00
Akim Demaille
ac07b92899 Comment changes. 2002-04-10 17:36:45 +00:00
Akim Demaille
9d658eddd9 * lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Install the Zsh
workaround for ${1+"$@"}.
* doc/autoconf.texi (Shell Substitutions): Explain it.
From Oliver Kiddle and Peter Stephenson.
Have M4sh perform minimal shell sanitizing.
* lib/m4sugar/m4sh.at (AS_SHELL_SANITIZE): Split the `_AS_PREPARE_*'
part into...
(_AS_PREPARE): this new macro.
(AS_PREPARE): New.
(AS_INIT): Invoke AS_SHELL_SANITIZE.
* tests/m4sh.at (AT_DATA_LINENO): Use _AS_PREPARE.
Adjust Autoconf and Autotest.
* lib/autoconf/general.m4 (_AC_INIT_DEFAULTS): Don't invoke
AS_SHELL_SANITIZE, AS_INIT did it, but invoke AS_PREPARE.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS):
Invoke _AS_PREPARE (not AS_PREPARE) in addition to
AS_SHELL_SANITIZE.
Use this M4sh to generate Autoconf's shell scripts.
* tests/wrapsh.as: New, precursor of wrapsh.in.
* tests/Makefile.am: Include lib/freeze.mk to get the dependencies
on Autotest and M4sh.
($(TESTSUITE)): Use $(autotest_m4f_dependencies).
(wrapsh.in): New target.
* bin/autoconf.as: New, precursor of autoconf.in.
(autoconf.in): New target.
2002-04-10 15:58:19 +00:00
Andreas Schwab
193f800800 * lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Only simplify if path
contains no literal separators.
2002-04-04 13:35:05 +00:00
Akim Demaille
3aec90e1cb * lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Invoke
_AS_MKDIR_P_PREPARE.
2002-04-02 15:14:09 +00:00
Paul Eggert
4f473142a8 (_AS_BASENAME_PREPARE): New macro.
(AS_SHELL_SANITIZE): Invoke it.
(AS_BASENAME): AS_REQUIRE it, and use $as_basename.
2002-03-27 20:33:03 +00:00
Akim Demaille
3168ea4c07 * doc/autoconf.texi (Introduction): The GNATS base moved. 2002-03-26 09:19:51 +00:00
Paul Eggert
b07b6a5b8e (_AS_LINENO_PREPARE): Unset ENV and BASH_ENV when reinvoking the
shell, to work around problems with installers who put strange things
like "cd" commands in their environments.
2002-03-22 05:35:53 +00:00
Paul Eggert
8064dd81b2 (_AS_MKDIR_P_PREPARE): New macro.
(AS_MKDIR_P): Require it.  Use mkdir -p if available, falling
back on AS_DIRNAME to compute prefixes otherwise; this is
roughly what mkinstalldirs does.  That way, we need not have
our own filename disassembler.  The old disassembler did not
work with Solaris 8 dtksh, which is ksh Version M-12/28/93d.
2002-03-19 06:23:15 +00:00
Akim Demaille
782c620d3b * lib/m4sugar/m4sh.m4 (AS_BASENAME_EXPR): AS_REQUIRE, not
m4_require.
2002-03-12 16:08:01 +00:00
Akim Demaille
0913170fae Fix Autoconf PR/209.
Also reported by Frank Denis.
* lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Don't over quote.
2002-02-07 15:49:31 +00:00
Akim Demaille
b0f1186048 Implement `autom4te --freeze'.
* bin/autom4te.in (&freeze): New.
* lib/autoconf/autoconf.m4, lib/autotest/general.m4,
* lib/m4sugar/m4sh.m4: Don't include files given by autom4te.
2002-02-05 08:12:46 +00:00
Akim Demaille
fa91df12dd * lib/m4sugar/m4sh.m4 (_AS_LINENO_PREPARE): Use PATH_SEPARATOR.
(_AS_PATH_SEPARATOR_PREPARE): Don't expect $SHELL to be
Bourne. Use /bin/sh.
From Andreas Buening.
2002-01-24 17:53:52 +00:00
Paul Eggert
e39b2117e3 (AS_SHELL_SANITIZE): _AS_CR_PREPARE needs to be invoked before
_AS_LINENO_PREPARE.

(_AS_LINENO_PREPARE): Use as_cr_digits and as_cr_alnum rather than
character ranges.
2001-11-01 22:41:54 +00:00
Paul Eggert
9fe512db2b (AS_SHELL_SANITIZE): Fix NLS before invoking AS_BASENAME. Set the
locale variables to 'C' if possible, as POSIX requires this to get the
traditional behavior.
2001-11-01 19:44:57 +00:00
Paul Eggert
0dfeb49d8e (_AS_LINENO_WORKS): Do not surround body with {}, as that triggers a
bug in Bash 2.05.
2001-10-31 20:07:48 +00:00
Paul Eggert
4c359a4349 (_AS_LINENO_PREPARE): Use Sed rather than Awk. Fix the sed prepass to
work even if there are multiple instances of $LINENO on the same line.
Do not substitute for other variables like $LINENOT.  Do not check
file dates; such a check is unreliable on sufficiently fast machines,
and removing the check makes the code simpler and more reliable.
Check for output and chmod failures.
2001-10-31 19:23:37 +00:00
Paul Eggert
a4cb525873 (_AS_LINENO_WORKS): New macro.
(_AS_LINENO_PREPARE): Use it instead of shell eval, since
eval $LINENO is not portable in practice.
2001-10-26 19:52:43 +00:00
Paul Eggert
4d264d5a3e (as_me): Shell-quote the argument of AS_BASENAME, in case $0 contains
white space.
2001-10-19 00:20:03 +00:00