From: Akim Demaille Date: Tue, 8 Feb 2000 11:39:46 +0000 (+0000) Subject: Clean up a bit the user interface. X-Git-Tag: autoconf-2.50~1208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a443a89e84d27105accba784b915b10fe30fd35f;p=thirdparty%2Fautoconf.git Clean up a bit the user interface. * autoconf.sh: Give your name while reporting errors. Don't spit --help for errors on arguments. * autoreconf.sh: Likewise. * autoheader.sh: Likewise. More temporary files that one can browse when debugging. Don't ${var}, just $var. Don't dump --help when the arguments are invalid. (config_h): Use the empty value instead of `undefined' to check that it is defined. * acspecific.m4: Formatting changes. --- diff --git a/ChangeLog b/ChangeLog index 7399a0491..ea64f58c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2000-02-08 Akim Demaille + + Clean up a bit the user interface. + + * autoconf.sh: Give your name while reporting errors. + Don't spit --help for errors on arguments. + * autoreconf.sh: Likewise. + * autoheader.sh: Likewise. + More temporary files that one can browse when debugging. + Don't ${var}, just $var. + Don't dump --help when the arguments are invalid. + (config_h): Use the empty value instead of `undefined' to check + that it is defined. + * acspecific.m4: Formatting changes. + 2000-02-08 Akim Demaille Introduce name spaces in libm4. diff --git a/acspecific.m4 b/acspecific.m4 index d181b7a07..38003abf6 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -1796,7 +1796,7 @@ AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, int main () { - exit (find_stack_direction() < 0); + exit (find_stack_direction () < 0); }], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1, ac_cv_c_stack_direction=0)]) AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) diff --git a/autoconf.in b/autoconf.in index b90992e29..3d3c5fa09 100644 --- a/autoconf.in +++ b/autoconf.in @@ -21,6 +21,8 @@ # With one arg, create a configure script on standard output from # the given template file. +me=`echo "$0" | sed -e 's,.*/,,'` + usage="\ Usage: autoconf [OPTION] ... [TEMPLATE-FILE] @@ -47,6 +49,9 @@ Copyright (C) 1992, 1993, 1994, 1996, 1999 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." +help="\ +Try \`$me --help' for more information." + # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). @@ -91,22 +96,22 @@ verbose=: while test $# -gt 0 ; do case "$1" in - -h | --help | --h* ) + --help | --h* | -h ) echo "$usage"; exit 0 ;; --localdir=* | --l*=* ) localdir=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; - -l | --localdir | --l*) + --localdir | --l* | -l ) shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } localdir="$1" shift ;; --macrodir=* | --m*=* ) AC_MACRODIR=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; - -m | --macrodir | --m* ) + --macrodir | --m* | -m ) shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } AC_MACRODIR="$1" shift ;; --install ) @@ -145,7 +150,10 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - echo "$usage" 1>&2; exit 1 ;; + exec 1>&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; * ) break ;; esac @@ -155,7 +163,10 @@ case $# in 0) infile=configure.in test $task = script && test "x$outfile" = x && outfile=configure;; 1) infile="$1" ;; - *) echo "$usage" >&2; exit 1 ;; + *) exec 1>&2 + echo "$me: invalid number of arguments." + echo "$help" + exit 1 ;; esac trap 'rm -f $tmpin $tmpout' 0 1 2 15 @@ -176,7 +187,7 @@ fi # Some non-GNU m4's don't reject the --help option, so give them /dev/null. case `$M4 --help < /dev/null 2>&1` in *reload-state*);; -*) echo Autoconf requires GNU m4 1.4 or later >&2; exit 1 ;; +*) echo "$me: Autoconf requires GNU m4 1.4 or later" >&2; exit 1 ;; esac run_m4="$M4 --reload $AC_MACRODIR/autoconf.m4f $use_localdir" @@ -311,7 +322,7 @@ EOF ln -s "$file" "$localdir/$filename" || cp "$file" "$localdir/$filename" || { - echo "$0: cannot link from $file to $localdir/$filename" >&2 + echo "$me: cannot link from $file to $localdir/$filename" >&2 exit 1 } fi @@ -351,7 +362,7 @@ EOF ## Unknown task ## ## ------------ ## - *)echo "$0: internal error: unknown task: $task" >&2 + *)echo "$me: internal error: unknown task: $task" >&2 exit 1 esac diff --git a/autoconf.sh b/autoconf.sh index b90992e29..3d3c5fa09 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -21,6 +21,8 @@ # With one arg, create a configure script on standard output from # the given template file. +me=`echo "$0" | sed -e 's,.*/,,'` + usage="\ Usage: autoconf [OPTION] ... [TEMPLATE-FILE] @@ -47,6 +49,9 @@ Copyright (C) 1992, 1993, 1994, 1996, 1999 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." +help="\ +Try \`$me --help' for more information." + # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). @@ -91,22 +96,22 @@ verbose=: while test $# -gt 0 ; do case "$1" in - -h | --help | --h* ) + --help | --h* | -h ) echo "$usage"; exit 0 ;; --localdir=* | --l*=* ) localdir=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; - -l | --localdir | --l*) + --localdir | --l* | -l ) shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } localdir="$1" shift ;; --macrodir=* | --m*=* ) AC_MACRODIR=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; - -m | --macrodir | --m* ) + --macrodir | --m* | -m ) shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } AC_MACRODIR="$1" shift ;; --install ) @@ -145,7 +150,10 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - echo "$usage" 1>&2; exit 1 ;; + exec 1>&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; * ) break ;; esac @@ -155,7 +163,10 @@ case $# in 0) infile=configure.in test $task = script && test "x$outfile" = x && outfile=configure;; 1) infile="$1" ;; - *) echo "$usage" >&2; exit 1 ;; + *) exec 1>&2 + echo "$me: invalid number of arguments." + echo "$help" + exit 1 ;; esac trap 'rm -f $tmpin $tmpout' 0 1 2 15 @@ -176,7 +187,7 @@ fi # Some non-GNU m4's don't reject the --help option, so give them /dev/null. case `$M4 --help < /dev/null 2>&1` in *reload-state*);; -*) echo Autoconf requires GNU m4 1.4 or later >&2; exit 1 ;; +*) echo "$me: Autoconf requires GNU m4 1.4 or later" >&2; exit 1 ;; esac run_m4="$M4 --reload $AC_MACRODIR/autoconf.m4f $use_localdir" @@ -311,7 +322,7 @@ EOF ln -s "$file" "$localdir/$filename" || cp "$file" "$localdir/$filename" || { - echo "$0: cannot link from $file to $localdir/$filename" >&2 + echo "$me: cannot link from $file to $localdir/$filename" >&2 exit 1 } fi @@ -351,7 +362,7 @@ EOF ## Unknown task ## ## ------------ ## - *)echo "$0: internal error: unknown task: $task" >&2 + *)echo "$me: internal error: unknown task: $task" >&2 exit 1 esac diff --git a/autoheader.in b/autoheader.in index 56fd735af..1e071bf66 100644 --- a/autoheader.in +++ b/autoheader.in @@ -23,6 +23,8 @@ # With one arg, create a header file on standard output from # the given template file. +me=`echo "$0" | sed -e 's,.*/,,'` + usage="\ Usage: autoheader [OPTION] ... [TEMPLATE-FILE] @@ -47,6 +49,9 @@ Copyright (C) 1992-1994, 1996, 1998-1999 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." +help="\ +Try \`$me --help' for more information." + # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). @@ -77,53 +82,59 @@ ac_LF_and_DOT=`echo; echo .` localdir=. debug=0 # Basename for temporary files. -ah_base=autoh$$ +ah_base=ah$$ while test $# -gt 0 ; do - case "${1}" in + case "$1" in -h | --help | --h* ) echo "$usage"; exit 0 ;; + --version | --v* ) + echo "$version"; exit 0 ;; -d | --debug | --d* ) - debug=1; shift ;; + debug=:; shift ;; --localdir=* | --l*=* ) - localdir=`echo \"${1}\" | sed -e 's/^[^=]*=//'` + localdir=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; -l | --localdir | --l*) shift - test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } - localdir="${1}" + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } + localdir=$1 shift ;; --macrodir=* | --m*=* ) - AC_MACRODIR=`echo \"${1}\" | sed -e 's/^[^=]*=//'` + AC_MACRODIR=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; -m | --macrodir | --m* ) shift - test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } - AC_MACRODIR="${1}" + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } + AC_MACRODIR=$1 shift ;; - --version | --v* ) - echo "$version"; exit 0 ;; -- ) # Stop option processing shift; break ;; - - ) # Use stdin as input. + - ) # Use stdin as input. break ;; -* ) - echo "${usage}" 1>&2; exit 1 ;; + exec 1>&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; * ) break ;; esac done acconfigs= -test -r $localdir/acconfig.h && acconfigs="${acconfigs} $localdir/acconfig.h" +test -r $localdir/acconfig.h && acconfigs="$acconfigs $localdir/acconfig.h" case $# in 0) infile=configure.in ;; 1) infile=$1 ;; - *) echo "$usage" >&2; exit 1 ;; + *) exec 1>&2 + echo "$me: invalid number of arguments." + echo "$help" + exit 1 ;; esac -config_h=undefined +config_h= syms= if test "$localdir" != .; then @@ -135,15 +146,15 @@ fi # Some non-GNU m4's don't reject the --help option, so give them /dev/null. case `$M4 --help < /dev/null 2>&1` in *reload-state*);; -*) echo Autoconf requires GNU m4 1.4 or later >&2; exit 1 ;; +*) echo "$me: Autoconf requires GNU m4 1.4 or later" >&2; exit 1 ;; esac run_m4="$M4 --reload $AC_MACRODIR/autoheader.m4f $use_localdir" -# Extract assignments of `ah_verbatim_SYMBOL' and `syms' from the -# modified autoconf processing of the input file. The sed hair is -# necessary to win for multi-line macro invocations. -$run_m4 $infile | - sed -n -e ' +# Extract assignments of `ah_verbatim_SYMBOL' from the modified +# autoconf processing of the input file. The sed hair is necessary to +# win for multi-line macro invocations. +$run_m4 $infile >$ah_base.exp +sed -n -e ' : again /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p /^@@@/{ @@ -151,9 +162,9 @@ $run_m4 $infile | n s/^/@@@/ b again - }' >$ah_base.decls + }' $ah_base.exp >$ah_base.decls . ./$ah_base.decls -if test $debug -eq 0; then rm ./$ah_base.decls; fi +$debug || rm $ah_base.exp $ah_base.decls # Make SYMS newline-separated rather than blank-separated, and remove dups. # Start each symbol with a blank (to match the blank after "#undef") @@ -163,10 +174,10 @@ syms=`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'` # Support "outfile[:infile]", defaulting infile="outfile.in". case "$config_h" in -undefined) echo "error: AC_CONFIG_HEADERS not found in $infile" >&2; exit 1 ;; -*:*) config_h_in=`echo "$config_h"|sed 's%.*:%%'` - config_h=`echo "$config_h"|sed 's%:.*%%'` ;; -*) config_h_in="${config_h}.in" ;; +"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2; exit 1 ;; +*:*) config_h_in=`echo "$config_h" | sed 's/.*://'` + config_h=`echo "$config_h" | sed 's/:.*//'` ;; +*) config_h_in="$config_h.in" ;; esac tmpout=$ah_base.out @@ -174,7 +185,7 @@ if test $debug -eq 0; then trap "rm -f $ah_base*; exit 1" 1 2 15; fi # Don't write "do not edit" -- it will get copied into the # config.h, which it's ok to edit. cat <$tmpout -/* ${config_h_in}. Generated automatically from $infile by autoheader. */ +/* $config_h_in. Generated automatically from $infile by autoheader. */ EOF test -r ${config_h}.top && cat ${config_h}.top >>$tmpout @@ -241,7 +252,7 @@ if test -n "$syms"; then if grep "^#[a-z]*[ ][ ]*$sym[ ]*$" $tmpout >/dev/null; then : # All is well. else - echo "$0: No template for symbol \`${sym}'" >&2 + echo "$0: No template for symbol \`$sym'" >&2 status=1 fi done @@ -251,11 +262,11 @@ fi if test $status -eq 0; then if test $# -eq 0; then # Output is a file - if test -f ${config_h_in} && cmp -s $tmpout ${config_h_in}; then + if test -f $config_h_in && cmp -s $tmpout $config_h_in; then # File didn't change, so don't update its mod time. echo "$0: $config_h_in is unchanged" >&2 else - mv -f $tmpout ${config_h_in} + mv -f $tmpout $config_h_in fi else # Output is stdout diff --git a/autoheader.sh b/autoheader.sh index 56fd735af..1e071bf66 100644 --- a/autoheader.sh +++ b/autoheader.sh @@ -23,6 +23,8 @@ # With one arg, create a header file on standard output from # the given template file. +me=`echo "$0" | sed -e 's,.*/,,'` + usage="\ Usage: autoheader [OPTION] ... [TEMPLATE-FILE] @@ -47,6 +49,9 @@ Copyright (C) 1992-1994, 1996, 1998-1999 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." +help="\ +Try \`$me --help' for more information." + # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). @@ -77,53 +82,59 @@ ac_LF_and_DOT=`echo; echo .` localdir=. debug=0 # Basename for temporary files. -ah_base=autoh$$ +ah_base=ah$$ while test $# -gt 0 ; do - case "${1}" in + case "$1" in -h | --help | --h* ) echo "$usage"; exit 0 ;; + --version | --v* ) + echo "$version"; exit 0 ;; -d | --debug | --d* ) - debug=1; shift ;; + debug=:; shift ;; --localdir=* | --l*=* ) - localdir=`echo \"${1}\" | sed -e 's/^[^=]*=//'` + localdir=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; -l | --localdir | --l*) shift - test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } - localdir="${1}" + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } + localdir=$1 shift ;; --macrodir=* | --m*=* ) - AC_MACRODIR=`echo \"${1}\" | sed -e 's/^[^=]*=//'` + AC_MACRODIR=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; -m | --macrodir | --m* ) shift - test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } - AC_MACRODIR="${1}" + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } + AC_MACRODIR=$1 shift ;; - --version | --v* ) - echo "$version"; exit 0 ;; -- ) # Stop option processing shift; break ;; - - ) # Use stdin as input. + - ) # Use stdin as input. break ;; -* ) - echo "${usage}" 1>&2; exit 1 ;; + exec 1>&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; * ) break ;; esac done acconfigs= -test -r $localdir/acconfig.h && acconfigs="${acconfigs} $localdir/acconfig.h" +test -r $localdir/acconfig.h && acconfigs="$acconfigs $localdir/acconfig.h" case $# in 0) infile=configure.in ;; 1) infile=$1 ;; - *) echo "$usage" >&2; exit 1 ;; + *) exec 1>&2 + echo "$me: invalid number of arguments." + echo "$help" + exit 1 ;; esac -config_h=undefined +config_h= syms= if test "$localdir" != .; then @@ -135,15 +146,15 @@ fi # Some non-GNU m4's don't reject the --help option, so give them /dev/null. case `$M4 --help < /dev/null 2>&1` in *reload-state*);; -*) echo Autoconf requires GNU m4 1.4 or later >&2; exit 1 ;; +*) echo "$me: Autoconf requires GNU m4 1.4 or later" >&2; exit 1 ;; esac run_m4="$M4 --reload $AC_MACRODIR/autoheader.m4f $use_localdir" -# Extract assignments of `ah_verbatim_SYMBOL' and `syms' from the -# modified autoconf processing of the input file. The sed hair is -# necessary to win for multi-line macro invocations. -$run_m4 $infile | - sed -n -e ' +# Extract assignments of `ah_verbatim_SYMBOL' from the modified +# autoconf processing of the input file. The sed hair is necessary to +# win for multi-line macro invocations. +$run_m4 $infile >$ah_base.exp +sed -n -e ' : again /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p /^@@@/{ @@ -151,9 +162,9 @@ $run_m4 $infile | n s/^/@@@/ b again - }' >$ah_base.decls + }' $ah_base.exp >$ah_base.decls . ./$ah_base.decls -if test $debug -eq 0; then rm ./$ah_base.decls; fi +$debug || rm $ah_base.exp $ah_base.decls # Make SYMS newline-separated rather than blank-separated, and remove dups. # Start each symbol with a blank (to match the blank after "#undef") @@ -163,10 +174,10 @@ syms=`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'` # Support "outfile[:infile]", defaulting infile="outfile.in". case "$config_h" in -undefined) echo "error: AC_CONFIG_HEADERS not found in $infile" >&2; exit 1 ;; -*:*) config_h_in=`echo "$config_h"|sed 's%.*:%%'` - config_h=`echo "$config_h"|sed 's%:.*%%'` ;; -*) config_h_in="${config_h}.in" ;; +"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2; exit 1 ;; +*:*) config_h_in=`echo "$config_h" | sed 's/.*://'` + config_h=`echo "$config_h" | sed 's/:.*//'` ;; +*) config_h_in="$config_h.in" ;; esac tmpout=$ah_base.out @@ -174,7 +185,7 @@ if test $debug -eq 0; then trap "rm -f $ah_base*; exit 1" 1 2 15; fi # Don't write "do not edit" -- it will get copied into the # config.h, which it's ok to edit. cat <$tmpout -/* ${config_h_in}. Generated automatically from $infile by autoheader. */ +/* $config_h_in. Generated automatically from $infile by autoheader. */ EOF test -r ${config_h}.top && cat ${config_h}.top >>$tmpout @@ -241,7 +252,7 @@ if test -n "$syms"; then if grep "^#[a-z]*[ ][ ]*$sym[ ]*$" $tmpout >/dev/null; then : # All is well. else - echo "$0: No template for symbol \`${sym}'" >&2 + echo "$0: No template for symbol \`$sym'" >&2 status=1 fi done @@ -251,11 +262,11 @@ fi if test $status -eq 0; then if test $# -eq 0; then # Output is a file - if test -f ${config_h_in} && cmp -s $tmpout ${config_h_in}; then + if test -f $config_h_in && cmp -s $tmpout $config_h_in; then # File didn't change, so don't update its mod time. echo "$0: $config_h_in is unchanged" >&2 else - mv -f $tmpout ${config_h_in} + mv -f $tmpout $config_h_in fi else # Output is stdout diff --git a/autoreconf.in b/autoreconf.in index c337a4604..9daff96c7 100644 --- a/autoreconf.in +++ b/autoreconf.in @@ -17,6 +17,8 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. +me=`echo "$0" | sed -e 's,.*/,,'` + usage="\ Usage: autoreconf [OPTION] ... [TEMPLATE-FILE] @@ -52,6 +54,9 @@ Copyright (C) 1994, 1999 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." +help="\ +Try \`$me --help' for more information." + localdir= verbose=: force=no @@ -62,22 +67,22 @@ test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@ while test $# -gt 0; do case "$1" in - -h | --help | --h*) + --help | --h* | -h ) echo "$usage"; exit 0 ;; --localdir=* | --l*=* ) localdir=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; - -l | --localdir | --l*) + --localdir | --l* | -l ) shift - test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } localdir="${1}" shift ;; --macrodir=* | --m*=* ) AC_MACRODIR=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; - -m | --macrodir | --m*) + --macrodir | --m* | -m ) shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + test $# -eq 0 && { echo "help" 1>&2; exit 1; } AC_MACRODIR="$1" shift ;; -v | --verbose | --verb*) @@ -92,13 +97,20 @@ while test $# -gt 0; do automake_deps=$1; shift ;; --) # Stop option processing. shift; break ;; - -*) echo "$usage" 1>&2; exit 1 ;; + -*) + exec 1>&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; *) break ;; esac done if test $# -ne 0; then - echo "$usage" 1>&2; exit 1 + exec 1>&2 + echo "$me: invalid number of arguments." + echo "$help" + exit 1 ;; fi # The paths to the autoconf and autoheader scripts, at the top of the tree. diff --git a/autoreconf.sh b/autoreconf.sh index c337a4604..9daff96c7 100644 --- a/autoreconf.sh +++ b/autoreconf.sh @@ -17,6 +17,8 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. +me=`echo "$0" | sed -e 's,.*/,,'` + usage="\ Usage: autoreconf [OPTION] ... [TEMPLATE-FILE] @@ -52,6 +54,9 @@ Copyright (C) 1994, 1999 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." +help="\ +Try \`$me --help' for more information." + localdir= verbose=: force=no @@ -62,22 +67,22 @@ test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@ while test $# -gt 0; do case "$1" in - -h | --help | --h*) + --help | --h* | -h ) echo "$usage"; exit 0 ;; --localdir=* | --l*=* ) localdir=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; - -l | --localdir | --l*) + --localdir | --l* | -l ) shift - test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } localdir="${1}" shift ;; --macrodir=* | --m*=* ) AC_MACRODIR=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; - -m | --macrodir | --m*) + --macrodir | --m* | -m ) shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + test $# -eq 0 && { echo "help" 1>&2; exit 1; } AC_MACRODIR="$1" shift ;; -v | --verbose | --verb*) @@ -92,13 +97,20 @@ while test $# -gt 0; do automake_deps=$1; shift ;; --) # Stop option processing. shift; break ;; - -*) echo "$usage" 1>&2; exit 1 ;; + -*) + exec 1>&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; *) break ;; esac done if test $# -ne 0; then - echo "$usage" 1>&2; exit 1 + exec 1>&2 + echo "$me: invalid number of arguments." + echo "$help" + exit 1 ;; fi # The paths to the autoconf and autoheader scripts, at the top of the tree. diff --git a/bin/autoconf.in b/bin/autoconf.in index b90992e29..3d3c5fa09 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -21,6 +21,8 @@ # With one arg, create a configure script on standard output from # the given template file. +me=`echo "$0" | sed -e 's,.*/,,'` + usage="\ Usage: autoconf [OPTION] ... [TEMPLATE-FILE] @@ -47,6 +49,9 @@ Copyright (C) 1992, 1993, 1994, 1996, 1999 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." +help="\ +Try \`$me --help' for more information." + # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). @@ -91,22 +96,22 @@ verbose=: while test $# -gt 0 ; do case "$1" in - -h | --help | --h* ) + --help | --h* | -h ) echo "$usage"; exit 0 ;; --localdir=* | --l*=* ) localdir=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; - -l | --localdir | --l*) + --localdir | --l* | -l ) shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } localdir="$1" shift ;; --macrodir=* | --m*=* ) AC_MACRODIR=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; - -m | --macrodir | --m* ) + --macrodir | --m* | -m ) shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } AC_MACRODIR="$1" shift ;; --install ) @@ -145,7 +150,10 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - echo "$usage" 1>&2; exit 1 ;; + exec 1>&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; * ) break ;; esac @@ -155,7 +163,10 @@ case $# in 0) infile=configure.in test $task = script && test "x$outfile" = x && outfile=configure;; 1) infile="$1" ;; - *) echo "$usage" >&2; exit 1 ;; + *) exec 1>&2 + echo "$me: invalid number of arguments." + echo "$help" + exit 1 ;; esac trap 'rm -f $tmpin $tmpout' 0 1 2 15 @@ -176,7 +187,7 @@ fi # Some non-GNU m4's don't reject the --help option, so give them /dev/null. case `$M4 --help < /dev/null 2>&1` in *reload-state*);; -*) echo Autoconf requires GNU m4 1.4 or later >&2; exit 1 ;; +*) echo "$me: Autoconf requires GNU m4 1.4 or later" >&2; exit 1 ;; esac run_m4="$M4 --reload $AC_MACRODIR/autoconf.m4f $use_localdir" @@ -311,7 +322,7 @@ EOF ln -s "$file" "$localdir/$filename" || cp "$file" "$localdir/$filename" || { - echo "$0: cannot link from $file to $localdir/$filename" >&2 + echo "$me: cannot link from $file to $localdir/$filename" >&2 exit 1 } fi @@ -351,7 +362,7 @@ EOF ## Unknown task ## ## ------------ ## - *)echo "$0: internal error: unknown task: $task" >&2 + *)echo "$me: internal error: unknown task: $task" >&2 exit 1 esac diff --git a/bin/autoheader.in b/bin/autoheader.in index 56fd735af..1e071bf66 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -23,6 +23,8 @@ # With one arg, create a header file on standard output from # the given template file. +me=`echo "$0" | sed -e 's,.*/,,'` + usage="\ Usage: autoheader [OPTION] ... [TEMPLATE-FILE] @@ -47,6 +49,9 @@ Copyright (C) 1992-1994, 1996, 1998-1999 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." +help="\ +Try \`$me --help' for more information." + # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). @@ -77,53 +82,59 @@ ac_LF_and_DOT=`echo; echo .` localdir=. debug=0 # Basename for temporary files. -ah_base=autoh$$ +ah_base=ah$$ while test $# -gt 0 ; do - case "${1}" in + case "$1" in -h | --help | --h* ) echo "$usage"; exit 0 ;; + --version | --v* ) + echo "$version"; exit 0 ;; -d | --debug | --d* ) - debug=1; shift ;; + debug=:; shift ;; --localdir=* | --l*=* ) - localdir=`echo \"${1}\" | sed -e 's/^[^=]*=//'` + localdir=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; -l | --localdir | --l*) shift - test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } - localdir="${1}" + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } + localdir=$1 shift ;; --macrodir=* | --m*=* ) - AC_MACRODIR=`echo \"${1}\" | sed -e 's/^[^=]*=//'` + AC_MACRODIR=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; -m | --macrodir | --m* ) shift - test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } - AC_MACRODIR="${1}" + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } + AC_MACRODIR=$1 shift ;; - --version | --v* ) - echo "$version"; exit 0 ;; -- ) # Stop option processing shift; break ;; - - ) # Use stdin as input. + - ) # Use stdin as input. break ;; -* ) - echo "${usage}" 1>&2; exit 1 ;; + exec 1>&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; * ) break ;; esac done acconfigs= -test -r $localdir/acconfig.h && acconfigs="${acconfigs} $localdir/acconfig.h" +test -r $localdir/acconfig.h && acconfigs="$acconfigs $localdir/acconfig.h" case $# in 0) infile=configure.in ;; 1) infile=$1 ;; - *) echo "$usage" >&2; exit 1 ;; + *) exec 1>&2 + echo "$me: invalid number of arguments." + echo "$help" + exit 1 ;; esac -config_h=undefined +config_h= syms= if test "$localdir" != .; then @@ -135,15 +146,15 @@ fi # Some non-GNU m4's don't reject the --help option, so give them /dev/null. case `$M4 --help < /dev/null 2>&1` in *reload-state*);; -*) echo Autoconf requires GNU m4 1.4 or later >&2; exit 1 ;; +*) echo "$me: Autoconf requires GNU m4 1.4 or later" >&2; exit 1 ;; esac run_m4="$M4 --reload $AC_MACRODIR/autoheader.m4f $use_localdir" -# Extract assignments of `ah_verbatim_SYMBOL' and `syms' from the -# modified autoconf processing of the input file. The sed hair is -# necessary to win for multi-line macro invocations. -$run_m4 $infile | - sed -n -e ' +# Extract assignments of `ah_verbatim_SYMBOL' from the modified +# autoconf processing of the input file. The sed hair is necessary to +# win for multi-line macro invocations. +$run_m4 $infile >$ah_base.exp +sed -n -e ' : again /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p /^@@@/{ @@ -151,9 +162,9 @@ $run_m4 $infile | n s/^/@@@/ b again - }' >$ah_base.decls + }' $ah_base.exp >$ah_base.decls . ./$ah_base.decls -if test $debug -eq 0; then rm ./$ah_base.decls; fi +$debug || rm $ah_base.exp $ah_base.decls # Make SYMS newline-separated rather than blank-separated, and remove dups. # Start each symbol with a blank (to match the blank after "#undef") @@ -163,10 +174,10 @@ syms=`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'` # Support "outfile[:infile]", defaulting infile="outfile.in". case "$config_h" in -undefined) echo "error: AC_CONFIG_HEADERS not found in $infile" >&2; exit 1 ;; -*:*) config_h_in=`echo "$config_h"|sed 's%.*:%%'` - config_h=`echo "$config_h"|sed 's%:.*%%'` ;; -*) config_h_in="${config_h}.in" ;; +"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2; exit 1 ;; +*:*) config_h_in=`echo "$config_h" | sed 's/.*://'` + config_h=`echo "$config_h" | sed 's/:.*//'` ;; +*) config_h_in="$config_h.in" ;; esac tmpout=$ah_base.out @@ -174,7 +185,7 @@ if test $debug -eq 0; then trap "rm -f $ah_base*; exit 1" 1 2 15; fi # Don't write "do not edit" -- it will get copied into the # config.h, which it's ok to edit. cat <$tmpout -/* ${config_h_in}. Generated automatically from $infile by autoheader. */ +/* $config_h_in. Generated automatically from $infile by autoheader. */ EOF test -r ${config_h}.top && cat ${config_h}.top >>$tmpout @@ -241,7 +252,7 @@ if test -n "$syms"; then if grep "^#[a-z]*[ ][ ]*$sym[ ]*$" $tmpout >/dev/null; then : # All is well. else - echo "$0: No template for symbol \`${sym}'" >&2 + echo "$0: No template for symbol \`$sym'" >&2 status=1 fi done @@ -251,11 +262,11 @@ fi if test $status -eq 0; then if test $# -eq 0; then # Output is a file - if test -f ${config_h_in} && cmp -s $tmpout ${config_h_in}; then + if test -f $config_h_in && cmp -s $tmpout $config_h_in; then # File didn't change, so don't update its mod time. echo "$0: $config_h_in is unchanged" >&2 else - mv -f $tmpout ${config_h_in} + mv -f $tmpout $config_h_in fi else # Output is stdout diff --git a/bin/autoreconf.in b/bin/autoreconf.in index c337a4604..9daff96c7 100644 --- a/bin/autoreconf.in +++ b/bin/autoreconf.in @@ -17,6 +17,8 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. +me=`echo "$0" | sed -e 's,.*/,,'` + usage="\ Usage: autoreconf [OPTION] ... [TEMPLATE-FILE] @@ -52,6 +54,9 @@ Copyright (C) 1994, 1999 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." +help="\ +Try \`$me --help' for more information." + localdir= verbose=: force=no @@ -62,22 +67,22 @@ test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@ while test $# -gt 0; do case "$1" in - -h | --help | --h*) + --help | --h* | -h ) echo "$usage"; exit 0 ;; --localdir=* | --l*=* ) localdir=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; - -l | --localdir | --l*) + --localdir | --l* | -l ) shift - test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } + test $# -eq 0 && { echo "$help" 1>&2; exit 1; } localdir="${1}" shift ;; --macrodir=* | --m*=* ) AC_MACRODIR=`echo "$1" | sed -e 's/^[^=]*=//'` shift ;; - -m | --macrodir | --m*) + --macrodir | --m* | -m ) shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + test $# -eq 0 && { echo "help" 1>&2; exit 1; } AC_MACRODIR="$1" shift ;; -v | --verbose | --verb*) @@ -92,13 +97,20 @@ while test $# -gt 0; do automake_deps=$1; shift ;; --) # Stop option processing. shift; break ;; - -*) echo "$usage" 1>&2; exit 1 ;; + -*) + exec 1>&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; *) break ;; esac done if test $# -ne 0; then - echo "$usage" 1>&2; exit 1 + exec 1>&2 + echo "$me: invalid number of arguments." + echo "$help" + exit 1 ;; fi # The paths to the autoconf and autoheader scripts, at the top of the tree. diff --git a/configure b/configure index 39a674146..81930cc40 100755 --- a/configure +++ b/configure @@ -12,6 +12,32 @@ ac_arg_enable_help= ac_arg_var_help= ac_default_prefix=/usr/local # Any additions from configure.in: +# Factorizing default headers for most tests. +# Mandatory included if its is not used. +ac_includes_default="\ +#include +#include +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#else +# if HAVE_STRINGS_H +# include +# endif +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -586,7 +612,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install... $ac_c" 1>&6 -echo "configure:590: checking for a BSD compatible install" 1>&5 +echo "configure:616: checking for a BSD compatible install" 1>&5 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -643,7 +669,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane... $ac_c" 1>&6 -echo "configure:647: checking whether build environment is sane" 1>&5 +echo "configure:673: checking whether build environment is sane" 1>&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -700,7 +726,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}... $ac_c" 1>&6 -echo "configure:704: checking whether ${MAKE-make} sets \${MAKE}" 1>&5 +echo "configure:730: checking whether ${MAKE-make} sets \${MAKE}" 1>&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -743,7 +769,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal... $ac_c" 1>&6 -echo "configure:747: checking for working aclocal" 1>&5 +echo "configure:773: checking for working aclocal" 1>&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -756,7 +782,7 @@ else fi echo $ac_n "checking for working autoconf... $ac_c" 1>&6 -echo "configure:760: checking for working autoconf" 1>&5 +echo "configure:786: checking for working autoconf" 1>&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -769,7 +795,7 @@ else fi echo $ac_n "checking for working automake... $ac_c" 1>&6 -echo "configure:773: checking for working automake" 1>&5 +echo "configure:799: checking for working automake" 1>&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -782,7 +808,7 @@ else fi echo $ac_n "checking for working autoheader... $ac_c" 1>&6 -echo "configure:786: checking for working autoheader" 1>&5 +echo "configure:812: checking for working autoheader" 1>&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -795,7 +821,7 @@ else fi echo $ac_n "checking for working makeinfo... $ac_c" 1>&6 -echo "configure:799: checking for working makeinfo" 1>&5 +echo "configure:825: checking for working makeinfo" 1>&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -810,7 +836,7 @@ fi AT_TESTPATH=.. echo $ac_n "checking how to suppress newlines using echo... $ac_c" 1>&6 -echo "configure:814: checking how to suppress newlines using echo" 1>&5 +echo "configure:840: checking how to suppress newlines using echo" 1>&5 if test "${fp_cv_prog_echo_nonl+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -839,7 +865,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:843: checking for $ac_word" 1>&5 +echo "configure:869: checking for $ac_word" 1>&5 if test "${ac_cv_path_M4+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -873,7 +899,7 @@ done test -n "$M4" || M4="m4" echo $ac_n "checking whether m4 supports frozen files... $ac_c" 1>&6 -echo "configure:877: checking whether m4 supports frozen files" 1>&5 +echo "configure:903: checking whether m4 supports frozen files" 1>&5 if test "${ac_cv_prog_gnu_m4+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -894,7 +920,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:898: checking for $ac_word" 1>&5 +echo "configure:924: checking for $ac_word" 1>&5 if test "${ac_cv_prog_AWK+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -924,7 +950,7 @@ test -n "$AWK" && break done echo $ac_n "checking for working help2man... $ac_c" 1>&6 -echo "configure:928: checking for working help2man" 1>&5 +echo "configure:954: checking for working help2man" 1>&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -939,7 +965,7 @@ fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:943: checking for $ac_word" 1>&5 +echo "configure:969: checking for $ac_word" 1>&5 if test "${ac_cv_path_PERL+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -987,7 +1013,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install... $ac_c" 1>&6 -echo "configure:991: checking for a BSD compatible install" 1>&5 +echo "configure:1017: checking for a BSD compatible install" 1>&5 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1257,9 +1283,12 @@ cat >>$CONFIG_STATUS <\$ac_cs_root.subs <<\\CEOF +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/%@/@@/; s/@%/@@/; s/%;t t\$/@;t t/; /@;t t\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@;t t\$/%;t t/' >\$ac_cs_root.subs <<\\CEOF s%@SHELL@%$SHELL%;t t s%@CFLAGS@%$CFLAGS%;t t s%@CPPFLAGS@%$CPPFLAGS%;t t @@ -1307,47 +1336,47 @@ CEOF EOF -cat >>$CONFIG_STATUS <<\EOF -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_lines=48 -ac_sed_frag=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_lines # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $ac_cs_root.subs >$ac_cs_root.sfrag - else - sed "${ac_end}q" $ac_cs_root.subs >$ac_cs_root.sfrag - fi - if test ! -s $ac_cs_root.sfrag; then - ac_more_lines=false - rm -f $ac_cs_root.sfrag - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $ac_cs_root.sfrag) >$ac_cs_root.s$ac_sed_frag - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $ac_cs_root.s$ac_sed_frag" + cat >>$CONFIG_STATUS <<\EOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds="" + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $ac_cs_root.subs >$ac_cs_root.sfrag + else + sed "${ac_end}q" $ac_cs_root.subs >$ac_cs_root.sfrag + fi + if test ! -s $ac_cs_root.sfrag; then + ac_more_lines=false + rm -f $ac_cs_root.sfrag else - ac_sed_cmds="$ac_sed_cmds | sed -f $ac_cs_root.s$ac_sed_frag" + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $ac_cs_root.sfrag) >$ac_cs_root.s$ac_sed_frag + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $ac_cs_root.s$ac_sed_frag" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $ac_cs_root.s$ac_sed_frag" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi +fi # test -n "$CONFIG_FILES" EOF - cat >>$CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". @@ -1388,16 +1417,18 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then echo creating "$ac_file" rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + configure_input="Generated automatically from `echo $ac_file_in | + sed 's%.*/%%'` by configure." case "$ac_file" in *[Mm]akefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac -# Don't redirect the output to AC_FILE directly: use `mv' so that updating -# is atomic, and doesn't need trapping. - ac_file_inputs=`echo $ac_file_in | sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + # Don't redirect the output to AC_FILE directly: use `mv' so that updating + # is atomic, and doesn't need trapping. + ac_file_inputs=`echo $ac_file_in | + sed -e "s%^%$ac_given_srcdir/%;s%:% $ac_given_srcdir/%g"` for ac_file_input in $ac_file_inputs; do test -f "$ac_file_input" || @@ -1424,8 +1455,9 @@ rm -f $ac_cs_root.s* EOF cat >>$CONFIG_STATUS <