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