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