Remove man files from CVS, as they're generated automatically.
[autoconf/tsuna.git] / bin / autoconf.as
blobf5c0824584c4ed7c1bf1f7c36f6b34dc7badc7ff
1 AS_INIT[]dnl -*- shell-script -*-
2 # autoconf -- create `configure' using m4 macros
4 # Copyright (C) 1992, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003,
5 # 2004, 2005, 2006 Free Software Foundation, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 # 02110-1301, USA.
22 usage=["\
23 Usage: $0 [OPTION] ... [TEMPLATE-FILE]
25 Generate a configuration script from a TEMPLATE-FILE if given, or
26 \`configure.ac' if present, or else \`configure.in'. Output is sent
27 to the standard output if TEMPLATE-FILE is given, else into
28 \`configure'.
30 Operation modes:
31 -h, --help print this help, then exit
32 -V, --version print version number, then exit
33 -v, --verbose verbosely report processing
34 -d, --debug don't remove temporary files
35 -f, --force consider all files obsolete
36 -o, --output=FILE save output in FILE (stdout is the default)
37 -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
39 Warning categories include:
40 \`cross' cross compilation issues
41 \`obsolete' obsolete constructs
42 \`syntax' dubious syntactic constructs
43 \`all' all the warnings
44 \`no-CATEGORY' turn off the warnings on CATEGORY
45 \`none' turn off all the warnings
46 \`error' warnings are error
48 The environment variables \`M4' and \`WARNINGS' are honored.
50 Library directories:
51 -B, --prepend-include=DIR prepend directory DIR to search path
52 -I, --include=DIR append directory DIR to search path
54 Tracing:
55 -t, --trace=MACRO report the list of calls to MACRO
56 -i, --initialization also trace Autoconf's initialization process
58 In tracing mode, no configuration script is created.
60 Report bugs to <bug-autoconf@gnu.org>."]
62 version=["\
63 autoconf (@PACKAGE_NAME@) @VERSION@
64 Copyright (C) 2006 Free Software Foundation, Inc.
65 This is free software. You may redistribute copies of it under the terms of
66 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
67 There is NO WARRANTY, to the extent permitted by law.
69 Written by David J. MacKenzie and Akim Demaille."]
71 help="\
72 Try \`$as_me --help' for more information."
74 exit_missing_arg='
75 AS_ECHO(["$as_me: option \`$[1]'\'' requires an argument"]) >&2
76 AS_ECHO(["$help"]) >&2
77 exit 1
80 # Variables.
81 : ${AUTOM4TE='@bindir@/@autom4te-name@'}
82 autom4te_options=
83 outfile=
84 verbose=false
86 # Parse command line.
87 while test $# -gt 0 ; do
88 option=[`expr "x$1" : 'x\(--[^=]*\)' \| \
89 "x$1" : 'x\(-.\)'`]
90 optarg=[`expr "x$1" : 'x--[^=]*=\(.*\)' \| \
91 "x$1" : 'x-.\(.*\)'`]
92 case $1 in
93 --version | -V )
94 echo "$version" ; exit ;;
95 --help | -h )
96 AS_ECHO(["$usage"]); exit ;;
98 --verbose | -v )
99 verbose=:
100 autom4te_options="$autom4te_options $1"; shift ;;
102 # Arguments passed as is to autom4te.
103 --debug | -d | \
104 --force | -f | \
105 --include=* | -I?* | \
106 --prepend-include=* | -B?* | \
107 --warnings=* | -W?* )
108 autom4te_options="$autom4te_options '$1'"; shift ;;
110 # Options with separated arg passed as is to autom4te.
111 --include | -I | \
112 --prepend-include | -B | \
113 --warnings | -W )
114 test $# = 1 && eval "$exit_missing_arg"
115 autom4te_options="$autom4te_options $option '$2'"
116 shift; shift ;;
118 --trace=* | -t?* )
119 traces="$traces --trace='"`AS_ECHO(["$optarg"]) | sed "s/'/'\\\\\\\\''/g"`"'"
120 shift ;;
121 --trace | -t )
122 test $# = 1 && eval "$exit_missing_arg"
123 traces="$traces --trace='"`AS_ECHO(["$[2]"]) | sed "s/'/'\\\\\\\\''/g"`"'"
124 shift; shift ;;
125 --initialization | -i )
126 autom4te_options="$autom4te_options --melt"
127 shift;;
129 --output=* | -o?* )
130 outfile=$optarg
131 shift ;;
132 --output | -o )
133 test $# = 1 && eval "$exit_missing_arg"
134 outfile=$2
135 shift; shift ;;
137 -- ) # Stop option processing
138 shift; break ;;
139 - ) # Use stdin as input.
140 break ;;
141 -* )
142 exec >&2
143 AS_ECHO(["$as_me: invalid option $[1]"])
144 AS_ECHO(["$help"])
145 exit 1 ;;
147 break ;;
148 esac
149 done
151 # Find the input file.
152 case $# in
154 if test -f configure.ac; then
155 if test -f configure.in; then
156 AS_ECHO(["$as_me: warning: both \`configure.ac' and \`configure.in' are present."]) >&2
157 AS_ECHO(["$as_me: warning: proceeding with \`configure.ac'."]) >&2
159 infile=configure.ac
160 elif test -f configure.in; then
161 infile=configure.in
162 else
163 AS_ECHO(["$as_me: no input file"]) >&2
164 exit 1
166 test -z "$traces" && test -z "$outfile" && outfile=configure;;
167 1) # autom4te doesn't like `-'.
168 test "x$1" != "x-" && infile=$1 ;;
169 *) exec >&2
170 AS_ECHO(["$as_me: invalid number of arguments."])
171 AS_ECHO(["$help"])
172 (exit 1); exit 1 ;;
173 esac
175 # Unless specified, the output is stdout.
176 test -z "$outfile" && outfile=-
178 # Run autom4te with expansion.
179 eval set x $autom4te_options \
180 --language=autoconf --output=\$outfile "$traces" \$infile
181 shift
182 $verbose && AS_ECHO(["$as_me: running $AUTOM4TE $*"]) >&2
183 exec "$AUTOM4TE" "$@"