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