* lib/autoconf/functions.m4 (_AC_FUNC_MALLOC_IF): Fix comment typo.
[autoconf/tsuna.git] / bin / autoconf.as
blobb68d4ef607d00c8d0bbe8a2b5281fae0cbac6ecc
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 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 3 of the License, or
12 # (at your option) 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, see <http://www.gnu.org/licenses/>.
22 m4_divert_pop([HEADER-COPYRIGHT])dnl back to BODY
24 usage=["\
25 Usage: $0 [OPTION] ... [TEMPLATE-FILE]
27 Generate a configuration script from a TEMPLATE-FILE if given, or
28 \`configure.ac' if present, or else \`configure.in'. Output is sent
29 to the standard output if TEMPLATE-FILE is given, else into
30 \`configure'.
32 Operation modes:
33 -h, --help print this help, then exit
34 -V, --version print version number, then exit
35 -v, --verbose verbosely report processing
36 -d, --debug don't remove temporary files
37 -f, --force consider all files obsolete
38 -o, --output=FILE save output in FILE (stdout is the default)
39 -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
41 Warning categories include:
42 \`cross' cross compilation issues
43 \`obsolete' obsolete constructs
44 \`syntax' dubious syntactic constructs
45 \`all' all the warnings
46 \`no-CATEGORY' turn off the warnings on CATEGORY
47 \`none' turn off all the warnings
48 \`error' warnings are error
50 The environment variables \`M4' and \`WARNINGS' are honored.
52 Library directories:
53 -B, --prepend-include=DIR prepend directory DIR to search path
54 -I, --include=DIR append directory DIR to search path
56 Tracing:
57 -t, --trace=MACRO report the list of calls to MACRO
58 -i, --initialization also trace Autoconf's initialization process
60 In tracing mode, no configuration script is created.
62 Report bugs to <bug-autoconf@gnu.org>."]
64 version=["\
65 autoconf (@PACKAGE_NAME@) @VERSION@
66 Copyright (C) @RELEASE_YEAR@ Free Software Foundation, Inc.
67 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
68 This is free software: you are free to change and redistribute it.
69 There is NO WARRANTY, to the extent permitted by law.
71 Written by David J. MacKenzie and Akim Demaille."]
73 help="\
74 Try \`$as_me --help' for more information."
76 exit_missing_arg='
77 AS_ECHO(["$as_me: option \`$[1]'\'' requires an argument"]) >&2
78 AS_ECHO(["$help"]) >&2
79 exit 1
80 ' # restore font-lock: "
82 # Variables.
83 : ${AUTOM4TE='@bindir@/@autom4te-name@'}
84 autom4te_options=
85 outfile=
86 verbose=false
88 # Parse command line.
89 while test $# -gt 0 ; do
90 option=[`expr "x$1" : 'x\(--[^=]*\)' \| \
91 "x$1" : 'x\(-.\)'`]
92 optarg=[`expr "x$1" : 'x--[^=]*=\(.*\)' \| \
93 "x$1" : 'x-.\(.*\)'`]
94 case $1 in
95 --version | -V )
96 echo "$version" ; exit ;;
97 --help | -h )
98 AS_ECHO(["$usage"]); exit ;;
100 --verbose | -v )
101 verbose=:
102 autom4te_options="$autom4te_options $1"; shift ;;
104 # Arguments passed as is to autom4te.
105 --debug | -d | \
106 --force | -f | \
107 --include=* | -I?* | \
108 --prepend-include=* | -B?* | \
109 --warnings=* | -W?* )
110 autom4te_options="$autom4te_options '$1'"; shift ;;
112 # Options with separated arg passed as is to autom4te.
113 --include | -I | \
114 --prepend-include | -B | \
115 --warnings | -W )
116 test $# = 1 && eval "$exit_missing_arg"
117 autom4te_options="$autom4te_options $option '$2'"
118 shift; shift ;;
120 --trace=* | -t?* )
121 traces="$traces --trace='"`AS_ECHO(["$optarg"]) | sed "s/'/'\\\\\\\\''/g"`"'"
122 shift ;;
123 --trace | -t )
124 test $# = 1 && eval "$exit_missing_arg"
125 traces="$traces --trace='"`AS_ECHO(["$[2]"]) | sed "s/'/'\\\\\\\\''/g"`"'"
126 shift; shift ;;
127 --initialization | -i )
128 autom4te_options="$autom4te_options --melt"
129 shift;;
131 --output=* | -o?* )
132 outfile=$optarg
133 shift ;;
134 --output | -o )
135 test $# = 1 && eval "$exit_missing_arg"
136 outfile=$2
137 shift; shift ;;
139 -- ) # Stop option processing
140 shift; break ;;
141 - ) # Use stdin as input.
142 break ;;
143 -* )
144 exec >&2
145 AS_ECHO(["$as_me: invalid option $[1]"])
146 AS_ECHO(["$help"])
147 exit 1 ;;
149 break ;;
150 esac
151 done
153 # Find the input file.
154 case $# in
156 if test -f configure.ac; then
157 if test -f configure.in; then
158 AS_ECHO(["$as_me: warning: both \`configure.ac' and \`configure.in' are present."]) >&2
159 AS_ECHO(["$as_me: warning: proceeding with \`configure.ac'."]) >&2
161 infile=configure.ac
162 elif test -f configure.in; then
163 infile=configure.in
164 else
165 AS_ECHO(["$as_me: no input file"]) >&2
166 exit 1
168 test -z "$traces" && test -z "$outfile" && outfile=configure;;
170 infile=$1 ;;
171 *) exec >&2
172 AS_ECHO(["$as_me: invalid number of arguments."])
173 AS_ECHO(["$help"])
174 (exit 1); exit 1 ;;
175 esac
177 # Unless specified, the output is stdout.
178 test -z "$outfile" && outfile=-
180 # Run autom4te with expansion.
181 eval set x $autom4te_options \
182 --language=autoconf --output=\$outfile "$traces" \$infile
183 shift
184 $verbose && AS_ECHO(["$as_me: running $AUTOM4TE $*"]) >&2
185 exec "$AUTOM4TE" "$@"