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