* 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 <akim@epita.fr>
+
+ 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 <akim@epita.fr>
Introduce name spaces in libm4.
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)
# 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]
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).
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 )
- ) # 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
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
# 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"
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
## Unknown task ##
## ------------ ##
- *)echo "$0: internal error: unknown task: $task" >&2
+ *)echo "$me: internal error: unknown task: $task" >&2
exit 1
esac
# 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]
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).
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 )
- ) # 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
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
# 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"
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
## Unknown task ##
## ------------ ##
- *)echo "$0: internal error: unknown task: $task" >&2
+ *)echo "$me: internal error: unknown task: $task" >&2
exit 1
esac
# 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]
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).
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
# 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
/^@@@/{
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")
# 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
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
cat <<EOF >$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
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
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
# 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]
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).
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
# 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
/^@@@/{
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")
# 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
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
cat <<EOF >$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
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
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
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
+me=`echo "$0" | sed -e 's,.*/,,'`
+
usage="\
Usage: autoreconf [OPTION] ... [TEMPLATE-FILE]
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
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*)
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.
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
+me=`echo "$0" | sed -e 's,.*/,,'`
+
usage="\
Usage: autoreconf [OPTION] ... [TEMPLATE-FILE]
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
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*)
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.
# 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]
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).
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 )
- ) # 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
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
# 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"
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
## Unknown task ##
## ------------ ##
- *)echo "$0: internal error: unknown task: $task" >&2
+ *)echo "$me: internal error: unknown task: $task" >&2
exit 1
esac
# 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]
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).
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
# 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
/^@@@/{
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")
# 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
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
cat <<EOF >$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
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
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
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
+me=`echo "$0" | sed -e 's,.*/,,'`
+
usage="\
Usage: autoreconf [OPTION] ... [TEMPLATE-FILE]
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
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*)
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.
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 <stdio.h>
+#include <sys/types.h>
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#else
+# if HAVE_STRINGS_H
+# include <strings.h>
+# endif
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
# Initialize some variables set by options.
# The variables have the same names as the options, with
# 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
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
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
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.
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.
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.
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.
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.
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
# 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
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
# 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
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.
# 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
# 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
# CONFIG_FILES section.
#
-# 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
+# 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
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".
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" ||
EOF
cat >>$CONFIG_STATUS <<EOF
+
#
-# AC_OUTPUT_COMMANDS section.
+# CONFIG_COMMANDS section.
#
EOF
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)