Install msysDTK-1.0.1
[msysgit.git] / bin / autoconf
blob447b771b4105e7eb9b57336b5251693f7e9d2d59
1 #! /bin/sh
2 ## --------------------- ##
3 ## M4sh Initialization. ##
4 ## --------------------- ##
6 # Be Bourne compatible
7 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
8 emulate sh
9 NULLCMD=:
10 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
11 # is contrary to our usage. Disable this feature.
12 alias -g '${1+"$@"}'='"$@"'
13 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
14 set -o posix
17 # Support unset when possible.
18 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
19 as_unset=unset
20 else
21 as_unset=false
25 # Work around bugs in pre-3.0 UWIN ksh.
26 $as_unset ENV MAIL MAILPATH
27 PS1='$ '
28 PS2='> '
29 PS4='+ '
31 # NLS nuisances.
32 for as_var in \
33 LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
34 LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
35 LC_TELEPHONE LC_TIME
37 if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
38 eval $as_var=C; export $as_var
39 else
40 $as_unset $as_var
42 done
44 # Required to use basename.
45 if expr a : '\(a\)' >/dev/null 2>&1; then
46 as_expr=expr
47 else
48 as_expr=false
51 if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
52 as_basename=basename
53 else
54 as_basename=false
58 # Name of the executable.
59 as_me=`$as_basename "$0" ||
60 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
61 X"$0" : 'X\(//\)$' \| \
62 X"$0" : 'X\(/\)$' \| \
63 . : '\(.\)' 2>/dev/null ||
64 echo X/"$0" |
65 sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
66 /^X\/\(\/\/\)$/{ s//\1/; q; }
67 /^X\/\(\/\).*/{ s//\1/; q; }
68 s/.*/./; q'`
71 # autoconf -- create `configure' using m4 macros
72 # Copyright (C) 1992, 1993, 1994, 1996, 1999, 2000, 2001, 2002
73 # Free Software Foundation, Inc.
75 # This program is free software; you can redistribute it and/or modify
76 # it under the terms of the GNU General Public License as published by
77 # the Free Software Foundation; either version 2, or (at your option)
78 # any later version.
80 # This program is distributed in the hope that it will be useful,
81 # but WITHOUT ANY WARRANTY; without even the implied warranty of
82 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
83 # GNU General Public License for more details.
85 # You should have received a copy of the GNU General Public License
86 # along with this program; if not, write to the Free Software
87 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
88 # 02111-1307, USA.
90 usage="\
91 Usage: $0 [OPTION] ... [TEMPLATE-FILE]
93 Generate a configuration script from a TEMPLATE-FILE if given, or
94 \`configure.ac' if present, or else \`configure.in'. Output is sent
95 to the standard output if TEMPLATE-FILE is given, else into
96 \`configure'.
98 Operation modes:
99 -h, --help print this help, then exit
100 -V, --version print version number, then exit
101 -v, --verbose verbosely report processing
102 -d, --debug don't remove temporary files
103 -f, --force consider all files obsolete
104 -o, --output=FILE save output in FILE (stdout is the default)
105 -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
107 Warning categories include:
108 \`cross' cross compilation issues
109 \`obsolete' obsolete constructs
110 \`syntax' dubious syntactic constructs
111 \`all' all the warnings
112 \`no-CATEGORY' turn off the warnings on CATEGORY
113 \`none' turn off all the warnings
114 \`error' warnings are error
116 The environment variable \`WARNINGS' is honored.
118 Library directories:
119 -B, --prepend-include=DIR prepend directory DIR to search path
120 -I, --include=DIR append directory DIR to search path
122 Tracing:
123 -t, --trace=MACRO report the list of calls to MACRO
124 -i, --initialization also trace Autoconf's initialization process
126 In tracing mode, no configuration script is created.
128 Report bugs to <bug-autoconf@gnu.org>."
130 version="\
131 autoconf (GNU Autoconf) 2.56
132 Written by David J. MacKenzie and Akim Demaille.
134 Copyright 2002 Free Software Foundation, Inc.
135 This is free software; see the source for copying conditions. There is NO
136 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
138 me=`$as_basename $0 ||
139 $as_expr X/$0 : '.*/\([^/][^/]*\)/*$' \| \
140 X$0 : 'X\(//\)$' \| \
141 X$0 : 'X\(/\)$' \| \
142 . : '\(.\)' 2>/dev/null ||
143 echo X/$0 |
144 sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
145 /^X\/\(\/\/\)$/{ s//\1/; q; }
146 /^X\/\(\/\).*/{ s//\1/; q; }
147 s/.*/./; q'`
149 help="\
150 Try \`$me --help' for more information."
152 exit_missing_arg="\
153 echo \"$me: option \\\`\$1' requires an argument\" >&2
154 echo \"\$help\" >&2
155 exit 1"
157 # Variables.
158 : ${AUTOM4TE='/usr/bin/autom4te'}
159 dir=`(dirname $0) 2>/dev/null ||
160 $as_expr X$0 : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
161 X$0 : 'X\(//\)[^/]' \| \
162 X$0 : 'X\(//\)$' \| \
163 X$0 : 'X\(/\)' \| \
164 . : '\(.\)' 2>/dev/null ||
165 echo X$0 |
166 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
167 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
168 /^X\(\/\/\)$/{ s//\1/; q; }
169 /^X\(\/\).*/{ s//\1/; q; }
170 s/.*/./; q'`
171 outfile=
172 verbose=:
174 # Parse command line.
175 while test $# -gt 0 ; do
176 option=`expr "x$1" : 'x\(--[^=]*\)' \| \
177 "x$1" : 'x\(-.\)'`
178 optarg=`expr "x$1" : 'x--[^=]*=\(.*\)' \| \
179 "x$1" : 'x-.\(.*\)'`
180 case $1 in
181 --version | -V )
182 echo "$version" ; exit 0 ;;
183 --help | -h )
184 echo "$usage"; exit 0 ;;
186 --verbose | -v )
187 verbose=echo
188 AUTOM4TE="$AUTOM4TE $1"; shift ;;
190 # Arguments passed as is to autom4te.
191 --debug | -d | \
192 --force | -f | \
193 --include=* | -I?* | \
194 --prepend-include=* | -B?* | \
195 --warnings=* | -W?* )
196 AUTOM4TE="$AUTOM4TE $1"; shift ;;
198 # Options with separated arg passed as is to autom4te.
199 --include | -I | \
200 --prepend-include | -B | \
201 --warnings | -W )
202 test $# = 1 && eval "$exit_missing_arg"
203 AUTOM4TE="$AUTOM4TE $option $2"
204 shift 2 ;;
206 --trace=* | -t?* )
207 traces="$traces --trace='"`echo "$optarg" | sed "s/'/'\\\\\\\\''/g"`"'"
208 shift ;;
209 --trace | -t )
210 test $# = 1 && eval "$exit_missing_arg"
211 shift
212 traces="$traces --trace='"`echo "$1" | sed "s/'/'\\\\\\\\''/g"`"'"
213 shift ;;
214 --initialization | -i )
215 AUTOM4TE="$AUTOM4TE --melt"
216 shift;;
218 --output=* | -o?* )
219 outfile=$optarg
220 shift ;;
221 --output | -o )
222 test $# = 1 && eval "$exit_missing_arg"
223 shift
224 outfile=$1
225 shift ;;
227 -- ) # Stop option processing
228 shift; break ;;
229 - ) # Use stdin as input.
230 break ;;
231 -* )
232 exec >&2
233 echo "$me: invalid option $1"
234 echo "$help"
235 exit 1 ;;
237 break ;;
238 esac
239 done
241 # Find the input file.
242 case $# in
244 if test -f configure.ac; then
245 if test -f configure.in; then
246 echo "$me: warning: both \`configure.ac' and \`configure.in' are present." >&2
247 echo "$me: warning: proceeding with \`configure.ac'." >&2
249 infile=configure.ac
250 elif test -f configure.in; then
251 infile=configure.in
252 else
253 echo "$me: no input file" >&2
254 exit 1
256 test -z "$traces" && test -z "$outfile" && outfile=configure;;
257 1) # autom4te doesn't like `-'.
258 test "x$1" != "x-" && infile=$1 ;;
259 *) exec >&2
260 echo "$me: invalid number of arguments."
261 echo "$help"
262 (exit 1); exit 1 ;;
263 esac
265 # Unless specified, the output is stdout.
266 test -z "$outfile" && outfile=-
268 # Run autom4te with expansion.
269 eval set \$AUTOM4TE --language=autoconf --output=\$outfile "$traces" \$infile
270 $verbose "$me: running $*" >&2
271 exec "$@"