]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/configure
2003-06-14 Michael Koch <konqueror@gmx.de>
[thirdparty/gcc.git] / gcc / configure
CommitLineData
005537df 1#! /bin/sh
093e61a6 2
861bb6c1 3# Guess values for system-dependent variables and create Makefiles.
093e61a6
RS
4# Generated automatically using autoconf version 2.13
5# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
861bb6c1
JL
6#
7# This configure script is free software; the Free Software Foundation
8# gives unlimited permission to copy, distribute and modify it.
9
093e61a6
RS
10# Defaults:
11ac_help=
861bb6c1 12ac_default_prefix=/usr/local
093e61a6
RS
13# Any additions from configure.in:
14ac_help="$ac_help
15 --with-local-prefix=DIR specifies directory to put local include"
16ac_help="$ac_help
17 --with-gxx-include-dir=DIR
18 specifies directory to put g++ header files"
19ac_help="$ac_help
20 --with-cpp-install-dir=DIR
21 install the user visible C preprocessor in DIR
22 (relative to PREFIX) as well as PREFIX/bin"
23ac_help="$ac_help
24 --with-gnu-ld arrange to work with GNU ld."
25ac_help="$ac_help
26 --with-ld arrange to use the specified ld (full pathname)"
27ac_help="$ac_help
28 --with-gnu-as arrange to work with GNU as"
29ac_help="$ac_help
30 --with-as arrange to use the specified as (full pathname)"
31ac_help="$ac_help
32 --enable-werror enable -Werror in bootstrap stage2 and later"
33ac_help="$ac_help
34 --enable-checking[=LIST]
35 enable expensive run-time checks. With LIST,
36 enable only specific categories of checks.
37 Categories are: misc,tree,rtl,rtlflag,gc,gcac;
38 default is misc,tree,gc,rtlflag"
39ac_help="$ac_help
40 --enable-coverage[=LEVEL]
41 enable compiler\'s code coverage collection.
42 Use to measure compiler performance and locate
43 unused parts of the compiler. With LEVEL, specify
44 optimization. Values are opt, noopt,
45 default is noopt"
46ac_help="$ac_help
47 --with-stabs arrange to use stabs instead of host debug format"
48ac_help="$ac_help
49 --with-elf arrange to use ELF instead of host debug format"
50ac_help="$ac_help
51 --enable-multilib enable library support for multiple ABIs"
52ac_help="$ac_help
53 --enable-__cxa_atexit enable __cxa_atexit for C++"
54ac_help="$ac_help
55 --enable-c-mbchar enable multibyte characters for C and C++"
56ac_help="$ac_help
57 --enable-threads enable thread usage for target GCC
58 --enable-threads=LIB use LIB thread package for target GCC"
59ac_help="$ac_help
60 --enable-objc-gc enable the use of Boehm's garbage collector with
61 the GNU Objective-C runtime"
62ac_help="$ac_help
63 --with-dwarf2 force the default debug format to be DWARF 2"
64ac_help="$ac_help
65 --disable-shared don't provide a shared libgcc"
66ac_help="$ac_help
67 --with-sysroot[=DIR] Search for usr/lib, usr/include, et al, within DIR."
68ac_help="$ac_help
69 --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib"
70ac_help="$ac_help
71 --enable-initfini-array use .init_array/.fini_array sections"
72ac_help="$ac_help
73 --enable-sjlj-exceptions
74 arrange to use setjmp/longjmp exception handling"
75ac_help="$ac_help
76 --enable-libunwind-exceptions force use libunwind for exceptions"
77ac_help="$ac_help
78 --enable-nls use Native Language Support (default)"
79ac_help="$ac_help
80 --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib"
81ac_help="$ac_help
82 --disable-nls do not use Native Language Support"
83ac_help="$ac_help
84 --with-included-gettext use the GNU gettext library included here"
85ac_help="$ac_help
86 --disable-win32-registry
87 disable lookup of installation paths in the
88 Registry on Windows hosts
89 --enable-win32-registry enable registry lookup (default)
90 --enable-win32-registry=KEY
91 use KEY instead of GCC version as the last portion
92 of the registry key"
93ac_help="$ac_help
94 --with-gc={simple,page} choose the garbage collection mechanism to use
95 with the compiler"
96ac_help="$ac_help
97 --with-system-zlib use installed libz"
98ac_help="$ac_help
99 --enable-maintainer-mode
100 enable make rules and dependencies not useful
101 (and sometimes confusing) to the casual installer"
102ac_help="$ac_help
103 --enable-version-specific-runtime-libs
104 specify that runtime libraries should be
105 installed in a compiler-specific directory"
106ac_help="$ac_help
107 --with-slibdir=DIR shared libraries in DIR [LIBDIR]"
861bb6c1
JL
108
109# Initialize some variables set by options.
110# The variables have the same names as the options, with
111# dashes changed to underlines.
093e61a6
RS
112build=NONE
113cache_file=./config.cache
861bb6c1 114exec_prefix=NONE
093e61a6 115host=NONE
861bb6c1 116no_create=
093e61a6 117nonopt=NONE
861bb6c1
JL
118no_recursion=
119prefix=NONE
120program_prefix=NONE
121program_suffix=NONE
122program_transform_name=s,x,x,
123silent=
124site=
125srcdir=
093e61a6 126target=NONE
861bb6c1
JL
127verbose=
128x_includes=NONE
129x_libraries=NONE
130bindir='${exec_prefix}/bin'
131sbindir='${exec_prefix}/sbin'
132libexecdir='${exec_prefix}/libexec'
133datadir='${prefix}/share'
134sysconfdir='${prefix}/etc'
135sharedstatedir='${prefix}/com'
136localstatedir='${prefix}/var'
137libdir='${exec_prefix}/lib'
138includedir='${prefix}/include'
139oldincludedir='/usr/include'
140infodir='${prefix}/info'
141mandir='${prefix}/man'
142
093e61a6
RS
143# Initialize some other variables.
144subdirs=
145MFLAGS= MAKEFLAGS=
146SHELL=${CONFIG_SHELL-/bin/sh}
147# Maximum number of lines to put in a shell here document.
148ac_max_here_lines=12
149
861bb6c1
JL
150ac_prev=
151for ac_option
152do
093e61a6 153
861bb6c1
JL
154 # If the previous option needs an argument, assign it.
155 if test -n "$ac_prev"; then
156 eval "$ac_prev=\$ac_option"
157 ac_prev=
158 continue
159 fi
160
093e61a6
RS
161 case "$ac_option" in
162 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
163 *) ac_optarg= ;;
164 esac
861bb6c1
JL
165
166 # Accept the important Cygnus configure options, so we can diagnose typos.
167
093e61a6 168 case "$ac_option" in
861bb6c1
JL
169
170 -bindir | --bindir | --bindi | --bind | --bin | --bi)
171 ac_prev=bindir ;;
172 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
093e61a6 173 bindir="$ac_optarg" ;;
861bb6c1
JL
174
175 -build | --build | --buil | --bui | --bu)
093e61a6 176 ac_prev=build ;;
861bb6c1 177 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
093e61a6 178 build="$ac_optarg" ;;
861bb6c1
JL
179
180 -cache-file | --cache-file | --cache-fil | --cache-fi \
181 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
182 ac_prev=cache_file ;;
183 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
184 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
093e61a6 185 cache_file="$ac_optarg" ;;
861bb6c1
JL
186
187 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
188 ac_prev=datadir ;;
189 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
190 | --da=*)
093e61a6 191 datadir="$ac_optarg" ;;
861bb6c1
JL
192
193 -disable-* | --disable-*)
093e61a6 194 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
861bb6c1 195 # Reject names that are not valid shell variable names.
093e61a6
RS
196 if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
197 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
198 fi
199 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
200 eval "enable_${ac_feature}=no" ;;
861bb6c1
JL
201
202 -enable-* | --enable-*)
093e61a6 203 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
861bb6c1 204 # Reject names that are not valid shell variable names.
093e61a6
RS
205 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
206 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
207 fi
208 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
209 case "$ac_option" in
210 *=*) ;;
861bb6c1
JL
211 *) ac_optarg=yes ;;
212 esac
093e61a6 213 eval "enable_${ac_feature}='$ac_optarg'" ;;
861bb6c1
JL
214
215 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
216 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
217 | --exec | --exe | --ex)
218 ac_prev=exec_prefix ;;
219 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
220 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
221 | --exec=* | --exe=* | --ex=*)
093e61a6 222 exec_prefix="$ac_optarg" ;;
861bb6c1
JL
223
224 -gas | --gas | --ga | --g)
225 # Obsolete; use --with-gas.
226 with_gas=yes ;;
227
093e61a6
RS
228 -help | --help | --hel | --he)
229 # Omit some internal or obsolete options to make the list less imposing.
230 # This message is too long to be a string in the A/UX 3.1 sh.
231 cat << EOF
232Usage: configure [options] [host]
233Options: [defaults in brackets after descriptions]
234Configuration:
235 --cache-file=FILE cache test results in FILE
236 --help print this message
237 --no-create do not create output files
238 --quiet, --silent do not print \`checking...' messages
239 --version print the version of autoconf that created configure
240Directory and file names:
241 --prefix=PREFIX install architecture-independent files in PREFIX
242 [$ac_default_prefix]
243 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
244 [same as prefix]
245 --bindir=DIR user executables in DIR [EPREFIX/bin]
246 --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
247 --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
248 --datadir=DIR read-only architecture-independent data in DIR
249 [PREFIX/share]
250 --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
251 --sharedstatedir=DIR modifiable architecture-independent data in DIR
252 [PREFIX/com]
253 --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
254 --libdir=DIR object code libraries in DIR [EPREFIX/lib]
255 --includedir=DIR C header files in DIR [PREFIX/include]
256 --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
257 --infodir=DIR info documentation in DIR [PREFIX/info]
258 --mandir=DIR man documentation in DIR [PREFIX/man]
259 --srcdir=DIR find the sources in DIR [configure dir or ..]
260 --program-prefix=PREFIX prepend PREFIX to installed program names
261 --program-suffix=SUFFIX append SUFFIX to installed program names
262 --program-transform-name=PROGRAM
263 run sed PROGRAM on installed program names
264EOF
265 cat << EOF
266Host type:
267 --build=BUILD configure for building on BUILD [BUILD=HOST]
268 --host=HOST configure for HOST [guessed]
269 --target=TARGET configure for TARGET [TARGET=HOST]
270Features and packages:
271 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
272 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
273 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
274 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
275 --x-includes=DIR X include files are in DIR
276 --x-libraries=DIR X library files are in DIR
277EOF
278 if test -n "$ac_help"; then
279 echo "--enable and --with options recognized:$ac_help"
280 fi
281 exit 0 ;;
861bb6c1
JL
282
283 -host | --host | --hos | --ho)
093e61a6 284 ac_prev=host ;;
861bb6c1 285 -host=* | --host=* | --hos=* | --ho=*)
093e61a6 286 host="$ac_optarg" ;;
861bb6c1
JL
287
288 -includedir | --includedir | --includedi | --included | --include \
289 | --includ | --inclu | --incl | --inc)
290 ac_prev=includedir ;;
291 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
292 | --includ=* | --inclu=* | --incl=* | --inc=*)
093e61a6 293 includedir="$ac_optarg" ;;
861bb6c1
JL
294
295 -infodir | --infodir | --infodi | --infod | --info | --inf)
296 ac_prev=infodir ;;
297 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
093e61a6 298 infodir="$ac_optarg" ;;
861bb6c1
JL
299
300 -libdir | --libdir | --libdi | --libd)
301 ac_prev=libdir ;;
302 -libdir=* | --libdir=* | --libdi=* | --libd=*)
093e61a6 303 libdir="$ac_optarg" ;;
861bb6c1
JL
304
305 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
306 | --libexe | --libex | --libe)
307 ac_prev=libexecdir ;;
308 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
309 | --libexe=* | --libex=* | --libe=*)
093e61a6 310 libexecdir="$ac_optarg" ;;
861bb6c1
JL
311
312 -localstatedir | --localstatedir | --localstatedi | --localstated \
313 | --localstate | --localstat | --localsta | --localst \
314 | --locals | --local | --loca | --loc | --lo)
315 ac_prev=localstatedir ;;
316 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
317 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
318 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
093e61a6 319 localstatedir="$ac_optarg" ;;
861bb6c1
JL
320
321 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
322 ac_prev=mandir ;;
323 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
093e61a6 324 mandir="$ac_optarg" ;;
861bb6c1
JL
325
326 -nfp | --nfp | --nf)
327 # Obsolete; use --without-fp.
328 with_fp=no ;;
329
330 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
093e61a6 331 | --no-cr | --no-c)
861bb6c1
JL
332 no_create=yes ;;
333
334 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
335 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
336 no_recursion=yes ;;
337
338 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
339 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
340 | --oldin | --oldi | --old | --ol | --o)
341 ac_prev=oldincludedir ;;
342 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
343 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
344 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
093e61a6 345 oldincludedir="$ac_optarg" ;;
861bb6c1
JL
346
347 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
348 ac_prev=prefix ;;
349 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
093e61a6 350 prefix="$ac_optarg" ;;
861bb6c1
JL
351
352 -program-prefix | --program-prefix | --program-prefi | --program-pref \
353 | --program-pre | --program-pr | --program-p)
354 ac_prev=program_prefix ;;
355 -program-prefix=* | --program-prefix=* | --program-prefi=* \
356 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
093e61a6 357 program_prefix="$ac_optarg" ;;
861bb6c1
JL
358
359 -program-suffix | --program-suffix | --program-suffi | --program-suff \
360 | --program-suf | --program-su | --program-s)
361 ac_prev=program_suffix ;;
362 -program-suffix=* | --program-suffix=* | --program-suffi=* \
363 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
093e61a6 364 program_suffix="$ac_optarg" ;;
861bb6c1
JL
365
366 -program-transform-name | --program-transform-name \
367 | --program-transform-nam | --program-transform-na \
368 | --program-transform-n | --program-transform- \
369 | --program-transform | --program-transfor \
370 | --program-transfo | --program-transf \
371 | --program-trans | --program-tran \
372 | --progr-tra | --program-tr | --program-t)
373 ac_prev=program_transform_name ;;
374 -program-transform-name=* | --program-transform-name=* \
375 | --program-transform-nam=* | --program-transform-na=* \
376 | --program-transform-n=* | --program-transform-=* \
377 | --program-transform=* | --program-transfor=* \
378 | --program-transfo=* | --program-transf=* \
379 | --program-trans=* | --program-tran=* \
380 | --progr-tra=* | --program-tr=* | --program-t=*)
093e61a6 381 program_transform_name="$ac_optarg" ;;
861bb6c1
JL
382
383 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
384 | -silent | --silent | --silen | --sile | --sil)
385 silent=yes ;;
386
387 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
388 ac_prev=sbindir ;;
389 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
390 | --sbi=* | --sb=*)
093e61a6 391 sbindir="$ac_optarg" ;;
861bb6c1
JL
392
393 -sharedstatedir | --sharedstatedir | --sharedstatedi \
394 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
395 | --sharedst | --shareds | --shared | --share | --shar \
396 | --sha | --sh)
397 ac_prev=sharedstatedir ;;
398 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
399 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
400 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
401 | --sha=* | --sh=*)
093e61a6 402 sharedstatedir="$ac_optarg" ;;
861bb6c1
JL
403
404 -site | --site | --sit)
405 ac_prev=site ;;
406 -site=* | --site=* | --sit=*)
093e61a6 407 site="$ac_optarg" ;;
861bb6c1
JL
408
409 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
410 ac_prev=srcdir ;;
411 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
093e61a6 412 srcdir="$ac_optarg" ;;
861bb6c1
JL
413
414 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
415 | --syscon | --sysco | --sysc | --sys | --sy)
416 ac_prev=sysconfdir ;;
417 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
418 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
093e61a6 419 sysconfdir="$ac_optarg" ;;
861bb6c1
JL
420
421 -target | --target | --targe | --targ | --tar | --ta | --t)
093e61a6 422 ac_prev=target ;;
861bb6c1 423 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
093e61a6 424 target="$ac_optarg" ;;
861bb6c1
JL
425
426 -v | -verbose | --verbose | --verbos | --verbo | --verb)
427 verbose=yes ;;
428
093e61a6
RS
429 -version | --version | --versio | --versi | --vers)
430 echo "configure generated by autoconf version 2.13"
431 exit 0 ;;
861bb6c1
JL
432
433 -with-* | --with-*)
093e61a6 434 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
861bb6c1 435 # Reject names that are not valid shell variable names.
093e61a6
RS
436 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
437 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
438 fi
861bb6c1 439 ac_package=`echo $ac_package| sed 's/-/_/g'`
093e61a6
RS
440 case "$ac_option" in
441 *=*) ;;
861bb6c1
JL
442 *) ac_optarg=yes ;;
443 esac
093e61a6 444 eval "with_${ac_package}='$ac_optarg'" ;;
861bb6c1
JL
445
446 -without-* | --without-*)
093e61a6 447 ac_package=`echo $ac_option|sed -e 's/-*without-//'`
861bb6c1 448 # Reject names that are not valid shell variable names.
093e61a6
RS
449 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
450 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
451 fi
452 ac_package=`echo $ac_package| sed 's/-/_/g'`
453 eval "with_${ac_package}=no" ;;
861bb6c1
JL
454
455 --x)
456 # Obsolete; use --with-x.
457 with_x=yes ;;
458
459 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
460 | --x-incl | --x-inc | --x-in | --x-i)
461 ac_prev=x_includes ;;
462 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
463 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
093e61a6 464 x_includes="$ac_optarg" ;;
861bb6c1
JL
465
466 -x-libraries | --x-libraries | --x-librarie | --x-librari \
467 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
468 ac_prev=x_libraries ;;
469 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
470 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
093e61a6 471 x_libraries="$ac_optarg" ;;
861bb6c1 472
093e61a6 473 -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
861bb6c1
JL
474 ;;
475
476 *)
093e61a6
RS
477 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
478 echo "configure: warning: $ac_option: invalid host type" 1>&2
479 fi
480 if test "x$nonopt" != xNONE; then
481 { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
482 fi
483 nonopt="$ac_option"
861bb6c1
JL
484 ;;
485
486 esac
487done
488
489if test -n "$ac_prev"; then
093e61a6 490 { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
861bb6c1 491fi
861bb6c1 492
093e61a6 493trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
861bb6c1 494
093e61a6
RS
495# File descriptor usage:
496# 0 standard input
497# 1 file creation
498# 2 errors and warnings
499# 3 some systems may open it to /dev/tty
500# 4 used on the Kubota Titan
501# 6 checking for... messages and results
502# 5 compiler messages saved in config.log
503if test "$silent" = yes; then
504 exec 6>/dev/null
505else
506 exec 6>&1
507fi
508exec 5>./config.log
509
510echo "\
511This file contains any messages produced by compilers while
512running configure, to aid debugging if configure makes a mistake.
513" 1>&5
514
515# Strip out --no-create and --no-recursion so they do not pile up.
516# Also quote any args containing shell metacharacters.
517ac_configure_args=
518for ac_arg
861bb6c1 519do
093e61a6
RS
520 case "$ac_arg" in
521 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
522 | --no-cr | --no-c) ;;
523 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
524 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
525 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
526 ac_configure_args="$ac_configure_args '$ac_arg'" ;;
527 *) ac_configure_args="$ac_configure_args $ac_arg" ;;
861bb6c1
JL
528 esac
529done
530
093e61a6
RS
531# NLS nuisances.
532# Only set these to C if already set. These must not be set unconditionally
533# because not all systems understand e.g. LANG=C (notably SCO).
534# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
535# Non-C LC_CTYPE values break the ctype check.
536if test "${LANG+set}" = set; then LANG=C; export LANG; fi
537if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
538if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
539if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
cafe096b 540
093e61a6
RS
541# confdefs.h avoids OS command line length limits that DEFS can exceed.
542rm -rf conftest* confdefs.h
543# AIX cpp loses on an empty file, so make sure it contains at least a newline.
544echo > confdefs.h
861bb6c1 545
093e61a6
RS
546# A filename unique to this package, relative to the directory that
547# configure is in, which we can look for to find out if srcdir is correct.
548ac_unique_file=tree.c
861bb6c1
JL
549
550# Find the source files, if location was not specified.
551if test -z "$srcdir"; then
552 ac_srcdir_defaulted=yes
553 # Try the directory containing this script, then its parent.
093e61a6
RS
554 ac_prog=$0
555 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
556 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
861bb6c1
JL
557 srcdir=$ac_confdir
558 if test ! -r $srcdir/$ac_unique_file; then
559 srcdir=..
560 fi
561else
562 ac_srcdir_defaulted=no
563fi
564if test ! -r $srcdir/$ac_unique_file; then
565 if test "$ac_srcdir_defaulted" = yes; then
093e61a6 566 { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
789b7de5 567 else
093e61a6 568 { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
861bb6c1
JL
569 fi
570fi
093e61a6 571srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
861bb6c1 572
093e61a6 573# Prefer explicitly selected file to automatically selected ones.
96ef4bdc
MM
574if test -z "$CONFIG_SITE"; then
575 if test "x$prefix" != xNONE; then
576 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
577 else
578 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
093e61a6
RS
579 fi
580fi
581for ac_site_file in $CONFIG_SITE; do
582 if test -r "$ac_site_file"; then
583 echo "loading site script $ac_site_file"
584 . "$ac_site_file"
585 fi
586done
587
588if test -r "$cache_file"; then
589 echo "loading cache $cache_file"
590 . $cache_file
591else
592 echo "creating cache $cache_file"
593 > $cache_file
594fi
861bb6c1 595
093e61a6
RS
596ac_ext=c
597# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
598ac_cpp='$CPP $CPPFLAGS'
599ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
600ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
601cross_compiling=$ac_cv_prog_cc_cross
602
603ac_exeext=
604ac_objext=o
605if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
606 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
607 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
608 ac_n= ac_c='
609' ac_t=' '
610 else
611 ac_n=-n ac_c= ac_t=
612 fi
613else
614 ac_n= ac_c='\c' ac_t=
615fi
861bb6c1
JL
616
617
618
619
093e61a6
RS
620# Determine the host, build, and target systems
621ac_aux_dir=
622for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
623 if test -f $ac_dir/install-sh; then
624 ac_aux_dir=$ac_dir
625 ac_install_sh="$ac_aux_dir/install-sh -c"
626 break
627 elif test -f $ac_dir/install.sh; then
628 ac_aux_dir=$ac_dir
629 ac_install_sh="$ac_aux_dir/install.sh -c"
630 break
631 fi
632done
633if test -z "$ac_aux_dir"; then
634 { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
635fi
636ac_config_guess=$ac_aux_dir/config.guess
637ac_config_sub=$ac_aux_dir/config.sub
638ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
13c22933
JJ
639
640
093e61a6
RS
641# Do some error checking and defaulting for the host and target type.
642# The inputs are:
643# configure --host=HOST --target=TARGET --build=BUILD NONOPT
644#
645# The rules are:
646# 1. You are not allowed to specify --host, --target, and nonopt at the
647# same time.
648# 2. Host defaults to nonopt.
649# 3. If nonopt is not specified, then host defaults to the current host,
650# as determined by config.guess.
651# 4. Target and build default to nonopt.
652# 5. If nonopt is not specified, then target and build default to host.
13c22933 653
093e61a6
RS
654# The aliases save the names the user supplied, while $host etc.
655# will get canonicalized.
656case $host---$target---$nonopt in
657NONE---*---* | *---NONE---* | *---*---NONE) ;;
658*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
659esac
13c22933
JJ
660
661
093e61a6
RS
662# Make sure we can run config.sub.
663if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
664else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
13c22933
JJ
665fi
666
093e61a6 667echo $ac_n "checking host system type""... $ac_c" 1>&6
96ef4bdc 668echo "configure:669: checking host system type" >&5
13c22933 669
093e61a6
RS
670host_alias=$host
671case "$host_alias" in
672NONE)
673 case $nonopt in
674 NONE)
675 if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
676 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
677 fi ;;
678 *) host_alias=$nonopt ;;
679 esac ;;
680esac
13c22933 681
093e61a6
RS
682host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
683host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
684host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
685host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
686echo "$ac_t""$host" 1>&6
687
688echo $ac_n "checking target system type""... $ac_c" 1>&6
96ef4bdc 689echo "configure:690: checking target system type" >&5
093e61a6
RS
690
691target_alias=$target
692case "$target_alias" in
693NONE)
694 case $nonopt in
695 NONE) target_alias=$host_alias ;;
696 *) target_alias=$nonopt ;;
697 esac ;;
698esac
13c22933 699
093e61a6
RS
700target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
701target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
702target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
703target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
704echo "$ac_t""$target" 1>&6
705
706echo $ac_n "checking build system type""... $ac_c" 1>&6
96ef4bdc 707echo "configure:708: checking build system type" >&5
093e61a6
RS
708
709build_alias=$build
710case "$build_alias" in
711NONE)
712 case $nonopt in
713 NONE) build_alias=$host_alias ;;
714 *) build_alias=$nonopt ;;
715 esac ;;
716esac
717
718build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
719build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
720build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
721build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
722echo "$ac_t""$build" 1>&6
13c22933 723
093e61a6
RS
724test "$host_alias" != "$target_alias" &&
725 test "$program_prefix$program_suffix$program_transform_name" = \
726 NONENONEs,x,x, &&
727 program_prefix=${target_alias}-
13c22933 728
73458fb7 729
4665e56c
NN
730# Determine the target- and build-specific subdirectories
731 case ${build_alias} in
732 "") build_noncanonical=${build} ;;
733 *) build_noncanonical=${build_alias} ;;
734esac
73458fb7 735
4665e56c
NN
736 case ${host_alias} in
737 "") host_noncanonical=${build_noncanonical} ;;
738 *) host_noncanonical=${host_alias} ;;
739esac
73458fb7 740
4665e56c
NN
741 case ${target_alias} in
742 "") target_noncanonical=${host_noncanonical} ;;
743 *) target_noncanonical=${target_alias} ;;
744esac
093e61a6 745
4665e56c
NN
746 # Prefix 'build-' so this never conflicts with target_subdir.
747build_subdir="build-${build_noncanonical}"
748# Not really a subdirectory, but here for completeness.
749host_subdir=.
750# No prefix.
751target_subdir=${target_noncanonical}
752
73458fb7 753
093e61a6
RS
754# Set program_transform_name
755if test "$program_transform_name" = s,x,x,; then
756 program_transform_name=
13c22933 757else
093e61a6
RS
758 # Double any \ or $. echo might interpret backslashes.
759 cat <<\EOF_SED > conftestsed
760s,\\,\\\\,g; s,\$,$$,g
761EOF_SED
762 program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
763 rm -f conftestsed
cafe096b 764fi
13c22933 765test "$program_prefix" != NONE &&
093e61a6 766 program_transform_name="s,^,${program_prefix},; $program_transform_name"
13c22933
JJ
767# Use a double $ so make ignores it.
768test "$program_suffix" != NONE &&
093e61a6
RS
769 program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
770
771# sed with no file args requires a program.
772test "$program_transform_name" = "" && program_transform_name="s,x,x,"
13c22933
JJ
773
774
34a86c2b
NN
775# Check for bogus environment variables.
776# Test if LIBRARY_PATH contains the notation for the current directory
777# since this would lead to problems installing/building glibc.
778# LIBRARY_PATH contains the current directory if one of the following
779# is true:
780# - one of the terminals (":" and ";") is the first or last sign
781# - two terminals occur directly after each other
782# - the path contains an element with a dot in it
093e61a6 783echo $ac_n "checking LIBRARY_PATH variable""... $ac_c" 1>&6
4665e56c 784echo "configure:785: checking LIBRARY_PATH variable" >&5
34a86c2b
NN
785case ${LIBRARY_PATH} in
786 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
787 library_path_setting="contains current directory"
788 ;;
789 *)
790 library_path_setting="ok"
791 ;;
792esac
093e61a6 793echo "$ac_t""$library_path_setting" 1>&6
34a86c2b 794if test "$library_path_setting" != "ok"; then
093e61a6 795{ echo "configure: error:
34a86c2b
NN
796*** LIBRARY_PATH shouldn't contain the current directory when
797*** building gcc. Please change the environment variable
093e61a6 798*** and run configure again." 1>&2; exit 1; }
e9a25f70
JL
799fi
800
34a86c2b
NN
801# Test if GCC_EXEC_PREFIX contains the notation for the current directory
802# since this would lead to problems installing/building glibc.
803# GCC_EXEC_PREFIX contains the current directory if one of the following
804# is true:
805# - one of the terminals (":" and ";") is the first or last sign
806# - two terminals occur directly after each other
807# - the path contains an element with a dot in it
093e61a6 808echo $ac_n "checking GCC_EXEC_PREFIX variable""... $ac_c" 1>&6
4665e56c 809echo "configure:810: checking GCC_EXEC_PREFIX variable" >&5
34a86c2b
NN
810case ${GCC_EXEC_PREFIX} in
811 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
812 gcc_exec_prefix_setting="contains current directory"
813 ;;
814 *)
815 gcc_exec_prefix_setting="ok"
816 ;;
817esac
093e61a6 818echo "$ac_t""$gcc_exec_prefix_setting" 1>&6
34a86c2b 819if test "$gcc_exec_prefix_setting" != "ok"; then
093e61a6 820{ echo "configure: error:
cafe096b
EC
821*** GCC_EXEC_PREFIX shouldn't contain the current directory when
822*** building gcc. Please change the environment variable
093e61a6 823*** and run configure again." 1>&2; exit 1; }
34a86c2b
NN
824fi
825
826# -----------
827# Directories
828# -----------
829
830# Specify the local prefix
831local_prefix=
832# Check whether --with-local-prefix or --without-local-prefix was given.
833if test "${with_local_prefix+set}" = set; then
834 withval="$with_local_prefix"
835 case "${withval}" in
093e61a6 836yes) { echo "configure: error: bad value ${withval} given for local include directory prefix" 1>&2; exit 1; } ;;
34a86c2b
NN
837no) ;;
838*) local_prefix=$with_local_prefix ;;
839esac
093e61a6
RS
840fi
841
34a86c2b
NN
842
843# Default local prefix if it is empty
844if test x$local_prefix = x; then
845 local_prefix=/usr/local
846fi
847
848# Don't set gcc_gxx_include_dir to gxx_include_dir since that's only
849# passed in by the toplevel make and thus we'd get different behavior
850# depending on where we built the sources.
851gcc_gxx_include_dir=
852# Specify the g++ header file directory
853# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
854if test "${with_gxx_include_dir+set}" = set; then
855 withval="$with_gxx_include_dir"
856 case "${withval}" in
093e61a6 857yes) { echo "configure: error: bad value ${withval} given for g++ include directory" 1>&2; exit 1; } ;;
34a86c2b
NN
858no) ;;
859*) gcc_gxx_include_dir=$with_gxx_include_dir ;;
860esac
093e61a6
RS
861fi
862
34a86c2b
NN
863
864if test x${gcc_gxx_include_dir} = x; then
865 if test x${enable_version_specific_runtime_libs} = xyes; then
866 gcc_gxx_include_dir='${libsubdir}/include/c++'
867 else
868 topsrcdir=${srcdir}/.. . ${srcdir}/../config.if
869 gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/"${libstdcxx_incdir}
870 fi
871fi
872
873# Check whether --with-cpp_install_dir or --without-cpp_install_dir was given.
874if test "${with_cpp_install_dir+set}" = set; then
875 withval="$with_cpp_install_dir"
876 if test x$withval = xyes; then
093e61a6 877 { echo "configure: error: option --with-cpp-install-dir requires an argument" 1>&2; exit 1; }
34a86c2b
NN
878elif test x$withval != xno; then
879 cpp_install_dir=$withval
880fi
093e61a6
RS
881fi
882
34a86c2b
NN
883
884# -------------------
885# Find default linker
886# -------------------
887
888# With GNU ld
889# Check whether --with-gnu-ld or --without-gnu-ld was given.
890if test "${with_gnu_ld+set}" = set; then
891 withval="$with_gnu_ld"
892 gnu_ld_flag="$with_gnu_ld"
893else
894 gnu_ld_flag=no
093e61a6 895fi
34a86c2b 896
cafe096b 897
093e61a6 898# With pre-defined ld
34a86c2b
NN
899# Check whether --with-ld or --without-ld was given.
900if test "${with_ld+set}" = set; then
901 withval="$with_ld"
902 DEFAULT_LINKER="$with_ld"
093e61a6
RS
903fi
904
34a86c2b
NN
905if test x"${DEFAULT_LINKER+set}" = x"set"; then
906 if test ! -x "$DEFAULT_LINKER"; then
093e61a6 907 echo "configure: warning: cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" 1>&2
34a86c2b
NN
908 elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
909 gnu_ld_flag=yes
910 fi
093e61a6 911 cat >> confdefs.h <<EOF
34a86c2b 912#define DEFAULT_LINKER "$DEFAULT_LINKER"
093e61a6 913EOF
34a86c2b
NN
914
915fi
916
093e61a6 917echo $ac_n "checking whether a default linker was specified""... $ac_c" 1>&6
4665e56c 918echo "configure:919: checking whether a default linker was specified" >&5
34a86c2b
NN
919if test x"${DEFAULT_LINKER+set}" = x"set"; then
920 if test x"$gnu_ld_flag" = x"no"; then
093e61a6 921 echo "$ac_t""yes ($DEFAULT_LINKER)" 1>&6
34a86c2b 922 else
093e61a6 923 echo "$ac_t""yes ($DEFAULT_LINKER - GNU ld)" 1>&6
34a86c2b
NN
924 fi
925else
093e61a6 926 echo "$ac_t""no" 1>&6
34a86c2b
NN
927fi
928
929# ----------------------
930# Find default assembler
931# ----------------------
932
933# With GNU as
934# Check whether --with-gnu-as or --without-gnu-as was given.
935if test "${with_gnu_as+set}" = set; then
936 withval="$with_gnu_as"
937 gas_flag="$with_gnu_as"
938else
939 gas_flag=no
093e61a6 940fi
34a86c2b
NN
941
942
943# Check whether --with-as or --without-as was given.
944if test "${with_as+set}" = set; then
945 withval="$with_as"
946 DEFAULT_ASSEMBLER="$with_as"
093e61a6
RS
947fi
948
34a86c2b
NN
949if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
950 if test ! -x "$DEFAULT_ASSEMBLER"; then
093e61a6 951 echo "configure: warning: cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER" 1>&2
34a86c2b
NN
952 elif $DEFAULT_ASSEMBLER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
953 gas_flag=yes
954 fi
093e61a6 955 cat >> confdefs.h <<EOF
34a86c2b 956#define DEFAULT_ASSEMBLER "$DEFAULT_ASSEMBLER"
093e61a6 957EOF
34a86c2b
NN
958
959fi
960
093e61a6 961echo $ac_n "checking whether a default assembler was specified""... $ac_c" 1>&6
4665e56c 962echo "configure:963: checking whether a default assembler was specified" >&5
34a86c2b
NN
963if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
964 if test x"$gas_flag" = x"no"; then
093e61a6 965 echo "$ac_t""yes ($DEFAULT_ASSEMBLER)" 1>&6
34a86c2b 966 else
093e61a6 967 echo "$ac_t""yes ($DEFAULT_ASSEMBLER - GNU as)" 1>&6
34a86c2b
NN
968 fi
969else
093e61a6 970 echo "$ac_t""no" 1>&6
34a86c2b
NN
971fi
972
973# ---------------
974# Find C compiler
975# ---------------
976
977# Find the native compiler
093e61a6 978# Extract the first word of "gcc", so it can be a program name with args.
34a86c2b 979set dummy gcc; ac_word=$2
093e61a6 980echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4665e56c 981echo "configure:982: checking for $ac_word" >&5
093e61a6
RS
982if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
983 echo $ac_n "(cached) $ac_c" 1>&6
34a86c2b
NN
984else
985 if test -n "$CC"; then
986 ac_cv_prog_CC="$CC" # Let the user override the test.
987else
093e61a6
RS
988 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
989 ac_dummy="$PATH"
990 for ac_dir in $ac_dummy; do
991 test -z "$ac_dir" && ac_dir=.
992 if test -f $ac_dir/$ac_word; then
993 ac_cv_prog_CC="gcc"
994 break
995 fi
996 done
997 IFS="$ac_save_ifs"
34a86c2b
NN
998fi
999fi
093e61a6 1000CC="$ac_cv_prog_CC"
34a86c2b 1001if test -n "$CC"; then
093e61a6 1002 echo "$ac_t""$CC" 1>&6
cafe096b 1003else
093e61a6 1004 echo "$ac_t""no" 1>&6
cafe096b 1005fi
cafe096b 1006
34a86c2b
NN
1007if test -z "$CC"; then
1008 # Extract the first word of "cc", so it can be a program name with args.
1009set dummy cc; ac_word=$2
093e61a6 1010echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4665e56c 1011echo "configure:1012: checking for $ac_word" >&5
093e61a6
RS
1012if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1013 echo $ac_n "(cached) $ac_c" 1>&6
e9a25f70
JL
1014else
1015 if test -n "$CC"; then
1016 ac_cv_prog_CC="$CC" # Let the user override the test.
1017else
093e61a6 1018 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
e9a25f70 1019 ac_prog_rejected=no
093e61a6
RS
1020 ac_dummy="$PATH"
1021 for ac_dir in $ac_dummy; do
1022 test -z "$ac_dir" && ac_dir=.
1023 if test -f $ac_dir/$ac_word; then
1024 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1025 ac_prog_rejected=yes
1026 continue
1027 fi
1028 ac_cv_prog_CC="cc"
1029 break
1030 fi
1031 done
1032 IFS="$ac_save_ifs"
e9a25f70
JL
1033if test $ac_prog_rejected = yes; then
1034 # We found a bogon in the path, so make sure we never use it.
1035 set dummy $ac_cv_prog_CC
1036 shift
093e61a6 1037 if test $# -gt 0; then
e9a25f70
JL
1038 # We chose a different compiler from the bogus one.
1039 # However, it has the same basename, so the bogon will be chosen
1040 # first if we set CC to just the basename; use the full file name.
1041 shift
093e61a6
RS
1042 set dummy "$ac_dir/$ac_word" "$@"
1043 shift
1044 ac_cv_prog_CC="$@"
e9a25f70
JL
1045 fi
1046fi
1047fi
1048fi
093e61a6 1049CC="$ac_cv_prog_CC"
e9a25f70 1050if test -n "$CC"; then
093e61a6 1051 echo "$ac_t""$CC" 1>&6
e9a25f70 1052else
093e61a6 1053 echo "$ac_t""no" 1>&6
e9a25f70
JL
1054fi
1055
093e61a6
RS
1056 if test -z "$CC"; then
1057 case "`uname -s`" in
1058 *win32* | *WIN32*)
1059 # Extract the first word of "cl", so it can be a program name with args.
1060set dummy cl; ac_word=$2
1061echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4665e56c 1062echo "configure:1063: checking for $ac_word" >&5
093e61a6
RS
1063if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1064 echo $ac_n "(cached) $ac_c" 1>&6
cd9e5e7c
MK
1065else
1066 if test -n "$CC"; then
1067 ac_cv_prog_CC="$CC" # Let the user override the test.
1068else
093e61a6
RS
1069 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1070 ac_dummy="$PATH"
1071 for ac_dir in $ac_dummy; do
1072 test -z "$ac_dir" && ac_dir=.
1073 if test -f $ac_dir/$ac_word; then
1074 ac_cv_prog_CC="cl"
1075 break
1076 fi
1077 done
1078 IFS="$ac_save_ifs"
cd9e5e7c
MK
1079fi
1080fi
093e61a6 1081CC="$ac_cv_prog_CC"
cd9e5e7c 1082if test -n "$CC"; then
093e61a6 1083 echo "$ac_t""$CC" 1>&6
cd9e5e7c 1084else
093e61a6 1085 echo "$ac_t""no" 1>&6
e9a25f70 1086fi
093e61a6
RS
1087 ;;
1088 esac
cafe096b 1089 fi
093e61a6 1090 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
cafe096b 1091fi
e9a25f70 1092
093e61a6 1093echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
4665e56c 1094echo "configure:1095: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
e9a25f70 1095
093e61a6
RS
1096ac_ext=c
1097# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1098ac_cpp='$CPP $CPPFLAGS'
1099ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1100ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1101cross_compiling=$ac_cv_prog_cc_cross
b27d2bd5 1102
093e61a6 1103cat > conftest.$ac_ext << EOF
b27d2bd5 1104
4665e56c 1105#line 1106 "configure"
093e61a6
RS
1106#include "confdefs.h"
1107
1108main(){return(0);}
1109EOF
4665e56c 1110if { (eval echo configure:1111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6
RS
1111 ac_cv_prog_cc_works=yes
1112 # If we can't run a trivial program, we are probably using a cross compiler.
1113 if (./conftest; exit) 2>/dev/null; then
1114 ac_cv_prog_cc_cross=no
e9a25f70 1115 else
093e61a6 1116 ac_cv_prog_cc_cross=yes
e9a25f70 1117 fi
e9a25f70 1118else
093e61a6
RS
1119 echo "configure: failed program was:" >&5
1120 cat conftest.$ac_ext >&5
1121 ac_cv_prog_cc_works=no
e9a25f70 1122fi
093e61a6
RS
1123rm -fr conftest*
1124ac_ext=c
1125# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1126ac_cpp='$CPP $CPPFLAGS'
1127ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1128ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1129cross_compiling=$ac_cv_prog_cc_cross
cafe096b 1130
093e61a6
RS
1131echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1132if test $ac_cv_prog_cc_works = no; then
1133 { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
e9a25f70 1134fi
093e61a6 1135echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
4665e56c 1136echo "configure:1137: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
093e61a6
RS
1137echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1138cross_compiling=$ac_cv_prog_cc_cross
e9a25f70 1139
093e61a6 1140echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
4665e56c 1141echo "configure:1142: checking whether we are using GNU C" >&5
093e61a6
RS
1142if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1143 echo $ac_n "(cached) $ac_c" 1>&6
1144else
1145 cat > conftest.c <<EOF
1146#ifdef __GNUC__
1147 yes;
cafe096b 1148#endif
093e61a6 1149EOF
4665e56c 1150if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
093e61a6
RS
1151 ac_cv_prog_gcc=yes
1152else
1153 ac_cv_prog_gcc=no
1154fi
1155fi
e9a25f70 1156
093e61a6 1157echo "$ac_t""$ac_cv_prog_gcc" 1>&6
cd9e5e7c 1158
093e61a6
RS
1159if test $ac_cv_prog_gcc = yes; then
1160 GCC=yes
1161else
1162 GCC=
1163fi
cafe096b 1164
093e61a6
RS
1165ac_test_CFLAGS="${CFLAGS+set}"
1166ac_save_CFLAGS="$CFLAGS"
1167CFLAGS=
1168echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
4665e56c 1169echo "configure:1170: checking whether ${CC-cc} accepts -g" >&5
093e61a6
RS
1170if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1171 echo $ac_n "(cached) $ac_c" 1>&6
1172else
1173 echo 'void f(){}' > conftest.c
1174if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
e9a25f70
JL
1175 ac_cv_prog_cc_g=yes
1176else
093e61a6 1177 ac_cv_prog_cc_g=no
e9a25f70 1178fi
093e61a6
RS
1179rm -f conftest*
1180
cafe096b 1181fi
093e61a6
RS
1182
1183echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
cd9e5e7c 1184if test "$ac_test_CFLAGS" = set; then
093e61a6 1185 CFLAGS="$ac_save_CFLAGS"
cd9e5e7c
MK
1186elif test $ac_cv_prog_cc_g = yes; then
1187 if test "$GCC" = yes; then
e9a25f70
JL
1188 CFLAGS="-g -O2"
1189 else
cd9e5e7c 1190 CFLAGS="-g"
81814e35 1191 fi
3723cad9 1192else
cd9e5e7c
MK
1193 if test "$GCC" = yes; then
1194 CFLAGS="-O2"
1195 else
1196 CFLAGS=
1197 fi
e9a25f70
JL
1198fi
1199
3ec83fc2 1200if test "x$CC" != xcc; then
093e61a6 1201 echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
4665e56c 1202echo "configure:1203: checking whether $CC and cc understand -c and -o together" >&5
3ec83fc2 1203else
093e61a6 1204 echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
4665e56c 1205echo "configure:1206: checking whether cc understands -c and -o together" >&5
3ec83fc2 1206fi
093e61a6
RS
1207set dummy $CC; ac_cc="`echo $2 |
1208 sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
1209if eval "test \"`echo '$''{'ac_cv_prog_cc_${ac_cc}_c_o'+set}'`\" = set"; then
1210 echo $ac_n "(cached) $ac_c" 1>&6
3ec83fc2 1211else
093e61a6 1212 echo 'foo(){}' > conftest.c
3ec83fc2
RH
1213# Make sure it works both with $CC and with simple cc.
1214# We do the test twice because some compilers refuse to overwrite an
1215# existing .o file with -o, though they will create one.
093e61a6 1216ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5'
4665e56c
NN
1217if { (eval echo configure:1218: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
1218 test -f conftest.o && { (eval echo configure:1219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
3ec83fc2
RH
1219then
1220 eval ac_cv_prog_cc_${ac_cc}_c_o=yes
1221 if test "x$CC" != xcc; then
1222 # Test first that cc exists at all.
4665e56c 1223 if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
093e61a6 1224 ac_try='cc -c conftest.c -o conftest.o 1>&5'
4665e56c
NN
1225 if { (eval echo configure:1226: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
1226 test -f conftest.o && { (eval echo configure:1227: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
3ec83fc2
RH
1227 then
1228 # cc works too.
1229 :
1230 else
1231 # cc exists but doesn't like -o.
1232 eval ac_cv_prog_cc_${ac_cc}_c_o=no
1233 fi
1234 fi
1235 fi
1236else
1237 eval ac_cv_prog_cc_${ac_cc}_c_o=no
1238fi
1239rm -f conftest*
1240
1241fi
1242if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
093e61a6 1243 echo "$ac_t""yes" 1>&6
3ec83fc2 1244else
093e61a6
RS
1245 echo "$ac_t""no" 1>&6
1246 cat >> confdefs.h <<\EOF
3ec83fc2 1247#define NO_MINUS_C_MINUS_O 1
093e61a6 1248EOF
3ec83fc2
RH
1249
1250fi
1251
414d23ae
HPN
1252# autoconf is lame and doesn't give us any substitution variable for this.
1253if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
1254 NO_MINUS_C_MINUS_O=yes
1255else
1256 OUTPUT_OPTION='-o $@'
1257fi
1258
1259
1260
73458fb7
NN
1261# -------------------------
1262# Check C compiler features
1263# -------------------------
1264
093e61a6 1265echo $ac_n "checking whether ${CC-cc} accepts -Wno-long-long""... $ac_c" 1>&6
4665e56c 1266echo "configure:1267: checking whether ${CC-cc} accepts -Wno-long-long" >&5
093e61a6
RS
1267if eval "test \"`echo '$''{'ac_cv_prog_cc_no_long_long'+set}'`\" = set"; then
1268 echo $ac_n "(cached) $ac_c" 1>&6
75e93faa
ZW
1269else
1270 save_CFLAGS="$CFLAGS"
1271CFLAGS="-Wno-long-long"
093e61a6 1272cat > conftest.$ac_ext <<EOF
4665e56c 1273#line 1274 "configure"
093e61a6 1274#include "confdefs.h"
75e93faa 1275
093e61a6 1276int main() {
75e93faa 1277
093e61a6
RS
1278; return 0; }
1279EOF
4665e56c 1280if { (eval echo configure:1281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 1281 rm -rf conftest*
34a86c2b 1282 ac_cv_prog_cc_no_long_long=yes
200ef634 1283else
093e61a6
RS
1284 echo "configure: failed program was:" >&5
1285 cat conftest.$ac_ext >&5
1286 rm -rf conftest*
1287 ac_cv_prog_cc_no_long_long=no
200ef634 1288fi
093e61a6 1289rm -f conftest*
34a86c2b 1290CFLAGS="$save_CFLAGS"
75e93faa
ZW
1291fi
1292
093e61a6
RS
1293echo "$ac_t""$ac_cv_prog_cc_no_long_long" 1>&6
1294
1295echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
4665e56c 1296echo "configure:1297: checking how to run the C preprocessor" >&5
84c041a1
ZW
1297# On Suns, sometimes $CPP names a directory.
1298if test -n "$CPP" && test -d "$CPP"; then
1299 CPP=
1300fi
1301if test -z "$CPP"; then
093e61a6
RS
1302if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1303 echo $ac_n "(cached) $ac_c" 1>&6
84c041a1 1304else
093e61a6
RS
1305 # This must be in double quotes, not single quotes, because CPP may get
1306 # substituted into the Makefile and "${CC-cc}" will confuse make.
1307 CPP="${CC-cc} -E"
84c041a1 1308 # On the NeXT, cc -E runs the code through the compiler's parser,
093e61a6
RS
1309 # not just through cpp.
1310 cat > conftest.$ac_ext <<EOF
4665e56c 1311#line 1312 "configure"
093e61a6
RS
1312#include "confdefs.h"
1313#include <assert.h>
1314Syntax Error
1315EOF
1316ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4665e56c 1317{ (eval echo configure:1318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
093e61a6
RS
1318ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1319if test -z "$ac_err"; then
84c041a1
ZW
1320 :
1321else
093e61a6
RS
1322 echo "$ac_err" >&5
1323 echo "configure: failed program was:" >&5
1324 cat conftest.$ac_ext >&5
1325 rm -rf conftest*
1326 CPP="${CC-cc} -E -traditional-cpp"
1327 cat > conftest.$ac_ext <<EOF
4665e56c 1328#line 1329 "configure"
093e61a6
RS
1329#include "confdefs.h"
1330#include <assert.h>
1331Syntax Error
1332EOF
1333ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4665e56c 1334{ (eval echo configure:1335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
093e61a6
RS
1335ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1336if test -z "$ac_err"; then
1337 :
cafe096b 1338else
093e61a6
RS
1339 echo "$ac_err" >&5
1340 echo "configure: failed program was:" >&5
1341 cat conftest.$ac_ext >&5
1342 rm -rf conftest*
1343 CPP="${CC-cc} -nologo -E"
1344 cat > conftest.$ac_ext <<EOF
4665e56c 1345#line 1346 "configure"
093e61a6
RS
1346#include "confdefs.h"
1347#include <assert.h>
1348Syntax Error
1349EOF
1350ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4665e56c 1351{ (eval echo configure:1352: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
093e61a6
RS
1352ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1353if test -z "$ac_err"; then
1354 :
cafe096b 1355else
093e61a6
RS
1356 echo "$ac_err" >&5
1357 echo "configure: failed program was:" >&5
1358 cat conftest.$ac_ext >&5
1359 rm -rf conftest*
1360 CPP=/lib/cpp
cafe096b 1361fi
093e61a6 1362rm -f conftest*
cafe096b 1363fi
093e61a6 1364rm -f conftest*
cafe096b 1365fi
093e61a6
RS
1366rm -f conftest*
1367 ac_cv_prog_CPP="$CPP"
414d23ae 1368fi
093e61a6 1369 CPP="$ac_cv_prog_CPP"
414d23ae 1370else
093e61a6 1371 ac_cv_prog_CPP="$CPP"
414d23ae 1372fi
093e61a6 1373echo "$ac_t""$CPP" 1>&6
414d23ae 1374
093e61a6 1375echo $ac_n "checking for inline""... $ac_c" 1>&6
4665e56c 1376echo "configure:1377: checking for inline" >&5
093e61a6
RS
1377if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1378 echo $ac_n "(cached) $ac_c" 1>&6
414d23ae
HPN
1379else
1380 ac_cv_c_inline=no
1381for ac_kw in inline __inline__ __inline; do
093e61a6 1382 cat > conftest.$ac_ext <<EOF
4665e56c 1383#line 1384 "configure"
093e61a6 1384#include "confdefs.h"
414d23ae 1385
093e61a6
RS
1386int main() {
1387} $ac_kw foo() {
1388; return 0; }
1389EOF
4665e56c 1390if { (eval echo configure:1391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 1391 rm -rf conftest*
414d23ae
HPN
1392 ac_cv_c_inline=$ac_kw; break
1393else
093e61a6
RS
1394 echo "configure: failed program was:" >&5
1395 cat conftest.$ac_ext >&5
414d23ae 1396fi
093e61a6 1397rm -f conftest*
414d23ae
HPN
1398done
1399
1400fi
093e61a6
RS
1401
1402echo "$ac_t""$ac_cv_c_inline" 1>&6
1403case "$ac_cv_c_inline" in
414d23ae 1404 inline | yes) ;;
093e61a6
RS
1405 no) cat >> confdefs.h <<\EOF
1406#define inline
1407EOF
414d23ae 1408 ;;
093e61a6 1409 *) cat >> confdefs.h <<EOF
414d23ae 1410#define inline $ac_cv_c_inline
093e61a6 1411EOF
414d23ae
HPN
1412 ;;
1413esac
1414
093e61a6 1415echo $ac_n "checking for volatile""... $ac_c" 1>&6
4665e56c 1416echo "configure:1417: checking for volatile" >&5
093e61a6
RS
1417if eval "test \"`echo '$''{'gcc_cv_c_volatile'+set}'`\" = set"; then
1418 echo $ac_n "(cached) $ac_c" 1>&6
414d23ae 1419else
093e61a6 1420 cat > conftest.$ac_ext <<EOF
4665e56c 1421#line 1422 "configure"
093e61a6 1422#include "confdefs.h"
414d23ae 1423
093e61a6 1424int main() {
414d23ae 1425volatile int foo;
093e61a6
RS
1426; return 0; }
1427EOF
4665e56c 1428if { (eval echo configure:1429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 1429 rm -rf conftest*
414d23ae
HPN
1430 gcc_cv_c_volatile=yes
1431else
093e61a6
RS
1432 echo "configure: failed program was:" >&5
1433 cat conftest.$ac_ext >&5
1434 rm -rf conftest*
1435 gcc_cv_c_volatile=no
414d23ae 1436fi
093e61a6 1437rm -f conftest*
414d23ae 1438fi
cafe096b 1439
093e61a6
RS
1440echo "$ac_t""$gcc_cv_c_volatile" 1>&6
1441if test $gcc_cv_c_volatile = yes ; then
1442 cat >> confdefs.h <<\EOF
414d23ae 1443#define HAVE_VOLATILE 1
093e61a6 1444EOF
414d23ae
HPN
1445
1446fi
1447
1448
093e61a6 1449echo $ac_n "checking for long double""... $ac_c" 1>&6
4665e56c 1450echo "configure:1451: checking for long double" >&5
093e61a6
RS
1451if eval "test \"`echo '$''{'gcc_cv_c_long_double'+set}'`\" = set"; then
1452 echo $ac_n "(cached) $ac_c" 1>&6
414d23ae
HPN
1453else
1454 if test "$GCC" = yes; then
1455 gcc_cv_c_long_double=yes
1456else
093e61a6 1457cat > conftest.$ac_ext <<EOF
4665e56c 1458#line 1459 "configure"
093e61a6 1459#include "confdefs.h"
414d23ae 1460
093e61a6 1461int main() {
414d23ae
HPN
1462/* The Stardent Vistra knows sizeof(long double), but does not support it. */
1463long double foo = 0.0;
1464/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
1465switch (0) case 0: case (sizeof(long double) >= sizeof(double)):;
093e61a6
RS
1466; return 0; }
1467EOF
4665e56c 1468if { (eval echo configure:1469: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 1469 rm -rf conftest*
414d23ae
HPN
1470 gcc_cv_c_long_double=yes
1471else
093e61a6
RS
1472 echo "configure: failed program was:" >&5
1473 cat conftest.$ac_ext >&5
1474 rm -rf conftest*
1475 gcc_cv_c_long_double=no
414d23ae 1476fi
093e61a6 1477rm -f conftest*
414d23ae
HPN
1478fi
1479fi
cafe096b 1480
093e61a6
RS
1481echo "$ac_t""$gcc_cv_c_long_double" 1>&6
1482if test $gcc_cv_c_long_double = yes; then
1483 cat >> confdefs.h <<\EOF
414d23ae 1484#define HAVE_LONG_DOUBLE 1
093e61a6 1485EOF
414d23ae
HPN
1486
1487fi
1488
093e61a6 1489echo $ac_n "checking for long long int""... $ac_c" 1>&6
4665e56c 1490echo "configure:1491: checking for long long int" >&5
093e61a6
RS
1491if eval "test \"`echo '$''{'ac_cv_c_long_long'+set}'`\" = set"; then
1492 echo $ac_n "(cached) $ac_c" 1>&6
414d23ae 1493else
093e61a6 1494 cat > conftest.$ac_ext <<EOF
4665e56c 1495#line 1496 "configure"
093e61a6 1496#include "confdefs.h"
414d23ae 1497
093e61a6 1498int main() {
414d23ae 1499long long int i;
093e61a6
RS
1500; return 0; }
1501EOF
4665e56c 1502if { (eval echo configure:1503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 1503 rm -rf conftest*
414d23ae
HPN
1504 ac_cv_c_long_long=yes
1505else
093e61a6
RS
1506 echo "configure: failed program was:" >&5
1507 cat conftest.$ac_ext >&5
1508 rm -rf conftest*
1509 ac_cv_c_long_long=no
414d23ae 1510fi
093e61a6 1511rm -f conftest*
414d23ae 1512fi
cafe096b 1513
093e61a6
RS
1514echo "$ac_t""$ac_cv_c_long_long" 1>&6
1515 if test $ac_cv_c_long_long = yes; then
1516 cat >> confdefs.h <<\EOF
414d23ae 1517#define HAVE_LONG_LONG 1
093e61a6 1518EOF
414d23ae
HPN
1519
1520 fi
093e61a6 1521echo $ac_n "checking for __int64""... $ac_c" 1>&6
4665e56c 1522echo "configure:1523: checking for __int64" >&5
093e61a6
RS
1523if eval "test \"`echo '$''{'ac_cv_c___int64'+set}'`\" = set"; then
1524 echo $ac_n "(cached) $ac_c" 1>&6
1525else
1526 cat > conftest.$ac_ext <<EOF
4665e56c 1527#line 1528 "configure"
093e61a6 1528#include "confdefs.h"
414d23ae 1529
093e61a6 1530int main() {
414d23ae 1531__int64 i;
093e61a6
RS
1532; return 0; }
1533EOF
4665e56c 1534if { (eval echo configure:1535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 1535 rm -rf conftest*
414d23ae
HPN
1536 ac_cv_c___int64=yes
1537else
093e61a6
RS
1538 echo "configure: failed program was:" >&5
1539 cat conftest.$ac_ext >&5
1540 rm -rf conftest*
1541 ac_cv_c___int64=no
414d23ae 1542fi
093e61a6 1543rm -f conftest*
414d23ae 1544fi
cafe096b 1545
093e61a6
RS
1546echo "$ac_t""$ac_cv_c___int64" 1>&6
1547 if test $ac_cv_c___int64 = yes; then
1548 cat >> confdefs.h <<\EOF
414d23ae 1549#define HAVE___INT64 1
093e61a6 1550EOF
414d23ae
HPN
1551
1552 fi
1553
093e61a6 1554echo $ac_n "checking for built-in _Bool""... $ac_c" 1>&6
4665e56c 1555echo "configure:1556: checking for built-in _Bool" >&5
093e61a6
RS
1556if eval "test \"`echo '$''{'gcc_cv_c__bool'+set}'`\" = set"; then
1557 echo $ac_n "(cached) $ac_c" 1>&6
414d23ae 1558else
093e61a6 1559 cat > conftest.$ac_ext <<EOF
4665e56c 1560#line 1561 "configure"
093e61a6 1561#include "confdefs.h"
414d23ae 1562
093e61a6 1563int main() {
414d23ae 1564_Bool foo;
093e61a6
RS
1565; return 0; }
1566EOF
4665e56c 1567if { (eval echo configure:1568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 1568 rm -rf conftest*
414d23ae
HPN
1569 gcc_cv_c__bool=yes
1570else
093e61a6
RS
1571 echo "configure: failed program was:" >&5
1572 cat conftest.$ac_ext >&5
1573 rm -rf conftest*
1574 gcc_cv_c__bool=no
414d23ae 1575fi
093e61a6 1576rm -f conftest*
414d23ae 1577
cafe096b 1578fi
cafe096b 1579
093e61a6
RS
1580echo "$ac_t""$gcc_cv_c__bool" 1>&6
1581if test $gcc_cv_c__bool = yes; then
1582 cat >> confdefs.h <<\EOF
414d23ae 1583#define HAVE__BOOL 1
093e61a6 1584EOF
414d23ae
HPN
1585
1586fi
1587
1588
1589# sizeof(char) is 1 by definition.
093e61a6 1590echo $ac_n "checking size of short""... $ac_c" 1>&6
4665e56c 1591echo "configure:1592: checking size of short" >&5
093e61a6
RS
1592if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
1593 echo $ac_n "(cached) $ac_c" 1>&6
414d23ae 1594else
4977bab6 1595 for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
093e61a6 1596 cat > conftest.$ac_ext <<EOF
4665e56c 1597#line 1598 "configure"
093e61a6 1598#include "confdefs.h"
414d23ae
HPN
1599#include "confdefs.h"
1600#include <sys/types.h>
1601
1602
093e61a6 1603int main() {
414d23ae 1604switch (0) case 0: case (sizeof (short) == $ac_size):;
093e61a6
RS
1605; return 0; }
1606EOF
4665e56c 1607if { (eval echo configure:1608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 1608 rm -rf conftest*
414d23ae
HPN
1609 ac_cv_sizeof_short=$ac_size
1610else
093e61a6
RS
1611 echo "configure: failed program was:" >&5
1612 cat conftest.$ac_ext >&5
84c041a1 1613fi
093e61a6 1614rm -f conftest*
414d23ae
HPN
1615 if test x$ac_cv_sizeof_short != x ; then break; fi
1616done
1617
84c041a1 1618fi
414d23ae
HPN
1619
1620if test x$ac_cv_sizeof_short = x ; then
093e61a6 1621 { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; }
84c041a1 1622fi
093e61a6
RS
1623echo "$ac_t""$ac_cv_sizeof_short" 1>&6
1624cat >> confdefs.h <<EOF
414d23ae 1625#define SIZEOF_SHORT $ac_cv_sizeof_short
093e61a6 1626EOF
84c041a1 1627
414d23ae 1628
093e61a6 1629echo $ac_n "checking size of int""... $ac_c" 1>&6
4665e56c 1630echo "configure:1631: checking size of int" >&5
093e61a6
RS
1631if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
1632 echo $ac_n "(cached) $ac_c" 1>&6
75e93faa 1633else
4977bab6 1634 for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
093e61a6 1635 cat > conftest.$ac_ext <<EOF
4665e56c 1636#line 1637 "configure"
093e61a6 1637#include "confdefs.h"
414d23ae
HPN
1638#include "confdefs.h"
1639#include <sys/types.h>
1640
75e93faa 1641
093e61a6 1642int main() {
414d23ae 1643switch (0) case 0: case (sizeof (int) == $ac_size):;
093e61a6
RS
1644; return 0; }
1645EOF
4665e56c 1646if { (eval echo configure:1647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 1647 rm -rf conftest*
414d23ae 1648 ac_cv_sizeof_int=$ac_size
75e93faa 1649else
093e61a6
RS
1650 echo "configure: failed program was:" >&5
1651 cat conftest.$ac_ext >&5
75e93faa 1652fi
093e61a6 1653rm -f conftest*
414d23ae 1654 if test x$ac_cv_sizeof_int != x ; then break; fi
75e93faa
ZW
1655done
1656
1657fi
1658
414d23ae 1659if test x$ac_cv_sizeof_int = x ; then
093e61a6 1660 { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; }
414d23ae 1661fi
093e61a6
RS
1662echo "$ac_t""$ac_cv_sizeof_int" 1>&6
1663cat >> confdefs.h <<EOF
414d23ae 1664#define SIZEOF_INT $ac_cv_sizeof_int
093e61a6 1665EOF
75e93faa 1666
414d23ae 1667
093e61a6 1668echo $ac_n "checking size of long""... $ac_c" 1>&6
4665e56c 1669echo "configure:1670: checking size of long" >&5
093e61a6
RS
1670if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
1671 echo $ac_n "(cached) $ac_c" 1>&6
75e93faa 1672else
4977bab6 1673 for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
093e61a6 1674 cat > conftest.$ac_ext <<EOF
4665e56c 1675#line 1676 "configure"
093e61a6 1676#include "confdefs.h"
75e93faa 1677#include "confdefs.h"
414d23ae
HPN
1678#include <sys/types.h>
1679
75e93faa 1680
093e61a6 1681int main() {
414d23ae 1682switch (0) case 0: case (sizeof (long) == $ac_size):;
093e61a6
RS
1683; return 0; }
1684EOF
4665e56c 1685if { (eval echo configure:1686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 1686 rm -rf conftest*
414d23ae 1687 ac_cv_sizeof_long=$ac_size
75e93faa 1688else
093e61a6
RS
1689 echo "configure: failed program was:" >&5
1690 cat conftest.$ac_ext >&5
75e93faa 1691fi
093e61a6 1692rm -f conftest*
414d23ae
HPN
1693 if test x$ac_cv_sizeof_long != x ; then break; fi
1694done
75e93faa 1695
414d23ae 1696fi
75e93faa 1697
414d23ae 1698if test x$ac_cv_sizeof_long = x ; then
093e61a6 1699 { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; }
75e93faa 1700fi
093e61a6
RS
1701echo "$ac_t""$ac_cv_sizeof_long" 1>&6
1702cat >> confdefs.h <<EOF
414d23ae 1703#define SIZEOF_LONG $ac_cv_sizeof_long
093e61a6 1704EOF
75e93faa
ZW
1705
1706
414d23ae 1707if test $ac_cv_c_long_long = yes; then
093e61a6 1708 echo $ac_n "checking size of long long""... $ac_c" 1>&6
4665e56c 1709echo "configure:1710: checking size of long long" >&5
093e61a6
RS
1710if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
1711 echo $ac_n "(cached) $ac_c" 1>&6
04cabffc 1712else
4977bab6 1713 for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
093e61a6 1714 cat > conftest.$ac_ext <<EOF
4665e56c 1715#line 1716 "configure"
093e61a6 1716#include "confdefs.h"
414d23ae
HPN
1717#include "confdefs.h"
1718#include <sys/types.h>
1719
04cabffc 1720
093e61a6 1721int main() {
414d23ae 1722switch (0) case 0: case (sizeof (long long) == $ac_size):;
093e61a6
RS
1723; return 0; }
1724EOF
4665e56c 1725if { (eval echo configure:1726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 1726 rm -rf conftest*
414d23ae 1727 ac_cv_sizeof_long_long=$ac_size
04cabffc 1728else
093e61a6
RS
1729 echo "configure: failed program was:" >&5
1730 cat conftest.$ac_ext >&5
04cabffc 1731fi
093e61a6 1732rm -f conftest*
414d23ae
HPN
1733 if test x$ac_cv_sizeof_long_long != x ; then break; fi
1734done
1735
04cabffc
KG
1736fi
1737
414d23ae 1738if test x$ac_cv_sizeof_long_long = x ; then
093e61a6 1739 { echo "configure: error: cannot determine a size for long long" 1>&2; exit 1; }
414d23ae 1740fi
093e61a6
RS
1741echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
1742cat >> confdefs.h <<EOF
414d23ae 1743#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
093e61a6 1744EOF
04cabffc 1745
04cabffc 1746
414d23ae
HPN
1747fi
1748if test $ac_cv_c___int64 = yes; then
093e61a6 1749 echo $ac_n "checking size of __int64""... $ac_c" 1>&6
4665e56c 1750echo "configure:1751: checking size of __int64" >&5
093e61a6
RS
1751if eval "test \"`echo '$''{'ac_cv_sizeof___int64'+set}'`\" = set"; then
1752 echo $ac_n "(cached) $ac_c" 1>&6
75e93faa 1753else
4977bab6 1754 for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
093e61a6 1755 cat > conftest.$ac_ext <<EOF
4665e56c 1756#line 1757 "configure"
093e61a6 1757#include "confdefs.h"
414d23ae
HPN
1758#include "confdefs.h"
1759#include <sys/types.h>
1760
61842080 1761
093e61a6 1762int main() {
414d23ae 1763switch (0) case 0: case (sizeof (__int64) == $ac_size):;
093e61a6
RS
1764; return 0; }
1765EOF
4665e56c 1766if { (eval echo configure:1767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 1767 rm -rf conftest*
414d23ae 1768 ac_cv_sizeof___int64=$ac_size
75e93faa 1769else
093e61a6
RS
1770 echo "configure: failed program was:" >&5
1771 cat conftest.$ac_ext >&5
75e93faa 1772fi
093e61a6 1773rm -f conftest*
414d23ae
HPN
1774 if test x$ac_cv_sizeof___int64 != x ; then break; fi
1775done
1776
75e93faa
ZW
1777fi
1778
414d23ae 1779if test x$ac_cv_sizeof___int64 = x ; then
093e61a6 1780 { echo "configure: error: cannot determine a size for __int64" 1>&2; exit 1; }
414d23ae 1781fi
093e61a6
RS
1782echo "$ac_t""$ac_cv_sizeof___int64" 1>&6
1783cat >> confdefs.h <<EOF
414d23ae 1784#define SIZEOF___INT64 $ac_cv_sizeof___int64
093e61a6 1785EOF
414d23ae 1786
cafe096b 1787
cafe096b 1788fi
cafe096b 1789
093e61a6 1790echo $ac_n "checking execution character set""... $ac_c" 1>&6
4665e56c 1791echo "configure:1792: checking execution character set" >&5
093e61a6
RS
1792if eval "test \"`echo '$''{'ac_cv_c_charset'+set}'`\" = set"; then
1793 echo $ac_n "(cached) $ac_c" 1>&6
cafe096b 1794else
093e61a6 1795 cat > conftest.$ac_ext <<EOF
4665e56c 1796#line 1797 "configure"
093e61a6 1797#include "confdefs.h"
414d23ae
HPN
1798#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \
1799 && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21
1800ASCII
1801#endif
093e61a6 1802EOF
414d23ae 1803if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
093e61a6
RS
1804 egrep "ASCII" >/dev/null 2>&1; then
1805 rm -rf conftest*
414d23ae
HPN
1806 ac_cv_c_charset=ASCII
1807fi
1808rm -f conftest*
5c3bc9fb 1809
414d23ae 1810 if test x${ac_cv_c_charset+set} != xset; then
093e61a6 1811 cat > conftest.$ac_ext <<EOF
4665e56c 1812#line 1813 "configure"
093e61a6 1813#include "confdefs.h"
414d23ae
HPN
1814#if '\n' == 0x15 && ' ' == 0x40 && '0' == 0xF0 \
1815 && 'A' == 0xC1 && 'a' == 0x81 && '!' == 0x5A
1816EBCDIC
1817#endif
093e61a6 1818EOF
414d23ae 1819if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
093e61a6
RS
1820 egrep "EBCDIC" >/dev/null 2>&1; then
1821 rm -rf conftest*
414d23ae
HPN
1822 ac_cv_c_charset=EBCDIC
1823fi
1824rm -f conftest*
1825
1826 fi
1827 if test x${ac_cv_c_charset+set} != xset; then
1828 ac_cv_c_charset=unknown
1829 fi
1830fi
093e61a6
RS
1831
1832echo "$ac_t""$ac_cv_c_charset" 1>&6
414d23ae 1833if test $ac_cv_c_charset = unknown; then
093e61a6 1834 { echo "configure: error: *** Cannot determine host character set." 1>&2; exit 1; }
414d23ae 1835elif test $ac_cv_c_charset = EBCDIC; then
093e61a6 1836 cat >> confdefs.h <<\EOF
414d23ae 1837#define HOST_EBCDIC 1
093e61a6 1838EOF
414d23ae
HPN
1839
1840fi
1841
34a86c2b
NN
1842# -----------------
1843# Find Ada compiler
1844# -----------------
1845
1846# See if GNAT has been installed
093e61a6
RS
1847if test $host != $build; then
1848 ac_tool_prefix=${host_alias}-
1849else
1850 ac_tool_prefix=
1851fi
34a86c2b
NN
1852
1853
093e61a6 1854# Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args.
34a86c2b 1855set dummy ${ac_tool_prefix}gnatbind; ac_word=$2
093e61a6 1856echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4665e56c 1857echo "configure:1858: checking for $ac_word" >&5
093e61a6
RS
1858if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
1859 echo $ac_n "(cached) $ac_c" 1>&6
34a86c2b
NN
1860else
1861 if test -n "$GNATBIND"; then
1862 ac_cv_prog_GNATBIND="$GNATBIND" # Let the user override the test.
1863else
093e61a6
RS
1864 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1865 ac_dummy="$PATH"
1866 for ac_dir in $ac_dummy; do
1867 test -z "$ac_dir" && ac_dir=.
1868 if test -f $ac_dir/$ac_word; then
1869 ac_cv_prog_GNATBIND="${ac_tool_prefix}gnatbind"
1870 break
1871 fi
1872 done
1873 IFS="$ac_save_ifs"
34a86c2b
NN
1874fi
1875fi
093e61a6 1876GNATBIND="$ac_cv_prog_GNATBIND"
34a86c2b 1877if test -n "$GNATBIND"; then
093e61a6 1878 echo "$ac_t""$GNATBIND" 1>&6
34a86c2b 1879else
093e61a6 1880 echo "$ac_t""no" 1>&6
34a86c2b
NN
1881fi
1882
093e61a6 1883
34a86c2b 1884if test -z "$ac_cv_prog_GNATBIND"; then
093e61a6 1885if test -n "$ac_tool_prefix"; then
34a86c2b
NN
1886 # Extract the first word of "gnatbind", so it can be a program name with args.
1887set dummy gnatbind; ac_word=$2
093e61a6 1888echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4665e56c 1889echo "configure:1890: checking for $ac_word" >&5
093e61a6
RS
1890if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
1891 echo $ac_n "(cached) $ac_c" 1>&6
34a86c2b 1892else
093e61a6
RS
1893 if test -n "$GNATBIND"; then
1894 ac_cv_prog_GNATBIND="$GNATBIND" # Let the user override the test.
34a86c2b 1895else
093e61a6
RS
1896 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1897 ac_dummy="$PATH"
1898 for ac_dir in $ac_dummy; do
1899 test -z "$ac_dir" && ac_dir=.
1900 if test -f $ac_dir/$ac_word; then
1901 ac_cv_prog_GNATBIND="gnatbind"
1902 break
1903 fi
1904 done
1905 IFS="$ac_save_ifs"
1906 test -z "$ac_cv_prog_GNATBIND" && ac_cv_prog_GNATBIND="no"
34a86c2b
NN
1907fi
1908fi
093e61a6
RS
1909GNATBIND="$ac_cv_prog_GNATBIND"
1910if test -n "$GNATBIND"; then
1911 echo "$ac_t""$GNATBIND" 1>&6
34a86c2b 1912else
093e61a6 1913 echo "$ac_t""no" 1>&6
34a86c2b
NN
1914fi
1915
1916else
093e61a6
RS
1917 GNATBIND="no"
1918fi
34a86c2b
NN
1919fi
1920
093e61a6 1921echo $ac_n "checking for compiler driver that understands Ada""... $ac_c" 1>&6
4665e56c 1922echo "configure:1923: checking for compiler driver that understands Ada" >&5
093e61a6
RS
1923if eval "test \"`echo '$''{'gcc_cv_prog_adac'+set}'`\" = set"; then
1924 echo $ac_n "(cached) $ac_c" 1>&6
34a86c2b
NN
1925else
1926 cat >conftest.adb <<EOF
1927procedure conftest is begin null; end conftest;
1928EOF
1929gcc_cv_prog_adac=no
1930# Have to do ac_tool_prefix and user overrides by hand.
1931for cand in ${ADAC+"$ADAC"} ${CC+"$CC"} \
1932 ${ac_tool_prefix}gcc gcc \
1933 ${ac_tool_prefix}cc cc \
1934 ${ac_tool_prefix}gnatgcc gnatgcc \
1935 ${ac_tool_prefix}gnatcc gnatcc \
1936 ${ac_tool_prefix}adagcc adagcc \
1937 ${ac_tool_prefix}adacc adacc ; do
1938 # There is a bug in all released versions of GCC which causes the
1939 # driver to exit successfully when the appropriate language module
1940 # has not been installed. This is fixed in 2.95.4, 3.0.2, and 3.1.
1941 # Therefore we must check for the error message as well as an
1942 # unsuccessful exit.
1943 errors=`($cand -c conftest.adb) 2>&1 || echo failure`
1944 if test x"$errors" = x; then
1945 gcc_cv_prog_adac=$cand
1946 break
1947 fi
1948done
1949rm -f conftest.*
1950fi
093e61a6
RS
1951
1952echo "$ac_t""$gcc_cv_prog_adac" 1>&6
34a86c2b
NN
1953ADAC=$gcc_cv_prog_adac
1954
1955
1956if test x$GNATBIND != xno && test x$ADAC != xno; then
1957 have_gnat=yes
1958else
1959 have_gnat=no
1960fi
1961
1962
093e61a6
RS
1963if test x$have_gnat != xno ; then
1964echo $ac_n "checking whether ${ADAC} accepts -Wno-long-long""... $ac_c" 1>&6
4665e56c 1965echo "configure:1966: checking whether ${ADAC} accepts -Wno-long-long" >&5
093e61a6
RS
1966if eval "test \"`echo '$''{'ac_cv_prog_adac_no_long_long'+set}'`\" = set"; then
1967 echo $ac_n "(cached) $ac_c" 1>&6
34a86c2b
NN
1968else
1969 cat >conftest.adb <<EOF
1970procedure conftest is begin null; end conftest;
1971EOF
1972if $ADAC -Wno-long-long -c conftest.adb 1>&5 2>&5 ; then
1973 ac_cv_prog_adac_no_long_long=yes
1974else
1975 ac_cv_prog_adac_no_long_long=no
1976fi
1977rm -f conftest*
1978fi
093e61a6
RS
1979
1980echo "$ac_t""$ac_cv_prog_adac_no_long_long" 1>&6
34a86c2b
NN
1981else
1982 ac_cv_prog_adac_no_long_long=yes
1983fi
1984
1985# ---------------------
1986# Warnings and checking
1987# ---------------------
1988
1989strict1_warn=
1990if test $ac_cv_prog_cc_no_long_long = yes && \
1991 test $ac_cv_prog_adac_no_long_long = yes ; then
1992 strict1_warn="-pedantic -Wno-long-long"
1993fi
1994
1995
093e61a6 1996# If the native compiler is GCC, we can enable warnings even in stage1.
414d23ae
HPN
1997# That's useful for people building cross-compilers, or just running a
1998# quick `make'.
1999warn_cflags=
2000if test "x$GCC" = "xyes"; then
2001 warn_cflags='$(GCC_WARN_CFLAGS)'
2002fi
2003
2004
dd859b8a
KG
2005# Enable -Werror in bootstrap stage2 and later.
2006# Change the default to "no" on release branches.
2007# Check whether --enable-werror or --disable-werror was given.
2008if test "${enable_werror+set}" = set; then
2009 enableval="$enable_werror"
093e61a6 2010 :
dd859b8a
KG
2011else
2012 enable_werror=yes
093e61a6
RS
2013fi
2014
dd859b8a
KG
2015if test x$enable_werror = xyes ; then
2016 WERROR=-Werror
2017fi
2018
2019
414d23ae
HPN
2020# Enable expensive internal checks
2021# Check whether --enable-checking or --disable-checking was given.
2022if test "${enable_checking+set}" = set; then
2023 enableval="$enable_checking"
2024 ac_checking=
2025ac_tree_checking=
2026ac_rtl_checking=
2027ac_rtlflag_checking=
2028ac_gc_checking=
2029ac_gc_always_collect=
2030case "${enableval}" in
2031yes) ac_checking=1 ; ac_tree_checking=1 ; ac_gc_checking=1 ;
2032 ac_rtlflag_checking=1 ;;
2033no) ;;
2034*) IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS,"
2035 set fnord $enableval; shift
2036 IFS="$ac_save_IFS"
2037 for check
2038 do
2039 case $check in
2040 misc) ac_checking=1 ;;
2041 tree) ac_tree_checking=1 ;;
2042 rtlflag) ac_rtlflag_checking=1 ;;
2043 rtl) ac_rtl_checking=1 ;;
2044 gc) ac_gc_checking=1 ;;
2045 gcac) ac_gc_always_collect=1 ;;
2046 valgrind) ac_checking_valgrind=1 ;;
093e61a6 2047 *) { echo "configure: error: unknown check category $check" 1>&2; exit 1; } ;;
414d23ae
HPN
2048 esac
2049 done
2050 ;;
2051esac
2052
75e93faa 2053else
414d23ae
HPN
2054 # Enable some checks by default for development versions of GCC
2055ac_checking=1; ac_tree_checking=1; ac_gc_checking=1; ac_rtlflag_checking=1;
093e61a6
RS
2056fi
2057
414d23ae
HPN
2058nocommon_flag=""
2059if test x$ac_checking != x ; then
093e61a6 2060 cat >> confdefs.h <<\EOF
414d23ae 2061#define ENABLE_CHECKING 1
093e61a6 2062EOF
75e93faa 2063
414d23ae
HPN
2064 nocommon_flag=-fno-common
2065fi
827ae6cf 2066
414d23ae 2067if test x$ac_tree_checking != x ; then
093e61a6 2068 cat >> confdefs.h <<\EOF
414d23ae 2069#define ENABLE_TREE_CHECKING 1
093e61a6 2070EOF
827ae6cf
RO
2071
2072fi
414d23ae 2073if test x$ac_rtl_checking != x ; then
093e61a6 2074 cat >> confdefs.h <<\EOF
414d23ae 2075#define ENABLE_RTL_CHECKING 1
093e61a6 2076EOF
827ae6cf 2077
414d23ae
HPN
2078fi
2079if test x$ac_rtlflag_checking != x ; then
093e61a6 2080 cat >> confdefs.h <<\EOF
414d23ae 2081#define ENABLE_RTL_FLAG_CHECKING 1
093e61a6 2082EOF
827ae6cf
RO
2083
2084fi
414d23ae 2085if test x$ac_gc_checking != x ; then
093e61a6 2086 cat >> confdefs.h <<\EOF
414d23ae 2087#define ENABLE_GC_CHECKING 1
093e61a6 2088EOF
827ae6cf 2089
414d23ae
HPN
2090fi
2091if test x$ac_gc_always_collect != x ; then
093e61a6 2092 cat >> confdefs.h <<\EOF
414d23ae 2093#define ENABLE_GC_ALWAYS_COLLECT 1
093e61a6 2094EOF
75e93faa 2095
414d23ae
HPN
2096fi
2097valgrind_path_defines=
2098valgrind_command=
2099if test x$ac_checking_valgrind != x ; then
2100 # It is certainly possible that there's valgrind but no valgrind.h.
2101 # GCC relies on making annotations so we must have both.
093e61a6 2102 echo $ac_n "checking for VALGRIND_DISCARD in <memcheck.h>""... $ac_c" 1>&6
4665e56c 2103echo "configure:2104: checking for VALGRIND_DISCARD in <memcheck.h>" >&5
093e61a6 2104 cat > conftest.$ac_ext <<EOF
4665e56c 2105#line 2106 "configure"
093e61a6 2106#include "confdefs.h"
14011ca4
AJ
2107#include <memcheck.h>
2108#ifndef VALGRIND_DISCARD
2109#error VALGRIND_DISCARD not defined
2110#endif
093e61a6
RS
2111EOF
2112ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4665e56c 2113{ (eval echo configure:2114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
093e61a6
RS
2114ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2115if test -z "$ac_err"; then
2116 rm -rf conftest*
14011ca4
AJ
2117 gcc_cv_header_memcheck_h=yes
2118else
093e61a6
RS
2119 echo "$ac_err" >&5
2120 echo "configure: failed program was:" >&5
2121 cat conftest.$ac_ext >&5
2122 rm -rf conftest*
cafe096b
EC
2123 gcc_cv_header_memcheck_h=no
2124fi
cafe096b 2125rm -f conftest*
093e61a6
RS
2126 echo "$ac_t""$gcc_cv_header_memcheck_h" 1>&6
2127 ac_safe=`echo "valgrind.h" | sed 'y%./+-%__p_%'`
2128echo $ac_n "checking for valgrind.h""... $ac_c" 1>&6
4665e56c 2129echo "configure:2130: checking for valgrind.h" >&5
093e61a6
RS
2130if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2131 echo $ac_n "(cached) $ac_c" 1>&6
2132else
2133 cat > conftest.$ac_ext <<EOF
4665e56c 2134#line 2135 "configure"
093e61a6
RS
2135#include "confdefs.h"
2136#include <valgrind.h>
2137EOF
2138ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4665e56c 2139{ (eval echo configure:2140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
093e61a6
RS
2140ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2141if test -z "$ac_err"; then
2142 rm -rf conftest*
2143 eval "ac_cv_header_$ac_safe=yes"
2144else
2145 echo "$ac_err" >&5
2146 echo "configure: failed program was:" >&5
2147 cat conftest.$ac_ext >&5
2148 rm -rf conftest*
2149 eval "ac_cv_header_$ac_safe=no"
75e93faa 2150fi
093e61a6 2151rm -f conftest*
414d23ae 2152fi
093e61a6
RS
2153if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2154 echo "$ac_t""yes" 1>&6
414d23ae
HPN
2155 have_valgrind_h=yes
2156else
093e61a6
RS
2157 echo "$ac_t""no" 1>&6
2158have_valgrind_h=no
75e93faa
ZW
2159fi
2160
414d23ae
HPN
2161 # Extract the first word of "valgrind", so it can be a program name with args.
2162set dummy valgrind; ac_word=$2
093e61a6 2163echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4665e56c 2164echo "configure:2165: checking for $ac_word" >&5
093e61a6
RS
2165if eval "test \"`echo '$''{'ac_cv_path_valgrind_path'+set}'`\" = set"; then
2166 echo $ac_n "(cached) $ac_c" 1>&6
414d23ae
HPN
2167else
2168 case "$valgrind_path" in
2169 /*)
2170 ac_cv_path_valgrind_path="$valgrind_path" # Let the user override the test with a path.
2171 ;;
2172 *)
2173 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2174 for ac_dir in $PATH; do
2175 test -z "$ac_dir" && ac_dir=.
2176 if test -f $ac_dir/$ac_word; then
2177 if $ac_dir/$ac_word --version | grep valgrind- >/dev/null 2>&1; then
2178 ac_cv_path_valgrind_path="$ac_dir/$ac_word"
2179 break
2180 fi
2181 fi
2182 done
2183 IFS="$ac_save_ifs"
2184 ;;
2185esac
75e93faa 2186fi
414d23ae
HPN
2187valgrind_path="$ac_cv_path_valgrind_path"
2188if test -n "$valgrind_path"; then
093e61a6 2189 echo "$ac_t""$valgrind_path" 1>&6
414d23ae 2190else
093e61a6 2191 echo "$ac_t""no" 1>&6
414d23ae
HPN
2192fi
2193
72bd67f9 2194 if test "x$valgrind_path" = "x" || (test $have_valgrind_h = no && test $gcc_cv_header_memcheck_h = no); then
093e61a6 2195 { echo "configure: error: *** Can't find both valgrind and valgrind.h/memcheck.h" 1>&2; exit 1; }
414d23ae
HPN
2196 fi
2197 valgrind_path_defines=-DVALGRIND_PATH='\"'$valgrind_path'\"'
2198 valgrind_command="$valgrind_path -q"
093e61a6 2199 cat >> confdefs.h <<\EOF
414d23ae 2200#define ENABLE_VALGRIND_CHECKING 1
093e61a6 2201EOF
75e93faa 2202
14011ca4 2203 if test $gcc_cv_header_memcheck_h = yes; then
093e61a6 2204 cat >> confdefs.h <<\EOF
14011ca4 2205#define HAVE_MEMCHECK_H 1
093e61a6 2206EOF
14011ca4
AJ
2207
2208 fi
414d23ae 2209fi
75e93faa 2210
75e93faa
ZW
2211
2212
414d23ae
HPN
2213# Enable code coverage collection
2214# Check whether --enable-coverage or --disable-coverage was given.
2215if test "${enable_coverage+set}" = set; then
2216 enableval="$enable_coverage"
2217 case "${enableval}" in
2218yes|noopt)
eb70d86d 2219 coverage_flags="-fprofile-arcs -ftest-coverage -O0 -DSELF_COVERAGE=1"
414d23ae
HPN
2220 ;;
2221opt)
eb70d86d 2222 coverage_flags="-fprofile-arcs -ftest-coverage -O2 -DSELF_COVERAGE=2"
414d23ae
HPN
2223 ;;
2224*)
093e61a6 2225 { echo "configure: error: unknown coverage setting $enableval" 1>&2; exit 1; }
414d23ae
HPN
2226 ;;
2227esac
75e93faa 2228else
414d23ae 2229 coverage_flags=""
093e61a6
RS
2230fi
2231
5c3bc9fb 2232
414d23ae 2233
73458fb7
NN
2234# -------------------------------
2235# Miscenalleous configure options
2236# -------------------------------
34a86c2b
NN
2237
2238# With stabs
2239# Check whether --with-stabs or --without-stabs was given.
2240if test "${with_stabs+set}" = set; then
2241 withval="$with_stabs"
2242 stabs="$with_stabs"
2243else
2244 stabs=no
093e61a6 2245fi
34a86c2b 2246
cafe096b 2247
093e61a6 2248# With ELF
34a86c2b
NN
2249# Check whether --with-elf or --without-elf was given.
2250if test "${with_elf+set}" = set; then
2251 withval="$with_elf"
2252 elf="$with_elf"
2253else
2254 elf=no
093e61a6
RS
2255fi
2256
34a86c2b
NN
2257
2258# Determine whether or not multilibs are enabled.
2259# Check whether --enable-multilib or --disable-multilib was given.
2260if test "${enable_multilib+set}" = set; then
2261 enableval="$enable_multilib"
093e61a6 2262 :
34a86c2b
NN
2263else
2264 enable_multilib=yes
093e61a6
RS
2265fi
2266
75e93faa 2267
34a86c2b 2268
414d23ae
HPN
2269# Enable __cxa_atexit for C++.
2270# Check whether --enable-__cxa_atexit or --disable-__cxa_atexit was given.
2271if test "${enable___cxa_atexit+set}" = set; then
2272 enableval="$enable___cxa_atexit"
093e61a6
RS
2273 :
2274fi
75e93faa
ZW
2275
2276
414d23ae
HPN
2277# Enable Multibyte Characters for C/C++
2278# Check whether --enable-c-mbchar or --disable-c-mbchar was given.
2279if test "${enable_c_mbchar+set}" = set; then
2280 enableval="$enable_c_mbchar"
2281 if test x$enable_c_mbchar != xno; then
093e61a6 2282 cat >> confdefs.h <<\EOF
414d23ae 2283#define MULTIBYTE_CHARS 1
093e61a6 2284EOF
414d23ae
HPN
2285
2286fi
093e61a6 2287fi
75e93faa 2288
093e61a6 2289
414d23ae
HPN
2290# Enable threads
2291# Pass with no value to take the default
2292# Pass with a value to specify a thread package
2293# Check whether --enable-threads or --disable-threads was given.
2294if test "${enable_threads+set}" = set; then
2295 enableval="$enable_threads"
093e61a6 2296 :
414d23ae
HPN
2297else
2298 enable_threads=''
093e61a6
RS
2299fi
2300
414d23ae
HPN
2301
2302enable_threads_flag=$enable_threads
2303# Check if a valid thread package
2304case x${enable_threads_flag} in
2305 x | xno)
2306 # No threads
2307 target_thread_file='single'
2308 ;;
2309 xyes)
2310 # default
2311 target_thread_file=''
2312 ;;
2313 xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
6d412a7b 2314 xsolaris | xwin32 | xdce | xrtems| xvxworks | xaix | xgnat)
414d23ae
HPN
2315 target_thread_file=$enable_threads_flag
2316 ;;
2317 *)
2318 echo "$enable_threads is an unknown thread package" 1>&2
2319 exit 1
2320 ;;
2321esac
2322
2323# Check whether --enable-objc-gc or --disable-objc-gc was given.
2324if test "${enable_objc_gc+set}" = set; then
2325 enableval="$enable_objc_gc"
2326 if test x$enable_objc_gc = xno; then
2327 objc_boehm_gc=''
2328else
2329 objc_boehm_gc=1
2330fi
2331else
2332 objc_boehm_gc=''
093e61a6 2333fi
75e93faa
ZW
2334
2335
414d23ae
HPN
2336# Check whether --with-dwarf2 or --without-dwarf2 was given.
2337if test "${with_dwarf2+set}" = set; then
2338 withval="$with_dwarf2"
2339 dwarf2="$with_dwarf2"
75e93faa 2340else
414d23ae 2341 dwarf2=no
093e61a6
RS
2342fi
2343
75e93faa 2344
414d23ae
HPN
2345# Check whether --enable-shared or --disable-shared was given.
2346if test "${enable_shared+set}" = set; then
2347 enableval="$enable_shared"
093e61a6 2348
414d23ae
HPN
2349 case $enable_shared in
2350 yes | no) ;;
2351 *)
2352 enable_shared=no
2353 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2354 for pkg in $enableval; do
2355 if test "X$pkg" = "Xgcc" || test "X$pkg" = "Xlibgcc"; then
2356 enable_shared=yes
2357 fi
2358 done
2359 IFS="$ac_save_ifs"
2360 ;;
2361 esac
2362
75e93faa 2363else
414d23ae 2364 enable_shared=yes
093e61a6 2365fi
75e93faa 2366
75e93faa 2367
75e93faa 2368
4977bab6
ZW
2369# Check whether --with-sysroot or --without-sysroot was given.
2370if test "${with_sysroot+set}" = set; then
2371 withval="$with_sysroot"
093e61a6 2372
4977bab6 2373 case ${with_sysroot} in
91710e62 2374 yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;;
4977bab6
ZW
2375 *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
2376 esac
093e61a6 2377
4977bab6
ZW
2378 TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
2379 CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR)'
2380
047d636f
DJ
2381 if test "x$exec_prefix" = xNONE; then
2382 if test "x$prefix" = xNONE; then
2383 test_prefix=/usr/local
2384 else
2385 test_prefix=$prefix
2386 fi
2387 else
2388 test_prefix=$exec_prefix
2389 fi
2390 case ${TARGET_SYSTEM_ROOT} in
91710e62
AO
2391 "${test_prefix}"|"${test_prefix}/"*|\
2392 '${exec_prefix}'|'${exec_prefix}/'*)
047d636f
DJ
2393 t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
2394 TARGET_SYSTEM_ROOT_DEFINE="$t"
2395 ;;
2396 esac
2397
4977bab6 2398else
093e61a6 2399
4977bab6 2400 TARGET_SYSTEM_ROOT=
db720d9a 2401 TARGET_SYSTEM_ROOT_DEFINE=
4977bab6
ZW
2402 CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include'
2403
093e61a6
RS
2404fi
2405
4977bab6
ZW
2406
2407
2408
2409
73458fb7
NN
2410# -------------------------
2411# Checks for other programs
2412# -------------------------
5b67ad6f 2413
093e61a6 2414echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
4665e56c 2415echo "configure:2416: checking whether ${MAKE-make} sets \${MAKE}" >&5
093e61a6
RS
2416set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
2417if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
2418 echo $ac_n "(cached) $ac_c" 1>&6
e9a25f70 2419else
093e61a6 2420 cat > conftestmake <<\EOF
e9a25f70 2421all:
093e61a6
RS
2422 @echo 'ac_maketemp="${MAKE}"'
2423EOF
e9a25f70 2424# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
093e61a6 2425eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
e9a25f70
JL
2426if test -n "$ac_maketemp"; then
2427 eval ac_cv_prog_make_${ac_make}_set=yes
2428else
2429 eval ac_cv_prog_make_${ac_make}_set=no
2430fi
093e61a6 2431rm -f conftestmake
e9a25f70
JL
2432fi
2433if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
093e61a6 2434 echo "$ac_t""yes" 1>&6
e9a25f70
JL
2435 SET_MAKE=
2436else
093e61a6 2437 echo "$ac_t""no" 1>&6
e9a25f70
JL
2438 SET_MAKE="MAKE=${MAKE-make}"
2439fi
2440
2441
861bb6c1 2442# Find some useful tools
2853bc5a 2443for ac_prog in gawk mawk nawk awk
861bb6c1 2444do
093e61a6 2445# Extract the first word of "$ac_prog", so it can be a program name with args.
861bb6c1 2446set dummy $ac_prog; ac_word=$2
093e61a6 2447echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4665e56c 2448echo "configure:2449: checking for $ac_word" >&5
093e61a6
RS
2449if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2450 echo $ac_n "(cached) $ac_c" 1>&6
861bb6c1
JL
2451else
2452 if test -n "$AWK"; then
2453 ac_cv_prog_AWK="$AWK" # Let the user override the test.
2454else
093e61a6
RS
2455 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2456 ac_dummy="$PATH"
2457 for ac_dir in $ac_dummy; do
2458 test -z "$ac_dir" && ac_dir=.
2459 if test -f $ac_dir/$ac_word; then
2460 ac_cv_prog_AWK="$ac_prog"
2461 break
2462 fi
2463 done
2464 IFS="$ac_save_ifs"
861bb6c1
JL
2465fi
2466fi
093e61a6 2467AWK="$ac_cv_prog_AWK"
861bb6c1 2468if test -n "$AWK"; then
093e61a6 2469 echo "$ac_t""$AWK" 1>&6
861bb6c1 2470else
093e61a6 2471 echo "$ac_t""no" 1>&6
861bb6c1
JL
2472fi
2473
093e61a6 2474test -n "$AWK" && break
861bb6c1
JL
2475done
2476
093e61a6 2477echo $ac_n "checking whether ln works""... $ac_c" 1>&6
4665e56c 2478echo "configure:2479: checking whether ln works" >&5
093e61a6
RS
2479if eval "test \"`echo '$''{'gcc_cv_prog_LN'+set}'`\" = set"; then
2480 echo $ac_n "(cached) $ac_c" 1>&6
0a4b6309
RL
2481else
2482 rm -f conftestdata_t
2483echo >conftestdata_f
2484if ln conftestdata_f conftestdata_t 2>/dev/null
2485then
2486 gcc_cv_prog_LN="ln"
2487else
2488 if ln -s conftestdata_f conftestdata_t 2>/dev/null
2489 then
2490 gcc_cv_prog_LN="ln -s"
2491 else
2492 gcc_cv_prog_LN=cp
2493 fi
2494fi
2495rm -f conftestdata_f conftestdata_t
2496
2497fi
2498LN="$gcc_cv_prog_LN"
2499if test "$gcc_cv_prog_LN" = "ln"; then
093e61a6 2500 echo "$ac_t""yes" 1>&6
0a4b6309
RL
2501else
2502 if test "$gcc_cv_prog_LN" = "ln -s"; then
093e61a6 2503 echo "$ac_t""no, using ln -s" 1>&6
0a4b6309 2504 else
093e61a6 2505 echo "$ac_t""no, and neither does ln -s, so using cp" 1>&6
0a4b6309
RL
2506 fi
2507fi
2508
093e61a6 2509echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
4665e56c 2510echo "configure:2511: checking whether ln -s works" >&5
093e61a6
RS
2511if eval "test \"`echo '$''{'gcc_cv_prog_LN_S'+set}'`\" = set"; then
2512 echo $ac_n "(cached) $ac_c" 1>&6
0a4b6309
RL
2513else
2514 rm -f conftestdata_t
2515echo >conftestdata_f
2516if ln -s conftestdata_f conftestdata_t 2>/dev/null
2517then
2518 gcc_cv_prog_LN_S="ln -s"
2519else
2520 if ln conftestdata_f conftestdata_t 2>/dev/null
2521 then
2522 gcc_cv_prog_LN_S=ln
2523 else
2524 gcc_cv_prog_LN_S=cp
2525 fi
2526fi
2527rm -f conftestdata_f conftestdata_t
2528
2529fi
2530LN_S="$gcc_cv_prog_LN_S"
2531if test "$gcc_cv_prog_LN_S" = "ln -s"; then
093e61a6 2532 echo "$ac_t""yes" 1>&6
0a4b6309
RL
2533else
2534 if test "$gcc_cv_prog_LN_S" = "ln"; then
093e61a6 2535 echo "$ac_t""no, using ln" 1>&6
0a4b6309 2536 else
093e61a6 2537 echo "$ac_t""no, and neither does ln, so using cp" 1>&6
0a4b6309
RL
2538 fi
2539fi
2540
093e61a6
RS
2541# Extract the first word of "ranlib", so it can be a program name with args.
2542set dummy ranlib; ac_word=$2
2543echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4665e56c 2544echo "configure:2545: checking for $ac_word" >&5
093e61a6
RS
2545if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
2546 echo $ac_n "(cached) $ac_c" 1>&6
861bb6c1
JL
2547else
2548 if test -n "$RANLIB"; then
2549 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2550else
093e61a6
RS
2551 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2552 ac_dummy="$PATH"
2553 for ac_dir in $ac_dummy; do
2554 test -z "$ac_dir" && ac_dir=.
2555 if test -f $ac_dir/$ac_word; then
2556 ac_cv_prog_RANLIB="ranlib"
2557 break
2558 fi
2559 done
2560 IFS="$ac_save_ifs"
2561 test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
861bb6c1
JL
2562fi
2563fi
093e61a6 2564RANLIB="$ac_cv_prog_RANLIB"
861bb6c1 2565if test -n "$RANLIB"; then
093e61a6 2566 echo "$ac_t""$RANLIB" 1>&6
cafe096b 2567else
093e61a6 2568 echo "$ac_t""no" 1>&6
861bb6c1
JL
2569fi
2570
0a4b6309
RL
2571# Find a good install program. We prefer a C program (faster),
2572# so one script is as good as another. But avoid the broken or
2573# incompatible versions:
2574# SysV /etc/install, /usr/sbin/install
2575# SunOS /usr/etc/install
2576# IRIX /sbin/install
2577# AIX /bin/install
2578# AFS /usr/afsws/bin/install, which mishandles nonexistent args
2579# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2580# ./install, which can be erroneously created by make from ./install.sh.
093e61a6 2581echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
4665e56c 2582echo "configure:2583: checking for a BSD compatible install" >&5
0a4b6309 2583if test -z "$INSTALL"; then
093e61a6
RS
2584if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
2585 echo $ac_n "(cached) $ac_c" 1>&6
0a4b6309
RL
2586else
2587 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
2588 for ac_dir in $PATH; do
2589 # Account for people who put trailing slashes in PATH elements.
2590 case "$ac_dir/" in
2591 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2592 *)
2593 # OSF1 and SCO ODT 3.0 have their own names for install.
2594 for ac_prog in ginstall scoinst install; do
2595 if test -f $ac_dir/$ac_prog; then
2596 if test $ac_prog = install &&
2597 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2598 # AIX install. It has an incompatible calling convention.
2599 # OSF/1 installbsd also uses dspmsg, but is usable.
2600 :
2601 else
2602 ac_cv_path_install="$ac_dir/$ac_prog -c"
2603 break 2
2604 fi
2605 fi
2606 done
2607 ;;
2608 esac
2609 done
2610 IFS="$ac_save_IFS"
2611
2612fi
2613 if test "${ac_cv_path_install+set}" = set; then
2614 INSTALL="$ac_cv_path_install"
2615 else
2616 # As a last resort, use the slow shell script. We don't cache a
2617 # path for INSTALL within a source directory, because that will
2618 # break other packages using the cache if that directory is
2619 # removed, or if the path is relative.
2620 INSTALL="$ac_install_sh"
2621 fi
2622fi
093e61a6 2623echo "$ac_t""$INSTALL" 1>&6
0a4b6309
RL
2624
2625# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2626# It thinks the first close brace ends the variable substitution.
2627test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2628
2629test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2630
861bb6c1 2631
73458fb7
NN
2632# See if we have the mktemp command.
2633# Extract the first word of "mktemp", so it can be a program name with args.
2634set dummy mktemp; ac_word=$2
093e61a6 2635echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4665e56c 2636echo "configure:2637: checking for $ac_word" >&5
093e61a6
RS
2637if eval "test \"`echo '$''{'ac_cv_prog_have_mktemp_command'+set}'`\" = set"; then
2638 echo $ac_n "(cached) $ac_c" 1>&6
73458fb7
NN
2639else
2640 if test -n "$have_mktemp_command"; then
2641 ac_cv_prog_have_mktemp_command="$have_mktemp_command" # Let the user override the test.
2642else
093e61a6
RS
2643 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2644 ac_dummy="$PATH"
2645 for ac_dir in $ac_dummy; do
2646 test -z "$ac_dir" && ac_dir=.
2647 if test -f $ac_dir/$ac_word; then
2648 ac_cv_prog_have_mktemp_command="yes"
2649 break
2650 fi
2651 done
2652 IFS="$ac_save_ifs"
73458fb7
NN
2653 test -z "$ac_cv_prog_have_mktemp_command" && ac_cv_prog_have_mktemp_command="no"
2654fi
2655fi
093e61a6 2656have_mktemp_command="$ac_cv_prog_have_mktemp_command"
73458fb7 2657if test -n "$have_mktemp_command"; then
093e61a6 2658 echo "$ac_t""$have_mktemp_command" 1>&6
73458fb7 2659else
093e61a6 2660 echo "$ac_t""no" 1>&6
73458fb7
NN
2661fi
2662
2663
2664# Do we have a single-tree copy of texinfo?
2665if test -f $srcdir/../texinfo/Makefile.in; then
2666 MAKEINFO='$(objdir)/../texinfo/makeinfo/makeinfo'
2667 gcc_cv_prog_makeinfo_modern=yes
093e61a6 2668 echo "$ac_t""Using makeinfo from the unified source tree." 1>&6
73458fb7
NN
2669else
2670 # See if makeinfo has been installed and is modern enough
2671 # that we can use it.
2672 # Extract the first word of "makeinfo", so it can be a program name with args.
2673set dummy makeinfo; ac_word=$2
093e61a6 2674echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4665e56c 2675echo "configure:2676: checking for $ac_word" >&5
093e61a6
RS
2676if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then
2677 echo $ac_n "(cached) $ac_c" 1>&6
73458fb7
NN
2678else
2679 if test -n "$MAKEINFO"; then
2680 ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test.
2681else
093e61a6
RS
2682 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2683 ac_dummy="$PATH"
2684 for ac_dir in $ac_dummy; do
2685 test -z "$ac_dir" && ac_dir=.
2686 if test -f $ac_dir/$ac_word; then
2687 ac_cv_prog_MAKEINFO="makeinfo"
2688 break
2689 fi
2690 done
2691 IFS="$ac_save_ifs"
73458fb7
NN
2692fi
2693fi
093e61a6 2694MAKEINFO="$ac_cv_prog_MAKEINFO"
73458fb7 2695if test -n "$MAKEINFO"; then
093e61a6 2696 echo "$ac_t""$MAKEINFO" 1>&6
73458fb7 2697else
093e61a6 2698 echo "$ac_t""no" 1>&6
73458fb7
NN
2699fi
2700
2701if test -n "$MAKEINFO"; then
2702 # Found it, now check the version.
093e61a6 2703 echo $ac_n "checking for modern makeinfo""... $ac_c" 1>&6
4665e56c 2704echo "configure:2705: checking for modern makeinfo" >&5
093e61a6
RS
2705if eval "test \"`echo '$''{'gcc_cv_prog_makeinfo_modern'+set}'`\" = set"; then
2706 echo $ac_n "(cached) $ac_c" 1>&6
73458fb7
NN
2707else
2708 ac_prog_version=`$MAKEINFO --version 2>&1 |
2709 sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
4665e56c 2710 echo "configure:2711: version of makeinfo is $ac_prog_version" >&5
73458fb7
NN
2711 case $ac_prog_version in
2712 '') gcc_cv_prog_makeinfo_modern=no;;
2713 4.[2-9]*)
2714 gcc_cv_prog_makeinfo_modern=yes;;
2715 *) gcc_cv_prog_makeinfo_modern=no;;
2716 esac
2717
2718fi
093e61a6
RS
2719
2720echo "$ac_t""$gcc_cv_prog_makeinfo_modern" 1>&6
73458fb7
NN
2721else
2722 gcc_cv_prog_makeinfo_modern=no
2723fi
2724
2725fi
2726
2727if test $gcc_cv_prog_makeinfo_modern = no; then
093e61a6 2728 echo "configure: warning:
cafe096b 2729*** Makeinfo is missing or too old.
093e61a6 2730*** Info documentation will not be built." 1>&2
73458fb7
NN
2731 BUILD_INFO=
2732else
093e61a6 2733 BUILD_INFO=info
73458fb7
NN
2734fi
2735
2736# Is pod2man recent enough to regenerate manpages?
093e61a6 2737echo $ac_n "checking for recent Pod::Man""... $ac_c" 1>&6
4665e56c 2738echo "configure:2739: checking for recent Pod::Man" >&5
73458fb7 2739if (perl -e 'use 1.10 Pod::Man') >/dev/null 2>&1; then
093e61a6
RS
2740 echo "$ac_t""yes" 1>&6
2741 GENERATED_MANPAGES=generated-manpages
73458fb7 2742else
093e61a6 2743 echo "$ac_t""no" 1>&6
73458fb7
NN
2744 GENERATED_MANPAGES=
2745fi
2746
baade80b
PE
2747# 'make compare' can be significantly faster, if cmp itself can
2748# skip bytes instead of using tail. The test being performed is
2749# "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2"
2750# but we need to sink errors and handle broken shells.
093e61a6 2751echo $ac_n "checking for cmp's capabilities""... $ac_c" 1>&6
4665e56c 2752echo "configure:2753: checking for cmp's capabilities" >&5
baade80b
PE
2753echo abfoo >t1
2754echo cdfoo >t2
2755if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
2756 if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
2757 make_compare_target=slowcompare
2758 else
2759 make_compare_target=gnucompare
2760 fi
c7a5cf61
PE
2761else
2762 make_compare_target=slowcompare
2763fi
baade80b 2764rm t1 t2
c7a5cf61 2765
093e61a6 2766echo "$ac_t""$make_compare_target" 1>&6
c7a5cf61 2767
73458fb7
NN
2768# How about lex?
2769if test -f $srcdir/../flex/skel.c; then
2770 FLEX='$(objdir)/../flex/flex'
2771else
2772 # Extract the first word of "flex", so it can be a program name with args.
2773set dummy flex; ac_word=$2
093e61a6 2774echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4665e56c 2775echo "configure:2776: checking for $ac_word" >&5
093e61a6
RS
2776if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then
2777 echo $ac_n "(cached) $ac_c" 1>&6
73458fb7
NN
2778else
2779 if test -n "$FLEX"; then
2780 ac_cv_prog_FLEX="$FLEX" # Let the user override the test.
2781else
093e61a6
RS
2782 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2783 ac_dummy="$PATH"
2784 for ac_dir in $ac_dummy; do
2785 test -z "$ac_dir" && ac_dir=.
2786 if test -f $ac_dir/$ac_word; then
2787 ac_cv_prog_FLEX="flex"
2788 break
2789 fi
2790 done
2791 IFS="$ac_save_ifs"
73458fb7
NN
2792 test -z "$ac_cv_prog_FLEX" && ac_cv_prog_FLEX="${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing flex"
2793fi
2794fi
093e61a6 2795FLEX="$ac_cv_prog_FLEX"
73458fb7 2796if test -n "$FLEX"; then
093e61a6 2797 echo "$ac_t""$FLEX" 1>&6
73458fb7 2798else
093e61a6 2799 echo "$ac_t""no" 1>&6
73458fb7
NN
2800fi
2801
2802fi
2803
2804# Bison?
2805# The -L switch is so bison can find its skeleton file.
2806if test -f $srcdir/../bison/bison.simple; then
2807 BISON='$(objdir)/../bison/bison -L $(srcdir)/../bison/'
2808else
2809 # Extract the first word of "bison", so it can be a program name with args.
2810set dummy bison; ac_word=$2
093e61a6 2811echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4665e56c 2812echo "configure:2813: checking for $ac_word" >&5
093e61a6
RS
2813if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then
2814 echo $ac_n "(cached) $ac_c" 1>&6
73458fb7
NN
2815else
2816 if test -n "$BISON"; then
2817 ac_cv_prog_BISON="$BISON" # Let the user override the test.
2818else
093e61a6
RS
2819 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2820 ac_dummy="$PATH"
2821 for ac_dir in $ac_dummy; do
2822 test -z "$ac_dir" && ac_dir=.
2823 if test -f $ac_dir/$ac_word; then
2824 ac_cv_prog_BISON="bison"
2825 break
2826 fi
2827 done
2828 IFS="$ac_save_ifs"
73458fb7
NN
2829 test -z "$ac_cv_prog_BISON" && ac_cv_prog_BISON="${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing bison"
2830fi
2831fi
093e61a6 2832BISON="$ac_cv_prog_BISON"
73458fb7 2833if test -n "$BISON"; then
093e61a6 2834 echo "$ac_t""$BISON" 1>&6
73458fb7 2835else
093e61a6 2836 echo "$ac_t""no" 1>&6
73458fb7
NN
2837fi
2838
2839fi
2840
2841# --------------------
2842# Checks for C headers
2843# --------------------
2844
093e61a6 2845echo $ac_n "checking for GNU C library""... $ac_c" 1>&6
4665e56c 2846echo "configure:2847: checking for GNU C library" >&5
093e61a6
RS
2847if eval "test \"`echo '$''{'gcc_cv_glibc'+set}'`\" = set"; then
2848 echo $ac_n "(cached) $ac_c" 1>&6
2849else
2850 cat > conftest.$ac_ext <<EOF
4665e56c 2851#line 2852 "configure"
093e61a6 2852#include "confdefs.h"
73458fb7 2853#include <features.h>
093e61a6 2854int main() {
73458fb7
NN
2855
2856#if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2857#error Not a GNU C library system
2858#endif
093e61a6
RS
2859; return 0; }
2860EOF
4665e56c 2861if { (eval echo configure:2862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 2862 rm -rf conftest*
73458fb7
NN
2863 gcc_cv_glibc=yes
2864else
093e61a6
RS
2865 echo "configure: failed program was:" >&5
2866 cat conftest.$ac_ext >&5
2867 rm -rf conftest*
2868 gcc_cv_glibc=no
73458fb7 2869fi
093e61a6 2870rm -f conftest*
73458fb7
NN
2871fi
2872
093e61a6 2873echo "$ac_t""$gcc_cv_glibc" 1>&6
73458fb7 2874if test $gcc_cv_glibc = yes; then
093e61a6 2875 cat >> confdefs.h <<\EOF
73458fb7 2876#define _GNU_SOURCE 1
093e61a6 2877EOF
73458fb7
NN
2878
2879fi
2880
093e61a6 2881echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4665e56c 2882echo "configure:2883: checking for ANSI C header files" >&5
093e61a6
RS
2883if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
2884 echo $ac_n "(cached) $ac_c" 1>&6
956d6950 2885else
093e61a6 2886 cat > conftest.$ac_ext <<EOF
4665e56c 2887#line 2888 "configure"
093e61a6 2888#include "confdefs.h"
956d6950
JL
2889#include <stdlib.h>
2890#include <stdarg.h>
2891#include <string.h>
2892#include <float.h>
093e61a6
RS
2893EOF
2894ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4665e56c 2895{ (eval echo configure:2896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
093e61a6
RS
2896ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2897if test -z "$ac_err"; then
2898 rm -rf conftest*
956d6950
JL
2899 ac_cv_header_stdc=yes
2900else
093e61a6
RS
2901 echo "$ac_err" >&5
2902 echo "configure: failed program was:" >&5
2903 cat conftest.$ac_ext >&5
2904 rm -rf conftest*
2905 ac_cv_header_stdc=no
956d6950 2906fi
093e61a6 2907rm -f conftest*
956d6950
JL
2908
2909if test $ac_cv_header_stdc = yes; then
2910 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
093e61a6 2911cat > conftest.$ac_ext <<EOF
4665e56c 2912#line 2913 "configure"
093e61a6 2913#include "confdefs.h"
956d6950 2914#include <string.h>
093e61a6 2915EOF
956d6950 2916if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
093e61a6 2917 egrep "memchr" >/dev/null 2>&1; then
956d6950
JL
2918 :
2919else
093e61a6 2920 rm -rf conftest*
956d6950
JL
2921 ac_cv_header_stdc=no
2922fi
2923rm -f conftest*
2924
2925fi
2926
2927if test $ac_cv_header_stdc = yes; then
2928 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
093e61a6 2929cat > conftest.$ac_ext <<EOF
4665e56c 2930#line 2931 "configure"
093e61a6 2931#include "confdefs.h"
956d6950 2932#include <stdlib.h>
093e61a6 2933EOF
956d6950 2934if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
093e61a6 2935 egrep "free" >/dev/null 2>&1; then
956d6950
JL
2936 :
2937else
093e61a6 2938 rm -rf conftest*
956d6950
JL
2939 ac_cv_header_stdc=no
2940fi
2941rm -f conftest*
2942
2943fi
2944
2945if test $ac_cv_header_stdc = yes; then
2946 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
093e61a6 2947if test "$cross_compiling" = yes; then
956d6950
JL
2948 :
2949else
093e61a6 2950 cat > conftest.$ac_ext <<EOF
4665e56c 2951#line 2952 "configure"
093e61a6 2952#include "confdefs.h"
956d6950 2953#include <ctype.h>
093e61a6
RS
2954#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
2955#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
cafe096b 2956#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
093e61a6
RS
2957int main () { int i; for (i = 0; i < 256; i++)
2958if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
2959exit (0); }
2960
2961EOF
4665e56c 2962if { (eval echo configure:2963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
093e61a6 2963then
956d6950
JL
2964 :
2965else
093e61a6
RS
2966 echo "configure: failed program was:" >&5
2967 cat conftest.$ac_ext >&5
2968 rm -fr conftest*
2969 ac_cv_header_stdc=no
956d6950 2970fi
093e61a6 2971rm -fr conftest*
956d6950 2972fi
093e61a6 2973
956d6950
JL
2974fi
2975fi
cafe096b 2976
093e61a6
RS
2977echo "$ac_t""$ac_cv_header_stdc" 1>&6
2978if test $ac_cv_header_stdc = yes; then
2979 cat >> confdefs.h <<\EOF
956d6950 2980#define STDC_HEADERS 1
093e61a6 2981EOF
956d6950
JL
2982
2983fi
2984
093e61a6 2985echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
4665e56c 2986echo "configure:2987: checking whether time.h and sys/time.h may both be included" >&5
093e61a6
RS
2987if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
2988 echo $ac_n "(cached) $ac_c" 1>&6
956d6950 2989else
093e61a6 2990 cat > conftest.$ac_ext <<EOF
4665e56c 2991#line 2992 "configure"
093e61a6 2992#include "confdefs.h"
956d6950
JL
2993#include <sys/types.h>
2994#include <sys/time.h>
2995#include <time.h>
093e61a6
RS
2996int main() {
2997struct tm *tp;
2998; return 0; }
2999EOF
4665e56c 3000if { (eval echo configure:3001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 3001 rm -rf conftest*
956d6950
JL
3002 ac_cv_header_time=yes
3003else
093e61a6
RS
3004 echo "configure: failed program was:" >&5
3005 cat conftest.$ac_ext >&5
3006 rm -rf conftest*
3007 ac_cv_header_time=no
956d6950 3008fi
093e61a6 3009rm -f conftest*
956d6950 3010fi
cafe096b 3011
093e61a6
RS
3012echo "$ac_t""$ac_cv_header_time" 1>&6
3013if test $ac_cv_header_time = yes; then
3014 cat >> confdefs.h <<\EOF
956d6950 3015#define TIME_WITH_SYS_TIME 1
093e61a6 3016EOF
956d6950
JL
3017
3018fi
3019
093e61a6 3020echo $ac_n "checking for working stdbool.h""... $ac_c" 1>&6
4665e56c 3021echo "configure:3022: checking for working stdbool.h" >&5
093e61a6
RS
3022if eval "test \"`echo '$''{'ac_cv_header_stdbool_h'+set}'`\" = set"; then
3023 echo $ac_n "(cached) $ac_c" 1>&6
827ae6cf 3024else
093e61a6 3025 cat > conftest.$ac_ext <<EOF
4665e56c 3026#line 3027 "configure"
093e61a6 3027#include "confdefs.h"
827ae6cf 3028#include <stdbool.h>
093e61a6 3029int main() {
827ae6cf 3030bool foo = false;
093e61a6
RS
3031; return 0; }
3032EOF
4665e56c 3033if { (eval echo configure:3034: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 3034 rm -rf conftest*
827ae6cf
RO
3035 ac_cv_header_stdbool_h=yes
3036else
093e61a6
RS
3037 echo "configure: failed program was:" >&5
3038 cat conftest.$ac_ext >&5
3039 rm -rf conftest*
3040 ac_cv_header_stdbool_h=no
827ae6cf 3041fi
093e61a6 3042rm -f conftest*
827ae6cf 3043fi
cafe096b 3044
093e61a6
RS
3045echo "$ac_t""$ac_cv_header_stdbool_h" 1>&6
3046if test $ac_cv_header_stdbool_h = yes; then
3047 cat >> confdefs.h <<\EOF
827ae6cf 3048#define HAVE_STDBOOL_H 1
093e61a6 3049EOF
827ae6cf
RO
3050
3051fi
3052
093e61a6 3053echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
4665e56c 3054echo "configure:3055: checking whether string.h and strings.h may both be included" >&5
093e61a6
RS
3055if eval "test \"`echo '$''{'gcc_cv_header_string'+set}'`\" = set"; then
3056 echo $ac_n "(cached) $ac_c" 1>&6
0a4b6309 3057else
093e61a6 3058 cat > conftest.$ac_ext <<EOF
4665e56c 3059#line 3060 "configure"
093e61a6 3060#include "confdefs.h"
0a4b6309
RL
3061#include <string.h>
3062#include <strings.h>
093e61a6 3063int main() {
0a4b6309 3064
093e61a6
RS
3065; return 0; }
3066EOF
4665e56c 3067if { (eval echo configure:3068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 3068 rm -rf conftest*
0a4b6309
RL
3069 gcc_cv_header_string=yes
3070else
093e61a6
RS
3071 echo "configure: failed program was:" >&5
3072 cat conftest.$ac_ext >&5
3073 rm -rf conftest*
3074 gcc_cv_header_string=no
0a4b6309 3075fi
093e61a6 3076rm -f conftest*
0a4b6309 3077fi
cafe096b 3078
093e61a6
RS
3079echo "$ac_t""$gcc_cv_header_string" 1>&6
3080if test $gcc_cv_header_string = yes; then
3081 cat >> confdefs.h <<\EOF
0a4b6309 3082#define STRING_WITH_STRINGS 1
093e61a6 3083EOF
0a4b6309
RL
3084
3085fi
3086
093e61a6 3087echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4665e56c 3088echo "configure:3089: checking for sys/wait.h that is POSIX.1 compatible" >&5
093e61a6
RS
3089if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
3090 echo $ac_n "(cached) $ac_c" 1>&6
e9831ca0 3091else
093e61a6 3092 cat > conftest.$ac_ext <<EOF
4665e56c 3093#line 3094 "configure"
093e61a6 3094#include "confdefs.h"
e9831ca0
KG
3095#include <sys/types.h>
3096#include <sys/wait.h>
3097#ifndef WEXITSTATUS
093e61a6 3098#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
e9831ca0
KG
3099#endif
3100#ifndef WIFEXITED
093e61a6 3101#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
e9831ca0 3102#endif
093e61a6
RS
3103int main() {
3104int s;
3105wait (&s);
3106s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3107; return 0; }
3108EOF
4665e56c 3109if { (eval echo configure:3110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 3110 rm -rf conftest*
e9831ca0
KG
3111 ac_cv_header_sys_wait_h=yes
3112else
093e61a6
RS
3113 echo "configure: failed program was:" >&5
3114 cat conftest.$ac_ext >&5
3115 rm -rf conftest*
3116 ac_cv_header_sys_wait_h=no
e9831ca0 3117fi
093e61a6 3118rm -f conftest*
e9831ca0 3119fi
cafe096b 3120
093e61a6
RS
3121echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3122if test $ac_cv_header_sys_wait_h = yes; then
3123 cat >> confdefs.h <<\EOF
e9831ca0 3124#define HAVE_SYS_WAIT_H 1
093e61a6 3125EOF
e9831ca0
KG
3126
3127fi
3128
093e61a6 3129for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h \
1072ec3f 3130 fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
03c41c05 3131 sys/resource.h sys/param.h sys/times.h sys/stat.h \
2bd02043 3132 direct.h malloc.h langinfo.h ldfcn.h wchar.h
861bb6c1 3133do
093e61a6
RS
3134ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3135echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4665e56c 3136echo "configure:3137: checking for $ac_hdr" >&5
093e61a6
RS
3137if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3138 echo $ac_n "(cached) $ac_c" 1>&6
3139else
3140 cat > conftest.$ac_ext <<EOF
4665e56c 3141#line 3142 "configure"
093e61a6
RS
3142#include "confdefs.h"
3143#include <$ac_hdr>
3144EOF
3145ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4665e56c 3146{ (eval echo configure:3147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
093e61a6
RS
3147ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3148if test -z "$ac_err"; then
3149 rm -rf conftest*
3150 eval "ac_cv_header_$ac_safe=yes"
3151else
3152 echo "$ac_err" >&5
3153 echo "configure: failed program was:" >&5
3154 cat conftest.$ac_ext >&5
3155 rm -rf conftest*
3156 eval "ac_cv_header_$ac_safe=no"
956d6950 3157fi
093e61a6 3158rm -f conftest*
956d6950 3159fi
093e61a6
RS
3160if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3161 echo "$ac_t""yes" 1>&6
3162 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3163 cat >> confdefs.h <<EOF
3164#define $ac_tr_hdr 1
3165EOF
3166
3167else
3168 echo "$ac_t""no" 1>&6
956d6950
JL
3169fi
3170done
3171
3172
f24af81b 3173# Check for thread headers.
093e61a6
RS
3174ac_safe=`echo "thread.h" | sed 'y%./+-%__p_%'`
3175echo $ac_n "checking for thread.h""... $ac_c" 1>&6
4665e56c 3176echo "configure:3177: checking for thread.h" >&5
093e61a6
RS
3177if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3178 echo $ac_n "(cached) $ac_c" 1>&6
3179else
3180 cat > conftest.$ac_ext <<EOF
4665e56c 3181#line 3182 "configure"
093e61a6 3182#include "confdefs.h"
cafe096b 3183#include <thread.h>
093e61a6
RS
3184EOF
3185ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4665e56c 3186{ (eval echo configure:3187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
093e61a6
RS
3187ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3188if test -z "$ac_err"; then
3189 rm -rf conftest*
3190 eval "ac_cv_header_$ac_safe=yes"
3191else
3192 echo "$ac_err" >&5
3193 echo "configure: failed program was:" >&5
3194 cat conftest.$ac_ext >&5
3195 rm -rf conftest*
3196 eval "ac_cv_header_$ac_safe=no"
f24af81b 3197fi
093e61a6 3198rm -f conftest*
f24af81b 3199fi
093e61a6
RS
3200if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3201 echo "$ac_t""yes" 1>&6
f24af81b
TT
3202 have_thread_h=yes
3203else
093e61a6
RS
3204 echo "$ac_t""no" 1>&6
3205have_thread_h=
f24af81b
TT
3206fi
3207
093e61a6
RS
3208ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'`
3209echo $ac_n "checking for pthread.h""... $ac_c" 1>&6
4665e56c 3210echo "configure:3211: checking for pthread.h" >&5
093e61a6
RS
3211if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3212 echo $ac_n "(cached) $ac_c" 1>&6
f24af81b 3213else
093e61a6 3214 cat > conftest.$ac_ext <<EOF
4665e56c 3215#line 3216 "configure"
093e61a6 3216#include "confdefs.h"
cafe096b 3217#include <pthread.h>
093e61a6
RS
3218EOF
3219ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4665e56c 3220{ (eval echo configure:3221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
093e61a6
RS
3221ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3222if test -z "$ac_err"; then
3223 rm -rf conftest*
3224 eval "ac_cv_header_$ac_safe=yes"
3225else
3226 echo "$ac_err" >&5
3227 echo "configure: failed program was:" >&5
3228 cat conftest.$ac_ext >&5
3229 rm -rf conftest*
3230 eval "ac_cv_header_$ac_safe=no"
f24af81b 3231fi
093e61a6 3232rm -f conftest*
f24af81b 3233fi
093e61a6
RS
3234if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3235 echo "$ac_t""yes" 1>&6
f24af81b
TT
3236 have_pthread_h=yes
3237else
093e61a6
RS
3238 echo "$ac_t""no" 1>&6
3239have_pthread_h=
f24af81b
TT
3240fi
3241
3242
84c041a1 3243# These tests can't be done till we know if we have limits.h.
093e61a6 3244echo $ac_n "checking for CHAR_BIT""... $ac_c" 1>&6
4665e56c 3245echo "configure:3246: checking for CHAR_BIT" >&5
093e61a6
RS
3246if eval "test \"`echo '$''{'gcc_cv_decl_char_bit'+set}'`\" = set"; then
3247 echo $ac_n "(cached) $ac_c" 1>&6
3248else
3249 cat > conftest.$ac_ext <<EOF
4665e56c 3250#line 3251 "configure"
093e61a6 3251#include "confdefs.h"
75e93faa
ZW
3252#ifdef HAVE_LIMITS_H
3253#include <limits.h>
3254#endif
3255#ifdef CHAR_BIT
3256found
3257#endif
093e61a6 3258EOF
75e93faa 3259if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
093e61a6
RS
3260 egrep "found" >/dev/null 2>&1; then
3261 rm -rf conftest*
75e93faa
ZW
3262 gcc_cv_decl_char_bit=yes
3263else
093e61a6 3264 rm -rf conftest*
75e93faa
ZW
3265 gcc_cv_decl_char_bit=no
3266fi
3267rm -f conftest*
3268
3269
3270fi
093e61a6
RS
3271
3272echo "$ac_t""$gcc_cv_decl_char_bit" 1>&6
75e93faa 3273if test $gcc_cv_decl_char_bit = no; then
093e61a6 3274 echo $ac_n "checking number of bits in a byte""... $ac_c" 1>&6
4665e56c 3275echo "configure:3276: checking number of bits in a byte" >&5
093e61a6
RS
3276if eval "test \"`echo '$''{'gcc_cv_c_nbby'+set}'`\" = set"; then
3277 echo $ac_n "(cached) $ac_c" 1>&6
75e93faa
ZW
3278else
3279 i=8
3280 gcc_cv_c_nbby=
3281 while test $i -lt 65; do
093e61a6 3282 cat > conftest.$ac_ext <<EOF
4665e56c 3283#line 3284 "configure"
093e61a6 3284#include "confdefs.h"
75e93faa 3285
093e61a6 3286int main() {
4e70264f
ZW
3287switch(0) {
3288 case (unsigned char)((unsigned long)1 << $i) == ((unsigned long)1 << $i):
3289 case (unsigned char)((unsigned long)1<<($i-1)) == ((unsigned long)1<<($i-1)):
3290 ; }
093e61a6
RS
3291; return 0; }
3292EOF
4665e56c 3293if { (eval echo configure:3294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 3294 rm -rf conftest*
4e70264f 3295 gcc_cv_c_nbby=$i; break
75e93faa 3296else
093e61a6
RS
3297 echo "configure: failed program was:" >&5
3298 cat conftest.$ac_ext >&5
75e93faa 3299fi
093e61a6 3300rm -f conftest*
75e93faa
ZW
3301 i=`expr $i + 1`
3302 done
3303 test -z "$gcc_cv_c_nbby" && gcc_cv_c_nbby=failed
3304
3305fi
093e61a6
RS
3306
3307echo "$ac_t""$gcc_cv_c_nbby" 1>&6
75e93faa 3308if test $gcc_cv_c_nbby = failed; then
093e61a6 3309 { echo "configure: error: cannot determine number of bits in a byte" 1>&2; exit 1; }
75e93faa 3310else
093e61a6 3311 cat >> confdefs.h <<EOF
75e93faa 3312#define CHAR_BIT $gcc_cv_c_nbby
093e61a6 3313EOF
75e93faa
ZW
3314
3315fi
3316fi
093e61a6 3317echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
4665e56c 3318echo "configure:3319: checking whether byte ordering is bigendian" >&5
093e61a6
RS
3319if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
3320 echo $ac_n "(cached) $ac_c" 1>&6
84c041a1 3321else
4977bab6
ZW
3322 ac_cv_c_bigendian=unknown
3323# See if sys/param.h defines the BYTE_ORDER macro.
093e61a6 3324cat > conftest.$ac_ext <<EOF
4665e56c 3325#line 3326 "configure"
093e61a6 3326#include "confdefs.h"
4977bab6
ZW
3327#include <sys/types.h>
3328#include <sys/param.h>
093e61a6 3329int main() {
2d6eb5bf 3330
4977bab6
ZW
3331#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
3332 bogus endian macros
84c041a1 3333#endif
093e61a6
RS
3334; return 0; }
3335EOF
4665e56c 3336if { (eval echo configure:3337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 3337 rm -rf conftest*
4977bab6 3338 # It does; now see whether it defined to BIG_ENDIAN or not.
093e61a6 3339cat > conftest.$ac_ext <<EOF
4665e56c 3340#line 3341 "configure"
093e61a6 3341#include "confdefs.h"
4977bab6
ZW
3342#include <sys/types.h>
3343#include <sys/param.h>
093e61a6 3344int main() {
4977bab6
ZW
3345
3346#if BYTE_ORDER != BIG_ENDIAN
3347 not big endian
84c041a1 3348#endif
093e61a6
RS
3349; return 0; }
3350EOF
4665e56c 3351if { (eval echo configure:3352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 3352 rm -rf conftest*
4977bab6
ZW
3353 ac_cv_c_bigendian=yes
3354else
093e61a6
RS
3355 echo "configure: failed program was:" >&5
3356 cat conftest.$ac_ext >&5
3357 rm -rf conftest*
3358 ac_cv_c_bigendian=no
4977bab6 3359fi
093e61a6 3360rm -f conftest*
4977bab6 3361else
093e61a6
RS
3362 echo "configure: failed program was:" >&5
3363 cat conftest.$ac_ext >&5
4977bab6 3364fi
093e61a6 3365rm -f conftest*
4977bab6
ZW
3366if test $ac_cv_c_bigendian = unknown; then
3367if test "$cross_compiling" = yes; then
093e61a6
RS
3368 echo $ac_n "cross-compiling... " 2>&6
3369else
3370 cat > conftest.$ac_ext <<EOF
4665e56c 3371#line 3372 "configure"
093e61a6 3372#include "confdefs.h"
4977bab6
ZW
3373main () {
3374 /* Are we little or big endian? From Harbison&Steele. */
3375 union
3376 {
3377 long l;
3378 char c[sizeof (long)];
3379 } u;
3380 u.l = 1;
3381 exit (u.c[sizeof (long) - 1] == 1);
3382}
093e61a6 3383EOF
4665e56c 3384if { (eval echo configure:3385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
093e61a6 3385then
4977bab6
ZW
3386 ac_cv_c_bigendian=no
3387else
093e61a6
RS
3388 echo "configure: failed program was:" >&5
3389 cat conftest.$ac_ext >&5
3390 rm -fr conftest*
3391 ac_cv_c_bigendian=yes
4977bab6 3392fi
093e61a6 3393rm -fr conftest*
84c041a1 3394fi
093e61a6 3395
4977bab6
ZW
3396fi
3397fi
093e61a6
RS
3398
3399echo "$ac_t""$ac_cv_c_bigendian" 1>&6
4977bab6 3400if test $ac_cv_c_bigendian = unknown; then
093e61a6 3401echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
4665e56c 3402echo "configure:3403: checking to probe for byte ordering" >&5
2d6eb5bf 3403
4977bab6
ZW
3404cat >conftest.c <<EOF
3405short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
3406short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
3407void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; }
3408short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
3409short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
3410void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; }
3411int main() { _ascii (); _ebcdic (); return 0; }
3412EOF
3413 if test -f conftest.c ; then
3414 if ${CC-cc} ${CFLAGS} conftest.c -o conftest.o && test -f conftest.o ; then
3415 if test `grep -l BIGenDianSyS conftest.o` ; then
3416 echo $ac_n ' big endian probe OK, ' 1>&6
3417 ac_cv_c_bigendian=yes
3418 fi
3419 if test `grep -l LiTTleEnDian conftest.o` ; then
3420 echo $ac_n ' little endian probe OK, ' 1>&6
3421 if test $ac_cv_c_bigendian = yes ; then
3422 ac_cv_c_bigendian=unknown;
3423 else
3424 ac_cv_c_bigendian=no
3425 fi
3426 fi
3427 echo $ac_n 'guessing bigendian ... ' >&6
3428 fi
3429 fi
093e61a6 3430echo "$ac_t""$ac_cv_c_bigendian" 1>&6
84c041a1 3431fi
4977bab6 3432if test $ac_cv_c_bigendian = yes; then
093e61a6 3433 cat >> confdefs.h <<\EOF
4977bab6 3434#define WORDS_BIGENDIAN 1
093e61a6 3435EOF
cafe096b 3436
093e61a6 3437 cat >> confdefs.h <<\EOF
84c041a1 3438#define HOST_WORDS_BIG_ENDIAN 1
093e61a6 3439EOF
84c041a1 3440
4977bab6
ZW
3441 BYTEORDER=4321
3442else
3443 BYTEORDER=1234
3444fi
093e61a6 3445cat >> confdefs.h <<EOF
4977bab6 3446#define BYTEORDER $BYTEORDER
093e61a6 3447EOF
4977bab6
ZW
3448
3449if test $ac_cv_c_bigendian = unknown; then
093e61a6 3450 { echo "configure: error: unknown endianess - sorry" 1>&2; exit 1; }
84c041a1
ZW
3451fi
3452
75e93faa 3453
73458fb7
NN
3454# --------
3455# UNSORTED
3456# --------
1e608388 3457
73458fb7
NN
3458# Stage specific cflags for build.
3459stage1_cflags=
3460case $build in
3461vax-*-*)
3462 if test x$GCC = xyes
3463 then
3464 stage1_cflags="-Wa,-J"
3465 else
3466 stage1_cflags="-J"
3467 fi
3468 ;;
3469powerpc-*-darwin*)
3470 # The spiffy cpp-precomp chokes on some legitimate constructs in GCC
3471 # sources; use -no-cpp-precomp to get to GNU cpp.
3472 # Apple's GCC has bugs in designated initializer handling, so disable
3473 # that too.
3474 stage1_cflags="-no-cpp-precomp -DHAVE_DESIGNATED_INITIALIZERS=0"
3475 ;;
3476esac
1e608388 3477
1e608388 3478
4e70264f
ZW
3479# These libraries may be used by collect2.
3480# We may need a special search path to get them linked.
093e61a6 3481echo $ac_n "checking for collect2 libraries""... $ac_c" 1>&6
4665e56c 3482echo "configure:3483: checking for collect2 libraries" >&5
093e61a6
RS
3483if eval "test \"`echo '$''{'gcc_cv_collect2_libs'+set}'`\" = set"; then
3484 echo $ac_n "(cached) $ac_c" 1>&6
4e70264f
ZW
3485else
3486 save_LIBS="$LIBS"
7f2749d4 3487for libs in '' -lld -lmld \
4e70264f
ZW
3488 '-L/usr/lib/cmplrs/cc2.11 -lmld' \
3489 '-L/usr/lib/cmplrs/cc3.11 -lmld'
3490do
3491 LIBS="$libs"
093e61a6 3492 cat > conftest.$ac_ext <<EOF
4665e56c 3493#line 3494 "configure"
093e61a6 3494#include "confdefs.h"
4e70264f
ZW
3495/* Override any gcc2 internal prototype to avoid an error. */
3496/* We use char because int might match the return type of a gcc2
093e61a6
RS
3497 builtin and then its argument prototype would still apply. */
3498char ldopen();
3499
3500int main() {
3501ldopen()
3502; return 0; }
3503EOF
4665e56c 3504if { (eval echo configure:3505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6 3505 rm -rf conftest*
4e70264f
ZW
3506 gcc_cv_collect2_libs="$libs"; break
3507else
093e61a6
RS
3508 echo "configure: failed program was:" >&5
3509 cat conftest.$ac_ext >&5
4e70264f 3510fi
093e61a6 3511rm -f conftest*
4e70264f
ZW
3512done
3513LIBS="$save_LIBS"
3514test -z "$gcc_cv_collect2_libs" && gcc_cv_collect2_libs='none required'
3515fi
093e61a6
RS
3516
3517echo "$ac_t""$gcc_cv_collect2_libs" 1>&6
4e70264f
ZW
3518case $gcc_cv_collect2_libs in
3519 "none required") ;;
3520 *) COLLECT2_LIBS=$gcc_cv_collect2_libs ;;
3521esac
3522
3523
7f2749d4
RK
3524# When building Ada code on Alpha, we need exc_resume which is usually in
3525# -lexc. So test for it.
3526save_LIBS="$LIBS"
3527LIBS=
3528
093e61a6 3529echo $ac_n "checking for library containing exc_resume""... $ac_c" 1>&6
4665e56c 3530echo "configure:3531: checking for library containing exc_resume" >&5
093e61a6
RS
3531if eval "test \"`echo '$''{'ac_cv_search_exc_resume'+set}'`\" = set"; then
3532 echo $ac_n "(cached) $ac_c" 1>&6
3533else
3534 ac_func_search_save_LIBS="$LIBS"
3535ac_cv_search_exc_resume="no"
3536cat > conftest.$ac_ext <<EOF
4665e56c 3537#line 3538 "configure"
093e61a6 3538#include "confdefs.h"
7f2749d4
RK
3539/* Override any gcc2 internal prototype to avoid an error. */
3540/* We use char because int might match the return type of a gcc2
093e61a6
RS
3541 builtin and then its argument prototype would still apply. */
3542char exc_resume();
3543
3544int main() {
3545exc_resume()
3546; return 0; }
3547EOF
4665e56c 3548if { (eval echo configure:3549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6 3549 rm -rf conftest*
7f2749d4
RK
3550 ac_cv_search_exc_resume="none required"
3551else
093e61a6
RS
3552 echo "configure: failed program was:" >&5
3553 cat conftest.$ac_ext >&5
7f2749d4 3554fi
093e61a6
RS
3555rm -f conftest*
3556test "$ac_cv_search_exc_resume" = "no" && for i in exc; do
3557LIBS="-l$i $ac_func_search_save_LIBS"
3558cat > conftest.$ac_ext <<EOF
4665e56c 3559#line 3560 "configure"
093e61a6 3560#include "confdefs.h"
7f2749d4
RK
3561/* Override any gcc2 internal prototype to avoid an error. */
3562/* We use char because int might match the return type of a gcc2
093e61a6
RS
3563 builtin and then its argument prototype would still apply. */
3564char exc_resume();
3565
3566int main() {
3567exc_resume()
3568; return 0; }
3569EOF
4665e56c 3570if { (eval echo configure:3571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6
RS
3571 rm -rf conftest*
3572 ac_cv_search_exc_resume="-l$i"
7f2749d4
RK
3573break
3574else
093e61a6
RS
3575 echo "configure: failed program was:" >&5
3576 cat conftest.$ac_ext >&5
7f2749d4 3577fi
093e61a6
RS
3578rm -f conftest*
3579done
3580LIBS="$ac_func_search_save_LIBS"
cafe096b 3581fi
cafe096b 3582
093e61a6
RS
3583echo "$ac_t""$ac_cv_search_exc_resume" 1>&6
3584if test "$ac_cv_search_exc_resume" != "no"; then
3585 test "$ac_cv_search_exc_resume" = "none required" || LIBS="$ac_cv_search_exc_resume $LIBS"
3586
3587else :
3588
7f2749d4
RK
3589fi
3590GNAT_LIBEXC="$LIBS"
3591LIBS="$save_LIBS"
3592
3593
62c9aa5f
ZW
3594# Some systems put ldexp and frexp in libm instead of libc; assume
3595# they're both in the same place. jcf-dump needs them.
3596save_LIBS="$LIBS"
3597LIBS=
3598
093e61a6 3599echo $ac_n "checking for library containing ldexp""... $ac_c" 1>&6
4665e56c 3600echo "configure:3601: checking for library containing ldexp" >&5
093e61a6
RS
3601if eval "test \"`echo '$''{'ac_cv_search_ldexp'+set}'`\" = set"; then
3602 echo $ac_n "(cached) $ac_c" 1>&6
3603else
3604 ac_func_search_save_LIBS="$LIBS"
3605ac_cv_search_ldexp="no"
3606cat > conftest.$ac_ext <<EOF
4665e56c 3607#line 3608 "configure"
093e61a6 3608#include "confdefs.h"
62c9aa5f
ZW
3609/* Override any gcc2 internal prototype to avoid an error. */
3610/* We use char because int might match the return type of a gcc2
093e61a6
RS
3611 builtin and then its argument prototype would still apply. */
3612char ldexp();
3613
3614int main() {
3615ldexp()
3616; return 0; }
3617EOF
4665e56c 3618if { (eval echo configure:3619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6 3619 rm -rf conftest*
62c9aa5f
ZW
3620 ac_cv_search_ldexp="none required"
3621else
093e61a6
RS
3622 echo "configure: failed program was:" >&5
3623 cat conftest.$ac_ext >&5
62c9aa5f 3624fi
093e61a6
RS
3625rm -f conftest*
3626test "$ac_cv_search_ldexp" = "no" && for i in m; do
3627LIBS="-l$i $ac_func_search_save_LIBS"
3628cat > conftest.$ac_ext <<EOF
4665e56c 3629#line 3630 "configure"
093e61a6 3630#include "confdefs.h"
62c9aa5f
ZW
3631/* Override any gcc2 internal prototype to avoid an error. */
3632/* We use char because int might match the return type of a gcc2
093e61a6
RS
3633 builtin and then its argument prototype would still apply. */
3634char ldexp();
3635
3636int main() {
3637ldexp()
3638; return 0; }
3639EOF
4665e56c 3640if { (eval echo configure:3641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6
RS
3641 rm -rf conftest*
3642 ac_cv_search_ldexp="-l$i"
62c9aa5f
ZW
3643break
3644else
093e61a6
RS
3645 echo "configure: failed program was:" >&5
3646 cat conftest.$ac_ext >&5
62c9aa5f 3647fi
093e61a6
RS
3648rm -f conftest*
3649done
3650LIBS="$ac_func_search_save_LIBS"
cafe096b 3651fi
cafe096b 3652
093e61a6
RS
3653echo "$ac_t""$ac_cv_search_ldexp" 1>&6
3654if test "$ac_cv_search_ldexp" != "no"; then
3655 test "$ac_cv_search_ldexp" = "none required" || LIBS="$ac_cv_search_ldexp $LIBS"
3656
3657else :
3658
62c9aa5f
ZW
3659fi
3660LDEXP_LIB="$LIBS"
3661LIBS="$save_LIBS"
3662
3663
890ad3ea 3664# See if the stage1 system preprocessor understands the ANSI C
4bc5fbd4 3665# preprocessor stringification operator. (Used by symcat.h.)
093e61a6
RS
3666
3667
3668echo $ac_n "checking for preprocessor stringizing operator""... $ac_c" 1>&6
4665e56c 3669echo "configure:3670: checking for preprocessor stringizing operator" >&5
093e61a6
RS
3670if eval "test \"`echo '$''{'ac_cv_c_stringize'+set}'`\" = set"; then
3671 echo $ac_n "(cached) $ac_c" 1>&6
3672else
3673 cat > conftest.$ac_ext <<EOF
4665e56c 3674#line 3675 "configure"
093e61a6
RS
3675#include "confdefs.h"
3676
890ad3ea
KG
3677#define x(y) #y
3678
3679char *s = x(teststring);
093e61a6
RS
3680
3681EOF
890ad3ea 3682if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
093e61a6
RS
3683 egrep "#teststring" >/dev/null 2>&1; then
3684 rm -rf conftest*
890ad3ea 3685 ac_cv_c_stringize=no
76844337 3686else
093e61a6 3687 rm -rf conftest*
890ad3ea 3688 ac_cv_c_stringize=yes
76844337
RH
3689fi
3690rm -f conftest*
890ad3ea 3691
76844337
RH
3692fi
3693
093e61a6
RS
3694if test "${ac_cv_c_stringize}" = yes
3695then
3696 cat >> confdefs.h <<\EOF
890ad3ea 3697#define HAVE_STRINGIZE 1
093e61a6 3698EOF
76844337
RH
3699
3700fi
093e61a6 3701echo "$ac_t""${ac_cv_c_stringize}" 1>&6
890ad3ea 3702
76844337 3703
956d6950
JL
3704# Use <inttypes.h> only if it exists,
3705# doesn't clash with <sys/types.h>, and declares intmax_t.
093e61a6 3706echo $ac_n "checking for inttypes.h""... $ac_c" 1>&6
4665e56c 3707echo "configure:3708: checking for inttypes.h" >&5
093e61a6
RS
3708if eval "test \"`echo '$''{'gcc_cv_header_inttypes_h'+set}'`\" = set"; then
3709 echo $ac_n "(cached) $ac_c" 1>&6
3710else
3711 cat > conftest.$ac_ext <<EOF
4665e56c 3712#line 3713 "configure"
093e61a6 3713#include "confdefs.h"
956d6950
JL
3714#include <sys/types.h>
3715#include <inttypes.h>
093e61a6 3716int main() {
956d6950 3717intmax_t i = -1;
093e61a6
RS
3718; return 0; }
3719EOF
4665e56c 3720if { (eval echo configure:3721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 3721 rm -rf conftest*
0056a9b5 3722 gcc_cv_header_inttypes_h=yes
956d6950 3723else
093e61a6
RS
3724 echo "configure: failed program was:" >&5
3725 cat conftest.$ac_ext >&5
3726 rm -rf conftest*
3727 gcc_cv_header_inttypes_h=no
956d6950 3728fi
093e61a6 3729rm -f conftest*
956d6950
JL
3730fi
3731
093e61a6 3732echo "$ac_t""$gcc_cv_header_inttypes_h" 1>&6
0056a9b5 3733if test $gcc_cv_header_inttypes_h = yes; then
093e61a6 3734 cat >> confdefs.h <<\EOF
0056a9b5 3735#define HAVE_INTTYPES_H 1
093e61a6 3736EOF
0056a9b5
KG
3737
3738fi
956d6950 3739
c149cc37 3740
6af8c740
KG
3741for ac_func in times clock dup2 kill getrlimit setrlimit atoll atoq \
3742 sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \
a15135c9 3743 fwrite_unlocked fprintf_unlocked getrusage nl_langinfo lstat \
8eb6a092 3744 scandir alphasort gettimeofday mbstowcs wcswidth mmap mincore
956d6950 3745do
093e61a6 3746echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4665e56c 3747echo "configure:3748: checking for $ac_func" >&5
093e61a6
RS
3748if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3749 echo $ac_n "(cached) $ac_c" 1>&6
3750else
3751 cat > conftest.$ac_ext <<EOF
4665e56c 3752#line 3753 "configure"
093e61a6 3753#include "confdefs.h"
956d6950 3754/* System header to define __stub macros and hopefully few prototypes,
093e61a6
RS
3755 which can conflict with char $ac_func(); below. */
3756#include <assert.h>
956d6950
JL
3757/* Override any gcc2 internal prototype to avoid an error. */
3758/* We use char because int might match the return type of a gcc2
093e61a6
RS
3759 builtin and then its argument prototype would still apply. */
3760char $ac_func();
3761
3762int main() {
3763
956d6950
JL
3764/* The GNU C library defines this for functions which it implements
3765 to always fail with ENOSYS. Some functions are actually named
3766 something starting with __ and the normal name is an alias. */
3767#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3768choke me
3769#else
093e61a6 3770$ac_func();
956d6950
JL
3771#endif
3772
093e61a6
RS
3773; return 0; }
3774EOF
4665e56c 3775if { (eval echo configure:3776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6
RS
3776 rm -rf conftest*
3777 eval "ac_cv_func_$ac_func=yes"
3778else
3779 echo "configure: failed program was:" >&5
3780 cat conftest.$ac_ext >&5
3781 rm -rf conftest*
3782 eval "ac_cv_func_$ac_func=no"
3783fi
3784rm -f conftest*
3785fi
956d6950 3786
093e61a6
RS
3787if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3788 echo "$ac_t""yes" 1>&6
3789 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3790 cat >> confdefs.h <<EOF
3791#define $ac_tr_func 1
3792EOF
3793
3794else
3795 echo "$ac_t""no" 1>&6
956d6950
JL
3796fi
3797done
3798
6885fc87 3799
39f6c4c8 3800if test x$ac_cv_func_mbstowcs = xyes; then
093e61a6 3801 echo $ac_n "checking whether mbstowcs works""... $ac_c" 1>&6
4665e56c 3802echo "configure:3803: checking whether mbstowcs works" >&5
093e61a6
RS
3803if eval "test \"`echo '$''{'gcc_cv_func_mbstowcs_works'+set}'`\" = set"; then
3804 echo $ac_n "(cached) $ac_c" 1>&6
39f6c4c8
KW
3805else
3806 if test "$cross_compiling" = yes; then
3807 gcc_cv_func_mbstowcs_works=yes
3808else
093e61a6 3809 cat > conftest.$ac_ext <<EOF
4665e56c 3810#line 3811 "configure"
093e61a6 3811#include "confdefs.h"
39f6c4c8
KW
3812#include <stdlib.h>
3813int main()
3814{
3815 mbstowcs(0, "", 0);
3816 return 0;
3817}
093e61a6 3818EOF
4665e56c 3819if { (eval echo configure:3820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
093e61a6 3820then
39f6c4c8
KW
3821 gcc_cv_func_mbstowcs_works=yes
3822else
093e61a6
RS
3823 echo "configure: failed program was:" >&5
3824 cat conftest.$ac_ext >&5
3825 rm -fr conftest*
3826 gcc_cv_func_mbstowcs_works=no
39f6c4c8 3827fi
093e61a6 3828rm -fr conftest*
39f6c4c8 3829fi
093e61a6 3830
39f6c4c8 3831fi
cafe096b 3832
093e61a6
RS
3833echo "$ac_t""$gcc_cv_func_mbstowcs_works" 1>&6
3834 if test x$gcc_cv_func_mbstowcs_works = xyes; then
3835 cat >> confdefs.h <<\EOF
39f6c4c8 3836#define HAVE_WORKING_MBSTOWCS 1
093e61a6 3837EOF
39f6c4c8
KW
3838
3839 fi
3840fi
3841
093e61a6 3842echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
4665e56c 3843echo "configure:3844: checking for ssize_t" >&5
093e61a6
RS
3844if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
3845 echo $ac_n "(cached) $ac_c" 1>&6
f12bc141 3846else
093e61a6 3847 cat > conftest.$ac_ext <<EOF
4665e56c 3848#line 3849 "configure"
093e61a6
RS
3849#include "confdefs.h"
3850#include <sys/types.h>
3851#if STDC_HEADERS
3852#include <stdlib.h>
3853#include <stddef.h>
3854#endif
3855EOF
3856if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3857 egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3858 rm -rf conftest*
cb65112a 3859 ac_cv_type_ssize_t=yes
f12bc141 3860else
093e61a6
RS
3861 rm -rf conftest*
3862 ac_cv_type_ssize_t=no
f12bc141 3863fi
093e61a6 3864rm -f conftest*
cafe096b 3865
093e61a6
RS
3866fi
3867echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
3868if test $ac_cv_type_ssize_t = no; then
3869 cat >> confdefs.h <<\EOF
f12bc141 3870#define ssize_t int
093e61a6 3871EOF
f12bc141
ZW
3872
3873fi
3874
0b9d02c6 3875
e256b8b6
DA
3876# Try to determine the array type of the second argument of getgroups
3877# for the target system (int or gid_t).
093e61a6 3878echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
4665e56c 3879echo "configure:3880: checking for uid_t in sys/types.h" >&5
093e61a6
RS
3880if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
3881 echo $ac_n "(cached) $ac_c" 1>&6
3882else
3883 cat > conftest.$ac_ext <<EOF
4665e56c 3884#line 3885 "configure"
093e61a6 3885#include "confdefs.h"
e256b8b6 3886#include <sys/types.h>
093e61a6 3887EOF
e256b8b6 3888if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
093e61a6
RS
3889 egrep "uid_t" >/dev/null 2>&1; then
3890 rm -rf conftest*
e256b8b6
DA
3891 ac_cv_type_uid_t=yes
3892else
093e61a6 3893 rm -rf conftest*
e256b8b6
DA
3894 ac_cv_type_uid_t=no
3895fi
3896rm -f conftest*
3897
3898fi
cafe096b 3899
093e61a6
RS
3900echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3901if test $ac_cv_type_uid_t = no; then
3902 cat >> confdefs.h <<\EOF
e256b8b6 3903#define uid_t int
093e61a6 3904EOF
cafe096b 3905
093e61a6 3906 cat >> confdefs.h <<\EOF
e256b8b6 3907#define gid_t int
093e61a6 3908EOF
e256b8b6
DA
3909
3910fi
3911
093e61a6 3912echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
4665e56c 3913echo "configure:3914: checking type of array argument to getgroups" >&5
093e61a6
RS
3914if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
3915 echo $ac_n "(cached) $ac_c" 1>&6
e256b8b6
DA
3916else
3917 if test "$cross_compiling" = yes; then
3918 ac_cv_type_getgroups=cross
3919else
093e61a6 3920 cat > conftest.$ac_ext <<EOF
4665e56c 3921#line 3922 "configure"
093e61a6
RS
3922#include "confdefs.h"
3923
e256b8b6
DA
3924/* Thanks to Mike Rendell for this test. */
3925#include <sys/types.h>
3926#define NGID 256
3927#undef MAX
3928#define MAX(x, y) ((x) > (y) ? (x) : (y))
093e61a6 3929main()
e256b8b6
DA
3930{
3931 gid_t gidset[NGID];
3932 int i, n;
3933 union { gid_t gval; long lval; } val;
3934
3935 val.lval = -1;
3936 for (i = 0; i < NGID; i++)
3937 gidset[i] = val.gval;
3938 n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
3939 gidset);
3940 /* Exit non-zero if getgroups seems to require an array of ints. This
3941 happens when gid_t is short but getgroups modifies an array of ints. */
3942 exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
3943}
cafe096b 3944
093e61a6 3945EOF
4665e56c 3946if { (eval echo configure:3947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
093e61a6
RS
3947then
3948 ac_cv_type_getgroups=gid_t
3949else
3950 echo "configure: failed program was:" >&5
3951 cat conftest.$ac_ext >&5
3952 rm -fr conftest*
3953 ac_cv_type_getgroups=int
e256b8b6 3954fi
093e61a6 3955rm -fr conftest*
e256b8b6 3956fi
093e61a6 3957
e256b8b6 3958if test $ac_cv_type_getgroups = cross; then
093e61a6 3959 cat > conftest.$ac_ext <<EOF
4665e56c 3960#line 3961 "configure"
093e61a6 3961#include "confdefs.h"
e256b8b6 3962#include <unistd.h>
093e61a6 3963EOF
e256b8b6 3964if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
093e61a6
RS
3965 egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
3966 rm -rf conftest*
e256b8b6
DA
3967 ac_cv_type_getgroups=gid_t
3968else
093e61a6 3969 rm -rf conftest*
e256b8b6
DA
3970 ac_cv_type_getgroups=int
3971fi
3972rm -f conftest*
3973
3974fi
3975fi
3976
093e61a6
RS
3977echo "$ac_t""$ac_cv_type_getgroups" 1>&6
3978cat >> confdefs.h <<EOF
e256b8b6 3979#define GETGROUPS_T $ac_cv_type_getgroups
093e61a6 3980EOF
e256b8b6
DA
3981
3982
3983if test "${target}" = "${build}"; then
3984 TARGET_GETGROUPS_T=$ac_cv_type_getgroups
3985else
3986 case "${target}" in
3987 # This condition may need some tweaking. It should include all
3988 # targets where the array type of the second argument of getgroups
3989 # is int and the type of gid_t is not equivalent to int.
3990 *-*-sunos* | *-*-ultrix*)
3991 TARGET_GETGROUPS_T=int
3992 ;;
3993 *)
3994 TARGET_GETGROUPS_T=gid_t
3995 ;;
3996 esac
3997fi
3998
3999
093e61a6 4000echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6
4665e56c 4001echo "configure:4002: checking whether the printf functions support %p" >&5
093e61a6
RS
4002if eval "test \"`echo '$''{'gcc_cv_func_printf_ptr'+set}'`\" = set"; then
4003 echo $ac_n "(cached) $ac_c" 1>&6
0a4b6309
RL
4004else
4005 if test "$cross_compiling" = yes; then
4006 gcc_cv_func_printf_ptr=no
4007else
093e61a6 4008 cat > conftest.$ac_ext <<EOF
4665e56c 4009#line 4010 "configure"
093e61a6 4010#include "confdefs.h"
0a4b6309
RL
4011#include <stdio.h>
4012
86cf1cbd 4013int main()
0a4b6309
RL
4014{
4015 char buf[64];
4016 char *p = buf, *q = NULL;
4017 sprintf(buf, "%p", p);
4018 sscanf(buf, "%p", &q);
86cf1cbd 4019 return (p != q);
0a4b6309 4020}
093e61a6 4021EOF
4665e56c 4022if { (eval echo configure:4023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
093e61a6 4023then
0a4b6309
RL
4024 gcc_cv_func_printf_ptr=yes
4025else
093e61a6
RS
4026 echo "configure: failed program was:" >&5
4027 cat conftest.$ac_ext >&5
4028 rm -fr conftest*
4029 gcc_cv_func_printf_ptr=no
0a4b6309 4030fi
093e61a6 4031rm -fr conftest*
0a4b6309 4032fi
093e61a6 4033
0a4b6309
RL
4034rm -f core core.* *.core
4035fi
cafe096b 4036
093e61a6
RS
4037echo "$ac_t""$gcc_cv_func_printf_ptr" 1>&6
4038if test $gcc_cv_func_printf_ptr = yes ; then
4039 cat >> confdefs.h <<\EOF
0a4b6309 4040#define HAVE_PRINTF_PTR 1
093e61a6 4041EOF
0a4b6309
RL
4042
4043fi
4044
1072ec3f
ZW
4045if test $ac_cv_header_sys_mman_h != yes \
4046 || test $ac_cv_func_mmap != yes; then
4047 gcc_cv_func_mmap_file=no
4048 gcc_cv_func_mmap_dev_zero=no
4049 gcc_cv_func_mmap_anon=no
4050else
4051 echo $ac_n "checking whether read-only mmap of a plain file works""... $ac_c" 1>&6
4665e56c 4052echo "configure:4053: checking whether read-only mmap of a plain file works" >&5
1072ec3f
ZW
4053if eval "test \"`echo '$''{'gcc_cv_func_mmap_file'+set}'`\" = set"; then
4054 echo $ac_n "(cached) $ac_c" 1>&6
4055else
4056 # Add a system to this blacklist if
4057 # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a
4058 # memory area containing the same data that you'd get if you applied
4059 # read() to the same fd. The only system known to have a problem here
4060 # is VMS, where text files have record structure.
4061 case "$host_os" in
4062 vms*)
4063 gcc_cv_func_mmap_file=no ;;
4064 *)
4065 gcc_cv_func_mmap_file=yes;;
4066 esac
4067fi
4068
4069echo "$ac_t""$gcc_cv_func_mmap_file" 1>&6
4070 echo $ac_n "checking whether mmap from /dev/zero works""... $ac_c" 1>&6
4665e56c 4071echo "configure:4072: checking whether mmap from /dev/zero works" >&5
1072ec3f
ZW
4072if eval "test \"`echo '$''{'gcc_cv_func_mmap_dev_zero'+set}'`\" = set"; then
4073 echo $ac_n "(cached) $ac_c" 1>&6
4074else
4075 # Add a system to this blacklist if it has mmap() but /dev/zero
4076 # does not exist, or if mmapping /dev/zero does not give anonymous
4077 # zeroed pages with both the following properties:
4078 # 1. If you map N consecutive pages in with one call, and then
4079 # unmap any subset of those pages, the pages that were not
4080 # explicitly unmapped remain accessible.
4081 # 2. If you map two adjacent blocks of memory and then unmap them
4082 # both at once, they must both go away.
4083 # Systems known to be in this category are Windows (all variants),
4084 # VMS, and Darwin.
4085 case "$host_os" in
4086 vms* | cygwin* | pe | mingw* | darwin*)
4087 gcc_cv_func_mmap_dev_zero=no ;;
4088 *)
4089 gcc_cv_func_mmap_dev_zero=yes;;
4090 esac
4091fi
4092
4093echo "$ac_t""$gcc_cv_func_mmap_dev_zero" 1>&6
4094
4095 # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
4096 echo $ac_n "checking for MAP_ANON(YMOUS)""... $ac_c" 1>&6
4665e56c 4097echo "configure:4098: checking for MAP_ANON(YMOUS)" >&5
1072ec3f
ZW
4098if eval "test \"`echo '$''{'gcc_cv_decl_map_anon'+set}'`\" = set"; then
4099 echo $ac_n "(cached) $ac_c" 1>&6
4100else
4101 cat > conftest.$ac_ext <<EOF
4665e56c 4102#line 4103 "configure"
1072ec3f
ZW
4103#include "confdefs.h"
4104#include <sys/types.h>
4105#include <sys/mman.h>
4106#include <unistd.h>
4107
4108#ifndef MAP_ANONYMOUS
4109#define MAP_ANONYMOUS MAP_ANON
4110#endif
4111
4112int main() {
4113int n = MAP_ANONYMOUS;
4114; return 0; }
4115EOF
4665e56c 4116if { (eval echo configure:4117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1072ec3f
ZW
4117 rm -rf conftest*
4118 gcc_cv_decl_map_anon=yes
4119else
4120 echo "configure: failed program was:" >&5
4121 cat conftest.$ac_ext >&5
4122 rm -rf conftest*
4123 gcc_cv_decl_map_anon=no
4124fi
4125rm -f conftest*
4126fi
4127
4128echo "$ac_t""$gcc_cv_decl_map_anon" 1>&6
4129
4130 if test $gcc_cv_decl_map_anon = no; then
4131 gcc_cv_func_mmap_anon=no
4132 else
4133 echo $ac_n "checking whether mmap with MAP_ANON(YMOUS) works""... $ac_c" 1>&6
4665e56c 4134echo "configure:4135: checking whether mmap with MAP_ANON(YMOUS) works" >&5
1072ec3f
ZW
4135if eval "test \"`echo '$''{'gcc_cv_func_mmap_anon'+set}'`\" = set"; then
4136 echo $ac_n "(cached) $ac_c" 1>&6
4137else
4138 # Add a system to this blacklist if it has mmap() and MAP_ANON or
4139 # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
4140 # doesn't give anonymous zeroed pages with the same properties listed
4141 # above for use of /dev/zero.
4142 # Systems known to be in this category are Windows, VMS, and SCO Unix.
4143 case "$host_os" in
4144 vms* | cygwin* | pe | mingw* | sco* | udk* )
4145 gcc_cv_func_mmap_anon=no ;;
4146 *)
4147 gcc_cv_func_mmap_anon=yes;;
4148 esac
4149fi
4150
4151echo "$ac_t""$gcc_cv_func_mmap_anon" 1>&6
4152 fi
4153fi
4154
4155if test $gcc_cv_func_mmap_file = yes; then
4156 cat >> confdefs.h <<\EOF
4157#define HAVE_MMAP_FILE 1
4158EOF
4159
4160fi
4161if test $gcc_cv_func_mmap_dev_zero = yes; then
4162 cat >> confdefs.h <<\EOF
4163#define HAVE_MMAP_DEV_ZERO 1
4164EOF
4165
4166fi
4167if test $gcc_cv_func_mmap_anon = yes; then
4168 cat >> confdefs.h <<\EOF
4169#define HAVE_MMAP_ANON 1
4170EOF
4171
4172fi
4173
b27d2bd5
MK
4174
4175case "${host}" in
4176*-*-uwin*)
093e61a6 4177 { echo "configure: error:
cafe096b 4178*** UWIN may not be used as a host platform because
093e61a6 4179*** linking with posix.dll is not allowed by the GNU GPL" 1>&2; exit 1; }
b27d2bd5 4180 ;;
ee262b6f 4181*-*-*vms*)
093e61a6 4182 # Under VMS, vfork works very different than on Unix. The standard test
ee262b6f
DR
4183 # won't work, and it isn't easily adaptable. It makes more sense to
4184 # just force it.
4185 ac_cv_func_vfork_works=yes
4186 ;;
b27d2bd5 4187esac
093e61a6 4188echo $ac_n "checking for pid_t""... $ac_c" 1>&6
4665e56c 4189echo "configure:4190: checking for pid_t" >&5
093e61a6
RS
4190if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
4191 echo $ac_n "(cached) $ac_c" 1>&6
4192else
4193 cat > conftest.$ac_ext <<EOF
4665e56c 4194#line 4195 "configure"
093e61a6
RS
4195#include "confdefs.h"
4196#include <sys/types.h>
4197#if STDC_HEADERS
4198#include <stdlib.h>
4199#include <stddef.h>
4200#endif
4201EOF
4202if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4203 egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
4204 rm -rf conftest*
cb65112a 4205 ac_cv_type_pid_t=yes
c375c43b 4206else
093e61a6
RS
4207 rm -rf conftest*
4208 ac_cv_type_pid_t=no
c375c43b 4209fi
093e61a6 4210rm -f conftest*
cafe096b 4211
093e61a6
RS
4212fi
4213echo "$ac_t""$ac_cv_type_pid_t" 1>&6
4214if test $ac_cv_type_pid_t = no; then
4215 cat >> confdefs.h <<\EOF
c375c43b 4216#define pid_t int
093e61a6 4217EOF
c375c43b
KG
4218
4219fi
4220
093e61a6
RS
4221ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
4222echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
4665e56c 4223echo "configure:4224: checking for vfork.h" >&5
093e61a6
RS
4224if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4225 echo $ac_n "(cached) $ac_c" 1>&6
cafe096b 4226else
093e61a6 4227 cat > conftest.$ac_ext <<EOF
4665e56c 4228#line 4229 "configure"
093e61a6
RS
4229#include "confdefs.h"
4230#include <vfork.h>
4231EOF
4232ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4665e56c 4233{ (eval echo configure:4234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
093e61a6
RS
4234ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4235if test -z "$ac_err"; then
4236 rm -rf conftest*
4237 eval "ac_cv_header_$ac_safe=yes"
4238else
4239 echo "$ac_err" >&5
4240 echo "configure: failed program was:" >&5
4241 cat conftest.$ac_ext >&5
4242 rm -rf conftest*
4243 eval "ac_cv_header_$ac_safe=no"
c375c43b 4244fi
093e61a6 4245rm -f conftest*
c375c43b 4246fi
093e61a6
RS
4247if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4248 echo "$ac_t""yes" 1>&6
4249 cat >> confdefs.h <<\EOF
4250#define HAVE_VFORK_H 1
4251EOF
c375c43b 4252
093e61a6
RS
4253else
4254 echo "$ac_t""no" 1>&6
c375c43b
KG
4255fi
4256
093e61a6 4257echo $ac_n "checking for working vfork""... $ac_c" 1>&6
4665e56c 4258echo "configure:4259: checking for working vfork" >&5
093e61a6
RS
4259if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
4260 echo $ac_n "(cached) $ac_c" 1>&6
4261else
4262 if test "$cross_compiling" = yes; then
4263 echo $ac_n "checking for vfork""... $ac_c" 1>&6
4665e56c 4264echo "configure:4265: checking for vfork" >&5
093e61a6
RS
4265if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
4266 echo $ac_n "(cached) $ac_c" 1>&6
4267else
4268 cat > conftest.$ac_ext <<EOF
4665e56c 4269#line 4270 "configure"
093e61a6 4270#include "confdefs.h"
c375c43b 4271/* System header to define __stub macros and hopefully few prototypes,
093e61a6
RS
4272 which can conflict with char vfork(); below. */
4273#include <assert.h>
c375c43b
KG
4274/* Override any gcc2 internal prototype to avoid an error. */
4275/* We use char because int might match the return type of a gcc2
093e61a6
RS
4276 builtin and then its argument prototype would still apply. */
4277char vfork();
4278
4279int main() {
4280
c375c43b
KG
4281/* The GNU C library defines this for functions which it implements
4282 to always fail with ENOSYS. Some functions are actually named
4283 something starting with __ and the normal name is an alias. */
093e61a6 4284#if defined (__stub_vfork) || defined (__stub___vfork)
c375c43b
KG
4285choke me
4286#else
093e61a6 4287vfork();
c375c43b
KG
4288#endif
4289
093e61a6
RS
4290; return 0; }
4291EOF
4665e56c 4292if { (eval echo configure:4293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6
RS
4293 rm -rf conftest*
4294 eval "ac_cv_func_vfork=yes"
4295else
4296 echo "configure: failed program was:" >&5
4297 cat conftest.$ac_ext >&5
4298 rm -rf conftest*
4299 eval "ac_cv_func_vfork=no"
4300fi
4301rm -f conftest*
c375c43b
KG
4302fi
4303
093e61a6
RS
4304if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
4305 echo "$ac_t""yes" 1>&6
4306 :
c375c43b 4307else
093e61a6 4308 echo "$ac_t""no" 1>&6
c375c43b 4309fi
093e61a6 4310
c375c43b
KG
4311ac_cv_func_vfork_works=$ac_cv_func_vfork
4312else
093e61a6 4313 cat > conftest.$ac_ext <<EOF
4665e56c 4314#line 4315 "configure"
093e61a6 4315#include "confdefs.h"
c375c43b
KG
4316/* Thanks to Paul Eggert for this test. */
4317#include <stdio.h>
4318#include <sys/types.h>
4319#include <sys/stat.h>
093e61a6
RS
4320#ifdef HAVE_UNISTD_H
4321#include <unistd.h>
c375c43b 4322#endif
093e61a6
RS
4323#ifdef HAVE_VFORK_H
4324#include <vfork.h>
c375c43b
KG
4325#endif
4326/* On some sparc systems, changes by the child to local and incoming
093e61a6
RS
4327 argument registers are propagated back to the parent.
4328 The compiler is told about this with #include <vfork.h>,
4329 but some compilers (e.g. gcc -O) don't grok <vfork.h>.
4330 Test for this by using a static variable whose address
4331 is put into a register that is clobbered by the vfork. */
4332static
c375c43b
KG
4333#ifdef __cplusplus
4334sparc_address_test (int arg)
093e61a6 4335#else
c375c43b
KG
4336sparc_address_test (arg) int arg;
4337#endif
4338{
4339 static pid_t child;
4340 if (!child) {
4341 child = vfork ();
4342 if (child < 0) {
4343 perror ("vfork");
4344 _exit(2);
4345 }
4346 if (!child) {
4347 arg = getpid();
4348 write(-1, "", 0);
4349 _exit (arg);
4350 }
4351 }
4352}
093e61a6 4353main() {
c375c43b
KG
4354 pid_t parent = getpid ();
4355 pid_t child;
4356
093e61a6 4357 sparc_address_test ();
c375c43b
KG
4358
4359 child = vfork ();
4360
4361 if (child == 0) {
093e61a6
RS
4362 /* Here is another test for sparc vfork register problems.
4363 This test uses lots of local variables, at least
4364 as many local variables as main has allocated so far
4365 including compiler temporaries. 4 locals are enough for
4366 gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
4367 A buggy compiler should reuse the register of parent
4368 for one of the local variables, since it will think that
4369 parent can't possibly be used any more in this routine.
4370 Assigning to the local variable will thus munge parent
4371 in the parent process. */
c375c43b
KG
4372 pid_t
4373 p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
4374 p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
4375 /* Convince the compiler that p..p7 are live; otherwise, it might
4376 use the same hardware register for all 8 local variables. */
4377 if (p != p1 || p != p2 || p != p3 || p != p4
4378 || p != p5 || p != p6 || p != p7)
4379 _exit(1);
4380
093e61a6
RS
4381 /* On some systems (e.g. IRIX 3.3),
4382 vfork doesn't separate parent from child file descriptors.
4383 If the child closes a descriptor before it execs or exits,
4384 this munges the parent's descriptor as well.
4385 Test for this by closing stdout in the child. */
c375c43b
KG
4386 _exit(close(fileno(stdout)) != 0);
4387 } else {
4388 int status;
4389 struct stat st;
4390
4391 while (wait(&status) != child)
4392 ;
4393 exit(
4394 /* Was there some problem with vforking? */
4395 child < 0
4396
4397 /* Did the child fail? (This shouldn't happen.) */
4398 || status
4399
4400 /* Did the vfork/compiler bug occur? */
4401 || parent != getpid()
4402
4403 /* Did the file descriptor bug occur? */
4404 || fstat(fileno(stdout), &st) != 0
4405 );
4406 }
4407}
093e61a6 4408EOF
4665e56c 4409if { (eval echo configure:4410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
093e61a6 4410then
c375c43b
KG
4411 ac_cv_func_vfork_works=yes
4412else
093e61a6
RS
4413 echo "configure: failed program was:" >&5
4414 cat conftest.$ac_ext >&5
4415 rm -fr conftest*
4416 ac_cv_func_vfork_works=no
c375c43b 4417fi
093e61a6 4418rm -fr conftest*
cafe096b 4419fi
c375c43b
KG
4420
4421fi
4422
093e61a6
RS
4423echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
4424if test $ac_cv_func_vfork_works = no; then
4425 cat >> confdefs.h <<\EOF
c375c43b 4426#define vfork fork
093e61a6 4427EOF
c375c43b
KG
4428
4429fi
4430
81bf3d9e 4431
f91abfce 4432
093e61a6 4433
b7f2fb96 4434 am_cv_lib_iconv_ldpath=
093e61a6 4435 # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
f91abfce
TT
4436if test "${with_libiconv_prefix+set}" = set; then
4437 withval="$with_libiconv_prefix"
093e61a6 4438
f91abfce
TT
4439 for dir in `echo "$withval" | tr : ' '`; do
4440 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
b7f2fb96 4441 if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
f91abfce 4442 done
093e61a6
RS
4443
4444fi
f91abfce
TT
4445
4446
093e61a6 4447 echo $ac_n "checking for iconv""... $ac_c" 1>&6
4665e56c 4448echo "configure:4449: checking for iconv" >&5
093e61a6
RS
4449if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
4450 echo $ac_n "(cached) $ac_c" 1>&6
f91abfce 4451else
093e61a6 4452
f91abfce
TT
4453 am_cv_func_iconv="no, consider installing GNU libiconv"
4454 am_cv_lib_iconv=no
093e61a6 4455 cat > conftest.$ac_ext <<EOF
4665e56c 4456#line 4457 "configure"
093e61a6 4457#include "confdefs.h"
f91abfce
TT
4458#include <stdlib.h>
4459#include <iconv.h>
093e61a6 4460int main() {
f91abfce
TT
4461iconv_t cd = iconv_open("","");
4462 iconv(cd,NULL,NULL,NULL,NULL);
4463 iconv_close(cd);
093e61a6
RS
4464; return 0; }
4465EOF
4665e56c 4466if { (eval echo configure:4467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6 4467 rm -rf conftest*
f91abfce
TT
4468 am_cv_func_iconv=yes
4469else
093e61a6
RS
4470 echo "configure: failed program was:" >&5
4471 cat conftest.$ac_ext >&5
f91abfce 4472fi
093e61a6 4473rm -f conftest*
f91abfce
TT
4474 if test "$am_cv_func_iconv" != yes; then
4475 am_save_LIBS="$LIBS"
b7f2fb96 4476 LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
093e61a6 4477 cat > conftest.$ac_ext <<EOF
4665e56c 4478#line 4479 "configure"
093e61a6 4479#include "confdefs.h"
f91abfce
TT
4480#include <stdlib.h>
4481#include <iconv.h>
093e61a6 4482int main() {
f91abfce
TT
4483iconv_t cd = iconv_open("","");
4484 iconv(cd,NULL,NULL,NULL,NULL);
4485 iconv_close(cd);
093e61a6
RS
4486; return 0; }
4487EOF
4665e56c 4488if { (eval echo configure:4489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6 4489 rm -rf conftest*
f91abfce
TT
4490 am_cv_lib_iconv=yes
4491 am_cv_func_iconv=yes
4492else
093e61a6
RS
4493 echo "configure: failed program was:" >&5
4494 cat conftest.$ac_ext >&5
f91abfce 4495fi
093e61a6 4496rm -f conftest*
f91abfce
TT
4497 LIBS="$am_save_LIBS"
4498 fi
093e61a6 4499
cafe096b 4500fi
cafe096b 4501
093e61a6
RS
4502echo "$ac_t""$am_cv_func_iconv" 1>&6
4503 if test "$am_cv_func_iconv" = yes; then
4504 cat >> confdefs.h <<\EOF
f91abfce 4505#define HAVE_ICONV 1
093e61a6 4506EOF
f91abfce 4507
093e61a6 4508 echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
4665e56c 4509echo "configure:4510: checking for iconv declaration" >&5
093e61a6
RS
4510 if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
4511 echo $ac_n "(cached) $ac_c" 1>&6
f91abfce 4512else
093e61a6
RS
4513
4514 cat > conftest.$ac_ext <<EOF
4665e56c 4515#line 4516 "configure"
093e61a6 4516#include "confdefs.h"
f91abfce
TT
4517
4518#include <stdlib.h>
4519#include <iconv.h>
4520extern
4521#ifdef __cplusplus
4522"C"
4523#endif
4524#if defined(__STDC__) || defined(__cplusplus)
4525size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
4526#else
4527size_t iconv();
4528#endif
4529
093e61a6 4530int main() {
f91abfce 4531
093e61a6
RS
4532; return 0; }
4533EOF
4665e56c 4534if { (eval echo configure:4535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 4535 rm -rf conftest*
f91abfce
TT
4536 am_cv_proto_iconv_arg1=""
4537else
093e61a6
RS
4538 echo "configure: failed program was:" >&5
4539 cat conftest.$ac_ext >&5
4540 rm -rf conftest*
4541 am_cv_proto_iconv_arg1="const"
f91abfce 4542fi
093e61a6 4543rm -f conftest*
f91abfce
TT
4544 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
4545fi
4546
4547 am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
093e61a6
RS
4548 echo "$ac_t""${ac_t:-
4549 }$am_cv_proto_iconv" 1>&6
4550 cat >> confdefs.h <<EOF
f91abfce 4551#define ICONV_CONST $am_cv_proto_iconv_arg1
093e61a6 4552EOF
f91abfce
TT
4553
4554 fi
4555 LIBICONV=
4556 if test "$am_cv_lib_iconv" = yes; then
b7f2fb96 4557 LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
f91abfce 4558 fi
093e61a6 4559
f91abfce
TT
4560
4561
86cf1cbd
KG
4562# We will need to find libiberty.h and ansidecl.h
4563saved_CFLAGS="$CFLAGS"
4564CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
8e944909 4565for ac_func in getenv atol sbrk abort atof getcwd getwd \
3b681e9d 4566 strsignal putc_unlocked fputs_unlocked fwrite_unlocked \
a7475ab1 4567 fprintf_unlocked strstr errno vasprintf \
c1800ec8 4568 malloc realloc calloc free basename getopt clock
81bf3d9e 4569do
f31e826b 4570 ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
093e61a6 4571echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
4665e56c 4572echo "configure:4573: checking whether $ac_func is declared" >&5
093e61a6
RS
4573if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
4574 echo $ac_n "(cached) $ac_c" 1>&6
4575else
4576 cat > conftest.$ac_ext <<EOF
4665e56c 4577#line 4578 "configure"
093e61a6 4578#include "confdefs.h"
7afe8c41
KG
4579#undef $ac_tr_decl
4580#define $ac_tr_decl 1
093e61a6 4581
d02af173 4582#include "ansidecl.h"
86cf1cbd 4583#include "system.h"
f31e826b 4584
093e61a6 4585int main() {
86cf1cbd
KG
4586#ifndef $ac_func
4587char *(*pfn) = (char *(*)) $ac_func ;
4588#endif
093e61a6
RS
4589; return 0; }
4590EOF
4665e56c 4591if { (eval echo configure:4592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 4592 rm -rf conftest*
f31e826b 4593 eval "gcc_cv_have_decl_$ac_func=yes"
81bf3d9e 4594else
093e61a6
RS
4595 echo "configure: failed program was:" >&5
4596 cat conftest.$ac_ext >&5
4597 rm -rf conftest*
4598 eval "gcc_cv_have_decl_$ac_func=no"
81bf3d9e 4599fi
093e61a6 4600rm -f conftest*
81bf3d9e
RH
4601fi
4602
f31e826b 4603if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
093e61a6 4604 echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
86cf1cbd 4605#define $ac_tr_decl 1
093e61a6
RS
4606EOF
4607
81bf3d9e 4608else
093e61a6 4609 echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
f31e826b 4610#define $ac_tr_decl 0
093e61a6
RS
4611EOF
4612
81bf3d9e
RH
4613fi
4614
4615done
86cf1cbd 4616if test x = y ; then
093e61a6 4617 cat >> confdefs.h <<\EOF
f31e826b 4618#define HAVE_DECL_GETENV 1
093e61a6
RS
4619EOF
4620 cat >> confdefs.h <<\EOF
f31e826b 4621#define HAVE_DECL_ATOL 1
093e61a6
RS
4622EOF
4623 cat >> confdefs.h <<\EOF
f31e826b 4624#define HAVE_DECL_SBRK 1
093e61a6
RS
4625EOF
4626 cat >> confdefs.h <<\EOF
f31e826b 4627#define HAVE_DECL_ABORT 1
093e61a6
RS
4628EOF
4629 cat >> confdefs.h <<\EOF
f31e826b 4630#define HAVE_DECL_ATOF 1
093e61a6
RS
4631EOF
4632 cat >> confdefs.h <<\EOF
f31e826b 4633#define HAVE_DECL_GETCWD 1
093e61a6
RS
4634EOF
4635 cat >> confdefs.h <<\EOF
f31e826b 4636#define HAVE_DECL_GETWD 1
093e61a6 4637EOF
86cf1cbd 4638 \
093e61a6 4639 cat >> confdefs.h <<\EOF
f31e826b 4640#define HAVE_DECL_STRSIGNAL 1
093e61a6
RS
4641EOF
4642 cat >> confdefs.h <<\EOF
f31e826b 4643#define HAVE_DECL_PUTC_UNLOCKED 1
093e61a6
RS
4644EOF
4645 cat >> confdefs.h <<\EOF
f31e826b 4646#define HAVE_DECL_FPUTS_UNLOCKED 1
093e61a6
RS
4647EOF
4648 cat >> confdefs.h <<\EOF
3b681e9d 4649#define HAVE_DECL_FWRITE_UNLOCKED 1
093e61a6 4650EOF
3b681e9d 4651 \
093e61a6 4652 cat >> confdefs.h <<\EOF
3b681e9d 4653#define HAVE_DECL_FPRINTF_UNLOCKED 1
093e61a6
RS
4654EOF
4655 cat >> confdefs.h <<\EOF
f31e826b 4656#define HAVE_DECL_STRSTR 1
093e61a6
RS
4657EOF
4658 cat >> confdefs.h <<\EOF
6c889b67 4659#define HAVE_DECL_ERRNO 1
093e61a6
RS
4660EOF
4661 cat >> confdefs.h <<\EOF
a7475ab1 4662#define HAVE_DECL_VASPRINTF 1
093e61a6 4663EOF
86cf1cbd 4664 \
093e61a6 4665 cat >> confdefs.h <<\EOF
f31e826b 4666#define HAVE_DECL_MALLOC 1
093e61a6
RS
4667EOF
4668 cat >> confdefs.h <<\EOF
f31e826b 4669#define HAVE_DECL_REALLOC 1
093e61a6
RS
4670EOF
4671 cat >> confdefs.h <<\EOF
f31e826b 4672#define HAVE_DECL_CALLOC 1
093e61a6
RS
4673EOF
4674 cat >> confdefs.h <<\EOF
f31e826b 4675#define HAVE_DECL_FREE 1
093e61a6
RS
4676EOF
4677 cat >> confdefs.h <<\EOF
f31e826b 4678#define HAVE_DECL_BASENAME 1
093e61a6
RS
4679EOF
4680 cat >> confdefs.h <<\EOF
f31e826b 4681#define HAVE_DECL_GETOPT 1
093e61a6
RS
4682EOF
4683 cat >> confdefs.h <<\EOF
c1800ec8 4684#define HAVE_DECL_CLOCK 1
093e61a6 4685EOF
81bf3d9e
RH
4686fi
4687
81bf3d9e
RH
4688
4689for ac_func in getrlimit setrlimit getrusage
4690do
f31e826b 4691 ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
093e61a6 4692echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
4665e56c 4693echo "configure:4694: checking whether $ac_func is declared" >&5
093e61a6
RS
4694if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
4695 echo $ac_n "(cached) $ac_c" 1>&6
4696else
4697 cat > conftest.$ac_ext <<EOF
4665e56c 4698#line 4699 "configure"
093e61a6 4699#include "confdefs.h"
7afe8c41
KG
4700#undef $ac_tr_decl
4701#define $ac_tr_decl 1
093e61a6 4702
d02af173 4703#include "ansidecl.h"
86cf1cbd 4704#include "system.h"
81bf3d9e
RH
4705#ifdef HAVE_SYS_RESOURCE_H
4706#include <sys/resource.h>
4707#endif
4708
f31e826b 4709
093e61a6 4710int main() {
86cf1cbd
KG
4711#ifndef $ac_func
4712char *(*pfn) = (char *(*)) $ac_func ;
4713#endif
093e61a6
RS
4714; return 0; }
4715EOF
4665e56c 4716if { (eval echo configure:4717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 4717 rm -rf conftest*
f31e826b 4718 eval "gcc_cv_have_decl_$ac_func=yes"
81bf3d9e 4719else
093e61a6
RS
4720 echo "configure: failed program was:" >&5
4721 cat conftest.$ac_ext >&5
4722 rm -rf conftest*
4723 eval "gcc_cv_have_decl_$ac_func=no"
81bf3d9e 4724fi
093e61a6 4725rm -f conftest*
81bf3d9e
RH
4726fi
4727
f31e826b 4728if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
093e61a6 4729 echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
86cf1cbd 4730#define $ac_tr_decl 1
093e61a6
RS
4731EOF
4732
81bf3d9e 4733else
093e61a6 4734 echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
f31e826b 4735#define $ac_tr_decl 0
093e61a6
RS
4736EOF
4737
81bf3d9e
RH
4738fi
4739
4740done
86cf1cbd 4741if test x = y ; then
093e61a6 4742 cat >> confdefs.h <<\EOF
f31e826b 4743#define HAVE_DECL_GETRLIMIT 1
093e61a6
RS
4744EOF
4745 cat >> confdefs.h <<\EOF
f31e826b 4746#define HAVE_DECL_SETRLIMIT 1
093e61a6
RS
4747EOF
4748 cat >> confdefs.h <<\EOF
f31e826b 4749#define HAVE_DECL_GETRUSAGE 1
093e61a6 4750EOF
86cf1cbd
KG
4751fi
4752
81bf3d9e 4753
093e61a6 4754cat > conftest.$ac_ext <<EOF
4665e56c 4755#line 4756 "configure"
093e61a6 4756#include "confdefs.h"
b2522d2b
HPN
4757
4758#include "ansidecl.h"
4759#include "system.h"
4760#ifdef HAVE_SYS_RESOURCE_H
4761#include <sys/resource.h>
4762#endif
4763
093e61a6 4764int main() {
b2522d2b 4765rlim_t l = 0;
093e61a6
RS
4766; return 0; }
4767EOF
4665e56c 4768if { (eval echo configure:4769: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
b2522d2b
HPN
4769 :
4770else
093e61a6
RS
4771 echo "configure: failed program was:" >&5
4772 cat conftest.$ac_ext >&5
4773 rm -rf conftest*
4774 cat >> confdefs.h <<\EOF
b2522d2b 4775#define rlim_t long
093e61a6 4776EOF
b2522d2b
HPN
4777
4778fi
093e61a6 4779rm -f conftest*
b2522d2b 4780
351df804 4781for ac_func in ldgetname
c1800ec8
ZW
4782do
4783 ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
093e61a6 4784echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
4665e56c 4785echo "configure:4786: checking whether $ac_func is declared" >&5
093e61a6
RS
4786if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
4787 echo $ac_n "(cached) $ac_c" 1>&6
4788else
4789 cat > conftest.$ac_ext <<EOF
4665e56c 4790#line 4791 "configure"
093e61a6 4791#include "confdefs.h"
c1800ec8
ZW
4792#undef $ac_tr_decl
4793#define $ac_tr_decl 1
093e61a6 4794
351df804
KG
4795#include "ansidecl.h"
4796#include "system.h"
4797#ifdef HAVE_LDFCN_H
4798#include <ldfcn.h>
4799#endif
4800
4801
093e61a6 4802int main() {
351df804
KG
4803#ifndef $ac_func
4804char *(*pfn) = (char *(*)) $ac_func ;
4805#endif
093e61a6
RS
4806; return 0; }
4807EOF
4665e56c 4808if { (eval echo configure:4809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 4809 rm -rf conftest*
351df804
KG
4810 eval "gcc_cv_have_decl_$ac_func=yes"
4811else
093e61a6
RS
4812 echo "configure: failed program was:" >&5
4813 cat conftest.$ac_ext >&5
4814 rm -rf conftest*
4815 eval "gcc_cv_have_decl_$ac_func=no"
351df804 4816fi
093e61a6 4817rm -f conftest*
351df804
KG
4818fi
4819
4820if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
093e61a6 4821 echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
351df804 4822#define $ac_tr_decl 1
093e61a6
RS
4823EOF
4824
351df804 4825else
093e61a6 4826 echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
351df804 4827#define $ac_tr_decl 0
093e61a6
RS
4828EOF
4829
351df804
KG
4830fi
4831
4832done
4833if test x = y ; then
093e61a6 4834 cat >> confdefs.h <<\EOF
351df804 4835#define HAVE_DECL_LDGETNAME 1
093e61a6 4836EOF
351df804
KG
4837fi
4838
4839
4840for ac_func in times
4841do
4842 ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
093e61a6 4843echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
4665e56c 4844echo "configure:4845: checking whether $ac_func is declared" >&5
093e61a6
RS
4845if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
4846 echo $ac_n "(cached) $ac_c" 1>&6
4847else
4848 cat > conftest.$ac_ext <<EOF
4665e56c 4849#line 4850 "configure"
093e61a6 4850#include "confdefs.h"
351df804
KG
4851#undef $ac_tr_decl
4852#define $ac_tr_decl 1
093e61a6 4853
c1800ec8
ZW
4854#include "ansidecl.h"
4855#include "system.h"
4856#ifdef HAVE_SYS_TIMES_H
4857#include <sys/times.h>
4858#endif
4859
4860
093e61a6 4861int main() {
c1800ec8
ZW
4862#ifndef $ac_func
4863char *(*pfn) = (char *(*)) $ac_func ;
4864#endif
093e61a6
RS
4865; return 0; }
4866EOF
4665e56c 4867if { (eval echo configure:4868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 4868 rm -rf conftest*
c1800ec8
ZW
4869 eval "gcc_cv_have_decl_$ac_func=yes"
4870else
093e61a6
RS
4871 echo "configure: failed program was:" >&5
4872 cat conftest.$ac_ext >&5
4873 rm -rf conftest*
4874 eval "gcc_cv_have_decl_$ac_func=no"
c1800ec8 4875fi
093e61a6 4876rm -f conftest*
c1800ec8
ZW
4877fi
4878
4879if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
093e61a6 4880 echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
c1800ec8 4881#define $ac_tr_decl 1
093e61a6
RS
4882EOF
4883
c1800ec8 4884else
093e61a6 4885 echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
c1800ec8 4886#define $ac_tr_decl 0
093e61a6
RS
4887EOF
4888
c1800ec8
ZW
4889fi
4890
4891done
4892if test x = y ; then
093e61a6 4893 cat >> confdefs.h <<\EOF
c1800ec8 4894#define HAVE_DECL_TIMES 1
093e61a6 4895EOF
c1800ec8
ZW
4896fi
4897
4898
4899# More time-related stuff.
093e61a6 4900echo $ac_n "checking for struct tms""... $ac_c" 1>&6
4665e56c 4901echo "configure:4902: checking for struct tms" >&5
093e61a6
RS
4902if eval "test \"`echo '$''{'ac_cv_struct_tms'+set}'`\" = set"; then
4903 echo $ac_n "(cached) $ac_c" 1>&6
4904else
4905
4906cat > conftest.$ac_ext <<EOF
4665e56c 4907#line 4908 "configure"
093e61a6 4908#include "confdefs.h"
c1800ec8
ZW
4909
4910#include "ansidecl.h"
4911#include "system.h"
4912#ifdef HAVE_SYS_TIMES_H
4913#include <sys/times.h>
4914#endif
4915
093e61a6 4916int main() {
c1800ec8 4917struct tms tms;
093e61a6
RS
4918; return 0; }
4919EOF
4665e56c 4920if { (eval echo configure:4921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 4921 rm -rf conftest*
c1800ec8
ZW
4922 ac_cv_struct_tms=yes
4923else
093e61a6
RS
4924 echo "configure: failed program was:" >&5
4925 cat conftest.$ac_ext >&5
4926 rm -rf conftest*
4927 ac_cv_struct_tms=no
c1800ec8 4928fi
093e61a6 4929rm -f conftest*
c1800ec8 4930fi
cafe096b 4931
093e61a6
RS
4932echo "$ac_t""$ac_cv_struct_tms" 1>&6
4933if test $ac_cv_struct_tms = yes; then
4934 cat >> confdefs.h <<\EOF
c1800ec8 4935#define HAVE_STRUCT_TMS 1
093e61a6 4936EOF
c1800ec8
ZW
4937
4938fi
4939
4940# use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE.
4941# revisit after autoconf 2.50.
093e61a6 4942echo $ac_n "checking for clock_t""... $ac_c" 1>&6
4665e56c 4943echo "configure:4944: checking for clock_t" >&5
093e61a6
RS
4944if eval "test \"`echo '$''{'gcc_cv_type_clock_t'+set}'`\" = set"; then
4945 echo $ac_n "(cached) $ac_c" 1>&6
4946else
4947
4948cat > conftest.$ac_ext <<EOF
4665e56c 4949#line 4950 "configure"
093e61a6 4950#include "confdefs.h"
c1800ec8
ZW
4951
4952#include "ansidecl.h"
4953#include "system.h"
4954
093e61a6 4955int main() {
c1800ec8 4956clock_t x;
093e61a6
RS
4957; return 0; }
4958EOF
4665e56c 4959if { (eval echo configure:4960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 4960 rm -rf conftest*
c1800ec8
ZW
4961 gcc_cv_type_clock_t=yes
4962else
093e61a6
RS
4963 echo "configure: failed program was:" >&5
4964 cat conftest.$ac_ext >&5
4965 rm -rf conftest*
4966 gcc_cv_type_clock_t=no
c1800ec8 4967fi
093e61a6 4968rm -f conftest*
c1800ec8 4969fi
cafe096b 4970
093e61a6
RS
4971echo "$ac_t""$gcc_cv_type_clock_t" 1>&6
4972if test $gcc_cv_type_clock_t = yes; then
4973 cat >> confdefs.h <<\EOF
c1800ec8 4974#define HAVE_CLOCK_T 1
093e61a6 4975EOF
c1800ec8
ZW
4976
4977fi
4978
093e61a6 4979echo $ac_n "checking for uchar""... $ac_c" 1>&6
4665e56c 4980echo "configure:4981: checking for uchar" >&5
093e61a6
RS
4981if eval "test \"`echo '$''{'gcc_cv_type_uchar'+set}'`\" = set"; then
4982 echo $ac_n "(cached) $ac_c" 1>&6
a12b5bd9 4983else
093e61a6 4984 cat > conftest.$ac_ext <<EOF
4665e56c 4985#line 4986 "configure"
093e61a6 4986#include "confdefs.h"
a12b5bd9
ZW
4987
4988#include "ansidecl.h"
4989#include "system.h"
4990
093e61a6 4991int main() {
a12b5bd9
ZW
4992if ((uchar *)0) return 0;
4993 if (sizeof(uchar)) return 0;
093e61a6
RS
4994; return 0; }
4995EOF
4665e56c 4996if { (eval echo configure:4997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 4997 rm -rf conftest*
a12b5bd9
ZW
4998 ac_cv_type_uchar=yes
4999else
093e61a6
RS
5000 echo "configure: failed program was:" >&5
5001 cat conftest.$ac_ext >&5
5002 rm -rf conftest*
5003 ac_cv_type_uchar=no
a12b5bd9 5004fi
093e61a6 5005rm -f conftest*
a12b5bd9 5006fi
cafe096b 5007
093e61a6
RS
5008echo "$ac_t""$gcc_cv_type_uchar" 1>&6
5009if test $ac_cv_type_uchar = yes; then
5010 cat >> confdefs.h <<\EOF
a12b5bd9 5011#define HAVE_UCHAR 1
093e61a6 5012EOF
a12b5bd9
ZW
5013
5014fi
5015
eb70d86d
AS
5016# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
5017CFLAGS="$saved_CFLAGS"
5018
07cf4226
DM
5019# Check whether --enable-initfini-array or --disable-initfini-array was given.
5020if test "${enable_initfini_array+set}" = set; then
5021 enableval="$enable_initfini_array"
093e61a6 5022 :
07cf4226 5023else
093e61a6
RS
5024
5025echo $ac_n "checking for .preinit_array/.init_array/.fini_array support""... $ac_c" 1>&6
4665e56c 5026echo "configure:5027: checking for .preinit_array/.init_array/.fini_array support" >&5
093e61a6
RS
5027if eval "test \"`echo '$''{'gcc_cv_initfini_array'+set}'`\" = set"; then
5028 echo $ac_n "(cached) $ac_c" 1>&6
07cf4226 5029else
eb70d86d 5030 if test "$cross_compiling" = yes; then
918c4fe4 5031 gcc_cv_initfini_array=no
eb70d86d 5032else
093e61a6 5033 cat > conftest.$ac_ext <<EOF
4665e56c 5034#line 5035 "configure"
093e61a6 5035#include "confdefs.h"
eb70d86d 5036
07cf4226
DM
5037static int x = -1;
5038int main (void) { return x; }
5039int foo (void) { x = 0; }
5040int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
093e61a6 5041EOF
4665e56c 5042if { (eval echo configure:5043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
093e61a6 5043then
918c4fe4 5044 gcc_cv_initfini_array=yes
eb70d86d 5045else
093e61a6
RS
5046 echo "configure: failed program was:" >&5
5047 cat conftest.$ac_ext >&5
5048 rm -fr conftest*
5049 gcc_cv_initfini_array=no
eb70d86d 5050fi
093e61a6 5051rm -fr conftest*
eb70d86d 5052fi
093e61a6 5053
07cf4226 5054fi
093e61a6
RS
5055
5056echo "$ac_t""$gcc_cv_initfini_array" 1>&6
eb70d86d 5057 enable_initfini_array=$gcc_cv_initfini_array
07cf4226 5058
093e61a6 5059fi
cafe096b 5060
093e61a6
RS
5061if test $enable_initfini_array = yes; then
5062 cat >> confdefs.h <<\EOF
eb70d86d 5063#define HAVE_INITFINI_ARRAY 1
093e61a6 5064EOF
07cf4226 5065
eb70d86d 5066fi
81bf3d9e 5067
093e61a6
RS
5068# mkdir takes a single argument on some systems.
5069echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6
4665e56c 5070echo "configure:5071: checking if mkdir takes one argument" >&5
093e61a6
RS
5071if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then
5072 echo $ac_n "(cached) $ac_c" 1>&6
75923b2f 5073else
093e61a6 5074 cat > conftest.$ac_ext <<EOF
4665e56c 5075#line 5076 "configure"
093e61a6 5076#include "confdefs.h"
75923b2f
MK
5077
5078#include <sys/types.h>
5079#ifdef HAVE_SYS_STAT_H
5080# include <sys/stat.h>
5081#endif
5082#ifdef HAVE_UNISTD_H
5083# include <unistd.h>
5084#endif
5085#ifdef HAVE_DIRECT_H
5086# include <direct.h>
5087#endif
093e61a6 5088int main() {
75923b2f 5089mkdir ("foo", 0);
093e61a6
RS
5090; return 0; }
5091EOF
4665e56c 5092if { (eval echo configure:5093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 5093 rm -rf conftest*
75923b2f
MK
5094 gcc_cv_mkdir_takes_one_arg=no
5095else
093e61a6
RS
5096 echo "configure: failed program was:" >&5
5097 cat conftest.$ac_ext >&5
5098 rm -rf conftest*
5099 gcc_cv_mkdir_takes_one_arg=yes
75923b2f 5100fi
093e61a6 5101rm -f conftest*
75923b2f 5102fi
cafe096b 5103
093e61a6
RS
5104echo "$ac_t""$gcc_cv_mkdir_takes_one_arg" 1>&6
5105if test $gcc_cv_mkdir_takes_one_arg = yes ; then
5106 cat >> confdefs.h <<\EOF
75923b2f 5107#define MKDIR_TAKES_ONE_ARG 1
093e61a6 5108EOF
75923b2f
MK
5109
5110fi
5111
5112
861bb6c1
JL
5113# File extensions
5114manext='.1'
5115objext='.o'
5116
5117
5118
4977bab6
ZW
5119# With Setjmp/Longjmp based exception handling.
5120# Check whether --enable-sjlj-exceptions or --disable-sjlj-exceptions was given.
5121if test "${enable_sjlj_exceptions+set}" = set; then
5122 enableval="$enable_sjlj_exceptions"
5123 sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi`
093e61a6 5124cat >> confdefs.h <<EOF
cafe096b 5125#define CONFIG_SJLJ_EXCEPTIONS $sjlj
093e61a6
RS
5126EOF
5127
5128fi
4977bab6
ZW
5129
5130
093e61a6 5131echo $ac_n "checking for main in -lunwind""... $ac_c" 1>&6
4665e56c 5132echo "configure:5133: checking for main in -lunwind" >&5
093e61a6
RS
5133ac_lib_var=`echo unwind'_'main | sed 'y%./+-%__p_%'`
5134if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5135 echo $ac_n "(cached) $ac_c" 1>&6
4977bab6 5136else
093e61a6 5137 ac_save_LIBS="$LIBS"
4977bab6 5138LIBS="-lunwind $LIBS"
093e61a6 5139cat > conftest.$ac_ext <<EOF
4665e56c 5140#line 5141 "configure"
093e61a6 5141#include "confdefs.h"
4977bab6 5142
093e61a6
RS
5143int main() {
5144main()
5145; return 0; }
5146EOF
4665e56c 5147if { (eval echo configure:5148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6
RS
5148 rm -rf conftest*
5149 eval "ac_cv_lib_$ac_lib_var=yes"
5150else
5151 echo "configure: failed program was:" >&5
5152 cat conftest.$ac_ext >&5
5153 rm -rf conftest*
5154 eval "ac_cv_lib_$ac_lib_var=no"
5155fi
5156rm -f conftest*
5157LIBS="$ac_save_LIBS"
4977bab6 5158
093e61a6
RS
5159fi
5160if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5161 echo "$ac_t""yes" 1>&6
4977bab6
ZW
5162 use_libunwind_default=yes
5163else
093e61a6
RS
5164 echo "$ac_t""no" 1>&6
5165use_libunwind_default=no
4977bab6
ZW
5166fi
5167
5168# Use libunwind based exception handling.
5169# Check whether --enable-libunwind-exceptions or --disable-libunwind-exceptions was given.
5170if test "${enable_libunwind_exceptions+set}" = set; then
5171 enableval="$enable_libunwind_exceptions"
5172 use_libunwind_exceptions=$enableval
5173else
5174 use_libunwind_exceptions=$use_libunwind_default
093e61a6 5175fi
cafe096b 5176
093e61a6
RS
5177if test x"$use_libunwind_exceptions" = xyes; then
5178 cat >> confdefs.h <<\EOF
4977bab6 5179#define USE_LIBUNWIND_EXCEPTIONS 1
093e61a6 5180EOF
4977bab6
ZW
5181
5182fi
5183
34a86c2b
NN
5184# --------------------------------------------------------
5185# Build, host, and target specific configuration fragments
5186# --------------------------------------------------------
5187
ef69da62 5188target_gtfiles=
861bb6c1 5189build_xm_file=
f6cb0e63 5190build_xm_defines=
861bb6c1
JL
5191build_install_headers_dir=install-headers-tar
5192build_exeext=
5193host_xm_file=
f6cb0e63 5194host_xm_defines=
861bb6c1 5195host_xmake_file=
6e26218f 5196host_exeext=
861bb6c1
JL
5197
5198# Decode the host machine, then the target machine.
5199# For the host machine, we save the xm_file variable as host_xm_file;
5200# then we decode the target machine and forget everything else
5201# that came from the host machine.
5202for machine in $build $host $target; do
61ed06c3 5203 . ${srcdir}/config.gcc
861bb6c1
JL
5204done
5205
5206extra_objs="${host_extra_objs} ${extra_objs}"
5207
5208# Default the target-machine variables that were not explicitly set.
75bffa71 5209if test x"$tm_file" = x
861bb6c1
JL
5210then tm_file=$cpu_type/$cpu_type.h; fi
5211
6b2adea9 5212if test x"$extra_headers" = x
861bb6c1
JL
5213then extra_headers=; fi
5214
75bffa71 5215if test x$md_file = x
e98e406f 5216then md_file=$cpu_type/$cpu_type.md; fi
861bb6c1 5217
75bffa71 5218if test x$out_file = x
861bb6c1
JL
5219then out_file=$cpu_type/$cpu_type.c; fi
5220
75bffa71 5221if test x"$tmake_file" = x
861bb6c1
JL
5222then tmake_file=$cpu_type/t-$cpu_type
5223fi
5224
90e6a802 5225if test x"$dwarf2" = xyes
756ee602 5226then tm_file="$tm_file tm-dwarf2.h"
90e6a802
RL
5227fi
5228
861bb6c1 5229# Say what files are being used for the output code and MD file.
11642c3a 5230echo "Using \`$srcdir/config/$out_file' for machine-specific logic."
861bb6c1
JL
5231echo "Using \`$srcdir/config/$md_file' as machine description file."
5232
11642c3a 5233# If any of the xm_file variables contain nonexistent files, warn
4dc0535b
ZW
5234# about them and drop them.
5235
11642c3a
ZW
5236bx=
5237for x in $build_xm_file; do
5238 if test -f $srcdir/config/$x
5239 then bx="$bx $x"
093e61a6 5240 else echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
11642c3a
ZW
5241 fi
5242done
5243build_xm_file="$bx"
5244
5245hx=
5246for x in $host_xm_file; do
5247 if test -f $srcdir/config/$x
5248 then hx="$hx $x"
093e61a6 5249 else echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
11642c3a
ZW
5250 fi
5251done
5252host_xm_file="$hx"
5253
5254tx=
5255for x in $xm_file; do
5256 if test -f $srcdir/config/$x
5257 then tx="$tx $x"
093e61a6 5258 else echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
11642c3a
ZW
5259 fi
5260done
5261xm_file="$tx"
5262
861bb6c1
JL
5263count=a
5264for f in $tm_file; do
5265 count=${count}x
5266done
75bffa71 5267if test $count = ax; then
861bb6c1
JL
5268 echo "Using \`$srcdir/config/$tm_file' as target machine macro file."
5269else
5270 echo "Using the following target machine macro files:"
5271 for f in $tm_file; do
5272 echo " $srcdir/config/$f"
5273 done
5274fi
5275
4977bab6 5276if test x$need_64bit_hwint = xyes; then
093e61a6 5277 cat >> confdefs.h <<\EOF
4977bab6 5278#define NEED_64BIT_HOST_WIDE_INT 1
093e61a6 5279EOF
4977bab6
ZW
5280
5281fi
5282
861bb6c1
JL
5283count=a
5284for f in $host_xm_file; do
5285 count=${count}x
5286done
11642c3a
ZW
5287if test $count = a; then
5288 :
5289elif test $count = ax; then
861bb6c1
JL
5290 echo "Using \`$srcdir/config/$host_xm_file' as host machine macro file."
5291else
5292 echo "Using the following host machine macro files:"
5293 for f in $host_xm_file; do
5294 echo " $srcdir/config/$f"
5295 done
5296fi
476d9098 5297echo "Using ${out_host_hook_obj} for host machine hooks."
861bb6c1 5298
75bffa71 5299if test "$host_xm_file" != "$build_xm_file"; then
861bb6c1
JL
5300 count=a
5301 for f in $build_xm_file; do
5302 count=${count}x
5303 done
11642c3a
ZW
5304 if test $count = a; then
5305 :
5306 elif test $count = ax; then
861bb6c1
JL
5307 echo "Using \`$srcdir/config/$build_xm_file' as build machine macro file."
5308 else
5309 echo "Using the following build machine macro files:"
5310 for f in $build_xm_file; do
5311 echo " $srcdir/config/$f"
5312 done
5313 fi
5314fi
5315
75bffa71
ILT
5316if test x$thread_file = x; then
5317 if test x$target_thread_file != x; then
a851212a
JW
5318 thread_file=$target_thread_file
5319 else
5320 thread_file='single'
5321 fi
861bb6c1
JL
5322fi
5323
2121a768
JT
5324if test x$enable___cxa_atexit = xyes || \
5325 test x$enable___cxa_atexit = x -a x$default_use_cxa_atexit = xyes; then
5326 cat >> confdefs.h <<\EOF
5327#define DEFAULT_USE_CXA_ATEXIT 1
5328EOF
5329
5330fi
5331
a5381466 5332# Look for a file containing extra machine modes.
1c0ca89d
ZW
5333if test -n "$extra_modes" && test -f $srcdir/config/$extra_modes; then
5334 extra_modes_file='$(srcdir)'/config/${extra_modes}
093e61a6
RS
5335
5336 cat >> confdefs.h <<EOF
1c0ca89d 5337#define EXTRA_MODES_FILE "$extra_modes"
093e61a6 5338EOF
cafe096b 5339
093e61a6 5340 cat >> confdefs.h <<\EOF
a5381466 5341#define EXTRA_CC_MODES 1
093e61a6 5342EOF
a5381466
ZW
5343
5344fi
5345
b7cb92ad 5346# auto-host.h is the file containing items generated by autoconf and is
e9a25f70 5347# the first file included by config.h.
4977bab6 5348# If host=build, it is correct to have bconfig include auto-host.h
093e61a6 5349# as well. If host!=build, we are in error and need to do more
db81d74a 5350# work to find out the build config parameters.
75bffa71 5351if test x$host = x$build
db81d74a 5352then
eaf4e618 5353 build_auto=auto-host.h
06f0b04c 5354 FORBUILD=..
b7cb92ad
JL
5355else
5356 # We create a subdir, then run autoconf in the subdir.
5357 # To prevent recursion we set host and build for the new
5358 # invocation of configure to the build for this invocation
093e61a6 5359 # of configure.
b7cb92ad
JL
5360 tempdir=build.$$
5361 rm -rf $tempdir
5362 mkdir $tempdir
5363 cd $tempdir
5364 case ${srcdir} in
255b8a49 5365 /* | A-Za-z:\\/* ) realsrcdir=${srcdir};;
b7cb92ad
JL
5366 *) realsrcdir=../${srcdir};;
5367 esac
d920e825
L
5368 saved_CFLAGS="${CFLAGS}"
5369 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
5370 ${realsrcdir}/configure \
534d0cc0 5371 --target=$target_alias --host=$build_alias --build=$build_alias
d920e825 5372 CFLAGS="${saved_CFLAGS}"
b7cb92ad
JL
5373
5374 # We just finished tests for the build machine, so rename
5375 # the file auto-build.h in the gcc directory.
5376 mv auto-host.h ../auto-build.h
5377 cd ..
5378 rm -rf $tempdir
eaf4e618 5379 build_auto=auto-build.h
3b1b059c 5380 FORBUILD=../${build_subdir}
db81d74a
RH
5381fi
5382
06f0b04c 5383
eaf4e618 5384tm_file="${tm_file} defaults.h"
4977bab6
ZW
5385tm_p_file="${tm_p_file} tm-preds.h"
5386host_xm_file="auto-host.h ansidecl.h ${host_xm_file}"
5387build_xm_file="${build_auto} ansidecl.h ${build_xm_file}"
49691411 5388# We don't want ansidecl.h in target files, write code there in ISO/GNU C.
b4862477
KG
5389# put this back in temporarily.
5390xm_file="ansidecl.h ${xm_file}"
0056a9b5 5391
34a86c2b
NN
5392# --------
5393# UNSORTED
5394# --------
5395
f1943b77 5396# Get the version trigger filename from the toplevel
75bffa71 5397if test "${with_gcc_version_trigger+set}" = set; then
f1943b77
MH
5398 gcc_version_trigger=$with_gcc_version_trigger
5399else
5400 gcc_version_trigger=${srcdir}/version.c
5401fi
022dae81 5402gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
8763704d 5403gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
861bb6c1 5404
cc1e60ea 5405# Compile in configure arguments.
8105825d 5406if test -f configargs.h ; then
cc1e60ea 5407 # Being re-configured.
022dae81 5408 gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'`
cc1e60ea
JM
5409 gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
5410else
5411 gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
5412fi
5413cat > configargs.h <<EOF
5414/* Generated automatically. */
5415static const char configuration_arguments[] = "$gcc_config_arguments";
a6687d2b 5416static const char thread_model[] = "$thread_file";
7816bea0
DJ
5417
5418static const struct {
5419 const char *name, *value;
5420} configure_default_options[] = $configure_default_options;
cc1e60ea
JM
5421EOF
5422
ab87f8c8
JL
5423# Internationalization
5424PACKAGE=gcc
5425VERSION="$gcc_version"
861bb6c1 5426
ab87f8c8
JL
5427
5428
dc6746e7 5429# Enable NLS support by default
ab87f8c8
JL
5430# Check whether --enable-nls or --disable-nls was given.
5431if test "${enable_nls+set}" = set; then
5432 enableval="$enable_nls"
093e61a6 5433 :
861bb6c1 5434else
dc6746e7 5435 enable_nls=yes
093e61a6
RS
5436fi
5437
861bb6c1 5438
dc6746e7
PT
5439# if cross compiling, disable NLS support.
5440# It's not worth the trouble, at least for now.
5441
063a4b85 5442if test "${build}" != "${host}" && test "x$enable_nls" = "xyes"; then
093e61a6 5443 echo "configure: warning: Disabling NLS support for canadian cross compiler." 1>&2
dc6746e7
PT
5444 enable_nls=no
5445fi
5446
861bb6c1 5447
093e61a6
RS
5448
5449echo $ac_n "checking for library containing strerror""... $ac_c" 1>&6
619833ad 5450echo "configure:5451: checking for library containing strerror" >&5
093e61a6
RS
5451if eval "test \"`echo '$''{'ac_cv_search_strerror'+set}'`\" = set"; then
5452 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8 5453else
093e61a6
RS
5454 ac_func_search_save_LIBS="$LIBS"
5455ac_cv_search_strerror="no"
5456cat > conftest.$ac_ext <<EOF
619833ad 5457#line 5458 "configure"
093e61a6 5458#include "confdefs.h"
ab87f8c8
JL
5459/* Override any gcc2 internal prototype to avoid an error. */
5460/* We use char because int might match the return type of a gcc2
093e61a6
RS
5461 builtin and then its argument prototype would still apply. */
5462char strerror();
5463
5464int main() {
5465strerror()
5466; return 0; }
5467EOF
619833ad 5468if { (eval echo configure:5469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6 5469 rm -rf conftest*
71a94577 5470 ac_cv_search_strerror="none required"
ab87f8c8 5471else
093e61a6
RS
5472 echo "configure: failed program was:" >&5
5473 cat conftest.$ac_ext >&5
861bb6c1 5474fi
093e61a6
RS
5475rm -f conftest*
5476test "$ac_cv_search_strerror" = "no" && for i in cposix; do
5477LIBS="-l$i $ac_func_search_save_LIBS"
5478cat > conftest.$ac_ext <<EOF
619833ad 5479#line 5480 "configure"
093e61a6 5480#include "confdefs.h"
71a94577
ZW
5481/* Override any gcc2 internal prototype to avoid an error. */
5482/* We use char because int might match the return type of a gcc2
093e61a6
RS
5483 builtin and then its argument prototype would still apply. */
5484char strerror();
5485
5486int main() {
5487strerror()
5488; return 0; }
5489EOF
619833ad 5490if { (eval echo configure:5491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6
RS
5491 rm -rf conftest*
5492 ac_cv_search_strerror="-l$i"
71a94577 5493break
861bb6c1 5494else
093e61a6
RS
5495 echo "configure: failed program was:" >&5
5496 cat conftest.$ac_ext >&5
861bb6c1 5497fi
093e61a6
RS
5498rm -f conftest*
5499done
5500LIBS="$ac_func_search_save_LIBS"
cafe096b 5501fi
cafe096b 5502
093e61a6
RS
5503echo "$ac_t""$ac_cv_search_strerror" 1>&6
5504if test "$ac_cv_search_strerror" != "no"; then
5505 test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
5506
5507else :
5508
71a94577 5509fi
093e61a6 5510
2ce3c6c6 5511
093e61a6 5512echo $ac_n "checking for working const""... $ac_c" 1>&6
619833ad 5513echo "configure:5514: checking for working const" >&5
093e61a6
RS
5514if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
5515 echo $ac_n "(cached) $ac_c" 1>&6
861bb6c1 5516else
093e61a6 5517 cat > conftest.$ac_ext <<EOF
619833ad 5518#line 5519 "configure"
093e61a6 5519#include "confdefs.h"
ab87f8c8 5520
093e61a6
RS
5521int main() {
5522
5523/* Ultrix mips cc rejects this. */
5524typedef int charset[2]; const charset x;
5525/* SunOS 4.1.1 cc rejects this. */
5526char const *const *ccp;
5527char **p;
5528/* NEC SVR4.0.2 mips cc rejects this. */
5529struct point {int x, y;};
5530static struct point const zero = {0,0};
5531/* AIX XL C 1.02.0.0 rejects this.
5532 It does not let you subtract one const X* pointer from another in an arm
5533 of an if-expression whose if-part is not a constant expression */
5534const char *g = "string";
5535ccp = &g + (g ? g-g : 0);
5536/* HPUX 7.0 cc rejects these. */
5537++ccp;
5538p = (char**) ccp;
5539ccp = (char const *const *) p;
5540{ /* SCO 3.2v4 cc rejects this. */
5541 char *t;
5542 char const *s = 0 ? (char *) 0 : (char const *) 0;
5543
5544 *t++ = 0;
5545}
5546{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
5547 int x[] = {25, 17};
5548 const int *foo = &x[0];
5549 ++foo;
5550}
5551{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
5552 typedef const int *iptr;
5553 iptr p = 0;
5554 ++p;
cafe096b 5555}
093e61a6
RS
5556{ /* AIX XL C 1.02.0.0 rejects this saying
5557 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
5558 struct s { int j; const int *ap[3]; };
5559 struct s *b; b->j = 5;
5560}
5561{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
5562 const int foo = 10;
5563}
5564
5565; return 0; }
5566EOF
619833ad 5567if { (eval echo configure:5568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 5568 rm -rf conftest*
ab87f8c8 5569 ac_cv_c_const=yes
861bb6c1 5570else
093e61a6
RS
5571 echo "configure: failed program was:" >&5
5572 cat conftest.$ac_ext >&5
5573 rm -rf conftest*
5574 ac_cv_c_const=no
861bb6c1 5575fi
093e61a6 5576rm -f conftest*
861bb6c1
JL
5577fi
5578
093e61a6
RS
5579echo "$ac_t""$ac_cv_c_const" 1>&6
5580if test $ac_cv_c_const = no; then
5581 cat >> confdefs.h <<\EOF
5582#define const
5583EOF
ab87f8c8
JL
5584
5585fi
093e61a6
RS
5586
5587echo $ac_n "checking for off_t""... $ac_c" 1>&6
619833ad 5588echo "configure:5589: checking for off_t" >&5
093e61a6
RS
5589if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
5590 echo $ac_n "(cached) $ac_c" 1>&6
5591else
5592 cat > conftest.$ac_ext <<EOF
619833ad 5593#line 5594 "configure"
093e61a6
RS
5594#include "confdefs.h"
5595#include <sys/types.h>
5596#if STDC_HEADERS
5597#include <stdlib.h>
5598#include <stddef.h>
5599#endif
5600EOF
5601if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5602 egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
5603 rm -rf conftest*
5604 ac_cv_type_off_t=yes
cafe096b 5605else
093e61a6
RS
5606 rm -rf conftest*
5607 ac_cv_type_off_t=no
5608fi
5609rm -f conftest*
cafe096b 5610
093e61a6
RS
5611fi
5612echo "$ac_t""$ac_cv_type_off_t" 1>&6
5613if test $ac_cv_type_off_t = no; then
5614 cat >> confdefs.h <<\EOF
ab87f8c8 5615#define off_t long
093e61a6 5616EOF
ab87f8c8
JL
5617
5618fi
5619
093e61a6 5620echo $ac_n "checking for size_t""... $ac_c" 1>&6
619833ad 5621echo "configure:5622: checking for size_t" >&5
093e61a6
RS
5622if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
5623 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8 5624else
093e61a6 5625 cat > conftest.$ac_ext <<EOF
619833ad 5626#line 5627 "configure"
093e61a6
RS
5627#include "confdefs.h"
5628#include <sys/types.h>
5629#if STDC_HEADERS
5630#include <stdlib.h>
5631#include <stddef.h>
5632#endif
5633EOF
5634if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5635 egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
5636 rm -rf conftest*
cb65112a 5637 ac_cv_type_size_t=yes
ab87f8c8 5638else
093e61a6
RS
5639 rm -rf conftest*
5640 ac_cv_type_size_t=no
ab87f8c8 5641fi
093e61a6 5642rm -f conftest*
cafe096b 5643
093e61a6
RS
5644fi
5645echo "$ac_t""$ac_cv_type_size_t" 1>&6
5646if test $ac_cv_type_size_t = no; then
5647 cat >> confdefs.h <<\EOF
ab87f8c8 5648#define size_t unsigned
093e61a6 5649EOF
ab87f8c8
JL
5650
5651fi
5652
71a94577
ZW
5653# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
5654# for constant arguments. Useless!
093e61a6 5655echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
619833ad 5656echo "configure:5657: checking for working alloca.h" >&5
093e61a6
RS
5657if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
5658 echo $ac_n "(cached) $ac_c" 1>&6
5659else
5660 cat > conftest.$ac_ext <<EOF
619833ad 5661#line 5662 "configure"
093e61a6 5662#include "confdefs.h"
71a94577 5663#include <alloca.h>
093e61a6
RS
5664int main() {
5665char *p = alloca(2 * sizeof(int));
5666; return 0; }
5667EOF
619833ad 5668if { (eval echo configure:5669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6
RS
5669 rm -rf conftest*
5670 ac_cv_header_alloca_h=yes
5671else
5672 echo "configure: failed program was:" >&5
5673 cat conftest.$ac_ext >&5
5674 rm -rf conftest*
5675 ac_cv_header_alloca_h=no
5676fi
5677rm -f conftest*
5678fi
5679
5680echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
5681if test $ac_cv_header_alloca_h = yes; then
5682 cat >> confdefs.h <<\EOF
71a94577 5683#define HAVE_ALLOCA_H 1
093e61a6 5684EOF
71a94577 5685
ab87f8c8 5686fi
ab87f8c8 5687
093e61a6 5688echo $ac_n "checking for alloca""... $ac_c" 1>&6
619833ad 5689echo "configure:5690: checking for alloca" >&5
093e61a6
RS
5690if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
5691 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8 5692else
093e61a6 5693 cat > conftest.$ac_ext <<EOF
619833ad 5694#line 5695 "configure"
093e61a6
RS
5695#include "confdefs.h"
5696
71a94577
ZW
5697#ifdef __GNUC__
5698# define alloca __builtin_alloca
ab87f8c8 5699#else
71a94577
ZW
5700# ifdef _MSC_VER
5701# include <malloc.h>
5702# define alloca _alloca
5703# else
5704# if HAVE_ALLOCA_H
5705# include <alloca.h>
5706# else
5707# ifdef _AIX
5708 #pragma alloca
5709# else
5710# ifndef alloca /* predefined by HP cc +Olibcalls */
5711char *alloca ();
5712# endif
5713# endif
5714# endif
5715# endif
ab87f8c8
JL
5716#endif
5717
093e61a6
RS
5718int main() {
5719char *p = (char *) alloca(1);
5720; return 0; }
5721EOF
619833ad 5722if { (eval echo configure:5723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6 5723 rm -rf conftest*
71a94577 5724 ac_cv_func_alloca_works=yes
ab87f8c8 5725else
093e61a6
RS
5726 echo "configure: failed program was:" >&5
5727 cat conftest.$ac_ext >&5
5728 rm -rf conftest*
5729 ac_cv_func_alloca_works=no
ab87f8c8 5730fi
093e61a6 5731rm -f conftest*
ab87f8c8
JL
5732fi
5733
093e61a6 5734echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
71a94577 5735if test $ac_cv_func_alloca_works = yes; then
093e61a6 5736 cat >> confdefs.h <<\EOF
cafe096b 5737#define HAVE_ALLOCA 1
093e61a6 5738EOF
cafe096b 5739
093e61a6 5740fi
cafe096b 5741
093e61a6
RS
5742if test $ac_cv_func_alloca_works = no; then
5743 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
5744 # that cause trouble. Some versions do not even contain alloca or
5745 # contain a buggy version. If you still want to use their alloca,
5746 # use ar to extract alloca.o from them instead of compiling alloca.c.
5747 ALLOCA=alloca.${ac_objext}
5748 cat >> confdefs.h <<\EOF
71a94577 5749#define C_ALLOCA 1
093e61a6 5750EOF
71a94577
ZW
5751
5752
093e61a6 5753echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
619833ad 5754echo "configure:5755: checking whether alloca needs Cray hooks" >&5
093e61a6
RS
5755if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
5756 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8 5757else
093e61a6 5758 cat > conftest.$ac_ext <<EOF
619833ad 5759#line 5760 "configure"
093e61a6 5760#include "confdefs.h"
71a94577
ZW
5761#if defined(CRAY) && ! defined(CRAY2)
5762webecray
5763#else
5764wenotbecray
5765#endif
5766
093e61a6 5767EOF
71a94577 5768if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
093e61a6
RS
5769 egrep "webecray" >/dev/null 2>&1; then
5770 rm -rf conftest*
71a94577
ZW
5771 ac_cv_os_cray=yes
5772else
093e61a6 5773 rm -rf conftest*
71a94577 5774 ac_cv_os_cray=no
ab87f8c8 5775fi
71a94577 5776rm -f conftest*
ab87f8c8 5777
71a94577 5778fi
093e61a6
RS
5779
5780echo "$ac_t""$ac_cv_os_cray" 1>&6
71a94577 5781if test $ac_cv_os_cray = yes; then
093e61a6
RS
5782for ac_func in _getb67 GETB67 getb67; do
5783 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
619833ad 5784echo "configure:5785: checking for $ac_func" >&5
093e61a6
RS
5785if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5786 echo $ac_n "(cached) $ac_c" 1>&6
5787else
5788 cat > conftest.$ac_ext <<EOF
619833ad 5789#line 5790 "configure"
093e61a6 5790#include "confdefs.h"
ab87f8c8 5791/* System header to define __stub macros and hopefully few prototypes,
093e61a6
RS
5792 which can conflict with char $ac_func(); below. */
5793#include <assert.h>
ab87f8c8
JL
5794/* Override any gcc2 internal prototype to avoid an error. */
5795/* We use char because int might match the return type of a gcc2
093e61a6
RS
5796 builtin and then its argument prototype would still apply. */
5797char $ac_func();
5798
5799int main() {
5800
ab87f8c8
JL
5801/* The GNU C library defines this for functions which it implements
5802 to always fail with ENOSYS. Some functions are actually named
5803 something starting with __ and the normal name is an alias. */
5804#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5805choke me
5806#else
093e61a6 5807$ac_func();
ab87f8c8
JL
5808#endif
5809
093e61a6
RS
5810; return 0; }
5811EOF
619833ad 5812if { (eval echo configure:5813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6
RS
5813 rm -rf conftest*
5814 eval "ac_cv_func_$ac_func=yes"
5815else
5816 echo "configure: failed program was:" >&5
5817 cat conftest.$ac_ext >&5
5818 rm -rf conftest*
5819 eval "ac_cv_func_$ac_func=no"
5820fi
5821rm -f conftest*
5822fi
5823
5824if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5825 echo "$ac_t""yes" 1>&6
5826 cat >> confdefs.h <<EOF
71a94577 5827#define CRAY_STACKSEG_END $ac_func
093e61a6 5828EOF
71a94577 5829
093e61a6
RS
5830 break
5831else
5832 echo "$ac_t""no" 1>&6
ab87f8c8 5833fi
ab87f8c8 5834
093e61a6 5835done
71a94577 5836fi
ab87f8c8 5837
093e61a6 5838echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
619833ad 5839echo "configure:5840: checking stack direction for C alloca" >&5
093e61a6
RS
5840if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
5841 echo $ac_n "(cached) $ac_c" 1>&6
71a94577
ZW
5842else
5843 if test "$cross_compiling" = yes; then
5844 ac_cv_c_stack_direction=0
ab87f8c8 5845else
093e61a6 5846 cat > conftest.$ac_ext <<EOF
619833ad 5847#line 5848 "configure"
093e61a6 5848#include "confdefs.h"
71a94577
ZW
5849find_stack_direction ()
5850{
5851 static char *addr = 0;
5852 auto char dummy;
5853 if (addr == 0)
5854 {
5855 addr = &dummy;
5856 return find_stack_direction ();
5857 }
5858 else
5859 return (&dummy > addr) ? 1 : -1;
5860}
5861main ()
5862{
093e61a6 5863 exit (find_stack_direction() < 0);
71a94577 5864}
093e61a6 5865EOF
619833ad 5866if { (eval echo configure:5867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
093e61a6 5867then
71a94577 5868 ac_cv_c_stack_direction=1
ab87f8c8 5869else
093e61a6
RS
5870 echo "configure: failed program was:" >&5
5871 cat conftest.$ac_ext >&5
5872 rm -fr conftest*
5873 ac_cv_c_stack_direction=-1
ab87f8c8 5874fi
093e61a6 5875rm -fr conftest*
ab87f8c8 5876fi
093e61a6 5877
71a94577
ZW
5878fi
5879
093e61a6
RS
5880echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
5881cat >> confdefs.h <<EOF
71a94577 5882#define STACK_DIRECTION $ac_cv_c_stack_direction
093e61a6 5883EOF
ab87f8c8 5884
ab87f8c8
JL
5885fi
5886
ab87f8c8 5887
093e61a6 5888 echo $ac_n "checking whether we are using the GNU C Library 2.1 or newer""... $ac_c" 1>&6
619833ad 5889echo "configure:5890: checking whether we are using the GNU C Library 2.1 or newer" >&5
093e61a6
RS
5890if eval "test \"`echo '$''{'ac_cv_gnu_library_2_1'+set}'`\" = set"; then
5891 echo $ac_n "(cached) $ac_c" 1>&6
71a94577 5892else
093e61a6 5893 cat > conftest.$ac_ext <<EOF
619833ad 5894#line 5895 "configure"
093e61a6 5895#include "confdefs.h"
ab87f8c8 5896
71a94577
ZW
5897#include <features.h>
5898#ifdef __GNU_LIBRARY__
5899 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
5900 Lucky GNU user
5901 #endif
5902#endif
093e61a6
RS
5903
5904EOF
71a94577 5905if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
093e61a6
RS
5906 egrep "Lucky GNU user" >/dev/null 2>&1; then
5907 rm -rf conftest*
71a94577 5908 ac_cv_gnu_library_2_1=yes
ab87f8c8 5909else
093e61a6 5910 rm -rf conftest*
71a94577 5911 ac_cv_gnu_library_2_1=no
ab87f8c8 5912fi
71a94577 5913rm -f conftest*
ab87f8c8 5914
093e61a6
RS
5915
5916
71a94577 5917fi
ab87f8c8 5918
093e61a6
RS
5919echo "$ac_t""$ac_cv_gnu_library_2_1" 1>&6
5920
71a94577 5921 GLIBC21="$ac_cv_gnu_library_2_1"
093e61a6 5922
ab87f8c8 5923
093e61a6
RS
5924
5925 for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
71a94577
ZW
5926stdlib.h string.h unistd.h sys/param.h
5927do
093e61a6
RS
5928ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5929echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
619833ad 5930echo "configure:5931: checking for $ac_hdr" >&5
093e61a6
RS
5931if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5932 echo $ac_n "(cached) $ac_c" 1>&6
5933else
5934 cat > conftest.$ac_ext <<EOF
619833ad 5935#line 5936 "configure"
093e61a6
RS
5936#include "confdefs.h"
5937#include <$ac_hdr>
5938EOF
5939ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
619833ad 5940{ (eval echo configure:5941: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
093e61a6
RS
5941ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5942if test -z "$ac_err"; then
5943 rm -rf conftest*
5944 eval "ac_cv_header_$ac_safe=yes"
5945else
5946 echo "$ac_err" >&5
5947 echo "configure: failed program was:" >&5
5948 cat conftest.$ac_ext >&5
5949 rm -rf conftest*
5950 eval "ac_cv_header_$ac_safe=no"
ab87f8c8 5951fi
093e61a6 5952rm -f conftest*
ab87f8c8 5953fi
093e61a6
RS
5954if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5955 echo "$ac_t""yes" 1>&6
5956 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5957 cat >> confdefs.h <<EOF
5958#define $ac_tr_hdr 1
5959EOF
5960
5961else
5962 echo "$ac_t""no" 1>&6
ab87f8c8 5963fi
71a94577 5964done
ab87f8c8 5965
093e61a6 5966 for ac_func in feof_unlocked fgets_unlocked getcwd getegid geteuid \
71a94577
ZW
5967getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
5968strdup strtoul tsearch __argz_count __argz_stringify __argz_next
5969do
093e61a6 5970echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
619833ad 5971echo "configure:5972: checking for $ac_func" >&5
093e61a6
RS
5972if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5973 echo $ac_n "(cached) $ac_c" 1>&6
5974else
5975 cat > conftest.$ac_ext <<EOF
619833ad 5976#line 5977 "configure"
093e61a6 5977#include "confdefs.h"
71a94577 5978/* System header to define __stub macros and hopefully few prototypes,
093e61a6
RS
5979 which can conflict with char $ac_func(); below. */
5980#include <assert.h>
ab87f8c8
JL
5981/* Override any gcc2 internal prototype to avoid an error. */
5982/* We use char because int might match the return type of a gcc2
093e61a6
RS
5983 builtin and then its argument prototype would still apply. */
5984char $ac_func();
5985
5986int main() {
5987
71a94577
ZW
5988/* The GNU C library defines this for functions which it implements
5989 to always fail with ENOSYS. Some functions are actually named
5990 something starting with __ and the normal name is an alias. */
5991#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5992choke me
5993#else
093e61a6 5994$ac_func();
71a94577
ZW
5995#endif
5996
093e61a6
RS
5997; return 0; }
5998EOF
619833ad 5999if { (eval echo configure:6000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6
RS
6000 rm -rf conftest*
6001 eval "ac_cv_func_$ac_func=yes"
6002else
6003 echo "configure: failed program was:" >&5
6004 cat conftest.$ac_ext >&5
6005 rm -rf conftest*
6006 eval "ac_cv_func_$ac_func=no"
6007fi
6008rm -f conftest*
6009fi
71a94577 6010
093e61a6
RS
6011if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6012 echo "$ac_t""yes" 1>&6
6013 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6014 cat >> confdefs.h <<EOF
6015#define $ac_tr_func 1
6016EOF
6017
6018else
6019 echo "$ac_t""no" 1>&6
71a94577
ZW
6020fi
6021done
6022
6023
093e61a6
RS
6024
6025
b7f2fb96 6026 am_cv_lib_iconv_ldpath=
093e61a6 6027 # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
71a94577
ZW
6028if test "${with_libiconv_prefix+set}" = set; then
6029 withval="$with_libiconv_prefix"
093e61a6 6030
71a94577
ZW
6031 for dir in `echo "$withval" | tr : ' '`; do
6032 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
b7f2fb96 6033 if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
71a94577 6034 done
093e61a6
RS
6035
6036fi
ab87f8c8 6037
71a94577 6038
093e61a6 6039 echo $ac_n "checking for iconv""... $ac_c" 1>&6
619833ad 6040echo "configure:6041: checking for iconv" >&5
093e61a6
RS
6041if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
6042 echo $ac_n "(cached) $ac_c" 1>&6
71a94577 6043else
093e61a6 6044
71a94577
ZW
6045 am_cv_func_iconv="no, consider installing GNU libiconv"
6046 am_cv_lib_iconv=no
093e61a6 6047 cat > conftest.$ac_ext <<EOF
619833ad 6048#line 6049 "configure"
093e61a6 6049#include "confdefs.h"
71a94577
ZW
6050#include <stdlib.h>
6051#include <iconv.h>
093e61a6 6052int main() {
71a94577
ZW
6053iconv_t cd = iconv_open("","");
6054 iconv(cd,NULL,NULL,NULL,NULL);
6055 iconv_close(cd);
093e61a6
RS
6056; return 0; }
6057EOF
619833ad 6058if { (eval echo configure:6059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6 6059 rm -rf conftest*
71a94577 6060 am_cv_func_iconv=yes
ab87f8c8 6061else
093e61a6
RS
6062 echo "configure: failed program was:" >&5
6063 cat conftest.$ac_ext >&5
ab87f8c8 6064fi
093e61a6 6065rm -f conftest*
71a94577
ZW
6066 if test "$am_cv_func_iconv" != yes; then
6067 am_save_LIBS="$LIBS"
b7f2fb96 6068 LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
093e61a6 6069 cat > conftest.$ac_ext <<EOF
619833ad 6070#line 6071 "configure"
093e61a6 6071#include "confdefs.h"
71a94577
ZW
6072#include <stdlib.h>
6073#include <iconv.h>
093e61a6 6074int main() {
71a94577
ZW
6075iconv_t cd = iconv_open("","");
6076 iconv(cd,NULL,NULL,NULL,NULL);
6077 iconv_close(cd);
093e61a6
RS
6078; return 0; }
6079EOF
619833ad 6080if { (eval echo configure:6081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6 6081 rm -rf conftest*
71a94577
ZW
6082 am_cv_lib_iconv=yes
6083 am_cv_func_iconv=yes
ab87f8c8 6084else
093e61a6
RS
6085 echo "configure: failed program was:" >&5
6086 cat conftest.$ac_ext >&5
ab87f8c8 6087fi
093e61a6 6088rm -f conftest*
71a94577
ZW
6089 LIBS="$am_save_LIBS"
6090 fi
093e61a6 6091
cafe096b 6092fi
cafe096b 6093
093e61a6
RS
6094echo "$ac_t""$am_cv_func_iconv" 1>&6
6095 if test "$am_cv_func_iconv" = yes; then
6096 cat >> confdefs.h <<\EOF
71a94577 6097#define HAVE_ICONV 1
093e61a6 6098EOF
71a94577 6099
093e61a6 6100 echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
619833ad 6101echo "configure:6102: checking for iconv declaration" >&5
093e61a6
RS
6102 if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
6103 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8 6104else
093e61a6
RS
6105
6106 cat > conftest.$ac_ext <<EOF
619833ad 6107#line 6108 "configure"
093e61a6 6108#include "confdefs.h"
ab87f8c8 6109
71a94577
ZW
6110#include <stdlib.h>
6111#include <iconv.h>
6112extern
6113#ifdef __cplusplus
6114"C"
6115#endif
6116#if defined(__STDC__) || defined(__cplusplus)
6117size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
6118#else
6119size_t iconv();
6120#endif
ab87f8c8 6121
093e61a6 6122int main() {
380a627a 6123
093e61a6
RS
6124; return 0; }
6125EOF
619833ad 6126if { (eval echo configure:6127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
093e61a6 6127 rm -rf conftest*
71a94577 6128 am_cv_proto_iconv_arg1=""
ab87f8c8 6129else
093e61a6
RS
6130 echo "configure: failed program was:" >&5
6131 cat conftest.$ac_ext >&5
6132 rm -rf conftest*
6133 am_cv_proto_iconv_arg1="const"
ab87f8c8 6134fi
093e61a6 6135rm -f conftest*
71a94577 6136 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
ab87f8c8 6137fi
71a94577
ZW
6138
6139 am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
093e61a6
RS
6140 echo "$ac_t""${ac_t:-
6141 }$am_cv_proto_iconv" 1>&6
6142 cat >> confdefs.h <<EOF
71a94577 6143#define ICONV_CONST $am_cv_proto_iconv_arg1
093e61a6 6144EOF
71a94577
ZW
6145
6146 fi
6147 LIBICONV=
6148 if test "$am_cv_lib_iconv" = yes; then
b7f2fb96 6149 LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
71a94577 6150 fi
093e61a6 6151
71a94577 6152
093e61a6
RS
6153
6154 echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
619833ad 6155echo "configure:6156: checking for nl_langinfo and CODESET" >&5
093e61a6
RS
6156if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then
6157 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8 6158else
093e61a6 6159 cat > conftest.$ac_ext <<EOF
619833ad 6160#line 6161 "configure"
093e61a6 6161#include "confdefs.h"
71a94577 6162#include <langinfo.h>
093e61a6 6163int main() {
71a94577 6164char* cs = nl_langinfo(CODESET);
093e61a6
RS
6165; return 0; }
6166EOF
619833ad 6167if { (eval echo configure:6168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6 6168 rm -rf conftest*
71a94577 6169 am_cv_langinfo_codeset=yes
ab87f8c8 6170else
093e61a6
RS
6171 echo "configure: failed program was:" >&5
6172 cat conftest.$ac_ext >&5
6173 rm -rf conftest*
6174 am_cv_langinfo_codeset=no
ab87f8c8 6175fi
093e61a6
RS
6176rm -f conftest*
6177
cafe096b 6178fi
cafe096b 6179
093e61a6
RS
6180echo "$ac_t""$am_cv_langinfo_codeset" 1>&6
6181 if test $am_cv_langinfo_codeset = yes; then
6182 cat >> confdefs.h <<\EOF
71a94577 6183#define HAVE_LANGINFO_CODESET 1
093e61a6 6184EOF
ab87f8c8 6185
71a94577
ZW
6186 fi
6187
6188 if test $ac_cv_header_locale_h = yes; then
093e61a6 6189 echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
619833ad 6190echo "configure:6191: checking for LC_MESSAGES" >&5
093e61a6
RS
6191if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
6192 echo $ac_n "(cached) $ac_c" 1>&6
6193else
6194 cat > conftest.$ac_ext <<EOF
619833ad 6195#line 6196 "configure"
093e61a6 6196#include "confdefs.h"
71a94577 6197#include <locale.h>
093e61a6 6198int main() {
71a94577 6199return LC_MESSAGES
093e61a6
RS
6200; return 0; }
6201EOF
619833ad 6202if { (eval echo configure:6203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6 6203 rm -rf conftest*
71a94577
ZW
6204 am_cv_val_LC_MESSAGES=yes
6205else
093e61a6
RS
6206 echo "configure: failed program was:" >&5
6207 cat conftest.$ac_ext >&5
6208 rm -rf conftest*
6209 am_cv_val_LC_MESSAGES=no
71a94577 6210fi
093e61a6 6211rm -f conftest*
71a94577 6212fi
cafe096b 6213
093e61a6
RS
6214echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
6215 if test $am_cv_val_LC_MESSAGES = yes; then
6216 cat >> confdefs.h <<\EOF
71a94577 6217#define HAVE_LC_MESSAGES 1
093e61a6 6218EOF
71a94577 6219
ab87f8c8 6220 fi
71a94577 6221 fi
093e61a6 6222 echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
619833ad 6223echo "configure:6224: checking whether NLS is requested" >&5
71a94577
ZW
6224 # Check whether --enable-nls or --disable-nls was given.
6225if test "${enable_nls+set}" = set; then
6226 enableval="$enable_nls"
6227 USE_NLS=$enableval
6228else
6229 USE_NLS=yes
093e61a6 6230fi
71a94577 6231
093e61a6
RS
6232 echo "$ac_t""$USE_NLS" 1>&6
6233
71a94577
ZW
6234
6235 BUILD_INCLUDED_LIBINTL=no
6236 USE_INCLUDED_LIBINTL=no
6237 INTLLIBS=
77c06844 6238 INTLDEPS=
71a94577
ZW
6239
6240 if test "$USE_NLS" = "yes"; then
093e61a6 6241 cat >> confdefs.h <<\EOF
71a94577 6242#define ENABLE_NLS 1
093e61a6 6243EOF
71a94577 6244
093e61a6 6245 echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
619833ad 6246echo "configure:6247: checking whether included gettext is requested" >&5
093e61a6 6247 # Check whether --with-included-gettext or --without-included-gettext was given.
71a94577
ZW
6248if test "${with_included_gettext+set}" = set; then
6249 withval="$with_included_gettext"
6250 nls_cv_force_use_gnu_gettext=$withval
ab87f8c8 6251else
71a94577 6252 nls_cv_force_use_gnu_gettext=no
093e61a6
RS
6253fi
6254
6255 echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
71a94577
ZW
6256
6257 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
6258 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
6259 CATOBJEXT=NONE
6260
093e61a6
RS
6261
6262
71a94577 6263
093e61a6
RS
6264 ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
6265echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
619833ad 6266echo "configure:6267: checking for libintl.h" >&5
093e61a6
RS
6267if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6268 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8 6269else
093e61a6 6270 cat > conftest.$ac_ext <<EOF
619833ad 6271#line 6272 "configure"
093e61a6 6272#include "confdefs.h"
cafe096b 6273#include <libintl.h>
093e61a6
RS
6274EOF
6275ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
619833ad 6276{ (eval echo configure:6277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
093e61a6
RS
6277ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6278if test -z "$ac_err"; then
6279 rm -rf conftest*
6280 eval "ac_cv_header_$ac_safe=yes"
6281else
6282 echo "$ac_err" >&5
6283 echo "configure: failed program was:" >&5
6284 cat conftest.$ac_ext >&5
6285 rm -rf conftest*
6286 eval "ac_cv_header_$ac_safe=no"
ab87f8c8 6287fi
093e61a6 6288rm -f conftest*
71a94577 6289fi
093e61a6
RS
6290if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6291 echo "$ac_t""yes" 1>&6
6292 cat >> confdefs.h <<\EOF
cafe096b 6293#define HAVE_LIBINTL_H 1
093e61a6
RS
6294EOF
6295
6296 echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6
619833ad 6297echo "configure:6298: checking for GNU gettext in libc" >&5
093e61a6
RS
6298if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libc'+set}'`\" = set"; then
6299 echo $ac_n "(cached) $ac_c" 1>&6
6300else
6301 cat > conftest.$ac_ext <<EOF
619833ad 6302#line 6303 "configure"
093e61a6 6303#include "confdefs.h"
71a94577 6304#include <libintl.h>
ab87f8c8 6305extern int _nl_msg_cat_cntr;
093e61a6 6306int main() {
71a94577
ZW
6307bindtextdomain ("", "");
6308return (int) gettext ("") + _nl_msg_cat_cntr
093e61a6
RS
6309; return 0; }
6310EOF
619833ad 6311if { (eval echo configure:6312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6 6312 rm -rf conftest*
71a94577 6313 gt_cv_func_gnugettext1_libc=yes
ab87f8c8 6314else
093e61a6
RS
6315 echo "configure: failed program was:" >&5
6316 cat conftest.$ac_ext >&5
6317 rm -rf conftest*
6318 gt_cv_func_gnugettext1_libc=no
ab87f8c8 6319fi
093e61a6 6320rm -f conftest*
ab87f8c8 6321fi
093e61a6
RS
6322
6323echo "$ac_t""$gt_cv_func_gnugettext1_libc" 1>&6
ab87f8c8 6324
71a94577 6325 if test "$gt_cv_func_gnugettext1_libc" != "yes"; then
093e61a6 6326 echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6
619833ad 6327echo "configure:6328: checking for GNU gettext in libintl" >&5
093e61a6
RS
6328if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libintl'+set}'`\" = set"; then
6329 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8 6330else
71a94577
ZW
6331 gt_save_LIBS="$LIBS"
6332 LIBS="$LIBS -lintl $LIBICONV"
093e61a6 6333 cat > conftest.$ac_ext <<EOF
619833ad 6334#line 6335 "configure"
093e61a6 6335#include "confdefs.h"
71a94577
ZW
6336#include <libintl.h>
6337extern int _nl_msg_cat_cntr;
093e61a6 6338int main() {
71a94577
ZW
6339bindtextdomain ("", "");
6340return (int) gettext ("") + _nl_msg_cat_cntr
093e61a6
RS
6341; return 0; }
6342EOF
619833ad 6343if { (eval echo configure:6344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6 6344 rm -rf conftest*
71a94577 6345 gt_cv_func_gnugettext1_libintl=yes
ab87f8c8 6346else
093e61a6
RS
6347 echo "configure: failed program was:" >&5
6348 cat conftest.$ac_ext >&5
6349 rm -rf conftest*
6350 gt_cv_func_gnugettext1_libintl=no
ab87f8c8 6351fi
093e61a6 6352rm -f conftest*
71a94577 6353 LIBS="$gt_save_LIBS"
ab87f8c8 6354fi
093e61a6
RS
6355
6356echo "$ac_t""$gt_cv_func_gnugettext1_libintl" 1>&6
71a94577
ZW
6357 fi
6358
6359 if test "$gt_cv_func_gnugettext1_libc" = "yes" \
6360 || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \
6361 && test "$PACKAGE" != gettext; }; then
093e61a6 6362 cat >> confdefs.h <<\EOF
71a94577 6363#define HAVE_GETTEXT 1
093e61a6 6364EOF
ab87f8c8 6365
ab87f8c8 6366
71a94577
ZW
6367 if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then
6368 INTLLIBS="-lintl $LIBICONV"
6369 fi
ab87f8c8 6370
71a94577
ZW
6371 gt_save_LIBS="$LIBS"
6372 LIBS="$LIBS $INTLLIBS"
093e61a6 6373 for ac_func in dcgettext
71a94577 6374do
093e61a6 6375echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
619833ad 6376echo "configure:6377: checking for $ac_func" >&5
093e61a6
RS
6377if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6378 echo $ac_n "(cached) $ac_c" 1>&6
6379else
6380 cat > conftest.$ac_ext <<EOF
619833ad 6381#line 6382 "configure"
093e61a6 6382#include "confdefs.h"
ab87f8c8 6383/* System header to define __stub macros and hopefully few prototypes,
093e61a6
RS
6384 which can conflict with char $ac_func(); below. */
6385#include <assert.h>
ab87f8c8
JL
6386/* Override any gcc2 internal prototype to avoid an error. */
6387/* We use char because int might match the return type of a gcc2
093e61a6
RS
6388 builtin and then its argument prototype would still apply. */
6389char $ac_func();
6390
6391int main() {
6392
ab87f8c8
JL
6393/* The GNU C library defines this for functions which it implements
6394 to always fail with ENOSYS. Some functions are actually named
6395 something starting with __ and the normal name is an alias. */
71a94577 6396#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
ab87f8c8
JL
6397choke me
6398#else
093e61a6 6399$ac_func();
ab87f8c8
JL
6400#endif
6401
093e61a6
RS
6402; return 0; }
6403EOF
619833ad 6404if { (eval echo configure:6405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6
RS
6405 rm -rf conftest*
6406 eval "ac_cv_func_$ac_func=yes"
6407else
6408 echo "configure: failed program was:" >&5
6409 cat conftest.$ac_ext >&5
6410 rm -rf conftest*
6411 eval "ac_cv_func_$ac_func=no"
6412fi
6413rm -f conftest*
6414fi
ab87f8c8 6415
093e61a6
RS
6416if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6417 echo "$ac_t""yes" 1>&6
6418 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6419 cat >> confdefs.h <<EOF
6420#define $ac_tr_func 1
6421EOF
6422
6423else
6424 echo "$ac_t""no" 1>&6
71a94577
ZW
6425fi
6426done
ab87f8c8 6427
71a94577
ZW
6428 LIBS="$gt_save_LIBS"
6429
6430 # Extract the first word of "msgfmt", so it can be a program name with args.
6431set dummy msgfmt; ac_word=$2
093e61a6 6432echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
619833ad 6433echo "configure:6434: checking for $ac_word" >&5
093e61a6
RS
6434if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
6435 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8 6436else
71a94577 6437 case "$MSGFMT" in
ab87f8c8 6438 /*)
71a94577 6439 ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
ab87f8c8
JL
6440 ;;
6441 *)
71a94577
ZW
6442 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
6443 for ac_dir in $PATH; do
ab87f8c8
JL
6444 test -z "$ac_dir" && ac_dir=.
6445 if test -f $ac_dir/$ac_word; then
71a94577
ZW
6446 if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then
6447 ac_cv_path_MSGFMT="$ac_dir/$ac_word"
6448 break
6449 fi
ab87f8c8
JL
6450 fi
6451 done
6452 IFS="$ac_save_ifs"
71a94577 6453 test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
ab87f8c8
JL
6454 ;;
6455esac
6456fi
71a94577
ZW
6457MSGFMT="$ac_cv_path_MSGFMT"
6458if test "$MSGFMT" != ":"; then
093e61a6 6459 echo "$ac_t""$MSGFMT" 1>&6
ab87f8c8 6460else
093e61a6 6461 echo "$ac_t""no" 1>&6
ab87f8c8 6462fi
71a94577
ZW
6463
6464 # Extract the first word of "gmsgfmt", so it can be a program name with args.
ab87f8c8 6465set dummy gmsgfmt; ac_word=$2
093e61a6 6466echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
619833ad 6467echo "configure:6468: checking for $ac_word" >&5
093e61a6
RS
6468if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
6469 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8 6470else
093e61a6
RS
6471 case "$GMSGFMT" in
6472 /*)
71a94577 6473 ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
ab87f8c8 6474 ;;
093e61a6
RS
6475 ?:/*)
6476 ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
6477 ;;
ab87f8c8 6478 *)
093e61a6
RS
6479 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
6480 ac_dummy="$PATH"
6481 for ac_dir in $ac_dummy; do
6482 test -z "$ac_dir" && ac_dir=.
6483 if test -f $ac_dir/$ac_word; then
6484 ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
6485 break
6486 fi
6487 done
6488 IFS="$ac_save_ifs"
71a94577 6489 test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
ab87f8c8
JL
6490 ;;
6491esac
6492fi
093e61a6 6493GMSGFMT="$ac_cv_path_GMSGFMT"
ab87f8c8 6494if test -n "$GMSGFMT"; then
093e61a6 6495 echo "$ac_t""$GMSGFMT" 1>&6
ab87f8c8 6496else
093e61a6 6497 echo "$ac_t""no" 1>&6
ab87f8c8
JL
6498fi
6499
ab87f8c8 6500
71a94577 6501 # Extract the first word of "xgettext", so it can be a program name with args.
ab87f8c8 6502set dummy xgettext; ac_word=$2
093e61a6 6503echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
619833ad 6504echo "configure:6505: checking for $ac_word" >&5
093e61a6
RS
6505if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
6506 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8
JL
6507else
6508 case "$XGETTEXT" in
6509 /*)
71a94577 6510 ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
ab87f8c8
JL
6511 ;;
6512 *)
6513 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
6514 for ac_dir in $PATH; do
6515 test -z "$ac_dir" && ac_dir=.
6516 if test -f $ac_dir/$ac_word; then
71a94577
ZW
6517 if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then
6518 ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
ab87f8c8
JL
6519 break
6520 fi
6521 fi
6522 done
6523 IFS="$ac_save_ifs"
71a94577 6524 test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
ab87f8c8
JL
6525 ;;
6526esac
6527fi
71a94577
ZW
6528XGETTEXT="$ac_cv_path_XGETTEXT"
6529if test "$XGETTEXT" != ":"; then
093e61a6 6530 echo "$ac_t""$XGETTEXT" 1>&6
ab87f8c8 6531else
093e61a6 6532 echo "$ac_t""no" 1>&6
ab87f8c8
JL
6533fi
6534
71a94577
ZW
6535
6536 CATOBJEXT=.gmo
6537 fi
093e61a6
RS
6538
6539else
6540 echo "$ac_t""no" 1>&6
ab87f8c8
JL
6541fi
6542
ab87f8c8
JL
6543
6544 if test "$CATOBJEXT" = "NONE"; then
6545 nls_cv_use_gnu_gettext=yes
6546 fi
6547 fi
6548
6549 if test "$nls_cv_use_gnu_gettext" = "yes"; then
6550 INTLOBJS="\$(GETTOBJS)"
6551 # Extract the first word of "msgfmt", so it can be a program name with args.
6552set dummy msgfmt; ac_word=$2
093e61a6 6553echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
619833ad 6554echo "configure:6555: checking for $ac_word" >&5
093e61a6
RS
6555if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
6556 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8
JL
6557else
6558 case "$MSGFMT" in
6559 /*)
71a94577 6560 ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
ab87f8c8
JL
6561 ;;
6562 *)
6563 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
6564 for ac_dir in $PATH; do
6565 test -z "$ac_dir" && ac_dir=.
6566 if test -f $ac_dir/$ac_word; then
71a94577
ZW
6567 if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then
6568 ac_cv_path_MSGFMT="$ac_dir/$ac_word"
ab87f8c8
JL
6569 break
6570 fi
6571 fi
6572 done
6573 IFS="$ac_save_ifs"
71a94577 6574 test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
ab87f8c8
JL
6575 ;;
6576esac
6577fi
71a94577
ZW
6578MSGFMT="$ac_cv_path_MSGFMT"
6579if test "$MSGFMT" != ":"; then
093e61a6 6580 echo "$ac_t""$MSGFMT" 1>&6
ab87f8c8 6581else
093e61a6 6582 echo "$ac_t""no" 1>&6
ab87f8c8
JL
6583fi
6584
6585 # Extract the first word of "gmsgfmt", so it can be a program name with args.
6586set dummy gmsgfmt; ac_word=$2
093e61a6 6587echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
619833ad 6588echo "configure:6589: checking for $ac_word" >&5
093e61a6
RS
6589if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
6590 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8 6591else
093e61a6
RS
6592 case "$GMSGFMT" in
6593 /*)
71a94577 6594 ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
ab87f8c8 6595 ;;
093e61a6
RS
6596 ?:/*)
6597 ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
6598 ;;
ab87f8c8 6599 *)
093e61a6
RS
6600 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
6601 ac_dummy="$PATH"
6602 for ac_dir in $ac_dummy; do
6603 test -z "$ac_dir" && ac_dir=.
6604 if test -f $ac_dir/$ac_word; then
6605 ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
6606 break
6607 fi
6608 done
6609 IFS="$ac_save_ifs"
71a94577 6610 test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
ab87f8c8
JL
6611 ;;
6612esac
6613fi
093e61a6 6614GMSGFMT="$ac_cv_path_GMSGFMT"
ab87f8c8 6615if test -n "$GMSGFMT"; then
093e61a6 6616 echo "$ac_t""$GMSGFMT" 1>&6
ab87f8c8 6617else
093e61a6 6618 echo "$ac_t""no" 1>&6
ab87f8c8
JL
6619fi
6620
6621 # Extract the first word of "xgettext", so it can be a program name with args.
6622set dummy xgettext; ac_word=$2
093e61a6 6623echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
619833ad 6624echo "configure:6625: checking for $ac_word" >&5
093e61a6
RS
6625if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
6626 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8
JL
6627else
6628 case "$XGETTEXT" in
6629 /*)
71a94577 6630 ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
ab87f8c8
JL
6631 ;;
6632 *)
6633 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
6634 for ac_dir in $PATH; do
6635 test -z "$ac_dir" && ac_dir=.
6636 if test -f $ac_dir/$ac_word; then
71a94577
ZW
6637 if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then
6638 ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
ab87f8c8
JL
6639 break
6640 fi
6641 fi
6642 done
6643 IFS="$ac_save_ifs"
71a94577 6644 test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
ab87f8c8
JL
6645 ;;
6646esac
6647fi
71a94577
ZW
6648XGETTEXT="$ac_cv_path_XGETTEXT"
6649if test "$XGETTEXT" != ":"; then
093e61a6 6650 echo "$ac_t""$XGETTEXT" 1>&6
ab87f8c8 6651else
093e61a6 6652 echo "$ac_t""no" 1>&6
ab87f8c8
JL
6653fi
6654
093e61a6 6655
71a94577 6656 BUILD_INCLUDED_LIBINTL=yes
ab87f8c8
JL
6657 USE_INCLUDED_LIBINTL=yes
6658 CATOBJEXT=.gmo
71a94577 6659 INTLLIBS="\$(top_builddir)/intl/libintl.a $LIBICONV"
77c06844 6660 INTLDEPS="\$(top_builddir)/intl/libintl.a"
71a94577
ZW
6661 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
6662 fi
6663
6664 if test "$GMSGFMT" != ":"; then
6665 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
6666 : ;
6667 else
093e61a6 6668 echo "$ac_t""found msgfmt program is not GNU msgfmt; ignore it" 1>&6
71a94577
ZW
6669 GMSGFMT=":"
6670 fi
ab87f8c8
JL
6671 fi
6672
71a94577
ZW
6673 if test "$XGETTEXT" != ":"; then
6674 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
ab87f8c8
JL
6675 : ;
6676 else
093e61a6 6677 echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6
ab87f8c8
JL
6678 XGETTEXT=":"
6679 fi
6680 fi
6681
71a94577
ZW
6682 POSUB=po
6683 fi
093e61a6 6684
17297c41
PT
6685
6686
71a94577
ZW
6687 if test "$PACKAGE" = gettext; then
6688 BUILD_INCLUDED_LIBINTL=yes
ab87f8c8 6689 fi
ab87f8c8 6690
71a94577
ZW
6691 for ac_prog in bison
6692do
093e61a6 6693# Extract the first word of "$ac_prog", so it can be a program name with args.
71a94577 6694set dummy $ac_prog; ac_word=$2
093e61a6 6695echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
619833ad 6696echo "configure:6697: checking for $ac_word" >&5
093e61a6
RS
6697if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then
6698 echo $ac_n "(cached) $ac_c" 1>&6
71a94577
ZW
6699else
6700 if test -n "$INTLBISON"; then
6701 ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test.
6702else
093e61a6
RS
6703 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
6704 ac_dummy="$PATH"
6705 for ac_dir in $ac_dummy; do
6706 test -z "$ac_dir" && ac_dir=.
6707 if test -f $ac_dir/$ac_word; then
6708 ac_cv_prog_INTLBISON="$ac_prog"
6709 break
6710 fi
6711 done
6712 IFS="$ac_save_ifs"
71a94577
ZW
6713fi
6714fi
093e61a6 6715INTLBISON="$ac_cv_prog_INTLBISON"
71a94577 6716if test -n "$INTLBISON"; then
093e61a6 6717 echo "$ac_t""$INTLBISON" 1>&6
71a94577 6718else
093e61a6 6719 echo "$ac_t""no" 1>&6
71a94577
ZW
6720fi
6721
093e61a6 6722test -n "$INTLBISON" && break
71a94577 6723done
ab87f8c8 6724
71a94577
ZW
6725 if test -z "$INTLBISON"; then
6726 ac_verc_fail=yes
6727 else
093e61a6 6728 echo $ac_n "checking version of bison""... $ac_c" 1>&6
619833ad 6729echo "configure:6730: checking version of bison" >&5
71a94577
ZW
6730 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
6731 case $ac_prog_version in
6732 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
6733 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
6734 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
6735 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
6736 esac
093e61a6 6737 echo "$ac_t""$ac_prog_version" 1>&6
71a94577
ZW
6738 fi
6739 if test $ac_verc_fail = yes; then
6740 INTLBISON=:
ab87f8c8
JL
6741 fi
6742
093e61a6
RS
6743
6744
6745
6746
6747
6748
6749
6750
6751
191bf464 6752 if test $USE_INCLUDED_LIBINTL = yes; then
093e61a6 6753 cat >> confdefs.h <<\EOF
191bf464 6754#define USE_INCLUDED_LIBINTL 1
093e61a6 6755EOF
191bf464
ZW
6756
6757 fi
71a94577
ZW
6758
6759 nls_cv_header_intl=
6760 nls_cv_header_libgt=
6761
6762 DATADIRNAME=share
093e61a6 6763
71a94577
ZW
6764
6765 INSTOBJEXT=.mo
093e61a6 6766
ab87f8c8 6767
71a94577 6768 GENCAT=gencat
093e61a6
RS
6769
6770
9fdf713f 6771
9f6682b7 6772 if test "x$CATOBJEXT" != x; then
093e61a6 6773 echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
619833ad 6774echo "configure:6775: checking for catalogs to be installed" >&5
9f6682b7
ZW
6775 # Look for .po and .gmo files in the source directory.
6776 CATALOGS=
6777 XLINGUAS=
6778 for cat in $srcdir/po/*$CATOBJEXT $srcdir/po/*.po; do
6779 # If there aren't any .gmo files the shell will give us the
6780 # literal string "../path/to/srcdir/po/*.gmo" which has to be
6781 # weeded out.
6782 case "$cat" in *\**)
6783 continue;;
6784 esac
6785 # The quadruple backslash is collapsed to a double backslash
6786 # by the backticks, then collapsed again by the double quotes,
6787 # leaving us with one backslash in the sed expression (right
6788 # before the dot that mustn't act as a wildcard). The dot to
6789 # be escaped in the second expression is hiding inside CATOBJEXT.
6790 cat=`echo $cat | sed -e "s!$srcdir/!!" -e "s!\\\\.po!$CATOBJEXT!"`
6791 lang=`echo $cat | sed -e 's!po/!!' -e "s!\\\\$CATOBJEXT!!"`
6792 # The user is allowed to set LINGUAS to a list of languages to
6793 # install catalogs for. If it's empty that means "all of them."
6794 if test "x$LINGUAS" = x; then
6795 CATALOGS="$CATALOGS $cat"
6796 XLINGUAS="$XLINGUAS $lang"
6797 else
6798 case "$LINGUAS" in *$lang*)
6799 CATALOGS="$CATALOGS $cat"
6800 XLINGUAS="$XLINGUAS $lang"
6801 ;;
6802 esac
6803 fi
6804 done
6805 LINGUAS="$XLINGUAS"
093e61a6 6806 echo "$ac_t""$LINGUAS" 1>&6
ab87f8c8
JL
6807 fi
6808
ab87f8c8
JL
6809 MKINSTALLDIRS=
6810 if test -n "$ac_aux_dir"; then
6811 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
6812 fi
6813 if test -z "$MKINSTALLDIRS"; then
6814 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
6815 fi
093e61a6 6816
ab87f8c8 6817
71a94577 6818 INTL_LIBTOOL_SUFFIX_PREFIX=
093e61a6
RS
6819
6820
ab87f8c8 6821
f4ab28e3
MK
6822# Windows32 Registry support for specifying GCC installation paths.
6823# Check whether --enable-win32-registry or --disable-win32-registry was given.
6824if test "${enable_win32_registry+set}" = set; then
6825 enableval="$enable_win32_registry"
093e61a6
RS
6826 :
6827fi
f4ab28e3 6828
4e70264f
ZW
6829case $host_os in
6830 win32 | pe | cygwin* | mingw32* | uwin*)
093e61a6 6831echo $ac_n "checking whether windows registry support is requested""... $ac_c" 1>&6
619833ad 6832echo "configure:6833: checking whether windows registry support is requested" >&5
9dd53f2c 6833if test "x$enable_win32_registry" != xno; then
093e61a6 6834 cat >> confdefs.h <<\EOF
f4ab28e3 6835#define ENABLE_WIN32_REGISTRY 1
093e61a6 6836EOF
f4ab28e3 6837
093e61a6
RS
6838 echo "$ac_t""yes" 1>&6
6839
6840echo $ac_n "checking for library containing RegOpenKeyExA""... $ac_c" 1>&6
619833ad 6841echo "configure:6842: checking for library containing RegOpenKeyExA" >&5
093e61a6
RS
6842if eval "test \"`echo '$''{'ac_cv_search_RegOpenKeyExA'+set}'`\" = set"; then
6843 echo $ac_n "(cached) $ac_c" 1>&6
6844else
6845 ac_func_search_save_LIBS="$LIBS"
6846ac_cv_search_RegOpenKeyExA="no"
6847cat > conftest.$ac_ext <<EOF
619833ad 6848#line 6849 "configure"
093e61a6 6849#include "confdefs.h"
4e70264f
ZW
6850/* Override any gcc2 internal prototype to avoid an error. */
6851/* We use char because int might match the return type of a gcc2
093e61a6
RS
6852 builtin and then its argument prototype would still apply. */
6853char RegOpenKeyExA();
6854
6855int main() {
6856RegOpenKeyExA()
6857; return 0; }
6858EOF
619833ad 6859if { (eval echo configure:6860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6 6860 rm -rf conftest*
4e70264f
ZW
6861 ac_cv_search_RegOpenKeyExA="none required"
6862else
093e61a6
RS
6863 echo "configure: failed program was:" >&5
6864 cat conftest.$ac_ext >&5
4e70264f 6865fi
093e61a6
RS
6866rm -f conftest*
6867test "$ac_cv_search_RegOpenKeyExA" = "no" && for i in advapi32; do
6868LIBS="-l$i $ac_func_search_save_LIBS"
6869cat > conftest.$ac_ext <<EOF
619833ad 6870#line 6871 "configure"
093e61a6 6871#include "confdefs.h"
4e70264f
ZW
6872/* Override any gcc2 internal prototype to avoid an error. */
6873/* We use char because int might match the return type of a gcc2
093e61a6
RS
6874 builtin and then its argument prototype would still apply. */
6875char RegOpenKeyExA();
6876
6877int main() {
6878RegOpenKeyExA()
6879; return 0; }
6880EOF
619833ad 6881if { (eval echo configure:6882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
093e61a6
RS
6882 rm -rf conftest*
6883 ac_cv_search_RegOpenKeyExA="-l$i"
4e70264f
ZW
6884break
6885else
093e61a6
RS
6886 echo "configure: failed program was:" >&5
6887 cat conftest.$ac_ext >&5
4e70264f 6888fi
093e61a6
RS
6889rm -f conftest*
6890done
6891LIBS="$ac_func_search_save_LIBS"
cafe096b 6892fi
cafe096b 6893
093e61a6
RS
6894echo "$ac_t""$ac_cv_search_RegOpenKeyExA" 1>&6
6895if test "$ac_cv_search_RegOpenKeyExA" != "no"; then
6896 test "$ac_cv_search_RegOpenKeyExA" = "none required" || LIBS="$ac_cv_search_RegOpenKeyExA $LIBS"
6897
6898else :
6899
4e70264f 6900fi
f4ab28e3 6901else
093e61a6 6902 echo "$ac_t""no" 1>&6
f4ab28e3
MK
6903fi
6904
6905# Check if user specified a different registry key.
9dd53f2c 6906case "x${enable_win32_registry}" in
f4ab28e3
MK
6907x | xyes)
6908 # default.
6909 gcc_cv_win32_registry_key="$VERSION"
6910 ;;
6911xno)
6912 # no registry lookup.
6913 gcc_cv_win32_registry_key=''
6914 ;;
6915*)
6916 # user-specified key.
6917 gcc_cv_win32_registry_key="$enable_win32_registry"
6918 ;;
6919esac
6920
9dd53f2c 6921if test "x$enable_win32_registry" != xno; then
093e61a6 6922 echo $ac_n "checking registry key on windows hosts""... $ac_c" 1>&6
619833ad 6923echo "configure:6924: checking registry key on windows hosts" >&5
093e61a6 6924 cat >> confdefs.h <<EOF
f4ab28e3 6925#define WIN32_REGISTRY_KEY "$gcc_cv_win32_registry_key"
093e61a6 6926EOF
f4ab28e3 6927
093e61a6 6928 echo "$ac_t""$gcc_cv_win32_registry_key" 1>&6
f4ab28e3 6929fi
4e70264f
ZW
6930;;
6931esac
f4ab28e3 6932
ab87f8c8 6933# Get an absolute path to the GCC top-level source directory
1e6347d8 6934holddir=`${PWDCMD-pwd}`
ab87f8c8 6935cd $srcdir
1e6347d8 6936topdir=`${PWDCMD-pwd}`
ab87f8c8
JL
6937cd $holddir
6938
6939# Conditionalize the makefile for this host machine.
6940# Make-host contains the concatenation of all host makefile fragments
6941# [there can be more than one]. This file is built by configure.frag.
6942host_overrides=Make-host
6943dep_host_xmake_file=
6944for f in .. ${host_xmake_file}
6945do
6946 if test -f ${srcdir}/config/$f
6947 then
6948 dep_host_xmake_file="${dep_host_xmake_file} ${srcdir}/config/$f"
6949 fi
6950done
6951
6952# Conditionalize the makefile for this target machine.
6953# Make-target contains the concatenation of all host makefile fragments
6954# [there can be more than one]. This file is built by configure.frag.
6955target_overrides=Make-target
6956dep_tmake_file=
6957for f in .. ${tmake_file}
6958do
6959 if test -f ${srcdir}/config/$f
6960 then
6961 dep_tmake_file="${dep_tmake_file} ${srcdir}/config/$f"
6962 fi
6963done
6964
34a86c2b
NN
6965symbolic_link='ln -s'
6966
ab87f8c8
JL
6967# If the host doesn't support symlinks, modify CC in
6968# FLAGS_TO_PASS so CC="stage1/xgcc -Bstage1/" works.
6969# Otherwise, we can use "CC=$(CC)".
6970rm -f symtest.tem
6971if $symbolic_link $srcdir/gcc.c symtest.tem 2>/dev/null
6972then
6973 cc_set_by_configure="\$(CC)"
5aa82ace 6974 quoted_cc_set_by_configure="\$(CC)"
ab87f8c8 6975 stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
596151e1 6976 quoted_stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
ab87f8c8
JL
6977else
6978 rm -f symtest.tem
6979 if cp -p $srcdir/gcc.c symtest.tem 2>/dev/null
6980 then
6981 symbolic_link="cp -p"
6982 else
6983 symbolic_link="cp"
6984 fi
6985 cc_set_by_configure="\`case '\$(CC)' in stage*) echo '\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\$(CC)';; esac\`"
5aa82ace 6986 quoted_cc_set_by_configure="\\\`case '\\\$(CC)' in stage*) echo '\\\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(CC)';; esac\\\`"
ab87f8c8 6987 stage_prefix_set_by_configure="\`case '\$(STAGE_PREFIX)' in stage*) echo '\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\$(STAGE_PREFIX)';; esac\`"
596151e1 6988 quoted_stage_prefix_set_by_configure="\\\`case '\\\$(STAGE_PREFIX)' in stage*) echo '\\\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(STAGE_PREFIX)';; esac\\\`"
ab87f8c8
JL
6989fi
6990rm -f symtest.tem
6991
6992out_object_file=`basename $out_file .c`.o
6993
6994tm_file_list=
6995for f in $tm_file; do
64ccbc99 6996 case $f in
d02af173
ZW
6997 ansidecl.h )
6998 tm_file_list="${tm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
6999 defaults.h )
e2500fed 7000 tm_file_list="${tm_file_list} \$(srcdir)/$f" ;;
64ccbc99
KG
7001 *) tm_file_list="${tm_file_list} \$(srcdir)/config/$f" ;;
7002 esac
ab87f8c8
JL
7003done
7004
11642c3a
ZW
7005tm_p_file_list=
7006for f in $tm_p_file; do
4977bab6
ZW
7007 case $f in
7008 tm-preds.h )
7009 tm_p_file_list="${tm_p_file_list} $f" ;;
7010 *) tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f" ;;
7011 esac
11642c3a
ZW
7012done
7013
ab87f8c8
JL
7014host_xm_file_list=
7015for f in $host_xm_file; do
64ccbc99 7016 case $f in
d02af173
ZW
7017 ansidecl.h )
7018 host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
e2500fed 7019 auto-host.h )
64ccbc99 7020 host_xm_file_list="${host_xm_file_list} $f" ;;
e2500fed
GK
7021 defaults.h )
7022 host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;;
64ccbc99
KG
7023 *) host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f" ;;
7024 esac
ab87f8c8
JL
7025done
7026
7027build_xm_file_list=
7028for f in $build_xm_file; do
64ccbc99 7029 case $f in
d02af173
ZW
7030 ansidecl.h )
7031 build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
e2500fed 7032 auto-build.h | auto-host.h )
64ccbc99 7033 build_xm_file_list="${build_xm_file_list} $f" ;;
e2500fed
GK
7034 defaults.h )
7035 host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;;
64ccbc99
KG
7036 *) build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f" ;;
7037 esac
ab87f8c8
JL
7038done
7039
a078a589
ZW
7040# Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
7041# Also use all.cross instead of all.internal and adjust SYSTEM_HEADER_DIR.
093e61a6
RS
7042CROSS=
7043ALL=all.internal
7044SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)'
ab87f8c8
JL
7045if test x$host != x$target
7046then
a078a589
ZW
7047 CROSS="-DCROSS_COMPILE"
7048 ALL=all.cross
7049 SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
343f59d9
AM
7050 case "$host","$target" in
7051 i?86-*-*,x86_64-*-* \
7052 | powerpc*-*-*,powerpc64*-*-*)
7053 CROSS="$CROSS -DNATIVE_CROSS" ;;
7054 esac
7a615b25
AO
7055elif test "x$TARGET_SYSTEM_ROOT" != x; then
7056 # This is just $(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR)
7057 SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
ab87f8c8
JL
7058fi
7059
b39d221a
EC
7060# If this is a cross-compiler that does not
7061# have its own set of headers then define
7062# inhibit_libc
7063
dc06db20
R
7064# If this is using newlib, without having the headers available now,
7065# then define inhibit_libc in LIBGCC2_CFLAGS.
fecd6201
ZW
7066# This prevents libgcc2 from containing any code which requires libc
7067# support.
b39d221a 7068inhibit_libc=
dc06db20
R
7069if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
7070 test x$with_newlib = xyes ; } &&
7071 test "x$with_headers" = x ; then
b39d221a 7072 inhibit_libc=-Dinhibit_libc
b39d221a
EC
7073fi
7074
7075
a078a589
ZW
7076# When building gcc with a cross-compiler, we need to adjust things so
7077# that the generator programs are still built with the native compiler.
7078# Also, we cannot run fixincludes or fix-header.
a078a589
ZW
7079
7080# These are the normal (build=host) settings:
093e61a6
RS
7081BUILD_PREFIX=
7082BUILD_PREFIX_1=ignore-
7083BUILD_CC='$(CC)'
7084BUILD_CFLAGS='$(ALL_CFLAGS)'
a078a589 7085
093e61a6
RS
7086STMP_FIXINC=stmp-fixinc
7087STMP_FIXPROTO=stmp-fixproto
a078a589
ZW
7088
7089# And these apply if build != host.
ab87f8c8
JL
7090if test x$build != x$host
7091then
5c35940c
NN
7092 BUILD_PREFIX=build-
7093 BUILD_PREFIX_1=build-
4977bab6
ZW
7094 BUILD_CC='$(CC_FOR_BUILD)'
7095 BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
a078a589 7096
7a615b25
AO
7097 if test "x$TARGET_SYSTEM_ROOT" = x; then
7098 STMP_FIXINC=
7099 STMP_FIXPROTO=
7100 fi
ab87f8c8
JL
7101fi
7102
7103# Expand extra_headers to include complete path.
7104# This substitutes for lots of t-* files.
7105extra_headers_list=
7106if test "x$extra_headers" = x
7107then true
7108else
29f7a208 7109 # Prepend ${srcdir}/config/${cpu_type}/ to every entry in extra_headers.
ab87f8c8
JL
7110 for file in $extra_headers;
7111 do
29f7a208 7112 extra_headers_list="${extra_headers_list} \$(srcdir)/config/${cpu_type}/${file}"
ab87f8c8
JL
7113 done
7114fi
7115
ab87f8c8 7116# Add a definition of USE_COLLECT2 if system wants one.
34a86c2b
NN
7117case $use_collect2 in
7118 no) use_collect2= ;;
7119 "") ;;
093e61a6 7120 *)
34a86c2b
NN
7121 host_xm_defines="${host_xm_defines} USE_COLLECT2"
7122 xm_defines="${xm_defines} USE_COLLECT2"
7123 ;;
7124esac
ab87f8c8 7125
d869a8c4
NN
7126# Identify the assembler which will work hand-in-glove with the newly
7127# built GCC, so that we can examine its features. This is the assembler
7128# which will be driven by the driver program.
7129#
7130# If build != host, and we aren't building gas in-tree, we identify a
7131# build->target assembler and hope that it will have the same features
7132# as the host->target assembler we'll be using.
093e61a6 7133echo $ac_n "checking what assembler to use""... $ac_c" 1>&6
619833ad 7134echo "configure:7135: checking what assembler to use" >&5
34a86c2b 7135in_tree_gas=no
ab87f8c8 7136gcc_cv_as=
981d4858
JM
7137gcc_cv_gas_major_version=
7138gcc_cv_gas_minor_version=
ab87f8c8
JL
7139gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
7140if test -x "$DEFAULT_ASSEMBLER"; then
7141 gcc_cv_as="$DEFAULT_ASSEMBLER"
7142elif test -x "$AS"; then
7143 gcc_cv_as="$AS"
7144elif test -x as$host_exeext; then
7145 # Build using assembler in the current directory.
7146 gcc_cv_as=./as$host_exeext
34a86c2b
NN
7147elif test -f $gcc_cv_as_gas_srcdir/configure.in \
7148 && test -f ../gas/Makefile; then
ad9c4d9f
NN
7149 # Single tree build which includes gas.
7150 in_tree_gas=yes
7151 gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
7152for f in $gcc_cv_as_bfd_srcdir/configure \
7153 $gcc_cv_as_gas_srcdir/configure \
7154 $gcc_cv_as_gas_srcdir/configure.in \
7155 $gcc_cv_as_gas_srcdir/Makefile.in ; do
7156 gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
7157 if test x$gcc_cv_gas_version != x; then
7158 break
7159 fi
7160done
7161gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
7162gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
7163gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.[0-9]*\.\([0-9]*\)"`
7164
f9c1196a
ZW
7165 rm -f as$host_exeext
7166 $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null
981d4858 7167fi
9e423e6d 7168
534d0cc0 7169if test "x$gcc_cv_as" = x; then
779243f7
JL
7170 # Search the same directories that the installed compiler will
7171 # search. Else we may find the wrong assembler and lose. If we
7172 # do not find a suitable assembler binary, then try the user's
7173 # path.
7174 #
7175 # Also note we have to check MD_EXEC_PREFIX before checking the
7176 # user's path. Unfortunately, there is no good way to get at the
7177 # value of MD_EXEC_PREFIX here. So we do a brute force search
7178 # through all the known MD_EXEC_PREFIX values. Ugh. This needs
7179 # to be fixed as part of the make/configure rewrite too.
7180
7181 if test "x$exec_prefix" = xNONE; then
7182 if test "x$prefix" = xNONE; then
7183 test_prefix=/usr/local
7184 else
7185 test_prefix=$prefix
7186 fi
7187 else
7188 test_prefix=$exec_prefix
7189 fi
7190
7191 # If the loop below does not find an assembler, then use whatever
7192 # one we can find in the users's path.
7193 # user's path.
55a2ea2a
AM
7194 if test "x$program_prefix" != xNONE; then
7195 gcc_cv_as=${program_prefix}as$host_exeext
7196 else
7197 gcc_cv_as=`echo as | sed ${program_transform_name}`$host_exeext
7198 fi
7199
7200 test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
7201 $test_prefix/lib/gcc-lib/$target_alias \
7202 /usr/lib/gcc/$target_alias/$gcc_version \
7203 /usr/lib/gcc/$target_alias \
7204 $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
7205 $test_prefix/$target_alias/bin"
7206
7207 if test x$host = x$target; then
7208 test_dirs="$test_dirs \
779243f7
JL
7209 /usr/libexec \
7210 /usr/ccs/gcc \
7211 /usr/ccs/bin \
7212 /udk/usr/ccs/bin \
7213 /bsd43/usr/lib/cmplrs/cc \
7214 /usr/cross64/usr/bin \
7215 /usr/lib/cmplrs/cc \
7216 /sysv/usr/lib/cmplrs/cc \
7217 /svr4/usr/lib/cmplrs/cc \
7218 /usr/bin"
55a2ea2a 7219 fi
779243f7
JL
7220
7221 for dir in $test_dirs; do
55a2ea2a 7222 if test -x $dir/as$host_exeext; then
779243f7
JL
7223 gcc_cv_as=$dir/as$host_exeext
7224 break;
7225 fi
7226 done
9e423e6d 7227fi
34a86c2b
NN
7228case $in_tree_gas in
7229 yes)
093e61a6 7230 echo "$ac_t"""newly built gas"" 1>&6
34a86c2b
NN
7231 ;;
7232 no)
093e61a6 7233 echo "$ac_t""$gcc_cv_as" 1>&6
34a86c2b
NN
7234 ;;
7235esac
981d4858 7236
d869a8c4
NN
7237# Identify the linker which will work hand-in-glove with the newly
7238# built GCC, so that we can examine its features. This is the linker
7239# which will be driven by the driver program.
7240#
7241# If build != host, and we aren't building gas in-tree, we identify a
7242# build->target linker and hope that it will have the same features
7243# as the host->target linker we'll be using.
093e61a6 7244echo $ac_n "checking what linker to use""... $ac_c" 1>&6
619833ad 7245echo "configure:7246: checking what linker to use" >&5
34a86c2b 7246in_tree_ld=no
275b60d6
JJ
7247gcc_cv_ld=
7248gcc_cv_gld_major_version=
7249gcc_cv_gld_minor_version=
7250gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/ld
7251gcc_cv_ld_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
7252if test -x "$DEFAULT_LINKER"; then
7253 gcc_cv_ld="$DEFAULT_LINKER"
7254elif test -x "$LD"; then
7255 gcc_cv_ld="$LD"
f9c1196a 7256elif test -x collect-ld$host_exeext; then
275b60d6 7257 # Build using linker in the current directory.
f9c1196a 7258 gcc_cv_ld=./collect-ld$host_exeext
34a86c2b
NN
7259elif test -f $gcc_cv_ld_gld_srcdir/configure.in \
7260 && test -f ../ld/Makefile; then
275b60d6 7261 # Single tree build which includes ld.
34a86c2b 7262 in_tree_ld=yes
275b60d6
JJ
7263 for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
7264 do
7265 gcc_cv_gld_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
7266 if test x$gcc_cv_gld_version != x; then
7267 break
7268 fi
7269 done
7270 gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"`
7271 gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
f9c1196a
ZW
7272 rm -f collect-ld$host_exeext
7273 $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext \
7274 2>/dev/null
275b60d6
JJ
7275fi
7276
534d0cc0 7277if test "x$gcc_cv_ld" = x; then
275b60d6
JJ
7278 # Search the same directories that the installed compiler will
7279 # search. Else we may find the wrong linker and lose. If we
7280 # do not find a suitable linker binary, then try the user's
7281 # path.
7282 #
7283 # Also note we have to check MD_EXEC_PREFIX before checking the
7284 # user's path. Unfortunately, there is no good way to get at the
7285 # value of MD_EXEC_PREFIX here. So we do a brute force search
7286 # through all the known MD_EXEC_PREFIX values. Ugh. This needs
7287 # to be fixed as part of the make/configure rewrite too.
7288
7289 if test "x$exec_prefix" = xNONE; then
7290 if test "x$prefix" = xNONE; then
7291 test_prefix=/usr/local
7292 else
7293 test_prefix=$prefix
7294 fi
7295 else
7296 test_prefix=$exec_prefix
7297 fi
7298
7299 # If the loop below does not find an linker, then use whatever
7300 # one we can find in the users's path.
7301 # user's path.
55a2ea2a
AM
7302 if test "x$program_prefix" != xNONE; then
7303 gcc_cv_ld=${program_prefix}ld$host_exeext
7304 else
7305 gcc_cv_ld=`echo ld | sed ${program_transform_name}`$host_exeext
7306 fi
7307
7308 test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
7309 $test_prefix/lib/gcc-lib/$target_alias \
7310 /usr/lib/gcc/$target_alias/$gcc_version \
7311 /usr/lib/gcc/$target_alias \
7312 $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
7313 $test_prefix/$target_alias/bin"
7314
7315 if test x$host = x$target; then
7316 test_dirs="$test_dirs \
275b60d6
JJ
7317 /usr/libexec \
7318 /usr/ccs/gcc \
7319 /usr/ccs/bin \
7320 /udk/usr/ccs/bin \
7321 /bsd43/usr/lib/cmplrs/cc \
7322 /usr/cross64/usr/bin \
7323 /usr/lib/cmplrs/cc \
7324 /sysv/usr/lib/cmplrs/cc \
7325 /svr4/usr/lib/cmplrs/cc \
7326 /usr/bin"
55a2ea2a 7327 fi
275b60d6
JJ
7328
7329 for dir in $test_dirs; do
55a2ea2a 7330 if test -x $dir/ld$host_exeext; then
275b60d6
JJ
7331 gcc_cv_ld=$dir/ld$host_exeext
7332 break;
7333 fi
7334 done
7335fi
34a86c2b
NN
7336case $in_tree_ld in
7337 yes)
093e61a6 7338 echo "$ac_t"""newly built ld"" 1>&6
34a86c2b
NN
7339 ;;
7340 no)
093e61a6 7341 echo "$ac_t""$gcc_cv_ld" 1>&6
34a86c2b
NN
7342 ;;
7343esac
275b60d6 7344
981d4858 7345# Figure out what nm we will be using.
f9c1196a 7346gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils
093e61a6 7347echo $ac_n "checking what nm to use""... $ac_c" 1>&6
619833ad 7348echo "configure:7349: checking what nm to use" >&5
f9c1196a 7349in_tree_nm=no
981d4858
JM
7350if test -x nm$host_exeext; then
7351 gcc_cv_nm=./nm$host_exeext
f9c1196a
ZW
7352elif test -f $gcc_cv_binutils_srcdir/configure.in \
7353 && test -f ../binutils/Makefile; then
7354 # Single tree build which includes binutils.
7355 in_tree_nm=yes
7356 gcc_cv_nm=./nm$host_exeext
7357 rm -f nm$host_exeext
7358 $symbolic_link ../binutils/nm-new$host_exeext nm$host_exeext 2>/dev/null
534d0cc0
AM
7359elif test "x$program_prefix" != xNONE; then
7360 gcc_cv_nm=${program_prefix}nm$host_exeext
7361else
7362 gcc_cv_nm=`echo nm | sed ${program_transform_name}`$host_exeext
981d4858 7363fi
f9c1196a 7364case $in_tree_nm in
093e61a6
RS
7365 yes) echo "$ac_t"""newly built nm"" 1>&6 ;;
7366 no) echo "$ac_t""$gcc_cv_nm" 1>&6 ;;
f9c1196a 7367esac
981d4858 7368
3cae5780 7369# Figure out what objdump we will be using.
093e61a6 7370echo $ac_n "checking what objdump to use""... $ac_c" 1>&6
619833ad 7371echo "configure:7372: checking what objdump to use" >&5
f9c1196a 7372in_tree_objdump=no
3cae5780
AS
7373if test -x objdump$host_exeext; then
7374 gcc_cv_objdump=./objdump$host_exeext
f9c1196a
ZW
7375elif test -f $gcc_cv_binutils_srcdir/configure.in \
7376 && test -f ../binutils/Makefile; then
7377 # Single tree build which includes binutils.
7378 in_tree_objdump=yes
7379 gcc_cv_objdump=./objdump$host_exeext
7380 rm -f objdump$host_exeext
7381 $symbolic_link ../binutils/objdump$host_exeext \
7382 objdump$host_exeext 2>/dev/null
534d0cc0
AM
7383elif test "x$program_prefix" != xNONE; then
7384 gcc_cv_objdump=${program_prefix}objdump$host_exeext
7385else
f9c1196a
ZW
7386 gcc_cv_objdump=`echo objdump | \
7387 sed ${program_transform_name}`$host_exeext
3cae5780 7388fi
f9c1196a 7389case $in_tree_objdump in
093e61a6
RS
7390 yes) echo "$ac_t"""newly built objdump"" 1>&6 ;;
7391 no) echo "$ac_t""$gcc_cv_objdump" 1>&6 ;;
f9c1196a 7392esac
3cae5780 7393
981d4858 7394# Figure out what assembler alignment features are present.
093e61a6 7395echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
619833ad 7396echo "configure:7397: checking assembler alignment features" >&5
9d147085 7397gcc_cv_as_alignment_features=none
34a86c2b 7398if test $in_tree_gas = yes; then
ad9c4d9f
NN
7399 # Gas version 2.6 and later support for .balign and .p2align.
7400 if test $gcc_cv_gas_major_version -eq 2 \
7401&& test $gcc_cv_gas_minor_version -ge 6 \
7402|| test $gcc_cv_gas_major_version -gt 2 ; then
7403
7404
7405 gcc_cv_as_alignment_features=".balign and .p2align"
093e61a6 7406 cat >> confdefs.h <<\EOF
981d4858 7407#define HAVE_GAS_BALIGN_AND_P2ALIGN 1
093e61a6 7408EOF
981d4858 7409
093e61a6 7410
ad9c4d9f
NN
7411
7412fi
7413
7414 # Gas version 2.8 and later support specifying the maximum
7415 # bytes to skip when using .p2align.
7416 if test $gcc_cv_gas_major_version -eq 2 \
7417&& test $gcc_cv_gas_minor_version -ge 8 \
7418|| test $gcc_cv_gas_major_version -gt 2 ; then
7419
7420
7421 gcc_cv_as_alignment_features=".p2align including maximum skip"
093e61a6 7422 cat >> confdefs.h <<\EOF
981d4858 7423#define HAVE_GAS_MAX_SKIP_P2ALIGN 1
093e61a6 7424EOF
981d4858 7425
093e61a6 7426
ad9c4d9f
NN
7427
7428fi
7429
981d4858 7430elif test x$gcc_cv_as != x; then
00ccc16d
JL
7431 # Check if we have .balign and .p2align
7432 echo ".balign 4" > conftest.s
7433 echo ".p2align 2" >> conftest.s
7434 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
7435 gcc_cv_as_alignment_features=".balign and .p2align"
093e61a6 7436 cat >> confdefs.h <<\EOF
00ccc16d 7437#define HAVE_GAS_BALIGN_AND_P2ALIGN 1
093e61a6 7438EOF
00ccc16d
JL
7439
7440 fi
7441 rm -f conftest.s conftest.o
9e423e6d
JW
7442 # Check if specifying the maximum bytes to skip when
7443 # using .p2align is supported.
7444 echo ".p2align 4,,7" > conftest.s
7445 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
7446 gcc_cv_as_alignment_features=".p2align including maximum skip"
093e61a6 7447 cat >> confdefs.h <<\EOF
9e423e6d 7448#define HAVE_GAS_MAX_SKIP_P2ALIGN 1
093e61a6 7449EOF
9e423e6d
JW
7450
7451 fi
7452 rm -f conftest.s conftest.o
7453fi
093e61a6 7454echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6
9e423e6d 7455
093e61a6 7456echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6
619833ad 7457echo "configure:7458: checking assembler subsection support" >&5
9d147085 7458gcc_cv_as_subsections=no
34a86c2b 7459if test $in_tree_gas = yes ; then
ad9c4d9f
NN
7460 if test $gcc_cv_gas_major_version -eq 2 \
7461&& test $gcc_cv_gas_minor_version -ge 9 \
7462|| test $gcc_cv_gas_major_version -gt 2 ; then
7463
7464
7465 if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
7466 gcc_cv_as_subsections="working .subsection -1"
7467 fi
093e61a6 7468
ad9c4d9f
NN
7469
7470fi
7471
981d4858 7472elif test x$gcc_cv_as != x; then
d1accaa3
JJ
7473 # Check if we have .subsection
7474 echo ".subsection 1" > conftest.s
7475 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
7476 gcc_cv_as_subsections=".subsection"
d1accaa3
JJ
7477 if test x$gcc_cv_nm != x; then
7478 cat > conftest.s <<EOF
7479conftest_label1: .word 0
7480.subsection -1
7481conftest_label2: .word 0
7482.previous
7483EOF
7484 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
7485 $gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1
7486 $gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2
1b015bec
AO
7487 if cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1; then
7488 :
7489 else
d1accaa3 7490 gcc_cv_as_subsections="working .subsection -1"
d1accaa3
JJ
7491 fi
7492 fi
7493 fi
7494 fi
7495 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
981d4858
JM
7496fi
7497if test x"$gcc_cv_as_subsections" = x"working .subsection -1"; then
093e61a6 7498 cat >> confdefs.h <<\EOF
981d4858 7499#define HAVE_GAS_SUBSECTION_ORDERING 1
093e61a6 7500EOF
981d4858 7501
d1accaa3 7502fi
093e61a6 7503echo "$ac_t""$gcc_cv_as_subsections" 1>&6
d1accaa3 7504
093e61a6 7505echo $ac_n "checking assembler weak support""... $ac_c" 1>&6
619833ad 7506echo "configure:7507: checking assembler weak support" >&5
9d147085 7507gcc_cv_as_weak=no
34a86c2b 7508if test $in_tree_gas = yes ; then
ad9c4d9f
NN
7509 if test $gcc_cv_gas_major_version -eq 2 \
7510&& test $gcc_cv_gas_minor_version -ge 2 \
7511|| test $gcc_cv_gas_major_version -gt 2 ; then
7512
7513
981d4858 7514 gcc_cv_as_weak="yes"
093e61a6 7515
ad9c4d9f
NN
7516
7517fi
7518
981d4858 7519elif test x$gcc_cv_as != x; then
12822146
JL
7520 # Check if we have .weak
7521 echo " .weak foobar" > conftest.s
7522 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
12822146
JL
7523 gcc_cv_as_weak="yes"
7524 fi
7525 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
981d4858
JM
7526fi
7527if test x"$gcc_cv_as_weak" = xyes; then
093e61a6 7528 cat >> confdefs.h <<\EOF
981d4858 7529#define HAVE_GAS_WEAK 1
093e61a6 7530EOF
981d4858 7531
12822146 7532fi
093e61a6 7533echo "$ac_t""$gcc_cv_as_weak" 1>&6
12822146 7534
093e61a6 7535echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6
619833ad 7536echo "configure:7537: checking assembler hidden support" >&5
9d147085 7537gcc_cv_as_hidden=no
34a86c2b 7538if test $in_tree_gas = yes ; then
ad9c4d9f
NN
7539 if test $gcc_cv_gas_major_version -eq 2 \
7540&& (test $gcc_cv_gas_minor_version -gt 12 \
7541 || (test $gcc_cv_gas_minor_version -eq 12 \
7542 && test $gcc_cv_gas_patch_version -ge 1 )) \
7543|| test $gcc_cv_gas_major_version -gt 2 ; then
7544
7545
7546 if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
7547 gcc_cv_as_hidden="yes"
7548 fi
093e61a6 7549
ad9c4d9f
NN
7550
7551fi
7552
981d4858 7553elif test x$gcc_cv_as != x; then
6a9c5260
UD
7554 # Check if we have .hidden
7555 echo " .hidden foobar" > conftest.s
7556 echo "foobar:" >> conftest.s
7557 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
6a9c5260
UD
7558 gcc_cv_as_hidden="yes"
7559 fi
7560 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
c72931a6
RH
7561
7562 # GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN.
093e61a6 7563 # This is irritatingly difficult to feature test for. Look for
c72931a6
RH
7564 # the date string after the version number.
7565 ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -1`
7566 if echo "$ld_ver" | grep GNU > /dev/null; then
96ef4bdc
MM
7567 ld_vers=`echo $ld_ver | sed -n 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\(\|\.[0-9][0-9]*\(\|\.[0-9][0-9]*\)\)\)\([ ].*\|\)$,\1,p'`
7568 ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
c72931a6 7569 if test 0"$ld_date" -lt 20020404; then
4832c9e1
JJ
7570 if test -n "$ld_date"; then
7571 # If there was date string, but was earlier than 2002-04-04, fail
7572 gcc_cv_as_hidden="no"
7573 elif test -z "$ld_vers"; then
7574 # If there was no date string nor ld version number, something is wrong
7575 gcc_cv_as_hidden="no"
7576 else
7577 ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
7578 ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
7579 ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
7580 test -z "$ld_vers_patch" && ld_vers_patch=0
7581 if test "$ld_vers_major" -lt 2; then
7582 gcc_cv_as_hidden="no"
7583 elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 12; then
7584 gcc_cv_as_hidden="no"
7585 elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -eq 12 \
7586 -a "$ld_vers_patch" -eq 0; then
7587 gcc_cv_as_hidden="no"
7588 fi
7589 fi
c72931a6
RH
7590 fi
7591 fi
981d4858 7592fi
789b7de5 7593case "$target" in
027faee7 7594 mips-sgi-irix6*)
789b7de5
RO
7595 if test x"$gnu_ld_flag" = x"no"; then
7596 # Even if using gas with .hidden support, the resulting object files
027faee7
AO
7597 # cannot be linked with the IRIX 6 O32 linker. With the N32 and
7598 # N64 linkers, the problem is that the linker refuses to accept
7599 # -call_shared (passed by default to the linker) and -r (used to
7600 # link the object file generated without .hidden directives with
7601 # one that hides symbols), so we also lose.
6d07784a 7602 gcc_cv_as_hidden=no
789b7de5
RO
7603 fi
7604 ;;
7605esac
6d07784a
RO
7606if test x"$gcc_cv_as_hidden" = xyes; then
7607 cat >> confdefs.h <<\EOF
7608#define HAVE_GAS_HIDDEN 1
7609EOF
7610
7611fi
7612echo "$ac_t""$gcc_cv_as_hidden" 1>&6
7613libgcc_visibility=$gcc_cv_as_hidden
9e944a16 7614
6a9c5260 7615
093e61a6 7616echo $ac_n "checking assembler leb128 support""... $ac_c" 1>&6
619833ad 7617echo "configure:7618: checking assembler leb128 support" >&5
fbe42b1b 7618gcc_cv_as_leb128=no
34a86c2b 7619if test $in_tree_gas = yes ; then
ad9c4d9f
NN
7620 if test $gcc_cv_gas_major_version -eq 2 \
7621&& test $gcc_cv_gas_minor_version -ge 11 \
7622|| test $gcc_cv_gas_major_version -gt 2 ; then
7623
7624
7625 if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
7626 gcc_cv_as_leb128="yes"
7627 fi
093e61a6 7628
ad9c4d9f
NN
7629
7630fi
7631
b7460f24
RH
7632elif test x$gcc_cv_as != x; then
7633 # Check if we have .[us]leb128, and support symbol arithmetic with it.
7634 cat > conftest.s <<EOF
7635 .data
7636 .uleb128 L2 - L1
7637L1:
7638 .uleb128 1280
7639 .sleb128 -1010
7640L2:
7641EOF
7642 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
78e766a0
RH
7643 gcc_cv_as_leb128="yes"
7644
7645 # GAS versions before 2.11 do not support uleb128,
7646 # despite appearing to.
7647 # ??? There exists an elf-specific test that will crash
7648 # the assembler. Perhaps it's better to figure out whether
7649 # arbitrary sections are supported and try the test.
7650 as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
7651 if echo "$as_ver" | grep GNU > /dev/null; then
5fed851d 7652 as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
78e766a0 7653 as_major=`echo $as_ver | sed 's/\..*//'`
3d399d67 7654 as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
78e766a0
RH
7655 if test $as_major -eq 2 -a $as_minor -lt 11; then
7656 gcc_cv_as_leb128="no"
7657 fi
fbe42b1b 7658 fi
b7460f24
RH
7659 fi
7660 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
7661fi
7662if test x"$gcc_cv_as_leb128" = xyes; then
093e61a6 7663 cat >> confdefs.h <<\EOF
b7460f24 7664#define HAVE_AS_LEB128 1
093e61a6 7665EOF
b7460f24
RH
7666
7667fi
093e61a6 7668echo "$ac_t""$gcc_cv_as_leb128" 1>&6
b7460f24 7669
093e61a6 7670echo $ac_n "checking assembler eh_frame optimization""... $ac_c" 1>&6
619833ad 7671echo "configure:7672: checking assembler eh_frame optimization" >&5
c64688ae 7672gcc_cv_as_eh_frame=no
34a86c2b 7673if test $in_tree_gas = yes ; then
ad9c4d9f
NN
7674 if test $gcc_cv_gas_major_version -eq 2 \
7675&& test $gcc_cv_gas_minor_version -ge 12 \
7676|| test $gcc_cv_gas_major_version -gt 2 ; then
7677
7678
7679 if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
7680 gcc_cv_as_eh_frame="yes"
7681 fi
093e61a6 7682
ad9c4d9f
NN
7683
7684fi
7685
c64688ae
RH
7686elif test x$gcc_cv_as != x; then
7687 # Check if this is GAS.
41948db5
SS
7688 as_ver=`$gcc_cv_as --version < /dev/null 2> /dev/null | head -1`
7689 rm -f a.out 2> /dev/null
c64688ae
RH
7690 if echo "$as_ver" | grep GNU > /dev/null; then
7691 # Versions up to and including 2.11.0 may mis-optimize
7692 # .eh_frame data. Try something.
7693 cat > conftest.s <<EOF
7694 .text
7695.LFB1:
7696 .4byte 0
7697.L1:
7698 .4byte 0
7699.LFE1:
7700 .section .eh_frame,"aw",@progbits
7701__FRAME_BEGIN__:
7702 .4byte .LECIE1-.LSCIE1
7703.LSCIE1:
7704 .4byte 0x0
7705 .byte 0x1
7706 .ascii "z\0"
7707 .byte 0x1
7708 .byte 0x78
7709 .byte 0x1a
7710 .byte 0x0
7711 .byte 0x4
7712 .4byte 1
7713 .p2align 1
7714.LECIE1:
7715.LSFDE1:
7716 .4byte .LEFDE1-.LASFDE1
7717.LASFDE1:
7718 .4byte .LASFDE1-__FRAME_BEGIN__
7719 .4byte .LFB1
7720 .4byte .LFE1-.LFB1
7721 .byte 0x4
7722 .4byte .LFE1-.LFB1
7723 .byte 0x4
7724 .4byte .L1-.LFB1
7725.LEFDE1:
7726EOF
01efb963 7727 cat > conftest.lit <<EOF
c64688ae
RH
7728 0000 10000000 00000000 017a0001 781a0004 .........z..x...
7729 0010 01000000 12000000 18000000 00000000 ................
093e61a6 7730 0020 08000000 04080000 0044 .........D
01efb963
AS
7731EOF
7732 cat > conftest.big <<EOF
7733 0000 00000010 00000000 017a0001 781a0004 .........z..x...
7734 0010 00000001 00000012 00000018 00000000 ................
093e61a6 7735 0020 00000008 04000000 0844 .........D
c64688ae
RH
7736EOF
7737 # If the assembler didn't choke, and we can objdump,
7738 # and we got the correct data, then succeed.
7739 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
3cae5780 7740 && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
c64688ae 7741 | tail -3 > conftest.got \
01efb963
AS
7742 && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
7743 || cmp conftest.big conftest.got > /dev/null 2>&1; }
c64688ae
RH
7744 then
7745 gcc_cv_as_eh_frame="yes"
7746 else
7747 gcc_cv_as_eh_frame="bad"
7748 if $gcc_cv_as -o conftest.o --traditional-format /dev/null; then
093e61a6 7749 cat >> confdefs.h <<\EOF
c64688ae 7750#define USE_AS_TRADITIONAL_FORMAT 1
093e61a6 7751EOF
c64688ae
RH
7752
7753 fi
7754 fi
7755 fi
7756 rm -f conftest.*
7757fi
093e61a6 7758echo "$ac_t""$gcc_cv_as_eh_frame" 1>&6
c64688ae 7759
093e61a6 7760echo $ac_n "checking assembler section merging support""... $ac_c" 1>&6
619833ad 7761echo "configure:7762: checking assembler section merging support" >&5
201556f0 7762gcc_cv_as_shf_merge=no
34a86c2b 7763if test $in_tree_gas = yes ; then
ad9c4d9f
NN
7764 if test $gcc_cv_gas_major_version -eq 2 \
7765&& test $gcc_cv_gas_minor_version -ge 12 \
7766|| test $gcc_cv_gas_major_version -gt 2 ; then
7767
7768
7769 if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
7770 gcc_cv_as_shf_merge=yes
7771 fi
093e61a6 7772
ad9c4d9f
NN
7773
7774fi
7775
201556f0
JJ
7776elif test x$gcc_cv_as != x; then
7777 # Check if we support SHF_MERGE sections
7778 echo '.section .rodata.str, "aMS", @progbits, 1' > conftest.s
a8b7afb9 7779 if $gcc_cv_as --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1; then
201556f0
JJ
7780 gcc_cv_as_shf_merge=yes
7781 fi
7782 rm -f conftest.s conftest.o
7783fi
7784if test x"$gcc_cv_as_shf_merge" = xyes; then
093e61a6 7785 cat >> confdefs.h <<\EOF
201556f0 7786#define HAVE_GAS_SHF_MERGE 1
093e61a6 7787EOF
201556f0
JJ
7788
7789fi
093e61a6 7790echo "$ac_t""$gcc_cv_as_shf_merge" 1>&6
201556f0 7791
093e61a6 7792echo $ac_n "checking assembler thread-local storage support""... $ac_c" 1>&6
619833ad 7793echo "configure:7794: checking assembler thread-local storage support" >&5
f996902d
RH
7794gcc_cv_as_tls=no
7795conftest_s=
7796tls_first_major=
7797tls_first_minor=
9739c90c 7798tls_as_opt=
f996902d 7799case "$target" in
6f9b006d
RH
7800 alpha*-*-*)
7801 conftest_s='
7802 .section ".tdata","awT",@progbits
7803foo: .long 25
7804 .text
7805 ldq $27,__tls_get_addr($29) !literal!1
7806 lda $16,foo($29) !tlsgd!1
7807 jsr $26,($27),__tls_get_addr !lituse_tlsgd!1
7808 ldq $27,__tls_get_addr($29) !literal!2
7809 lda $16,foo($29) !tlsldm!2
7810 jsr $26,($27),__tls_get_addr !lituse_tlsldm!2
7811 ldq $1,foo($29) !gotdtprel
7812 ldah $2,foo($29) !dtprelhi
7813 lda $3,foo($2) !dtprello
7814 lda $4,foo($29) !dtprel
7815 ldq $1,foo($29) !gottprel
7816 ldah $2,foo($29) !tprelhi
7817 lda $3,foo($2) !tprello
7818 lda $4,foo($29) !tprel'
7819 tls_first_major=2
7820 tls_first_minor=13
7821 ;;
f996902d
RH
7822 i[34567]86-*-*)
7823 conftest_s='
7824 .section ".tdata","awT",@progbits
7825foo: .long 25
7826 .text
7827 movl %gs:0, %eax
7828 leal foo@TLSGD(,%ebx,1), %eax
7829 leal foo@TLSLDM(%ebx), %eax
7830 leal foo@DTPOFF(%eax), %edx
7831 movl foo@GOTTPOFF(%ebx), %eax
7832 subl foo@GOTTPOFF(%ebx), %eax
75d38379
JJ
7833 addl foo@GOTNTPOFF(%ebx), %eax
7834 movl foo@INDNTPOFF, %eax
f996902d
RH
7835 movl $foo@TPOFF, %eax
7836 subl $foo@TPOFF, %eax
7837 leal foo@NTPOFF(%ecx), %eax'
7838 tls_first_major=2
75d38379
JJ
7839 tls_first_minor=14
7840 ;;
7841 x86_64-*-*)
7842 conftest_s='
7843 .section ".tdata","awT",@progbits
7844foo: .long 25
7845 .text
7846 movq %fs:0, %rax
7847 leaq foo@TLSGD(%rip), %rdi
7848 leaq foo@TLSLD(%rip), %rdi
7849 leaq foo@DTPOFF(%rax), %rdx
7850 movq foo@GOTTPOFF(%rip), %rax
7851 movq $foo@TPOFF, %rax'
7852 tls_first_major=2
7853 tls_first_minor=14
f996902d 7854 ;;
7b6e506e
RH
7855 ia64-*-*)
7856 conftest_s='
7857 .section ".tdata","awT",@progbits
7858foo: data8 25
7859 .text
7860 addl r16 = @ltoff(@dtpmod(foo#)), gp
7861 addl r17 = @ltoff(@dtprel(foo#)), gp
7862 addl r18 = @ltoff(@tprel(foo#)), gp
7863 addl r19 = @dtprel(foo#), gp
7864 adds r21 = @dtprel(foo#), r13
7865 movl r23 = @dtprel(foo#)
7866 addl r20 = @tprel(foo#), gp
7867 adds r22 = @tprel(foo#), r13
7868 movl r24 = @tprel(foo#)'
7869 tls_first_major=2
7870 tls_first_minor=13
7871 ;;
c4501e62
JJ
7872 powerpc-*-*)
7873 conftest_s='
7874 .section ".tdata","awT",@progbits
7875 .align 2
7876ld0: .space 4
7877ld1: .space 4
7878x1: .space 4
7879x2: .space 4
7880x3: .space 4
7881 .text
7882 addi 3,31,ld0@got@tlsgd
7883 bl __tls_get_addr
7884 addi 3,31,x1@got@tlsld
7885 bl __tls_get_addr
7886 addi 9,3,x1@dtprel
7887 addis 9,3,x2@dtprel@ha
7888 addi 9,9,x2@dtprel@l
7889 lwz 9,x3@got@tprel(31)
7890 add 9,9,x@tls
7891 addi 9,2,x1@tprel
7892 addis 9,2,x2@tprel@ha
7893 addi 9,9,x2@tprel@l'
7894 tls_first_major=2
7895 tls_first_minor=14
9739c90c 7896 tls_as_opt=-a32
c4501e62
JJ
7897 ;;
7898 powerpc64-*-*)
7899 conftest_s='
7900 .section ".tdata","awT",@progbits
7901 .align 3
7902ld0: .space 8
7903ld1: .space 8
7904x1: .space 8
7905x2: .space 8
7906x3: .space 8
7907 .text
7908 addi 3,2,ld0@got@tlsgd
7909 bl .__tls_get_addr
7910 nop
7911 addi 3,2,ld1@toc
7912 bl .__tls_get_addr
7913 nop
7914 addi 3,2,x1@got@tlsld
7915 bl .__tls_get_addr
7916 nop
7917 addi 9,3,x1@dtprel
7918 bl .__tls_get_addr
7919 nop
7920 addis 9,3,x2@dtprel@ha
7921 addi 9,9,x2@dtprel@l
7922 bl .__tls_get_addr
7923 nop
7924 ld 9,x3@got@dtprel(2)
7925 add 9,9,3
7926 bl .__tls_get_addr
7927 nop'
7928 tls_first_major=2
7929 tls_first_minor=14
9739c90c 7930 tls_as_opt=-a64
c4501e62 7931 ;;
fd3cd001
UW
7932 s390-*-*)
7933 conftest_s='
7934 .section ".tdata","awT",@progbits
7935foo: .long 25
7936 .text
7937 .long foo@TLSGD
7938 .long foo@TLSLDM
7939 .long foo@DTPOFF
7940 .long foo@NTPOFF
7941 .long foo@GOTNTPOFF
7942 .long foo@INDNTPOFF
7943 l %r1,foo@GOTNTPOFF(%r12)
7944 l %r1,0(%r1):tls_load:foo
7945 bas %r14,0(%r1,%r13):tls_gdcall:foo
7946 bas %r14,0(%r1,%r13):tls_ldcall:foo'
7947 tls_first_major=2
7948 tls_first_minor=14
9739c90c 7949 tls_as_opt=-m31
fd3cd001
UW
7950 ;;
7951 s390x-*-*)
7952 conftest_s='
7953 .section ".tdata","awT",@progbits
7954foo: .long 25
7955 .text
7956 .quad foo@TLSGD
7957 .quad foo@TLSLDM
7958 .quad foo@DTPOFF
7959 .quad foo@NTPOFF
7960 .quad foo@GOTNTPOFF
7961 lg %r1,foo@GOTNTPOFF(%r12)
7962 larl %r1,foo@INDNTPOFF
7963 brasl %r14,__tls_get_offset@PLT:tls_gdcall:foo
7964 brasl %r14,__tls_get_offset@PLT:tls_ldcall:foo'
7965 tls_first_major=2
7966 tls_first_minor=14
9739c90c 7967 tls_as_opt="-m64 -Aesame"
fd3cd001 7968 ;;
f996902d
RH
7969esac
7970if test -z "$tls_first_major"; then
7971 :
34a86c2b 7972elif test $in_tree_gas = yes ; then
ad9c4d9f
NN
7973 if test $gcc_cv_gas_major_version -eq $tls_first_major \
7974&& test $gcc_cv_gas_minor_version -ge $tls_first_minor \
7975|| test $gcc_cv_gas_major_version -gt $tls_first_major ; then
7976
7977
f996902d 7978 gcc_cv_as_tls=yes
093e61a6 7979
ad9c4d9f
NN
7980
7981fi
7982
f996902d
RH
7983elif test x$gcc_cv_as != x; then
7984 echo "$conftest_s" > conftest.s
9739c90c 7985 if $gcc_cv_as $tls_as_opt --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1
f996902d
RH
7986 then
7987 gcc_cv_as_tls=yes
7988 fi
7989 rm -f conftest.s conftest.o
7990fi
7991if test "$gcc_cv_as_tls" = yes; then
093e61a6 7992 cat >> confdefs.h <<\EOF
f996902d 7993#define HAVE_AS_TLS 1
093e61a6 7994EOF
f996902d
RH
7995
7996fi
093e61a6 7997echo "$ac_t""$gcc_cv_as_tls" 1>&6
f996902d 7998
3a37b08e
RH
7999case "$target" in
8000 # All TARGET_ABI_OSF targets.
8001 alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
093e61a6 8002 echo $ac_n "checking assembler supports explicit relocations""... $ac_c" 1>&6
619833ad 8003echo "configure:8004: checking assembler supports explicit relocations" >&5
093e61a6
RS
8004if eval "test \"`echo '$''{'gcc_cv_as_explicit_relocs'+set}'`\" = set"; then
8005 echo $ac_n "(cached) $ac_c" 1>&6
3a37b08e 8006else
093e61a6 8007
3a37b08e 8008 gcc_cv_as_explicit_relocs=unknown
34a86c2b 8009 if test $in_tree_gas = yes ; then
ad9c4d9f
NN
8010 if test $gcc_cv_gas_major_version -eq 2 \
8011&& test $gcc_cv_gas_minor_version -ge 12 \
8012|| test $gcc_cv_gas_major_version -gt 2 ; then
8013
8014
3a37b08e 8015 gcc_cv_as_explicit_relocs=yes
093e61a6 8016
ad9c4d9f
NN
8017
8018fi
8019
3a37b08e
RH
8020 elif test x$gcc_cv_as != x; then
8021 cat > conftest.s << 'EOF'
8022 .set nomacro
8023 .text
8024 extbl $3, $2, $3 !lituse_bytoff!1
8025 ldq $2, a($29) !literal!1
8026 ldq $4, b($29) !literal!2
8027 ldq_u $3, 0($2) !lituse_base!1
8028 ldq $27, f($29) !literal!5
8029 jsr $26, ($27), f !lituse_jsr!5
8030 ldah $29, 0($26) !gpdisp!3
8031 lda $0, c($29) !gprel
8032 ldah $1, d($29) !gprelhigh
8033 lda $1, d($1) !gprellow
8034 lda $29, 0($29) !gpdisp!3
8035EOF
8036 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
8037 gcc_cv_as_explicit_relocs=yes
8038 else
8039 gcc_cv_as_explicit_relocs=no
8040 fi
8041 rm -f conftest.s conftest.o
8042 fi
093e61a6 8043
cafe096b 8044fi
cafe096b 8045
093e61a6
RS
8046echo "$ac_t""$gcc_cv_as_explicit_relocs" 1>&6
8047 if test "x$gcc_cv_as_explicit_relocs" = xyes; then
8048 cat >> confdefs.h <<\EOF
3a37b08e 8049#define HAVE_AS_EXPLICIT_RELOCS 1
093e61a6 8050EOF
3a37b08e
RH
8051
8052 fi
8053 ;;
1cb36a98 8054 sparc*-*-*)
093e61a6 8055 echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6
619833ad 8056echo "configure:8057: checking assembler .register pseudo-op support" >&5
093e61a6
RS
8057if eval "test \"`echo '$''{'gcc_cv_as_register_pseudo_op'+set}'`\" = set"; then
8058 echo $ac_n "(cached) $ac_c" 1>&6
5b68c389 8059else
093e61a6 8060
5b68c389
AO
8061 gcc_cv_as_register_pseudo_op=unknown
8062 if test x$gcc_cv_as != x; then
8063 # Check if we have .register
8064 echo ".register %g2, #scratch" > conftest.s
8065 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
1cb36a98 8066 gcc_cv_as_register_pseudo_op=yes
5b68c389
AO
8067 else
8068 gcc_cv_as_register_pseudo_op=no
8069 fi
8070 rm -f conftest.s conftest.o
8071 fi
093e61a6 8072
cafe096b 8073fi
cafe096b 8074
093e61a6
RS
8075echo "$ac_t""$gcc_cv_as_register_pseudo_op" 1>&6
8076 if test "x$gcc_cv_as_register_pseudo_op" = xyes; then
8077 cat >> confdefs.h <<\EOF
1cb36a98 8078#define HAVE_AS_REGISTER_PSEUDO_OP 1
093e61a6 8079EOF
1cb36a98 8080
1cb36a98 8081 fi
1cb36a98 8082
093e61a6 8083 echo $ac_n "checking assembler supports -relax""... $ac_c" 1>&6
619833ad 8084echo "configure:8085: checking assembler supports -relax" >&5
093e61a6
RS
8085if eval "test \"`echo '$''{'gcc_cv_as_relax_opt'+set}'`\" = set"; then
8086 echo $ac_n "(cached) $ac_c" 1>&6
e95b1e6a 8087else
093e61a6 8088
e95b1e6a
JJ
8089 gcc_cv_as_relax_opt=unknown
8090 if test x$gcc_cv_as != x; then
8091 # Check if gas supports -relax
8092 echo ".text" > conftest.s
8093 if $gcc_cv_as -relax -o conftest.o conftest.s > /dev/null 2>&1; then
8094 gcc_cv_as_relax_opt=yes
8095 else
8096 gcc_cv_as_relax_opt=no
8097 fi
8098 rm -f conftest.s conftest.o
8099 fi
093e61a6 8100
cafe096b 8101fi
cafe096b 8102
093e61a6
RS
8103echo "$ac_t""$gcc_cv_as_relax_opt" 1>&6
8104 if test "x$gcc_cv_as_relax_opt" = xyes; then
8105 cat >> confdefs.h <<\EOF
e95b1e6a 8106#define HAVE_AS_RELAX_OPTION 1
093e61a6 8107EOF
e95b1e6a
JJ
8108
8109 fi
8110
093e61a6 8111 echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6
619833ad 8112echo "configure:8113: checking assembler and linker support unaligned pc related relocs" >&5
093e61a6
RS
8113if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then
8114 echo $ac_n "(cached) $ac_c" 1>&6
17e9e88c 8115else
093e61a6 8116
17e9e88c
JJ
8117 gcc_cv_as_sparc_ua_pcrel=unknown
8118 if test x$gcc_cv_as != x -a x$gcc_cv_ld != x; then
8119 gcc_cv_as_sparc_ua_pcrel=no
8120 echo ".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo)" > conftest.s
cf7b8b0d
JJ
8121 if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
8122 && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
8123 gcc_cv_as_sparc_ua_pcrel=yes
17e9e88c
JJ
8124 fi
8125 rm -f conftest.s conftest.o conftest
8126 fi
093e61a6 8127
cafe096b 8128fi
cafe096b 8129
093e61a6
RS
8130echo "$ac_t""$gcc_cv_as_sparc_ua_pcrel" 1>&6
8131 if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
8132 cat >> confdefs.h <<\EOF
17e9e88c 8133#define HAVE_AS_SPARC_UA_PCREL 1
093e61a6 8134EOF
17e9e88c
JJ
8135
8136 fi
8137
093e61a6 8138 echo $ac_n "checking assembler and linker support unaligned pc related relocs against hidden symbols""... $ac_c" 1>&6
619833ad 8139echo "configure:8140: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5
093e61a6
RS
8140if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel_hidden'+set}'`\" = set"; then
8141 echo $ac_n "(cached) $ac_c" 1>&6
cf7b8b0d 8142else
093e61a6 8143
cf7b8b0d
JJ
8144 if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
8145 gcc_cv_as_sparc_ua_pcrel_hidden=unknown
8146 if test x$gcc_cv_objdump != x; then
8147 gcc_cv_as_sparc_ua_pcrel_hidden=no
8148 echo ".data; .align 4; .byte 0x31; .uaword %r_disp32(foo)" > conftest.s
8149 echo ".byte 0x32, 0x33, 0x34; .global foo; .hidden foo" >> conftest.s
8150 echo "foo: .skip 4" >> conftest.s
8151 if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
8152 && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1 \
8153 && $gcc_cv_objdump -s -j .data conftest 2> /dev/null \
8154 | grep ' 31000000 07323334' > /dev/null 2>&1; then
8155 if $gcc_cv_objdump -R conftest 2> /dev/null \
8156 | grep 'DISP32' > /dev/null 2>&1; then
8157 :
8158 else
8159 gcc_cv_as_sparc_ua_pcrel_hidden=yes
8160 fi
8161 fi
8162 fi
8163 rm -f conftest.s conftest.o conftest
8164 else
8165 gcc_cv_as_sparc_ua_pcrel_hidden="$gcc_cv_as_sparc_ua_pcrel"
8166 fi
093e61a6 8167
cafe096b 8168fi
cafe096b 8169
093e61a6
RS
8170echo "$ac_t""$gcc_cv_as_sparc_ua_pcrel_hidden" 1>&6
8171 if test "x$gcc_cv_as_sparc_ua_pcrel_hidden" = xyes; then
8172 cat >> confdefs.h <<\EOF
cf7b8b0d 8173#define HAVE_AS_SPARC_UA_PCREL_HIDDEN 1
093e61a6 8174EOF
cf7b8b0d
JJ
8175
8176 fi
8177
093e61a6 8178 echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6
619833ad 8179echo "configure:8180: checking for assembler offsetable %lo() support" >&5
093e61a6
RS
8180if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then
8181 echo $ac_n "(cached) $ac_c" 1>&6
5b68c389 8182else
093e61a6 8183
22252625
JJ
8184 gcc_cv_as_offsetable_lo10=unknown
8185 if test "x$gcc_cv_as" != x; then
8186 # Check if assembler has offsetable %lo()
8187 echo "or %g1, %lo(ab) + 12, %g1" > conftest.s
8188 echo "or %g1, %lo(ab + 12), %g1" > conftest1.s
8189 if $gcc_cv_as -xarch=v9 -o conftest.o conftest.s \
8190 > /dev/null 2>&1 &&
8191 $gcc_cv_as -xarch=v9 -o conftest1.o conftest1.s \
8192 > /dev/null 2>&1; then
8193 if cmp conftest.o conftest1.o > /dev/null 2>&1; then
5b68c389 8194 gcc_cv_as_offsetable_lo10=no
22252625
JJ
8195 else
8196 gcc_cv_as_offsetable_lo10=yes
5b68c389 8197 fi
22252625
JJ
8198 else
8199 gcc_cv_as_offsetable_lo10=no
5b68c389 8200 fi
22252625
JJ
8201 rm -f conftest.s conftest.o conftest1.s conftest1.o
8202 fi
093e61a6 8203
cafe096b 8204fi
cafe096b 8205
093e61a6
RS
8206echo "$ac_t""$gcc_cv_as_offsetable_lo10" 1>&6
8207 if test "x$gcc_cv_as_offsetable_lo10" = xyes; then
8208 cat >> confdefs.h <<\EOF
1cb36a98 8209#define HAVE_AS_OFFSETABLE_LO10 1
093e61a6 8210EOF
1cb36a98 8211
1cb36a98 8212 fi
43160d01 8213
1cb36a98
RH
8214 ;;
8215
c307e6dd 8216 i[34567]86-*-* | x86_64-*-*)
093e61a6 8217 echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
619833ad 8218echo "configure:8219: checking assembler instructions" >&5
1cb36a98 8219 gcc_cv_as_instructions=
093e61a6 8220 if test $in_tree_gas = yes ; then
ad9c4d9f
NN
8221 if test $gcc_cv_gas_major_version -eq 2 \
8222&& test $gcc_cv_gas_minor_version -ge 9 \
8223|| test $gcc_cv_gas_major_version -gt 2 ; then
8224
8225
981d4858 8226 gcc_cv_as_instructions="filds fists"
093e61a6 8227
ad9c4d9f
NN
8228
8229fi
8230
981d4858 8231 elif test x$gcc_cv_as != x; then
53b5ce19
JW
8232 set "filds fists" "filds mem; fists mem"
8233 while test $# -gt 0
8234 do
8235 echo "$2" > conftest.s
8236 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
8237 gcc_cv_as_instructions=${gcc_cv_as_instructions}$1" "
53b5ce19
JW
8238 fi
8239 shift 2
8240 done
8241 rm -f conftest.s conftest.o
1cb36a98 8242 fi
981d4858 8243 if test x"$gcc_cv_as_instructions" != x; then
093e61a6 8244 cat >> confdefs.h <<EOF
ee7692d2 8245#define HAVE_GAS_`echo "$gcc_cv_as_instructions" | sed -e 's/ $//' | tr 'a-z ' 'A-Z_'` 1
093e61a6 8246EOF
981d4858
JM
8247
8248 fi
093e61a6 8249 echo "$ac_t""$gcc_cv_as_instructions" 1>&6
f88c65f7 8250
093e61a6 8251 echo $ac_n "checking assembler GOTOFF in data directives""... $ac_c" 1>&6
619833ad 8252echo "configure:8253: checking assembler GOTOFF in data directives" >&5
f88c65f7 8253 gcc_cv_as_gotoff_in_data=no
34a86c2b 8254 if test $in_tree_gas = yes ; then
ad9c4d9f
NN
8255 if test $gcc_cv_gas_major_version -eq 2 \
8256&& test $gcc_cv_gas_minor_version -ge 11 \
8257|| test $gcc_cv_gas_major_version -gt 2 ; then
8258
8259
f88c65f7 8260 gcc_cv_as_gotoff_in_data=yes
093e61a6 8261
ad9c4d9f
NN
8262
8263fi
8264
f88c65f7
RH
8265 elif test x$gcc_cv_as != x; then
8266 cat > conftest.s <<EOF
8267 .text
8268.L0:
8269 nop
8270 .data
8271 .long .L0@GOTOFF
8272EOF
8273 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
8274 gcc_cv_as_gotoff_in_data=yes
8275 fi
8276 fi
093e61a6 8277 cat >> confdefs.h <<EOF
f88c65f7 8278#define HAVE_AS_GOTOFF_IN_DATA `if test $gcc_cv_as_gotoff_in_data = yes; then echo 1; else echo 0; fi`
093e61a6 8279EOF
f88c65f7 8280
093e61a6 8281 echo "$ac_t""$gcc_cv_as_gotoff_in_data" 1>&6
1cb36a98 8282 ;;
ef1ecf87
RH
8283
8284 ia64*-*-*)
093e61a6 8285 echo $ac_n "checking assembler supports ltoffx and ldxmov""... $ac_c" 1>&6
619833ad 8286echo "configure:8287: checking assembler supports ltoffx and ldxmov" >&5
093e61a6
RS
8287if eval "test \"`echo '$''{'gcc_cv_as_ltoffx_ldxmov_relocs'+set}'`\" = set"; then
8288 echo $ac_n "(cached) $ac_c" 1>&6
ef1ecf87 8289else
093e61a6 8290
ef1ecf87 8291 gcc_cv_as_ltoffx_ldxmov_relocs=unknown
ad9c4d9f
NN
8292 if test $in_tree_gas = yes ; then
8293 if test $gcc_cv_gas_major_version -eq 2 \
8294&& test $gcc_cv_gas_minor_version -ge 14 \
8295|| test $gcc_cv_gas_major_version -gt 2 ; then
8296
8297
8298 gcc_cv_as_ltoffx_ldxmov_relocs=yes
093e61a6 8299
ad9c4d9f
NN
8300
8301fi
8302
ef1ecf87
RH
8303 elif test x$gcc_cv_as != x; then
8304 cat > conftest.s << 'EOF'
8305 .text
8306 addl r15 = @ltoffx(x#), gp
8307 ;;
8308 ld8.mov r16 = [r15], x#
8309EOF
8310 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
8311 gcc_cv_as_ltoffx_ldxmov_relocs=yes
8312 else
8313 gcc_cv_as_ltoffx_ldxmov_relocs=no
8314 fi
8315 rm -f conftest.s conftest.o
8316 fi
093e61a6 8317
cafe096b 8318fi
cafe096b 8319
093e61a6
RS
8320echo "$ac_t""$gcc_cv_as_ltoffx_ldxmov_relocs" 1>&6
8321 if test "x$gcc_cv_as_ltoffx_ldxmov_relocs" = xyes; then
8322 cat >> confdefs.h <<\EOF
ef1ecf87 8323#define HAVE_AS_LTOFFX_LDXMOV_RELOCS 1
093e61a6 8324EOF
ef1ecf87
RH
8325
8326 fi
8327 ;;
1cb36a98 8328esac
53b5ce19 8329
093e61a6 8330echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6
619833ad 8331echo "configure:8332: checking assembler dwarf2 debug_line support" >&5
9d147085
RH
8332gcc_cv_as_dwarf2_debug_line=no
8333# ??? Not all targets support dwarf2 debug_line, even within a version
8334# of gas. Moreover, we need to emit a valid instruction to trigger any
8335# info to the output file. So, as supported targets are added to gas 2.11,
8336# add some instruction here to (also) show we expect this might work.
8337# ??? Once 2.11 is released, probably need to add first known working
8338# version to the per-target configury.
8339case "$target" in
80486e06 8340 i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
2853bc5a
HPN
8341 | x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-* \
8342 | xstormy16*-*-* | cris-*-*)
9d147085
RH
8343 insn="nop"
8344 ;;
8345 ia64*-*-*)
8346 insn="nop 0"
8347 ;;
2853bc5a
HPN
8348 mmix-*-*)
8349 insn="swym 0"
8350 ;;
9d147085 8351 esac
34a86c2b 8352if test $in_tree_gas = yes ; then
ad9c4d9f
NN
8353 if test $gcc_cv_gas_major_version -eq 2 \
8354&& test $gcc_cv_gas_minor_version -ge 11 \
8355|| test $gcc_cv_gas_major_version -gt 2 ; then
8356
8357
8358 if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
8359 && test x"$insn" != x ; then
8360 gcc_cv_as_dwarf2_debug_line="yes"
8361 fi
093e61a6 8362
ad9c4d9f
NN
8363
8364fi
8365
9d147085 8366elif test x$gcc_cv_as != x -a x"$insn" != x ; then
acc187f5
RH
8367 echo ' .file 1 "conftest.s"' > conftest.s
8368 echo ' .loc 1 3 0' >> conftest.s
9d147085 8369 echo " $insn" >> conftest.s
981975b6 8370 # ??? This fails with non-gnu grep.
9d147085
RH
8371 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
8372 && grep debug_line conftest.o > /dev/null 2>&1 ; then
981975b6 8373 # The .debug_line file table must be in the exact order that
eaec9b3d 8374 # we specified the files, since these indices are also used
981975b6
RH
8375 # by DW_AT_decl_file. Approximate this test by testing if
8376 # the assembler bitches if the same index is assigned twice.
8377 echo ' .file 1 "foo.s"' > conftest.s
8378 echo ' .file 1 "bar.s"' >> conftest.s
8379 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1
8380 then
8381 gcc_cv_as_dwarf2_debug_line="no"
8382 else
8383 gcc_cv_as_dwarf2_debug_line="yes"
8384 fi
9d147085
RH
8385 fi
8386 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
8387fi
8388if test x"$gcc_cv_as_dwarf2_debug_line" = xyes; then
093e61a6 8389 cat >> confdefs.h <<\EOF
9d147085 8390#define HAVE_AS_DWARF2_DEBUG_LINE 1
093e61a6 8391EOF
9d147085
RH
8392
8393fi
093e61a6 8394echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
9d147085 8395
093e61a6 8396echo $ac_n "checking assembler --gdwarf2 support""... $ac_c" 1>&6
2853bc5a 8397echo "configure:8398: checking assembler --gdwarf2 support" >&5
5f0e9ea2 8398gcc_cv_as_gdwarf2_flag=no
34a86c2b 8399if test $in_tree_gas = yes ; then
ad9c4d9f
NN
8400 if test $gcc_cv_gas_major_version -eq 2 \
8401&& test $gcc_cv_gas_minor_version -ge 11 \
8402|| test $gcc_cv_gas_major_version -gt 2 ; then
8403
8404
8405 if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
8406 && test x"$insn" != x ; then
8407 gcc_cv_as_gdwarf2_flag="yes"
8408 fi
093e61a6 8409
ad9c4d9f
NN
8410
8411fi
8412
5f0e9ea2
GK
8413elif test x$gcc_cv_as != x -a x"$insn" != x ; then
8414 echo '' > conftest.s
8415 # ??? This fails with non-gnu grep.
8416 if $gcc_cv_as --gdwarf2 -o conftest.o conftest.s > /dev/null 2>&1
8417 then
8418 gcc_cv_as_gdwarf2_flag="yes"
8419 fi
8420 rm -f conftest.s conftest.o
8421fi
8422if test x"$gcc_cv_as_gdwarf2_flag" = xyes; then
093e61a6 8423 cat >> confdefs.h <<\EOF
5f0e9ea2 8424#define HAVE_AS_GDWARF2_DEBUG_FLAG 1
093e61a6 8425EOF
5f0e9ea2
GK
8426
8427fi
093e61a6 8428echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6
5f0e9ea2 8429
093e61a6 8430echo $ac_n "checking assembler --gstabs support""... $ac_c" 1>&6
2853bc5a 8431echo "configure:8432: checking assembler --gstabs support" >&5
5f0e9ea2 8432gcc_cv_as_gstabs_flag=no
34a86c2b 8433if test $in_tree_gas = yes ; then
ad9c4d9f
NN
8434 if test $gcc_cv_gas_major_version -eq 2 \
8435&& test $gcc_cv_gas_minor_version -ge 11 \
8436|| test $gcc_cv_gas_major_version -gt 2 ; then
8437
8438
8439 if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
8440 && test x"$insn" != x ; then
8441 gcc_cv_as_gstabs_flag="yes"
8442 fi
093e61a6 8443
ad9c4d9f
NN
8444
8445fi
8446
5f0e9ea2
GK
8447elif test x$gcc_cv_as != x -a x"$insn" != x ; then
8448 echo '' > conftest.s
8449 # ??? This fails with non-gnu grep.
8450 if $gcc_cv_as --gstabs -o conftest.o conftest.s > /dev/null 2>&1 ; then
8451 gcc_cv_as_gstabs_flag="yes"
8452 fi
8453 rm -f conftest.s conftest.o
8454fi
8455if test x"$gcc_cv_as_gstabs_flag" = xyes; then
093e61a6 8456 cat >> confdefs.h <<\EOF
5f0e9ea2 8457#define HAVE_AS_GSTABS_DEBUG_FLAG 1
093e61a6 8458EOF
5f0e9ea2
GK
8459
8460fi
093e61a6 8461echo "$ac_t""$gcc_cv_as_gstabs_flag" 1>&6
5f0e9ea2 8462
093e61a6 8463echo $ac_n "checking linker read-only and read-write section mixing""... $ac_c" 1>&6
2853bc5a 8464echo "configure:8465: checking linker read-only and read-write section mixing" >&5
96d0f4dc 8465gcc_cv_ld_ro_rw_mix=unknown
34a86c2b 8466if test $in_tree_ld = yes ; then
96d0f4dc
JJ
8467 if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
8468 gcc_cv_ld_ro_rw_mix=read-write
8469 fi
8470elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then
90e145da
KC
8471 echo '.section myfoosect, "a"' > conftest1.s
8472 echo '.section myfoosect, "aw"' > conftest2.s
96d0f4dc 8473 echo '.byte 1' >> conftest2.s
90e145da 8474 echo '.section myfoosect, "a"' > conftest3.s
96d0f4dc 8475 echo '.byte 0' >> conftest3.s
6cd656d0
KC
8476 if $gcc_cv_as -o conftest1.o conftest1.s > /dev/null 2>&1 \
8477 && $gcc_cv_as -o conftest2.o conftest2.s > /dev/null 2>&1 \
8478 && $gcc_cv_as -o conftest3.o conftest3.s > /dev/null 2>&1 \
96d0f4dc 8479 && $gcc_cv_ld -shared -o conftest1.so conftest1.o \
c6cc7e13 8480 conftest2.o conftest3.o > /dev/null 2>&1; then
96d0f4dc 8481 gcc_cv_ld_ro_rw_mix=`$gcc_cv_objdump -h conftest1.so \
c6cc7e13 8482 | sed -e '/myfoosect/!d' -e N`
96d0f4dc
JJ
8483 if echo "$gcc_cv_ld_ro_rw_mix" | grep CONTENTS > /dev/null; then
8484 if echo "$gcc_cv_ld_ro_rw_mix" | grep READONLY > /dev/null; then
8485 gcc_cv_ld_ro_rw_mix=read-only
8486 else
8487 gcc_cv_ld_ro_rw_mix=read-write
8488 fi
8489 fi
8490 fi
8491 rm -f conftest.* conftest[123].*
8492fi
8493if test x$gcc_cv_ld_ro_rw_mix = xread-write; then
093e61a6 8494 cat >> confdefs.h <<\EOF
96d0f4dc 8495#define HAVE_LD_RO_RW_SECTION_MIXING 1
093e61a6 8496EOF
96d0f4dc
JJ
8497
8498fi
093e61a6 8499echo "$ac_t""$gcc_cv_ld_ro_rw_mix" 1>&6
96d0f4dc 8500
093e61a6 8501echo $ac_n "checking linker PT_GNU_EH_FRAME support""... $ac_c" 1>&6
2853bc5a 8502echo "configure:8503: checking linker PT_GNU_EH_FRAME support" >&5
275b60d6 8503gcc_cv_ld_eh_frame_hdr=no
34a86c2b 8504if test $in_tree_ld = yes ; then
275b60d6
JJ
8505 if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
8506 gcc_cv_ld_eh_frame_hdr=yes
8507 fi
8508elif test x$gcc_cv_ld != x; then
8509 # Check if linker supports --eh-frame-hdr option
8510 if $gcc_cv_ld --help 2>/dev/null | grep eh-frame-hdr > /dev/null; then
8511 gcc_cv_ld_eh_frame_hdr=yes
8512 fi
8513fi
8514if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
093e61a6 8515 cat >> confdefs.h <<\EOF
275b60d6 8516#define HAVE_LD_EH_FRAME_HDR 1
093e61a6 8517EOF
275b60d6
JJ
8518
8519fi
093e61a6 8520echo "$ac_t""$gcc_cv_ld_eh_frame_hdr" 1>&6
275b60d6 8521
24a4dd31 8522echo $ac_n "checking linker position independent executable support""... $ac_c" 1>&6
2853bc5a 8523echo "configure:8524: checking linker position independent executable support" >&5
24a4dd31
JJ
8524gcc_cv_ld_pie=no
8525if test $in_tree_ld = yes ; then
8526 if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 15 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
8527 gcc_cv_ld_pie=yes
8528 fi
8529elif test x$gcc_cv_ld != x; then
8530 # Check if linker supports -pie option
8531 if $gcc_cv_ld --help 2>/dev/null | grep -- -pie > /dev/null; then
8532 gcc_cv_ld_pie=yes
8533 fi
8534fi
8535if test x"$gcc_cv_ld_pie" = xyes; then
8536 cat >> confdefs.h <<\EOF
8537#define HAVE_LD_PIE 1
8538EOF
8539
8540fi
8541echo "$ac_t""$gcc_cv_ld_pie" 1>&6
8542
4357a6c3
CD
8543# Miscellaneous target-specific checks.
8544case "$target" in
8545 mips*-*-*)
093e61a6 8546 echo $ac_n "checking whether libgloss uses STARTUP directives consistently""... $ac_c" 1>&6
2853bc5a 8547echo "configure:8548: checking whether libgloss uses STARTUP directives consistently" >&5
4357a6c3
CD
8548 gcc_cv_mips_libgloss_startup=no
8549 gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss
8550 if test "x$exec_prefix" = xNONE; then
8551 if test "x$prefix" = xNONE; then
8552 test_prefix=/usr/local
8553 else
8554 test_prefix=$prefix
8555 fi
8556 else
8557 test_prefix=$exec_prefix
8558 fi
8559 for f in $gcc_cv_libgloss_srcdir/mips/idt.ld $test_prefix/$target_alias/lib/idt.ld
8560 do
8561 if grep '^STARTUP' $f > /dev/null 2>&1; then
8562 gcc_cv_mips_libgloss_startup=yes
8563 break
8564 fi
8565 done
8566 if test x"$gcc_cv_mips_libgloss_startup" = xyes; then
093e61a6 8567 cat >> confdefs.h <<\EOF
4357a6c3 8568#define HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES 1
093e61a6 8569EOF
4357a6c3
CD
8570
8571 fi
093e61a6 8572 echo "$ac_t""$gcc_cv_mips_libgloss_startup" 1>&6
cafe096b 8573
093e61a6 8574 echo $ac_n "checking whether the assembler has explicit relocation support""... $ac_c" 1>&6
2853bc5a 8575echo "configure:8576: checking whether the assembler has explicit relocation support" >&5
cafe096b
EC
8576 if test x$gcc_cv_mips_explicit_relocs = x; then
8577 gcc_cv_mips_explicit_relocs=no
4665e56c 8578 if test $in_tree_gas = yes; then
4dd03b27
RS
8579 if test $gcc_cv_gas_major_version -eq 2 \
8580&& test $gcc_cv_gas_minor_version -ge 14 \
8581|| test $gcc_cv_gas_major_version -gt 2 ; then
8582
8583
8584 gcc_cv_mips_explicit_relocs=yes
8585
8586
8587fi
8588
8589 elif test x$gcc_cv_as != x; then
cafe096b
EC
8590 echo ' lw $4,%gp_rel(foo)($4)' > conftest.s
8591 if $gcc_cv_as conftest.s -o conftest.o > /dev/null 2>&1; then
8592 gcc_cv_mips_explicit_relocs=yes
8593 fi
8594 rm -f conftest.s conftest.o
8595 fi
8596 fi
8597 if test $gcc_cv_mips_explicit_relocs = yes; then
8598 test x$target_cpu_default != x || target_cpu_default=0
8599 target_cpu_default="(${target_cpu_default}|MASK_EXPLICIT_RELOCS)"
8600 fi
093e61a6 8601 echo "$ac_t""$gcc_cv_mips_explicit_relocs" 1>&6
4357a6c3
CD
8602 ;;
8603esac
8604
9fb28a67 8605if test x$with_sysroot = x && test x$host = x$target \
047d636f 8606 && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then
093e61a6 8607 cat >> confdefs.h <<EOF
793e9558 8608#define PREFIX_INCLUDE_DIR "$prefix/include"
093e61a6 8609EOF
793e9558
PB
8610
8611fi
8612
861bb6c1 8613# Figure out what language subdirectories are present.
71205e0b
MH
8614# Look if the user specified --enable-languages="..."; if not, use
8615# the environment variable $LANGUAGES if defined. $LANGUAGES might
8616# go away some day.
cc9a08e0 8617# NB: embedded tabs in this IF block -- do not untabify
71205e0b
MH
8618if test x"${enable_languages+set}" != xset; then
8619 if test x"${LANGUAGES+set}" = xset; then
cc9a08e0 8620 enable_languages="${LANGUAGES}"
093e61a6 8621 echo "configure: warning: setting LANGUAGES is deprecated, use --enable-languages instead" 1>&2
cc9a08e0 8622
71205e0b
MH
8623 else
8624 enable_languages=all
8625 fi
d6c6b553 8626else
015089dd
TJ
8627 if test x"${enable_languages}" = x \
8628 || test x"${enable_languages}" = xyes;
cc9a08e0 8629 then
093e61a6 8630 { echo "configure: error: --enable-languages needs at least one language argument" 1>&2; exit 1; }
d6c6b553 8631 fi
71205e0b 8632fi
cc9a08e0 8633enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'`
75382c6d
TT
8634
8635# First scan to see if an enabled language requires some other language.
8636# We assume that a given config-lang.in will list all the language
8637# front ends it requires, even if some are required indirectly.
8638for lang in ${srcdir}/*/config-lang.in ..
8639do
8640 case $lang in
8641 ..)
8642 ;;
8643 # The odd quoting in the next line works around
8644 # an apparent bug in bash 1.12 on linux.
8645 ${srcdir}/[*]/config-lang.in)
8646 ;;
8647 *)
8648 lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
8649 this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang`
8650 for other in $this_lang_requires
8651 do
8652 case ,${enable_languages}, in
8653 *,$other,*)
8654 ;;
8655 *,all,*)
8656 ;;
1bf17cc4 8657 *,$lang_alias,*)
75382c6d
TT
8658 enable_languages="$enable_languages,$other"
8659 ;;
8660 esac
8661 done
8662 ;;
8663 esac
8664done
8665
015089dd
TJ
8666expected_languages=`echo ,${enable_languages}, | sed -e 's:,: :g' -e 's: *: :g' -e 's: *: :g' -e 's:^ ::' -e 's: $::'`
8667found_languages=
861bb6c1
JL
8668subdirs=
8669for lang in ${srcdir}/*/config-lang.in ..
8670do
8671 case $lang in
8672 ..) ;;
8673 # The odd quoting in the next line works around
8674 # an apparent bug in bash 1.12 on linux.
8675 ${srcdir}/[*]/config-lang.in) ;;
71205e0b
MH
8676 *)
8677 lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
2b60b2cb
AO
8678 this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang`
8679 build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang`
71205e0b
MH
8680 if test "x$lang_alias" = x
8681 then
8682 echo "$lang doesn't set \$language." 1>&2
8683 exit 1
8684 fi
2b60b2cb
AO
8685 case ${build_by_default},${enable_languages}, in
8686 *,$lang_alias,*) add_this_lang=yes ;;
8687 no,*) add_this_lang=no ;;
8688 *,all,*) add_this_lang=yes ;;
8689 *) add_this_lang=no ;;
8690 esac
015089dd 8691 found_languages="${found_languages} ${lang_alias}"
71205e0b
MH
8692 if test x"${add_this_lang}" = xyes; then
8693 case $lang in
8694 ${srcdir}/ada/config-lang.in)
1ffc5c6e 8695 if test x$have_gnat = xyes ; then
71205e0b
MH
8696 subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
8697 fi
8698 ;;
8699 *)
8700 subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
8701 ;;
8702 esac
8703 fi
8704 ;;
861bb6c1
JL
8705 esac
8706done
8707
015089dd
TJ
8708missing_languages=
8709for expected_language in ${expected_languages} ..
093e61a6 8710do
015089dd
TJ
8711 if test "${expected_language}" != ..; then
8712 missing_language="${expected_language}"
8713 if test "${expected_language}" = "c" \
8714 || test "${expected_language}" = "all"; then
8715 missing_language=
8716 fi
8717 for found_language in ${found_languages} ..
093e61a6 8718 do
015089dd
TJ
8719 if test "${found_language}" != ..; then
8720 if test "${expected_language}" = "${found_language}"; then
8721 missing_language=
8722 fi
8723 fi
8724 done
8725 if test "x${missing_language}" != x; then
8726 missing_languages="${missing_languages} ${missing_language}"
8727 fi
8728 fi
8729done
8730
8731if test "x$missing_languages" != x; then
093e61a6 8732 { echo "configure: error:
015089dd 8733The following requested languages were not found:${missing_languages}
093e61a6 8734The following languages were available: c${found_languages}" 1>&2; exit 1; }
02ef40d9
TJ
8735fi
8736
f24af81b
TT
8737# Make gthr-default.h if we have a thread file.
8738gthread_flags=
75bffa71 8739if test $thread_file != single; then
f24af81b 8740 rm -f gthr-default.h
db0d1ed9 8741 echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h
f24af81b
TT
8742 gthread_flags=-DHAVE_GTHR_DEFAULT
8743fi
8744
8745
81bf3d9e
RH
8746# Find out what GC implementation we want, or may, use.
8747# Check whether --with-gc or --without-gc was given.
8748if test "${with_gc+set}" = set; then
8749 withval="$with_gc"
8750 case "$withval" in
8751 simple | page)
8752 GGC=ggc-$withval
8753 ;;
8754 *)
093e61a6 8755 { echo "configure: error: $withval is an invalid option to --with-gc" 1>&2; exit 1; }
81bf3d9e
RH
8756 ;;
8757esac
8758else
005537df 8759 GGC=ggc-page
093e61a6
RS
8760fi
8761
81bf3d9e
RH
8762
8763echo "Using $GGC for garbage collection."
8764
3c809ba4 8765# Use the system's zlib library.
b8dad04b
ZW
8766zlibdir=-L../zlib
8767zlibinc="-I\$(srcdir)/../zlib"
3c809ba4
AG
8768# Check whether --with-system-zlib or --without-system-zlib was given.
8769if test "${with_system_zlib+set}" = set; then
8770 withval="$with_system_zlib"
8771 zlibdir=
8772zlibinc=
8773
093e61a6
RS
8774fi
8775
3c809ba4
AG
8776
8777
8778
dc6746e7 8779
093e61a6 8780echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
2853bc5a 8781echo "configure:8782: checking whether to enable maintainer-specific portions of Makefiles" >&5
dc6746e7
PT
8782 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
8783if test "${enable_maintainer_mode+set}" = set; then
8784 enableval="$enable_maintainer_mode"
8785 maintainer_mode=$enableval
8786else
8787 maintainer_mode=no
093e61a6
RS
8788fi
8789
dc6746e7 8790
093e61a6 8791echo "$ac_t""$maintainer_mode" 1>&6
dc6746e7
PT
8792
8793if test "$maintainer_mode" = "yes"; then
8794 MAINT=''
8795else
8796 MAINT='#'
8797fi
8798
861bb6c1
JL
8799# Make empty files to contain the specs and options for each language.
8800# Then add #include lines to for a compiler that has specs and/or options.
8801
8802lang_specs_files=
8803lang_options_files=
3103b7db 8804lang_tree_files=
861bb6c1
JL
8805for subdir in . $subdirs
8806do
75bffa71 8807 if test -f $srcdir/$subdir/lang-specs.h; then
0d24f4d1 8808 lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
861bb6c1 8809 fi
75bffa71 8810 if test -f $srcdir/$subdir/lang-options.h; then
0d24f4d1 8811 lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
861bb6c1 8812 fi
3103b7db 8813 if test -f $srcdir/$subdir/$subdir-tree.def; then
0d24f4d1 8814 lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def"
3103b7db 8815 fi
861bb6c1
JL
8816done
8817
8818# These (without "all_") are set in each config-lang.in.
8819# `language' must be a single word so is spelled singularly.
8820all_languages=
8821all_boot_languages=
8822all_compilers=
8823all_stagestuff=
e34a3d31 8824all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc mkheaders'
861bb6c1
JL
8825# List of language makefile fragments.
8826all_lang_makefiles=
e2500fed 8827# Files for gengtype
ef69da62 8828all_gtfiles="$target_gtfiles"
8ac9d31f
TJ
8829# Files for gengtype with language
8830all_gtfiles_files_langs=
8831all_gtfiles_files_files=
861bb6c1
JL
8832
8833# Add the language fragments.
8834# Languages are added via two mechanisms. Some information must be
8835# recorded in makefile variables, these are defined in config-lang.in.
8836# We accumulate them and plug them into the main Makefile.
8837# The other mechanism is a set of hooks for each of the main targets
8838# like `clean', `install', etc.
8839
8840language_fragments="Make-lang"
8841language_hooks="Make-hooks"
861bb6c1
JL
8842
8843for s in .. $subdirs
8844do
75bffa71 8845 if test $s != ".."
861bb6c1
JL
8846 then
8847 language=
8848 boot_language=
8849 compilers=
8850 stagestuff=
861bb6c1 8851 outputs=
e2500fed 8852 gtfiles=
861bb6c1 8853 . ${srcdir}/$s/config-lang.in
75bffa71 8854 if test "x$language" = x
861bb6c1
JL
8855 then
8856 echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2
8857 exit 1
8858 fi
72aaffbd
ZW
8859 all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Make-lang.in"
8860 if test -f ${srcdir}/$s/Makefile.in
8861 then all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Makefile.in"
8862 fi
861bb6c1 8863 all_languages="$all_languages $language"
75bffa71 8864 if test "x$boot_language" = xyes
861bb6c1
JL
8865 then
8866 all_boot_languages="$all_boot_languages $language"
8867 fi
8868 all_compilers="$all_compilers $compilers"
8869 all_stagestuff="$all_stagestuff $stagestuff"
861bb6c1 8870 all_outputs="$all_outputs $outputs"
e2500fed 8871 all_gtfiles="$all_gtfiles $gtfiles"
8ac9d31f
TJ
8872 for f in .. $gtfiles
8873 do
8874 if test $f != ".."
8875 then
8876 all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} "
8877 all_gtfiles_files_files="$all_gtfiles_files_files ${f} "
8878 fi
8879 done
861bb6c1
JL
8880 fi
8881done
8882
8ac9d31f
TJ
8883# Pick up gtfiles for c
8884gtfiles=
8885s="c"
8886. ${srcdir}/c-config-lang.in
8887all_gtfiles="$all_gtfiles $gtfiles"
8888for f in .. $gtfiles
8889do
8890 if test $f != ".."
8891 then
8892 all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} "
8893 all_gtfiles_files_files="$all_gtfiles_files_files ${f} "
8894 fi
8895done
8896
cbc59f01
DD
8897check_languages=
8898for language in .. $all_languages
8899do
8900 if test $language != ".."
8901 then
8902 check_languages="$check_languages check-$language"
8903 fi
8904done
8905
861bb6c1
JL
8906# Since we can't use `::' targets, we link each language in
8907# with a set of hooks, reached indirectly via lang.${target}.
8908
8909rm -f Make-hooks
8910touch Make-hooks
65ebbf81 8911target_list="all.build all.cross start.encap rest.encap tags \
d3945f0a 8912 info dvi generated-manpages \
861bb6c1 8913 install-normal install-common install-info install-man \
436a88a6 8914 uninstall \
861bb6c1 8915 mostlyclean clean distclean extraclean maintainer-clean \
8f231b5d 8916 stage1 stage2 stage3 stage4 stageprofile stagefeedback"
861bb6c1
JL
8917for t in $target_list
8918do
8919 x=
ab87f8c8 8920 for lang in .. $all_languages
861bb6c1 8921 do
ab87f8c8
JL
8922 if test $lang != ".."; then
8923 x="$x $lang.$t"
861bb6c1
JL
8924 fi
8925 done
8926 echo "lang.$t: $x" >> Make-hooks
8927done
8928
cc06d68c 8929# Create .gdbinit.
861bb6c1 8930
cc06d68c
GP
8931echo "dir ." > .gdbinit
8932echo "dir ${srcdir}" >> .gdbinit
8933if test x$gdb_needs_out_file_path = xyes
8934then
8935 echo "dir ${srcdir}/config/"`dirname ${out_file}` >> .gdbinit
8936fi
8937if test "x$subdirs" != x; then
8938 for s in $subdirs
8939 do
8940 echo "dir ${srcdir}/$s" >> .gdbinit
8941 done
861bb6c1 8942fi
cc06d68c 8943echo "source ${srcdir}/gdbinit.in" >> .gdbinit
861bb6c1 8944
8f8d3278
NC
8945# If $(exec_prefix) exists and is not the same as $(prefix), then compute an
8946# absolute path for gcc_tooldir based on inserting the number of up-directory
8947# movements required to get from $(exec_prefix) to $(prefix) into the basic
8948# $(libsubdir)/@(unlibsubdir) based path.
82cbf8f7
JL
8949# Don't set gcc_tooldir to tooldir since that's only passed in by the toplevel
8950# make and thus we'd get different behavior depending on where we built the
8951# sources.
5949a9fc 8952if test x$exec_prefix = xNONE -o x$exec_prefix = x$prefix; then
d062c304
JL
8953 gcc_tooldir='$(libsubdir)/$(unlibsubdir)/../$(target_alias)'
8954else
8f8d3278
NC
8955# An explanation of the sed strings:
8956# -e 's|^\$(prefix)||' matches and eliminates 'prefix' from 'exec_prefix'
8957# -e 's|/$||' match a trailing forward slash and eliminates it
8958# -e 's|^[^/]|/|' forces the string to start with a forward slash (*)
ff7cc307 8959# -e 's|/[^/]*|../|g' replaces each occurrence of /<directory> with ../
8f8d3278
NC
8960#
8961# (*) Note this pattern overwrites the first character of the string
8962# with a forward slash if one is not already present. This is not a
8963# problem because the exact names of the sub-directories concerned is
8964# unimportant, just the number of them matters.
8965#
8966# The practical upshot of these patterns is like this:
8967#
8968# prefix exec_prefix result
8969# ------ ----------- ------
8970# /foo /foo/bar ../
8971# /foo/ /foo/bar ../
8972# /foo /foo/bar/ ../
8973# /foo/ /foo/bar/ ../
8974# /foo /foo/bar/ugg ../../
8975#
4c112cda
NC
8976 dollar='$$'
8977 gcc_tooldir="\$(libsubdir)/\$(unlibsubdir)/\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/\$(dollar)||' -e 's|^[^/]|/|' -e 's|/[^/]*|../|g'\`\$(target_alias)"
d062c304
JL
8978fi
8979
8980
2ce3c6c6 8981
2bbea3a6
RH
8982# Find a directory in which to install a shared libgcc.
8983
8984# Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given.
8985if test "${enable_version_specific_runtime_libs+set}" = set; then
8986 enableval="$enable_version_specific_runtime_libs"
093e61a6
RS
8987 :
8988fi
2bbea3a6
RH
8989
8990
5b15f277
RH
8991# Check whether --with-slibdir or --without-slibdir was given.
8992if test "${with_slibdir+set}" = set; then
8993 withval="$with_slibdir"
8994 slibdir="$with_slibdir"
8995else
8996 if test "${enable_version_specific_runtime_libs+set}" = set; then
2bbea3a6 8997 slibdir='$(libsubdir)'
5b15f277 8998elif test "$host" != "$target"; then
2bbea3a6
RH
8999 slibdir='$(build_tooldir)/lib'
9000else
5b15f277 9001 slibdir='$(libdir)'
2bbea3a6 9002fi
093e61a6
RS
9003fi
9004
2bbea3a6
RH
9005
9006
1e6347d8 9007objdir=`${PWDCMD-pwd}`
7e717196
JL
9008
9009
861bb6c1
JL
9010# Process the language and host/target makefile fragments.
9011${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xmake_file" "$dep_tmake_file"
9012
9013# Substitute configuration variables
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9b16d2c4 9060
e9a25f70 9061
6e26218f 9062
c8724862 9063
e061d1ce 9064
d8bb17c8 9065
11642c3a
ZW
9066
9067
9068
9069
9070
9071
9072
3d9d2476 9073
596151e1 9074
8ac9d31f
TJ
9075
9076
9077
e2500fed 9078
d5355cb2 9079
476d9098 9080
861bb6c1
JL
9081
9082
9083# Echo that links are built
75bffa71 9084if test x$host = x$target
861bb6c1
JL
9085then
9086 str1="native "
9087else
9088 str1="cross-"
9089 str2=" from $host"
9090fi
9091
75bffa71 9092if test x$host != x$build
861bb6c1
JL
9093then
9094 str3=" on a $build system"
9095fi
9096
75bffa71 9097if test "x$str2" != x || test "x$str3" != x
861bb6c1
JL
9098then
9099 str4=
9100fi
9101
9102echo "Links are now set up to build a ${str1}compiler for ${target}$str4" 1>&2
9103
75bffa71 9104if test "x$str2" != x || test "x$str3" != x
861bb6c1
JL
9105then
9106 echo " ${str2}${str3}." 1>&2
9107fi
9108
9109# Configure the subdirectories
9110# AC_CONFIG_SUBDIRS($subdirs)
9111
9112# Create the Makefile
9113# and configure language subdirectories
093e61a6
RS
9114trap '' 1 2 15
9115cat > confcache <<\EOF
861bb6c1
JL
9116# This file is a shell script that caches the results of configure
9117# tests run on this system so they can be shared between configure
093e61a6
RS
9118# scripts and configure runs. It is not useful on other systems.
9119# If it contains results you don't want to keep, you may remove or edit it.
861bb6c1 9120#
093e61a6
RS
9121# By default, configure uses ./config.cache as the cache file,
9122# creating it if it does not exist already. You can give configure
9123# the --cache-file=FILE option to use a different cache file; that is
9124# what configure does when it calls configure scripts in
9125# subdirectories, so they share the cache.
9126# Giving --cache-file=/dev/null disables caching, for debugging configure.
9127# config.status only pays attention to the cache file if you give it the
9128# --recheck option to rerun configure.
861bb6c1 9129#
093e61a6 9130EOF
861bb6c1
JL
9131# The following way of writing the cache mishandles newlines in values,
9132# but we know of no workaround that is simple, portable, and efficient.
9133# So, don't put newlines in cache variables' values.
9134# Ultrix sh set writes to stderr and can't be redirected directly,
9135# and sets the high bit in the cache file unless we assign to the vars.
093e61a6
RS
9136(set) 2>&1 |
9137 case `(ac_space=' '; set | grep ac_space) 2>&1` in
9138 *ac_space=\ *)
9139 # `set' does not quote correctly, so add quotes (double-quote substitution
9140 # turns \\\\ into \\, and sed turns \\ into \).
9141 sed -n \
9142 -e "s/'/'\\\\''/g" \
9143 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
9144 ;;
9145 *)
9146 # `set' quotes correctly as required by POSIX, so do not add quotes.
9147 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
9148 ;;
9149 esac >> confcache
9150if cmp -s $cache_file confcache; then
9151 :
9152else
861bb6c1 9153 if test -w $cache_file; then
093e61a6
RS
9154 echo "updating cache $cache_file"
9155 cat confcache > $cache_file
861bb6c1
JL
9156 else
9157 echo "not updating unwritable cache $cache_file"
9158 fi
9159fi
9160rm -f confcache
9161
093e61a6
RS
9162trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
9163
861bb6c1
JL
9164test "x$prefix" = xNONE && prefix=$ac_default_prefix
9165# Let make expand exec_prefix.
9166test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
9167
093e61a6
RS
9168# Any assignment to VPATH causes Sun make to only execute
9169# the first set of double-colon rules, so remove it if not needed.
9170# If there is a colon in the path, we need to keep it.
861bb6c1 9171if test "x$srcdir" = x.; then
093e61a6 9172 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
861bb6c1
JL
9173fi
9174
093e61a6 9175trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
cafe096b 9176
093e61a6 9177DEFS=-DHAVE_CONFIG_H
cafe096b 9178
093e61a6 9179# Without the "./", some shells look in PATH for config.status.
cafe096b 9180: ${CONFIG_STATUS=./config.status}
cafe096b 9181
093e61a6
RS
9182echo creating $CONFIG_STATUS
9183rm -f $CONFIG_STATUS
9184cat > $CONFIG_STATUS <<EOF
9185#! /bin/sh
9186# Generated automatically by configure.
9187# Run this file to recreate the current configuration.
9188# This directory was configured as follows,
9189# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
cafe096b 9190#
093e61a6 9191# $0 $ac_configure_args
cafe096b 9192#
093e61a6
RS
9193# Compiler output produced by configure, useful for debugging
9194# configure, is in ./config.log if it exists.
cafe096b 9195
093e61a6
RS
9196ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
9197for ac_option
cafe096b 9198do
093e61a6
RS
9199 case "\$ac_option" in
9200 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
9201 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
9202 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
9203 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
9204 echo "$CONFIG_STATUS generated by autoconf version 2.13"
9205 exit 0 ;;
9206 -help | --help | --hel | --he | --h)
9207 echo "\$ac_cs_usage"; exit 0 ;;
9208 *) echo "\$ac_cs_usage"; exit 1 ;;
cafe096b
EC
9209 esac
9210done
9211
093e61a6 9212ac_given_srcdir=$srcdir
cafe096b 9213
093e61a6
RS
9214trap 'rm -fr `echo "$all_outputs auto-host.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
9215EOF
9216cat >> $CONFIG_STATUS <<EOF
cafe096b 9217
093e61a6
RS
9218# Protect against being on the right side of a sed subst in config.status.
9219sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
9220 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
9221$ac_vpsub
9222$extrasub
9223s%@SHELL@%$SHELL%g
9224s%@CFLAGS@%$CFLAGS%g
9225s%@CPPFLAGS@%$CPPFLAGS%g
9226s%@CXXFLAGS@%$CXXFLAGS%g
9227s%@FFLAGS@%$FFLAGS%g
9228s%@DEFS@%$DEFS%g
9229s%@LDFLAGS@%$LDFLAGS%g
9230s%@LIBS@%$LIBS%g
9231s%@exec_prefix@%$exec_prefix%g
9232s%@prefix@%$prefix%g
9233s%@program_transform_name@%$program_transform_name%g
9234s%@bindir@%$bindir%g
9235s%@sbindir@%$sbindir%g
9236s%@libexecdir@%$libexecdir%g
9237s%@datadir@%$datadir%g
9238s%@sysconfdir@%$sysconfdir%g
9239s%@sharedstatedir@%$sharedstatedir%g
9240s%@localstatedir@%$localstatedir%g
9241s%@libdir@%$libdir%g
9242s%@includedir@%$includedir%g
9243s%@oldincludedir@%$oldincludedir%g
9244s%@infodir@%$infodir%g
9245s%@mandir@%$mandir%g
9246s%@host@%$host%g
9247s%@host_alias@%$host_alias%g
9248s%@host_cpu@%$host_cpu%g
9249s%@host_vendor@%$host_vendor%g
9250s%@host_os@%$host_os%g
9251s%@target@%$target%g
9252s%@target_alias@%$target_alias%g
9253s%@target_cpu@%$target_cpu%g
9254s%@target_vendor@%$target_vendor%g
9255s%@target_os@%$target_os%g
9256s%@build@%$build%g
9257s%@build_alias@%$build_alias%g
9258s%@build_cpu@%$build_cpu%g
9259s%@build_vendor@%$build_vendor%g
9260s%@build_os@%$build_os%g
4665e56c
NN
9261s%@build_subdir@%$build_subdir%g
9262s%@host_subdir@%$host_subdir%g
093e61a6
RS
9263s%@target_subdir@%$target_subdir%g
9264s%@CC@%$CC%g
9265s%@NO_MINUS_C_MINUS_O@%$NO_MINUS_C_MINUS_O%g
9266s%@OUTPUT_OPTION@%$OUTPUT_OPTION%g
9267s%@CPP@%$CPP%g
9268s%@GNATBIND@%$GNATBIND%g
9269s%@ADAC@%$ADAC%g
9270s%@strict1_warn@%$strict1_warn%g
9271s%@warn_cflags@%$warn_cflags%g
9272s%@WERROR@%$WERROR%g
9273s%@nocommon_flag@%$nocommon_flag%g
9274s%@valgrind_path@%$valgrind_path%g
9275s%@valgrind_path_defines@%$valgrind_path_defines%g
9276s%@valgrind_command@%$valgrind_command%g
9277s%@coverage_flags@%$coverage_flags%g
9278s%@enable_multilib@%$enable_multilib%g
9279s%@enable_shared@%$enable_shared%g
9280s%@TARGET_SYSTEM_ROOT@%$TARGET_SYSTEM_ROOT%g
9281s%@TARGET_SYSTEM_ROOT_DEFINE@%$TARGET_SYSTEM_ROOT_DEFINE%g
9282s%@CROSS_SYSTEM_HEADER_DIR@%$CROSS_SYSTEM_HEADER_DIR%g
9283s%@SET_MAKE@%$SET_MAKE%g
9284s%@AWK@%$AWK%g
9285s%@LN@%$LN%g
9286s%@LN_S@%$LN_S%g
9287s%@RANLIB@%$RANLIB%g
9288s%@INSTALL@%$INSTALL%g
9289s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
9290s%@INSTALL_DATA@%$INSTALL_DATA%g
9291s%@have_mktemp_command@%$have_mktemp_command%g
9292s%@MAKEINFO@%$MAKEINFO%g
9293s%@BUILD_INFO@%$BUILD_INFO%g
9294s%@GENERATED_MANPAGES@%$GENERATED_MANPAGES%g
9295s%@make_compare_target@%$make_compare_target%g
9296s%@FLEX@%$FLEX%g
9297s%@BISON@%$BISON%g
9298s%@stage1_cflags@%$stage1_cflags%g
9299s%@COLLECT2_LIBS@%$COLLECT2_LIBS%g
9300s%@GNAT_LIBEXC@%$GNAT_LIBEXC%g
9301s%@LDEXP_LIB@%$LDEXP_LIB%g
9302s%@TARGET_GETGROUPS_T@%$TARGET_GETGROUPS_T%g
9303s%@LIBICONV@%$LIBICONV%g
9304s%@manext@%$manext%g
9305s%@objext@%$objext%g
9306s%@extra_modes_file@%$extra_modes_file%g
9307s%@FORBUILD@%$FORBUILD%g
9308s%@PACKAGE@%$PACKAGE%g
9309s%@VERSION@%$VERSION%g
9310s%@ALLOCA@%$ALLOCA%g
9311s%@GLIBC21@%$GLIBC21%g
9312s%@USE_NLS@%$USE_NLS%g
9313s%@MSGFMT@%$MSGFMT%g
9314s%@GMSGFMT@%$GMSGFMT%g
9315s%@XGETTEXT@%$XGETTEXT%g
9316s%@INTLBISON@%$INTLBISON%g
9317s%@BUILD_INCLUDED_LIBINTL@%$BUILD_INCLUDED_LIBINTL%g
9318s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
9319s%@CATALOGS@%$CATALOGS%g
9320s%@CATOBJEXT@%$CATOBJEXT%g
9321s%@INTLLIBS@%$INTLLIBS%g
9322s%@INTLDEPS@%$INTLDEPS%g
9323s%@INTLOBJS@%$INTLOBJS%g
9324s%@POSUB@%$POSUB%g
9325s%@DATADIRNAME@%$DATADIRNAME%g
9326s%@INSTOBJEXT@%$INSTOBJEXT%g
9327s%@GENCAT@%$GENCAT%g
9328s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
9329s%@INTL_LIBTOOL_SUFFIX_PREFIX@%$INTL_LIBTOOL_SUFFIX_PREFIX%g
9330s%@CROSS@%$CROSS%g
9331s%@ALL@%$ALL%g
9332s%@SYSTEM_HEADER_DIR@%$SYSTEM_HEADER_DIR%g
9333s%@inhibit_libc@%$inhibit_libc%g
9334s%@BUILD_PREFIX@%$BUILD_PREFIX%g
9335s%@BUILD_PREFIX_1@%$BUILD_PREFIX_1%g
9336s%@BUILD_CC@%$BUILD_CC%g
9337s%@BUILD_CFLAGS@%$BUILD_CFLAGS%g
9338s%@STMP_FIXINC@%$STMP_FIXINC%g
9339s%@STMP_FIXPROTO@%$STMP_FIXPROTO%g
9340s%@libgcc_visibility@%$libgcc_visibility%g
9341s%@gthread_flags@%$gthread_flags%g
9342s%@GGC@%$GGC%g
9343s%@zlibdir@%$zlibdir%g
9344s%@zlibinc@%$zlibinc%g
9345s%@MAINT@%$MAINT%g
9346s%@gcc_tooldir@%$gcc_tooldir%g
9347s%@dollar@%$dollar%g
9348s%@slibdir@%$slibdir%g
9349s%@objdir@%$objdir%g
9350s%@subdirs@%$subdirs%g
9351s%@srcdir@%$srcdir%g
9352s%@all_boot_languages@%$all_boot_languages%g
9353s%@all_compilers@%$all_compilers%g
9354s%@all_gtfiles@%$all_gtfiles%g
9355s%@all_gtfiles_files_langs@%$all_gtfiles_files_langs%g
9356s%@all_gtfiles_files_files@%$all_gtfiles_files_files%g
9357s%@all_lang_makefiles@%$all_lang_makefiles%g
9358s%@all_languages@%$all_languages%g
9359s%@all_stagestuff@%$all_stagestuff%g
9360s%@build_exeext@%$build_exeext%g
9361s%@build_install_headers_dir@%$build_install_headers_dir%g
9362s%@build_xm_file_list@%$build_xm_file_list%g
9363s%@build_xm_file@%$build_xm_file%g
9364s%@build_xm_defines@%$build_xm_defines%g
9365s%@check_languages@%$check_languages%g
9366s%@cc_set_by_configure@%$cc_set_by_configure%g
9367s%@quoted_cc_set_by_configure@%$quoted_cc_set_by_configure%g
9368s%@cpp_install_dir@%$cpp_install_dir%g
9369s%@dep_host_xmake_file@%$dep_host_xmake_file%g
9370s%@dep_tmake_file@%$dep_tmake_file%g
9371s%@extra_headers_list@%$extra_headers_list%g
9372s%@extra_objs@%$extra_objs%g
9373s%@extra_parts@%$extra_parts%g
9374s%@extra_passes@%$extra_passes%g
9375s%@extra_programs@%$extra_programs%g
9376s%@float_h_file@%$float_h_file%g
9377s%@gcc_config_arguments@%$gcc_config_arguments%g
9378s%@gcc_gxx_include_dir@%$gcc_gxx_include_dir%g
9379s%@libstdcxx_incdir@%$libstdcxx_incdir%g
9380s%@gcc_version@%$gcc_version%g
9381s%@gcc_version_full@%$gcc_version_full%g
9382s%@gcc_version_trigger@%$gcc_version_trigger%g
9383s%@host_exeext@%$host_exeext%g
9384s%@host_extra_gcc_objs@%$host_extra_gcc_objs%g
9385s%@host_xm_file_list@%$host_xm_file_list%g
9386s%@host_xm_file@%$host_xm_file%g
9387s%@host_xm_defines@%$host_xm_defines%g
9388s%@out_host_hook_obj@%$out_host_hook_obj%g
9389s%@install@%$install%g
9390s%@lang_options_files@%$lang_options_files%g
9391s%@lang_specs_files@%$lang_specs_files%g
9392s%@lang_tree_files@%$lang_tree_files%g
9393s%@local_prefix@%$local_prefix%g
9394s%@md_file@%$md_file%g
9395s%@objc_boehm_gc@%$objc_boehm_gc%g
9396s%@out_file@%$out_file%g
9397s%@out_object_file@%$out_object_file%g
9398s%@stage_prefix_set_by_configure@%$stage_prefix_set_by_configure%g
9399s%@quoted_stage_prefix_set_by_configure@%$quoted_stage_prefix_set_by_configure%g
9400s%@symbolic_link@%$symbolic_link%g
9401s%@thread_file@%$thread_file%g
9402s%@tm_file_list@%$tm_file_list%g
9403s%@tm_file@%$tm_file%g
9404s%@tm_defines@%$tm_defines%g
9405s%@tm_p_file_list@%$tm_p_file_list%g
9406s%@tm_p_file@%$tm_p_file%g
9407s%@xm_file@%$xm_file%g
9408s%@xm_defines@%$xm_defines%g
9409s%@c_target_objs@%$c_target_objs%g
9410s%@cxx_target_objs@%$cxx_target_objs%g
9411s%@target_cpu_default@%$target_cpu_default%g
861bb6c1 9412/@target_overrides@/r $target_overrides
093e61a6 9413s%@target_overrides@%%g
861bb6c1 9414/@host_overrides@/r $host_overrides
093e61a6 9415s%@host_overrides@%%g
861bb6c1 9416/@language_fragments@/r $language_fragments
093e61a6 9417s%@language_fragments@%%g
861bb6c1 9418/@language_hooks@/r $language_hooks
093e61a6
RS
9419s%@language_hooks@%%g
9420
861bb6c1 9421CEOF
093e61a6 9422EOF
861bb6c1 9423
093e61a6
RS
9424cat >> $CONFIG_STATUS <<\EOF
9425
9426# Split the substitutions into bite-sized pieces for seds with
9427# small command number limits, like on Digital OSF/1 and HP-UX.
9428ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
9429ac_file=1 # Number of current file.
9430ac_beg=1 # First line for current file.
9431ac_end=$ac_max_sed_cmds # Line after last line for current file.
9432ac_more_lines=:
9433ac_sed_cmds=""
9434while $ac_more_lines; do
9435 if test $ac_beg -gt 1; then
9436 sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
9437 else
9438 sed "${ac_end}q" conftest.subs > conftest.s$ac_file
9439 fi
9440 if test ! -s conftest.s$ac_file; then
9441 ac_more_lines=false
9442 rm -f conftest.s$ac_file
9443 else
9444 if test -z "$ac_sed_cmds"; then
9445 ac_sed_cmds="sed -f conftest.s$ac_file"
861bb6c1 9446 else
093e61a6 9447 ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
861bb6c1 9448 fi
093e61a6
RS
9449 ac_file=`expr $ac_file + 1`
9450 ac_beg=$ac_end
9451 ac_end=`expr $ac_end + $ac_max_sed_cmds`
861bb6c1 9452 fi
093e61a6
RS
9453done
9454if test -z "$ac_sed_cmds"; then
9455 ac_sed_cmds=cat
9456fi
9457EOF
861bb6c1 9458
093e61a6
RS
9459cat >> $CONFIG_STATUS <<EOF
9460
9461CONFIG_FILES=\${CONFIG_FILES-"$all_outputs"}
9462EOF
9463cat >> $CONFIG_STATUS <<\EOF
9464for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
861bb6c1 9465 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
093e61a6
RS
9466 case "$ac_file" in
9467 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
9468 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9469 *) ac_file_in="${ac_file}.in" ;;
861bb6c1
JL
9470 esac
9471
093e61a6 9472 # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
cafe096b 9473
093e61a6
RS
9474 # Remove last slash and all that follows it. Not all systems have dirname.
9475 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
9476 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
9477 # The file is in a subdirectory.
9478 test ! -d "$ac_dir" && mkdir "$ac_dir"
9479 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
9480 # A "../" for each directory in $ac_dir_suffix.
9481 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
9482 else
9483 ac_dir_suffix= ac_dots=
9484 fi
cafe096b 9485
093e61a6
RS
9486 case "$ac_given_srcdir" in
9487 .) srcdir=.
9488 if test -z "$ac_dots"; then top_srcdir=.
9489 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
9490 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
861bb6c1 9491 *) # Relative path.
093e61a6
RS
9492 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
9493 top_srcdir="$ac_dots$ac_given_srcdir" ;;
9494 esac
861bb6c1 9495
cafe096b 9496
093e61a6
RS
9497 echo creating "$ac_file"
9498 rm -f "$ac_file"
9499 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
9500 case "$ac_file" in
9501 *Makefile*) ac_comsub="1i\\
9502# $configure_input" ;;
9503 *) ac_comsub= ;;
9504 esac
cafe096b 9505
093e61a6
RS
9506 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
9507 sed -e "$ac_comsub
9508s%@configure_input@%$configure_input%g
9509s%@srcdir@%$srcdir%g
9510s%@top_srcdir@%$top_srcdir%g
9511" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
9512fi; done
9513rm -f conftest.s*
861bb6c1
JL
9514
9515# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
9516# NAME is the cpp macro being defined and VALUE is the value it is being given.
9517#
9518# ac_d sets the value in "#define NAME VALUE" lines.
093e61a6
RS
9519ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
9520ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
9521ac_dC='\3'
9522ac_dD='%g'
9523# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
9524ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
9525ac_uB='\([ ]\)%\1#\2define\3'
861bb6c1 9526ac_uC=' '
093e61a6
RS
9527ac_uD='\4%g'
9528# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
9529ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
9530ac_eB='$%\1#\2define\3'
9531ac_eC=' '
9532ac_eD='%g'
9533
9534if test "${CONFIG_HEADERS+set}" != set; then
9535EOF
9536cat >> $CONFIG_STATUS <<EOF
9537 CONFIG_HEADERS="auto-host.h:config.in"
9538EOF
9539cat >> $CONFIG_STATUS <<\EOF
9540fi
9541for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
861bb6c1 9542 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
093e61a6
RS
9543 case "$ac_file" in
9544 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
9545 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9546 *) ac_file_in="${ac_file}.in" ;;
861bb6c1
JL
9547 esac
9548
093e61a6
RS
9549 echo creating $ac_file
9550
9551 rm -f conftest.frag conftest.in conftest.out
9552 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
9553 cat $ac_file_inputs > conftest.in
9554
9555EOF
9556
9557# Transform confdefs.h into a sed script conftest.vals that substitutes
9558# the proper values into config.h.in to produce config.h. And first:
9559# Protect against being on the right side of a sed subst in config.status.
9560# Protect against being in an unquoted here document in config.status.
9561rm -f conftest.vals
9562cat > conftest.hdr <<\EOF
9563s/[\\&%]/\\&/g
9564s%[\\$`]%\\&%g
9565s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
9566s%ac_d%ac_u%gp
9567s%ac_u%ac_e%gp
9568EOF
9569sed -n -f conftest.hdr confdefs.h > conftest.vals
9570rm -f conftest.hdr
861bb6c1
JL
9571
9572# This sed command replaces #undef with comments. This is necessary, for
9573# example, in the case of _POSIX_SOURCE, which is predefined and required
9574# on some systems where configure will not decide to define it.
093e61a6
RS
9575cat >> conftest.vals <<\EOF
9576s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
9577EOF
9578
9579# Break up conftest.vals because some shells have a limit on
9580# the size of here documents, and old seds have small limits too.
861bb6c1
JL
9581
9582rm -f conftest.tail
093e61a6 9583while :
861bb6c1 9584do
093e61a6
RS
9585 ac_lines=`grep -c . conftest.vals`
9586 # grep -c gives empty output for an empty file on some AIX systems.
9587 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
9588 # Write a limited-size here document to conftest.frag.
9589 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
9590 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
861bb6c1 9591 echo 'CEOF
093e61a6
RS
9592 sed -f conftest.frag conftest.in > conftest.out
9593 rm -f conftest.in
9594 mv conftest.out conftest.in
9595' >> $CONFIG_STATUS
9596 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
9597 rm -f conftest.vals
9598 mv conftest.tail conftest.vals
861bb6c1 9599done
093e61a6
RS
9600rm -f conftest.vals
9601
9602cat >> $CONFIG_STATUS <<\EOF
9603 rm -f conftest.frag conftest.h
9604 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
9605 cat conftest.in >> conftest.h
9606 rm -f conftest.in
9607 if cmp -s $ac_file conftest.h 2>/dev/null; then
9608 echo "$ac_file is unchanged"
9609 rm -f conftest.h
cafe096b 9610 else
093e61a6
RS
9611 # Remove last slash and all that follows it. Not all systems have dirname.
9612 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
9613 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
9614 # The file is in a subdirectory.
9615 test ! -d "$ac_dir" && mkdir "$ac_dir"
cafe096b 9616 fi
093e61a6
RS
9617 rm -f $ac_file
9618 mv conftest.h $ac_file
cafe096b 9619 fi
093e61a6 9620fi; done
861bb6c1 9621
093e61a6
RS
9622EOF
9623cat >> $CONFIG_STATUS <<EOF
9624
9625subdirs='$subdirs'
9626symbolic_link='$symbolic_link'
9627
9628EOF
9629cat >> $CONFIG_STATUS <<\EOF
9630for ac_file in $CONFIG_FILES; do
71a94577
ZW
9631 # Support "outfile[:infile[:infile...]]"
9632 case "$ac_file" in
9633 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9634 esac
9635 # PO directories have a Makefile.in generated from Makefile.in.in.
9636 case "$ac_file" in */Makefile.in)
9637 # Adjust a relative srcdir.
9638 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
9639 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
9640 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
9641 # In autoconf-2.13 it is called $ac_given_srcdir.
9642 # In autoconf-2.50 it is called $srcdir.
9643 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
9644 case "$ac_given_srcdir" in
9645 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
9646 /*) top_srcdir="$ac_given_srcdir" ;;
9647 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
9648 esac
9649 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
9650 rm -f "$ac_dir/POTFILES"
9651 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
9652 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
9653 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
9654 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
9655 fi
9656 ;;
9657 esac
093e61a6
RS
9658 done
9659
861bb6c1 9660case x$CONFIG_HEADERS in
b7cb92ad 9661xauto-host.h:config.in)
861bb6c1
JL
9662echo > cstamp-h ;;
9663esac
93cf819d
BK
9664# If the host supports symlinks, point stage[1234] at ../stage[1234] so
9665# bootstrapping and the installation procedure can still use
9666# CC="stage1/xgcc -Bstage1/". If the host doesn't support symlinks,
9667# FLAGS_TO_PASS has been modified to solve the problem there.
9668# This is virtually a duplicate of what happens in configure.lang; we do
9669# an extra check to make sure this only happens if ln -s can be used.
75bffa71 9670if test "$symbolic_link" = "ln -s"; then
d8140df6 9671 for d in .. ${subdirs} fixinc ; do
75bffa71 9672 if test $d != ..; then
1e6347d8 9673 STARTDIR=`${PWDCMD-pwd}`
4e8a434e 9674 cd $d
6a1b7268 9675 for t in stage1 stage2 stage3 stage4 stageprofile stagefeedback include
4e8a434e
BK
9676 do
9677 rm -f $t
9678 $symbolic_link ../$t $t 2>/dev/null
9679 done
9680 cd $STARTDIR
93cf819d
BK
9681 fi
9682 done
9683else true ; fi
ab87f8c8
JL
9684# Avoid having to add intl to our include paths.
9685if test -f intl/libintl.h; then
9686 echo creating libintl.h
9687 echo '#include "intl/libintl.h"' >libintl.h
9688fi
cafe096b 9689
093e61a6
RS
9690exit 0
9691EOF
861bb6c1 9692chmod +x $CONFIG_STATUS
093e61a6
RS
9693rm -fr confdefs* $ac_clean_files
9694test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
861bb6c1 9695