* doc/autoconf.texi (AU_DEFUN): Fix English,
[autoconf.git] / tests / wrapper.in
blob1c5a37dff631fbbea5519b1e351135638306c598
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
16 DUALCASE=1; export DUALCASE # for MKS sh
19 # PATH needs CR
20 # Avoid depending upon Character Ranges.
21 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
22 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
23 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
24 as_cr_digits='0123456789'
25 as_cr_alnum=$as_cr_Letters$as_cr_digits
27 # The user is always right.
28 if test "${PATH_SEPARATOR+set}" != set; then
29 echo "#! /bin/sh" >conf$$.sh
30 echo "exit 0" >>conf$$.sh
31 chmod +x conf$$.sh
32 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
33 PATH_SEPARATOR=';'
34 else
35 PATH_SEPARATOR=:
37 rm -f conf$$.sh
40 # Support unset when possible.
41 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
42 as_unset=unset
43 else
44 as_unset=false
48 # Find who we are. Look in the path if we contain no path at all
49 # relative or not.
50 case $0 in
51 *[\\/]* ) as_myself=$0 ;;
52 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
53 for as_dir in $PATH
55 IFS=$as_save_IFS
56 test -z "$as_dir" && as_dir=.
57 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
58 done
61 esac
62 # We did not find ourselves, most probably we were run as `sh COMMAND'
63 # in which case we are not to be found in the path.
64 if test "x$as_myself" = x; then
65 as_myself=$0
67 if test ! -f "$as_myself"; then
68 { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
69 { (exit 1); exit 1; }; }
72 # Work around bugs in pre-3.0 UWIN ksh.
73 $as_unset ENV MAIL MAILPATH
74 PS1='$ '
75 PS2='> '
76 PS4='+ '
78 # NLS nuisances.
79 for as_var in \
80 LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
81 LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
82 LC_TELEPHONE LC_TIME
84 if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
85 eval $as_var=C; export $as_var
86 else
87 $as_unset $as_var
89 done
91 # Required to use basename.
92 if expr a : '\(a\)' >/dev/null 2>&1; then
93 as_expr=expr
94 else
95 as_expr=false
98 if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
99 as_basename=basename
100 else
101 as_basename=false
105 # Name of the executable.
106 as_me=`$as_basename "$0" ||
107 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
108 X"$0" : 'X\(//\)$' \| \
109 X"$0" : 'X\(/\)$' \| \
110 . : '\(.\)' 2>/dev/null ||
111 echo X/"$0" |
112 sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
113 /^X\/\(\/\/\)$/{ s//\1/; q; }
114 /^X\/\(\/\).*/{ s//\1/; q; }
115 s/.*/./; q'`
119 if test "x$CONFIG_SHELL" = x; then
120 if (eval ":") 2>/dev/null; then
121 as_have_required=yes
122 else
123 as_have_required=no
126 if test $as_have_required = yes && (eval ":
127 (func_return () {
128 (exit \$1)
130 func_success () {
131 func_return 0
133 func_failure () {
134 func_return 1
136 func_ret_success () {
137 return 0
139 func_ret_failure () {
140 return 1
143 exitcode=0
144 if func_success; then
146 else
147 exitcode=1
148 echo func_failure succeeded.
151 if func_failure; then
152 exitcode=1
153 echo func_success failed.
156 if func_ret_success; then
158 else
159 exitcode=1
160 echo func_ret_success failed.
163 if func_ret_failure; then
164 exitcode=1
165 echo func_ret_failure succeeded.
168 test \$exitcode = 0) || { (exit 1); exit 1; }
169 ") 2> /dev/null; then
171 else
172 as_candidate_shells="$SHELL"
173 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
174 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
176 IFS=$as_save_IFS
177 test -z "$as_dir" && as_dir=.
178 case $as_dir in
180 for as_base in sh bash ksh sh5; do
181 as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
182 done
183 esac
184 done
187 for as_shell in $as_candidate_shells; do
188 if { $as_shell 2> /dev/null <<\_ASEOF
189 # Be Bourne compatible
190 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
191 emulate sh
192 NULLCMD=:
193 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
194 # is contrary to our usage. Disable this feature.
195 alias -g '${1+"$@"}'='"$@"'
196 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
197 set -o posix
199 DUALCASE=1; export DUALCASE # for MKS sh
202 _ASEOF
203 }; then
204 CONFIG_SHELL=$as_shell
205 as_have_required=yes
206 if { $as_shell 2> /dev/null <<\_ASEOF
207 # Be Bourne compatible
208 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
209 emulate sh
210 NULLCMD=:
211 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
212 # is contrary to our usage. Disable this feature.
213 alias -g '${1+"$@"}'='"$@"'
214 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
215 set -o posix
217 DUALCASE=1; export DUALCASE # for MKS sh
220 (func_return () {
221 (exit $1)
223 func_success () {
224 func_return 0
226 func_failure () {
227 func_return 1
229 func_ret_success () {
230 return 0
232 func_ret_failure () {
233 return 1
236 exitcode=0
237 if func_success; then
239 else
240 exitcode=1
241 echo func_failure succeeded.
244 if func_failure; then
245 exitcode=1
246 echo func_success failed.
249 if func_ret_success; then
251 else
252 exitcode=1
253 echo func_ret_success failed.
256 if func_ret_failure; then
257 exitcode=1
258 echo func_ret_failure succeeded.
261 test $exitcode = 0) || { (exit 1); exit 1; }
263 _ASEOF
264 }; then
265 break
270 done
272 if test "x$CONFIG_SHELL" != x; then
273 $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
274 $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
275 export CONFIG_SHELL
276 exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
280 if test $as_have_required = no; then
281 echo This script requires a shell more modern than all the
282 echo shells that I found on your system. Please install a
283 echo modern shell, or manually run the script under such a
284 echo shell if you do have one.
285 { (exit 1); exit 1; }
295 (eval "func_return () {
296 (exit \$1)
298 func_success () {
299 func_return 0
301 func_failure () {
302 func_return 1
304 func_ret_success () {
305 return 0
307 func_ret_failure () {
308 return 1
311 exitcode=0
312 if func_success; then
314 else
315 exitcode=1
316 echo func_failure succeeded.
319 if func_failure; then
320 exitcode=1
321 echo func_success failed.
324 if func_ret_success; then
326 else
327 exitcode=1
328 echo func_ret_success failed.
331 if func_ret_failure; then
332 exitcode=1
333 echo func_ret_failure succeeded.
336 test \$exitcode = 0") || {
337 echo No shell found that supports shell functions.
338 echo Please tell autoconf@gnu.org about your system,
339 echo including any error possibly output before this
340 echo message
344 testdir=@abs_top_builddir@/tests
345 AUTOCONF=$testdir/autoconf
346 AUTOHEADER=$testdir/autoheader
347 AUTOM4TE=$testdir/autom4te
348 AUTOM4TE_CFG=@abs_top_builddir@/lib/autom4te.cfg
349 autom4te_perllibdir=@abs_top_srcdir@/lib
350 export AUTOCONF AUTOHEADER AUTOM4TE AUTOM4TE_CFG autom4te_perllibdir
352 case $as_me in
353 ifnames)
354 # Does not have lib files.
355 exec @abs_top_builddir@/bin/$as_me ${1+"$@"}
358 # We might need files from the build tree (frozen files), in
359 # addition of src files.
360 exec @abs_top_builddir@/bin/$as_me \
361 -B @abs_top_builddir@/lib \
362 -B @abs_top_srcdir@/lib ${1+"$@"}
363 esac
364 exit 1