]> gcc.gnu.org Git - gcc.git/blame - gcc/configure
config.in (ENABLE_RTL_FLAG_CHECKING): New.
[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
4c76f856 2241for ac_prog in mawk gawk 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 \
3442 fwrite_unlocked fprintf_unlocked getrusage nl_langinfo lstat
956d6950
JL
3443do
3444echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4c76f856 3445echo "configure:3446: checking for $ac_func" >&5
956d6950
JL
3446if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3447 echo $ac_n "(cached) $ac_c" 1>&6
3448else
3449 cat > conftest.$ac_ext <<EOF
4c76f856 3450#line 3451 "configure"
956d6950
JL
3451#include "confdefs.h"
3452/* System header to define __stub macros and hopefully few prototypes,
3453 which can conflict with char $ac_func(); below. */
3454#include <assert.h>
3455/* Override any gcc2 internal prototype to avoid an error. */
3456/* We use char because int might match the return type of a gcc2
3457 builtin and then its argument prototype would still apply. */
3458char $ac_func();
3459
3460int main() {
3461
3462/* The GNU C library defines this for functions which it implements
3463 to always fail with ENOSYS. Some functions are actually named
3464 something starting with __ and the normal name is an alias. */
3465#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3466choke me
3467#else
99b09ff3 3468$ac_func();
956d6950
JL
3469#endif
3470
3471; return 0; }
3472EOF
4c76f856 3473if { (eval echo configure:3474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
956d6950
JL
3474 rm -rf conftest*
3475 eval "ac_cv_func_$ac_func=yes"
3476else
3477 echo "configure: failed program was:" >&5
3478 cat conftest.$ac_ext >&5
3479 rm -rf conftest*
3480 eval "ac_cv_func_$ac_func=no"
3481fi
3482rm -f conftest*
3483fi
3484
3485if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3486 echo "$ac_t""yes" 1>&6
3487 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3488 cat >> confdefs.h <<EOF
3489#define $ac_tr_func 1
3490EOF
3491
3492else
3493 echo "$ac_t""no" 1>&6
3494fi
3495done
3496
6885fc87 3497
f12bc141 3498echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
4c76f856 3499echo "configure:3500: checking for ssize_t" >&5
f12bc141
ZW
3500if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
3501 echo $ac_n "(cached) $ac_c" 1>&6
3502else
3503 cat > conftest.$ac_ext <<EOF
4c76f856 3504#line 3505 "configure"
f12bc141
ZW
3505#include "confdefs.h"
3506#include <sys/types.h>
3507#if STDC_HEADERS
3508#include <stdlib.h>
3509#include <stddef.h>
3510#endif
3511EOF
3512if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3513 egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3514 rm -rf conftest*
cb65112a 3515 ac_cv_type_ssize_t=yes
f12bc141
ZW
3516else
3517 rm -rf conftest*
cb65112a 3518 ac_cv_type_ssize_t=no
f12bc141
ZW
3519fi
3520rm -f conftest*
3521
3522fi
cb65112a
AO
3523echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
3524if test $ac_cv_type_ssize_t = no; then
3525 cat >> confdefs.h <<\EOF
f12bc141
ZW
3526#define ssize_t int
3527EOF
3528
3529fi
3530
0b9d02c6 3531
e256b8b6
DA
3532# Try to determine the array type of the second argument of getgroups
3533# for the target system (int or gid_t).
3534echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
4c76f856 3535echo "configure:3536: checking for uid_t in sys/types.h" >&5
e256b8b6
DA
3536if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
3537 echo $ac_n "(cached) $ac_c" 1>&6
3538else
3539 cat > conftest.$ac_ext <<EOF
4c76f856 3540#line 3541 "configure"
e256b8b6
DA
3541#include "confdefs.h"
3542#include <sys/types.h>
3543EOF
3544if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3545 egrep "uid_t" >/dev/null 2>&1; then
3546 rm -rf conftest*
3547 ac_cv_type_uid_t=yes
3548else
3549 rm -rf conftest*
3550 ac_cv_type_uid_t=no
3551fi
3552rm -f conftest*
3553
3554fi
3555
3556echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3557if test $ac_cv_type_uid_t = no; then
3558 cat >> confdefs.h <<\EOF
3559#define uid_t int
3560EOF
3561
3562 cat >> confdefs.h <<\EOF
3563#define gid_t int
3564EOF
3565
3566fi
3567
3568echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
4c76f856 3569echo "configure:3570: checking type of array argument to getgroups" >&5
e256b8b6
DA
3570if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
3571 echo $ac_n "(cached) $ac_c" 1>&6
3572else
3573 if test "$cross_compiling" = yes; then
3574 ac_cv_type_getgroups=cross
3575else
3576 cat > conftest.$ac_ext <<EOF
4c76f856 3577#line 3578 "configure"
e256b8b6
DA
3578#include "confdefs.h"
3579
3580/* Thanks to Mike Rendell for this test. */
3581#include <sys/types.h>
3582#define NGID 256
3583#undef MAX
3584#define MAX(x, y) ((x) > (y) ? (x) : (y))
3585main()
3586{
3587 gid_t gidset[NGID];
3588 int i, n;
3589 union { gid_t gval; long lval; } val;
3590
3591 val.lval = -1;
3592 for (i = 0; i < NGID; i++)
3593 gidset[i] = val.gval;
3594 n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
3595 gidset);
3596 /* Exit non-zero if getgroups seems to require an array of ints. This
3597 happens when gid_t is short but getgroups modifies an array of ints. */
3598 exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
3599}
3600
3601EOF
4c76f856 3602if { (eval echo configure:3603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
e256b8b6
DA
3603then
3604 ac_cv_type_getgroups=gid_t
3605else
3606 echo "configure: failed program was:" >&5
3607 cat conftest.$ac_ext >&5
3608 rm -fr conftest*
3609 ac_cv_type_getgroups=int
3610fi
3611rm -fr conftest*
3612fi
3613
3614if test $ac_cv_type_getgroups = cross; then
3615 cat > conftest.$ac_ext <<EOF
4c76f856 3616#line 3617 "configure"
e256b8b6
DA
3617#include "confdefs.h"
3618#include <unistd.h>
3619EOF
3620if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3621 egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
3622 rm -rf conftest*
3623 ac_cv_type_getgroups=gid_t
3624else
3625 rm -rf conftest*
3626 ac_cv_type_getgroups=int
3627fi
3628rm -f conftest*
3629
3630fi
3631fi
3632
3633echo "$ac_t""$ac_cv_type_getgroups" 1>&6
3634cat >> confdefs.h <<EOF
3635#define GETGROUPS_T $ac_cv_type_getgroups
3636EOF
3637
3638
3639if test "${target}" = "${build}"; then
3640 TARGET_GETGROUPS_T=$ac_cv_type_getgroups
3641else
3642 case "${target}" in
3643 # This condition may need some tweaking. It should include all
3644 # targets where the array type of the second argument of getgroups
3645 # is int and the type of gid_t is not equivalent to int.
3646 *-*-sunos* | *-*-ultrix*)
3647 TARGET_GETGROUPS_T=int
3648 ;;
3649 *)
3650 TARGET_GETGROUPS_T=gid_t
3651 ;;
3652 esac
3653fi
3654
3655
0a4b6309 3656echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6
4c76f856 3657echo "configure:3658: checking whether the printf functions support %p" >&5
0a4b6309
RL
3658if eval "test \"`echo '$''{'gcc_cv_func_printf_ptr'+set}'`\" = set"; then
3659 echo $ac_n "(cached) $ac_c" 1>&6
3660else
3661 if test "$cross_compiling" = yes; then
3662 gcc_cv_func_printf_ptr=no
3663else
3664 cat > conftest.$ac_ext <<EOF
4c76f856 3665#line 3666 "configure"
0a4b6309
RL
3666#include "confdefs.h"
3667#include <stdio.h>
3668
86cf1cbd 3669int main()
0a4b6309
RL
3670{
3671 char buf[64];
3672 char *p = buf, *q = NULL;
3673 sprintf(buf, "%p", p);
3674 sscanf(buf, "%p", &q);
86cf1cbd 3675 return (p != q);
0a4b6309
RL
3676}
3677EOF
4c76f856 3678if { (eval echo configure:3679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
0a4b6309
RL
3679then
3680 gcc_cv_func_printf_ptr=yes
3681else
3682 echo "configure: failed program was:" >&5
3683 cat conftest.$ac_ext >&5
3684 rm -fr conftest*
3685 gcc_cv_func_printf_ptr=no
3686fi
3687rm -fr conftest*
3688fi
3689
3690rm -f core core.* *.core
3691fi
3692
3693echo "$ac_t""$gcc_cv_func_printf_ptr" 1>&6
3694if test $gcc_cv_func_printf_ptr = yes ; then
3695 cat >> confdefs.h <<\EOF
3696#define HAVE_PRINTF_PTR 1
3697EOF
3698
3699fi
3700
b27d2bd5
MK
3701
3702case "${host}" in
3703*-*-uwin*)
34fa3e7d
MM
3704 { echo "configure: error:
3705*** UWIN may not be used as a host platform because
3706*** linking with posix.dll is not allowed by the GNU GPL" 1>&2; exit 1; }
b27d2bd5 3707 ;;
ee262b6f
DR
3708*-*-*vms*)
3709 # Under VMS, vfork works very different than on Unix. The standard test
3710 # won't work, and it isn't easily adaptable. It makes more sense to
3711 # just force it.
3712 ac_cv_func_vfork_works=yes
3713 ;;
b27d2bd5 3714esac
c375c43b 3715echo $ac_n "checking for pid_t""... $ac_c" 1>&6
4c76f856 3716echo "configure:3717: checking for pid_t" >&5
c375c43b
KG
3717if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
3718 echo $ac_n "(cached) $ac_c" 1>&6
3719else
3720 cat > conftest.$ac_ext <<EOF
4c76f856 3721#line 3722 "configure"
c375c43b
KG
3722#include "confdefs.h"
3723#include <sys/types.h>
3724#if STDC_HEADERS
3725#include <stdlib.h>
3726#include <stddef.h>
3727#endif
3728EOF
3729if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
b27d2bd5 3730 egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
c375c43b 3731 rm -rf conftest*
cb65112a 3732 ac_cv_type_pid_t=yes
c375c43b
KG
3733else
3734 rm -rf conftest*
cb65112a 3735 ac_cv_type_pid_t=no
c375c43b
KG
3736fi
3737rm -f conftest*
3738
3739fi
cb65112a
AO
3740echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3741if test $ac_cv_type_pid_t = no; then
3742 cat >> confdefs.h <<\EOF
c375c43b
KG
3743#define pid_t int
3744EOF
3745
3746fi
3747
3748ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
3749echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
4c76f856 3750echo "configure:3751: checking for vfork.h" >&5
c375c43b
KG
3751if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3752 echo $ac_n "(cached) $ac_c" 1>&6
3753else
3754 cat > conftest.$ac_ext <<EOF
4c76f856 3755#line 3756 "configure"
c375c43b
KG
3756#include "confdefs.h"
3757#include <vfork.h>
3758EOF
3759ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4c76f856 3760{ (eval echo configure:3761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
cd9e5e7c 3761ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
c375c43b
KG
3762if test -z "$ac_err"; then
3763 rm -rf conftest*
3764 eval "ac_cv_header_$ac_safe=yes"
3765else
3766 echo "$ac_err" >&5
3767 echo "configure: failed program was:" >&5
3768 cat conftest.$ac_ext >&5
3769 rm -rf conftest*
3770 eval "ac_cv_header_$ac_safe=no"
3771fi
3772rm -f conftest*
3773fi
3774if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3775 echo "$ac_t""yes" 1>&6
3776 cat >> confdefs.h <<\EOF
3777#define HAVE_VFORK_H 1
3778EOF
3779
3780else
3781 echo "$ac_t""no" 1>&6
3782fi
3783
3784echo $ac_n "checking for working vfork""... $ac_c" 1>&6
4c76f856 3785echo "configure:3786: checking for working vfork" >&5
c375c43b
KG
3786if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
3787 echo $ac_n "(cached) $ac_c" 1>&6
3788else
3789 if test "$cross_compiling" = yes; then
3790 echo $ac_n "checking for vfork""... $ac_c" 1>&6
4c76f856 3791echo "configure:3792: checking for vfork" >&5
c375c43b
KG
3792if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
3793 echo $ac_n "(cached) $ac_c" 1>&6
3794else
3795 cat > conftest.$ac_ext <<EOF
4c76f856 3796#line 3797 "configure"
c375c43b
KG
3797#include "confdefs.h"
3798/* System header to define __stub macros and hopefully few prototypes,
3799 which can conflict with char vfork(); below. */
3800#include <assert.h>
3801/* Override any gcc2 internal prototype to avoid an error. */
3802/* We use char because int might match the return type of a gcc2
3803 builtin and then its argument prototype would still apply. */
3804char vfork();
3805
3806int main() {
3807
3808/* The GNU C library defines this for functions which it implements
3809 to always fail with ENOSYS. Some functions are actually named
3810 something starting with __ and the normal name is an alias. */
3811#if defined (__stub_vfork) || defined (__stub___vfork)
3812choke me
3813#else
99b09ff3 3814vfork();
c375c43b
KG
3815#endif
3816
3817; return 0; }
3818EOF
4c76f856 3819if { (eval echo configure:3820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c375c43b
KG
3820 rm -rf conftest*
3821 eval "ac_cv_func_vfork=yes"
3822else
3823 echo "configure: failed program was:" >&5
3824 cat conftest.$ac_ext >&5
3825 rm -rf conftest*
3826 eval "ac_cv_func_vfork=no"
3827fi
3828rm -f conftest*
3829fi
3830
3831if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
3832 echo "$ac_t""yes" 1>&6
3833 :
3834else
3835 echo "$ac_t""no" 1>&6
3836fi
3837
3838ac_cv_func_vfork_works=$ac_cv_func_vfork
3839else
3840 cat > conftest.$ac_ext <<EOF
4c76f856 3841#line 3842 "configure"
c375c43b
KG
3842#include "confdefs.h"
3843/* Thanks to Paul Eggert for this test. */
3844#include <stdio.h>
3845#include <sys/types.h>
3846#include <sys/stat.h>
3847#ifdef HAVE_UNISTD_H
3848#include <unistd.h>
3849#endif
3850#ifdef HAVE_VFORK_H
3851#include <vfork.h>
3852#endif
3853/* On some sparc systems, changes by the child to local and incoming
3854 argument registers are propagated back to the parent.
3855 The compiler is told about this with #include <vfork.h>,
3856 but some compilers (e.g. gcc -O) don't grok <vfork.h>.
3857 Test for this by using a static variable whose address
3858 is put into a register that is clobbered by the vfork. */
3859static
3860#ifdef __cplusplus
3861sparc_address_test (int arg)
3862#else
3863sparc_address_test (arg) int arg;
3864#endif
3865{
3866 static pid_t child;
3867 if (!child) {
3868 child = vfork ();
3869 if (child < 0) {
3870 perror ("vfork");
3871 _exit(2);
3872 }
3873 if (!child) {
3874 arg = getpid();
3875 write(-1, "", 0);
3876 _exit (arg);
3877 }
3878 }
3879}
3880main() {
3881 pid_t parent = getpid ();
3882 pid_t child;
3883
3884 sparc_address_test ();
3885
3886 child = vfork ();
3887
3888 if (child == 0) {
3889 /* Here is another test for sparc vfork register problems.
3890 This test uses lots of local variables, at least
3891 as many local variables as main has allocated so far
3892 including compiler temporaries. 4 locals are enough for
3893 gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
3894 A buggy compiler should reuse the register of parent
3895 for one of the local variables, since it will think that
3896 parent can't possibly be used any more in this routine.
3897 Assigning to the local variable will thus munge parent
3898 in the parent process. */
3899 pid_t
3900 p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
3901 p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
3902 /* Convince the compiler that p..p7 are live; otherwise, it might
3903 use the same hardware register for all 8 local variables. */
3904 if (p != p1 || p != p2 || p != p3 || p != p4
3905 || p != p5 || p != p6 || p != p7)
3906 _exit(1);
3907
3908 /* On some systems (e.g. IRIX 3.3),
3909 vfork doesn't separate parent from child file descriptors.
3910 If the child closes a descriptor before it execs or exits,
3911 this munges the parent's descriptor as well.
3912 Test for this by closing stdout in the child. */
3913 _exit(close(fileno(stdout)) != 0);
3914 } else {
3915 int status;
3916 struct stat st;
3917
3918 while (wait(&status) != child)
3919 ;
3920 exit(
3921 /* Was there some problem with vforking? */
3922 child < 0
3923
3924 /* Did the child fail? (This shouldn't happen.) */
3925 || status
3926
3927 /* Did the vfork/compiler bug occur? */
3928 || parent != getpid()
3929
3930 /* Did the file descriptor bug occur? */
3931 || fstat(fileno(stdout), &st) != 0
3932 );
3933 }
3934}
3935EOF
4c76f856 3936if { (eval echo configure:3937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
c375c43b
KG
3937then
3938 ac_cv_func_vfork_works=yes
3939else
3940 echo "configure: failed program was:" >&5
3941 cat conftest.$ac_ext >&5
3942 rm -fr conftest*
3943 ac_cv_func_vfork_works=no
3944fi
3945rm -fr conftest*
3946fi
3947
3948fi
3949
3950echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
3951if test $ac_cv_func_vfork_works = no; then
3952 cat >> confdefs.h <<\EOF
3953#define vfork fork
3954EOF
3955
3956fi
3957
81bf3d9e 3958for ac_func in getpagesize
0a4b6309 3959do
81bf3d9e 3960echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4c76f856 3961echo "configure:3962: checking for $ac_func" >&5
81bf3d9e 3962if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
0a4b6309
RL
3963 echo $ac_n "(cached) $ac_c" 1>&6
3964else
3965 cat > conftest.$ac_ext <<EOF
4c76f856 3966#line 3967 "configure"
0a4b6309 3967#include "confdefs.h"
81bf3d9e
RH
3968/* System header to define __stub macros and hopefully few prototypes,
3969 which can conflict with char $ac_func(); below. */
3970#include <assert.h>
3971/* Override any gcc2 internal prototype to avoid an error. */
3972/* We use char because int might match the return type of a gcc2
3973 builtin and then its argument prototype would still apply. */
3974char $ac_func();
8fa1f09f 3975
81bf3d9e
RH
3976int main() {
3977
3978/* The GNU C library defines this for functions which it implements
3979 to always fail with ENOSYS. Some functions are actually named
3980 something starting with __ and the normal name is an alias. */
3981#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3982choke me
c5c76735 3983#else
99b09ff3 3984$ac_func();
c5c76735
JL
3985#endif
3986
c5c76735
JL
3987; return 0; }
3988EOF
4c76f856 3989if { (eval echo configure:3990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c5c76735 3990 rm -rf conftest*
81bf3d9e 3991 eval "ac_cv_func_$ac_func=yes"
c5c76735
JL
3992else
3993 echo "configure: failed program was:" >&5
3994 cat conftest.$ac_ext >&5
3995 rm -rf conftest*
81bf3d9e 3996 eval "ac_cv_func_$ac_func=no"
c5c76735
JL
3997fi
3998rm -f conftest*
3999fi
4000
81bf3d9e 4001if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
c5c76735 4002 echo "$ac_t""yes" 1>&6
81bf3d9e 4003 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
c5c76735 4004 cat >> confdefs.h <<EOF
81bf3d9e 4005#define $ac_tr_func 1
c5c76735 4006EOF
81bf3d9e 4007
c5c76735
JL
4008else
4009 echo "$ac_t""no" 1>&6
4010fi
c5c76735
JL
4011done
4012
825b6926
ZW
4013# The test program for the next two tests is the same except for one
4014# set of ifdefs.
4015cat >ct-mmap.inc <<'EOF'
d2cabf16 4016#include <sys/types.h>
81bf3d9e 4017#include <sys/mman.h>
825b6926
ZW
4018#include <fcntl.h>
4019#include <signal.h>
4020#include <setjmp.h>
4021#include <stdio.h>
0a4b6309 4022
4c1331d6
DA
4023#if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
4024# define MAP_ANONYMOUS MAP_ANON
4025#endif
4026
81bf3d9e
RH
4027/* This mess was copied from the GNU getpagesize.h. */
4028#ifndef HAVE_GETPAGESIZE
4029# ifdef HAVE_UNISTD_H
4030# include <unistd.h>
4031# endif
0a4b6309 4032
81bf3d9e
RH
4033/* Assume that all systems that can run configure have sys/param.h. */
4034# ifndef HAVE_SYS_PARAM_H
4035# define HAVE_SYS_PARAM_H 1
4036# endif
0a4b6309 4037
81bf3d9e
RH
4038# ifdef _SC_PAGESIZE
4039# define getpagesize() sysconf(_SC_PAGESIZE)
4040# else /* no _SC_PAGESIZE */
4041# ifdef HAVE_SYS_PARAM_H
4042# include <sys/param.h>
4043# ifdef EXEC_PAGESIZE
4044# define getpagesize() EXEC_PAGESIZE
4045# else /* no EXEC_PAGESIZE */
4046# ifdef NBPG
4047# define getpagesize() NBPG * CLSIZE
4048# ifndef CLSIZE
4049# define CLSIZE 1
4050# endif /* no CLSIZE */
4051# else /* no NBPG */
4052# ifdef NBPC
4053# define getpagesize() NBPC
4054# else /* no NBPC */
4055# ifdef PAGESIZE
4056# define getpagesize() PAGESIZE
4057# endif /* PAGESIZE */
4058# endif /* no NBPC */
4059# endif /* no NBPG */
4060# endif /* no EXEC_PAGESIZE */
4061# else /* no HAVE_SYS_PARAM_H */
4062# define getpagesize() 8192 /* punt totally */
4063# endif /* no HAVE_SYS_PARAM_H */
4064# endif /* no _SC_PAGESIZE */
0a4b6309 4065
81bf3d9e 4066#endif /* no HAVE_GETPAGESIZE */
0a4b6309 4067
825b6926
ZW
4068#ifndef MAP_FAILED
4069# define MAP_FAILED -1
4c1331d6 4070#endif
81bf3d9e 4071
825b6926
ZW
4072#undef perror_exit
4073#define perror_exit(str, val) \
4074 do { perror(str); exit(val); } while (0)
4075
4076/* Some versions of cygwin mmap require that munmap is called with the
4077 same parameters as mmap. GCC expects that this is not the case.
4078 Test for various forms of this problem. Warning - icky signal games. */
4079
4080static sigset_t unblock_sigsegv;
4081static jmp_buf r;
4082static size_t pg;
4083static int devzero;
4084
4085static char *
4086anonmap (size)
4087 size_t size;
4088{
4089#ifdef USE_MAP_ANON
4090 return (char *) mmap (0, size, PROT_READ|PROT_WRITE,
4091 MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
4c1331d6 4092#else
825b6926
ZW
4093 return (char *) mmap (0, size, PROT_READ|PROT_WRITE,
4094 MAP_PRIVATE, devzero, 0);
4c1331d6 4095#endif
825b6926
ZW
4096}
4097
4098static void
4099sigsegv (unused)
4100 int unused;
4101{
4102 sigprocmask (SIG_UNBLOCK, &unblock_sigsegv, 0);
4103 longjmp (r, 1);
4104}
4105
4106/* Basic functionality test. */
4107void
4108test_0 ()
4109{
4110 char *x = anonmap (pg);
4111 if (x == (char *) MAP_FAILED)
4112 perror_exit("test 0 mmap", 2);
81bf3d9e 4113
4acab94b 4114 *(int *)x += 1;
81bf3d9e 4115
4acab94b 4116 if (munmap(x, pg) < 0)
825b6926
ZW
4117 perror_exit("test 0 munmap", 3);
4118}
4119
4120/* 1. If we map a 2-page region and unmap its second page, the first page
4121 must remain. */
4122static void
4123test_1 ()
4124{
4125 char *x = anonmap (pg * 2);
4126 if (x == (char *)MAP_FAILED)
4127 perror_exit ("test 1 mmap", 4);
4128
4129 signal (SIGSEGV, sigsegv);
4130 if (setjmp (r))
4131 perror_exit ("test 1 fault", 5);
4132
4133 x[0] = 1;
4134 x[pg] = 1;
4135
4136 if (munmap (x + pg, pg) < 0)
4137 perror_exit ("test 1 munmap 1", 6);
4138 x[0] = 2;
4139
4140 if (setjmp (r) == 0)
4141 {
4142 x[pg] = 1;
4143 perror_exit ("test 1 no fault", 7);
4144 }
4145 if (munmap (x, pg) < 0)
4146 perror_exit ("test 1 munmap 2", 8);
4147}
4148
4149/* 2. If we map a 2-page region and unmap its first page, the second
4150 page must remain. */
4151static void
4152test_2 ()
4153{
4154 char *x = anonmap (pg * 2);
4155 if (x == (char *)MAP_FAILED)
4156 perror_exit ("test 2 mmap", 9);
4157
4158 signal (SIGSEGV, sigsegv);
4159 if (setjmp (r))
4160 perror_exit ("test 2 fault", 10);
4161
4162 x[0] = 1;
4163 x[pg] = 1;
4164
4165 if (munmap (x, pg) < 0)
4166 perror_exit ("test 2 munmap 1", 11);
4167
4168 x[pg] = 2;
4169
4170 if (setjmp (r) == 0)
4171 {
4172 x[0] = 1;
4173 perror_exit ("test 2 no fault", 12);
4174 }
4175
4176 if (munmap (x+pg, pg) < 0)
4177 perror_exit ("test 2 munmap 2", 13);
4178}
4179
4180/* 3. If we map two adjacent 1-page regions and unmap them both with
4181 one munmap, both must go away.
4182
4183 Getting two adjacent 1-page regions with two mmap calls is slightly
4184 tricky. All OS's tested skip over already-allocated blocks; therefore
4185 we have been careful to unmap all allocated regions in previous tests.
4186 HP/UX allocates pages backward in memory. No OS has yet been observed
4187 to be so perverse as to leave unmapped space between consecutive calls
4188 to mmap. */
4189
4190static void
4191test_3 ()
4192{
4193 char *x, *y, *z;
4194
4195 x = anonmap (pg);
4196 if (x == (char *)MAP_FAILED)
4197 perror_exit ("test 3 mmap 1", 14);
4198 y = anonmap (pg);
4199 if (y == (char *)MAP_FAILED)
4200 perror_exit ("test 3 mmap 2", 15);
4201
4202 if (y != x + pg)
4203 {
4204 if (y == x - pg)
4205 z = y, y = x, x = z;
4206 else
4207 {
4208 fprintf (stderr, "test 3 nonconsecutive pages - %lx, %lx\n",
4209 (unsigned long)x, (unsigned long)y);
4210 exit (16);
4211 }
4212 }
4213
4214 signal (SIGSEGV, sigsegv);
4215 if (setjmp (r))
4216 perror_exit ("test 3 fault", 17);
4217
4218 x[0] = 1;
4219 y[0] = 1;
4220
4221 if (munmap (x, pg*2) < 0)
4222 perror_exit ("test 3 munmap", 18);
4223
4224 if (setjmp (r) == 0)
4225 {
4226 x[0] = 1;
4227 perror_exit ("test 3 no fault 1", 19);
4228 }
4229
4230 signal (SIGSEGV, sigsegv);
4231 if (setjmp (r) == 0)
4232 {
4233 y[0] = 1;
4234 perror_exit ("test 3 no fault 2", 20);
4235 }
4236}
4237
4238int
4239main ()
4240{
4241 sigemptyset (&unblock_sigsegv);
4242 sigaddset (&unblock_sigsegv, SIGSEGV);
4243 pg = getpagesize ();
4244#ifndef USE_MAP_ANON
4245 devzero = open ("/dev/zero", O_RDWR);
4246 if (devzero < 0)
4247 perror_exit ("open /dev/zero", 1);
4248#endif
4249
4250 test_0();
4251 test_1();
4252 test_2();
4253 test_3();
81bf3d9e 4254
4acab94b
AO
4255 exit(0);
4256}
81bf3d9e 4257EOF
825b6926
ZW
4258
4259echo $ac_n "checking for working mmap from /dev/zero""... $ac_c" 1>&6
4c76f856 4260echo "configure:4261: checking for working mmap from /dev/zero" >&5
825b6926
ZW
4261if eval "test \"`echo '$''{'ac_cv_func_mmap_dev_zero'+set}'`\" = set"; then
4262 echo $ac_n "(cached) $ac_c" 1>&6
4263else
4264 if test "$cross_compiling" = yes; then
4265 # If this is not cygwin, and /dev/zero is a character device, it's probably
4266 # safe to assume it works.
4267 case "$host_os" in
4268 cygwin* | win32 | pe | mingw* ) ac_cv_func_mmap_dev_zero=buggy ;;
4269 * ) if test -c /dev/zero
4270 then ac_cv_func_mmap_dev_zero=yes
4271 else ac_cv_func_mmap_dev_zero=no
4272 fi ;;
4273 esac
4274else
4275 cat > conftest.$ac_ext <<EOF
4c76f856 4276#line 4277 "configure"
825b6926
ZW
4277#include "confdefs.h"
4278#include "ct-mmap.inc"
4279EOF
4c76f856 4280if { (eval echo configure:4281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
825b6926
ZW
4281then
4282 ac_cv_func_mmap_dev_zero=yes
4283else
4284 echo "configure: failed program was:" >&5
4285 cat conftest.$ac_ext >&5
4286 rm -fr conftest*
4287 if test $? -lt 4
4288 then ac_cv_func_mmap_dev_zero=no
4289 else ac_cv_func_mmap_dev_zero=buggy
4290 fi
4291fi
4292rm -fr conftest*
4293fi
4294
4295
4296fi
4297
4298echo "$ac_t""$ac_cv_func_mmap_dev_zero" 1>&6
4299if test $ac_cv_func_mmap_dev_zero = yes; then
4300 cat >> confdefs.h <<\EOF
4301#define HAVE_MMAP_DEV_ZERO 1
4302EOF
4303
4304fi
4305
4306echo $ac_n "checking for working mmap with MAP_ANON(YMOUS)""... $ac_c" 1>&6
4c76f856 4307echo "configure:4308: checking for working mmap with MAP_ANON(YMOUS)" >&5
825b6926
ZW
4308if eval "test \"`echo '$''{'ac_cv_func_mmap_anon'+set}'`\" = set"; then
4309 echo $ac_n "(cached) $ac_c" 1>&6
4310else
4311 if test "$cross_compiling" = yes; then
4312 # Unlike /dev/zero, it is not safe to assume MAP_ANON(YMOUS) works
4313 # just because it's there. Some SCO Un*xen define it but don't implement it.
4314 ac_cv_func_mmap_anon=no
4315else
4316 cat > conftest.$ac_ext <<EOF
4c76f856 4317#line 4318 "configure"
825b6926
ZW
4318#include "confdefs.h"
4319#define USE_MAP_ANON
4320#include "ct-mmap.inc"
4321EOF
4c76f856 4322if { (eval echo configure:4323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
81bf3d9e 4323then
825b6926 4324 ac_cv_func_mmap_anon=yes
81bf3d9e
RH
4325else
4326 echo "configure: failed program was:" >&5
4327 cat conftest.$ac_ext >&5
4328 rm -fr conftest*
825b6926
ZW
4329 if test $? -lt 4
4330 then ac_cv_func_mmap_anon=no
4331 else ac_cv_func_mmap_anon=buggy
4332 fi
81bf3d9e
RH
4333fi
4334rm -fr conftest*
4335fi
4336
825b6926 4337
81bf3d9e
RH
4338fi
4339
825b6926
ZW
4340echo "$ac_t""$ac_cv_func_mmap_anon" 1>&6
4341if test $ac_cv_func_mmap_anon = yes; then
81bf3d9e 4342 cat >> confdefs.h <<\EOF
825b6926 4343#define HAVE_MMAP_ANON 1
81bf3d9e
RH
4344EOF
4345
4346fi
825b6926 4347rm -f ct-mmap.inc
81bf3d9e 4348
56f02b88 4349echo $ac_n "checking for working mmap of a file""... $ac_c" 1>&6
4c76f856 4350echo "configure:4351: checking for working mmap of a file" >&5
56f02b88
ZW
4351if eval "test \"`echo '$''{'ac_cv_func_mmap_file'+set}'`\" = set"; then
4352 echo $ac_n "(cached) $ac_c" 1>&6
4353else
4354 # Create a file one thousand bytes long.
4355for i in 1 2 3 4 5 6 7 8 9 0
4356do for j in 1 2 3 4 5 6 7 8 9 0
4357do echo $i $j xxxxx
4358done
4359done > conftestdata$$
4360
4361if test "$cross_compiling" = yes; then
4362 ac_cv_func_mmap_file=no
4363else
4364 cat > conftest.$ac_ext <<EOF
4c76f856 4365#line 4366 "configure"
56f02b88
ZW
4366#include "confdefs.h"
4367
4368/* Test by Zack Weinberg. Modified from MMAP_ANYWHERE test by
4369 Richard Henderson and Alexandre Oliva.
4370 Check whether read-only mmap of a plain file works. */
4371#include <sys/types.h>
4372#include <sys/stat.h>
4373#include <fcntl.h>
4374#include <sys/mman.h>
4375
4376int main()
4377{
4378 char *x;
4379 int fd;
4380 struct stat st;
4381
4382 fd = open("conftestdata$$", O_RDONLY);
4383 if (fd < 0)
4384 exit(1);
4385
4386 if (fstat (fd, &st))
4387 exit(2);
4388
4389 x = (char*)mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
4390 if (x == (char *) -1)
4391 exit(3);
4392
4393 if (x[0] != '1' || x[1] != ' ' || x[2] != '1' || x[3] != ' ')
4394 exit(4);
4395
4396 if (munmap(x, st.st_size) < 0)
4397 exit(5);
4398
4399 exit(0);
4400}
4401EOF
4c76f856 4402if { (eval echo configure:4403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
56f02b88
ZW
4403then
4404 ac_cv_func_mmap_file=yes
4405else
4406 echo "configure: failed program was:" >&5
4407 cat conftest.$ac_ext >&5
4408 rm -fr conftest*
4409 ac_cv_func_mmap_file=no
4410fi
4411rm -fr conftest*
4412fi
4413
4414fi
4415
4416echo "$ac_t""$ac_cv_func_mmap_file" 1>&6
4417if test $ac_cv_func_mmap_file = yes; then
4418 cat >> confdefs.h <<\EOF
4419#define HAVE_MMAP_FILE 1
4420EOF
4421
4422fi
4423
81bf3d9e 4424
f91abfce
TT
4425
4426
b7f2fb96 4427 am_cv_lib_iconv_ldpath=
f91abfce
TT
4428 # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
4429if test "${with_libiconv_prefix+set}" = set; then
4430 withval="$with_libiconv_prefix"
4431
4432 for dir in `echo "$withval" | tr : ' '`; do
4433 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
b7f2fb96 4434 if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
f91abfce
TT
4435 done
4436
4437fi
4438
4439
4440 echo $ac_n "checking for iconv""... $ac_c" 1>&6
4c76f856 4441echo "configure:4442: checking for iconv" >&5
f91abfce
TT
4442if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
4443 echo $ac_n "(cached) $ac_c" 1>&6
4444else
4445
4446 am_cv_func_iconv="no, consider installing GNU libiconv"
4447 am_cv_lib_iconv=no
4448 cat > conftest.$ac_ext <<EOF
4c76f856 4449#line 4450 "configure"
f91abfce
TT
4450#include "confdefs.h"
4451#include <stdlib.h>
4452#include <iconv.h>
4453int main() {
4454iconv_t cd = iconv_open("","");
4455 iconv(cd,NULL,NULL,NULL,NULL);
4456 iconv_close(cd);
4457; return 0; }
4458EOF
4c76f856 4459if { (eval echo configure:4460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
f91abfce
TT
4460 rm -rf conftest*
4461 am_cv_func_iconv=yes
4462else
4463 echo "configure: failed program was:" >&5
4464 cat conftest.$ac_ext >&5
4465fi
4466rm -f conftest*
4467 if test "$am_cv_func_iconv" != yes; then
4468 am_save_LIBS="$LIBS"
b7f2fb96 4469 LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
f91abfce 4470 cat > conftest.$ac_ext <<EOF
4c76f856 4471#line 4472 "configure"
f91abfce
TT
4472#include "confdefs.h"
4473#include <stdlib.h>
4474#include <iconv.h>
4475int main() {
4476iconv_t cd = iconv_open("","");
4477 iconv(cd,NULL,NULL,NULL,NULL);
4478 iconv_close(cd);
4479; return 0; }
4480EOF
4c76f856 4481if { (eval echo configure:4482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
f91abfce
TT
4482 rm -rf conftest*
4483 am_cv_lib_iconv=yes
4484 am_cv_func_iconv=yes
4485else
4486 echo "configure: failed program was:" >&5
4487 cat conftest.$ac_ext >&5
4488fi
4489rm -f conftest*
4490 LIBS="$am_save_LIBS"
4491 fi
4492
4493fi
4494
4495echo "$ac_t""$am_cv_func_iconv" 1>&6
4496 if test "$am_cv_func_iconv" = yes; then
4497 cat >> confdefs.h <<\EOF
4498#define HAVE_ICONV 1
4499EOF
4500
4501 echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
4c76f856 4502echo "configure:4503: checking for iconv declaration" >&5
f91abfce
TT
4503 if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
4504 echo $ac_n "(cached) $ac_c" 1>&6
4505else
4506
4507 cat > conftest.$ac_ext <<EOF
4c76f856 4508#line 4509 "configure"
f91abfce
TT
4509#include "confdefs.h"
4510
4511#include <stdlib.h>
4512#include <iconv.h>
4513extern
4514#ifdef __cplusplus
4515"C"
4516#endif
4517#if defined(__STDC__) || defined(__cplusplus)
4518size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
4519#else
4520size_t iconv();
4521#endif
4522
4523int main() {
4524
4525; return 0; }
4526EOF
4c76f856 4527if { (eval echo configure:4528: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f91abfce
TT
4528 rm -rf conftest*
4529 am_cv_proto_iconv_arg1=""
4530else
4531 echo "configure: failed program was:" >&5
4532 cat conftest.$ac_ext >&5
4533 rm -rf conftest*
4534 am_cv_proto_iconv_arg1="const"
4535fi
4536rm -f conftest*
4537 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);"
4538fi
4539
4540 am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
4541 echo "$ac_t""${ac_t:-
4542 }$am_cv_proto_iconv" 1>&6
4543 cat >> confdefs.h <<EOF
4544#define ICONV_CONST $am_cv_proto_iconv_arg1
4545EOF
4546
4547 fi
4548 LIBICONV=
4549 if test "$am_cv_lib_iconv" = yes; then
b7f2fb96 4550 LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
f91abfce
TT
4551 fi
4552
4553
4554
86cf1cbd
KG
4555# We will need to find libiberty.h and ansidecl.h
4556saved_CFLAGS="$CFLAGS"
4557CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
8e944909 4558for ac_func in getenv atol sbrk abort atof getcwd getwd \
3b681e9d 4559 strsignal putc_unlocked fputs_unlocked fwrite_unlocked \
df2c9a44 4560 fprintf_unlocked strstr errno \
c1800ec8 4561 malloc realloc calloc free basename getopt clock
81bf3d9e 4562do
f31e826b
KG
4563 ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4564echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
4c76f856 4565echo "configure:4566: checking whether $ac_func is declared" >&5
f31e826b 4566if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
81bf3d9e
RH
4567 echo $ac_n "(cached) $ac_c" 1>&6
4568else
4569 cat > conftest.$ac_ext <<EOF
4c76f856 4570#line 4571 "configure"
81bf3d9e 4571#include "confdefs.h"
7afe8c41
KG
4572#undef $ac_tr_decl
4573#define $ac_tr_decl 1
4574
d02af173 4575#include "ansidecl.h"
86cf1cbd 4576#include "system.h"
f31e826b 4577
81bf3d9e 4578int main() {
86cf1cbd
KG
4579#ifndef $ac_func
4580char *(*pfn) = (char *(*)) $ac_func ;
4581#endif
81bf3d9e
RH
4582; return 0; }
4583EOF
4c76f856 4584if { (eval echo configure:4585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
81bf3d9e 4585 rm -rf conftest*
f31e826b 4586 eval "gcc_cv_have_decl_$ac_func=yes"
81bf3d9e
RH
4587else
4588 echo "configure: failed program was:" >&5
4589 cat conftest.$ac_ext >&5
4590 rm -rf conftest*
f31e826b 4591 eval "gcc_cv_have_decl_$ac_func=no"
81bf3d9e
RH
4592fi
4593rm -f conftest*
4594fi
4595
f31e826b
KG
4596if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
4597 echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
86cf1cbd 4598#define $ac_tr_decl 1
81bf3d9e 4599EOF
86cf1cbd 4600
81bf3d9e 4601else
f31e826b
KG
4602 echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
4603#define $ac_tr_decl 0
4604EOF
4605
81bf3d9e
RH
4606fi
4607
4608done
86cf1cbd 4609if test x = y ; then
05e12634 4610 cat >> confdefs.h <<\EOF
f31e826b 4611#define HAVE_DECL_GETENV 1
86cf1cbd 4612EOF
05e12634 4613 cat >> confdefs.h <<\EOF
f31e826b 4614#define HAVE_DECL_ATOL 1
86cf1cbd 4615EOF
05e12634 4616 cat >> confdefs.h <<\EOF
f31e826b 4617#define HAVE_DECL_SBRK 1
86cf1cbd 4618EOF
05e12634 4619 cat >> confdefs.h <<\EOF
f31e826b 4620#define HAVE_DECL_ABORT 1
86cf1cbd 4621EOF
05e12634 4622 cat >> confdefs.h <<\EOF
f31e826b 4623#define HAVE_DECL_ATOF 1
86cf1cbd 4624EOF
05e12634 4625 cat >> confdefs.h <<\EOF
f31e826b 4626#define HAVE_DECL_GETCWD 1
86cf1cbd 4627EOF
05e12634 4628 cat >> confdefs.h <<\EOF
f31e826b 4629#define HAVE_DECL_GETWD 1
86cf1cbd
KG
4630EOF
4631 \
05e12634 4632 cat >> confdefs.h <<\EOF
f31e826b 4633#define HAVE_DECL_STRSIGNAL 1
86cf1cbd 4634EOF
05e12634 4635 cat >> confdefs.h <<\EOF
f31e826b 4636#define HAVE_DECL_PUTC_UNLOCKED 1
86cf1cbd 4637EOF
05e12634 4638 cat >> confdefs.h <<\EOF
f31e826b 4639#define HAVE_DECL_FPUTS_UNLOCKED 1
3b681e9d
ZW
4640EOF
4641 cat >> confdefs.h <<\EOF
4642#define HAVE_DECL_FWRITE_UNLOCKED 1
4643EOF
4644 \
4645 cat >> confdefs.h <<\EOF
4646#define HAVE_DECL_FPRINTF_UNLOCKED 1
86cf1cbd 4647EOF
05e12634 4648 cat >> confdefs.h <<\EOF
f31e826b 4649#define HAVE_DECL_STRSTR 1
6c889b67 4650EOF
05e12634 4651 cat >> confdefs.h <<\EOF
6c889b67 4652#define HAVE_DECL_ERRNO 1
86cf1cbd
KG
4653EOF
4654 \
05e12634 4655 cat >> confdefs.h <<\EOF
f31e826b
KG
4656#define HAVE_DECL_MALLOC 1
4657EOF
05e12634 4658 cat >> confdefs.h <<\EOF
f31e826b 4659#define HAVE_DECL_REALLOC 1
86cf1cbd 4660EOF
05e12634 4661 cat >> confdefs.h <<\EOF
f31e826b 4662#define HAVE_DECL_CALLOC 1
86cf1cbd 4663EOF
05e12634 4664 cat >> confdefs.h <<\EOF
f31e826b 4665#define HAVE_DECL_FREE 1
86cf1cbd 4666EOF
05e12634 4667 cat >> confdefs.h <<\EOF
f31e826b
KG
4668#define HAVE_DECL_BASENAME 1
4669EOF
05e12634 4670 cat >> confdefs.h <<\EOF
f31e826b 4671#define HAVE_DECL_GETOPT 1
c1800ec8 4672EOF
05e12634 4673 cat >> confdefs.h <<\EOF
c1800ec8 4674#define HAVE_DECL_CLOCK 1
81bf3d9e 4675EOF
81bf3d9e
RH
4676fi
4677
81bf3d9e
RH
4678
4679for ac_func in getrlimit setrlimit getrusage
4680do
f31e826b
KG
4681 ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4682echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
4c76f856 4683echo "configure:4684: checking whether $ac_func is declared" >&5
f31e826b 4684if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
81bf3d9e
RH
4685 echo $ac_n "(cached) $ac_c" 1>&6
4686else
4687 cat > conftest.$ac_ext <<EOF
4c76f856 4688#line 4689 "configure"
81bf3d9e 4689#include "confdefs.h"
7afe8c41
KG
4690#undef $ac_tr_decl
4691#define $ac_tr_decl 1
4692
d02af173 4693#include "ansidecl.h"
86cf1cbd 4694#include "system.h"
81bf3d9e
RH
4695#ifdef HAVE_SYS_RESOURCE_H
4696#include <sys/resource.h>
4697#endif
4698
f31e826b 4699
81bf3d9e 4700int main() {
86cf1cbd
KG
4701#ifndef $ac_func
4702char *(*pfn) = (char *(*)) $ac_func ;
4703#endif
81bf3d9e
RH
4704; return 0; }
4705EOF
4c76f856 4706if { (eval echo configure:4707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
81bf3d9e 4707 rm -rf conftest*
f31e826b 4708 eval "gcc_cv_have_decl_$ac_func=yes"
81bf3d9e
RH
4709else
4710 echo "configure: failed program was:" >&5
4711 cat conftest.$ac_ext >&5
4712 rm -rf conftest*
f31e826b 4713 eval "gcc_cv_have_decl_$ac_func=no"
81bf3d9e
RH
4714fi
4715rm -f conftest*
4716fi
4717
f31e826b
KG
4718if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
4719 echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
86cf1cbd 4720#define $ac_tr_decl 1
81bf3d9e 4721EOF
86cf1cbd 4722
81bf3d9e 4723else
f31e826b
KG
4724 echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
4725#define $ac_tr_decl 0
4726EOF
4727
81bf3d9e
RH
4728fi
4729
4730done
86cf1cbd 4731if test x = y ; then
05e12634 4732 cat >> confdefs.h <<\EOF
f31e826b 4733#define HAVE_DECL_GETRLIMIT 1
86cf1cbd 4734EOF
05e12634 4735 cat >> confdefs.h <<\EOF
f31e826b 4736#define HAVE_DECL_SETRLIMIT 1
86cf1cbd 4737EOF
05e12634 4738 cat >> confdefs.h <<\EOF
f31e826b 4739#define HAVE_DECL_GETRUSAGE 1
86cf1cbd
KG
4740EOF
4741fi
4742
81bf3d9e 4743
c1800ec8
ZW
4744for ac_func in times
4745do
4746 ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4747echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
4c76f856 4748echo "configure:4749: checking whether $ac_func is declared" >&5
c1800ec8
ZW
4749if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
4750 echo $ac_n "(cached) $ac_c" 1>&6
4751else
4752 cat > conftest.$ac_ext <<EOF
4c76f856 4753#line 4754 "configure"
c1800ec8
ZW
4754#include "confdefs.h"
4755#undef $ac_tr_decl
4756#define $ac_tr_decl 1
4757
4758#include "ansidecl.h"
4759#include "system.h"
4760#ifdef HAVE_SYS_TIMES_H
4761#include <sys/times.h>
4762#endif
4763
4764
4765int main() {
4766#ifndef $ac_func
4767char *(*pfn) = (char *(*)) $ac_func ;
4768#endif
4769; return 0; }
4770EOF
4c76f856 4771if { (eval echo configure:4772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c1800ec8
ZW
4772 rm -rf conftest*
4773 eval "gcc_cv_have_decl_$ac_func=yes"
4774else
4775 echo "configure: failed program was:" >&5
4776 cat conftest.$ac_ext >&5
4777 rm -rf conftest*
4778 eval "gcc_cv_have_decl_$ac_func=no"
4779fi
4780rm -f conftest*
4781fi
4782
4783if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
4784 echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
4785#define $ac_tr_decl 1
4786EOF
4787
4788else
4789 echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
4790#define $ac_tr_decl 0
4791EOF
4792
4793fi
4794
4795done
4796if test x = y ; then
05e12634 4797 cat >> confdefs.h <<\EOF
c1800ec8
ZW
4798#define HAVE_DECL_TIMES 1
4799EOF
4800fi
4801
4802
4803# More time-related stuff.
4804echo $ac_n "checking for struct tms""... $ac_c" 1>&6
4c76f856 4805echo "configure:4806: checking for struct tms" >&5
c1800ec8
ZW
4806if eval "test \"`echo '$''{'ac_cv_struct_tms'+set}'`\" = set"; then
4807 echo $ac_n "(cached) $ac_c" 1>&6
4808else
4809
4810cat > conftest.$ac_ext <<EOF
4c76f856 4811#line 4812 "configure"
c1800ec8
ZW
4812#include "confdefs.h"
4813
4814#include "ansidecl.h"
4815#include "system.h"
4816#ifdef HAVE_SYS_TIMES_H
4817#include <sys/times.h>
4818#endif
4819
4820int main() {
4821struct tms tms;
4822; return 0; }
4823EOF
4c76f856 4824if { (eval echo configure:4825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c1800ec8
ZW
4825 rm -rf conftest*
4826 ac_cv_struct_tms=yes
4827else
4828 echo "configure: failed program was:" >&5
4829 cat conftest.$ac_ext >&5
4830 rm -rf conftest*
4831 ac_cv_struct_tms=no
4832fi
4833rm -f conftest*
4834fi
4835
4836echo "$ac_t""$ac_cv_struct_tms" 1>&6
4837if test $ac_cv_struct_tms = yes; then
4838 cat >> confdefs.h <<\EOF
4839#define HAVE_STRUCT_TMS 1
4840EOF
4841
4842fi
4843
4844# use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE.
4845# revisit after autoconf 2.50.
4846echo $ac_n "checking for clock_t""... $ac_c" 1>&6
4c76f856 4847echo "configure:4848: checking for clock_t" >&5
c1800ec8
ZW
4848if eval "test \"`echo '$''{'gcc_cv_type_clock_t'+set}'`\" = set"; then
4849 echo $ac_n "(cached) $ac_c" 1>&6
4850else
4851
4852cat > conftest.$ac_ext <<EOF
4c76f856 4853#line 4854 "configure"
c1800ec8
ZW
4854#include "confdefs.h"
4855
4856#include "ansidecl.h"
4857#include "system.h"
4858
4859int main() {
4860clock_t x;
4861; return 0; }
4862EOF
4c76f856 4863if { (eval echo configure:4864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c1800ec8
ZW
4864 rm -rf conftest*
4865 gcc_cv_type_clock_t=yes
4866else
4867 echo "configure: failed program was:" >&5
4868 cat conftest.$ac_ext >&5
4869 rm -rf conftest*
4870 gcc_cv_type_clock_t=no
4871fi
4872rm -f conftest*
4873fi
4874
4875echo "$ac_t""$gcc_cv_type_clock_t" 1>&6
4876if test $gcc_cv_type_clock_t = yes; then
4877 cat >> confdefs.h <<\EOF
4878#define HAVE_CLOCK_T 1
4879EOF
4880
4881fi
4882
86cf1cbd
KG
4883# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
4884CFLAGS="$saved_CFLAGS"
81bf3d9e 4885
75923b2f
MK
4886# mkdir takes a single argument on some systems.
4887echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6
4c76f856 4888echo "configure:4889: checking if mkdir takes one argument" >&5
75923b2f
MK
4889if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then
4890 echo $ac_n "(cached) $ac_c" 1>&6
4891else
4892 cat > conftest.$ac_ext <<EOF
4c76f856 4893#line 4894 "configure"
75923b2f
MK
4894#include "confdefs.h"
4895
4896#include <sys/types.h>
4897#ifdef HAVE_SYS_STAT_H
4898# include <sys/stat.h>
4899#endif
4900#ifdef HAVE_UNISTD_H
4901# include <unistd.h>
4902#endif
4903#ifdef HAVE_DIRECT_H
4904# include <direct.h>
4905#endif
4906int main() {
4907mkdir ("foo", 0);
4908; return 0; }
4909EOF
4c76f856 4910if { (eval echo configure:4911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
75923b2f
MK
4911 rm -rf conftest*
4912 gcc_cv_mkdir_takes_one_arg=no
4913else
4914 echo "configure: failed program was:" >&5
4915 cat conftest.$ac_ext >&5
4916 rm -rf conftest*
4917 gcc_cv_mkdir_takes_one_arg=yes
4918fi
4919rm -f conftest*
4920fi
4921
4922echo "$ac_t""$gcc_cv_mkdir_takes_one_arg" 1>&6
4923if test $gcc_cv_mkdir_takes_one_arg = yes ; then
4924 cat >> confdefs.h <<\EOF
4925#define MKDIR_TAKES_ONE_ARG 1
4926EOF
4927
4928fi
4929
4930
861bb6c1
JL
4931# File extensions
4932manext='.1'
4933objext='.o'
4934
4935
4936
4937build_xm_file=
f6cb0e63 4938build_xm_defines=
861bb6c1
JL
4939build_install_headers_dir=install-headers-tar
4940build_exeext=
4941host_xm_file=
f6cb0e63 4942host_xm_defines=
861bb6c1
JL
4943host_xmake_file=
4944host_truncate_target=
6e26218f 4945host_exeext=
861bb6c1
JL
4946
4947# Decode the host machine, then the target machine.
4948# For the host machine, we save the xm_file variable as host_xm_file;
4949# then we decode the target machine and forget everything else
4950# that came from the host machine.
4951for machine in $build $host $target; do
61ed06c3 4952 . ${srcdir}/config.gcc
861bb6c1
JL
4953done
4954
4955extra_objs="${host_extra_objs} ${extra_objs}"
4956
4957# Default the target-machine variables that were not explicitly set.
75bffa71 4958if test x"$tm_file" = x
861bb6c1
JL
4959then tm_file=$cpu_type/$cpu_type.h; fi
4960
6b2adea9 4961if test x"$extra_headers" = x
861bb6c1
JL
4962then extra_headers=; fi
4963
75bffa71 4964if test x$md_file = x
e98e406f 4965then md_file=$cpu_type/$cpu_type.md; fi
861bb6c1 4966
75bffa71 4967if test x$out_file = x
861bb6c1
JL
4968then out_file=$cpu_type/$cpu_type.c; fi
4969
75bffa71 4970if test x"$tmake_file" = x
861bb6c1
JL
4971then tmake_file=$cpu_type/t-$cpu_type
4972fi
4973
90e6a802 4974if test x"$dwarf2" = xyes
756ee602 4975then tm_file="$tm_file tm-dwarf2.h"
90e6a802
RL
4976fi
4977
75bffa71 4978if test x$float_format = x
861bb6c1
JL
4979then float_format=i64
4980fi
4981
027ea2a7
JW
4982if test $float_format = none
4983then float_h_file=Makefile.in
4984else float_h_file=float-$float_format.h
4985fi
4986
9fc9b82a 4987# Handle cpp installation.
3ecc3258 4988if test x$enable_cpp != xno
9fc9b82a
L
4989then
4990 tmake_file="$tmake_file t-install-cpp"
4991fi
4992
861bb6c1 4993# Say what files are being used for the output code and MD file.
11642c3a 4994echo "Using \`$srcdir/config/$out_file' for machine-specific logic."
861bb6c1
JL
4995echo "Using \`$srcdir/config/$md_file' as machine description file."
4996
11642c3a 4997# If any of the xm_file variables contain nonexistent files, warn
4dc0535b
ZW
4998# about them and drop them.
4999
11642c3a
ZW
5000bx=
5001for x in $build_xm_file; do
5002 if test -f $srcdir/config/$x
5003 then bx="$bx $x"
11642c3a
ZW
5004 else echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
5005 fi
5006done
5007build_xm_file="$bx"
5008
5009hx=
5010for x in $host_xm_file; do
5011 if test -f $srcdir/config/$x
5012 then hx="$hx $x"
11642c3a
ZW
5013 else echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
5014 fi
5015done
5016host_xm_file="$hx"
5017
5018tx=
5019for x in $xm_file; do
5020 if test -f $srcdir/config/$x
5021 then tx="$tx $x"
11642c3a
ZW
5022 else echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
5023 fi
5024done
5025xm_file="$tx"
5026
861bb6c1
JL
5027count=a
5028for f in $tm_file; do
5029 count=${count}x
5030done
75bffa71 5031if test $count = ax; then
861bb6c1
JL
5032 echo "Using \`$srcdir/config/$tm_file' as target machine macro file."
5033else
5034 echo "Using the following target machine macro files:"
5035 for f in $tm_file; do
5036 echo " $srcdir/config/$f"
5037 done
5038fi
5039
5040count=a
5041for f in $host_xm_file; do
5042 count=${count}x
5043done
11642c3a
ZW
5044if test $count = a; then
5045 :
5046elif test $count = ax; then
861bb6c1
JL
5047 echo "Using \`$srcdir/config/$host_xm_file' as host machine macro file."
5048else
5049 echo "Using the following host machine macro files:"
5050 for f in $host_xm_file; do
5051 echo " $srcdir/config/$f"
5052 done
5053fi
5054
75bffa71 5055if test "$host_xm_file" != "$build_xm_file"; then
861bb6c1
JL
5056 count=a
5057 for f in $build_xm_file; do
5058 count=${count}x
5059 done
11642c3a
ZW
5060 if test $count = a; then
5061 :
5062 elif test $count = ax; then
861bb6c1
JL
5063 echo "Using \`$srcdir/config/$build_xm_file' as build machine macro file."
5064 else
5065 echo "Using the following build machine macro files:"
5066 for f in $build_xm_file; do
5067 echo " $srcdir/config/$f"
5068 done
5069 fi
5070fi
5071
75bffa71
ILT
5072if test x$thread_file = x; then
5073 if test x$target_thread_file != x; then
a851212a
JW
5074 thread_file=$target_thread_file
5075 else
5076 thread_file='single'
5077 fi
861bb6c1
JL
5078fi
5079
b7cb92ad 5080# auto-host.h is the file containing items generated by autoconf and is
e9a25f70 5081# the first file included by config.h.
b7cb92ad 5082# If host=build, it is correct to have hconfig include auto-host.h
db81d74a
RH
5083# as well. If host!=build, we are in error and need to do more
5084# work to find out the build config parameters.
75bffa71 5085if test x$host = x$build
db81d74a 5086then
eaf4e618 5087 build_auto=auto-host.h
06f0b04c 5088 FORBUILD=..
b7cb92ad
JL
5089else
5090 # We create a subdir, then run autoconf in the subdir.
5091 # To prevent recursion we set host and build for the new
5092 # invocation of configure to the build for this invocation
5093 # of configure.
5094 tempdir=build.$$
5095 rm -rf $tempdir
5096 mkdir $tempdir
5097 cd $tempdir
5098 case ${srcdir} in
255b8a49 5099 /* | A-Za-z:\\/* ) realsrcdir=${srcdir};;
b7cb92ad
JL
5100 *) realsrcdir=../${srcdir};;
5101 esac
d920e825
L
5102 saved_CFLAGS="${CFLAGS}"
5103 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
5104 ${realsrcdir}/configure \
534d0cc0 5105 --target=$target_alias --host=$build_alias --build=$build_alias
d920e825 5106 CFLAGS="${saved_CFLAGS}"
b7cb92ad
JL
5107
5108 # We just finished tests for the build machine, so rename
5109 # the file auto-build.h in the gcc directory.
5110 mv auto-host.h ../auto-build.h
5111 cd ..
5112 rm -rf $tempdir
eaf4e618 5113 build_auto=auto-build.h
06f0b04c 5114 FORBUILD=../$build
db81d74a
RH
5115fi
5116
06f0b04c 5117
eaf4e618 5118tm_file="${tm_file} defaults.h"
d02af173
ZW
5119host_xm_file="auto-host.h ansidecl.h ${host_xm_file} ${tm_file}"
5120build_xm_file="${build_auto} ansidecl.h ${build_xm_file} ${tm_file}"
5121xm_file="ansidecl.h ${xm_file} ${tm_file}"
0056a9b5 5122
861bb6c1 5123# Truncate the target if necessary
75bffa71 5124if test x$host_truncate_target != x; then
861bb6c1
JL
5125 target=`echo $target | sed -e 's/\(..............\).*/\1/'`
5126fi
5127
f1943b77 5128# Get the version trigger filename from the toplevel
75bffa71 5129if test "${with_gcc_version_trigger+set}" = set; then
f1943b77
MH
5130 gcc_version_trigger=$with_gcc_version_trigger
5131else
5132 gcc_version_trigger=${srcdir}/version.c
5133fi
022dae81 5134gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
8763704d 5135gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
861bb6c1 5136
cc1e60ea 5137# Compile in configure arguments.
8105825d 5138if test -f configargs.h ; then
cc1e60ea 5139 # Being re-configured.
022dae81 5140 gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'`
cc1e60ea
JM
5141 gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
5142else
5143 gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
5144fi
5145cat > configargs.h <<EOF
5146/* Generated automatically. */
5147static const char configuration_arguments[] = "$gcc_config_arguments";
a6687d2b 5148static const char thread_model[] = "$thread_file";
cc1e60ea
JM
5149EOF
5150
ab87f8c8
JL
5151# Internationalization
5152PACKAGE=gcc
5153VERSION="$gcc_version"
861bb6c1 5154
ab87f8c8
JL
5155
5156
dc6746e7 5157# Enable NLS support by default
ab87f8c8
JL
5158# Check whether --enable-nls or --disable-nls was given.
5159if test "${enable_nls+set}" = set; then
5160 enableval="$enable_nls"
5161 :
861bb6c1 5162else
dc6746e7 5163 enable_nls=yes
861bb6c1 5164fi
861bb6c1 5165
861bb6c1 5166
dc6746e7
PT
5167# if cross compiling, disable NLS support.
5168# It's not worth the trouble, at least for now.
5169
063a4b85 5170if test "${build}" != "${host}" && test "x$enable_nls" = "xyes"; then
dc6746e7
PT
5171 echo "configure: warning: Disabling NLS support for canadian cross compiler." 1>&2
5172 enable_nls=no
5173fi
5174
861bb6c1 5175
71a94577
ZW
5176
5177echo $ac_n "checking for library containing strerror""... $ac_c" 1>&6
4c76f856 5178echo "configure:5179: checking for library containing strerror" >&5
71a94577 5179if eval "test \"`echo '$''{'ac_cv_search_strerror'+set}'`\" = set"; then
ab87f8c8
JL
5180 echo $ac_n "(cached) $ac_c" 1>&6
5181else
71a94577
ZW
5182 ac_func_search_save_LIBS="$LIBS"
5183ac_cv_search_strerror="no"
ab87f8c8 5184cat > conftest.$ac_ext <<EOF
4c76f856 5185#line 5186 "configure"
ab87f8c8
JL
5186#include "confdefs.h"
5187/* Override any gcc2 internal prototype to avoid an error. */
5188/* We use char because int might match the return type of a gcc2
5189 builtin and then its argument prototype would still apply. */
5190char strerror();
861bb6c1 5191
ab87f8c8
JL
5192int main() {
5193strerror()
5194; return 0; }
5195EOF
4c76f856 5196if { (eval echo configure:5197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8 5197 rm -rf conftest*
71a94577 5198 ac_cv_search_strerror="none required"
ab87f8c8
JL
5199else
5200 echo "configure: failed program was:" >&5
5201 cat conftest.$ac_ext >&5
861bb6c1 5202fi
ab87f8c8 5203rm -f conftest*
71a94577
ZW
5204test "$ac_cv_search_strerror" = "no" && for i in cposix; do
5205LIBS="-l$i $ac_func_search_save_LIBS"
5206cat > conftest.$ac_ext <<EOF
4c76f856 5207#line 5208 "configure"
71a94577
ZW
5208#include "confdefs.h"
5209/* Override any gcc2 internal prototype to avoid an error. */
5210/* We use char because int might match the return type of a gcc2
5211 builtin and then its argument prototype would still apply. */
5212char strerror();
861bb6c1 5213
71a94577
ZW
5214int main() {
5215strerror()
5216; return 0; }
5217EOF
4c76f856 5218if { (eval echo configure:5219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
71a94577
ZW
5219 rm -rf conftest*
5220 ac_cv_search_strerror="-l$i"
5221break
861bb6c1 5222else
71a94577
ZW
5223 echo "configure: failed program was:" >&5
5224 cat conftest.$ac_ext >&5
5225fi
5226rm -f conftest*
5227done
5228LIBS="$ac_func_search_save_LIBS"
861bb6c1
JL
5229fi
5230
71a94577
ZW
5231echo "$ac_t""$ac_cv_search_strerror" 1>&6
5232if test "$ac_cv_search_strerror" != "no"; then
5233 test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
5234
5235else :
5236
5237fi
ab87f8c8 5238
2ce3c6c6 5239
ab87f8c8 5240echo $ac_n "checking for working const""... $ac_c" 1>&6
4c76f856 5241echo "configure:5242: checking for working const" >&5
ab87f8c8
JL
5242if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
5243 echo $ac_n "(cached) $ac_c" 1>&6
861bb6c1 5244else
ab87f8c8 5245 cat > conftest.$ac_ext <<EOF
4c76f856 5246#line 5247 "configure"
ab87f8c8 5247#include "confdefs.h"
861bb6c1 5248
ab87f8c8
JL
5249int main() {
5250
5251/* Ultrix mips cc rejects this. */
130fadbb 5252typedef int charset[2]; const charset x;
ab87f8c8
JL
5253/* SunOS 4.1.1 cc rejects this. */
5254char const *const *ccp;
5255char **p;
5256/* NEC SVR4.0.2 mips cc rejects this. */
5257struct point {int x, y;};
5258static struct point const zero = {0,0};
5259/* AIX XL C 1.02.0.0 rejects this.
5260 It does not let you subtract one const X* pointer from another in an arm
5261 of an if-expression whose if-part is not a constant expression */
5262const char *g = "string";
5263ccp = &g + (g ? g-g : 0);
5264/* HPUX 7.0 cc rejects these. */
5265++ccp;
5266p = (char**) ccp;
5267ccp = (char const *const *) p;
5268{ /* SCO 3.2v4 cc rejects this. */
5269 char *t;
5270 char const *s = 0 ? (char *) 0 : (char const *) 0;
5271
5272 *t++ = 0;
5273}
5274{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
5275 int x[] = {25, 17};
5276 const int *foo = &x[0];
5277 ++foo;
5278}
5279{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
5280 typedef const int *iptr;
5281 iptr p = 0;
5282 ++p;
5283}
5284{ /* AIX XL C 1.02.0.0 rejects this saying
5285 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
5286 struct s { int j; const int *ap[3]; };
5287 struct s *b; b->j = 5;
5288}
5289{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
5290 const int foo = 10;
5291}
5292
5293; return 0; }
5294EOF
4c76f856 5295if { (eval echo configure:5296: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ab87f8c8
JL
5296 rm -rf conftest*
5297 ac_cv_c_const=yes
861bb6c1 5298else
ab87f8c8
JL
5299 echo "configure: failed program was:" >&5
5300 cat conftest.$ac_ext >&5
5301 rm -rf conftest*
5302 ac_cv_c_const=no
5303fi
5304rm -f conftest*
861bb6c1
JL
5305fi
5306
ab87f8c8
JL
5307echo "$ac_t""$ac_cv_c_const" 1>&6
5308if test $ac_cv_c_const = no; then
5309 cat >> confdefs.h <<\EOF
5310#define const
5311EOF
5312
861bb6c1
JL
5313fi
5314
ab87f8c8 5315echo $ac_n "checking for off_t""... $ac_c" 1>&6
4c76f856 5316echo "configure:5317: checking for off_t" >&5
ab87f8c8
JL
5317if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
5318 echo $ac_n "(cached) $ac_c" 1>&6
5319else
5320 cat > conftest.$ac_ext <<EOF
4c76f856 5321#line 5322 "configure"
ab87f8c8
JL
5322#include "confdefs.h"
5323#include <sys/types.h>
5324#if STDC_HEADERS
5325#include <stdlib.h>
5326#include <stddef.h>
5327#endif
5328EOF
5329if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
b27d2bd5 5330 egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
ab87f8c8 5331 rm -rf conftest*
cb65112a 5332 ac_cv_type_off_t=yes
ab87f8c8
JL
5333else
5334 rm -rf conftest*
cb65112a 5335 ac_cv_type_off_t=no
ab87f8c8
JL
5336fi
5337rm -f conftest*
5338
5339fi
cb65112a
AO
5340echo "$ac_t""$ac_cv_type_off_t" 1>&6
5341if test $ac_cv_type_off_t = no; then
5342 cat >> confdefs.h <<\EOF
ab87f8c8
JL
5343#define off_t long
5344EOF
5345
5346fi
5347
5348echo $ac_n "checking for size_t""... $ac_c" 1>&6
4c76f856 5349echo "configure:5350: checking for size_t" >&5
ab87f8c8
JL
5350if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
5351 echo $ac_n "(cached) $ac_c" 1>&6
5352else
5353 cat > conftest.$ac_ext <<EOF
4c76f856 5354#line 5355 "configure"
ab87f8c8
JL
5355#include "confdefs.h"
5356#include <sys/types.h>
5357#if STDC_HEADERS
5358#include <stdlib.h>
5359#include <stddef.h>
5360#endif
5361EOF
5362if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
b27d2bd5 5363 egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
ab87f8c8 5364 rm -rf conftest*
cb65112a 5365 ac_cv_type_size_t=yes
ab87f8c8
JL
5366else
5367 rm -rf conftest*
cb65112a 5368 ac_cv_type_size_t=no
ab87f8c8
JL
5369fi
5370rm -f conftest*
5371
5372fi
cb65112a
AO
5373echo "$ac_t""$ac_cv_type_size_t" 1>&6
5374if test $ac_cv_type_size_t = no; then
5375 cat >> confdefs.h <<\EOF
ab87f8c8
JL
5376#define size_t unsigned
5377EOF
5378
5379fi
5380
71a94577
ZW
5381# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
5382# for constant arguments. Useless!
5383echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
4c76f856 5384echo "configure:5385: checking for working alloca.h" >&5
71a94577 5385if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
ab87f8c8
JL
5386 echo $ac_n "(cached) $ac_c" 1>&6
5387else
5388 cat > conftest.$ac_ext <<EOF
4c76f856 5389#line 5390 "configure"
ab87f8c8 5390#include "confdefs.h"
71a94577
ZW
5391#include <alloca.h>
5392int main() {
5393char *p = alloca(2 * sizeof(int));
5394; return 0; }
ab87f8c8 5395EOF
4c76f856 5396if { (eval echo configure:5397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8 5397 rm -rf conftest*
71a94577 5398 ac_cv_header_alloca_h=yes
ab87f8c8 5399else
ab87f8c8
JL
5400 echo "configure: failed program was:" >&5
5401 cat conftest.$ac_ext >&5
5402 rm -rf conftest*
71a94577 5403 ac_cv_header_alloca_h=no
ab87f8c8
JL
5404fi
5405rm -f conftest*
5406fi
71a94577
ZW
5407
5408echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
5409if test $ac_cv_header_alloca_h = yes; then
5410 cat >> confdefs.h <<\EOF
5411#define HAVE_ALLOCA_H 1
ab87f8c8 5412EOF
71a94577 5413
ab87f8c8 5414fi
ab87f8c8 5415
71a94577 5416echo $ac_n "checking for alloca""... $ac_c" 1>&6
4c76f856 5417echo "configure:5418: checking for alloca" >&5
71a94577 5418if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
ab87f8c8
JL
5419 echo $ac_n "(cached) $ac_c" 1>&6
5420else
5421 cat > conftest.$ac_ext <<EOF
4c76f856 5422#line 5423 "configure"
ab87f8c8 5423#include "confdefs.h"
ab87f8c8 5424
71a94577
ZW
5425#ifdef __GNUC__
5426# define alloca __builtin_alloca
ab87f8c8 5427#else
71a94577
ZW
5428# ifdef _MSC_VER
5429# include <malloc.h>
5430# define alloca _alloca
5431# else
5432# if HAVE_ALLOCA_H
5433# include <alloca.h>
5434# else
5435# ifdef _AIX
5436 #pragma alloca
5437# else
5438# ifndef alloca /* predefined by HP cc +Olibcalls */
5439char *alloca ();
5440# endif
5441# endif
5442# endif
5443# endif
ab87f8c8
JL
5444#endif
5445
71a94577
ZW
5446int main() {
5447char *p = (char *) alloca(1);
ab87f8c8
JL
5448; return 0; }
5449EOF
4c76f856 5450if { (eval echo configure:5451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8 5451 rm -rf conftest*
71a94577 5452 ac_cv_func_alloca_works=yes
ab87f8c8
JL
5453else
5454 echo "configure: failed program was:" >&5
5455 cat conftest.$ac_ext >&5
5456 rm -rf conftest*
71a94577 5457 ac_cv_func_alloca_works=no
ab87f8c8
JL
5458fi
5459rm -f conftest*
5460fi
5461
71a94577
ZW
5462echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
5463if test $ac_cv_func_alloca_works = yes; then
5464 cat >> confdefs.h <<\EOF
5465#define HAVE_ALLOCA 1
ab87f8c8 5466EOF
71a94577
ZW
5467
5468fi
5469
5470if test $ac_cv_func_alloca_works = no; then
5471 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
5472 # that cause trouble. Some versions do not even contain alloca or
5473 # contain a buggy version. If you still want to use their alloca,
5474 # use ar to extract alloca.o from them instead of compiling alloca.c.
5475 ALLOCA=alloca.${ac_objext}
5476 cat >> confdefs.h <<\EOF
5477#define C_ALLOCA 1
5478EOF
5479
5480
5481echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
4c76f856 5482echo "configure:5483: checking whether alloca needs Cray hooks" >&5
71a94577
ZW
5483if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
5484 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8 5485else
71a94577 5486 cat > conftest.$ac_ext <<EOF
4c76f856 5487#line 5488 "configure"
71a94577
ZW
5488#include "confdefs.h"
5489#if defined(CRAY) && ! defined(CRAY2)
5490webecray
5491#else
5492wenotbecray
5493#endif
5494
5495EOF
5496if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5497 egrep "webecray" >/dev/null 2>&1; then
5498 rm -rf conftest*
5499 ac_cv_os_cray=yes
5500else
5501 rm -rf conftest*
5502 ac_cv_os_cray=no
ab87f8c8 5503fi
71a94577 5504rm -f conftest*
ab87f8c8 5505
71a94577 5506fi
ab87f8c8 5507
71a94577
ZW
5508echo "$ac_t""$ac_cv_os_cray" 1>&6
5509if test $ac_cv_os_cray = yes; then
5510for ac_func in _getb67 GETB67 getb67; do
5511 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4c76f856 5512echo "configure:5513: checking for $ac_func" >&5
ab87f8c8
JL
5513if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5514 echo $ac_n "(cached) $ac_c" 1>&6
5515else
5516 cat > conftest.$ac_ext <<EOF
4c76f856 5517#line 5518 "configure"
ab87f8c8
JL
5518#include "confdefs.h"
5519/* System header to define __stub macros and hopefully few prototypes,
5520 which can conflict with char $ac_func(); below. */
5521#include <assert.h>
5522/* Override any gcc2 internal prototype to avoid an error. */
5523/* We use char because int might match the return type of a gcc2
5524 builtin and then its argument prototype would still apply. */
5525char $ac_func();
5526
5527int main() {
5528
5529/* The GNU C library defines this for functions which it implements
5530 to always fail with ENOSYS. Some functions are actually named
5531 something starting with __ and the normal name is an alias. */
5532#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5533choke me
5534#else
99b09ff3 5535$ac_func();
ab87f8c8
JL
5536#endif
5537
5538; return 0; }
5539EOF
4c76f856 5540if { (eval echo configure:5541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8
JL
5541 rm -rf conftest*
5542 eval "ac_cv_func_$ac_func=yes"
5543else
5544 echo "configure: failed program was:" >&5
5545 cat conftest.$ac_ext >&5
5546 rm -rf conftest*
5547 eval "ac_cv_func_$ac_func=no"
5548fi
5549rm -f conftest*
5550fi
5551
5552if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5553 echo "$ac_t""yes" 1>&6
ab87f8c8 5554 cat >> confdefs.h <<EOF
71a94577 5555#define CRAY_STACKSEG_END $ac_func
ab87f8c8 5556EOF
71a94577
ZW
5557
5558 break
ab87f8c8
JL
5559else
5560 echo "$ac_t""no" 1>&6
5561fi
ab87f8c8 5562
71a94577
ZW
5563done
5564fi
ab87f8c8 5565
71a94577 5566echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
4c76f856 5567echo "configure:5568: checking stack direction for C alloca" >&5
71a94577 5568if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
ab87f8c8 5569 echo $ac_n "(cached) $ac_c" 1>&6
71a94577
ZW
5570else
5571 if test "$cross_compiling" = yes; then
5572 ac_cv_c_stack_direction=0
ab87f8c8
JL
5573else
5574 cat > conftest.$ac_ext <<EOF
4c76f856 5575#line 5576 "configure"
ab87f8c8 5576#include "confdefs.h"
71a94577
ZW
5577find_stack_direction ()
5578{
5579 static char *addr = 0;
5580 auto char dummy;
5581 if (addr == 0)
5582 {
5583 addr = &dummy;
5584 return find_stack_direction ();
5585 }
5586 else
5587 return (&dummy > addr) ? 1 : -1;
5588}
5589main ()
5590{
5591 exit (find_stack_direction() < 0);
5592}
ab87f8c8 5593EOF
4c76f856 5594if { (eval echo configure:5595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
71a94577
ZW
5595then
5596 ac_cv_c_stack_direction=1
ab87f8c8
JL
5597else
5598 echo "configure: failed program was:" >&5
5599 cat conftest.$ac_ext >&5
71a94577
ZW
5600 rm -fr conftest*
5601 ac_cv_c_stack_direction=-1
ab87f8c8 5602fi
71a94577 5603rm -fr conftest*
ab87f8c8
JL
5604fi
5605
71a94577
ZW
5606fi
5607
5608echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
5609cat >> confdefs.h <<EOF
5610#define STACK_DIRECTION $ac_cv_c_stack_direction
ab87f8c8
JL
5611EOF
5612
ab87f8c8
JL
5613fi
5614
ab87f8c8 5615
71a94577 5616 echo $ac_n "checking whether we are using the GNU C Library 2.1 or newer""... $ac_c" 1>&6
4c76f856 5617echo "configure:5618: checking whether we are using the GNU C Library 2.1 or newer" >&5
71a94577
ZW
5618if eval "test \"`echo '$''{'ac_cv_gnu_library_2_1'+set}'`\" = set"; then
5619 echo $ac_n "(cached) $ac_c" 1>&6
5620else
5621 cat > conftest.$ac_ext <<EOF
4c76f856 5622#line 5623 "configure"
71a94577 5623#include "confdefs.h"
ab87f8c8 5624
71a94577
ZW
5625#include <features.h>
5626#ifdef __GNU_LIBRARY__
5627 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
5628 Lucky GNU user
5629 #endif
5630#endif
5631
ab87f8c8 5632EOF
71a94577
ZW
5633if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5634 egrep "Lucky GNU user" >/dev/null 2>&1; then
5635 rm -rf conftest*
5636 ac_cv_gnu_library_2_1=yes
ab87f8c8 5637else
71a94577
ZW
5638 rm -rf conftest*
5639 ac_cv_gnu_library_2_1=no
ab87f8c8 5640fi
71a94577 5641rm -f conftest*
ab87f8c8 5642
71a94577
ZW
5643
5644
5645fi
ab87f8c8 5646
71a94577
ZW
5647echo "$ac_t""$ac_cv_gnu_library_2_1" 1>&6
5648
5649 GLIBC21="$ac_cv_gnu_library_2_1"
5650
ab87f8c8 5651
71a94577
ZW
5652
5653 for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
5654stdlib.h string.h unistd.h sys/param.h
5655do
5656ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5657echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4c76f856 5658echo "configure:5659: checking for $ac_hdr" >&5
ab87f8c8
JL
5659if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5660 echo $ac_n "(cached) $ac_c" 1>&6
5661else
5662 cat > conftest.$ac_ext <<EOF
4c76f856 5663#line 5664 "configure"
ab87f8c8 5664#include "confdefs.h"
71a94577 5665#include <$ac_hdr>
ab87f8c8
JL
5666EOF
5667ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4c76f856 5668{ (eval echo configure:5669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
cd9e5e7c 5669ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ab87f8c8
JL
5670if test -z "$ac_err"; then
5671 rm -rf conftest*
5672 eval "ac_cv_header_$ac_safe=yes"
5673else
5674 echo "$ac_err" >&5
5675 echo "configure: failed program was:" >&5
5676 cat conftest.$ac_ext >&5
5677 rm -rf conftest*
5678 eval "ac_cv_header_$ac_safe=no"
5679fi
5680rm -f conftest*
5681fi
5682if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5683 echo "$ac_t""yes" 1>&6
71a94577
ZW
5684 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5685 cat >> confdefs.h <<EOF
5686#define $ac_tr_hdr 1
ab87f8c8 5687EOF
71a94577 5688
ab87f8c8 5689else
71a94577 5690 echo "$ac_t""no" 1>&6
ab87f8c8 5691fi
71a94577 5692done
ab87f8c8 5693
71a94577
ZW
5694 for ac_func in feof_unlocked fgets_unlocked getcwd getegid geteuid \
5695getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
5696strdup strtoul tsearch __argz_count __argz_stringify __argz_next
5697do
5698echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4c76f856 5699echo "configure:5700: checking for $ac_func" >&5
71a94577 5700if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
ab87f8c8
JL
5701 echo $ac_n "(cached) $ac_c" 1>&6
5702else
71a94577 5703 cat > conftest.$ac_ext <<EOF
4c76f856 5704#line 5705 "configure"
ab87f8c8 5705#include "confdefs.h"
71a94577
ZW
5706/* System header to define __stub macros and hopefully few prototypes,
5707 which can conflict with char $ac_func(); below. */
5708#include <assert.h>
ab87f8c8
JL
5709/* Override any gcc2 internal prototype to avoid an error. */
5710/* We use char because int might match the return type of a gcc2
5711 builtin and then its argument prototype would still apply. */
71a94577 5712char $ac_func();
ab87f8c8
JL
5713
5714int main() {
71a94577
ZW
5715
5716/* The GNU C library defines this for functions which it implements
5717 to always fail with ENOSYS. Some functions are actually named
5718 something starting with __ and the normal name is an alias. */
5719#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5720choke me
5721#else
5722$ac_func();
5723#endif
5724
ab87f8c8
JL
5725; return 0; }
5726EOF
4c76f856 5727if { (eval echo configure:5728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8 5728 rm -rf conftest*
71a94577 5729 eval "ac_cv_func_$ac_func=yes"
ab87f8c8
JL
5730else
5731 echo "configure: failed program was:" >&5
5732 cat conftest.$ac_ext >&5
5733 rm -rf conftest*
71a94577 5734 eval "ac_cv_func_$ac_func=no"
ab87f8c8
JL
5735fi
5736rm -f conftest*
ab87f8c8 5737fi
71a94577
ZW
5738
5739if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
ab87f8c8 5740 echo "$ac_t""yes" 1>&6
71a94577
ZW
5741 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5742 cat >> confdefs.h <<EOF
5743#define $ac_tr_func 1
5744EOF
5745
ab87f8c8 5746else
71a94577
ZW
5747 echo "$ac_t""no" 1>&6
5748fi
5749done
5750
5751
5752
5753
b7f2fb96 5754 am_cv_lib_iconv_ldpath=
71a94577
ZW
5755 # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
5756if test "${with_libiconv_prefix+set}" = set; then
5757 withval="$with_libiconv_prefix"
5758
5759 for dir in `echo "$withval" | tr : ' '`; do
5760 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
b7f2fb96 5761 if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
71a94577
ZW
5762 done
5763
5764fi
ab87f8c8 5765
71a94577
ZW
5766
5767 echo $ac_n "checking for iconv""... $ac_c" 1>&6
4c76f856 5768echo "configure:5769: checking for iconv" >&5
71a94577
ZW
5769if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
5770 echo $ac_n "(cached) $ac_c" 1>&6
5771else
5772
5773 am_cv_func_iconv="no, consider installing GNU libiconv"
5774 am_cv_lib_iconv=no
5775 cat > conftest.$ac_ext <<EOF
4c76f856 5776#line 5777 "configure"
71a94577
ZW
5777#include "confdefs.h"
5778#include <stdlib.h>
5779#include <iconv.h>
ab87f8c8 5780int main() {
71a94577
ZW
5781iconv_t cd = iconv_open("","");
5782 iconv(cd,NULL,NULL,NULL,NULL);
5783 iconv_close(cd);
ab87f8c8
JL
5784; return 0; }
5785EOF
4c76f856 5786if { (eval echo configure:5787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8 5787 rm -rf conftest*
71a94577 5788 am_cv_func_iconv=yes
ab87f8c8
JL
5789else
5790 echo "configure: failed program was:" >&5
5791 cat conftest.$ac_ext >&5
ab87f8c8
JL
5792fi
5793rm -f conftest*
71a94577
ZW
5794 if test "$am_cv_func_iconv" != yes; then
5795 am_save_LIBS="$LIBS"
b7f2fb96 5796 LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
71a94577 5797 cat > conftest.$ac_ext <<EOF
4c76f856 5798#line 5799 "configure"
71a94577
ZW
5799#include "confdefs.h"
5800#include <stdlib.h>
5801#include <iconv.h>
5802int main() {
5803iconv_t cd = iconv_open("","");
5804 iconv(cd,NULL,NULL,NULL,NULL);
5805 iconv_close(cd);
5806; return 0; }
5807EOF
4c76f856 5808if { (eval echo configure:5809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
71a94577
ZW
5809 rm -rf conftest*
5810 am_cv_lib_iconv=yes
5811 am_cv_func_iconv=yes
ab87f8c8 5812else
71a94577
ZW
5813 echo "configure: failed program was:" >&5
5814 cat conftest.$ac_ext >&5
ab87f8c8 5815fi
71a94577
ZW
5816rm -f conftest*
5817 LIBS="$am_save_LIBS"
5818 fi
5819
ab87f8c8
JL
5820fi
5821
71a94577
ZW
5822echo "$ac_t""$am_cv_func_iconv" 1>&6
5823 if test "$am_cv_func_iconv" = yes; then
5824 cat >> confdefs.h <<\EOF
5825#define HAVE_ICONV 1
5826EOF
5827
5828 echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
4c76f856 5829echo "configure:5830: checking for iconv declaration" >&5
71a94577
ZW
5830 if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
5831 echo $ac_n "(cached) $ac_c" 1>&6
ab87f8c8 5832else
71a94577
ZW
5833
5834 cat > conftest.$ac_ext <<EOF
4c76f856 5835#line 5836 "configure"
71a94577 5836#include "confdefs.h"
ab87f8c8 5837
71a94577
ZW
5838#include <stdlib.h>
5839#include <iconv.h>
5840extern
5841#ifdef __cplusplus
5842"C"
5843#endif
5844#if defined(__STDC__) || defined(__cplusplus)
5845size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
5846#else
5847size_t iconv();
5848#endif
ab87f8c8 5849
71a94577 5850int main() {
380a627a 5851
71a94577 5852; return 0; }
ab87f8c8 5853EOF
4c76f856 5854if { (eval echo configure:5855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
71a94577
ZW
5855 rm -rf conftest*
5856 am_cv_proto_iconv_arg1=""
ab87f8c8 5857else
71a94577
ZW
5858 echo "configure: failed program was:" >&5
5859 cat conftest.$ac_ext >&5
5860 rm -rf conftest*
5861 am_cv_proto_iconv_arg1="const"
ab87f8c8 5862fi
71a94577
ZW
5863rm -f conftest*
5864 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 5865fi
71a94577
ZW
5866
5867 am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
5868 echo "$ac_t""${ac_t:-
5869 }$am_cv_proto_iconv" 1>&6
5870 cat >> confdefs.h <<EOF
5871#define ICONV_CONST $am_cv_proto_iconv_arg1
5872EOF
5873
5874 fi
5875 LIBICONV=
5876 if test "$am_cv_lib_iconv" = yes; then
b7f2fb96 5877 LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
71a94577
ZW
5878 fi
5879
5880
5881
5882 echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
4c76f856 5883echo "configure:5884: checking for nl_langinfo and CODESET" >&5
71a94577 5884if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then
ab87f8c8
JL
5885 echo $ac_n "(cached) $ac_c" 1>&6
5886else
5887 cat > conftest.$ac_ext <<EOF
4c76f856 5888#line 5889 "configure"
ab87f8c8 5889#include "confdefs.h"
71a94577 5890#include <langinfo.h>
ab87f8c8 5891int main() {
71a94577 5892char* cs = nl_langinfo(CODESET);
ab87f8c8
JL
5893; return 0; }
5894EOF
4c76f856 5895if { (eval echo configure:5896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8 5896 rm -rf conftest*
71a94577 5897 am_cv_langinfo_codeset=yes
ab87f8c8
JL
5898else
5899 echo "configure: failed program was:" >&5
5900 cat conftest.$ac_ext >&5
5901 rm -rf conftest*
71a94577 5902 am_cv_langinfo_codeset=no
ab87f8c8
JL
5903fi
5904rm -f conftest*
71a94577 5905
ab87f8c8
JL
5906fi
5907
71a94577
ZW
5908echo "$ac_t""$am_cv_langinfo_codeset" 1>&6
5909 if test $am_cv_langinfo_codeset = yes; then
5910 cat >> confdefs.h <<\EOF
5911#define HAVE_LANGINFO_CODESET 1
ab87f8c8 5912EOF
ab87f8c8 5913
71a94577
ZW
5914 fi
5915
5916 if test $ac_cv_header_locale_h = yes; then
5917 echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
4c76f856 5918echo "configure:5919: checking for LC_MESSAGES" >&5
71a94577 5919if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
ab87f8c8
JL
5920 echo $ac_n "(cached) $ac_c" 1>&6
5921else
71a94577 5922 cat > conftest.$ac_ext <<EOF
4c76f856 5923#line 5924 "configure"
71a94577
ZW
5924#include "confdefs.h"
5925#include <locale.h>
5926int main() {
5927return LC_MESSAGES
5928; return 0; }
5929EOF
4c76f856 5930if { (eval echo configure:5931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
71a94577
ZW
5931 rm -rf conftest*
5932 am_cv_val_LC_MESSAGES=yes
5933else
5934 echo "configure: failed program was:" >&5
5935 cat conftest.$ac_ext >&5
5936 rm -rf conftest*
5937 am_cv_val_LC_MESSAGES=no
5938fi
5939rm -f conftest*
5940fi
5941
5942echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
5943 if test $am_cv_val_LC_MESSAGES = yes; then
5944 cat >> confdefs.h <<\EOF
5945#define HAVE_LC_MESSAGES 1
5946EOF
5947
ab87f8c8 5948 fi
71a94577
ZW
5949 fi
5950 echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
4c76f856 5951echo "configure:5952: checking whether NLS is requested" >&5
71a94577
ZW
5952 # Check whether --enable-nls or --disable-nls was given.
5953if test "${enable_nls+set}" = set; then
5954 enableval="$enable_nls"
5955 USE_NLS=$enableval
5956else
5957 USE_NLS=yes
ab87f8c8 5958fi
71a94577
ZW
5959
5960 echo "$ac_t""$USE_NLS" 1>&6
5961
5962
5963 BUILD_INCLUDED_LIBINTL=no
5964 USE_INCLUDED_LIBINTL=no
5965 INTLLIBS=
77c06844 5966 INTLDEPS=
71a94577
ZW
5967
5968 if test "$USE_NLS" = "yes"; then
5969 cat >> confdefs.h <<\EOF
5970#define ENABLE_NLS 1
5971EOF
5972
5973 echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
4c76f856 5974echo "configure:5975: checking whether included gettext is requested" >&5
71a94577
ZW
5975 # Check whether --with-included-gettext or --without-included-gettext was given.
5976if test "${with_included_gettext+set}" = set; then
5977 withval="$with_included_gettext"
5978 nls_cv_force_use_gnu_gettext=$withval
ab87f8c8 5979else
71a94577 5980 nls_cv_force_use_gnu_gettext=no
ab87f8c8
JL
5981fi
5982
71a94577
ZW
5983 echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
5984
5985 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
5986 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
5987 CATOBJEXT=NONE
5988
5989
5990
5991
5992 ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
5993echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
4c76f856 5994echo "configure:5995: checking for libintl.h" >&5
71a94577 5995if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
ab87f8c8
JL
5996 echo $ac_n "(cached) $ac_c" 1>&6
5997else
71a94577 5998 cat > conftest.$ac_ext <<EOF
4c76f856 5999#line 6000 "configure"
71a94577
ZW
6000#include "confdefs.h"
6001#include <libintl.h>
6002EOF
6003ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4c76f856 6004{ (eval echo configure:6005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
71a94577
ZW
6005ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6006if test -z "$ac_err"; then
6007 rm -rf conftest*
6008 eval "ac_cv_header_$ac_safe=yes"
ab87f8c8 6009else
71a94577
ZW
6010 echo "$ac_err" >&5
6011 echo "configure: failed program was:" >&5
6012 cat conftest.$ac_ext >&5
6013 rm -rf conftest*
6014 eval "ac_cv_header_$ac_safe=no"
ab87f8c8 6015fi
71a94577
ZW
6016rm -f conftest*
6017fi
6018if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6019 echo "$ac_t""yes" 1>&6
191bf464
ZW
6020 cat >> confdefs.h <<\EOF
6021#define HAVE_LIBINTL_H 1
6022EOF
6023
6024 echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6
4c76f856 6025echo "configure:6026: checking for GNU gettext in libc" >&5
71a94577
ZW
6026if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libc'+set}'`\" = set"; then
6027 echo $ac_n "(cached) $ac_c" 1>&6
6028else
6029 cat > conftest.$ac_ext <<EOF
4c76f856 6030#line 6031 "configure"
ab87f8c8 6031#include "confdefs.h"
71a94577 6032#include <libintl.h>
ab87f8c8 6033extern int _nl_msg_cat_cntr;
71a94577
ZW
6034int main() {
6035bindtextdomain ("", "");
6036return (int) gettext ("") + _nl_msg_cat_cntr
ab87f8c8
JL
6037; return 0; }
6038EOF
4c76f856 6039if { (eval echo configure:6040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8 6040 rm -rf conftest*
71a94577 6041 gt_cv_func_gnugettext1_libc=yes
ab87f8c8
JL
6042else
6043 echo "configure: failed program was:" >&5
6044 cat conftest.$ac_ext >&5
6045 rm -rf conftest*
71a94577 6046 gt_cv_func_gnugettext1_libc=no
ab87f8c8
JL
6047fi
6048rm -f conftest*
ab87f8c8
JL
6049fi
6050
71a94577 6051echo "$ac_t""$gt_cv_func_gnugettext1_libc" 1>&6
ab87f8c8 6052
71a94577
ZW
6053 if test "$gt_cv_func_gnugettext1_libc" != "yes"; then
6054 echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6
4c76f856 6055echo "configure:6056: checking for GNU gettext in libintl" >&5
71a94577 6056if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libintl'+set}'`\" = set"; then
ab87f8c8
JL
6057 echo $ac_n "(cached) $ac_c" 1>&6
6058else
71a94577
ZW
6059 gt_save_LIBS="$LIBS"
6060 LIBS="$LIBS -lintl $LIBICONV"
6061 cat > conftest.$ac_ext <<EOF
4c76f856 6062#line 6063 "configure"
ab87f8c8 6063#include "confdefs.h"
71a94577
ZW
6064#include <libintl.h>
6065extern int _nl_msg_cat_cntr;
ab87f8c8 6066int main() {
71a94577
ZW
6067bindtextdomain ("", "");
6068return (int) gettext ("") + _nl_msg_cat_cntr
ab87f8c8
JL
6069; return 0; }
6070EOF
4c76f856 6071if { (eval echo configure:6072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8 6072 rm -rf conftest*
71a94577 6073 gt_cv_func_gnugettext1_libintl=yes
ab87f8c8
JL
6074else
6075 echo "configure: failed program was:" >&5
6076 cat conftest.$ac_ext >&5
6077 rm -rf conftest*
71a94577 6078 gt_cv_func_gnugettext1_libintl=no
ab87f8c8
JL
6079fi
6080rm -f conftest*
71a94577 6081 LIBS="$gt_save_LIBS"
ab87f8c8 6082fi
71a94577
ZW
6083
6084echo "$ac_t""$gt_cv_func_gnugettext1_libintl" 1>&6
6085 fi
6086
6087 if test "$gt_cv_func_gnugettext1_libc" = "yes" \
6088 || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \
6089 && test "$PACKAGE" != gettext; }; then
6090 cat >> confdefs.h <<\EOF
6091#define HAVE_GETTEXT 1
ab87f8c8
JL
6092EOF
6093
ab87f8c8 6094
71a94577
ZW
6095 if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then
6096 INTLLIBS="-lintl $LIBICONV"
6097 fi
ab87f8c8 6098
71a94577
ZW
6099 gt_save_LIBS="$LIBS"
6100 LIBS="$LIBS $INTLLIBS"
6101 for ac_func in dcgettext
6102do
6103echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4c76f856 6104echo "configure:6105: checking for $ac_func" >&5
71a94577 6105if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
ab87f8c8
JL
6106 echo $ac_n "(cached) $ac_c" 1>&6
6107else
6108 cat > conftest.$ac_ext <<EOF
4c76f856 6109#line 6110 "configure"
ab87f8c8
JL
6110#include "confdefs.h"
6111/* System header to define __stub macros and hopefully few prototypes,
71a94577 6112 which can conflict with char $ac_func(); below. */
ab87f8c8
JL
6113#include <assert.h>
6114/* Override any gcc2 internal prototype to avoid an error. */
6115/* We use char because int might match the return type of a gcc2
6116 builtin and then its argument prototype would still apply. */
71a94577 6117char $ac_func();
ab87f8c8
JL
6118
6119int main() {
6120
6121/* The GNU C library defines this for functions which it implements
6122 to always fail with ENOSYS. Some functions are actually named
6123 something starting with __ and the normal name is an alias. */
71a94577 6124#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
ab87f8c8
JL
6125choke me
6126#else
71a94577 6127$ac_func();
ab87f8c8
JL
6128#endif
6129
6130; return 0; }
6131EOF
4c76f856 6132if { (eval echo configure:6133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8 6133 rm -rf conftest*
71a94577 6134 eval "ac_cv_func_$ac_func=yes"
ab87f8c8
JL
6135else
6136 echo "configure: failed program was:" >&5
6137 cat conftest.$ac_ext >&5
6138 rm -rf conftest*
71a94577 6139 eval "ac_cv_func_$ac_func=no"
ab87f8c8
JL
6140fi
6141rm -f conftest*
6142fi
6143
71a94577 6144if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
ab87f8c8 6145 echo "$ac_t""yes" 1>&6
71a94577
ZW
6146 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6147 cat >> confdefs.h <<EOF
6148#define $ac_tr_func 1
ab87f8c8 6149EOF
71a94577
ZW
6150
6151else
6152 echo "$ac_t""no" 1>&6
6153fi
6154done
ab87f8c8 6155
71a94577
ZW
6156 LIBS="$gt_save_LIBS"
6157
6158 # Extract the first word of "msgfmt", so it can be a program name with args.
6159set dummy msgfmt; ac_word=$2
ab87f8c8 6160echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4c76f856 6161echo "configure:6162: checking for $ac_word" >&5
71a94577 6162if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
ab87f8c8
JL
6163 echo $ac_n "(cached) $ac_c" 1>&6
6164else
71a94577 6165 case "$MSGFMT" in
ab87f8c8 6166 /*)
71a94577 6167 ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
ab87f8c8
JL
6168 ;;
6169 *)
71a94577
ZW
6170 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
6171 for ac_dir in $PATH; do
ab87f8c8
JL
6172 test -z "$ac_dir" && ac_dir=.
6173 if test -f $ac_dir/$ac_word; then
71a94577
ZW
6174 if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then
6175 ac_cv_path_MSGFMT="$ac_dir/$ac_word"
6176 break
6177 fi
ab87f8c8
JL
6178 fi
6179 done
6180 IFS="$ac_save_ifs"
71a94577 6181 test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
ab87f8c8
JL
6182 ;;
6183esac
6184fi
71a94577
ZW
6185MSGFMT="$ac_cv_path_MSGFMT"
6186if test "$MSGFMT" != ":"; then
6187 echo "$ac_t""$MSGFMT" 1>&6
ab87f8c8
JL
6188else
6189 echo "$ac_t""no" 1>&6
6190fi
71a94577
ZW
6191
6192 # Extract the first word of "gmsgfmt", so it can be a program name with args.
ab87f8c8
JL
6193set dummy gmsgfmt; ac_word=$2
6194echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4c76f856 6195echo "configure:6196: checking for $ac_word" >&5
71a94577 6196if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
ab87f8c8
JL
6197 echo $ac_n "(cached) $ac_c" 1>&6
6198else
6199 case "$GMSGFMT" in
6200 /*)
71a94577 6201 ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
ab87f8c8
JL
6202 ;;
6203 ?:/*)
71a94577 6204 ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
ab87f8c8
JL
6205 ;;
6206 *)
cd9e5e7c 6207 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
b27d2bd5
MK
6208 ac_dummy="$PATH"
6209 for ac_dir in $ac_dummy; do
ab87f8c8
JL
6210 test -z "$ac_dir" && ac_dir=.
6211 if test -f $ac_dir/$ac_word; then
71a94577 6212 ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
ab87f8c8
JL
6213 break
6214 fi
6215 done
6216 IFS="$ac_save_ifs"
71a94577 6217 test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
ab87f8c8
JL
6218 ;;
6219esac
6220fi
71a94577 6221GMSGFMT="$ac_cv_path_GMSGFMT"
ab87f8c8
JL
6222if test -n "$GMSGFMT"; then
6223 echo "$ac_t""$GMSGFMT" 1>&6
6224else
6225 echo "$ac_t""no" 1>&6
6226fi
6227
ab87f8c8 6228
71a94577 6229 # Extract the first word of "xgettext", so it can be a program name with args.
ab87f8c8
JL
6230set dummy xgettext; ac_word=$2
6231echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4c76f856 6232echo "configure:6233: checking for $ac_word" >&5
71a94577 6233if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
ab87f8c8
JL
6234 echo $ac_n "(cached) $ac_c" 1>&6
6235else
6236 case "$XGETTEXT" in
6237 /*)
71a94577 6238 ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
ab87f8c8
JL
6239 ;;
6240 *)
6241 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
6242 for ac_dir in $PATH; do
6243 test -z "$ac_dir" && ac_dir=.
6244 if test -f $ac_dir/$ac_word; then
71a94577
ZW
6245 if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then
6246 ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
ab87f8c8
JL
6247 break
6248 fi
6249 fi
6250 done
6251 IFS="$ac_save_ifs"
71a94577 6252 test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
ab87f8c8
JL
6253 ;;
6254esac
6255fi
71a94577
ZW
6256XGETTEXT="$ac_cv_path_XGETTEXT"
6257if test "$XGETTEXT" != ":"; then
ab87f8c8
JL
6258 echo "$ac_t""$XGETTEXT" 1>&6
6259else
6260 echo "$ac_t""no" 1>&6
6261fi
6262
71a94577
ZW
6263
6264 CATOBJEXT=.gmo
6265 fi
6266
ab87f8c8
JL
6267else
6268 echo "$ac_t""no" 1>&6
6269fi
6270
ab87f8c8
JL
6271
6272 if test "$CATOBJEXT" = "NONE"; then
6273 nls_cv_use_gnu_gettext=yes
6274 fi
6275 fi
6276
6277 if test "$nls_cv_use_gnu_gettext" = "yes"; then
6278 INTLOBJS="\$(GETTOBJS)"
6279 # Extract the first word of "msgfmt", so it can be a program name with args.
6280set dummy msgfmt; ac_word=$2
6281echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4c76f856 6282echo "configure:6283: checking for $ac_word" >&5
71a94577 6283if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
ab87f8c8
JL
6284 echo $ac_n "(cached) $ac_c" 1>&6
6285else
6286 case "$MSGFMT" in
6287 /*)
71a94577 6288 ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
ab87f8c8
JL
6289 ;;
6290 *)
6291 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
6292 for ac_dir in $PATH; do
6293 test -z "$ac_dir" && ac_dir=.
6294 if test -f $ac_dir/$ac_word; then
71a94577
ZW
6295 if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then
6296 ac_cv_path_MSGFMT="$ac_dir/$ac_word"
ab87f8c8
JL
6297 break
6298 fi
6299 fi
6300 done
6301 IFS="$ac_save_ifs"
71a94577 6302 test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
ab87f8c8
JL
6303 ;;
6304esac
6305fi
71a94577
ZW
6306MSGFMT="$ac_cv_path_MSGFMT"
6307if test "$MSGFMT" != ":"; then
ab87f8c8
JL
6308 echo "$ac_t""$MSGFMT" 1>&6
6309else
6310 echo "$ac_t""no" 1>&6
6311fi
6312
6313 # Extract the first word of "gmsgfmt", so it can be a program name with args.
6314set dummy gmsgfmt; ac_word=$2
6315echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4c76f856 6316echo "configure:6317: checking for $ac_word" >&5
71a94577 6317if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
ab87f8c8
JL
6318 echo $ac_n "(cached) $ac_c" 1>&6
6319else
6320 case "$GMSGFMT" in
6321 /*)
71a94577 6322 ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
ab87f8c8
JL
6323 ;;
6324 ?:/*)
71a94577 6325 ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
ab87f8c8
JL
6326 ;;
6327 *)
cd9e5e7c 6328 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
b27d2bd5
MK
6329 ac_dummy="$PATH"
6330 for ac_dir in $ac_dummy; do
ab87f8c8
JL
6331 test -z "$ac_dir" && ac_dir=.
6332 if test -f $ac_dir/$ac_word; then
71a94577 6333 ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
ab87f8c8
JL
6334 break
6335 fi
6336 done
6337 IFS="$ac_save_ifs"
71a94577 6338 test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
ab87f8c8
JL
6339 ;;
6340esac
6341fi
71a94577 6342GMSGFMT="$ac_cv_path_GMSGFMT"
ab87f8c8
JL
6343if test -n "$GMSGFMT"; then
6344 echo "$ac_t""$GMSGFMT" 1>&6
6345else
6346 echo "$ac_t""no" 1>&6
6347fi
6348
6349 # Extract the first word of "xgettext", so it can be a program name with args.
6350set dummy xgettext; ac_word=$2
6351echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4c76f856 6352echo "configure:6353: checking for $ac_word" >&5
71a94577 6353if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
ab87f8c8
JL
6354 echo $ac_n "(cached) $ac_c" 1>&6
6355else
6356 case "$XGETTEXT" in
6357 /*)
71a94577 6358 ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
ab87f8c8
JL
6359 ;;
6360 *)
6361 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
6362 for ac_dir in $PATH; do
6363 test -z "$ac_dir" && ac_dir=.
6364 if test -f $ac_dir/$ac_word; then
71a94577
ZW
6365 if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then
6366 ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
ab87f8c8
JL
6367 break
6368 fi
6369 fi
6370 done
6371 IFS="$ac_save_ifs"
71a94577 6372 test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
ab87f8c8
JL
6373 ;;
6374esac
6375fi
71a94577
ZW
6376XGETTEXT="$ac_cv_path_XGETTEXT"
6377if test "$XGETTEXT" != ":"; then
ab87f8c8
JL
6378 echo "$ac_t""$XGETTEXT" 1>&6
6379else
6380 echo "$ac_t""no" 1>&6
6381fi
6382
6383
71a94577 6384 BUILD_INCLUDED_LIBINTL=yes
ab87f8c8
JL
6385 USE_INCLUDED_LIBINTL=yes
6386 CATOBJEXT=.gmo
71a94577 6387 INTLLIBS="\$(top_builddir)/intl/libintl.a $LIBICONV"
77c06844 6388 INTLDEPS="\$(top_builddir)/intl/libintl.a"
71a94577
ZW
6389 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
6390 fi
6391
6392 if test "$GMSGFMT" != ":"; then
6393 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
6394 : ;
6395 else
6396 echo "$ac_t""found msgfmt program is not GNU msgfmt; ignore it" 1>&6
6397 GMSGFMT=":"
6398 fi
ab87f8c8
JL
6399 fi
6400
71a94577
ZW
6401 if test "$XGETTEXT" != ":"; then
6402 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
ab87f8c8
JL
6403 : ;
6404 else
6405 echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6
6406 XGETTEXT=":"
6407 fi
6408 fi
6409
71a94577
ZW
6410 POSUB=po
6411 fi
6412
17297c41
PT
6413
6414
71a94577
ZW
6415 if test "$PACKAGE" = gettext; then
6416 BUILD_INCLUDED_LIBINTL=yes
ab87f8c8 6417 fi
ab87f8c8 6418
71a94577
ZW
6419 for ac_prog in bison
6420do
6421# Extract the first word of "$ac_prog", so it can be a program name with args.
6422set dummy $ac_prog; ac_word=$2
6423echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4c76f856 6424echo "configure:6425: checking for $ac_word" >&5
71a94577
ZW
6425if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then
6426 echo $ac_n "(cached) $ac_c" 1>&6
6427else
6428 if test -n "$INTLBISON"; then
6429 ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test.
6430else
6431 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
6432 ac_dummy="$PATH"
6433 for ac_dir in $ac_dummy; do
6434 test -z "$ac_dir" && ac_dir=.
6435 if test -f $ac_dir/$ac_word; then
6436 ac_cv_prog_INTLBISON="$ac_prog"
6437 break
6438 fi
6439 done
6440 IFS="$ac_save_ifs"
6441fi
6442fi
6443INTLBISON="$ac_cv_prog_INTLBISON"
6444if test -n "$INTLBISON"; then
6445 echo "$ac_t""$INTLBISON" 1>&6
6446else
6447 echo "$ac_t""no" 1>&6
6448fi
6449
6450test -n "$INTLBISON" && break
6451done
ab87f8c8 6452
71a94577
ZW
6453 if test -z "$INTLBISON"; then
6454 ac_verc_fail=yes
6455 else
6456 echo $ac_n "checking version of bison""... $ac_c" 1>&6
4c76f856 6457echo "configure:6458: checking version of bison" >&5
71a94577
ZW
6458 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
6459 case $ac_prog_version in
6460 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
6461 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
6462 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
6463 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
6464 esac
6465 echo "$ac_t""$ac_prog_version" 1>&6
6466 fi
6467 if test $ac_verc_fail = yes; then
6468 INTLBISON=:
ab87f8c8
JL
6469 fi
6470
ab87f8c8 6471
9f6682b7 6472
ab87f8c8
JL
6473
6474
6475
6476
6477
6478
77c06844 6479
191bf464
ZW
6480 if test $USE_INCLUDED_LIBINTL = yes; then
6481 cat >> confdefs.h <<\EOF
6482#define USE_INCLUDED_LIBINTL 1
6483EOF
6484
6485 fi
71a94577
ZW
6486
6487 nls_cv_header_intl=
6488 nls_cv_header_libgt=
6489
6490 DATADIRNAME=share
ab87f8c8 6491
71a94577
ZW
6492
6493 INSTOBJEXT=.mo
ab87f8c8 6494
ab87f8c8 6495
71a94577
ZW
6496 GENCAT=gencat
6497
6498
9fdf713f 6499
9f6682b7
ZW
6500 if test "x$CATOBJEXT" != x; then
6501 echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
4c76f856 6502echo "configure:6503: checking for catalogs to be installed" >&5
9f6682b7
ZW
6503 # Look for .po and .gmo files in the source directory.
6504 CATALOGS=
6505 XLINGUAS=
6506 for cat in $srcdir/po/*$CATOBJEXT $srcdir/po/*.po; do
6507 # If there aren't any .gmo files the shell will give us the
6508 # literal string "../path/to/srcdir/po/*.gmo" which has to be
6509 # weeded out.
6510 case "$cat" in *\**)
6511 continue;;
6512 esac
6513 # The quadruple backslash is collapsed to a double backslash
6514 # by the backticks, then collapsed again by the double quotes,
6515 # leaving us with one backslash in the sed expression (right
6516 # before the dot that mustn't act as a wildcard). The dot to
6517 # be escaped in the second expression is hiding inside CATOBJEXT.
6518 cat=`echo $cat | sed -e "s!$srcdir/!!" -e "s!\\\\.po!$CATOBJEXT!"`
6519 lang=`echo $cat | sed -e 's!po/!!' -e "s!\\\\$CATOBJEXT!!"`
6520 # The user is allowed to set LINGUAS to a list of languages to
6521 # install catalogs for. If it's empty that means "all of them."
6522 if test "x$LINGUAS" = x; then
6523 CATALOGS="$CATALOGS $cat"
6524 XLINGUAS="$XLINGUAS $lang"
6525 else
6526 case "$LINGUAS" in *$lang*)
6527 CATALOGS="$CATALOGS $cat"
6528 XLINGUAS="$XLINGUAS $lang"
6529 ;;
6530 esac
6531 fi
6532 done
6533 LINGUAS="$XLINGUAS"
6534 echo "$ac_t""$LINGUAS" 1>&6
ab87f8c8
JL
6535 fi
6536
ab87f8c8
JL
6537 MKINSTALLDIRS=
6538 if test -n "$ac_aux_dir"; then
6539 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
6540 fi
6541 if test -z "$MKINSTALLDIRS"; then
6542 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
6543 fi
6544
6545
71a94577 6546 INTL_LIBTOOL_SUFFIX_PREFIX=
ab87f8c8 6547
ab87f8c8 6548
ab87f8c8 6549
f4ab28e3
MK
6550# Windows32 Registry support for specifying GCC installation paths.
6551# Check whether --enable-win32-registry or --disable-win32-registry was given.
6552if test "${enable_win32_registry+set}" = set; then
6553 enableval="$enable_win32_registry"
6554 :
6555fi
6556
4e70264f
ZW
6557case $host_os in
6558 win32 | pe | cygwin* | mingw32* | uwin*)
f4ab28e3 6559echo $ac_n "checking whether windows registry support is requested""... $ac_c" 1>&6
4c76f856 6560echo "configure:6561: checking whether windows registry support is requested" >&5
9dd53f2c 6561if test "x$enable_win32_registry" != xno; then
f4ab28e3
MK
6562 cat >> confdefs.h <<\EOF
6563#define ENABLE_WIN32_REGISTRY 1
6564EOF
6565
6566 echo "$ac_t""yes" 1>&6
4e70264f
ZW
6567
6568echo $ac_n "checking for library containing RegOpenKeyExA""... $ac_c" 1>&6
4c76f856 6569echo "configure:6570: checking for library containing RegOpenKeyExA" >&5
4e70264f
ZW
6570if eval "test \"`echo '$''{'ac_cv_search_RegOpenKeyExA'+set}'`\" = set"; then
6571 echo $ac_n "(cached) $ac_c" 1>&6
6572else
6573 ac_func_search_save_LIBS="$LIBS"
6574ac_cv_search_RegOpenKeyExA="no"
6575cat > conftest.$ac_ext <<EOF
4c76f856 6576#line 6577 "configure"
4e70264f
ZW
6577#include "confdefs.h"
6578/* Override any gcc2 internal prototype to avoid an error. */
6579/* We use char because int might match the return type of a gcc2
6580 builtin and then its argument prototype would still apply. */
6581char RegOpenKeyExA();
6582
6583int main() {
6584RegOpenKeyExA()
6585; return 0; }
6586EOF
4c76f856 6587if { (eval echo configure:6588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4e70264f
ZW
6588 rm -rf conftest*
6589 ac_cv_search_RegOpenKeyExA="none required"
6590else
6591 echo "configure: failed program was:" >&5
6592 cat conftest.$ac_ext >&5
6593fi
6594rm -f conftest*
6595test "$ac_cv_search_RegOpenKeyExA" = "no" && for i in advapi32; do
6596LIBS="-l$i $ac_func_search_save_LIBS"
6597cat > conftest.$ac_ext <<EOF
4c76f856 6598#line 6599 "configure"
4e70264f
ZW
6599#include "confdefs.h"
6600/* Override any gcc2 internal prototype to avoid an error. */
6601/* We use char because int might match the return type of a gcc2
6602 builtin and then its argument prototype would still apply. */
6603char RegOpenKeyExA();
6604
6605int main() {
6606RegOpenKeyExA()
6607; return 0; }
6608EOF
4c76f856 6609if { (eval echo configure:6610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4e70264f
ZW
6610 rm -rf conftest*
6611 ac_cv_search_RegOpenKeyExA="-l$i"
6612break
6613else
6614 echo "configure: failed program was:" >&5
6615 cat conftest.$ac_ext >&5
6616fi
6617rm -f conftest*
6618done
6619LIBS="$ac_func_search_save_LIBS"
6620fi
6621
6622echo "$ac_t""$ac_cv_search_RegOpenKeyExA" 1>&6
6623if test "$ac_cv_search_RegOpenKeyExA" != "no"; then
6624 test "$ac_cv_search_RegOpenKeyExA" = "none required" || LIBS="$ac_cv_search_RegOpenKeyExA $LIBS"
6625
6626else :
6627
6628fi
f4ab28e3
MK
6629else
6630 echo "$ac_t""no" 1>&6
6631fi
6632
6633# Check if user specified a different registry key.
9dd53f2c 6634case "x${enable_win32_registry}" in
f4ab28e3
MK
6635x | xyes)
6636 # default.
6637 gcc_cv_win32_registry_key="$VERSION"
6638 ;;
6639xno)
6640 # no registry lookup.
6641 gcc_cv_win32_registry_key=''
6642 ;;
6643*)
6644 # user-specified key.
6645 gcc_cv_win32_registry_key="$enable_win32_registry"
6646 ;;
6647esac
6648
9dd53f2c 6649if test "x$enable_win32_registry" != xno; then
f4ab28e3 6650 echo $ac_n "checking registry key on windows hosts""... $ac_c" 1>&6
4c76f856 6651echo "configure:6652: checking registry key on windows hosts" >&5
f4ab28e3
MK
6652 cat >> confdefs.h <<EOF
6653#define WIN32_REGISTRY_KEY "$gcc_cv_win32_registry_key"
6654EOF
6655
6656 echo "$ac_t""$gcc_cv_win32_registry_key" 1>&6
6657fi
4e70264f
ZW
6658;;
6659esac
f4ab28e3 6660
ab87f8c8
JL
6661# Get an absolute path to the GCC top-level source directory
6662holddir=`pwd`
6663cd $srcdir
6664topdir=`pwd`
6665cd $holddir
6666
6667# Conditionalize the makefile for this host machine.
6668# Make-host contains the concatenation of all host makefile fragments
6669# [there can be more than one]. This file is built by configure.frag.
6670host_overrides=Make-host
6671dep_host_xmake_file=
6672for f in .. ${host_xmake_file}
6673do
6674 if test -f ${srcdir}/config/$f
6675 then
6676 dep_host_xmake_file="${dep_host_xmake_file} ${srcdir}/config/$f"
6677 fi
6678done
6679
6680# Conditionalize the makefile for this target machine.
6681# Make-target contains the concatenation of all host makefile fragments
6682# [there can be more than one]. This file is built by configure.frag.
6683target_overrides=Make-target
6684dep_tmake_file=
6685for f in .. ${tmake_file}
6686do
6687 if test -f ${srcdir}/config/$f
6688 then
6689 dep_tmake_file="${dep_tmake_file} ${srcdir}/config/$f"
6690 fi
6691done
6692
6693# If the host doesn't support symlinks, modify CC in
6694# FLAGS_TO_PASS so CC="stage1/xgcc -Bstage1/" works.
6695# Otherwise, we can use "CC=$(CC)".
6696rm -f symtest.tem
6697if $symbolic_link $srcdir/gcc.c symtest.tem 2>/dev/null
6698then
6699 cc_set_by_configure="\$(CC)"
5aa82ace 6700 quoted_cc_set_by_configure="\$(CC)"
ab87f8c8 6701 stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
596151e1 6702 quoted_stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
ab87f8c8
JL
6703else
6704 rm -f symtest.tem
6705 if cp -p $srcdir/gcc.c symtest.tem 2>/dev/null
6706 then
6707 symbolic_link="cp -p"
6708 else
6709 symbolic_link="cp"
6710 fi
6711 cc_set_by_configure="\`case '\$(CC)' in stage*) echo '\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\$(CC)';; esac\`"
5aa82ace 6712 quoted_cc_set_by_configure="\\\`case '\\\$(CC)' in stage*) echo '\\\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(CC)';; esac\\\`"
ab87f8c8 6713 stage_prefix_set_by_configure="\`case '\$(STAGE_PREFIX)' in stage*) echo '\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\$(STAGE_PREFIX)';; esac\`"
596151e1 6714 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
6715fi
6716rm -f symtest.tem
6717
6718out_object_file=`basename $out_file .c`.o
6719
6720tm_file_list=
6721for f in $tm_file; do
64ccbc99 6722 case $f in
d02af173
ZW
6723 ansidecl.h )
6724 tm_file_list="${tm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
6725 defaults.h )
64ccbc99
KG
6726 tm_file_list="${tm_file_list} $f" ;;
6727 *) tm_file_list="${tm_file_list} \$(srcdir)/config/$f" ;;
6728 esac
ab87f8c8
JL
6729done
6730
11642c3a
ZW
6731tm_p_file_list=
6732for f in $tm_p_file; do
6733 tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f"
6734done
6735
ab87f8c8
JL
6736host_xm_file_list=
6737for f in $host_xm_file; do
64ccbc99 6738 case $f in
d02af173
ZW
6739 ansidecl.h )
6740 host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
6741 auto-host.h | defaults.h )
64ccbc99
KG
6742 host_xm_file_list="${host_xm_file_list} $f" ;;
6743 *) host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f" ;;
6744 esac
ab87f8c8
JL
6745done
6746
6747build_xm_file_list=
6748for f in $build_xm_file; do
64ccbc99 6749 case $f in
d02af173
ZW
6750 ansidecl.h )
6751 build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
6752 auto-build.h | auto-host.h | defaults.h )
64ccbc99
KG
6753 build_xm_file_list="${build_xm_file_list} $f" ;;
6754 *) build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f" ;;
6755 esac
ab87f8c8
JL
6756done
6757
a078a589
ZW
6758# Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
6759# Also use all.cross instead of all.internal and adjust SYSTEM_HEADER_DIR.
6760CROSS=
6761ALL=all.internal
6762SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)'
ab87f8c8
JL
6763if test x$host != x$target
6764then
a078a589
ZW
6765 CROSS="-DCROSS_COMPILE"
6766 ALL=all.cross
6767 SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
ab87f8c8
JL
6768fi
6769
b39d221a
EC
6770# If this is a cross-compiler that does not
6771# have its own set of headers then define
6772# inhibit_libc
6773
fecd6201
ZW
6774# If this is using newlib, then define inhibit_libc in LIBGCC2_CFLAGS.
6775# This prevents libgcc2 from containing any code which requires libc
6776# support.
b39d221a
EC
6777inhibit_libc=
6778if test x$host != x$target && test x$with_headers = x; then
6779 inhibit_libc=-Dinhibit_libc
6780else
6781 if test x$with_newlib = xyes; then
6782 inhibit_libc=-Dinhibit_libc
6783 fi
6784fi
6785
6786
a078a589
ZW
6787# When building gcc with a cross-compiler, we need to adjust things so
6788# that the generator programs are still built with the native compiler.
6789# Also, we cannot run fixincludes or fix-header.
6790# Note that the terminology here is wrong; it should be BUILD_* throughout.
6791# FIXME.
6792
6793# These are the normal (build=host) settings:
6794HOST_PREFIX=
6795HOST_PREFIX_1=ignore-
6796HOST_CC='$(CC)'
6797HOST_CFLAGS='$(ALL_CFLAGS)'
6798
6799STMP_FIXINC=stmp-fixinc
6800STMP_FIXPROTO=stmp-fixproto
6801
6802# And these apply if build != host.
ab87f8c8
JL
6803if test x$build != x$host
6804then
a078a589
ZW
6805 HOST_PREFIX=build-
6806 HOST_PREFIX_1=build-
6807 HOST_CC='$(CC_FOR_BUILD)'
6808 HOST_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
6809
6810 STMP_FIXINC=
6811 STMP_FIXPROTO=
ab87f8c8
JL
6812fi
6813
6814# Expand extra_headers to include complete path.
6815# This substitutes for lots of t-* files.
6816extra_headers_list=
6817if test "x$extra_headers" = x
6818then true
6819else
29f7a208 6820 # Prepend ${srcdir}/config/${cpu_type}/ to every entry in extra_headers.
ab87f8c8
JL
6821 for file in $extra_headers;
6822 do
29f7a208 6823 extra_headers_list="${extra_headers_list} \$(srcdir)/config/${cpu_type}/${file}"
ab87f8c8
JL
6824 done
6825fi
6826
6827if test x$use_collect2 = xno; then
6828 use_collect2=
6829fi
6830
6831# Add a definition of USE_COLLECT2 if system wants one.
2cc07db4 6832if test x$use_collect2 != x
ab87f8c8 6833then
2cc07db4
RH
6834 host_xm_defines="${host_xm_defines} USE_COLLECT2"
6835 xm_defines="${xm_defines} USE_COLLECT2"
ab87f8c8
JL
6836fi
6837
ab87f8c8
JL
6838# If we have gas in the build tree, make a link to it.
6839if test -f ../gas/Makefile; then
6840 rm -f as; $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null
6841fi
6842
3cae5780 6843# If we have nm and objdump in the build tree, make a link to them.
ab87f8c8
JL
6844if test -f ../binutils/Makefile; then
6845 rm -f nm; $symbolic_link ../binutils/nm-new$host_exeext nm$host_exeext 2>/dev/null
3cae5780 6846 rm -f objdump; $symbolic_link ../binutils/objdump$host_exeext objdump$host_exeext 2>/dev/null
ab87f8c8
JL
6847fi
6848
6849# If we have ld in the build tree, make a link to it.
6850if test -f ../ld/Makefile; then
2cc07db4 6851 rm -f collect-ld; $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext 2>/dev/null
ab87f8c8
JL
6852fi
6853
981d4858
JM
6854# Figure out what assembler we will be using.
6855echo $ac_n "checking what assembler to use""... $ac_c" 1>&6
4c76f856 6856echo "configure:6857: checking what assembler to use" >&5
ab87f8c8 6857gcc_cv_as=
981d4858
JM
6858gcc_cv_gas_major_version=
6859gcc_cv_gas_minor_version=
ab87f8c8 6860gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
0936a455 6861gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
ab87f8c8
JL
6862if test -x "$DEFAULT_ASSEMBLER"; then
6863 gcc_cv_as="$DEFAULT_ASSEMBLER"
6864elif test -x "$AS"; then
6865 gcc_cv_as="$AS"
6866elif test -x as$host_exeext; then
6867 # Build using assembler in the current directory.
6868 gcc_cv_as=./as$host_exeext
6869elif test -f $gcc_cv_as_gas_srcdir/configure.in -a -f ../gas/Makefile; then
6870 # Single tree build which includes gas.
0936a455 6871 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
6872 do
6873 gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
6874 if test x$gcc_cv_gas_version != x; then
6875 break
6876 fi
6877 done
6878 gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
6879 gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
c72931a6 6880 gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.[0-9]*\.\([0-9]*\)"`
981d4858 6881fi
9e423e6d 6882
534d0cc0 6883if test "x$gcc_cv_as" = x; then
779243f7
JL
6884 # Search the same directories that the installed compiler will
6885 # search. Else we may find the wrong assembler and lose. If we
6886 # do not find a suitable assembler binary, then try the user's
6887 # path.
6888 #
6889 # Also note we have to check MD_EXEC_PREFIX before checking the
6890 # user's path. Unfortunately, there is no good way to get at the
6891 # value of MD_EXEC_PREFIX here. So we do a brute force search
6892 # through all the known MD_EXEC_PREFIX values. Ugh. This needs
6893 # to be fixed as part of the make/configure rewrite too.
6894
6895 if test "x$exec_prefix" = xNONE; then
6896 if test "x$prefix" = xNONE; then
6897 test_prefix=/usr/local
6898 else
6899 test_prefix=$prefix
6900 fi
6901 else
6902 test_prefix=$exec_prefix
6903 fi
6904
6905 # If the loop below does not find an assembler, then use whatever
6906 # one we can find in the users's path.
6907 # user's path.
55a2ea2a
AM
6908 if test "x$program_prefix" != xNONE; then
6909 gcc_cv_as=${program_prefix}as$host_exeext
6910 else
6911 gcc_cv_as=`echo as | sed ${program_transform_name}`$host_exeext
6912 fi
6913
6914 test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
6915 $test_prefix/lib/gcc-lib/$target_alias \
6916 /usr/lib/gcc/$target_alias/$gcc_version \
6917 /usr/lib/gcc/$target_alias \
6918 $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
6919 $test_prefix/$target_alias/bin"
6920
6921 if test x$host = x$target; then
6922 test_dirs="$test_dirs \
779243f7
JL
6923 /usr/libexec \
6924 /usr/ccs/gcc \
6925 /usr/ccs/bin \
6926 /udk/usr/ccs/bin \
6927 /bsd43/usr/lib/cmplrs/cc \
6928 /usr/cross64/usr/bin \
6929 /usr/lib/cmplrs/cc \
6930 /sysv/usr/lib/cmplrs/cc \
6931 /svr4/usr/lib/cmplrs/cc \
6932 /usr/bin"
55a2ea2a 6933 fi
779243f7
JL
6934
6935 for dir in $test_dirs; do
55a2ea2a 6936 if test -x $dir/as$host_exeext; then
779243f7
JL
6937 gcc_cv_as=$dir/as$host_exeext
6938 break;
6939 fi
6940 done
9e423e6d 6941fi
981d4858
JM
6942if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
6943 echo "$ac_t"""newly built gas"" 1>&6
6944else
6945 echo "$ac_t""$gcc_cv_as" 1>&6
6946fi
6947
275b60d6
JJ
6948# Figure out what linker we will be using.
6949echo $ac_n "checking what linker to use""... $ac_c" 1>&6
4c76f856 6950echo "configure:6951: checking what linker to use" >&5
275b60d6
JJ
6951gcc_cv_ld=
6952gcc_cv_gld_major_version=
6953gcc_cv_gld_minor_version=
6954gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/ld
6955gcc_cv_ld_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
6956if test -x "$DEFAULT_LINKER"; then
6957 gcc_cv_ld="$DEFAULT_LINKER"
6958elif test -x "$LD"; then
6959 gcc_cv_ld="$LD"
6960elif test -x ld$host_exeext; then
6961 # Build using linker in the current directory.
6962 gcc_cv_ld=./ld$host_exeext
6963elif test -f $gcc_cv_ld_gld_srcdir/configure.in -a -f ../ld/Makefile; then
6964 # Single tree build which includes ld.
6965 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
6966 do
6967 gcc_cv_gld_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
6968 if test x$gcc_cv_gld_version != x; then
6969 break
6970 fi
6971 done
6972 gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"`
6973 gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
6974fi
6975
534d0cc0 6976if test "x$gcc_cv_ld" = x; then
275b60d6
JJ
6977 # Search the same directories that the installed compiler will
6978 # search. Else we may find the wrong linker and lose. If we
6979 # do not find a suitable linker binary, then try the user's
6980 # path.
6981 #
6982 # Also note we have to check MD_EXEC_PREFIX before checking the
6983 # user's path. Unfortunately, there is no good way to get at the
6984 # value of MD_EXEC_PREFIX here. So we do a brute force search
6985 # through all the known MD_EXEC_PREFIX values. Ugh. This needs
6986 # to be fixed as part of the make/configure rewrite too.
6987
6988 if test "x$exec_prefix" = xNONE; then
6989 if test "x$prefix" = xNONE; then
6990 test_prefix=/usr/local
6991 else
6992 test_prefix=$prefix
6993 fi
6994 else
6995 test_prefix=$exec_prefix
6996 fi
6997
6998 # If the loop below does not find an linker, then use whatever
6999 # one we can find in the users's path.
7000 # user's path.
55a2ea2a
AM
7001 if test "x$program_prefix" != xNONE; then
7002 gcc_cv_ld=${program_prefix}ld$host_exeext
7003 else
7004 gcc_cv_ld=`echo ld | sed ${program_transform_name}`$host_exeext
7005 fi
7006
7007 test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
7008 $test_prefix/lib/gcc-lib/$target_alias \
7009 /usr/lib/gcc/$target_alias/$gcc_version \
7010 /usr/lib/gcc/$target_alias \
7011 $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
7012 $test_prefix/$target_alias/bin"
7013
7014 if test x$host = x$target; then
7015 test_dirs="$test_dirs \
275b60d6
JJ
7016 /usr/libexec \
7017 /usr/ccs/gcc \
7018 /usr/ccs/bin \
7019 /udk/usr/ccs/bin \
7020 /bsd43/usr/lib/cmplrs/cc \
7021 /usr/cross64/usr/bin \
7022 /usr/lib/cmplrs/cc \
7023 /sysv/usr/lib/cmplrs/cc \
7024 /svr4/usr/lib/cmplrs/cc \
7025 /usr/bin"
55a2ea2a 7026 fi
275b60d6
JJ
7027
7028 for dir in $test_dirs; do
55a2ea2a 7029 if test -x $dir/ld$host_exeext; then
275b60d6
JJ
7030 gcc_cv_ld=$dir/ld$host_exeext
7031 break;
7032 fi
7033 done
7034fi
7035if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
7036 echo "$ac_t"""newly built ld"" 1>&6
7037else
7038 echo "$ac_t""$gcc_cv_ld" 1>&6
7039fi
7040
981d4858
JM
7041# Figure out what nm we will be using.
7042echo $ac_n "checking what nm to use""... $ac_c" 1>&6
4c76f856 7043echo "configure:7044: checking what nm to use" >&5
981d4858
JM
7044if test -x nm$host_exeext; then
7045 gcc_cv_nm=./nm$host_exeext
534d0cc0
AM
7046elif test "x$program_prefix" != xNONE; then
7047 gcc_cv_nm=${program_prefix}nm$host_exeext
7048else
7049 gcc_cv_nm=`echo nm | sed ${program_transform_name}`$host_exeext
981d4858
JM
7050fi
7051echo "$ac_t""$gcc_cv_nm" 1>&6
7052
3cae5780
AS
7053# Figure out what objdump we will be using.
7054echo $ac_n "checking what objdump to use""... $ac_c" 1>&6
4c76f856 7055echo "configure:7056: checking what objdump to use" >&5
3cae5780
AS
7056if test -x objdump$host_exeext; then
7057 gcc_cv_objdump=./objdump$host_exeext
534d0cc0
AM
7058elif test "x$program_prefix" != xNONE; then
7059 gcc_cv_objdump=${program_prefix}objdump$host_exeext
7060else
7061 gcc_cv_objdump=`echo objdump | sed ${program_transform_name}`$host_exeext
3cae5780
AS
7062fi
7063echo "$ac_t""$gcc_cv_objdump" 1>&6
7064
981d4858
JM
7065# Figure out what assembler alignment features are present.
7066echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
4c76f856 7067echo "configure:7068: checking assembler alignment features" >&5
9d147085 7068gcc_cv_as_alignment_features=none
981d4858
JM
7069if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
7070 # Gas version 2.6 and later support for .balign and .p2align.
7071 # bytes to skip when using .p2align.
7072 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
7073 gcc_cv_as_alignment_features=".balign and .p2align"
7074 cat >> confdefs.h <<\EOF
7075#define HAVE_GAS_BALIGN_AND_P2ALIGN 1
7076EOF
7077
7078 fi
7079 # Gas version 2.8 and later support specifying the maximum
7080 # bytes to skip when using .p2align.
7081 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
7082 gcc_cv_as_alignment_features=".p2align including maximum skip"
7083 cat >> confdefs.h <<\EOF
7084#define HAVE_GAS_MAX_SKIP_P2ALIGN 1
7085EOF
7086
7087 fi
7088elif test x$gcc_cv_as != x; then
00ccc16d
JL
7089 # Check if we have .balign and .p2align
7090 echo ".balign 4" > conftest.s
7091 echo ".p2align 2" >> conftest.s
7092 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
7093 gcc_cv_as_alignment_features=".balign and .p2align"
7094 cat >> confdefs.h <<\EOF
7095#define HAVE_GAS_BALIGN_AND_P2ALIGN 1
7096EOF
7097
7098 fi
7099 rm -f conftest.s conftest.o
9e423e6d
JW
7100 # Check if specifying the maximum bytes to skip when
7101 # using .p2align is supported.
7102 echo ".p2align 4,,7" > conftest.s
7103 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
7104 gcc_cv_as_alignment_features=".p2align including maximum skip"
7105 cat >> confdefs.h <<\EOF
7106#define HAVE_GAS_MAX_SKIP_P2ALIGN 1
7107EOF
7108
7109 fi
7110 rm -f conftest.s conftest.o
7111fi
7112echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6
7113
d1accaa3 7114echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6
4c76f856 7115echo "configure:7116: checking assembler subsection support" >&5
9d147085 7116gcc_cv_as_subsections=no
981d4858
JM
7117if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
7118 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
7119 gcc_cv_as_subsections="working .subsection -1"
7120 fi
7121elif test x$gcc_cv_as != x; then
d1accaa3
JJ
7122 # Check if we have .subsection
7123 echo ".subsection 1" > conftest.s
7124 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
7125 gcc_cv_as_subsections=".subsection"
d1accaa3
JJ
7126 if test x$gcc_cv_nm != x; then
7127 cat > conftest.s <<EOF
7128conftest_label1: .word 0
7129.subsection -1
7130conftest_label2: .word 0
7131.previous
7132EOF
7133 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
7134 $gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1
7135 $gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2
1b015bec
AO
7136 if cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1; then
7137 :
7138 else
d1accaa3 7139 gcc_cv_as_subsections="working .subsection -1"
d1accaa3
JJ
7140 fi
7141 fi
7142 fi
7143 fi
7144 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
981d4858
JM
7145fi
7146if test x"$gcc_cv_as_subsections" = x"working .subsection -1"; then
7147 cat >> confdefs.h <<\EOF
7148#define HAVE_GAS_SUBSECTION_ORDERING 1
7149EOF
7150
d1accaa3
JJ
7151fi
7152echo "$ac_t""$gcc_cv_as_subsections" 1>&6
7153
12822146 7154echo $ac_n "checking assembler weak support""... $ac_c" 1>&6
4c76f856 7155echo "configure:7156: checking assembler weak support" >&5
9d147085 7156gcc_cv_as_weak=no
981d4858
JM
7157if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
7158 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
7159 gcc_cv_as_weak="yes"
7160 fi
7161elif test x$gcc_cv_as != x; then
12822146
JL
7162 # Check if we have .weak
7163 echo " .weak foobar" > conftest.s
7164 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
12822146
JL
7165 gcc_cv_as_weak="yes"
7166 fi
7167 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
981d4858
JM
7168fi
7169if test x"$gcc_cv_as_weak" = xyes; then
7170 cat >> confdefs.h <<\EOF
7171#define HAVE_GAS_WEAK 1
7172EOF
7173
12822146
JL
7174fi
7175echo "$ac_t""$gcc_cv_as_weak" 1>&6
7176
6a9c5260 7177echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6
4c76f856 7178echo "configure:7179: checking assembler hidden support" >&5
9d147085 7179gcc_cv_as_hidden=no
981d4858 7180if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
c72931a6
RH
7181 if test "$gcc_cv_gas_major_version" -eq 2 \
7182 -a "$gcc_cv_gas_minor_version" -eq 12 \
7183 -a "$gcc_cv_gas_patch_version" -ge 1 \
7184 -o "$gcc_cv_gas_major_version" -eq 2 \
7185 -a "$gcc_cv_gas_minor_version" -gt 12 \
7186 -o "$gcc_cv_gas_major_version" -gt 2 \
7187 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
981d4858
JM
7188 gcc_cv_as_hidden="yes"
7189 fi
7190elif test x$gcc_cv_as != x; then
6a9c5260
UD
7191 # Check if we have .hidden
7192 echo " .hidden foobar" > conftest.s
7193 echo "foobar:" >> conftest.s
7194 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
6a9c5260
UD
7195 gcc_cv_as_hidden="yes"
7196 fi
7197 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
c72931a6
RH
7198
7199 # GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN.
7200 # This is irritatingly difficult to feature test for. Look for
7201 # the date string after the version number.
7202 ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -1`
7203 if echo "$ld_ver" | grep GNU > /dev/null; then
7204 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'`
7205 if test 0"$ld_date" -lt 20020404; then
7206 gcc_cv_as_hidden="no"
7207 fi
7208 fi
981d4858
JM
7209fi
7210if test x"$gcc_cv_as_hidden" = xyes; then
7211 cat >> confdefs.h <<\EOF
7212#define HAVE_GAS_HIDDEN 1
7213EOF
7214
6a9c5260
UD
7215fi
7216echo "$ac_t""$gcc_cv_as_hidden" 1>&6
9e944a16
JJ
7217libgcc_visibility=$gcc_cv_as_hidden
7218
6a9c5260 7219
b7460f24 7220echo $ac_n "checking assembler leb128 support""... $ac_c" 1>&6
4c76f856 7221echo "configure:7222: checking assembler leb128 support" >&5
fbe42b1b 7222gcc_cv_as_leb128=no
b7460f24 7223if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
fbe42b1b 7224 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
7225 gcc_cv_as_leb128="yes"
7226 fi
7227elif test x$gcc_cv_as != x; then
7228 # Check if we have .[us]leb128, and support symbol arithmetic with it.
7229 cat > conftest.s <<EOF
7230 .data
7231 .uleb128 L2 - L1
7232L1:
7233 .uleb128 1280
7234 .sleb128 -1010
7235L2:
7236EOF
7237 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
78e766a0
RH
7238 gcc_cv_as_leb128="yes"
7239
7240 # GAS versions before 2.11 do not support uleb128,
7241 # despite appearing to.
7242 # ??? There exists an elf-specific test that will crash
7243 # the assembler. Perhaps it's better to figure out whether
7244 # arbitrary sections are supported and try the test.
7245 as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
7246 if echo "$as_ver" | grep GNU > /dev/null; then
5fed851d 7247 as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
78e766a0 7248 as_major=`echo $as_ver | sed 's/\..*//'`
3d399d67 7249 as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
78e766a0
RH
7250 if test $as_major -eq 2 -a $as_minor -lt 11; then
7251 gcc_cv_as_leb128="no"
7252 fi
fbe42b1b 7253 fi
b7460f24
RH
7254 fi
7255 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
7256fi
7257if test x"$gcc_cv_as_leb128" = xyes; then
7258 cat >> confdefs.h <<\EOF
7259#define HAVE_AS_LEB128 1
7260EOF
7261
7262fi
7263echo "$ac_t""$gcc_cv_as_leb128" 1>&6
7264
c64688ae 7265echo $ac_n "checking assembler eh_frame optimization""... $ac_c" 1>&6
4c76f856 7266echo "configure:7267: checking assembler eh_frame optimization" >&5
c64688ae
RH
7267gcc_cv_as_eh_frame=no
7268if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
7269 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
7270 gcc_cv_as_eh_frame="yes"
7271 fi
7272elif test x$gcc_cv_as != x; then
7273 # Check if this is GAS.
41948db5
SS
7274 as_ver=`$gcc_cv_as --version < /dev/null 2> /dev/null | head -1`
7275 rm -f a.out 2> /dev/null
c64688ae
RH
7276 if echo "$as_ver" | grep GNU > /dev/null; then
7277 # Versions up to and including 2.11.0 may mis-optimize
7278 # .eh_frame data. Try something.
7279 cat > conftest.s <<EOF
7280 .text
7281.LFB1:
7282 .4byte 0
7283.L1:
7284 .4byte 0
7285.LFE1:
7286 .section .eh_frame,"aw",@progbits
7287__FRAME_BEGIN__:
7288 .4byte .LECIE1-.LSCIE1
7289.LSCIE1:
7290 .4byte 0x0
7291 .byte 0x1
7292 .ascii "z\0"
7293 .byte 0x1
7294 .byte 0x78
7295 .byte 0x1a
7296 .byte 0x0
7297 .byte 0x4
7298 .4byte 1
7299 .p2align 1
7300.LECIE1:
7301.LSFDE1:
7302 .4byte .LEFDE1-.LASFDE1
7303.LASFDE1:
7304 .4byte .LASFDE1-__FRAME_BEGIN__
7305 .4byte .LFB1
7306 .4byte .LFE1-.LFB1
7307 .byte 0x4
7308 .4byte .LFE1-.LFB1
7309 .byte 0x4
7310 .4byte .L1-.LFB1
7311.LEFDE1:
7312EOF
01efb963 7313 cat > conftest.lit <<EOF
c64688ae
RH
7314 0000 10000000 00000000 017a0001 781a0004 .........z..x...
7315 0010 01000000 12000000 18000000 00000000 ................
7316 0020 08000000 04080000 0044 .........D
01efb963
AS
7317EOF
7318 cat > conftest.big <<EOF
7319 0000 00000010 00000000 017a0001 781a0004 .........z..x...
7320 0010 00000001 00000012 00000018 00000000 ................
7321 0020 00000008 04000000 0844 .........D
c64688ae
RH
7322EOF
7323 # If the assembler didn't choke, and we can objdump,
7324 # and we got the correct data, then succeed.
7325 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
3cae5780 7326 && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
c64688ae 7327 | tail -3 > conftest.got \
01efb963
AS
7328 && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
7329 || cmp conftest.big conftest.got > /dev/null 2>&1; }
c64688ae
RH
7330 then
7331 gcc_cv_as_eh_frame="yes"
7332 else
7333 gcc_cv_as_eh_frame="bad"
7334 if $gcc_cv_as -o conftest.o --traditional-format /dev/null; then
7335 cat >> confdefs.h <<\EOF
7336#define USE_AS_TRADITIONAL_FORMAT 1
7337EOF
7338
7339 fi
7340 fi
7341 fi
7342 rm -f conftest.*
7343fi
7344echo "$ac_t""$gcc_cv_as_eh_frame" 1>&6
7345
201556f0 7346echo $ac_n "checking assembler section merging support""... $ac_c" 1>&6
4c76f856 7347echo "configure:7348: checking assembler section merging support" >&5
201556f0
JJ
7348gcc_cv_as_shf_merge=no
7349if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
7350 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 7351 gcc_cv_as_shf_merge=yes
201556f0
JJ
7352 fi
7353elif test x$gcc_cv_as != x; then
7354 # Check if we support SHF_MERGE sections
7355 echo '.section .rodata.str, "aMS", @progbits, 1' > conftest.s
a8b7afb9 7356 if $gcc_cv_as --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1; then
201556f0
JJ
7357 gcc_cv_as_shf_merge=yes
7358 fi
7359 rm -f conftest.s conftest.o
7360fi
7361if test x"$gcc_cv_as_shf_merge" = xyes; then
7362 cat >> confdefs.h <<\EOF
7363#define HAVE_GAS_SHF_MERGE 1
7364EOF
7365
7366fi
7367echo "$ac_t""$gcc_cv_as_shf_merge" 1>&6
7368
3a37b08e
RH
7369case "$target" in
7370 # All TARGET_ABI_OSF targets.
7371 alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
7372 echo $ac_n "checking assembler supports explicit relocations""... $ac_c" 1>&6
4c76f856 7373echo "configure:7374: checking assembler supports explicit relocations" >&5
3a37b08e
RH
7374if eval "test \"`echo '$''{'gcc_cv_as_explicit_relocs'+set}'`\" = set"; then
7375 echo $ac_n "(cached) $ac_c" 1>&6
7376else
7377
7378 gcc_cv_as_explicit_relocs=unknown
7379 if test x$gcc_cv_gas_major_version != x \
7380 -a x$gcc_cv_gas_minor_version != x
7381 then
7382 if test "$gcc_cv_gas_major_version" -eq 2 \
7383 -a "$gcc_cv_gas_minor_version" -ge 12 \
7384 -o "$gcc_cv_gas_major_version" -gt 2; then
7385 gcc_cv_as_explicit_relocs=yes
7386 fi
7387 elif test x$gcc_cv_as != x; then
7388 cat > conftest.s << 'EOF'
7389 .set nomacro
7390 .text
7391 extbl $3, $2, $3 !lituse_bytoff!1
7392 ldq $2, a($29) !literal!1
7393 ldq $4, b($29) !literal!2
7394 ldq_u $3, 0($2) !lituse_base!1
7395 ldq $27, f($29) !literal!5
7396 jsr $26, ($27), f !lituse_jsr!5
7397 ldah $29, 0($26) !gpdisp!3
7398 lda $0, c($29) !gprel
7399 ldah $1, d($29) !gprelhigh
7400 lda $1, d($1) !gprellow
7401 lda $29, 0($29) !gpdisp!3
7402EOF
7403 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
7404 gcc_cv_as_explicit_relocs=yes
7405 else
7406 gcc_cv_as_explicit_relocs=no
7407 fi
7408 rm -f conftest.s conftest.o
7409 fi
7410
7411fi
7412
7413echo "$ac_t""$gcc_cv_as_explicit_relocs" 1>&6
7414 if test "x$gcc_cv_as_explicit_relocs" = xyes; then
7415 cat >> confdefs.h <<\EOF
7416#define HAVE_AS_EXPLICIT_RELOCS 1
7417EOF
7418
7419 fi
7420 ;;
1cb36a98
RH
7421 sparc*-*-*)
7422 echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6
4c76f856 7423echo "configure:7424: checking assembler .register pseudo-op support" >&5
5b68c389
AO
7424if eval "test \"`echo '$''{'gcc_cv_as_register_pseudo_op'+set}'`\" = set"; then
7425 echo $ac_n "(cached) $ac_c" 1>&6
7426else
7427
7428 gcc_cv_as_register_pseudo_op=unknown
7429 if test x$gcc_cv_as != x; then
7430 # Check if we have .register
7431 echo ".register %g2, #scratch" > conftest.s
7432 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
1cb36a98 7433 gcc_cv_as_register_pseudo_op=yes
5b68c389
AO
7434 else
7435 gcc_cv_as_register_pseudo_op=no
7436 fi
7437 rm -f conftest.s conftest.o
7438 fi
7439
7440fi
7441
7442echo "$ac_t""$gcc_cv_as_register_pseudo_op" 1>&6
7443 if test "x$gcc_cv_as_register_pseudo_op" = xyes; then
7444 cat >> confdefs.h <<\EOF
1cb36a98
RH
7445#define HAVE_AS_REGISTER_PSEUDO_OP 1
7446EOF
7447
1cb36a98 7448 fi
1cb36a98 7449
e95b1e6a 7450 echo $ac_n "checking assembler supports -relax""... $ac_c" 1>&6
4c76f856 7451echo "configure:7452: checking assembler supports -relax" >&5
e95b1e6a
JJ
7452if eval "test \"`echo '$''{'gcc_cv_as_relax_opt'+set}'`\" = set"; then
7453 echo $ac_n "(cached) $ac_c" 1>&6
7454else
7455
7456 gcc_cv_as_relax_opt=unknown
7457 if test x$gcc_cv_as != x; then
7458 # Check if gas supports -relax
7459 echo ".text" > conftest.s
7460 if $gcc_cv_as -relax -o conftest.o conftest.s > /dev/null 2>&1; then
7461 gcc_cv_as_relax_opt=yes
7462 else
7463 gcc_cv_as_relax_opt=no
7464 fi
7465 rm -f conftest.s conftest.o
7466 fi
7467
7468fi
7469
7470echo "$ac_t""$gcc_cv_as_relax_opt" 1>&6
7471 if test "x$gcc_cv_as_relax_opt" = xyes; then
7472 cat >> confdefs.h <<\EOF
7473#define HAVE_AS_RELAX_OPTION 1
7474EOF
7475
7476 fi
7477
17e9e88c 7478 echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6
4c76f856 7479echo "configure:7480: checking assembler and linker support unaligned pc related relocs" >&5
17e9e88c
JJ
7480if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then
7481 echo $ac_n "(cached) $ac_c" 1>&6
7482else
7483
7484 gcc_cv_as_sparc_ua_pcrel=unknown
7485 if test x$gcc_cv_as != x -a x$gcc_cv_ld != x; then
7486 gcc_cv_as_sparc_ua_pcrel=no
7487 echo ".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo)" > conftest.s
cf7b8b0d
JJ
7488 if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
7489 && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
7490 gcc_cv_as_sparc_ua_pcrel=yes
17e9e88c
JJ
7491 fi
7492 rm -f conftest.s conftest.o conftest
7493 fi
7494
7495fi
7496
7497echo "$ac_t""$gcc_cv_as_sparc_ua_pcrel" 1>&6
7498 if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
7499 cat >> confdefs.h <<\EOF
7500#define HAVE_AS_SPARC_UA_PCREL 1
7501EOF
7502
7503 fi
7504
fc06c4b2 7505 echo $ac_n "checking assembler and linker support unaligned pc related relocs against hidden symbols""... $ac_c" 1>&6
4c76f856 7506echo "configure:7507: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5
cf7b8b0d
JJ
7507if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel_hidden'+set}'`\" = set"; then
7508 echo $ac_n "(cached) $ac_c" 1>&6
7509else
7510
7511 if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
7512 gcc_cv_as_sparc_ua_pcrel_hidden=unknown
7513 if test x$gcc_cv_objdump != x; then
7514 gcc_cv_as_sparc_ua_pcrel_hidden=no
7515 echo ".data; .align 4; .byte 0x31; .uaword %r_disp32(foo)" > conftest.s
7516 echo ".byte 0x32, 0x33, 0x34; .global foo; .hidden foo" >> conftest.s
7517 echo "foo: .skip 4" >> conftest.s
7518 if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
7519 && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1 \
7520 && $gcc_cv_objdump -s -j .data conftest 2> /dev/null \
7521 | grep ' 31000000 07323334' > /dev/null 2>&1; then
7522 if $gcc_cv_objdump -R conftest 2> /dev/null \
7523 | grep 'DISP32' > /dev/null 2>&1; then
7524 :
7525 else
7526 gcc_cv_as_sparc_ua_pcrel_hidden=yes
7527 fi
7528 fi
7529 fi
7530 rm -f conftest.s conftest.o conftest
7531 else
7532 gcc_cv_as_sparc_ua_pcrel_hidden="$gcc_cv_as_sparc_ua_pcrel"
7533 fi
7534
7535fi
7536
7537echo "$ac_t""$gcc_cv_as_sparc_ua_pcrel_hidden" 1>&6
7538 if test "x$gcc_cv_as_sparc_ua_pcrel_hidden" = xyes; then
7539 cat >> confdefs.h <<\EOF
7540#define HAVE_AS_SPARC_UA_PCREL_HIDDEN 1
7541EOF
7542
7543 fi
7544
5b68c389
AO
7545 if test "x$gcc_cv_as_flags64" != xno; then
7546 echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6
4c76f856 7547echo "configure:7548: checking for assembler offsetable %lo() support" >&5
5b68c389
AO
7548if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then
7549 echo $ac_n "(cached) $ac_c" 1>&6
7550else
7551
7552 gcc_cv_as_offsetable_lo10=unknown
7553 if test "x$gcc_cv_as" != x; then
7554 # Check if assembler has offsetable %lo()
7555 echo "or %g1, %lo(ab) + 12, %g1" > conftest.s
7556 echo "or %g1, %lo(ab + 12), %g1" > conftest1.s
7557 if $gcc_cv_as $gcc_cv_as_flags64 -o conftest.o conftest.s \
7558 > /dev/null 2>&1 &&
7559 $gcc_cv_as $gcc_cv_as_flags64 -o conftest1.o conftest1.s \
7560 > /dev/null 2>&1; then
7561 if cmp conftest.o conftest1.o > /dev/null 2>&1; then
7562 gcc_cv_as_offsetable_lo10=no
7563 else
7564 gcc_cv_as_offsetable_lo10=yes
7565 fi
7566 else
7567 gcc_cv_as_offsetable_lo10=no
7568 fi
7569 rm -f conftest.s conftest.o conftest1.s conftest1.o
7570 fi
7571
7572fi
7573
7574echo "$ac_t""$gcc_cv_as_offsetable_lo10" 1>&6
7575 if test "x$gcc_cv_as_offsetable_lo10" = xyes; then
7576 cat >> confdefs.h <<\EOF
1cb36a98
RH
7577#define HAVE_AS_OFFSETABLE_LO10 1
7578EOF
7579
1cb36a98 7580 fi
1cb36a98 7581 fi
43160d01 7582
1cb36a98
RH
7583 ;;
7584
c307e6dd 7585 i[34567]86-*-* | x86_64-*-*)
1cb36a98 7586 echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
4c76f856 7587echo "configure:7588: checking assembler instructions" >&5
1cb36a98 7588 gcc_cv_as_instructions=
981d4858
JM
7589 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
7590 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
7591 gcc_cv_as_instructions="filds fists"
7592 fi
7593 elif test x$gcc_cv_as != x; then
53b5ce19
JW
7594 set "filds fists" "filds mem; fists mem"
7595 while test $# -gt 0
7596 do
7597 echo "$2" > conftest.s
7598 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
7599 gcc_cv_as_instructions=${gcc_cv_as_instructions}$1" "
53b5ce19
JW
7600 fi
7601 shift 2
7602 done
7603 rm -f conftest.s conftest.o
1cb36a98 7604 fi
981d4858
JM
7605 if test x"$gcc_cv_as_instructions" != x; then
7606 cat >> confdefs.h <<EOF
ee7692d2 7607#define HAVE_GAS_`echo "$gcc_cv_as_instructions" | sed -e 's/ $//' | tr 'a-z ' 'A-Z_'` 1
981d4858
JM
7608EOF
7609
7610 fi
1cb36a98 7611 echo "$ac_t""$gcc_cv_as_instructions" 1>&6
f88c65f7
RH
7612
7613 echo $ac_n "checking assembler GOTOFF in data directives""... $ac_c" 1>&6
4c76f856 7614echo "configure:7615: checking assembler GOTOFF in data directives" >&5
f88c65f7
RH
7615 gcc_cv_as_gotoff_in_data=no
7616 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x
7617 then
7618 if test "$gcc_cv_gas_major_version" -eq 2 \
7619 -a "$gcc_cv_gas_minor_version" -ge 11 \
7620 -o "$gcc_cv_gas_major_version" -gt 2; then
7621 gcc_cv_as_gotoff_in_data=yes
7622 fi
7623 elif test x$gcc_cv_as != x; then
7624 cat > conftest.s <<EOF
7625 .text
7626.L0:
7627 nop
7628 .data
7629 .long .L0@GOTOFF
7630EOF
7631 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
7632 gcc_cv_as_gotoff_in_data=yes
7633 fi
7634 fi
7635 cat >> confdefs.h <<EOF
7636#define HAVE_AS_GOTOFF_IN_DATA `if test $gcc_cv_as_gotoff_in_data = yes; then echo 1; else echo 0; fi`
7637EOF
7638
7639 echo "$ac_t""$gcc_cv_as_gotoff_in_data" 1>&6
1cb36a98
RH
7640 ;;
7641esac
53b5ce19 7642
9d147085 7643echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6
4c76f856 7644echo "configure:7645: checking assembler dwarf2 debug_line support" >&5
9d147085
RH
7645gcc_cv_as_dwarf2_debug_line=no
7646# ??? Not all targets support dwarf2 debug_line, even within a version
7647# of gas. Moreover, we need to emit a valid instruction to trigger any
7648# info to the output file. So, as supported targets are added to gas 2.11,
7649# add some instruction here to (also) show we expect this might work.
7650# ??? Once 2.11 is released, probably need to add first known working
7651# version to the per-target configury.
7652case "$target" in
823fbbce 7653 i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* | x86_64*-*-* | hppa*-*-*)
9d147085
RH
7654 insn="nop"
7655 ;;
7656 ia64*-*-*)
7657 insn="nop 0"
7658 ;;
7659 esac
7660if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
7661then
7662 if test "$gcc_cv_gas_major_version" -eq 2 \
7663 -a "$gcc_cv_gas_minor_version" -ge 11 \
7664 -o "$gcc_cv_gas_major_version" -gt 2 \
7665 && grep 'obj_format = elf' ../gas/Makefile > /dev/null \
7666 && test x"$insn" != x ; then
7667 gcc_cv_as_dwarf2_debug_line="yes"
7668 fi
7669elif test x$gcc_cv_as != x -a x"$insn" != x ; then
acc187f5
RH
7670 echo ' .file 1 "conftest.s"' > conftest.s
7671 echo ' .loc 1 3 0' >> conftest.s
9d147085 7672 echo " $insn" >> conftest.s
981975b6 7673 # ??? This fails with non-gnu grep.
9d147085
RH
7674 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
7675 && grep debug_line conftest.o > /dev/null 2>&1 ; then
981975b6 7676 # The .debug_line file table must be in the exact order that
eaec9b3d 7677 # we specified the files, since these indices are also used
981975b6
RH
7678 # by DW_AT_decl_file. Approximate this test by testing if
7679 # the assembler bitches if the same index is assigned twice.
7680 echo ' .file 1 "foo.s"' > conftest.s
7681 echo ' .file 1 "bar.s"' >> conftest.s
7682 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1
7683 then
7684 gcc_cv_as_dwarf2_debug_line="no"
7685 else
7686 gcc_cv_as_dwarf2_debug_line="yes"
7687 fi
9d147085
RH
7688 fi
7689 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
7690fi
7691if test x"$gcc_cv_as_dwarf2_debug_line" = xyes; then
7692 cat >> confdefs.h <<\EOF
7693#define HAVE_AS_DWARF2_DEBUG_LINE 1
7694EOF
7695
7696fi
7697echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
7698
5f0e9ea2 7699echo $ac_n "checking assembler --gdwarf2 support""... $ac_c" 1>&6
4c76f856 7700echo "configure:7701: checking assembler --gdwarf2 support" >&5
5f0e9ea2
GK
7701gcc_cv_as_gdwarf2_flag=no
7702if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
7703then
7704 if test "$gcc_cv_gas_major_version" -eq 2 \
7705 -a "$gcc_cv_gas_minor_version" -ge 11 \
7706 -o "$gcc_cv_gas_major_version" -gt 2 \
7707 && grep 'obj_format = elf' ../gas/Makefile > /dev/null \
7708 && test x"$insn" != x ; then
7709 gcc_cv_as_gdwarf2_debug_flag="yes"
7710 fi
7711elif test x$gcc_cv_as != x -a x"$insn" != x ; then
7712 echo '' > conftest.s
7713 # ??? This fails with non-gnu grep.
7714 if $gcc_cv_as --gdwarf2 -o conftest.o conftest.s > /dev/null 2>&1
7715 then
7716 gcc_cv_as_gdwarf2_flag="yes"
7717 fi
7718 rm -f conftest.s conftest.o
7719fi
7720if test x"$gcc_cv_as_gdwarf2_flag" = xyes; then
7721 cat >> confdefs.h <<\EOF
7722#define HAVE_AS_GDWARF2_DEBUG_FLAG 1
7723EOF
7724
7725fi
7726echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6
7727
7728echo $ac_n "checking assembler --gstabs support""... $ac_c" 1>&6
4c76f856 7729echo "configure:7730: checking assembler --gstabs support" >&5
5f0e9ea2
GK
7730gcc_cv_as_gstabs_flag=no
7731if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
7732then
7733 if test "$gcc_cv_gas_major_version" -eq 2 \
7734 -a "$gcc_cv_gas_minor_version" -ge 11 \
7735 -o "$gcc_cv_gas_major_version" -gt 2 \
7736 && grep 'obj_format = elf' ../gas/Makefile > /dev/null \
7737 && test x"$insn" != x ; then
7738 gcc_cv_as_gstabs_debug_flag="yes"
7739 fi
7740elif test x$gcc_cv_as != x -a x"$insn" != x ; then
7741 echo '' > conftest.s
7742 # ??? This fails with non-gnu grep.
7743 if $gcc_cv_as --gstabs -o conftest.o conftest.s > /dev/null 2>&1 ; then
7744 gcc_cv_as_gstabs_flag="yes"
7745 fi
7746 rm -f conftest.s conftest.o
7747fi
7748if test x"$gcc_cv_as_gstabs_flag" = xyes; then
7749 cat >> confdefs.h <<\EOF
7750#define HAVE_AS_GSTABS_DEBUG_FLAG 1
7751EOF
7752
7753fi
7754echo "$ac_t""$gcc_cv_as_gstabs_flag" 1>&6
7755
275b60d6 7756echo $ac_n "checking linker PT_GNU_EH_FRAME support""... $ac_c" 1>&6
4c76f856 7757echo "configure:7758: checking linker PT_GNU_EH_FRAME support" >&5
275b60d6
JJ
7758gcc_cv_ld_eh_frame_hdr=no
7759if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
7760 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
7761 gcc_cv_ld_eh_frame_hdr=yes
7762 fi
7763elif test x$gcc_cv_ld != x; then
7764 # Check if linker supports --eh-frame-hdr option
7765 if $gcc_cv_ld --help 2>/dev/null | grep eh-frame-hdr > /dev/null; then
7766 gcc_cv_ld_eh_frame_hdr=yes
7767 fi
7768fi
7769if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
7770 cat >> confdefs.h <<\EOF
7771#define HAVE_LD_EH_FRAME_HDR 1
7772EOF
7773
7774fi
7775echo "$ac_t""$gcc_cv_ld_eh_frame_hdr" 1>&6
7776
793e9558
PB
7777if test "$prefix" != "/usr" && test "$prefix" != "/usr/local" ; then
7778 cat >> confdefs.h <<EOF
7779#define PREFIX_INCLUDE_DIR "$prefix/include"
7780EOF
7781
7782fi
7783
861bb6c1 7784# Figure out what language subdirectories are present.
71205e0b
MH
7785# Look if the user specified --enable-languages="..."; if not, use
7786# the environment variable $LANGUAGES if defined. $LANGUAGES might
7787# go away some day.
cc9a08e0 7788# NB: embedded tabs in this IF block -- do not untabify
71205e0b
MH
7789if test x"${enable_languages+set}" != xset; then
7790 if test x"${LANGUAGES+set}" = xset; then
cc9a08e0
PE
7791 enable_languages="${LANGUAGES}"
7792 echo "configure: warning: setting LANGUAGES is deprecated, use --enable-languages instead" 1>&2
7793
71205e0b
MH
7794 else
7795 enable_languages=all
7796 fi
d6c6b553 7797else
cc9a08e0
PE
7798 if test x"${enable_languages}" = x ||
7799 test x"${enable_languages}" = xyes;
7800 then
7801 { echo "configure: error: --enable-languages needs at least one language argument" 1>&2; exit 1; }
d6c6b553 7802 fi
71205e0b 7803fi
cc9a08e0 7804enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'`
75382c6d
TT
7805
7806# First scan to see if an enabled language requires some other language.
7807# We assume that a given config-lang.in will list all the language
7808# front ends it requires, even if some are required indirectly.
7809for lang in ${srcdir}/*/config-lang.in ..
7810do
7811 case $lang in
7812 ..)
7813 ;;
7814 # The odd quoting in the next line works around
7815 # an apparent bug in bash 1.12 on linux.
7816 ${srcdir}/[*]/config-lang.in)
7817 ;;
7818 *)
7819 lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
7820 this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang`
7821 for other in $this_lang_requires
7822 do
7823 case ,${enable_languages}, in
7824 *,$other,*)
7825 ;;
7826 *,all,*)
7827 ;;
1bf17cc4 7828 *,$lang_alias,*)
75382c6d
TT
7829 enable_languages="$enable_languages,$other"
7830 ;;
7831 esac
7832 done
7833 ;;
7834 esac
7835done
7836
861bb6c1
JL
7837subdirs=
7838for lang in ${srcdir}/*/config-lang.in ..
7839do
7840 case $lang in
7841 ..) ;;
7842 # The odd quoting in the next line works around
7843 # an apparent bug in bash 1.12 on linux.
7844 ${srcdir}/[*]/config-lang.in) ;;
71205e0b
MH
7845 *)
7846 lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
2b60b2cb
AO
7847 this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang`
7848 build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang`
71205e0b
MH
7849 if test "x$lang_alias" = x
7850 then
7851 echo "$lang doesn't set \$language." 1>&2
7852 exit 1
7853 fi
2b60b2cb
AO
7854 case ${build_by_default},${enable_languages}, in
7855 *,$lang_alias,*) add_this_lang=yes ;;
7856 no,*) add_this_lang=no ;;
7857 *,all,*) add_this_lang=yes ;;
7858 *) add_this_lang=no ;;
7859 esac
71205e0b
MH
7860 if test x"${add_this_lang}" = xyes; then
7861 case $lang in
7862 ${srcdir}/ada/config-lang.in)
1ffc5c6e 7863 if test x$have_gnat = xyes ; then
71205e0b
MH
7864 subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
7865 fi
7866 ;;
7867 *)
7868 subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
7869 ;;
7870 esac
7871 fi
7872 ;;
861bb6c1
JL
7873 esac
7874done
7875
f24af81b
TT
7876# Make gthr-default.h if we have a thread file.
7877gthread_flags=
75bffa71 7878if test $thread_file != single; then
f24af81b 7879 rm -f gthr-default.h
db0d1ed9 7880 echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h
f24af81b
TT
7881 gthread_flags=-DHAVE_GTHR_DEFAULT
7882fi
7883
7884
81bf3d9e
RH
7885# Find out what GC implementation we want, or may, use.
7886# Check whether --with-gc or --without-gc was given.
7887if test "${with_gc+set}" = set; then
7888 withval="$with_gc"
7889 case "$withval" in
7890 simple | page)
7891 GGC=ggc-$withval
7892 ;;
7893 *)
7894 { echo "configure: error: $withval is an invalid option to --with-gc" 1>&2; exit 1; }
7895 ;;
7896esac
7897else
005537df 7898 GGC=ggc-page
81bf3d9e
RH
7899fi
7900
7901
7902echo "Using $GGC for garbage collection."
7903
3c809ba4 7904# Use the system's zlib library.
b8dad04b
ZW
7905zlibdir=-L../zlib
7906zlibinc="-I\$(srcdir)/../zlib"
3c809ba4
AG
7907# Check whether --with-system-zlib or --without-system-zlib was given.
7908if test "${with_system_zlib+set}" = set; then
7909 withval="$with_system_zlib"
7910 zlibdir=
7911zlibinc=
7912
7913fi
7914
7915
7916
7917
dc6746e7
PT
7918
7919echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
4c76f856 7920echo "configure:7921: checking whether to enable maintainer-specific portions of Makefiles" >&5
dc6746e7
PT
7921 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
7922if test "${enable_maintainer_mode+set}" = set; then
7923 enableval="$enable_maintainer_mode"
7924 maintainer_mode=$enableval
7925else
7926 maintainer_mode=no
7927fi
7928
7929
7930echo "$ac_t""$maintainer_mode" 1>&6
7931
7932if test "$maintainer_mode" = "yes"; then
7933 MAINT=''
7934else
7935 MAINT='#'
7936fi
7937
531073e7
RH
7938# With Setjmp/Longjmp based exception handling.
7939# Check whether --enable-sjlj-exceptions or --disable-sjlj-exceptions was given.
7940if test "${enable_sjlj_exceptions+set}" = set; then
7941 enableval="$enable_sjlj_exceptions"
7942 sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi`
7943cat >> confdefs.h <<EOF
7944#define CONFIG_SJLJ_EXCEPTIONS $sjlj
7945EOF
7946
7947fi
7948
7949
861bb6c1
JL
7950# Make empty files to contain the specs and options for each language.
7951# Then add #include lines to for a compiler that has specs and/or options.
7952
7953lang_specs_files=
7954lang_options_files=
3103b7db 7955lang_tree_files=
861bb6c1
JL
7956for subdir in . $subdirs
7957do
75bffa71 7958 if test -f $srcdir/$subdir/lang-specs.h; then
0d24f4d1 7959 lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
861bb6c1 7960 fi
75bffa71 7961 if test -f $srcdir/$subdir/lang-options.h; then
0d24f4d1 7962 lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
861bb6c1 7963 fi
3103b7db 7964 if test -f $srcdir/$subdir/$subdir-tree.def; then
0d24f4d1 7965 lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def"
3103b7db 7966 fi
861bb6c1
JL
7967done
7968
7969# These (without "all_") are set in each config-lang.in.
7970# `language' must be a single word so is spelled singularly.
7971all_languages=
7972all_boot_languages=
7973all_compilers=
7974all_stagestuff=
5b7874aa 7975all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc'
861bb6c1
JL
7976# List of language makefile fragments.
7977all_lang_makefiles=
861bb6c1
JL
7978
7979# Add the language fragments.
7980# Languages are added via two mechanisms. Some information must be
7981# recorded in makefile variables, these are defined in config-lang.in.
7982# We accumulate them and plug them into the main Makefile.
7983# The other mechanism is a set of hooks for each of the main targets
7984# like `clean', `install', etc.
7985
7986language_fragments="Make-lang"
7987language_hooks="Make-hooks"
861bb6c1
JL
7988
7989for s in .. $subdirs
7990do
75bffa71 7991 if test $s != ".."
861bb6c1
JL
7992 then
7993 language=
7994 boot_language=
7995 compilers=
7996 stagestuff=
861bb6c1 7997 outputs=
861bb6c1 7998 . ${srcdir}/$s/config-lang.in
75bffa71 7999 if test "x$language" = x
861bb6c1
JL
8000 then
8001 echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2
8002 exit 1
8003 fi
72aaffbd
ZW
8004 all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Make-lang.in"
8005 if test -f ${srcdir}/$s/Makefile.in
8006 then all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Makefile.in"
8007 fi
861bb6c1 8008 all_languages="$all_languages $language"
75bffa71 8009 if test "x$boot_language" = xyes
861bb6c1
JL
8010 then
8011 all_boot_languages="$all_boot_languages $language"
8012 fi
8013 all_compilers="$all_compilers $compilers"
8014 all_stagestuff="$all_stagestuff $stagestuff"
861bb6c1 8015 all_outputs="$all_outputs $outputs"
861bb6c1
JL
8016 fi
8017done
8018
cbc59f01
DD
8019check_languages=
8020for language in .. $all_languages
8021do
8022 if test $language != ".."
8023 then
8024 check_languages="$check_languages check-$language"
8025 fi
8026done
8027
861bb6c1
JL
8028# Since we can't use `::' targets, we link each language in
8029# with a set of hooks, reached indirectly via lang.${target}.
8030
8031rm -f Make-hooks
8032touch Make-hooks
8033target_list="all.build all.cross start.encap rest.encap \
d3945f0a 8034 info dvi generated-manpages \
861bb6c1 8035 install-normal install-common install-info install-man \
436a88a6 8036 uninstall \
861bb6c1
JL
8037 mostlyclean clean distclean extraclean maintainer-clean \
8038 stage1 stage2 stage3 stage4"
8039for t in $target_list
8040do
8041 x=
ab87f8c8 8042 for lang in .. $all_languages
861bb6c1 8043 do
ab87f8c8
JL
8044 if test $lang != ".."; then
8045 x="$x $lang.$t"
861bb6c1
JL
8046 fi
8047 done
8048 echo "lang.$t: $x" >> Make-hooks
8049done
8050
cc06d68c 8051# Create .gdbinit.
861bb6c1 8052
cc06d68c
GP
8053echo "dir ." > .gdbinit
8054echo "dir ${srcdir}" >> .gdbinit
8055if test x$gdb_needs_out_file_path = xyes
8056then
8057 echo "dir ${srcdir}/config/"`dirname ${out_file}` >> .gdbinit
8058fi
8059if test "x$subdirs" != x; then
8060 for s in $subdirs
8061 do
8062 echo "dir ${srcdir}/$s" >> .gdbinit
8063 done
861bb6c1 8064fi
cc06d68c 8065echo "source ${srcdir}/gdbinit.in" >> .gdbinit
861bb6c1 8066
88111b26
JL
8067# Define variables host_canonical and build_canonical
8068# because some Cygnus local changes in the Makefile depend on them.
8069build_canonical=${build}
8070host_canonical=${host}
8071target_subdir=
75bffa71 8072if test "${host}" != "${target}" ; then
924c96eb 8073 target_subdir=${target_alias}/
88111b26
JL
8074fi
8075
8076
8077
8078
8f8d3278
NC
8079# If $(exec_prefix) exists and is not the same as $(prefix), then compute an
8080# absolute path for gcc_tooldir based on inserting the number of up-directory
8081# movements required to get from $(exec_prefix) to $(prefix) into the basic
8082# $(libsubdir)/@(unlibsubdir) based path.
82cbf8f7
JL
8083# Don't set gcc_tooldir to tooldir since that's only passed in by the toplevel
8084# make and thus we'd get different behavior depending on where we built the
8085# sources.
5949a9fc 8086if test x$exec_prefix = xNONE -o x$exec_prefix = x$prefix; then
d062c304
JL
8087 gcc_tooldir='$(libsubdir)/$(unlibsubdir)/../$(target_alias)'
8088else
8f8d3278
NC
8089# An explanation of the sed strings:
8090# -e 's|^\$(prefix)||' matches and eliminates 'prefix' from 'exec_prefix'
8091# -e 's|/$||' match a trailing forward slash and eliminates it
8092# -e 's|^[^/]|/|' forces the string to start with a forward slash (*)
ff7cc307 8093# -e 's|/[^/]*|../|g' replaces each occurrence of /<directory> with ../
8f8d3278
NC
8094#
8095# (*) Note this pattern overwrites the first character of the string
8096# with a forward slash if one is not already present. This is not a
8097# problem because the exact names of the sub-directories concerned is
8098# unimportant, just the number of them matters.
8099#
8100# The practical upshot of these patterns is like this:
8101#
8102# prefix exec_prefix result
8103# ------ ----------- ------
8104# /foo /foo/bar ../
8105# /foo/ /foo/bar ../
8106# /foo /foo/bar/ ../
8107# /foo/ /foo/bar/ ../
8108# /foo /foo/bar/ugg ../../
8109#
4c112cda
NC
8110 dollar='$$'
8111 gcc_tooldir="\$(libsubdir)/\$(unlibsubdir)/\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/\$(dollar)||' -e 's|^[^/]|/|' -e 's|/[^/]*|../|g'\`\$(target_alias)"
d062c304
JL
8112fi
8113
8114
2ce3c6c6 8115
2bbea3a6
RH
8116# Find a directory in which to install a shared libgcc.
8117
8118# Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given.
8119if test "${enable_version_specific_runtime_libs+set}" = set; then
8120 enableval="$enable_version_specific_runtime_libs"
8121 :
8122fi
8123
8124
5b15f277
RH
8125# Check whether --with-slibdir or --without-slibdir was given.
8126if test "${with_slibdir+set}" = set; then
8127 withval="$with_slibdir"
8128 slibdir="$with_slibdir"
8129else
8130 if test "${enable_version_specific_runtime_libs+set}" = set; then
2bbea3a6 8131 slibdir='$(libsubdir)'
5b15f277 8132elif test "$host" != "$target"; then
2bbea3a6
RH
8133 slibdir='$(build_tooldir)/lib'
8134else
5b15f277 8135 slibdir='$(libdir)'
2bbea3a6 8136fi
5b15f277
RH
8137fi
8138
2bbea3a6
RH
8139
8140
7e717196
JL
8141# Nothing to do for FLOAT_H, float_format already handled.
8142objdir=`pwd`
8143
8144
861bb6c1
JL
8145# Process the language and host/target makefile fragments.
8146${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xmake_file" "$dep_tmake_file"
8147
8148# Substitute configuration variables
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
9b16d2c4 8195
e9a25f70 8196
6e26218f 8197
c8724862 8198
e061d1ce 8199
d8bb17c8 8200
11642c3a
ZW
8201
8202
8203
8204
8205
8206
8207
3d9d2476 8208
596151e1 8209
861bb6c1
JL
8210
8211
8212# Echo that links are built
75bffa71 8213if test x$host = x$target
861bb6c1
JL
8214then
8215 str1="native "
8216else
8217 str1="cross-"
8218 str2=" from $host"
8219fi
8220
75bffa71 8221if test x$host != x$build
861bb6c1
JL
8222then
8223 str3=" on a $build system"
8224fi
8225
75bffa71 8226if test "x$str2" != x || test "x$str3" != x
861bb6c1
JL
8227then
8228 str4=
8229fi
8230
8231echo "Links are now set up to build a ${str1}compiler for ${target}$str4" 1>&2
8232
75bffa71 8233if test "x$str2" != x || test "x$str3" != x
861bb6c1
JL
8234then
8235 echo " ${str2}${str3}." 1>&2
8236fi
8237
f6cb0e63 8238# Truncate the target if necessary
75bffa71 8239if test x$host_truncate_target != x; then
f6cb0e63
JL
8240 target=`echo $target | sed -e 's/\(..............\).*/\1/'`
8241fi
8242
861bb6c1
JL
8243# Configure the subdirectories
8244# AC_CONFIG_SUBDIRS($subdirs)
8245
8246# Create the Makefile
8247# and configure language subdirectories
8248trap '' 1 2 15
8249cat > confcache <<\EOF
8250# This file is a shell script that caches the results of configure
8251# tests run on this system so they can be shared between configure
8252# scripts and configure runs. It is not useful on other systems.
8253# If it contains results you don't want to keep, you may remove or edit it.
8254#
8255# By default, configure uses ./config.cache as the cache file,
8256# creating it if it does not exist already. You can give configure
8257# the --cache-file=FILE option to use a different cache file; that is
8258# what configure does when it calls configure scripts in
8259# subdirectories, so they share the cache.
8260# Giving --cache-file=/dev/null disables caching, for debugging configure.
8261# config.status only pays attention to the cache file if you give it the
8262# --recheck option to rerun configure.
8263#
8264EOF
8265# The following way of writing the cache mishandles newlines in values,
8266# but we know of no workaround that is simple, portable, and efficient.
8267# So, don't put newlines in cache variables' values.
8268# Ultrix sh set writes to stderr and can't be redirected directly,
8269# and sets the high bit in the cache file unless we assign to the vars.
8270(set) 2>&1 |
b27d2bd5 8271 case `(ac_space=' '; set | grep ac_space) 2>&1` in
861bb6c1
JL
8272 *ac_space=\ *)
8273 # `set' does not quote correctly, so add quotes (double-quote substitution
8274 # turns \\\\ into \\, and sed turns \\ into \).
8275 sed -n \
8276 -e "s/'/'\\\\''/g" \
8277 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
8278 ;;
8279 *)
8280 # `set' quotes correctly as required by POSIX, so do not add quotes.
8281 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
8282 ;;
8283 esac >> confcache
8284if cmp -s $cache_file confcache; then
8285 :
8286else
8287 if test -w $cache_file; then
8288 echo "updating cache $cache_file"
8289 cat confcache > $cache_file
8290 else
8291 echo "not updating unwritable cache $cache_file"
8292 fi
8293fi
8294rm -f confcache
8295
8296trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
8297
8298test "x$prefix" = xNONE && prefix=$ac_default_prefix
8299# Let make expand exec_prefix.
8300test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
8301
8302# Any assignment to VPATH causes Sun make to only execute
8303# the first set of double-colon rules, so remove it if not needed.
8304# If there is a colon in the path, we need to keep it.
8305if test "x$srcdir" = x.; then
8306 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
8307fi
8308
8309trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
8310
8311DEFS=-DHAVE_CONFIG_H
8312
8313# Without the "./", some shells look in PATH for config.status.
8314: ${CONFIG_STATUS=./config.status}
8315
8316echo creating $CONFIG_STATUS
8317rm -f $CONFIG_STATUS
8318cat > $CONFIG_STATUS <<EOF
8319#! /bin/sh
8320# Generated automatically by configure.
8321# Run this file to recreate the current configuration.
8322# This directory was configured as follows,
8323# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
8324#
8325# $0 $ac_configure_args
8326#
8327# Compiler output produced by configure, useful for debugging
8328# configure, is in ./config.log if it exists.
8329
8330ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
8331for ac_option
8332do
8333 case "\$ac_option" in
8334 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
8335 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
8336 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
8337 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
b27d2bd5 8338 echo "$CONFIG_STATUS generated by autoconf version 2.13"
861bb6c1
JL
8339 exit 0 ;;
8340 -help | --help | --hel | --he | --h)
8341 echo "\$ac_cs_usage"; exit 0 ;;
8342 *) echo "\$ac_cs_usage"; exit 1 ;;
8343 esac
8344done
8345
8346ac_given_srcdir=$srcdir
861bb6c1 8347
b7cb92ad 8348trap 'rm -fr `echo "$all_outputs auto-host.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
861bb6c1
JL
8349EOF
8350cat >> $CONFIG_STATUS <<EOF
8351
8352# Protect against being on the right side of a sed subst in config.status.
8353sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
8354 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
8355$ac_vpsub
8356$extrasub
6f144c9c 8357s%@SHELL@%$SHELL%g
861bb6c1
JL
8358s%@CFLAGS@%$CFLAGS%g
8359s%@CPPFLAGS@%$CPPFLAGS%g
8360s%@CXXFLAGS@%$CXXFLAGS%g
b27d2bd5 8361s%@FFLAGS@%$FFLAGS%g
861bb6c1
JL
8362s%@DEFS@%$DEFS%g
8363s%@LDFLAGS@%$LDFLAGS%g
8364s%@LIBS@%$LIBS%g
8365s%@exec_prefix@%$exec_prefix%g
8366s%@prefix@%$prefix%g
8367s%@program_transform_name@%$program_transform_name%g
8368s%@bindir@%$bindir%g
8369s%@sbindir@%$sbindir%g
8370s%@libexecdir@%$libexecdir%g
8371s%@datadir@%$datadir%g
8372s%@sysconfdir@%$sysconfdir%g
8373s%@sharedstatedir@%$sharedstatedir%g
8374s%@localstatedir@%$localstatedir%g
8375s%@libdir@%$libdir%g
8376s%@includedir@%$includedir%g
8377s%@oldincludedir@%$oldincludedir%g
8378s%@infodir@%$infodir%g
8379s%@mandir@%$mandir%g
39d6f2e8 8380s%@enable_multilib@%$enable_multilib%g
50503ac8 8381s%@enable_shared@%$enable_shared%g
861bb6c1
JL
8382s%@host@%$host%g
8383s%@host_alias@%$host_alias%g
8384s%@host_cpu@%$host_cpu%g
8385s%@host_vendor@%$host_vendor%g
8386s%@host_os@%$host_os%g
8387s%@target@%$target%g
8388s%@target_alias@%$target_alias%g
8389s%@target_cpu@%$target_cpu%g
8390s%@target_vendor@%$target_vendor%g
8391s%@target_os@%$target_os%g
8392s%@build@%$build%g
8393s%@build_alias@%$build_alias%g
8394s%@build_cpu@%$build_cpu%g
8395s%@build_vendor@%$build_vendor%g
8396s%@build_os@%$build_os%g
e9a25f70 8397s%@CC@%$CC%g
3ec83fc2 8398s%@NO_MINUS_C_MINUS_O@%$NO_MINUS_C_MINUS_O%g
b8dad04b 8399s%@OUTPUT_OPTION@%$OUTPUT_OPTION%g
200ef634
GK
8400s%@GNATBIND@%$GNATBIND%g
8401s%@ADAC@%$ADAC%g
b8dad04b 8402s%@strict1_warn@%$strict1_warn%g
84c041a1 8403s%@CPP@%$CPP%g
b8dad04b
ZW
8404s%@warn_cflags@%$warn_cflags%g
8405s%@stage1_cflags@%$stage1_cflags%g
e9a25f70 8406s%@SET_MAKE@%$SET_MAKE%g
861bb6c1 8407s%@AWK@%$AWK%g
0a4b6309
RL
8408s%@LN@%$LN%g
8409s%@LN_S@%$LN_S%g
861bb6c1 8410s%@RANLIB@%$RANLIB%g
0a4b6309
RL
8411s%@INSTALL@%$INSTALL%g
8412s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
8413s%@INSTALL_DATA@%$INSTALL_DATA%g
955be633 8414s%@have_mktemp_command@%$have_mktemp_command%g
09fa0705
ZW
8415s%@MAKEINFO@%$MAKEINFO%g
8416s%@BUILD_INFO@%$BUILD_INFO%g
fd939e46 8417s%@GENERATED_MANPAGES@%$GENERATED_MANPAGES%g
1e608388
ZW
8418s%@FLEX@%$FLEX%g
8419s%@BISON@%$BISON%g
4e70264f 8420s%@COLLECT2_LIBS@%$COLLECT2_LIBS%g
7f2749d4 8421s%@GNAT_LIBEXC@%$GNAT_LIBEXC%g
e256b8b6 8422s%@TARGET_GETGROUPS_T@%$TARGET_GETGROUPS_T%g
f91abfce 8423s%@LIBICONV@%$LIBICONV%g
861bb6c1 8424s%@manext@%$manext%g
992d1248 8425s%@objext@%$objext%g
06f0b04c 8426s%@FORBUILD@%$FORBUILD%g
ab87f8c8
JL
8427s%@PACKAGE@%$PACKAGE%g
8428s%@VERSION@%$VERSION%g
71a94577
ZW
8429s%@ALLOCA@%$ALLOCA%g
8430s%@GLIBC21@%$GLIBC21%g
ab87f8c8
JL
8431s%@USE_NLS@%$USE_NLS%g
8432s%@MSGFMT@%$MSGFMT%g
8433s%@GMSGFMT@%$GMSGFMT%g
8434s%@XGETTEXT@%$XGETTEXT%g
71a94577
ZW
8435s%@INTLBISON@%$INTLBISON%g
8436s%@BUILD_INCLUDED_LIBINTL@%$BUILD_INCLUDED_LIBINTL%g
ab87f8c8
JL
8437s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
8438s%@CATALOGS@%$CATALOGS%g
8439s%@CATOBJEXT@%$CATOBJEXT%g
ab87f8c8 8440s%@INTLLIBS@%$INTLLIBS%g
77c06844 8441s%@INTLDEPS@%$INTLDEPS%g
ab87f8c8 8442s%@INTLOBJS@%$INTLOBJS%g
ab87f8c8 8443s%@POSUB@%$POSUB%g
71a94577
ZW
8444s%@DATADIRNAME@%$DATADIRNAME%g
8445s%@INSTOBJEXT@%$INSTOBJEXT%g
8446s%@GENCAT@%$GENCAT%g
ab87f8c8 8447s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
71a94577 8448s%@INTL_LIBTOOL_SUFFIX_PREFIX@%$INTL_LIBTOOL_SUFFIX_PREFIX%g
a078a589
ZW
8449s%@CROSS@%$CROSS%g
8450s%@ALL@%$ALL%g
8451s%@SYSTEM_HEADER_DIR@%$SYSTEM_HEADER_DIR%g
b39d221a 8452s%@inhibit_libc@%$inhibit_libc%g
a078a589
ZW
8453s%@HOST_PREFIX@%$HOST_PREFIX%g
8454s%@HOST_PREFIX_1@%$HOST_PREFIX_1%g
8455s%@HOST_CC@%$HOST_CC%g
8456s%@HOST_CFLAGS@%$HOST_CFLAGS%g
8457s%@STMP_FIXINC@%$STMP_FIXINC%g
8458s%@STMP_FIXPROTO@%$STMP_FIXPROTO%g
9e944a16 8459s%@libgcc_visibility@%$libgcc_visibility%g
f24af81b 8460s%@gthread_flags@%$gthread_flags%g
81bf3d9e 8461s%@GGC@%$GGC%g
3c809ba4
AG
8462s%@zlibdir@%$zlibdir%g
8463s%@zlibinc@%$zlibinc%g
dc6746e7 8464s%@MAINT@%$MAINT%g
88111b26
JL
8465s%@build_canonical@%$build_canonical%g
8466s%@host_canonical@%$host_canonical%g
8467s%@target_subdir@%$target_subdir%g
d062c304 8468s%@gcc_tooldir@%$gcc_tooldir%g
4c112cda 8469s%@dollar@%$dollar%g
2bbea3a6 8470s%@slibdir@%$slibdir%g
7e717196 8471s%@objdir@%$objdir%g
861bb6c1 8472s%@subdirs@%$subdirs%g
861bb6c1
JL
8473s%@all_boot_languages@%$all_boot_languages%g
8474s%@all_compilers@%$all_compilers%g
4f3ae93c
BK
8475s%@all_lang_makefiles@%$all_lang_makefiles%g
8476s%@all_languages@%$all_languages%g
4f3ae93c
BK
8477s%@all_stagestuff@%$all_stagestuff%g
8478s%@build_exeext@%$build_exeext%g
8479s%@build_install_headers_dir@%$build_install_headers_dir%g
8480s%@build_xm_file_list@%$build_xm_file_list%g
11642c3a
ZW
8481s%@build_xm_file@%$build_xm_file%g
8482s%@build_xm_defines@%$build_xm_defines%g
cbc59f01 8483s%@check_languages@%$check_languages%g
4f3ae93c 8484s%@cc_set_by_configure@%$cc_set_by_configure%g
5aa82ace 8485s%@quoted_cc_set_by_configure@%$quoted_cc_set_by_configure%g
4f3ae93c 8486s%@cpp_install_dir@%$cpp_install_dir%g
4f3ae93c
BK
8487s%@dep_host_xmake_file@%$dep_host_xmake_file%g
8488s%@dep_tmake_file@%$dep_tmake_file%g
4f3ae93c 8489s%@extra_headers_list@%$extra_headers_list%g
861bb6c1 8490s%@extra_objs@%$extra_objs%g
4f3ae93c
BK
8491s%@extra_parts@%$extra_parts%g
8492s%@extra_passes@%$extra_passes%g
8493s%@extra_programs@%$extra_programs%g
4f3ae93c 8494s%@float_h_file@%$float_h_file%g
cc1e60ea 8495s%@gcc_config_arguments@%$gcc_config_arguments%g
4f3ae93c 8496s%@gcc_gxx_include_dir@%$gcc_gxx_include_dir%g
e2187d3b 8497s%@libstdcxx_incdir@%$libstdcxx_incdir%g
4f3ae93c 8498s%@gcc_version@%$gcc_version%g
8763704d 8499s%@gcc_version_full@%$gcc_version_full%g
4f3ae93c
BK
8500s%@gcc_version_trigger@%$gcc_version_trigger%g
8501s%@host_exeext@%$host_exeext%g
861bb6c1 8502s%@host_extra_gcc_objs@%$host_extra_gcc_objs%g
861bb6c1 8503s%@host_xm_file_list@%$host_xm_file_list%g
11642c3a
ZW
8504s%@host_xm_file@%$host_xm_file%g
8505s%@host_xm_defines@%$host_xm_defines%g
4f3ae93c 8506s%@install@%$install%g
861bb6c1 8507s%@lang_options_files@%$lang_options_files%g
4f3ae93c 8508s%@lang_specs_files@%$lang_specs_files%g
3103b7db 8509s%@lang_tree_files@%$lang_tree_files%g
861bb6c1 8510s%@local_prefix@%$local_prefix%g
4f3ae93c
BK
8511s%@md_file@%$md_file%g
8512s%@objc_boehm_gc@%$objc_boehm_gc%g
8513s%@out_file@%$out_file%g
8514s%@out_object_file@%$out_object_file%g
861bb6c1 8515s%@stage_prefix_set_by_configure@%$stage_prefix_set_by_configure%g
596151e1 8516s%@quoted_stage_prefix_set_by_configure@%$quoted_stage_prefix_set_by_configure%g
e9a25f70 8517s%@symbolic_link@%$symbolic_link%g
4f3ae93c
BK
8518s%@thread_file@%$thread_file%g
8519s%@tm_file_list@%$tm_file_list%g
11642c3a
ZW
8520s%@tm_file@%$tm_file%g
8521s%@tm_p_file_list@%$tm_p_file_list%g
8522s%@tm_p_file@%$tm_p_file%g
8523s%@xm_file@%$xm_file%g
3d9d2476 8524s%@xm_defines@%$xm_defines%g
aac69a49
NC
8525s%@c_target_objs@%$c_target_objs%g
8526s%@cxx_target_objs@%$cxx_target_objs%g
11642c3a 8527s%@target_cpu_default@%$target_cpu_default%g
861bb6c1
JL
8528/@target_overrides@/r $target_overrides
8529s%@target_overrides@%%g
8530/@host_overrides@/r $host_overrides
8531s%@host_overrides@%%g
861bb6c1
JL
8532/@language_fragments@/r $language_fragments
8533s%@language_fragments@%%g
8534/@language_hooks@/r $language_hooks
8535s%@language_hooks@%%g
8536
8537CEOF
8538EOF
8539
8540cat >> $CONFIG_STATUS <<\EOF
8541
8542# Split the substitutions into bite-sized pieces for seds with
8543# small command number limits, like on Digital OSF/1 and HP-UX.
8544ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
8545ac_file=1 # Number of current file.
8546ac_beg=1 # First line for current file.
8547ac_end=$ac_max_sed_cmds # Line after last line for current file.
8548ac_more_lines=:
8549ac_sed_cmds=""
8550while $ac_more_lines; do
8551 if test $ac_beg -gt 1; then
8552 sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
8553 else
8554 sed "${ac_end}q" conftest.subs > conftest.s$ac_file
8555 fi
8556 if test ! -s conftest.s$ac_file; then
8557 ac_more_lines=false
8558 rm -f conftest.s$ac_file
8559 else
8560 if test -z "$ac_sed_cmds"; then
8561 ac_sed_cmds="sed -f conftest.s$ac_file"
8562 else
8563 ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
8564 fi
8565 ac_file=`expr $ac_file + 1`
8566 ac_beg=$ac_end
8567 ac_end=`expr $ac_end + $ac_max_sed_cmds`
8568 fi
8569done
8570if test -z "$ac_sed_cmds"; then
8571 ac_sed_cmds=cat
8572fi
8573EOF
8574
8575cat >> $CONFIG_STATUS <<EOF
8576
8577CONFIG_FILES=\${CONFIG_FILES-"$all_outputs"}
8578EOF
8579cat >> $CONFIG_STATUS <<\EOF
8580for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
8581 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8582 case "$ac_file" in
8583 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8584 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8585 *) ac_file_in="${ac_file}.in" ;;
8586 esac
8587
8588 # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
8589
8590 # Remove last slash and all that follows it. Not all systems have dirname.
8591 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
8592 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
8593 # The file is in a subdirectory.
8594 test ! -d "$ac_dir" && mkdir "$ac_dir"
8595 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
8596 # A "../" for each directory in $ac_dir_suffix.
8597 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
8598 else
8599 ac_dir_suffix= ac_dots=
8600 fi
8601
8602 case "$ac_given_srcdir" in
8603 .) srcdir=.
8604 if test -z "$ac_dots"; then top_srcdir=.
8605 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
8606 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
8607 *) # Relative path.
8608 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
8609 top_srcdir="$ac_dots$ac_given_srcdir" ;;
8610 esac
8611
861bb6c1
JL
8612
8613 echo creating "$ac_file"
8614 rm -f "$ac_file"
8615 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
8616 case "$ac_file" in
8617 *Makefile*) ac_comsub="1i\\
8618# $configure_input" ;;
8619 *) ac_comsub= ;;
8620 esac
8621
8622 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8623 sed -e "$ac_comsub
8624s%@configure_input@%$configure_input%g
8625s%@srcdir@%$srcdir%g
8626s%@top_srcdir@%$top_srcdir%g
861bb6c1
JL
8627" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
8628fi; done
8629rm -f conftest.s*
8630
8631# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
8632# NAME is the cpp macro being defined and VALUE is the value it is being given.
8633#
8634# ac_d sets the value in "#define NAME VALUE" lines.
8635ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
8636ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
8637ac_dC='\3'
8638ac_dD='%g'
8639# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
8640ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
8641ac_uB='\([ ]\)%\1#\2define\3'
8642ac_uC=' '
8643ac_uD='\4%g'
8644# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
8645ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
8646ac_eB='$%\1#\2define\3'
8647ac_eC=' '
8648ac_eD='%g'
8649
8650if test "${CONFIG_HEADERS+set}" != set; then
8651EOF
8652cat >> $CONFIG_STATUS <<EOF
b7cb92ad 8653 CONFIG_HEADERS="auto-host.h:config.in"
861bb6c1
JL
8654EOF
8655cat >> $CONFIG_STATUS <<\EOF
8656fi
8657for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
8658 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8659 case "$ac_file" in
8660 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8661 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8662 *) ac_file_in="${ac_file}.in" ;;
8663 esac
8664
8665 echo creating $ac_file
8666
8667 rm -f conftest.frag conftest.in conftest.out
8668 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8669 cat $ac_file_inputs > conftest.in
8670
8671EOF
8672
8673# Transform confdefs.h into a sed script conftest.vals that substitutes
8674# the proper values into config.h.in to produce config.h. And first:
8675# Protect against being on the right side of a sed subst in config.status.
8676# Protect against being in an unquoted here document in config.status.
8677rm -f conftest.vals
8678cat > conftest.hdr <<\EOF
8679s/[\\&%]/\\&/g
8680s%[\\$`]%\\&%g
8681s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
8682s%ac_d%ac_u%gp
8683s%ac_u%ac_e%gp
8684EOF
8685sed -n -f conftest.hdr confdefs.h > conftest.vals
8686rm -f conftest.hdr
8687
8688# This sed command replaces #undef with comments. This is necessary, for
8689# example, in the case of _POSIX_SOURCE, which is predefined and required
8690# on some systems where configure will not decide to define it.
8691cat >> conftest.vals <<\EOF
8692s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
8693EOF
8694
8695# Break up conftest.vals because some shells have a limit on
8696# the size of here documents, and old seds have small limits too.
8697
8698rm -f conftest.tail
8699while :
8700do
8701 ac_lines=`grep -c . conftest.vals`
8702 # grep -c gives empty output for an empty file on some AIX systems.
8703 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
8704 # Write a limited-size here document to conftest.frag.
8705 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
8706 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
8707 echo 'CEOF
8708 sed -f conftest.frag conftest.in > conftest.out
8709 rm -f conftest.in
8710 mv conftest.out conftest.in
8711' >> $CONFIG_STATUS
8712 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
8713 rm -f conftest.vals
8714 mv conftest.tail conftest.vals
8715done
8716rm -f conftest.vals
8717
8718cat >> $CONFIG_STATUS <<\EOF
8719 rm -f conftest.frag conftest.h
8720 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
8721 cat conftest.in >> conftest.h
8722 rm -f conftest.in
8723 if cmp -s $ac_file conftest.h 2>/dev/null; then
8724 echo "$ac_file is unchanged"
8725 rm -f conftest.h
8726 else
8727 # Remove last slash and all that follows it. Not all systems have dirname.
8728 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
8729 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
8730 # The file is in a subdirectory.
8731 test ! -d "$ac_dir" && mkdir "$ac_dir"
8732 fi
8733 rm -f $ac_file
8734 mv conftest.h $ac_file
8735 fi
8736fi; done
8737
8738EOF
8739cat >> $CONFIG_STATUS <<EOF
8740
0d24f4d1
ZW
8741subdirs='$subdirs'
8742symbolic_link='$symbolic_link'
861bb6c1
JL
8743
8744EOF
8745cat >> $CONFIG_STATUS <<\EOF
71a94577
ZW
8746for ac_file in $CONFIG_FILES; do
8747 # Support "outfile[:infile[:infile...]]"
8748 case "$ac_file" in
8749 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8750 esac
8751 # PO directories have a Makefile.in generated from Makefile.in.in.
8752 case "$ac_file" in */Makefile.in)
8753 # Adjust a relative srcdir.
8754 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
8755 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
8756 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
8757 # In autoconf-2.13 it is called $ac_given_srcdir.
8758 # In autoconf-2.50 it is called $srcdir.
8759 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
8760 case "$ac_given_srcdir" in
8761 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
8762 /*) top_srcdir="$ac_given_srcdir" ;;
8763 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
8764 esac
8765 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
8766 rm -f "$ac_dir/POTFILES"
8767 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
8768 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
8769 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
8770 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
8771 fi
8772 ;;
8773 esac
8774 done
861bb6c1 8775
861bb6c1 8776case x$CONFIG_HEADERS in
b7cb92ad 8777xauto-host.h:config.in)
861bb6c1
JL
8778echo > cstamp-h ;;
8779esac
93cf819d
BK
8780# If the host supports symlinks, point stage[1234] at ../stage[1234] so
8781# bootstrapping and the installation procedure can still use
8782# CC="stage1/xgcc -Bstage1/". If the host doesn't support symlinks,
8783# FLAGS_TO_PASS has been modified to solve the problem there.
8784# This is virtually a duplicate of what happens in configure.lang; we do
8785# an extra check to make sure this only happens if ln -s can be used.
75bffa71 8786if test "$symbolic_link" = "ln -s"; then
d8140df6 8787 for d in .. ${subdirs} fixinc ; do
75bffa71 8788 if test $d != ..; then
4e8a434e
BK
8789 STARTDIR=`pwd`
8790 cd $d
8791 for t in stage1 stage2 stage3 stage4 include
8792 do
8793 rm -f $t
8794 $symbolic_link ../$t $t 2>/dev/null
8795 done
8796 cd $STARTDIR
93cf819d
BK
8797 fi
8798 done
8799else true ; fi
ab87f8c8
JL
8800# Avoid having to add intl to our include paths.
8801if test -f intl/libintl.h; then
8802 echo creating libintl.h
8803 echo '#include "intl/libintl.h"' >libintl.h
8804fi
861bb6c1
JL
8805
8806exit 0
8807EOF
8808chmod +x $CONFIG_STATUS
8809rm -fr confdefs* $ac_clean_files
8810test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
8811
This page took 2.624195 seconds and 5 git commands to generate.