autoconf/bin/autoconf.in
Paul Eggert 66d5f073b5 2002-07-17 Mark D. Roth <roth@feep.net>
* configure.ac: Add --enable-site-macro-dir option.
	* bin/Makefile.am: Expand @SITE_MACRO_DIR@.
	* bin/autom4te.in: Add --prepend-include, --include-envvar, and
	--site-macro-subdir options.
	* bin/autoconf.in: Add --prepend-include option.
	* bin/autoheader.in: Add --prepend-include option.
	* bin/autoreconf.in: Add --prepend-include option.
	* bin/autoscan.in: Add --prepend-include option.
	* bin/autoupdate.in: Add --prepend-include option.
	* doc/autoconf.texi: Document use of $AC_MACRO_PATH and site
	macro directory, remove note that include path directories are
	used in reverse order, and document --prepend-include option.
	* lib/autom4te.in: Use --prepend-include instead of --include.
	* tests/wrapsh.in: Use --prepend-include instead of --include.
2002-07-17 08:30:42 +00:00

288 lines
8.8 KiB
Bash

#! /bin/sh
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x 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
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'`
# 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
-B, --prepend-include=DIR prepend directory DIR to search path
-I, --include=DIR append directory DIR to search path
-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 <bug-autoconf@gnu.org>."
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 ||
$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."
exit_missing_arg="\
echo \"$me: option \\\`\$1' requires an argument\" >&2
echo \"\$help\" >&2
exit 1"
# Variables.
: ${AUTOM4TE=@autom4te-name@}
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=:
# 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?* | \
--prepend-include=* | -B?* | \
--warnings=* | -W?* )
AUTOM4TE="$AUTOM4TE $1"; shift ;;
# Options with separated arg passed as is to autom4te.
--include | -I | \
--prepend-include | -B | \
--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=-
# Run autom4te with expansion.
eval set \$AUTOM4TE --language=autoconf --output=\$outfile "$traces" \$infile
$verbose "$me: running $*" >&2
exec "$@"