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