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