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