Fix typo in previous patch.
[autoconf.git] / bin / autoconf.as
blobaa7fe6b5c79ea899151df14c46312f8d179a265e
1 AS_INIT[]dnl -*- shell-script -*-
2 m4_divert_push([HEADER-COPYRIGHT])dnl
3 # @configure_input@
4 # autoconf -- create `configure' using m4 macros
6 # Copyright (C) 1992, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003,
7 # 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
8 # Inc.
10 # This program is free software: you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation, either version 3 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 m4_divert_pop([HEADER-COPYRIGHT])dnl back to BODY
24 AS_ME_PREPARE[]dnl
26 usage=["\
27 Usage: $0 [OPTION]... [TEMPLATE-FILE]
29 Generate a configuration script from a TEMPLATE-FILE if given, or
30 \`configure.ac' if present, or else \`configure.in'. Output is sent
31 to the standard output if TEMPLATE-FILE is given, else into
32 \`configure'.
34 Operation modes:
35 -h, --help print this help, then exit
36 -V, --version print version number, then exit
37 -v, --verbose verbosely report processing
38 -d, --debug don't remove temporary files
39 -f, --force consider all files obsolete
40 -o, --output=FILE save output in FILE (stdout is the default)
41 -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
43 Warning categories include:
44 \`cross' cross compilation issues
45 \`obsolete' obsolete constructs
46 \`syntax' dubious syntactic constructs
47 \`all' all the warnings
48 \`no-CATEGORY' turn off the warnings on CATEGORY
49 \`none' turn off all the warnings
50 \`error' warnings are error
52 The environment variables \`M4' and \`WARNINGS' are honored.
54 Library directories:
55 -B, --prepend-include=DIR prepend directory DIR to search path
56 -I, --include=DIR append directory DIR to search path
58 Tracing:
59 -t, --trace=MACRO[:FORMAT] report the list of calls to MACRO
60 -i, --initialization also trace Autoconf's initialization process
62 In tracing mode, no configuration script is created. FORMAT defaults
63 to \`\$f:\$l:\$n:\$%'; see \`autom4te --help' for information about FORMAT.
65 Report bugs to <bug-autoconf@gnu.org>.
66 GNU Autoconf home page: <http://www.gnu.org/software/autoconf/>.
67 General help using GNU software: <http://www.gnu.org/gethelp/>."]
69 version=["\
70 autoconf (@PACKAGE_NAME@) @VERSION@
71 Copyright (C) @RELEASE_YEAR@ Free Software Foundation, Inc.
72 License GPLv3+/Autoconf: GNU GPL version 3 or later
73 <http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
74 This is free software: you are free to change and redistribute it.
75 There is NO WARRANTY, to the extent permitted by law.
77 Written by David J. MacKenzie and Akim Demaille."]
79 help="\
80 Try \`$as_me --help' for more information."
82 exit_missing_arg='
83 m4_bpatsubst([AS_ERROR([option `$[1]' requires an argument$as_nl$help])],
84 ['], ['\\''])'
85 # restore font-lock: '
87 # Variables.
88 : ${AUTOM4TE='@bindir@/@autom4te-name@'}
89 autom4te_options=
90 outfile=
91 verbose=false
93 # Parse command line.
94 while test $# -gt 0 ; do
95 option=[`expr "x$1" : 'x\(--[^=]*\)' \| \
96 "x$1" : 'x\(-.\)'`]
97 optarg=[`expr "x$1" : 'x--[^=]*=\(.*\)' \| \
98 "x$1" : 'x-.\(.*\)'`]
99 case $1 in
100 --version | -V )
101 echo "$version" ; exit ;;
102 --help | -h )
103 AS_ECHO(["$usage"]); exit ;;
105 --verbose | -v )
106 verbose=:
107 autom4te_options="$autom4te_options $1"; shift ;;
109 # Arguments passed as is to autom4te.
110 --debug | -d | \
111 --force | -f | \
112 --include=* | -I?* | \
113 --prepend-include=* | -B?* | \
114 --warnings=* | -W?* )
115 case $1 in
116 *\'*) arg=`AS_ECHO(["$1"]) | sed "s/'/'\\\\\\\\''/g"` ;; #'
117 *) arg=$1 ;;
118 esac
119 autom4te_options="$autom4te_options '$arg'"; shift ;;
120 # Options with separated arg passed as is to autom4te.
121 --include | -I | \
122 --prepend-include | -B | \
123 --warnings | -W )
124 test $# = 1 && eval "$exit_missing_arg"
125 case $2 in
126 *\'*) arg=`AS_ECHO(["$2"]) | sed "s/'/'\\\\\\\\''/g"` ;; #'
127 *) arg=$2 ;;
128 esac
129 autom4te_options="$autom4te_options $option '$arg'"
130 shift; shift ;;
132 --trace=* | -t?* )
133 traces="$traces --trace='"`AS_ECHO(["$optarg"]) | sed "s/'/'\\\\\\\\''/g"`"'"
134 shift ;;
135 --trace | -t )
136 test $# = 1 && eval "$exit_missing_arg"
137 traces="$traces --trace='"`AS_ECHO(["$[2]"]) | sed "s/'/'\\\\\\\\''/g"`"'"
138 shift; shift ;;
139 --initialization | -i )
140 autom4te_options="$autom4te_options --melt"
141 shift;;
143 --output=* | -o?* )
144 outfile=$optarg
145 shift ;;
146 --output | -o )
147 test $# = 1 && eval "$exit_missing_arg"
148 outfile=$2
149 shift; shift ;;
151 -- ) # Stop option processing
152 shift; break ;;
153 - ) # Use stdin as input.
154 break ;;
155 -* )
156 exec >&2
157 AS_ERROR([invalid option `$[1]'$as_nl$help]) ;; #`
159 break ;;
160 esac
161 done
163 # Find the input file.
164 case $# in
166 if test -f configure.ac; then
167 if test -f configure.in; then
168 AS_ECHO(["$as_me: warning: both \`configure.ac' and \`configure.in' are present."]) >&2
169 AS_ECHO(["$as_me: warning: proceeding with \`configure.ac'."]) >&2
171 infile=configure.ac
172 elif test -f configure.in; then
173 infile=configure.in
174 else
175 AS_ERROR([no input file])
177 test -z "$traces" && test -z "$outfile" && outfile=configure;;
179 infile=$1 ;;
180 *) exec >&2
181 AS_ERROR([invalid number of arguments$as_nl$help]) ;;
182 esac
184 # Unless specified, the output is stdout.
185 test -z "$outfile" && outfile=-
187 # Run autom4te with expansion.
188 eval set x "$autom4te_options" \
189 --language=autoconf --output=\"\$outfile\" "$traces" \"\$infile\"
190 shift
191 $verbose && AS_ECHO(["$as_me: running $AUTOM4TE $*"]) >&2
192 exec "$AUTOM4TE" "$@"