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