OSDN Git Service

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