Balance parentheses in _AC_CACHE_DUMP.
[autoconf.git] / bin / autoconf.as
blobc678e55ae0a822b6fd109af9c47895cdbf0cd812
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 Free Software Foundation, Inc.
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 # 02110-1301, USA.
24 m4_divert_pop([HEADER-COPYRIGHT])dnl back to BODY
25 AS_ME_PREPARE[]dnl
27 usage=["\
28 Usage: $0 [OPTION]... [TEMPLATE-FILE]
30 Generate a configuration script from a TEMPLATE-FILE if given, or
31 \`configure.ac' if present, or else \`configure.in'. Output is sent
32 to the standard output if TEMPLATE-FILE is given, else into
33 \`configure'.
35 Operation modes:
36 -h, --help print this help, then exit
37 -V, --version print version number, then exit
38 -v, --verbose verbosely report processing
39 -d, --debug don't remove temporary files
40 -f, --force consider all files obsolete
41 -o, --output=FILE save output in FILE (stdout is the default)
42 -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
44 Warning categories include:
45 \`cross' cross compilation issues
46 \`obsolete' obsolete constructs
47 \`syntax' dubious syntactic constructs
48 \`all' all the warnings
49 \`no-CATEGORY' turn off the warnings on CATEGORY
50 \`none' turn off all the warnings
51 \`error' warnings are error
53 The environment variables \`M4' and \`WARNINGS' are honored.
55 Library directories:
56 -B, --prepend-include=DIR prepend directory DIR to search path
57 -I, --include=DIR append directory DIR to search path
59 Tracing:
60 -t, --trace=MACRO[:FORMAT] report the list of calls to MACRO
61 -i, --initialization also trace Autoconf's initialization process
63 In tracing mode, no configuration script is created. FORMAT defaults
64 to \`\$f:\$l:\$n:\$%'; see \`autom4te --help' for information about FORMAT.
66 Report bugs to <bug-autoconf@gnu.org>."]
68 version=["\
69 autoconf (@PACKAGE_NAME@) @VERSION@
70 Copyright (C) @RELEASE_YEAR@ Free Software Foundation, Inc.
71 License GPLv2+: GNU GPL version 2 or later
72 <http://gnu.org/licenses/old-licenses/gpl-2.0.html>
73 This is free software: you are free to change and redistribute it.
74 There is NO WARRANTY, to the extent permitted by law.
76 Written by David J. MacKenzie and Akim Demaille."]
78 help="\
79 Try \`$as_me --help' for more information."
81 exit_missing_arg='
82 AS_ECHO(["$as_me: option \`$[1]'\'' requires an argument"]) >&2
83 AS_ECHO(["$help"]) >&2
84 AS_EXIT([1])
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_ECHO(["$as_me: invalid option $[1]"])
158 AS_ECHO(["$help"])
159 AS_EXIT([1]) ;;
161 break ;;
162 esac
163 done
165 # Find the input file.
166 case $# in
168 if test -f configure.ac; then
169 if test -f configure.in; then
170 AS_ECHO(["$as_me: warning: both \`configure.ac' and \`configure.in' are present."]) >&2
171 AS_ECHO(["$as_me: warning: proceeding with \`configure.ac'."]) >&2
173 infile=configure.ac
174 elif test -f configure.in; then
175 infile=configure.in
176 else
177 AS_ECHO(["$as_me: no input file"]) >&2
178 AS_EXIT([1])
180 test -z "$traces" && test -z "$outfile" && outfile=configure;;
182 infile=$1 ;;
183 *) exec >&2
184 AS_ECHO(["$as_me: invalid number of arguments."])
185 AS_ECHO(["$help"])
186 AS_EXIT([1]) ;;
187 esac
189 # Unless specified, the output is stdout.
190 test -z "$outfile" && outfile=-
192 # Run autom4te with expansion.
193 eval set x "$autom4te_options" \
194 --language=autoconf --output=\"\$outfile\" "$traces" \"\$infile\"
195 shift
196 $verbose && AS_ECHO(["$as_me: running $AUTOM4TE $*"]) >&2
197 exec "$AUTOM4TE" "$@"