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