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