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