Prefer HTTPS to FTP and HTTP
[autoconf.git] / bin / autoconf.as
blob263d82a456f76560c4bb301e0acf6431310e7fd2
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-1994, 1996, 1999-2017 Free Software Foundation,
7 # 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 <https://www.gnu.org/licenses/>.
22 m4_divert_pop([HEADER-COPYRIGHT])dnl back to BODY
23 AS_ME_PREPARE[]dnl
25 usage=["\
26 Usage: $0 [OPTION]... [TEMPLATE-FILE]
28 Generate a configuration script from a TEMPLATE-FILE if given, or
29 'configure.ac' if present, or else 'configure.in'. Output is sent
30 to the standard output if TEMPLATE-FILE is given, else into
31 'configure'.
33 Operation modes:
34 -h, --help print this help, then exit
35 -V, --version print version number, then exit
36 -v, --verbose verbosely report processing
37 -d, --debug don't remove temporary files
38 -f, --force consider all files obsolete
39 -o, --output=FILE save output in FILE (stdout is the default)
40 -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
42 Warning categories include:
43 'cross' cross compilation issues
44 'obsolete' obsolete constructs
45 'syntax' dubious syntactic constructs
46 'all' all the warnings
47 'no-CATEGORY' turn off the warnings on CATEGORY
48 'none' turn off all the warnings
49 'error' warnings are error
51 The environment variables 'M4' and 'WARNINGS' are honored.
53 Library directories:
54 -B, --prepend-include=DIR prepend directory DIR to search path
55 -I, --include=DIR append directory DIR to search path
57 Tracing:
58 -t, --trace=MACRO[:FORMAT] report the list of calls to MACRO
59 -i, --initialization also trace Autoconf's initialization process
61 In tracing mode, no configuration script is created. FORMAT defaults
62 to '\$f:\$l:\$n:\$%'; see 'autom4te --help' for information about FORMAT.
64 Report bugs to <bug-autoconf@gnu.org>.
65 GNU Autoconf home page: <https://www.gnu.org/software/autoconf/>.
66 General help using GNU software: <https://www.gnu.org/gethelp/>."]
68 version=["\
69 autoconf (@PACKAGE_NAME@) @VERSION@
70 Copyright (C) @RELEASE_YEAR@ Free Software Foundation, Inc.
71 License GPLv3+/Autoconf: GNU GPL version 3 or later
72 <https://gnu.org/licenses/gpl.html>, <https://gnu.org/licenses/exceptions.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 m4_bpatsubst([AS_ERROR([option '$[1]' requires an argument$as_nl$help])],
83 ['], ['\\''])'
84 # restore font-lock: '
86 # Variables.
87 : ${AUTOM4TE='@bindir@/@autom4te-name@'}
88 autom4te_options=
89 outfile=
90 verbose=false
92 # Parse command line.
93 while test $# -gt 0 ; do
94 option=[`expr "x$1" : 'x\(--[^=]*\)' \| \
95 "x$1" : 'x\(-.\)'`]
96 optarg=[`expr "x$1" : 'x--[^=]*=\(.*\)' \| \
97 "x$1" : 'x-.\(.*\)'`]
98 case $1 in
99 --version | -V )
100 echo "$version" ; exit ;;
101 --help | -h )
102 AS_ECHO(["$usage"]); exit ;;
104 --verbose | -v )
105 verbose=:
106 autom4te_options="$autom4te_options $1"; shift ;;
108 # Arguments passed as is to autom4te.
109 --debug | -d | \
110 --force | -f | \
111 --include=* | -I?* | \
112 --prepend-include=* | -B?* | \
113 --warnings=* | -W?* )
114 case $1 in
115 *\'*) arg=`AS_ECHO(["$1"]) | sed "s/'/'\\\\\\\\''/g"` ;; #'
116 *) arg=$1 ;;
117 esac
118 autom4te_options="$autom4te_options '$arg'"; shift ;;
119 # Options with separated arg passed as is to autom4te.
120 --include | -I | \
121 --prepend-include | -B | \
122 --warnings | -W )
123 test $# = 1 && eval "$exit_missing_arg"
124 case $2 in
125 *\'*) arg=`AS_ECHO(["$2"]) | sed "s/'/'\\\\\\\\''/g"` ;; #'
126 *) arg=$2 ;;
127 esac
128 autom4te_options="$autom4te_options $option '$arg'"
129 shift; shift ;;
131 --trace=* | -t?* )
132 traces="$traces --trace='"`AS_ECHO(["$optarg"]) | sed "s/'/'\\\\\\\\''/g"`"'"
133 shift ;;
134 --trace | -t )
135 test $# = 1 && eval "$exit_missing_arg"
136 traces="$traces --trace='"`AS_ECHO(["$[2]"]) | sed "s/'/'\\\\\\\\''/g"`"'"
137 shift; shift ;;
138 --initialization | -i )
139 autom4te_options="$autom4te_options --melt"
140 shift;;
142 --output=* | -o?* )
143 outfile=$optarg
144 shift ;;
145 --output | -o )
146 test $# = 1 && eval "$exit_missing_arg"
147 outfile=$2
148 shift; shift ;;
150 -- ) # Stop option processing
151 shift; break ;;
152 - ) # Use stdin as input.
153 break ;;
154 -* )
155 exec >&2
156 AS_ERROR([invalid option '$[1]'$as_nl$help]) ;;
158 break ;;
159 esac
160 done
162 # Find the input file.
163 case $# in
165 if test -f configure.ac; then
166 if test -f configure.in; then
167 AS_ECHO(["$as_me: warning: both 'configure.ac' and 'configure.in' are present."]) >&2
168 AS_ECHO(["$as_me: warning: proceeding with 'configure.ac'."]) >&2
170 infile=configure.ac
171 elif test -f configure.in; then
172 infile=configure.in
173 else
174 AS_ERROR([no input file])
176 test -z "$traces" && test -z "$outfile" && outfile=configure;;
178 infile=$1 ;;
179 *) exec >&2
180 AS_ERROR([invalid number of arguments$as_nl$help]) ;;
181 esac
183 # Unless specified, the output is stdout.
184 test -z "$outfile" && outfile=-
186 # Run autom4te with expansion.
187 eval set x "$autom4te_options" \
188 --language=autoconf --output=\"\$outfile\" "$traces" \"\$infile\"
189 shift
190 $verbose && AS_ECHO(["$as_me: running $AUTOM4TE $*"]) >&2
191 exec "$AUTOM4TE" "$@"