From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27092 invoked from network); 10 Apr 2002 15:51:55 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 10 Apr 2002 15:51:55 -0000 Received: (qmail 9463 invoked by alias); 10 Apr 2002 15:51:48 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16957 Received: (qmail 9450 invoked from network); 10 Apr 2002 15:51:46 -0000 To: Peter Stephenson Cc: zsh-workers@sunsite.dk, ab@purdue.edu, bug-autoconf@gnu.org, APatche Subject: Re: Zsh 3 and ${1+"$@"} (Was: [GNU Autoconf 2.53] testsuite.log: 126 failures) References: <28811.1018353588@csr.com> From: Akim Demaille Date: 10 Apr 2002 17:52:05 +0200 In-Reply-To: <28811.1018353588@csr.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: Akim Demaille --=-=-= Thanks to you all for the help! I'm installing the following patch on Autoconf (I have left its side effects, such as on configure, so that people can look at its impact). Feel free to fix my words about Zsh. Allen, I'll wrap a tarball, once the test suite finished (err... a couple of hours I guess), will you be able to re-run the test suite on that tarball? I expect much less than 126 failures on 163 tests :) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=diffs.patch Index: ChangeLog from Akim Demaille * 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. Index: NEWS =================================================================== RCS file: /cvsroot/autoconf/autoconf/NEWS,v retrieving revision 1.229 diff -u -u -r1.229 NEWS --- NEWS 9 Apr 2002 20:37:10 -0000 1.229 +++ NEWS 10 Apr 2002 15:51:27 -0000 @@ -8,6 +8,16 @@ - AC_PROG_CC_STDC is integrated into AC_PROG_CC. +** Bug fixes + +- Spurious complaints from `m4_bmatch' about invalid regular + expressions are suppressed. + +** Improved Zsh portability + Both Autoconf the package, and the scripts it produces, should run + more reliably with Zsh. Bear in mind it is the default Bourne shell + on Darwin. + ** Documentation - Limitations of Make Index: THANKS =================================================================== RCS file: /cvsroot/autoconf/autoconf/THANKS,v retrieving revision 1.85 diff -u -u -r1.85 THANKS --- THANKS 19 Mar 2002 15:20:58 -0000 1.85 +++ THANKS 10 Apr 2002 15:51:27 -0000 @@ -126,6 +126,7 @@ Nishio Futoshi fut_nis@d3.dion.ne.jp Noah Elliott elliott@hera.llnl.gov Noah Friedman friedman@gnu.ai.mit.edu +Oliver Kiddle okiddle@totalise.co.uk Olly Betts olly@survex.com Ossama Othman ossama@debian.org Patrick Tullmann tullmann@cs.utah.edu @@ -137,6 +138,7 @@ Pavel Roskin pavel_roskin@geocities.com Peter Eisentraut peter_e@gmx.net Peter Simons simons@research.cys.de +Peter Stephenson pws@csr.com Philipp Thomas kthomas@gwdg.de Rainer Orth ro@TechFak.Uni-Bielefeld.DE Raja R Harinath harinath@cs.umn.edu Index: configure =================================================================== RCS file: /cvsroot/autoconf/autoconf/configure,v retrieving revision 1.206 diff -u -u -r1.206 configure --- configure 13 Mar 2002 09:58:41 -0000 1.206 +++ configure 10 Apr 2002 15:51:27 -0000 @@ -8,14 +8,6 @@ # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - - - ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -24,6 +16,9 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: + # Zsh performs word splitting on ${1+"$@"}, which is contrary to + # our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi @@ -62,8 +57,22 @@ { LC_MESSAGES=C; export LC_MESSAGES; } +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + # Name of the executable. -as_me=`(basename "$0") 2>/dev/null || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ @@ -74,13 +83,6 @@ /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then @@ -95,92 +97,6 @@ rm -f conftest.sh fi - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; @@ -188,48 +104,8 @@ *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - as_executable_p="test -f" -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } - # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, @@ -1159,7 +1035,7 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. -ac_config_files="$ac_config_files config/Makefile" + ac_config_files="$ac_config_files config/Makefile" am__api_version="1.6a" @@ -1519,24 +1395,24 @@ # Initialize the test suite and build position independent wrappers. -ac_config_commands="$ac_config_commands tests/atconfig" + ac_config_commands="$ac_config_commands tests/atconfig" -ac_config_files="$ac_config_files tests/Makefile tests/atlocal" + ac_config_files="$ac_config_files tests/Makefile tests/atlocal" -ac_config_files="$ac_config_files tests/autoconf:tests/wrapsh.in" + ac_config_files="$ac_config_files tests/autoconf:tests/wrapsh.in" -ac_config_files="$ac_config_files tests/autoheader:tests/wrappl.in" + ac_config_files="$ac_config_files tests/autoheader:tests/wrappl.in" -ac_config_files="$ac_config_files tests/autom4te:tests/wrappl.in" + ac_config_files="$ac_config_files tests/autom4te:tests/wrappl.in" -ac_config_files="$ac_config_files tests/autoreconf:tests/wrappl.in" + ac_config_files="$ac_config_files tests/autoreconf:tests/wrappl.in" -ac_config_files="$ac_config_files tests/autoscan:tests/wrappl.in" + ac_config_files="$ac_config_files tests/autoscan:tests/wrappl.in" -ac_config_files="$ac_config_files tests/autoupdate:tests/wrappl.in" + ac_config_files="$ac_config_files tests/autoupdate:tests/wrappl.in" -ac_config_files="$ac_config_files tests/ifnames:tests/wrappl.in" + ac_config_files="$ac_config_files tests/ifnames:tests/wrappl.in" # Extract the first word of "expr", so it can be a program name with args. set dummy expr; ac_word=$2 @@ -1649,7 +1525,7 @@ fi # Man pages. -ac_config_files="$ac_config_files man/Makefile" + ac_config_files="$ac_config_files man/Makefile" HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"} @@ -1708,7 +1584,7 @@ } # Emacs modes. -ac_config_files="$ac_config_files lib/emacs/Makefile" + ac_config_files="$ac_config_files lib/emacs/Makefile" test x"$EMACS" = xt && EMACS= for ac_prog in emacs xemacs @@ -1845,7 +1721,7 @@ -ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile lib/Autom4te/Makefile lib/autoscan/Makefile lib/m4sugar/Makefile lib/autoconf/Makefile lib/autotest/Makefile bin/Makefile" + ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile lib/Autom4te/Makefile lib/autoscan/Makefile lib/m4sugar/Makefile lib/autoconf/Makefile lib/autotest/Makefile bin/Makefile" cat >confcache <<\_ACEOF @@ -1973,7 +1849,6 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -1982,6 +1857,9 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: + # Zsh performs word splitting on ${1+"$@"}, which is contrary to + # our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi @@ -2020,8 +1898,22 @@ { LC_MESSAGES=C; export LC_MESSAGES; } +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + # Name of the executable. -as_me=`(basename "$0") 2>/dev/null || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ @@ -2032,6 +1924,7 @@ /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` + # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -2099,6 +1992,8 @@ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} @@ -2172,6 +2067,12 @@ fi rm -f conf$$ conf$$.exe conf$$.file +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. @@ -2544,25 +2445,30 @@ /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; } - ;; - esac -done; } + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } ac_builddir=. Index: bin/Makefile.am =================================================================== RCS file: /cvsroot/autoconf/autoconf/bin/Makefile.am,v retrieving revision 1.4 diff -u -u -r1.4 Makefile.am --- bin/Makefile.am 23 Sep 2001 17:16:43 -0000 1.4 +++ bin/Makefile.am 10 Apr 2002 15:51:27 -0000 @@ -1,7 +1,7 @@ ## Process this file with automake to create Makefile.in. -*-Makefile-*- ## Makefile for Autoconf. -## Copyright 1999, 2000, 2001 Free Software Foundation, Inc. +## Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -22,7 +22,8 @@ autoconf autoheader autoreconf ifnames autoscan autoupdate EXTRA_DIST = autoconf.in autoheader.in autoreconf.in autoupdate.in ifnames.in \ - autoscan.in autom4te.in + autoscan.in autom4te.in \ + autoconf.as # Files that should be removed, but which Automake does not know. CLEANFILES = $(bin_SCRIPTS) @@ -46,9 +47,15 @@ -e 's,@VERSION\@,$(VERSION),g' \ -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' +# autoconf is written in M4sh. +AUTOM4SH = $(top_builddir)/tests/autom4te --language M4sh +$(srcdir)/autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies) + $(AUTOM4SH) $(srcdir)/autoconf.as -o $@ + ## All the files below depend on configure.ac so that they are rebuilt ## when the Autoconf version changes. Unfortunately, suffix rules cannot ## have additional dependencies, so we have to use explicit rules. + autoconf: $(srcdir)/autoconf.in $(top_srcdir)/configure.ac rm -f autoconf autoconf.tmp Index: bin/Makefile.in =================================================================== RCS file: /cvsroot/autoconf/autoconf/bin/Makefile.in,v retrieving revision 1.10 diff -u -u -r1.10 Makefile.in --- bin/Makefile.in 8 Mar 2002 12:44:46 -0000 1.10 +++ bin/Makefile.in 10 Apr 2002 15:51:27 -0000 @@ -85,7 +85,8 @@ EXTRA_DIST = autoconf.in autoheader.in autoreconf.in autoupdate.in ifnames.in \ - autoscan.in autom4te.in + autoscan.in autom4te.in \ + autoconf.as # Files that should be removed, but which Automake does not know. @@ -106,6 +107,9 @@ -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' +# autoconf is written in M4sh. +AUTOM4SH = $(top_builddir)/tests/autom4te --language M4sh + TAGS_DEPENDENCIES = $(EXTRA_DIST) letters = abcdefghijklmnopqrstuvwxyz @@ -294,6 +298,8 @@ maintainer-clean-generic mostlyclean mostlyclean-generic tags \ uninstall uninstall-am uninstall-binSCRIPTS uninstall-info-am +$(srcdir)/autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies) + $(AUTOM4SH) $(srcdir)/autoconf.as -o $@ autoconf: $(srcdir)/autoconf.in $(top_srcdir)/configure.ac rm -f autoconf autoconf.tmp Index: bin/autoconf.as =================================================================== RCS file: bin/autoconf.as diff -N bin/autoconf.as --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ bin/autoconf.as 10 Apr 2002 15:51:27 -0000 @@ -0,0 +1,191 @@ +AS_INIT[]dnl -*- shell-script -*- +# autoconf -- create `configure' using m4 macros +# Copyright (C) 1992, 1993, 1994, 1996, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +usage=["\ +Usage: $0 [OPTION] ... [TEMPLATE-FILE] + +Generate a configuration script from a TEMPLATE-FILE if given, or +\`configure.ac' if present, or else \`configure.in'. Output is sent +to the standard output if TEMPLATE-FILE is given, else into +\`configure'. + +Operation modes: + -h, --help print this help, then exit + -V, --version print version number, then exit + -v, --verbose verbosely report processing + -d, --debug don't remove temporary files + -I, --include=DIR look for input files in DIR (cumulative) + -f, --force consider all files obsolete + -o, --output=FILE save output in FILE (stdout is the default) + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax] + +Warning categories include: + \`cross' cross compilation issues + \`obsolete' obsolete constructs + \`syntax' dubious syntactic constructs + \`all' all the warnings + \`no-CATEGORY' turn off the warnings on CATEGORY + \`none' turn off all the warnings + \`error' warnings are error + +The environment variable \`WARNINGS' is honored. + +Tracing: + -t, --trace=MACRO report the list of calls to MACRO + -i, --initialization also trace Autoconf's initialization process + +In tracing mode, no configuration script is created. + +Report bugs to ."] + +version=["\ +autoconf (@PACKAGE_NAME@) @VERSION@ +Written by David J. MacKenzie and Akim Demaille. + +Copyright 2002 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."] + +me=`AS_BASENAME([$0])` + +help="\ +Try \`$me --help' for more information." + +exit_missing_arg="\ +echo \"$me: option \\\`\$1' requires an argument\" >&2 +echo \"\$help\" >&2 +exit 1" + +# Variables. +: ${AUTOM4TE=@autom4te-name@} +dir=`AS_DIRNAME([$0])` +outfile= +verbose=: + +# Parse command line. +while test $# -gt 0 ; do + option=[`expr "x$1" : 'x\(--[^=]*\)' \| \ + "x$1" : 'x\(-.\)'`] + optarg=[`expr "x$1" : 'x--[^=]*=\(.*\)' \| \ + "x$1" : 'x-.\(.*\)'`] + case $1 in + --version | -V ) + echo "$version" ; exit 0 ;; + --help | -h ) + echo "$usage"; exit 0 ;; + + --verbose | -v ) + verbose=echo + AUTOM4TE="$AUTOM4TE $1"; shift ;; + + # Arguments passed as is to autom4te. + --debug | -d | \ + --force | -f | \ + --include=* | -I?* | \ + --warnings=* | -W?* ) + AUTOM4TE="$AUTOM4TE $1"; shift ;; + + # Options with separated arg passed as is to autom4te. + --include | -I | \ + --warnings | -W ) + test $# = 1 && eval "$exit_missing_arg" + AUTOM4TE="$AUTOM4TE $option $2" + shift 2 ;; + + # Obsolete options. + --localdir=* | -l?* | --autoconf-dir=* | -A?* | --macrodir=* | -m?* ) + echo "$me: warning: $option is obsolete, use --include" >&2 + AUTOM4TE="$AUTOM4TE --include=$optarg" + shift ;; + --localdir | -l | --autoconf-dir | -A | --macrodir | -m ) + echo "$me: warning: $option is obsolete, use --include" >&2 + test $# = 1 && eval "$exit_missing_arg" + shift + AUTOM4TE="$AUTOM4TE --include=$1" + shift ;; + + --trace=* | -t?* ) + traces="$traces --trace='"`echo "$optarg" | sed "s/'/'\\\\\\\\''/g"`"'" + shift ;; + --trace | -t ) + test $# = 1 && eval "$exit_missing_arg" + shift + traces="$traces --trace='"`echo "$1" | sed "s/'/'\\\\\\\\''/g"`"'" + shift ;; + --initialization | -i ) + AUTOM4TE="$AUTOM4TE --melt" + shift;; + + --output=* | -o?* ) + outfile=$optarg + shift ;; + --output | -o ) + test $# = 1 && eval "$exit_missing_arg" + shift + outfile=$1 + shift ;; + + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + exec >&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; + * ) + break ;; + esac +done + +# Find the input file. +case $# in + 0) + case `ls configure.ac configure.in 2>/dev/null` in + *ac*in ) + echo "$me: warning: both \`configure.ac' and \`configure.in' are present." >&2 + echo "$me: warning: proceeding with \`configure.ac'." >&2 + infile=configure.ac;; + *ac ) infile=configure.ac;; + *in ) infile=configure.in;; + * ) + echo "$me: no input file" >&2 + exit 1;; + esac + test -z "$traces" && test -z "$outfile" && outfile=configure;; + 1) # autom4te doesn't like `-'. + test "x$1" != "x-" && infile=$1 ;; + *) exec >&2 + echo "$me: invalid number of arguments." + echo "$help" + (exit 1); exit 1 ;; +esac + +# Unless specified, the output is stdout. +test -z "$outfile" && outfile=- + +# Running autom4te. +run_autom4te="$AUTOM4TE --language=autoconf --output=$outfile" +# Autom4te expansion. +eval set dummy "$traces" +shift +$verbose "$me: running $run_autom4te "${1+"$@"}" $infile" >&2 +exec $run_autom4te ${1+"$@"} $infile Index: bin/autoconf.in =================================================================== RCS file: /cvsroot/autoconf/autoconf/bin/autoconf.in,v retrieving revision 1.144 diff -u -u -r1.144 autoconf.in --- bin/autoconf.in 8 Mar 2002 11:46:31 -0000 1.144 +++ bin/autoconf.in 10 Apr 2002 15:51:27 -0000 @@ -1,7 +1,29 @@ -#! @SHELL@ -# -*- shell-script -*- +#! /bin/sh +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh performs word splitting on ${1+""}, which is contrary to + # our usage. Disable this feature. + alias -g '${1+""}'='""' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + # autoconf -- create `configure' using m4 macros -# Copyright 1992, 1993, 1994, 1996, 1999, 2000, 2001 +# Copyright (C) 1992, 1993, 1994, 1996, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -19,8 +41,6 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. -me=`echo "$0" | sed -e 's,.*[\\/],,'` - usage="\ Usage: $0 [OPTION] ... [TEMPLATE-FILE] @@ -66,6 +86,17 @@ This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +me=`$as_basename $0 || +$as_expr X/$0 : '.*/\([^/][^/]*\)/*$' \| \ + X$0 : 'X\(//\)$' \| \ + X$0 : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/$0 | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + help="\ Try \`$me --help' for more information." @@ -74,15 +105,20 @@ echo \"\$help\" >&2 exit 1" -# NLS nuisances. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi - # Variables. : ${AUTOM4TE=@autom4te-name@} -dir=`echo "$0" | sed -e 's,[^\\/]*$,,'` +dir=`(dirname $0) 2>/dev/null || +$as_expr X$0 : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$0 : 'X\(//\)[^/]' \| \ + X$0 : 'X\(//\)$' \| \ + X$0 : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$0 | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` outfile= verbose=: Index: doc/autoconf.texi =================================================================== RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v retrieving revision 1.608 diff -u -u -r1.608 autoconf.texi --- doc/autoconf.texi 9 Apr 2002 20:37:11 -0000 1.608 +++ doc/autoconf.texi 10 Apr 2002 15:51:28 -0000 @@ -7412,6 +7412,9 @@ @c FIXME: Eventually will become a chapter, as it is not related to @c programming in M4 per se. +M4sh is aiming at producing portable Bourne shell scripts. For the time +being, it is not mature enough to be widely used. + M4sh provides portable alternatives for some common shell constructs that unfortunately are not portable in practice. @@ -8460,6 +8463,35 @@ Unix 4.0 and 5.0, will then replace it with an empty argument. To be portable, use @samp{$@{1+"$@@"@}}. +But that's not the end of the story. Zsh (3.x and 4.x), when emulating +the Bourne shell, does perform word splitting on @samp{$@{1+"$@@"@}}... + +@example +zsh $ @kbd{emulate sh} +zsh $ @kbd{for i in "$@"; do echo $i; done} +Hello World +! +zsh $ @kbd{for i in $@{1+"$@@"@}; do echo $i; done} +Hello +World +! +@end example + +@noindent +It is not clear whether this is a violation of the Bourne shell +standard, nevertheless, in this regard Zsh is different from all the +other shells. Of course Zsh handles @samp{"$@@"} properly, but we can't +use it portably... + +Fortunately, there is a workaround which relies on Zsh's ``global +aliases'': let it convert @samp{$@{1+"$@@"@}} into @samp{"$@@"} by +itself: + +@example +test -n "$@{ZSH_VERSION+set@}" = set && alias -g '$@{1+"$@@"@}'='"$@@"' +@end example + + @item $@{@var{var}:-@var{value}@} @c Info cannot handle `:' in index entries. @c @cindex $@{@var{var}:-@var{value}@} @@ -8478,6 +8510,8 @@ otherwise some shells, such as on Digital Unix V 5.0, will die because of a ``bad substitution''. +@sp 1 + Solaris' @command{/bin/sh} has a frightening bug in its interpretation of this. Imagine you need set a variable to a string containing @samp{@}}. This @samp{@}} character confuses Solaris' @command{/bin/sh} @@ -9132,6 +9166,12 @@ echo "$arg" done @end example + +@noindent +But keep in mind that Zsh, even in Bourne shell emulation mode, performs +word splitting on @samp{$@{1+"$@@"@}}, see @ref{Shell Substitutions}, +item @samp{$@@}, for more. + @item @command{if} @c --------------- Index: lib/autoconf/autoconf.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/autoconf.m4,v retrieving revision 1.40 diff -u -u -r1.40 autoconf.m4 --- lib/autoconf/autoconf.m4 5 Feb 2002 08:12:46 -0000 1.40 +++ lib/autoconf/autoconf.m4 10 Apr 2002 15:51:28 -0000 @@ -1,6 +1,6 @@ # This file is part of Autoconf. -*- Autoconf -*- # Driver that loads the Autoconf macro files. -# Copyright 1994, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1994, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by Index: lib/autoconf/general.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v retrieving revision 1.792 diff -u -u -r1.792 general.m4 --- lib/autoconf/general.m4 4 Mar 2002 15:09:21 -0000 1.792 +++ lib/autoconf/general.m4 10 Apr 2002 15:51:28 -0000 @@ -432,8 +432,6 @@ m4_define([_AC_INIT_DEFAULTS], [m4_divert_push([DEFAULTS])dnl -AS_SHELL_SANITIZE - # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. @@ -1252,6 +1250,7 @@ # Actually reserved by M4sh. m4_pattern_allow([^AS_FLAGS$]) AS_INIT +AS_PREPARE m4_ifval([$2], [_AC_INIT_PACKAGE($@)]) _AC_INIT_DEFAULTS _AC_INIT_PARSE_ARGS @@ -1754,9 +1753,9 @@ # ------------------------------------------ # The name of shell var CACHE-ID must contain `_cv_' in order to get saved. # Should be dnl'ed. Try to catch common mistakes. -m4_define([AC_CACHE_VAL], +m4_defun([AC_CACHE_VAL], [m4_bmatch([$2], [AC_DEFINE], - [AC_DIAGNOSE(syntax, + [AC_DIAGNOSE(syntax, [$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl [where no actions should be taken])])dnl AS_VAR_SET_IF([$1], @@ -1767,7 +1766,7 @@ # AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS) # ------------------------------------------- # Do not call this macro with a dnl right behind. -m4_define([AC_CACHE_CHECK], +m4_defun([AC_CACHE_CHECK], [AC_MSG_CHECKING([$1]) AC_CACHE_VAL([$2], [$3])dnl AC_MSG_RESULT_UNQUOTED([AS_VAR_GET([$2])])]) Index: lib/autoconf/status.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v retrieving revision 1.21 diff -u -u -r1.21 status.m4 --- lib/autoconf/status.m4 9 Apr 2002 11:15:33 -0000 1.21 +++ lib/autoconf/status.m4 10 Apr 2002 15:51:28 -0000 @@ -1261,6 +1261,10 @@ cat >>$CONFIG_STATUS <<\_ACEOF AS_SHELL_SANITIZE +dnl Watch out, this is directly the initializations, do not use +dnl AS_PREPARE, otherwise you'd get it output in the initialization +dnl of configure, not config.status. +_AS_PREPARE exec AS_MESSAGE_FD>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to Index: lib/autotest/general.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/autotest/general.m4,v retrieving revision 1.129 diff -u -u -r1.129 general.m4 --- lib/autotest/general.m4 19 Mar 2002 06:43:17 -0000 1.129 +++ lib/autotest/general.m4 10 Apr 2002 15:51:28 -0000 @@ -94,9 +94,10 @@ m4_define([AT_ordinal], 0) m4_define([AT_banner_ordinal], 0) AS_INIT +AS_PREPARE m4_divert_push([DEFAULT])dnl -AS_SHELL_SANITIZE +AS_PREPARE SHELL=${CONFIG_SHELL-/bin/sh} # How were we run? Index: lib/m4sugar/m4sh.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v retrieving revision 1.81 diff -u -u -r1.81 m4sh.m4 --- lib/m4sugar/m4sh.m4 4 Apr 2002 13:35:05 -0000 1.81 +++ lib/m4sugar/m4sh.m4 10 Apr 2002 15:51:28 -0000 @@ -137,20 +137,8 @@ # AS_SHELL_SANITIZE # ----------------- # Try to be as Bourne and/or POSIX as possible. -# -# This macro has a very special status. Normal use of M4sh relies -# heavily on AS_REQUIRE, so that needed initiatizations (such as -# _AS_TEST_PREPARE) are performed on need, not on demand. But -# Autoconf is the first client of M4sh, and for two reasons: configure -# and config.status. Relying on AS_REQUIRE is of course fine for -# configure, but fails for config.status (which is created by -# configure). So we need a means to force the inclusion of the -# various _AS_PREPARE_* on top of config.status. That's basically why -# there are so many _AS_PREPARE_* below, and that's also why it is -# important not to forget some: config.status needs them. m4_defun([AS_SHELL_SANITIZE], -[ -## --------------------- ## +[## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -158,6 +146,9 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: + [#] Zsh performs word splitting on ${1+"$[@]"}, which is contrary to + # our usage. Disable this feature. + alias -g '${1+"$[@]"}'='"$[@]"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi @@ -172,11 +163,30 @@ { _AS_var=C; export _AS_var; } ]) -# Name of the executable. +# Required to use basename. +_AS_EXPR_PREPARE _AS_BASENAME_PREPARE + +# Name of the executable. as_me=`AS_BASENAME("$[0]")` -# PATH needs CR, and LINENO needs CR and PATH. +]) + + +# _AS_PREPARE +# ----------- +# This macro has a very special status. Normal use of M4sh relies +# heavily on AS_REQUIRE, so that needed initiatizations (such as +# _AS_TEST_PREPARE) are performed on need, not on demand. But +# Autoconf is the first client of M4sh, and for two reasons: configure +# and config.status. Relying on AS_REQUIRE is of course fine for +# configure, but fails for config.status (which is created by +# configure). So we need a means to force the inclusion of the +# various _AS_PREPARE_* on top of config.status. That's basically why +# there are so many _AS_PREPARE_* below, and that's also why it is +# important not to forget some: config.status needs them. +m4_defun([_AS_PREPARE], +[# PATH needs CR, and LINENO needs CR and PATH. _AS_CR_PREPARE _AS_PATH_SEPARATOR_PREPARE _AS_LINENO_PREPARE @@ -200,6 +210,14 @@ ]) +# AS_PREPARE +# ---------- +# Output all the M4sh possible initialization into the initialization +# diversion. +m4_defun([AS_PREPARE], +[m4_divert_text([M4SH-INIT], [_AS_PREPARE])]) + + ## ----------------------------- ## ## 2. Wrappers around builtins. ## ## ----------------------------- ## @@ -508,7 +526,8 @@ # configure) you'd compare LINENO wrt config.status vs. _oline_ vs # configure. m4_define([_AS_LINENO_PREPARE], -[_AS_LINENO_WORKS || { +[AS_REQUIRE([_AS_CR_PREPARE])dnl +_AS_LINENO_WORKS || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $[0] in @@ -1017,8 +1036,9 @@ # Forbidden tokens and exceptions. m4_pattern_forbid([^_?AS_]) -# Bangshe. +# Bangshe and minimal initialization. m4_divert_text([BINSH], [@%:@! /bin/sh]) +m4_divert_text([M4SH-INIT], [AS_SHELL_SANITIZE]) # Let's go! m4_wrap([m4_divert_pop([BODY])[]]) Index: man/autoconf.1 =================================================================== RCS file: /cvsroot/autoconf/autoconf/man/autoconf.1,v retrieving revision 1.62 diff -u -u -r1.62 autoconf.1 --- man/autoconf.1 11 Mar 2002 14:39:00 -0000 1.62 +++ man/autoconf.1 10 Apr 2002 15:51:28 -0000 @@ -1,5 +1,5 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.26. -.TH AUTOCONF "1" "March 2002" "autoconf 2.53a" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.27. +.TH AUTOCONF "1" "April 2002" "autoconf 2.53a" "User Commands" .SH NAME autoconf \- Generate configuration scripts .SH SYNOPSIS Index: man/config.guess.1 =================================================================== RCS file: /cvsroot/autoconf/autoconf/man/config.guess.1,v retrieving revision 1.13 diff -u -u -r1.13 config.guess.1 --- man/config.guess.1 5 Mar 2002 08:43:46 -0000 1.13 +++ man/config.guess.1 10 Apr 2002 15:51:28 -0000 @@ -1,5 +1,5 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.25. -.TH CONFIG.GUESS "1" "March 2002" "config.guess (2002-03-04)" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.27. +.TH CONFIG.GUESS "1" "April 2002" "config.guess (2002-03-20)" "User Commands" .SH NAME config.guess \- guess the build system triplet .SH SYNOPSIS Index: tests/Makefile.am =================================================================== RCS file: /cvsroot/autoconf/autoconf/tests/Makefile.am,v retrieving revision 1.79 diff -u -u -r1.79 Makefile.am --- tests/Makefile.am 5 Feb 2002 08:28:08 -0000 1.79 +++ tests/Makefile.am 10 Apr 2002 15:51:28 -0000 @@ -1,7 +1,7 @@ ## Process this file with automake to create Makefile.in. -*-Makefile-*- ## Makefile for Autoconf testsuite. -## Copyright 2000, 2001, 2002 Free Software Foundation, Inc. +## Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -21,14 +21,17 @@ # We don't actually distribute the testsuite, since one only # needs m4 to build it, m4 being required anyway to install Autoconf. EXTRA_DIST = $(TESTSUITE_AT) atspecific.m4 mktests.sh \ - atlocal.in package.m4 + atlocal.in package.m4 wrapsh.as # Running the uninstalled scripts. check_SCRIPTS = autoconf autoheader autoreconf autom4te autoscan autoupdate ifnames -# FIXME: Why doesn't Automake clean these? DISTCLEANFILES = atconfig atlocal $(TESTSUITE) $(check_SCRIPTS) +# Import the dependencies on Autotest and M4sh. +include ../lib/freeze.mk + + ## ------------ ## ## package.m4. ## ## ------------ ## @@ -45,6 +48,14 @@ +## ---------- ## +## Wrappers. ## +## ---------- ## + +$(srcdir)/wrapsh.in: $(srcdir)/wrapsh.as $(m4sh_m4f_dependencies) + ./autom4te --language=M4sh $(srcdir)/wrapsh.as -o $@ + + ## ------------ ## ## Test suite. ## ## ------------ ## @@ -71,13 +82,10 @@ # Don't use AUTOM4TE since `make alpha' makes it unavailable although # we are allowed to use it (since we ship it). AUTOTEST = ./autom4te --language=autotest -$(TESTSUITE): $(top_srcdir)/lib/m4sugar/m4sugar.m4 \ - $(top_srcdir)/lib/m4sugar/m4sh.m4 \ - $(top_srcdir)/lib/autotest/autotest.m4 \ - $(top_srcdir)/lib/autotest/general.m4 \ - $(srcdir)/package.m4 \ - atspecific.m4 \ - $(TESTSUITE_AT) +$(TESTSUITE): $(srcdir)/package.m4 \ + atspecific.m4 \ + $(TESTSUITE_AT) \ + $(autotest_m4f_dependencies) $(AUTOTEST) -I $(srcdir) suite.at -o $@.tmp mv $@.tmp $@ Index: tests/Makefile.in =================================================================== RCS file: /cvsroot/autoconf/autoconf/tests/Makefile.in,v retrieving revision 1.112 diff -u -u -r1.112 Makefile.in --- tests/Makefile.in 8 Mar 2002 12:44:47 -0000 1.112 +++ tests/Makefile.in 10 Apr 2002 15:51:28 -0000 @@ -83,15 +83,69 @@ # We don't actually distribute the testsuite, since one only # needs m4 to build it, m4 being required anyway to install Autoconf. EXTRA_DIST = $(TESTSUITE_AT) atspecific.m4 mktests.sh \ - atlocal.in package.m4 + atlocal.in package.m4 wrapsh.as # Running the uninstalled scripts. check_SCRIPTS = autoconf autoheader autoreconf autom4te autoscan autoupdate ifnames -# FIXME: Why doesn't Automake clean these? DISTCLEANFILES = atconfig atlocal $(TESTSUITE) $(check_SCRIPTS) +SUFFIXES = .m4 .m4f + +# Do not use AUTOM4TE here, since Makefile.maint (my-distcheck) +# checks if we are independant of Autoconf by defining AUTOM4TE (and +# others) to `false'. But we _ship_ tests/autom4te, so it doesn't +# apply to us. +MY_AUTOM4TE = $(top_builddir)/tests/autom4te + +AUTOM4TE_CFG = $(top_builddir)/lib/autom4te.cfg + +# Factor the dependencies between all the frozen files. +# Some day we should explain to Automake how to use autom4te to compute +# the dependencies... +src_libdir = $(top_srcdir)/lib +build_libdir = $(top_builddir)/lib + +m4f_dependencies = $(MY_AUTOM4TE) $(AUTOM4TE_CFG) + +m4sugar_m4f_dependencies = \ + $(m4f_dependencies) \ + $(src_libdir)/m4sugar/m4sugar.m4 \ + $(build_libdir)/m4sugar/version.m4 + + +m4sh_m4f_dependencies = \ + $(m4sugar_m4f_dependencies) \ + $(src_libdir)/m4sugar/m4sh.m4 + + +autotest_m4f_dependencies = \ + $(m4sh_m4f_dependencies) \ + $(src_libdir)/autotest/autotest.m4 \ + $(src_libdir)/autotest/general.m4 + + +autoconf_m4f_dependencies = \ + $(m4sh_m4f_dependencies) \ + $(src_libdir)/autoconf/general.m4 \ + $(src_libdir)/autoconf/autoheader.m4 \ + $(src_libdir)/autoconf/autoupdate.m4 \ + $(src_libdir)/autoconf/autotest.m4 \ + $(src_libdir)/autoconf/status.m4 \ + $(src_libdir)/autoconf/oldnames.m4 \ + $(src_libdir)/autoconf/specific.m4 \ + $(src_libdir)/autoconf/lang.m4 \ + $(src_libdir)/autoconf/c.m4 \ + $(src_libdir)/autoconf/fortran.m4 \ + $(src_libdir)/autoconf/functions.m4 \ + $(src_libdir)/autoconf/headers.m4 \ + $(src_libdir)/autoconf/types.m4 \ + $(src_libdir)/autoconf/libs.m4 \ + $(src_libdir)/autoconf/programs.m4 \ + $(src_libdir)/autoconf/autoconf.m4 + + TESTSUITE_GENERATED_AT = \ aclang.at acc.at acfortran.at \ acgeneral.at acstatus.at \ @@ -149,7 +203,8 @@ all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +.SUFFIXES: .m4 .m4f +$(srcdir)/Makefile.in: Makefile.am $(srcdir)/../lib/freeze.mk $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @@ -278,6 +333,30 @@ maintainer-clean-generic mostlyclean mostlyclean-generic \ uninstall uninstall-am uninstall-info-am +$(MY_AUTOM4TE): + cd $(top_builddir)/tests && $(MAKE) $(AM_MAKEFLAGS) autom4te +$(AUTOM4TE_CFG): + cd $(top_builddir)/lib && $(MAKE) $(AM_MAKEFLAGS) autom4te.cfg + +# When processing the file with diversion disabled, there must be no +# output but comments and empty lines. +# If freezing produces output, something went wrong: a bad `divert', +# or an improper paren etc. +# It may happen that the output does not end with a end of line, hence +# force an end of line when reporting errors. +.m4.m4f: + $(MY_AUTOM4TE) \ + --language=$* \ + --freeze \ + --include=$(srcdir)/.. \ + --include=.. \ + --output=$@ + +# For parallel builds. +$(build_libdir)/m4sugar/version.m4: + cd $(build_libdir)/m4sugar && $(MAKE) $(AM_MAKEFLAGS) version.m4 + +# Import the dependencies on Autotest and M4sh. $(srcdir)/package.m4: $(top_srcdir)/configure.ac { \ @@ -288,13 +367,13 @@ echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \ echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \ } >$(srcdir)/package.m4 -$(TESTSUITE): $(top_srcdir)/lib/m4sugar/m4sugar.m4 \ - $(top_srcdir)/lib/m4sugar/m4sh.m4 \ - $(top_srcdir)/lib/autotest/autotest.m4 \ - $(top_srcdir)/lib/autotest/general.m4 \ - $(srcdir)/package.m4 \ - atspecific.m4 \ - $(TESTSUITE_AT) + +$(srcdir)/wrapsh.in: $(srcdir)/wrapsh.as $(m4sh_m4f_dependencies) + ./autom4te --language=M4sh $(srcdir)/wrapsh.as -o $@ +$(TESTSUITE): $(srcdir)/package.m4 \ + atspecific.m4 \ + $(TESTSUITE_AT) \ + $(autotest_m4f_dependencies) $(AUTOTEST) -I $(srcdir) suite.at -o $@.tmp mv $@.tmp $@ Index: tests/m4sh.at =================================================================== RCS file: /cvsroot/autoconf/autoconf/tests/m4sh.at,v retrieving revision 1.28 diff -u -u -r1.28 m4sh.at --- tests/m4sh.at 25 Mar 2002 22:02:24 -0000 1.28 +++ tests/m4sh.at 10 Apr 2002 15:51:29 -0000 @@ -2,7 +2,7 @@ AT_BANNER([M4sh.]) -# Copyright 2000, 2001 Free Software Foundation, Inc. +# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ if $2; then AS@&t@_UNSET([LINENO]) fi -AS@&t@_SHELL_SANITIZE +_AS@&t@_PREPARE echo "Line: $3" grep 'Line: .*$4' $[0] >/dev/null || AS@&t@_ERROR([cannot find original script]) Index: tests/wrapsh.as =================================================================== RCS file: tests/wrapsh.as diff -N tests/wrapsh.as --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ tests/wrapsh.as 10 Apr 2002 15:51:29 -0000 @@ -0,0 +1,5 @@ +AS_INIT +# Running `$0' as if it were installed. +me=`echo "$0" | sed -e 's,.*[\\/],,'` + +exec @abs_top_builddir@/bin/$me --include @abs_top_builddir@/lib ${1+"$@"} Index: tests/wrapsh.in =================================================================== RCS file: /cvsroot/autoconf/autoconf/tests/wrapsh.in,v retrieving revision 1.2 diff -u -u -r1.2 wrapsh.in --- tests/wrapsh.in 14 Dec 2001 17:57:29 -0000 1.2 +++ tests/wrapsh.in 10 Apr 2002 15:51:29 -0000 @@ -1,6 +1,82 @@ #! /bin/sh -# Running `$0' as if it were installed. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh performs word splitting on ${1+"$@"}, which is contrary to + # our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# NLS nuisances. +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } +(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } +(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } +(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } +(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } +(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } +(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } +(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } + + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi -me=`echo "$0" | sed -e 's,.*[\\/],,'` +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + + +# Running `$0' as if it were installed. +me=`echo "$0" | sed -e 's,.*\\/,,'` exec @abs_top_builddir@/bin/$me --include @abs_top_builddir@/lib ${1+"$@"} --=-=-=--