OSDN Git Service

8dbe3edd15f6843d95ad83e496e0f8fc2b5732d2
[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,fold;
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 ac_fold_checking=
1937 case "${enableval}" in
1938 yes)    ac_checking=1 ; ac_tree_checking=1 ; ac_gc_checking=1 ;
1939         ac_rtlflag_checking=1 ;;
1940 no)     ;;
1941 *)      IFS="${IFS=     }"; ac_save_IFS="$IFS"; IFS="$IFS,"
1942         set fnord $enableval; shift
1943         IFS="$ac_save_IFS"
1944         for check
1945         do
1946                 case $check in
1947                 misc)   ac_checking=1 ;;
1948                 tree)   ac_tree_checking=1 ;;
1949                 rtlflag)        ac_rtlflag_checking=1 ;;
1950                 rtl)    ac_rtl_checking=1 ;;
1951                 gc)     ac_gc_checking=1 ;;
1952                 gcac)   ac_gc_always_collect=1 ;;
1953                 fold)   ac_fold_checking=1 ;;
1954                 valgrind)       ac_checking_valgrind=1 ;;
1955                 *)      { echo "configure: error: unknown check category $check" 1>&2; exit 1; } ;;
1956                 esac
1957         done
1958         ;;
1959 esac
1960
1961 else
1962   # Enable some checks by default for development versions of GCC
1963 ac_checking=1; ac_tree_checking=1; ac_gc_checking=1; ac_rtlflag_checking=1;
1964 fi
1965
1966 nocommon_flag=""
1967 if test x$ac_checking != x ; then
1968   cat >> confdefs.h <<\EOF
1969 #define ENABLE_CHECKING 1
1970 EOF
1971
1972   nocommon_flag=-fno-common
1973 fi
1974
1975 if test x$ac_tree_checking != x ; then
1976   cat >> confdefs.h <<\EOF
1977 #define ENABLE_TREE_CHECKING 1
1978 EOF
1979
1980 fi
1981 if test x$ac_rtl_checking != x ; then
1982   cat >> confdefs.h <<\EOF
1983 #define ENABLE_RTL_CHECKING 1
1984 EOF
1985
1986 fi
1987 if test x$ac_rtlflag_checking != x ; then
1988   cat >> confdefs.h <<\EOF
1989 #define ENABLE_RTL_FLAG_CHECKING 1
1990 EOF
1991
1992 fi
1993 if test x$ac_gc_checking != x ; then
1994   cat >> confdefs.h <<\EOF
1995 #define ENABLE_GC_CHECKING 1
1996 EOF
1997
1998 fi
1999 if test x$ac_gc_always_collect != x ; then
2000   cat >> confdefs.h <<\EOF
2001 #define ENABLE_GC_ALWAYS_COLLECT 1
2002 EOF
2003
2004 fi
2005 if test x$ac_fold_checking != x ; then
2006   cat >> confdefs.h <<\EOF
2007 #define ENABLE_FOLD_CHECKING 1
2008 EOF
2009
2010 fi
2011 valgrind_path_defines=
2012 valgrind_command=
2013 if test x$ac_checking_valgrind != x ; then
2014   # It is certainly possible that there's valgrind but no valgrind.h.
2015   # GCC relies on making annotations so we must have both.
2016   echo $ac_n "checking for VALGRIND_DISCARD in <memcheck.h>""... $ac_c" 1>&6
2017 echo "configure:2018: checking for VALGRIND_DISCARD in <memcheck.h>" >&5
2018   cat > conftest.$ac_ext <<EOF
2019 #line 2020 "configure"
2020 #include "confdefs.h"
2021 #include <memcheck.h>
2022 #ifndef VALGRIND_DISCARD
2023 #error VALGRIND_DISCARD not defined
2024 #endif
2025 EOF
2026 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2027 { (eval echo configure:2028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2028 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2029 if test -z "$ac_err"; then
2030   rm -rf conftest*
2031   gcc_cv_header_memcheck_h=yes
2032 else
2033   echo "$ac_err" >&5
2034   echo "configure: failed program was:" >&5
2035   cat conftest.$ac_ext >&5
2036   rm -rf conftest*
2037   gcc_cv_header_memcheck_h=no
2038 fi
2039 rm -f conftest*
2040   echo "$ac_t""$gcc_cv_header_memcheck_h" 1>&6
2041   ac_safe=`echo "valgrind.h" | sed 'y%./+-%__p_%'`
2042 echo $ac_n "checking for valgrind.h""... $ac_c" 1>&6
2043 echo "configure:2044: checking for valgrind.h" >&5
2044 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2045   echo $ac_n "(cached) $ac_c" 1>&6
2046 else
2047   cat > conftest.$ac_ext <<EOF
2048 #line 2049 "configure"
2049 #include "confdefs.h"
2050 #include <valgrind.h>
2051 EOF
2052 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2053 { (eval echo configure:2054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2054 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2055 if test -z "$ac_err"; then
2056   rm -rf conftest*
2057   eval "ac_cv_header_$ac_safe=yes"
2058 else
2059   echo "$ac_err" >&5
2060   echo "configure: failed program was:" >&5
2061   cat conftest.$ac_ext >&5
2062   rm -rf conftest*
2063   eval "ac_cv_header_$ac_safe=no"
2064 fi
2065 rm -f conftest*
2066 fi
2067 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2068   echo "$ac_t""yes" 1>&6
2069   have_valgrind_h=yes
2070 else
2071   echo "$ac_t""no" 1>&6
2072 have_valgrind_h=no
2073 fi
2074
2075   
2076 # Prepare PATH_SEPARATOR.
2077 # The user is always right.
2078 if test "${PATH_SEPARATOR+set}" != set; then
2079   echo "#! /bin/sh" >conf$$.sh
2080   echo  "exit 0"   >>conf$$.sh
2081   chmod +x conf$$.sh
2082   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2083     PATH_SEPARATOR=';'
2084   else
2085     PATH_SEPARATOR=:
2086   fi
2087   rm -f conf$$.sh
2088 fi
2089
2090 # Find out how to test for executable files. Don't use a zero-byte file,
2091 # as systems may use methods other than mode bits to determine executability.
2092 cat >conf$$.file <<_ASEOF
2093 #! /bin/sh
2094 exit 0
2095 _ASEOF
2096 chmod +x conf$$.file
2097 if test -x conf$$.file >/dev/null 2>&1; then
2098   ac_executable_p="test -x"
2099 else
2100   ac_executable_p="test -f"
2101 fi
2102 rm -f conf$$.file
2103
2104 # Extract the first word of "valgrind", so it can be a program name with args.
2105 set dummy valgrind; ac_word=$2
2106 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2107 echo "configure:2108: checking for $ac_word" >&5
2108 if eval "test \"`echo '$''{'ac_cv_path_valgrind_path'+set}'`\" = set"; then
2109   echo $ac_n "(cached) $ac_c" 1>&6
2110 else
2111   case "$valgrind_path" in
2112   [\\/]* | ?:[\\/]*)
2113     ac_cv_path_valgrind_path="$valgrind_path" # Let the user override the test with a path.
2114     ;;
2115   *)
2116     ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2117     for ac_dir in $PATH; do
2118       IFS="$ac_save_IFS"
2119       test -z "$ac_dir" && ac_dir=.
2120       for ac_exec_ext in '' $ac_executable_extensions; do
2121         if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2122           if $ac_dir/$ac_word --version | grep valgrind- >/dev/null 2>&1; then
2123             ac_cv_path_valgrind_path="$ac_dir/$ac_word$ac_exec_ext"
2124             break 2
2125           fi
2126         fi
2127       done
2128     done
2129     IFS="$ac_save_IFS"
2130     ;;
2131 esac
2132 fi
2133 valgrind_path="$ac_cv_path_valgrind_path"
2134 if test -n "$valgrind_path"; then
2135   echo "$ac_t""$valgrind_path" 1>&6
2136 else
2137   echo "$ac_t""no" 1>&6
2138 fi
2139
2140   if test "x$valgrind_path" = "x" || (test $have_valgrind_h = no && test $gcc_cv_header_memcheck_h = no); then
2141         { echo "configure: error: *** Can't find both valgrind and valgrind.h/memcheck.h" 1>&2; exit 1; }
2142   fi
2143   valgrind_path_defines=-DVALGRIND_PATH='\"'$valgrind_path'\"'
2144   valgrind_command="$valgrind_path -q"
2145   cat >> confdefs.h <<\EOF
2146 #define ENABLE_VALGRIND_CHECKING 1
2147 EOF
2148
2149   if test $gcc_cv_header_memcheck_h = yes; then
2150     cat >> confdefs.h <<\EOF
2151 #define HAVE_MEMCHECK_H 1
2152 EOF
2153
2154   fi
2155 fi
2156
2157
2158
2159 # Enable code coverage collection
2160 # Check whether --enable-coverage or --disable-coverage was given.
2161 if test "${enable_coverage+set}" = set; then
2162   enableval="$enable_coverage"
2163   case "${enableval}" in
2164 yes|noopt)
2165         coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O0"
2166         ;;
2167 opt)
2168         coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2"
2169         ;;
2170 *)
2171         { echo "configure: error: unknown coverage setting $enableval" 1>&2; exit 1; }
2172         ;;
2173 esac
2174 else
2175   coverage_flags=""
2176 fi
2177
2178
2179
2180 # -------------------------------
2181 # Miscenalleous configure options
2182 # -------------------------------
2183
2184 # With stabs
2185 # Check whether --with-stabs or --without-stabs was given.
2186 if test "${with_stabs+set}" = set; then
2187   withval="$with_stabs"
2188   stabs="$with_stabs"
2189 else
2190   stabs=no
2191 fi
2192
2193
2194 # With ELF
2195 # Check whether --with-elf or --without-elf was given.
2196 if test "${with_elf+set}" = set; then
2197   withval="$with_elf"
2198   elf="$with_elf"
2199 else
2200   elf=no
2201 fi
2202
2203
2204 # Determine whether or not multilibs are enabled.
2205 # Check whether --enable-multilib or --disable-multilib was given.
2206 if test "${enable_multilib+set}" = set; then
2207   enableval="$enable_multilib"
2208   :
2209 else
2210   enable_multilib=yes
2211 fi
2212
2213
2214
2215 # Enable __cxa_atexit for C++.
2216 # Check whether --enable-__cxa_atexit or --disable-__cxa_atexit was given.
2217 if test "${enable___cxa_atexit+set}" = set; then
2218   enableval="$enable___cxa_atexit"
2219   :
2220 fi
2221
2222
2223 # Enable threads
2224 # Pass with no value to take the default
2225 # Pass with a value to specify a thread package
2226 # Check whether --enable-threads or --disable-threads was given.
2227 if test "${enable_threads+set}" = set; then
2228   enableval="$enable_threads"
2229   :
2230 else
2231   enable_threads=''
2232 fi
2233
2234
2235 enable_threads_flag=$enable_threads
2236 # Check if a valid thread package
2237 case x${enable_threads_flag} in
2238         x | xno)
2239                 # No threads
2240                 target_thread_file='single'
2241                 ;;
2242         xyes)
2243                 # default
2244                 target_thread_file=''
2245                 ;;
2246         xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
2247         xsolaris | xwin32 | xdce | xrtems| xvxworks | xaix | xgnat)
2248                 target_thread_file=$enable_threads_flag
2249                 ;;
2250         *)
2251                 echo "$enable_threads is an unknown thread package" 1>&2
2252                 exit 1
2253                 ;;
2254 esac
2255
2256 # Check whether --enable-objc-gc or --disable-objc-gc was given.
2257 if test "${enable_objc_gc+set}" = set; then
2258   enableval="$enable_objc_gc"
2259   if test x$enable_objc_gc = xno; then
2260         objc_boehm_gc=''
2261 else
2262         objc_boehm_gc=1
2263 fi
2264 else
2265   objc_boehm_gc=''
2266 fi
2267
2268
2269 # Check whether --with-dwarf2 or --without-dwarf2 was given.
2270 if test "${with_dwarf2+set}" = set; then
2271   withval="$with_dwarf2"
2272   dwarf2="$with_dwarf2"
2273 else
2274   dwarf2=no
2275 fi
2276
2277
2278 # Check whether --enable-shared or --disable-shared was given.
2279 if test "${enable_shared+set}" = set; then
2280   enableval="$enable_shared"
2281   
2282   case $enable_shared in
2283   yes | no) ;;
2284   *)
2285     enable_shared=no
2286     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2287     for pkg in $enableval; do
2288       if test "X$pkg" = "Xgcc" || test "X$pkg" = "Xlibgcc"; then
2289         enable_shared=yes
2290       fi
2291     done
2292     IFS="$ac_save_ifs"
2293     ;;
2294   esac
2295
2296 else
2297   enable_shared=yes
2298 fi
2299
2300
2301
2302 # Check whether --with-sysroot or --without-sysroot was given.
2303 if test "${with_sysroot+set}" = set; then
2304   withval="$with_sysroot"
2305   
2306  case ${with_sysroot} in
2307  yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;;
2308  *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
2309  esac
2310    
2311  TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
2312  CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR)'
2313
2314  if test "x$exec_prefix" = xNONE; then
2315   if test "x$prefix" = xNONE; then
2316    test_prefix=/usr/local
2317   else
2318    test_prefix=$prefix
2319   fi
2320  else
2321   test_prefix=$exec_prefix
2322  fi
2323  case ${TARGET_SYSTEM_ROOT} in
2324  "${test_prefix}"|"${test_prefix}/"*|\
2325  '${exec_prefix}'|'${exec_prefix}/'*)
2326    t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
2327    TARGET_SYSTEM_ROOT_DEFINE="$t"
2328    ;;
2329  esac
2330
2331 else
2332   
2333  TARGET_SYSTEM_ROOT=
2334  TARGET_SYSTEM_ROOT_DEFINE=
2335  CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include'
2336
2337 fi
2338
2339
2340
2341
2342
2343 # Build with intermodule optimisations
2344 # Check whether --enable-intermodule or --disable-intermodule was given.
2345 if test "${enable_intermodule+set}" = set; then
2346   enableval="$enable_intermodule"
2347   case ${enable_intermodule} in
2348   yes) onestep="-onestep";;
2349   *) onestep="";;
2350 esac
2351 else
2352   onestep=""
2353 fi
2354
2355
2356
2357 # -------------------------
2358 # Checks for other programs
2359 # -------------------------
2360
2361 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
2362 echo "configure:2363: checking whether ${MAKE-make} sets \${MAKE}" >&5
2363 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
2364 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
2365   echo $ac_n "(cached) $ac_c" 1>&6
2366 else
2367   cat > conftestmake <<\EOF
2368 all:
2369         @echo 'ac_maketemp="${MAKE}"'
2370 EOF
2371 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2372 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
2373 if test -n "$ac_maketemp"; then
2374   eval ac_cv_prog_make_${ac_make}_set=yes
2375 else
2376   eval ac_cv_prog_make_${ac_make}_set=no
2377 fi
2378 rm -f conftestmake
2379 fi
2380 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2381   echo "$ac_t""yes" 1>&6
2382   SET_MAKE=
2383 else
2384   echo "$ac_t""no" 1>&6
2385   SET_MAKE="MAKE=${MAKE-make}"
2386 fi
2387
2388
2389 # Find some useful tools
2390 for ac_prog in gawk mawk nawk awk
2391 do
2392 # Extract the first word of "$ac_prog", so it can be a program name with args.
2393 set dummy $ac_prog; ac_word=$2
2394 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2395 echo "configure:2396: checking for $ac_word" >&5
2396 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2397   echo $ac_n "(cached) $ac_c" 1>&6
2398 else
2399   if test -n "$AWK"; then
2400   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2401 else
2402   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2403   ac_dummy="$PATH"
2404   for ac_dir in $ac_dummy; do
2405     test -z "$ac_dir" && ac_dir=.
2406     if test -f $ac_dir/$ac_word; then
2407       ac_cv_prog_AWK="$ac_prog"
2408       break
2409     fi
2410   done
2411   IFS="$ac_save_ifs"
2412 fi
2413 fi
2414 AWK="$ac_cv_prog_AWK"
2415 if test -n "$AWK"; then
2416   echo "$ac_t""$AWK" 1>&6
2417 else
2418   echo "$ac_t""no" 1>&6
2419 fi
2420
2421 test -n "$AWK" && break
2422 done
2423
2424 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
2425 echo "configure:2426: checking whether ln works" >&5
2426 if eval "test \"`echo '$''{'gcc_cv_prog_LN'+set}'`\" = set"; then
2427   echo $ac_n "(cached) $ac_c" 1>&6
2428 else
2429   rm -f conftestdata_t
2430 echo >conftestdata_f
2431 if ln conftestdata_f conftestdata_t 2>/dev/null
2432 then
2433   gcc_cv_prog_LN="ln"
2434 else
2435   if ln -s conftestdata_f conftestdata_t 2>/dev/null
2436   then
2437     gcc_cv_prog_LN="ln -s"
2438   else
2439     gcc_cv_prog_LN=cp
2440   fi
2441 fi
2442 rm -f conftestdata_f conftestdata_t
2443
2444 fi
2445 LN="$gcc_cv_prog_LN"
2446 if test "$gcc_cv_prog_LN" = "ln"; then
2447   echo "$ac_t""yes" 1>&6
2448 else
2449   if test "$gcc_cv_prog_LN" = "ln -s"; then
2450     echo "$ac_t""no, using ln -s" 1>&6
2451   else
2452     echo "$ac_t""no, and neither does ln -s, so using cp" 1>&6
2453   fi
2454 fi
2455
2456 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2457 echo "configure:2458: checking whether ln -s works" >&5
2458 if eval "test \"`echo '$''{'gcc_cv_prog_LN_S'+set}'`\" = set"; then
2459   echo $ac_n "(cached) $ac_c" 1>&6
2460 else
2461   rm -f conftestdata_t
2462 echo >conftestdata_f
2463 if ln -s conftestdata_f conftestdata_t 2>/dev/null
2464 then
2465   gcc_cv_prog_LN_S="ln -s"
2466 else
2467   if ln conftestdata_f conftestdata_t 2>/dev/null
2468   then
2469     gcc_cv_prog_LN_S=ln
2470   else
2471     gcc_cv_prog_LN_S=cp
2472   fi
2473 fi
2474 rm -f conftestdata_f conftestdata_t
2475
2476 fi
2477 LN_S="$gcc_cv_prog_LN_S"
2478 if test "$gcc_cv_prog_LN_S" = "ln -s"; then
2479   echo "$ac_t""yes" 1>&6
2480 else
2481   if test "$gcc_cv_prog_LN_S" = "ln"; then
2482     echo "$ac_t""no, using ln" 1>&6
2483   else
2484     echo "$ac_t""no, and neither does ln, so using cp" 1>&6
2485   fi
2486 fi
2487
2488 # Extract the first word of "ranlib", so it can be a program name with args.
2489 set dummy ranlib; ac_word=$2
2490 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2491 echo "configure:2492: checking for $ac_word" >&5
2492 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
2493   echo $ac_n "(cached) $ac_c" 1>&6
2494 else
2495   if test -n "$RANLIB"; then
2496   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2497 else
2498   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2499   ac_dummy="$PATH"
2500   for ac_dir in $ac_dummy; do
2501     test -z "$ac_dir" && ac_dir=.
2502     if test -f $ac_dir/$ac_word; then
2503       ac_cv_prog_RANLIB="ranlib"
2504       break
2505     fi
2506   done
2507   IFS="$ac_save_ifs"
2508   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2509 fi
2510 fi
2511 RANLIB="$ac_cv_prog_RANLIB"
2512 if test -n "$RANLIB"; then
2513   echo "$ac_t""$RANLIB" 1>&6
2514 else
2515   echo "$ac_t""no" 1>&6
2516 fi
2517
2518 # Find a good install program.  We prefer a C program (faster),
2519 # so one script is as good as another.  But avoid the broken or
2520 # incompatible versions:
2521 # SysV /etc/install, /usr/sbin/install
2522 # SunOS /usr/etc/install
2523 # IRIX /sbin/install
2524 # AIX /bin/install
2525 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2526 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2527 # ./install, which can be erroneously created by make from ./install.sh.
2528 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2529 echo "configure:2530: checking for a BSD compatible install" >&5
2530 if test -z "$INSTALL"; then
2531 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
2532   echo $ac_n "(cached) $ac_c" 1>&6
2533 else
2534     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
2535   for ac_dir in $PATH; do
2536     # Account for people who put trailing slashes in PATH elements.
2537     case "$ac_dir/" in
2538     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2539     *)
2540       # OSF1 and SCO ODT 3.0 have their own names for install.
2541       for ac_prog in ginstall scoinst install; do
2542         if test -f $ac_dir/$ac_prog; then
2543           if test $ac_prog = install &&
2544             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2545             # AIX install.  It has an incompatible calling convention.
2546             # OSF/1 installbsd also uses dspmsg, but is usable.
2547             :
2548           else
2549             ac_cv_path_install="$ac_dir/$ac_prog -c"
2550             break 2
2551           fi
2552         fi
2553       done
2554       ;;
2555     esac
2556   done
2557   IFS="$ac_save_IFS"
2558
2559 fi
2560   if test "${ac_cv_path_install+set}" = set; then
2561     INSTALL="$ac_cv_path_install"
2562   else
2563     # As a last resort, use the slow shell script.  We don't cache a
2564     # path for INSTALL within a source directory, because that will
2565     # break other packages using the cache if that directory is
2566     # removed, or if the path is relative.
2567     INSTALL="$ac_install_sh"
2568   fi
2569 fi
2570 echo "$ac_t""$INSTALL" 1>&6
2571
2572 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2573 # It thinks the first close brace ends the variable substitution.
2574 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2575
2576 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2577
2578
2579 # See if cmp has --ignore-initial.
2580 echo $ac_n "checking for cmp's capabilities""... $ac_c" 1>&6
2581 echo "configure:2582: checking for cmp's capabilities" >&5
2582 if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then
2583   echo $ac_n "(cached) $ac_c" 1>&6
2584 else
2585    echo abfoo >t1
2586   echo cdfoo >t2
2587   if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
2588     if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
2589       gcc_cv_prog_cmp_skip=slowcompare
2590     else
2591       gcc_cv_prog_cmp_skip=gnucompare
2592     fi
2593   else
2594     gcc_cv_prog_cmp_skip=slowcompare
2595   fi
2596   rm t1 t2
2597
2598 fi
2599
2600 echo "$ac_t""$gcc_cv_prog_cmp_skip" 1>&6
2601 make_compare_target=$gcc_cv_prog_cmp_skip
2602
2603
2604
2605 # See if we have the mktemp command.
2606 # Extract the first word of "mktemp", so it can be a program name with args.
2607 set dummy mktemp; ac_word=$2
2608 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2609 echo "configure:2610: checking for $ac_word" >&5
2610 if eval "test \"`echo '$''{'ac_cv_prog_have_mktemp_command'+set}'`\" = set"; then
2611   echo $ac_n "(cached) $ac_c" 1>&6
2612 else
2613   if test -n "$have_mktemp_command"; then
2614   ac_cv_prog_have_mktemp_command="$have_mktemp_command" # Let the user override the test.
2615 else
2616   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2617   ac_dummy="$PATH"
2618   for ac_dir in $ac_dummy; do
2619     test -z "$ac_dir" && ac_dir=.
2620     if test -f $ac_dir/$ac_word; then
2621       ac_cv_prog_have_mktemp_command="yes"
2622       break
2623     fi
2624   done
2625   IFS="$ac_save_ifs"
2626   test -z "$ac_cv_prog_have_mktemp_command" && ac_cv_prog_have_mktemp_command="no"
2627 fi
2628 fi
2629 have_mktemp_command="$ac_cv_prog_have_mktemp_command"
2630 if test -n "$have_mktemp_command"; then
2631   echo "$ac_t""$have_mktemp_command" 1>&6
2632 else
2633   echo "$ac_t""no" 1>&6
2634 fi
2635
2636
2637 # Do we have a single-tree copy of texinfo?
2638 if test -f $srcdir/../texinfo/Makefile.in; then
2639   MAKEINFO='$(objdir)/../texinfo/makeinfo/makeinfo'
2640   gcc_cv_prog_makeinfo_modern=yes
2641   echo "$ac_t""Using makeinfo from the unified source tree." 1>&6
2642 else
2643   # See if makeinfo has been installed and is modern enough
2644   # that we can use it.
2645   # Extract the first word of "makeinfo", so it can be a program name with args.
2646 set dummy makeinfo; ac_word=$2
2647 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2648 echo "configure:2649: checking for $ac_word" >&5
2649 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then
2650   echo $ac_n "(cached) $ac_c" 1>&6
2651 else
2652   if test -n "$MAKEINFO"; then
2653   ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test.
2654 else
2655   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2656   ac_dummy="$PATH"
2657   for ac_dir in $ac_dummy; do
2658     test -z "$ac_dir" && ac_dir=.
2659     if test -f $ac_dir/$ac_word; then
2660       ac_cv_prog_MAKEINFO="makeinfo"
2661       break
2662     fi
2663   done
2664   IFS="$ac_save_ifs"
2665 fi
2666 fi
2667 MAKEINFO="$ac_cv_prog_MAKEINFO"
2668 if test -n "$MAKEINFO"; then
2669   echo "$ac_t""$MAKEINFO" 1>&6
2670 else
2671   echo "$ac_t""no" 1>&6
2672 fi
2673
2674 if test -n "$MAKEINFO"; then
2675   # Found it, now check the version.
2676   echo $ac_n "checking for modern makeinfo""... $ac_c" 1>&6
2677 echo "configure:2678: checking for modern makeinfo" >&5
2678 if eval "test \"`echo '$''{'gcc_cv_prog_makeinfo_modern'+set}'`\" = set"; then
2679   echo $ac_n "(cached) $ac_c" 1>&6
2680 else
2681     ac_prog_version=`$MAKEINFO --version 2>&1 |
2682                    sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
2683   echo "configure:2684: version of makeinfo is $ac_prog_version" >&5
2684   case $ac_prog_version in
2685     '')     gcc_cv_prog_makeinfo_modern=no;;
2686     4.[2-9]*)
2687             gcc_cv_prog_makeinfo_modern=yes;;
2688     *)      gcc_cv_prog_makeinfo_modern=no;;
2689   esac
2690
2691 fi
2692
2693 echo "$ac_t""$gcc_cv_prog_makeinfo_modern" 1>&6
2694 else
2695   gcc_cv_prog_makeinfo_modern=no
2696 fi
2697
2698 fi
2699
2700 if test $gcc_cv_prog_makeinfo_modern = no; then
2701   echo "configure: warning: 
2702 *** Makeinfo is missing or too old.
2703 *** Info documentation will not be built." 1>&2
2704   BUILD_INFO=
2705 else
2706   BUILD_INFO=info               
2707 fi
2708
2709 # Is pod2man recent enough to regenerate manpages?
2710 echo $ac_n "checking for recent Pod::Man""... $ac_c" 1>&6
2711 echo "configure:2712: checking for recent Pod::Man" >&5
2712 if (perl -e 'use 1.10 Pod::Man') >/dev/null 2>&1; then
2713   echo "$ac_t""yes" 1>&6
2714   GENERATED_MANPAGES=generated-manpages         
2715 else
2716   echo "$ac_t""no" 1>&6
2717   GENERATED_MANPAGES=
2718 fi
2719
2720 # How about lex?
2721 if test -f $srcdir/../flex/skel.c; then
2722   FLEX='$(objdir)/../flex/flex'
2723 else
2724   # Extract the first word of "flex", so it can be a program name with args.
2725 set dummy flex; ac_word=$2
2726 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2727 echo "configure:2728: checking for $ac_word" >&5
2728 if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then
2729   echo $ac_n "(cached) $ac_c" 1>&6
2730 else
2731   if test -n "$FLEX"; then
2732   ac_cv_prog_FLEX="$FLEX" # Let the user override the test.
2733 else
2734   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2735   ac_dummy="$PATH"
2736   for ac_dir in $ac_dummy; do
2737     test -z "$ac_dir" && ac_dir=.
2738     if test -f $ac_dir/$ac_word; then
2739       ac_cv_prog_FLEX="flex"
2740       break
2741     fi
2742   done
2743   IFS="$ac_save_ifs"
2744   test -z "$ac_cv_prog_FLEX" && ac_cv_prog_FLEX="${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing flex"
2745 fi
2746 fi
2747 FLEX="$ac_cv_prog_FLEX"
2748 if test -n "$FLEX"; then
2749   echo "$ac_t""$FLEX" 1>&6
2750 else
2751   echo "$ac_t""no" 1>&6
2752 fi
2753
2754 fi
2755
2756 # Bison?
2757 # The -L switch is so bison can find its skeleton file.
2758 if test -f $srcdir/../bison/bison.simple; then
2759   BISON='$(objdir)/../bison/bison -L $(srcdir)/../bison/'
2760 else
2761   # Extract the first word of "bison", so it can be a program name with args.
2762 set dummy bison; ac_word=$2
2763 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2764 echo "configure:2765: checking for $ac_word" >&5
2765 if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then
2766   echo $ac_n "(cached) $ac_c" 1>&6
2767 else
2768   if test -n "$BISON"; then
2769   ac_cv_prog_BISON="$BISON" # Let the user override the test.
2770 else
2771   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2772   ac_dummy="$PATH"
2773   for ac_dir in $ac_dummy; do
2774     test -z "$ac_dir" && ac_dir=.
2775     if test -f $ac_dir/$ac_word; then
2776       ac_cv_prog_BISON="bison"
2777       break
2778     fi
2779   done
2780   IFS="$ac_save_ifs"
2781   test -z "$ac_cv_prog_BISON" && ac_cv_prog_BISON="${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing bison"
2782 fi
2783 fi
2784 BISON="$ac_cv_prog_BISON"
2785 if test -n "$BISON"; then
2786   echo "$ac_t""$BISON" 1>&6
2787 else
2788   echo "$ac_t""no" 1>&6
2789 fi
2790
2791 fi
2792
2793 # --------------------
2794 # Checks for C headers
2795 # --------------------
2796
2797 echo $ac_n "checking for GNU C library""... $ac_c" 1>&6
2798 echo "configure:2799: checking for GNU C library" >&5
2799 if eval "test \"`echo '$''{'gcc_cv_glibc'+set}'`\" = set"; then
2800   echo $ac_n "(cached) $ac_c" 1>&6
2801 else
2802   cat > conftest.$ac_ext <<EOF
2803 #line 2804 "configure"
2804 #include "confdefs.h"
2805 #include <features.h>
2806 int main() {
2807
2808 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2809 #error Not a GNU C library system
2810 #endif
2811 ; return 0; }
2812 EOF
2813 if { (eval echo configure:2814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2814   rm -rf conftest*
2815   gcc_cv_glibc=yes
2816 else
2817   echo "configure: failed program was:" >&5
2818   cat conftest.$ac_ext >&5
2819   rm -rf conftest*
2820   gcc_cv_glibc=no
2821 fi
2822 rm -f conftest*
2823 fi
2824
2825 echo "$ac_t""$gcc_cv_glibc" 1>&6
2826 if test $gcc_cv_glibc = yes; then
2827   cat >> confdefs.h <<\EOF
2828 #define _GNU_SOURCE 1
2829 EOF
2830
2831 fi
2832
2833 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
2834 echo "configure:2835: checking for ANSI C header files" >&5
2835 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
2836   echo $ac_n "(cached) $ac_c" 1>&6
2837 else
2838   cat > conftest.$ac_ext <<EOF
2839 #line 2840 "configure"
2840 #include "confdefs.h"
2841 #include <stdlib.h>
2842 #include <stdarg.h>
2843 #include <string.h>
2844 #include <float.h>
2845 EOF
2846 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2847 { (eval echo configure:2848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2848 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2849 if test -z "$ac_err"; then
2850   rm -rf conftest*
2851   ac_cv_header_stdc=yes
2852 else
2853   echo "$ac_err" >&5
2854   echo "configure: failed program was:" >&5
2855   cat conftest.$ac_ext >&5
2856   rm -rf conftest*
2857   ac_cv_header_stdc=no
2858 fi
2859 rm -f conftest*
2860
2861 if test $ac_cv_header_stdc = yes; then
2862   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
2863 cat > conftest.$ac_ext <<EOF
2864 #line 2865 "configure"
2865 #include "confdefs.h"
2866 #include <string.h>
2867 EOF
2868 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2869   egrep "memchr" >/dev/null 2>&1; then
2870   :
2871 else
2872   rm -rf conftest*
2873   ac_cv_header_stdc=no
2874 fi
2875 rm -f conftest*
2876
2877 fi
2878
2879 if test $ac_cv_header_stdc = yes; then
2880   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
2881 cat > conftest.$ac_ext <<EOF
2882 #line 2883 "configure"
2883 #include "confdefs.h"
2884 #include <stdlib.h>
2885 EOF
2886 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2887   egrep "free" >/dev/null 2>&1; then
2888   :
2889 else
2890   rm -rf conftest*
2891   ac_cv_header_stdc=no
2892 fi
2893 rm -f conftest*
2894
2895 fi
2896
2897 if test $ac_cv_header_stdc = yes; then
2898   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
2899 if test "$cross_compiling" = yes; then
2900   :
2901 else
2902   cat > conftest.$ac_ext <<EOF
2903 #line 2904 "configure"
2904 #include "confdefs.h"
2905 #include <ctype.h>
2906 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
2907 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
2908 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
2909 int main () { int i; for (i = 0; i < 256; i++)
2910 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
2911 exit (0); }
2912
2913 EOF
2914 if { (eval echo configure:2915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2915 then
2916   :
2917 else
2918   echo "configure: failed program was:" >&5
2919   cat conftest.$ac_ext >&5
2920   rm -fr conftest*
2921   ac_cv_header_stdc=no
2922 fi
2923 rm -fr conftest*
2924 fi
2925
2926 fi
2927 fi
2928
2929 echo "$ac_t""$ac_cv_header_stdc" 1>&6
2930 if test $ac_cv_header_stdc = yes; then
2931   cat >> confdefs.h <<\EOF
2932 #define STDC_HEADERS 1
2933 EOF
2934
2935 fi
2936
2937 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
2938 echo "configure:2939: checking whether time.h and sys/time.h may both be included" >&5
2939 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
2940   echo $ac_n "(cached) $ac_c" 1>&6
2941 else
2942   cat > conftest.$ac_ext <<EOF
2943 #line 2944 "configure"
2944 #include "confdefs.h"
2945 #include <sys/types.h>
2946 #include <sys/time.h>
2947 #include <time.h>
2948 int main() {
2949 struct tm *tp;
2950 ; return 0; }
2951 EOF
2952 if { (eval echo configure:2953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2953   rm -rf conftest*
2954   ac_cv_header_time=yes
2955 else
2956   echo "configure: failed program was:" >&5
2957   cat conftest.$ac_ext >&5
2958   rm -rf conftest*
2959   ac_cv_header_time=no
2960 fi
2961 rm -f conftest*
2962 fi
2963
2964 echo "$ac_t""$ac_cv_header_time" 1>&6
2965 if test $ac_cv_header_time = yes; then
2966   cat >> confdefs.h <<\EOF
2967 #define TIME_WITH_SYS_TIME 1
2968 EOF
2969
2970 fi
2971
2972 echo $ac_n "checking for working stdbool.h""... $ac_c" 1>&6
2973 echo "configure:2974: checking for working stdbool.h" >&5
2974 if eval "test \"`echo '$''{'ac_cv_header_stdbool_h'+set}'`\" = set"; then
2975   echo $ac_n "(cached) $ac_c" 1>&6
2976 else
2977   cat > conftest.$ac_ext <<EOF
2978 #line 2979 "configure"
2979 #include "confdefs.h"
2980 #include <stdbool.h>
2981 int main() {
2982 bool foo = false;
2983 ; return 0; }
2984 EOF
2985 if { (eval echo configure:2986: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2986   rm -rf conftest*
2987   ac_cv_header_stdbool_h=yes
2988 else
2989   echo "configure: failed program was:" >&5
2990   cat conftest.$ac_ext >&5
2991   rm -rf conftest*
2992   ac_cv_header_stdbool_h=no
2993 fi
2994 rm -f conftest*
2995 fi
2996
2997 echo "$ac_t""$ac_cv_header_stdbool_h" 1>&6
2998 if test $ac_cv_header_stdbool_h = yes; then
2999   cat >> confdefs.h <<\EOF
3000 #define HAVE_STDBOOL_H 1
3001 EOF
3002
3003 fi
3004
3005 echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
3006 echo "configure:3007: checking whether string.h and strings.h may both be included" >&5
3007 if eval "test \"`echo '$''{'gcc_cv_header_string'+set}'`\" = set"; then
3008   echo $ac_n "(cached) $ac_c" 1>&6
3009 else
3010   cat > conftest.$ac_ext <<EOF
3011 #line 3012 "configure"
3012 #include "confdefs.h"
3013 #include <string.h>
3014 #include <strings.h>
3015 int main() {
3016
3017 ; return 0; }
3018 EOF
3019 if { (eval echo configure:3020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3020   rm -rf conftest*
3021   gcc_cv_header_string=yes
3022 else
3023   echo "configure: failed program was:" >&5
3024   cat conftest.$ac_ext >&5
3025   rm -rf conftest*
3026   gcc_cv_header_string=no
3027 fi
3028 rm -f conftest*
3029 fi
3030
3031 echo "$ac_t""$gcc_cv_header_string" 1>&6
3032 if test $gcc_cv_header_string = yes; then
3033   cat >> confdefs.h <<\EOF
3034 #define STRING_WITH_STRINGS 1
3035 EOF
3036
3037 fi
3038
3039 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3040 echo "configure:3041: checking for sys/wait.h that is POSIX.1 compatible" >&5
3041 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
3042   echo $ac_n "(cached) $ac_c" 1>&6
3043 else
3044   cat > conftest.$ac_ext <<EOF
3045 #line 3046 "configure"
3046 #include "confdefs.h"
3047 #include <sys/types.h>
3048 #include <sys/wait.h>
3049 #ifndef WEXITSTATUS
3050 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3051 #endif
3052 #ifndef WIFEXITED
3053 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3054 #endif
3055 int main() {
3056 int s;
3057 wait (&s);
3058 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3059 ; return 0; }
3060 EOF
3061 if { (eval echo configure:3062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3062   rm -rf conftest*
3063   ac_cv_header_sys_wait_h=yes
3064 else
3065   echo "configure: failed program was:" >&5
3066   cat conftest.$ac_ext >&5
3067   rm -rf conftest*
3068   ac_cv_header_sys_wait_h=no
3069 fi
3070 rm -f conftest*
3071 fi
3072
3073 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3074 if test $ac_cv_header_sys_wait_h = yes; then
3075   cat >> confdefs.h <<\EOF
3076 #define HAVE_SYS_WAIT_H 1
3077 EOF
3078
3079 fi
3080
3081 for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h \
3082                  fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
3083                  sys/resource.h sys/param.h sys/times.h sys/stat.h \
3084                  direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h
3085 do
3086 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3087 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3088 echo "configure:3089: checking for $ac_hdr" >&5
3089 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3090   echo $ac_n "(cached) $ac_c" 1>&6
3091 else
3092   cat > conftest.$ac_ext <<EOF
3093 #line 3094 "configure"
3094 #include "confdefs.h"
3095 #include <$ac_hdr>
3096 EOF
3097 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3098 { (eval echo configure:3099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3099 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3100 if test -z "$ac_err"; then
3101   rm -rf conftest*
3102   eval "ac_cv_header_$ac_safe=yes"
3103 else
3104   echo "$ac_err" >&5
3105   echo "configure: failed program was:" >&5
3106   cat conftest.$ac_ext >&5
3107   rm -rf conftest*
3108   eval "ac_cv_header_$ac_safe=no"
3109 fi
3110 rm -f conftest*
3111 fi
3112 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3113   echo "$ac_t""yes" 1>&6
3114     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3115   cat >> confdefs.h <<EOF
3116 #define $ac_tr_hdr 1
3117 EOF
3118  
3119 else
3120   echo "$ac_t""no" 1>&6
3121 fi
3122 done
3123
3124
3125 # Check for thread headers.
3126 ac_safe=`echo "thread.h" | sed 'y%./+-%__p_%'`
3127 echo $ac_n "checking for thread.h""... $ac_c" 1>&6
3128 echo "configure:3129: checking for thread.h" >&5
3129 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3130   echo $ac_n "(cached) $ac_c" 1>&6
3131 else
3132   cat > conftest.$ac_ext <<EOF
3133 #line 3134 "configure"
3134 #include "confdefs.h"
3135 #include <thread.h>
3136 EOF
3137 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3138 { (eval echo configure:3139: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3139 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3140 if test -z "$ac_err"; then
3141   rm -rf conftest*
3142   eval "ac_cv_header_$ac_safe=yes"
3143 else
3144   echo "$ac_err" >&5
3145   echo "configure: failed program was:" >&5
3146   cat conftest.$ac_ext >&5
3147   rm -rf conftest*
3148   eval "ac_cv_header_$ac_safe=no"
3149 fi
3150 rm -f conftest*
3151 fi
3152 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3153   echo "$ac_t""yes" 1>&6
3154   have_thread_h=yes
3155 else
3156   echo "$ac_t""no" 1>&6
3157 have_thread_h=
3158 fi
3159
3160 ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'`
3161 echo $ac_n "checking for pthread.h""... $ac_c" 1>&6
3162 echo "configure:3163: checking for pthread.h" >&5
3163 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3164   echo $ac_n "(cached) $ac_c" 1>&6
3165 else
3166   cat > conftest.$ac_ext <<EOF
3167 #line 3168 "configure"
3168 #include "confdefs.h"
3169 #include <pthread.h>
3170 EOF
3171 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3172 { (eval echo configure:3173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3173 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3174 if test -z "$ac_err"; then
3175   rm -rf conftest*
3176   eval "ac_cv_header_$ac_safe=yes"
3177 else
3178   echo "$ac_err" >&5
3179   echo "configure: failed program was:" >&5
3180   cat conftest.$ac_ext >&5
3181   rm -rf conftest*
3182   eval "ac_cv_header_$ac_safe=no"
3183 fi
3184 rm -f conftest*
3185 fi
3186 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3187   echo "$ac_t""yes" 1>&6
3188   have_pthread_h=yes
3189 else
3190   echo "$ac_t""no" 1>&6
3191 have_pthread_h=
3192 fi
3193
3194
3195 # These tests can't be done till we know if we have limits.h.
3196 echo $ac_n "checking for CHAR_BIT""... $ac_c" 1>&6
3197 echo "configure:3198: checking for CHAR_BIT" >&5
3198 if eval "test \"`echo '$''{'gcc_cv_decl_char_bit'+set}'`\" = set"; then
3199   echo $ac_n "(cached) $ac_c" 1>&6
3200 else
3201   cat > conftest.$ac_ext <<EOF
3202 #line 3203 "configure"
3203 #include "confdefs.h"
3204 #ifdef HAVE_LIMITS_H
3205 #include <limits.h>
3206 #endif
3207 #ifdef CHAR_BIT
3208 found
3209 #endif
3210 EOF
3211 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3212   egrep "found" >/dev/null 2>&1; then
3213   rm -rf conftest*
3214   gcc_cv_decl_char_bit=yes
3215 else
3216   rm -rf conftest*
3217   gcc_cv_decl_char_bit=no
3218 fi
3219 rm -f conftest*
3220
3221
3222 fi
3223
3224 echo "$ac_t""$gcc_cv_decl_char_bit" 1>&6
3225 if test $gcc_cv_decl_char_bit = no; then
3226   echo $ac_n "checking number of bits in a byte""... $ac_c" 1>&6
3227 echo "configure:3228: checking number of bits in a byte" >&5
3228 if eval "test \"`echo '$''{'gcc_cv_c_nbby'+set}'`\" = set"; then
3229   echo $ac_n "(cached) $ac_c" 1>&6
3230 else
3231   i=8
3232  gcc_cv_c_nbby=
3233  while test $i -lt 65; do
3234    cat > conftest.$ac_ext <<EOF
3235 #line 3236 "configure"
3236 #include "confdefs.h"
3237
3238 int main() {
3239 switch(0) {
3240   case (unsigned char)((unsigned long)1 << $i) == ((unsigned long)1 << $i):
3241   case (unsigned char)((unsigned long)1<<($i-1)) == ((unsigned long)1<<($i-1)):
3242   ; }
3243 ; return 0; }
3244 EOF
3245 if { (eval echo configure:3246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3246   rm -rf conftest*
3247   gcc_cv_c_nbby=$i; break
3248 else
3249   echo "configure: failed program was:" >&5
3250   cat conftest.$ac_ext >&5
3251 fi
3252 rm -f conftest*
3253    i=`expr $i + 1`
3254  done
3255  test -z "$gcc_cv_c_nbby" && gcc_cv_c_nbby=failed
3256
3257 fi
3258
3259 echo "$ac_t""$gcc_cv_c_nbby" 1>&6
3260 if test $gcc_cv_c_nbby = failed; then
3261   { echo "configure: error: cannot determine number of bits in a byte" 1>&2; exit 1; }
3262 else
3263   cat >> confdefs.h <<EOF
3264 #define CHAR_BIT $gcc_cv_c_nbby
3265 EOF
3266
3267 fi
3268 fi
3269 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
3270 echo "configure:3271: checking whether byte ordering is bigendian" >&5
3271 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
3272   echo $ac_n "(cached) $ac_c" 1>&6
3273 else
3274   ac_cv_c_bigendian=unknown
3275 # See if sys/param.h defines the BYTE_ORDER macro.
3276 cat > conftest.$ac_ext <<EOF
3277 #line 3278 "configure"
3278 #include "confdefs.h"
3279 #include <sys/types.h>
3280 #include <sys/param.h>
3281 int main() {
3282
3283 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
3284  bogus endian macros
3285 #endif
3286 ; return 0; }
3287 EOF
3288 if { (eval echo configure:3289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3289   rm -rf conftest*
3290   # It does; now see whether it defined to BIG_ENDIAN or not.
3291 cat > conftest.$ac_ext <<EOF
3292 #line 3293 "configure"
3293 #include "confdefs.h"
3294 #include <sys/types.h>
3295 #include <sys/param.h>
3296 int main() {
3297
3298 #if BYTE_ORDER != BIG_ENDIAN
3299  not big endian
3300 #endif
3301 ; return 0; }
3302 EOF
3303 if { (eval echo configure:3304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3304   rm -rf conftest*
3305   ac_cv_c_bigendian=yes
3306 else
3307   echo "configure: failed program was:" >&5
3308   cat conftest.$ac_ext >&5
3309   rm -rf conftest*
3310   ac_cv_c_bigendian=no
3311 fi
3312 rm -f conftest*
3313 else
3314   echo "configure: failed program was:" >&5
3315   cat conftest.$ac_ext >&5
3316 fi
3317 rm -f conftest*
3318 if test $ac_cv_c_bigendian = unknown; then
3319 if test "$cross_compiling" = yes; then
3320    echo $ac_n "cross-compiling... " 2>&6 
3321 else
3322   cat > conftest.$ac_ext <<EOF
3323 #line 3324 "configure"
3324 #include "confdefs.h"
3325 main () {
3326   /* Are we little or big endian?  From Harbison&Steele.  */
3327   union
3328   {
3329     long l;
3330     char c[sizeof (long)];
3331   } u;
3332   u.l = 1;
3333   exit (u.c[sizeof (long) - 1] == 1);
3334 }
3335 EOF
3336 if { (eval echo configure:3337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3337 then
3338   ac_cv_c_bigendian=no
3339 else
3340   echo "configure: failed program was:" >&5
3341   cat conftest.$ac_ext >&5
3342   rm -fr conftest*
3343   ac_cv_c_bigendian=yes
3344 fi
3345 rm -fr conftest*
3346 fi
3347
3348 fi
3349 fi
3350
3351 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
3352 if test $ac_cv_c_bigendian = unknown; then
3353 echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
3354 echo "configure:3355: checking to probe for byte ordering" >&5
3355
3356 cat >conftest.c <<EOF
3357 short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
3358 short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
3359 void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; }
3360 short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
3361 short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
3362 void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; }
3363 int main() { _ascii (); _ebcdic (); return 0; }
3364 EOF
3365  if test -f conftest.c ; then
3366      if ${CC-cc} ${CFLAGS} conftest.c -o conftest.o && test -f conftest.o ; then
3367         if test `grep -l BIGenDianSyS conftest.o` ; then
3368            echo $ac_n ' big endian probe OK, ' 1>&6
3369            ac_cv_c_bigendian=yes
3370         fi
3371         if test `grep -l LiTTleEnDian conftest.o` ; then
3372            echo $ac_n ' little endian probe OK, ' 1>&6
3373            if test $ac_cv_c_bigendian = yes ; then
3374             ac_cv_c_bigendian=unknown;
3375            else
3376             ac_cv_c_bigendian=no
3377            fi
3378         fi
3379         echo $ac_n 'guessing bigendian ...  ' >&6
3380      fi
3381   fi
3382 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
3383 fi
3384 if test $ac_cv_c_bigendian = yes; then
3385   cat >> confdefs.h <<\EOF
3386 #define WORDS_BIGENDIAN 1
3387 EOF
3388
3389   cat >> confdefs.h <<\EOF
3390 #define HOST_WORDS_BIG_ENDIAN 1
3391 EOF
3392
3393   BYTEORDER=4321
3394 else
3395   BYTEORDER=1234
3396 fi
3397 cat >> confdefs.h <<EOF
3398 #define BYTEORDER $BYTEORDER
3399 EOF
3400
3401 if test $ac_cv_c_bigendian = unknown; then
3402   { echo "configure: error: unknown endianess - sorry" 1>&2; exit 1; }
3403 fi
3404
3405
3406 # --------
3407 # UNSORTED
3408 # --------
3409
3410 # Stage specific cflags for build.
3411 stage1_cflags=
3412 case $build in
3413 vax-*-*)
3414   if test x$GCC = xyes
3415   then
3416     stage1_cflags="-Wa,-J"
3417   else
3418     stage1_cflags="-J"
3419   fi
3420   ;;
3421 powerpc-*-darwin*)
3422   # The spiffy cpp-precomp chokes on some legitimate constructs in GCC
3423   # sources; use -no-cpp-precomp to get to GNU cpp.
3424   # Apple's GCC has bugs in designated initializer handling, so disable
3425   # that too.
3426   stage1_cflags="-no-cpp-precomp -DHAVE_DESIGNATED_INITIALIZERS=0"
3427   ;;
3428 esac
3429
3430
3431 # These libraries may be used by collect2.
3432 # We may need a special search path to get them linked.
3433 echo $ac_n "checking for collect2 libraries""... $ac_c" 1>&6
3434 echo "configure:3435: checking for collect2 libraries" >&5
3435 if eval "test \"`echo '$''{'gcc_cv_collect2_libs'+set}'`\" = set"; then
3436   echo $ac_n "(cached) $ac_c" 1>&6
3437 else
3438   save_LIBS="$LIBS"
3439 for libs in '' -lld -lmld \
3440                 '-L/usr/lib/cmplrs/cc2.11 -lmld' \
3441                 '-L/usr/lib/cmplrs/cc3.11 -lmld'
3442 do
3443         LIBS="$libs"
3444         cat > conftest.$ac_ext <<EOF
3445 #line 3446 "configure"
3446 #include "confdefs.h"
3447 /* Override any gcc2 internal prototype to avoid an error.  */
3448 /* We use char because int might match the return type of a gcc2
3449     builtin and then its argument prototype would still apply.  */
3450 char ldopen();
3451
3452 int main() {
3453 ldopen()
3454 ; return 0; }
3455 EOF
3456 if { (eval echo configure:3457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3457   rm -rf conftest*
3458   gcc_cv_collect2_libs="$libs"; break
3459 else
3460   echo "configure: failed program was:" >&5
3461   cat conftest.$ac_ext >&5
3462 fi
3463 rm -f conftest*
3464 done
3465 LIBS="$save_LIBS"
3466 test -z "$gcc_cv_collect2_libs" && gcc_cv_collect2_libs='none required'
3467 fi
3468
3469 echo "$ac_t""$gcc_cv_collect2_libs" 1>&6
3470 case $gcc_cv_collect2_libs in
3471         "none required")        ;;
3472         *)      COLLECT2_LIBS=$gcc_cv_collect2_libs ;;
3473 esac
3474
3475
3476 # When building Ada code on Alpha, we need exc_resume which is usually in
3477 # -lexc.  So test for it.
3478 save_LIBS="$LIBS"
3479 LIBS=
3480
3481 echo $ac_n "checking for library containing exc_resume""... $ac_c" 1>&6
3482 echo "configure:3483: checking for library containing exc_resume" >&5
3483 if eval "test \"`echo '$''{'ac_cv_search_exc_resume'+set}'`\" = set"; then
3484   echo $ac_n "(cached) $ac_c" 1>&6
3485 else
3486   ac_func_search_save_LIBS="$LIBS"
3487 ac_cv_search_exc_resume="no"
3488 cat > conftest.$ac_ext <<EOF
3489 #line 3490 "configure"
3490 #include "confdefs.h"
3491 /* Override any gcc2 internal prototype to avoid an error.  */
3492 /* We use char because int might match the return type of a gcc2
3493     builtin and then its argument prototype would still apply.  */
3494 char exc_resume();
3495
3496 int main() {
3497 exc_resume()
3498 ; return 0; }
3499 EOF
3500 if { (eval echo configure:3501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3501   rm -rf conftest*
3502   ac_cv_search_exc_resume="none required"
3503 else
3504   echo "configure: failed program was:" >&5
3505   cat conftest.$ac_ext >&5
3506 fi
3507 rm -f conftest*
3508 test "$ac_cv_search_exc_resume" = "no" && for i in exc; do
3509 LIBS="-l$i  $ac_func_search_save_LIBS"
3510 cat > conftest.$ac_ext <<EOF
3511 #line 3512 "configure"
3512 #include "confdefs.h"
3513 /* Override any gcc2 internal prototype to avoid an error.  */
3514 /* We use char because int might match the return type of a gcc2
3515     builtin and then its argument prototype would still apply.  */
3516 char exc_resume();
3517
3518 int main() {
3519 exc_resume()
3520 ; return 0; }
3521 EOF
3522 if { (eval echo configure:3523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3523   rm -rf conftest*
3524   ac_cv_search_exc_resume="-l$i"
3525 break
3526 else
3527   echo "configure: failed program was:" >&5
3528   cat conftest.$ac_ext >&5
3529 fi
3530 rm -f conftest*
3531 done
3532 LIBS="$ac_func_search_save_LIBS"
3533 fi
3534
3535 echo "$ac_t""$ac_cv_search_exc_resume" 1>&6
3536 if test "$ac_cv_search_exc_resume" != "no"; then
3537   test "$ac_cv_search_exc_resume" = "none required" || LIBS="$ac_cv_search_exc_resume $LIBS"
3538   
3539 else :
3540   
3541 fi
3542 GNAT_LIBEXC="$LIBS"
3543 LIBS="$save_LIBS"
3544
3545
3546 # Some systems put ldexp and frexp in libm instead of libc; assume
3547 # they're both in the same place.  jcf-dump needs them.
3548 save_LIBS="$LIBS"
3549 LIBS=
3550
3551 echo $ac_n "checking for library containing ldexp""... $ac_c" 1>&6
3552 echo "configure:3553: checking for library containing ldexp" >&5
3553 if eval "test \"`echo '$''{'ac_cv_search_ldexp'+set}'`\" = set"; then
3554   echo $ac_n "(cached) $ac_c" 1>&6
3555 else
3556   ac_func_search_save_LIBS="$LIBS"
3557 ac_cv_search_ldexp="no"
3558 cat > conftest.$ac_ext <<EOF
3559 #line 3560 "configure"
3560 #include "confdefs.h"
3561 /* Override any gcc2 internal prototype to avoid an error.  */
3562 /* We use char because int might match the return type of a gcc2
3563     builtin and then its argument prototype would still apply.  */
3564 char ldexp();
3565
3566 int main() {
3567 ldexp()
3568 ; return 0; }
3569 EOF
3570 if { (eval echo configure:3571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3571   rm -rf conftest*
3572   ac_cv_search_ldexp="none required"
3573 else
3574   echo "configure: failed program was:" >&5
3575   cat conftest.$ac_ext >&5
3576 fi
3577 rm -f conftest*
3578 test "$ac_cv_search_ldexp" = "no" && for i in m; do
3579 LIBS="-l$i  $ac_func_search_save_LIBS"
3580 cat > conftest.$ac_ext <<EOF
3581 #line 3582 "configure"
3582 #include "confdefs.h"
3583 /* Override any gcc2 internal prototype to avoid an error.  */
3584 /* We use char because int might match the return type of a gcc2
3585     builtin and then its argument prototype would still apply.  */
3586 char ldexp();
3587
3588 int main() {
3589 ldexp()
3590 ; return 0; }
3591 EOF
3592 if { (eval echo configure:3593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3593   rm -rf conftest*
3594   ac_cv_search_ldexp="-l$i"
3595 break
3596 else
3597   echo "configure: failed program was:" >&5
3598   cat conftest.$ac_ext >&5
3599 fi
3600 rm -f conftest*
3601 done
3602 LIBS="$ac_func_search_save_LIBS"
3603 fi
3604
3605 echo "$ac_t""$ac_cv_search_ldexp" 1>&6
3606 if test "$ac_cv_search_ldexp" != "no"; then
3607   test "$ac_cv_search_ldexp" = "none required" || LIBS="$ac_cv_search_ldexp $LIBS"
3608   
3609 else :
3610   
3611 fi
3612 LDEXP_LIB="$LIBS"
3613 LIBS="$save_LIBS"
3614
3615
3616 # Use <inttypes.h> only if it exists,
3617 # doesn't clash with <sys/types.h>, and declares intmax_t.
3618 echo $ac_n "checking for inttypes.h""... $ac_c" 1>&6
3619 echo "configure:3620: checking for inttypes.h" >&5
3620 if eval "test \"`echo '$''{'gcc_cv_header_inttypes_h'+set}'`\" = set"; then
3621   echo $ac_n "(cached) $ac_c" 1>&6
3622 else
3623   cat > conftest.$ac_ext <<EOF
3624 #line 3625 "configure"
3625 #include "confdefs.h"
3626 #include <sys/types.h>
3627 #include <inttypes.h>
3628 int main() {
3629 intmax_t i = -1;
3630 ; return 0; }
3631 EOF
3632 if { (eval echo configure:3633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3633   rm -rf conftest*
3634   gcc_cv_header_inttypes_h=yes
3635 else
3636   echo "configure: failed program was:" >&5
3637   cat conftest.$ac_ext >&5
3638   rm -rf conftest*
3639   gcc_cv_header_inttypes_h=no
3640 fi
3641 rm -f conftest*
3642 fi
3643
3644 echo "$ac_t""$gcc_cv_header_inttypes_h" 1>&6
3645 if test $gcc_cv_header_inttypes_h = yes; then
3646   cat >> confdefs.h <<\EOF
3647 #define HAVE_INTTYPES_H 1
3648 EOF
3649
3650 fi
3651
3652
3653 for ac_func in times clock dup2 kill getrlimit setrlimit atoll atoq \
3654         sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \
3655         fwrite_unlocked fprintf_unlocked getrusage nl_langinfo \
3656         scandir alphasort gettimeofday mbstowcs wcswidth mmap mincore \
3657         setlocale
3658 do
3659 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3660 echo "configure:3661: checking for $ac_func" >&5
3661 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3662   echo $ac_n "(cached) $ac_c" 1>&6
3663 else
3664   cat > conftest.$ac_ext <<EOF
3665 #line 3666 "configure"
3666 #include "confdefs.h"
3667 /* System header to define __stub macros and hopefully few prototypes,
3668     which can conflict with char $ac_func(); below.  */
3669 #include <assert.h>
3670 /* Override any gcc2 internal prototype to avoid an error.  */
3671 /* We use char because int might match the return type of a gcc2
3672     builtin and then its argument prototype would still apply.  */
3673 char $ac_func();
3674
3675 int main() {
3676
3677 /* The GNU C library defines this for functions which it implements
3678     to always fail with ENOSYS.  Some functions are actually named
3679     something starting with __ and the normal name is an alias.  */
3680 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3681 choke me
3682 #else
3683 $ac_func();
3684 #endif
3685
3686 ; return 0; }
3687 EOF
3688 if { (eval echo configure:3689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3689   rm -rf conftest*
3690   eval "ac_cv_func_$ac_func=yes"
3691 else
3692   echo "configure: failed program was:" >&5
3693   cat conftest.$ac_ext >&5
3694   rm -rf conftest*
3695   eval "ac_cv_func_$ac_func=no"
3696 fi
3697 rm -f conftest*
3698 fi
3699
3700 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3701   echo "$ac_t""yes" 1>&6
3702     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3703   cat >> confdefs.h <<EOF
3704 #define $ac_tr_func 1
3705 EOF
3706  
3707 else
3708   echo "$ac_t""no" 1>&6
3709 fi
3710 done
3711
3712
3713 if test x$ac_cv_func_mbstowcs = xyes; then
3714   echo $ac_n "checking whether mbstowcs works""... $ac_c" 1>&6
3715 echo "configure:3716: checking whether mbstowcs works" >&5
3716 if eval "test \"`echo '$''{'gcc_cv_func_mbstowcs_works'+set}'`\" = set"; then
3717   echo $ac_n "(cached) $ac_c" 1>&6
3718 else
3719       if test "$cross_compiling" = yes; then
3720   gcc_cv_func_mbstowcs_works=yes
3721 else
3722   cat > conftest.$ac_ext <<EOF
3723 #line 3724 "configure"
3724 #include "confdefs.h"
3725 #include <stdlib.h>
3726 int main()
3727 {
3728   mbstowcs(0, "", 0);
3729   return 0;
3730 }
3731 EOF
3732 if { (eval echo configure:3733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3733 then
3734   gcc_cv_func_mbstowcs_works=yes
3735 else
3736   echo "configure: failed program was:" >&5
3737   cat conftest.$ac_ext >&5
3738   rm -fr conftest*
3739   gcc_cv_func_mbstowcs_works=no
3740 fi
3741 rm -fr conftest*
3742 fi
3743
3744 fi
3745
3746 echo "$ac_t""$gcc_cv_func_mbstowcs_works" 1>&6
3747   if test x$gcc_cv_func_mbstowcs_works = xyes; then
3748     cat >> confdefs.h <<\EOF
3749 #define HAVE_WORKING_MBSTOWCS 1
3750 EOF
3751
3752   fi
3753 fi
3754
3755 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
3756 echo "configure:3757: checking for ssize_t" >&5
3757 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
3758   echo $ac_n "(cached) $ac_c" 1>&6
3759 else
3760   cat > conftest.$ac_ext <<EOF
3761 #line 3762 "configure"
3762 #include "confdefs.h"
3763 #include <sys/types.h>
3764 #if STDC_HEADERS
3765 #include <stdlib.h>
3766 #include <stddef.h>
3767 #endif
3768 EOF
3769 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3770   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3771   rm -rf conftest*
3772   ac_cv_type_ssize_t=yes
3773 else
3774   rm -rf conftest*
3775   ac_cv_type_ssize_t=no
3776 fi
3777 rm -f conftest*
3778
3779 fi
3780 echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
3781 if test $ac_cv_type_ssize_t = no; then
3782   cat >> confdefs.h <<\EOF
3783 #define ssize_t int
3784 EOF
3785
3786 fi
3787
3788
3789 # Try to determine the array type of the second argument of getgroups
3790 # for the target system (int or gid_t).
3791 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3792 echo "configure:3793: checking for uid_t in sys/types.h" >&5
3793 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
3794   echo $ac_n "(cached) $ac_c" 1>&6
3795 else
3796   cat > conftest.$ac_ext <<EOF
3797 #line 3798 "configure"
3798 #include "confdefs.h"
3799 #include <sys/types.h>
3800 EOF
3801 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3802   egrep "uid_t" >/dev/null 2>&1; then
3803   rm -rf conftest*
3804   ac_cv_type_uid_t=yes
3805 else
3806   rm -rf conftest*
3807   ac_cv_type_uid_t=no
3808 fi
3809 rm -f conftest*
3810
3811 fi
3812
3813 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3814 if test $ac_cv_type_uid_t = no; then
3815   cat >> confdefs.h <<\EOF
3816 #define uid_t int
3817 EOF
3818
3819   cat >> confdefs.h <<\EOF
3820 #define gid_t int
3821 EOF
3822
3823 fi
3824
3825 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
3826 echo "configure:3827: checking type of array argument to getgroups" >&5
3827 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
3828   echo $ac_n "(cached) $ac_c" 1>&6
3829 else
3830   if test "$cross_compiling" = yes; then
3831   ac_cv_type_getgroups=cross
3832 else
3833   cat > conftest.$ac_ext <<EOF
3834 #line 3835 "configure"
3835 #include "confdefs.h"
3836
3837 /* Thanks to Mike Rendell for this test.  */
3838 #include <sys/types.h>
3839 #define NGID 256
3840 #undef MAX
3841 #define MAX(x, y) ((x) > (y) ? (x) : (y))
3842 main()
3843 {
3844   gid_t gidset[NGID];
3845   int i, n;
3846   union { gid_t gval; long lval; }  val;
3847
3848   val.lval = -1;
3849   for (i = 0; i < NGID; i++)
3850     gidset[i] = val.gval;
3851   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
3852                  gidset);
3853   /* Exit non-zero if getgroups seems to require an array of ints.  This
3854      happens when gid_t is short but getgroups modifies an array of ints.  */
3855   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
3856 }
3857
3858 EOF
3859 if { (eval echo configure:3860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3860 then
3861     ac_cv_type_getgroups=gid_t
3862 else
3863   echo "configure: failed program was:" >&5
3864   cat conftest.$ac_ext >&5
3865   rm -fr conftest*
3866   ac_cv_type_getgroups=int
3867 fi
3868 rm -fr conftest*
3869 fi
3870
3871 if test $ac_cv_type_getgroups = cross; then
3872         cat > conftest.$ac_ext <<EOF
3873 #line 3874 "configure"
3874 #include "confdefs.h"
3875 #include <unistd.h>
3876 EOF
3877 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3878   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
3879   rm -rf conftest*
3880   ac_cv_type_getgroups=gid_t
3881 else
3882   rm -rf conftest*
3883   ac_cv_type_getgroups=int
3884 fi
3885 rm -f conftest*
3886
3887 fi
3888 fi
3889
3890 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
3891 cat >> confdefs.h <<EOF
3892 #define GETGROUPS_T $ac_cv_type_getgroups
3893 EOF
3894
3895
3896 if test "${target}" = "${build}"; then
3897   TARGET_GETGROUPS_T=$ac_cv_type_getgroups
3898 else
3899   case "${target}" in
3900         # This condition may need some tweaking.  It should include all
3901         # targets where the array type of the second argument of getgroups
3902         # is int and the type of gid_t is not equivalent to int.
3903         *-*-sunos* | *-*-ultrix*)
3904                 TARGET_GETGROUPS_T=int
3905                 ;;
3906         *)
3907                 TARGET_GETGROUPS_T=gid_t
3908                 ;;
3909   esac
3910 fi
3911
3912
3913 echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6
3914 echo "configure:3915: checking whether the printf functions support %p" >&5
3915 if eval "test \"`echo '$''{'gcc_cv_func_printf_ptr'+set}'`\" = set"; then
3916   echo $ac_n "(cached) $ac_c" 1>&6
3917 else
3918   if test "$cross_compiling" = yes; then
3919   gcc_cv_func_printf_ptr=no
3920 else
3921   cat > conftest.$ac_ext <<EOF
3922 #line 3923 "configure"
3923 #include "confdefs.h"
3924 #include <stdio.h>
3925
3926 int main()
3927 {
3928   char buf[64];
3929   char *p = buf, *q = NULL;
3930   sprintf(buf, "%p", p);
3931   sscanf(buf, "%p", &q);
3932   return (p != q);
3933 }
3934 EOF
3935 if { (eval echo configure:3936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3936 then
3937   gcc_cv_func_printf_ptr=yes
3938 else
3939   echo "configure: failed program was:" >&5
3940   cat conftest.$ac_ext >&5
3941   rm -fr conftest*
3942   gcc_cv_func_printf_ptr=no
3943 fi
3944 rm -fr conftest*
3945 fi
3946
3947 rm -f core core.* *.core
3948 fi
3949
3950 echo "$ac_t""$gcc_cv_func_printf_ptr" 1>&6
3951 if test $gcc_cv_func_printf_ptr = yes ; then
3952   cat >> confdefs.h <<\EOF
3953 #define HAVE_PRINTF_PTR 1
3954 EOF
3955
3956 fi
3957
3958 if test $ac_cv_header_sys_mman_h != yes \
3959  || test $ac_cv_func_mmap != yes; then
3960    gcc_cv_func_mmap_file=no
3961    gcc_cv_func_mmap_dev_zero=no
3962    gcc_cv_func_mmap_anon=no
3963 else
3964    echo $ac_n "checking whether read-only mmap of a plain file works""... $ac_c" 1>&6
3965 echo "configure:3966: checking whether read-only mmap of a plain file works" >&5
3966 if eval "test \"`echo '$''{'gcc_cv_func_mmap_file'+set}'`\" = set"; then
3967   echo $ac_n "(cached) $ac_c" 1>&6
3968 else
3969   # Add a system to this blacklist if 
3970    # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a
3971    # memory area containing the same data that you'd get if you applied
3972    # read() to the same fd.  The only system known to have a problem here
3973    # is VMS, where text files have record structure.
3974    case "$host_os" in
3975      vms*) 
3976         gcc_cv_func_mmap_file=no ;;
3977      *)
3978         gcc_cv_func_mmap_file=yes;;
3979    esac
3980 fi
3981
3982 echo "$ac_t""$gcc_cv_func_mmap_file" 1>&6
3983    echo $ac_n "checking whether mmap from /dev/zero works""... $ac_c" 1>&6
3984 echo "configure:3985: checking whether mmap from /dev/zero works" >&5
3985 if eval "test \"`echo '$''{'gcc_cv_func_mmap_dev_zero'+set}'`\" = set"; then
3986   echo $ac_n "(cached) $ac_c" 1>&6
3987 else
3988   # Add a system to this blacklist if it has mmap() but /dev/zero
3989    # does not exist, or if mmapping /dev/zero does not give anonymous
3990    # zeroed pages with both the following properties:
3991    # 1. If you map N consecutive pages in with one call, and then
3992    #    unmap any subset of those pages, the pages that were not
3993    #    explicitly unmapped remain accessible.
3994    # 2. If you map two adjacent blocks of memory and then unmap them
3995    #    both at once, they must both go away.
3996    # Systems known to be in this category are Windows (all variants),
3997    # VMS, and Darwin.
3998    case "$host_os" in
3999      vms* | cygwin* | pe | mingw* | darwin*)
4000         gcc_cv_func_mmap_dev_zero=no ;;
4001      *)
4002         gcc_cv_func_mmap_dev_zero=yes;;
4003    esac
4004 fi
4005
4006 echo "$ac_t""$gcc_cv_func_mmap_dev_zero" 1>&6
4007
4008    # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
4009    echo $ac_n "checking for MAP_ANON(YMOUS)""... $ac_c" 1>&6
4010 echo "configure:4011: checking for MAP_ANON(YMOUS)" >&5
4011 if eval "test \"`echo '$''{'gcc_cv_decl_map_anon'+set}'`\" = set"; then
4012   echo $ac_n "(cached) $ac_c" 1>&6
4013 else
4014   cat > conftest.$ac_ext <<EOF
4015 #line 4016 "configure"
4016 #include "confdefs.h"
4017 #include <sys/types.h>
4018 #include <sys/mman.h>
4019 #include <unistd.h>
4020
4021 #ifndef MAP_ANONYMOUS
4022 #define MAP_ANONYMOUS MAP_ANON
4023 #endif
4024
4025 int main() {
4026 int n = MAP_ANONYMOUS;
4027 ; return 0; }
4028 EOF
4029 if { (eval echo configure:4030: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4030   rm -rf conftest*
4031   gcc_cv_decl_map_anon=yes
4032 else
4033   echo "configure: failed program was:" >&5
4034   cat conftest.$ac_ext >&5
4035   rm -rf conftest*
4036   gcc_cv_decl_map_anon=no
4037 fi
4038 rm -f conftest*
4039 fi
4040
4041 echo "$ac_t""$gcc_cv_decl_map_anon" 1>&6
4042
4043    if test $gcc_cv_decl_map_anon = no; then
4044      gcc_cv_func_mmap_anon=no
4045    else
4046      echo $ac_n "checking whether mmap with MAP_ANON(YMOUS) works""... $ac_c" 1>&6
4047 echo "configure:4048: checking whether mmap with MAP_ANON(YMOUS) works" >&5
4048 if eval "test \"`echo '$''{'gcc_cv_func_mmap_anon'+set}'`\" = set"; then
4049   echo $ac_n "(cached) $ac_c" 1>&6
4050 else
4051   # Add a system to this blacklist if it has mmap() and MAP_ANON or
4052    # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
4053    # doesn't give anonymous zeroed pages with the same properties listed
4054    # above for use of /dev/zero.
4055    # Systems known to be in this category are Windows, VMS, and SCO Unix.
4056    case "$host_os" in
4057      vms* | cygwin* | pe | mingw* | sco* | udk* )
4058         gcc_cv_func_mmap_anon=no ;;
4059      *)
4060         gcc_cv_func_mmap_anon=yes;;
4061    esac
4062 fi
4063
4064 echo "$ac_t""$gcc_cv_func_mmap_anon" 1>&6
4065    fi
4066 fi
4067
4068 if test $gcc_cv_func_mmap_file = yes; then
4069   cat >> confdefs.h <<\EOF
4070 #define HAVE_MMAP_FILE 1
4071 EOF
4072
4073 fi
4074 if test $gcc_cv_func_mmap_dev_zero = yes; then
4075   cat >> confdefs.h <<\EOF
4076 #define HAVE_MMAP_DEV_ZERO 1
4077 EOF
4078
4079 fi
4080 if test $gcc_cv_func_mmap_anon = yes; then
4081   cat >> confdefs.h <<\EOF
4082 #define HAVE_MMAP_ANON 1
4083 EOF
4084
4085 fi
4086
4087
4088 case "${host}" in
4089 *-*-uwin*)
4090   { echo "configure: error: 
4091 *** UWIN may not be used as a host platform because
4092 *** linking with posix.dll is not allowed by the GNU GPL" 1>&2; exit 1; }
4093   ;;
4094 *-*-*vms*)
4095   # Under VMS, vfork works very different than on Unix. The standard test 
4096   # won't work, and it isn't easily adaptable. It makes more sense to
4097   # just force it.
4098   ac_cv_func_vfork_works=yes
4099   ;;
4100 esac
4101 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
4102 echo "configure:4103: checking for pid_t" >&5
4103 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
4104   echo $ac_n "(cached) $ac_c" 1>&6
4105 else
4106   cat > conftest.$ac_ext <<EOF
4107 #line 4108 "configure"
4108 #include "confdefs.h"
4109 #include <sys/types.h>
4110 #if STDC_HEADERS
4111 #include <stdlib.h>
4112 #include <stddef.h>
4113 #endif
4114 EOF
4115 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4116   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
4117   rm -rf conftest*
4118   ac_cv_type_pid_t=yes
4119 else
4120   rm -rf conftest*
4121   ac_cv_type_pid_t=no
4122 fi
4123 rm -f conftest*
4124
4125 fi
4126 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
4127 if test $ac_cv_type_pid_t = no; then
4128   cat >> confdefs.h <<\EOF
4129 #define pid_t int
4130 EOF
4131
4132 fi
4133
4134 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
4135 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
4136 echo "configure:4137: checking for vfork.h" >&5
4137 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4138   echo $ac_n "(cached) $ac_c" 1>&6
4139 else
4140   cat > conftest.$ac_ext <<EOF
4141 #line 4142 "configure"
4142 #include "confdefs.h"
4143 #include <vfork.h>
4144 EOF
4145 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4146 { (eval echo configure:4147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4147 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4148 if test -z "$ac_err"; then
4149   rm -rf conftest*
4150   eval "ac_cv_header_$ac_safe=yes"
4151 else
4152   echo "$ac_err" >&5
4153   echo "configure: failed program was:" >&5
4154   cat conftest.$ac_ext >&5
4155   rm -rf conftest*
4156   eval "ac_cv_header_$ac_safe=no"
4157 fi
4158 rm -f conftest*
4159 fi
4160 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4161   echo "$ac_t""yes" 1>&6
4162   cat >> confdefs.h <<\EOF
4163 #define HAVE_VFORK_H 1
4164 EOF
4165
4166 else
4167   echo "$ac_t""no" 1>&6
4168 fi
4169
4170 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
4171 echo "configure:4172: checking for working vfork" >&5
4172 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
4173   echo $ac_n "(cached) $ac_c" 1>&6
4174 else
4175   if test "$cross_compiling" = yes; then
4176   echo $ac_n "checking for vfork""... $ac_c" 1>&6
4177 echo "configure:4178: checking for vfork" >&5
4178 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
4179   echo $ac_n "(cached) $ac_c" 1>&6
4180 else
4181   cat > conftest.$ac_ext <<EOF
4182 #line 4183 "configure"
4183 #include "confdefs.h"
4184 /* System header to define __stub macros and hopefully few prototypes,
4185     which can conflict with char vfork(); below.  */
4186 #include <assert.h>
4187 /* Override any gcc2 internal prototype to avoid an error.  */
4188 /* We use char because int might match the return type of a gcc2
4189     builtin and then its argument prototype would still apply.  */
4190 char vfork();
4191
4192 int main() {
4193
4194 /* The GNU C library defines this for functions which it implements
4195     to always fail with ENOSYS.  Some functions are actually named
4196     something starting with __ and the normal name is an alias.  */
4197 #if defined (__stub_vfork) || defined (__stub___vfork)
4198 choke me
4199 #else
4200 vfork();
4201 #endif
4202
4203 ; return 0; }
4204 EOF
4205 if { (eval echo configure:4206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4206   rm -rf conftest*
4207   eval "ac_cv_func_vfork=yes"
4208 else
4209   echo "configure: failed program was:" >&5
4210   cat conftest.$ac_ext >&5
4211   rm -rf conftest*
4212   eval "ac_cv_func_vfork=no"
4213 fi
4214 rm -f conftest*
4215 fi
4216
4217 if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
4218   echo "$ac_t""yes" 1>&6
4219   :
4220 else
4221   echo "$ac_t""no" 1>&6
4222 fi
4223
4224 ac_cv_func_vfork_works=$ac_cv_func_vfork
4225 else
4226   cat > conftest.$ac_ext <<EOF
4227 #line 4228 "configure"
4228 #include "confdefs.h"
4229 /* Thanks to Paul Eggert for this test.  */
4230 #include <stdio.h>
4231 #include <sys/types.h>
4232 #include <sys/stat.h>
4233 #ifdef HAVE_UNISTD_H
4234 #include <unistd.h>
4235 #endif
4236 #ifdef HAVE_VFORK_H
4237 #include <vfork.h>
4238 #endif
4239 /* On some sparc systems, changes by the child to local and incoming
4240    argument registers are propagated back to the parent.
4241    The compiler is told about this with #include <vfork.h>,
4242    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
4243    Test for this by using a static variable whose address
4244    is put into a register that is clobbered by the vfork.  */
4245 static
4246 #ifdef __cplusplus
4247 sparc_address_test (int arg)
4248 #else
4249 sparc_address_test (arg) int arg;
4250 #endif
4251 {
4252   static pid_t child;
4253   if (!child) {
4254     child = vfork ();
4255     if (child < 0) {
4256       perror ("vfork");
4257       _exit(2);
4258     }
4259     if (!child) {
4260       arg = getpid();
4261       write(-1, "", 0);
4262       _exit (arg);
4263     }
4264   }
4265 }
4266 main() {
4267   pid_t parent = getpid ();
4268   pid_t child;
4269
4270   sparc_address_test ();
4271
4272   child = vfork ();
4273
4274   if (child == 0) {
4275     /* Here is another test for sparc vfork register problems.
4276        This test uses lots of local variables, at least
4277        as many local variables as main has allocated so far
4278        including compiler temporaries.  4 locals are enough for
4279        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
4280        A buggy compiler should reuse the register of parent
4281        for one of the local variables, since it will think that
4282        parent can't possibly be used any more in this routine.
4283        Assigning to the local variable will thus munge parent
4284        in the parent process.  */
4285     pid_t
4286       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
4287       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
4288     /* Convince the compiler that p..p7 are live; otherwise, it might
4289        use the same hardware register for all 8 local variables.  */
4290     if (p != p1 || p != p2 || p != p3 || p != p4
4291         || p != p5 || p != p6 || p != p7)
4292       _exit(1);
4293
4294     /* On some systems (e.g. IRIX 3.3),
4295        vfork doesn't separate parent from child file descriptors.
4296        If the child closes a descriptor before it execs or exits,
4297        this munges the parent's descriptor as well.
4298        Test for this by closing stdout in the child.  */
4299     _exit(close(fileno(stdout)) != 0);
4300   } else {
4301     int status;
4302     struct stat st;
4303
4304     while (wait(&status) != child)
4305       ;
4306     exit(
4307          /* Was there some problem with vforking?  */
4308          child < 0
4309
4310          /* Did the child fail?  (This shouldn't happen.)  */
4311          || status
4312
4313          /* Did the vfork/compiler bug occur?  */
4314          || parent != getpid()
4315
4316          /* Did the file descriptor bug occur?  */
4317          || fstat(fileno(stdout), &st) != 0
4318          );
4319   }
4320 }
4321 EOF
4322 if { (eval echo configure:4323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4323 then
4324   ac_cv_func_vfork_works=yes
4325 else
4326   echo "configure: failed program was:" >&5
4327   cat conftest.$ac_ext >&5
4328   rm -fr conftest*
4329   ac_cv_func_vfork_works=no
4330 fi
4331 rm -fr conftest*
4332 fi
4333
4334 fi
4335
4336 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
4337 if test $ac_cv_func_vfork_works = no; then
4338   cat >> confdefs.h <<\EOF
4339 #define vfork fork
4340 EOF
4341
4342 fi
4343
4344
4345
4346     
4347   am_cv_lib_iconv_ldpath=
4348   # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
4349 if test "${with_libiconv_prefix+set}" = set; then
4350   withval="$with_libiconv_prefix"
4351   
4352     for dir in `echo "$withval" | tr : ' '`; do
4353       if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
4354       if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
4355     done
4356    
4357 fi
4358
4359
4360   echo $ac_n "checking for iconv""... $ac_c" 1>&6
4361 echo "configure:4362: checking for iconv" >&5
4362 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
4363   echo $ac_n "(cached) $ac_c" 1>&6
4364 else
4365   
4366     am_cv_func_iconv="no, consider installing GNU libiconv"
4367     am_cv_lib_iconv=no
4368     cat > conftest.$ac_ext <<EOF
4369 #line 4370 "configure"
4370 #include "confdefs.h"
4371 #include <stdlib.h>
4372 #include <iconv.h>
4373 int main() {
4374 iconv_t cd = iconv_open("","");
4375        iconv(cd,NULL,NULL,NULL,NULL);
4376        iconv_close(cd);
4377 ; return 0; }
4378 EOF
4379 if { (eval echo configure:4380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4380   rm -rf conftest*
4381   am_cv_func_iconv=yes
4382 else
4383   echo "configure: failed program was:" >&5
4384   cat conftest.$ac_ext >&5
4385 fi
4386 rm -f conftest*
4387     if test "$am_cv_func_iconv" != yes; then
4388       am_save_LIBS="$LIBS"
4389       LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
4390       cat > conftest.$ac_ext <<EOF
4391 #line 4392 "configure"
4392 #include "confdefs.h"
4393 #include <stdlib.h>
4394 #include <iconv.h>
4395 int main() {
4396 iconv_t cd = iconv_open("","");
4397          iconv(cd,NULL,NULL,NULL,NULL);
4398          iconv_close(cd);
4399 ; return 0; }
4400 EOF
4401 if { (eval echo configure:4402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4402   rm -rf conftest*
4403   am_cv_lib_iconv=yes
4404         am_cv_func_iconv=yes
4405 else
4406   echo "configure: failed program was:" >&5
4407   cat conftest.$ac_ext >&5
4408 fi
4409 rm -f conftest*
4410       LIBS="$am_save_LIBS"
4411     fi
4412   
4413 fi
4414
4415 echo "$ac_t""$am_cv_func_iconv" 1>&6
4416   if test "$am_cv_func_iconv" = yes; then
4417     cat >> confdefs.h <<\EOF
4418 #define HAVE_ICONV 1
4419 EOF
4420
4421     echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
4422 echo "configure:4423: checking for iconv declaration" >&5
4423     if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
4424   echo $ac_n "(cached) $ac_c" 1>&6
4425 else
4426   
4427       cat > conftest.$ac_ext <<EOF
4428 #line 4429 "configure"
4429 #include "confdefs.h"
4430
4431 #include <stdlib.h>
4432 #include <iconv.h>
4433 extern
4434 #ifdef __cplusplus
4435 "C"
4436 #endif
4437 #if defined(__STDC__) || defined(__cplusplus)
4438 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
4439 #else
4440 size_t iconv();
4441 #endif
4442
4443 int main() {
4444
4445 ; return 0; }
4446 EOF
4447 if { (eval echo configure:4448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4448   rm -rf conftest*
4449   am_cv_proto_iconv_arg1=""
4450 else
4451   echo "configure: failed program was:" >&5
4452   cat conftest.$ac_ext >&5
4453   rm -rf conftest*
4454   am_cv_proto_iconv_arg1="const"
4455 fi
4456 rm -f conftest*
4457       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);"
4458 fi
4459
4460     am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
4461     echo "$ac_t""${ac_t:-
4462          }$am_cv_proto_iconv" 1>&6
4463     cat >> confdefs.h <<EOF
4464 #define ICONV_CONST $am_cv_proto_iconv_arg1
4465 EOF
4466
4467   fi
4468   LIBICONV=
4469   if test "$am_cv_lib_iconv" = yes; then
4470     LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
4471   fi
4472   
4473
4474 # Until we have in-tree GNU iconv:
4475 LIBICONV_DEP=
4476
4477
4478
4479   echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
4480 echo "configure:4481: checking for LC_MESSAGES" >&5
4481 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
4482   echo $ac_n "(cached) $ac_c" 1>&6
4483 else
4484   cat > conftest.$ac_ext <<EOF
4485 #line 4486 "configure"
4486 #include "confdefs.h"
4487 #include <locale.h>
4488 int main() {
4489 return LC_MESSAGES
4490 ; return 0; }
4491 EOF
4492 if { (eval echo configure:4493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4493   rm -rf conftest*
4494   am_cv_val_LC_MESSAGES=yes
4495 else
4496   echo "configure: failed program was:" >&5
4497   cat conftest.$ac_ext >&5
4498   rm -rf conftest*
4499   am_cv_val_LC_MESSAGES=no
4500 fi
4501 rm -f conftest*
4502 fi
4503
4504 echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
4505   if test $am_cv_val_LC_MESSAGES = yes; then
4506     cat >> confdefs.h <<\EOF
4507 #define HAVE_LC_MESSAGES 1
4508 EOF
4509
4510   fi
4511
4512
4513 # We will need to find libiberty.h and ansidecl.h
4514 saved_CFLAGS="$CFLAGS"
4515 CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
4516 for ac_func in getenv atol sbrk abort atof getcwd getwd \
4517         strsignal putc_unlocked fputs_unlocked fwrite_unlocked \
4518         fprintf_unlocked strstr errno vasprintf \
4519         malloc realloc calloc free basename getopt clock
4520 do
4521   ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4522 echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
4523 echo "configure:4524: checking whether $ac_func is declared" >&5
4524 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
4525   echo $ac_n "(cached) $ac_c" 1>&6
4526 else
4527   cat > conftest.$ac_ext <<EOF
4528 #line 4529 "configure"
4529 #include "confdefs.h"
4530 #undef $ac_tr_decl
4531 #define $ac_tr_decl 1
4532   
4533 #include "ansidecl.h"
4534 #include "system.h"
4535
4536 int main() {
4537 #ifndef $ac_func
4538 char *(*pfn) = (char *(*)) $ac_func ;
4539 #endif
4540 ; return 0; }
4541 EOF
4542 if { (eval echo configure:4543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4543   rm -rf conftest*
4544   eval "gcc_cv_have_decl_$ac_func=yes"
4545 else
4546   echo "configure: failed program was:" >&5
4547   cat conftest.$ac_ext >&5
4548   rm -rf conftest*
4549   eval "gcc_cv_have_decl_$ac_func=no"
4550 fi
4551 rm -f conftest*
4552 fi
4553
4554 if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
4555   echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
4556 #define $ac_tr_decl 1
4557 EOF
4558  
4559 else
4560   echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
4561 #define $ac_tr_decl 0
4562 EOF
4563  
4564 fi
4565
4566 done
4567 if test x = y ; then
4568   cat >> confdefs.h <<\EOF
4569 #define HAVE_DECL_GETENV 1
4570 EOF
4571  cat >> confdefs.h <<\EOF
4572 #define HAVE_DECL_ATOL 1
4573 EOF
4574  cat >> confdefs.h <<\EOF
4575 #define HAVE_DECL_SBRK 1
4576 EOF
4577  cat >> confdefs.h <<\EOF
4578 #define HAVE_DECL_ABORT 1
4579 EOF
4580  cat >> confdefs.h <<\EOF
4581 #define HAVE_DECL_ATOF 1
4582 EOF
4583  cat >> confdefs.h <<\EOF
4584 #define HAVE_DECL_GETCWD 1
4585 EOF
4586  cat >> confdefs.h <<\EOF
4587 #define HAVE_DECL_GETWD 1
4588 EOF
4589  \
4590         cat >> confdefs.h <<\EOF
4591 #define HAVE_DECL_STRSIGNAL 1
4592 EOF
4593  cat >> confdefs.h <<\EOF
4594 #define HAVE_DECL_PUTC_UNLOCKED 1
4595 EOF
4596  cat >> confdefs.h <<\EOF
4597 #define HAVE_DECL_FPUTS_UNLOCKED 1
4598 EOF
4599  cat >> confdefs.h <<\EOF
4600 #define HAVE_DECL_FWRITE_UNLOCKED 1
4601 EOF
4602  \
4603         cat >> confdefs.h <<\EOF
4604 #define HAVE_DECL_FPRINTF_UNLOCKED 1
4605 EOF
4606  cat >> confdefs.h <<\EOF
4607 #define HAVE_DECL_STRSTR 1
4608 EOF
4609  cat >> confdefs.h <<\EOF
4610 #define HAVE_DECL_ERRNO 1
4611 EOF
4612  cat >> confdefs.h <<\EOF
4613 #define HAVE_DECL_VASPRINTF 1
4614 EOF
4615  \
4616         cat >> confdefs.h <<\EOF
4617 #define HAVE_DECL_MALLOC 1
4618 EOF
4619  cat >> confdefs.h <<\EOF
4620 #define HAVE_DECL_REALLOC 1
4621 EOF
4622  cat >> confdefs.h <<\EOF
4623 #define HAVE_DECL_CALLOC 1
4624 EOF
4625  cat >> confdefs.h <<\EOF
4626 #define HAVE_DECL_FREE 1
4627 EOF
4628  cat >> confdefs.h <<\EOF
4629 #define HAVE_DECL_BASENAME 1
4630 EOF
4631  cat >> confdefs.h <<\EOF
4632 #define HAVE_DECL_GETOPT 1
4633 EOF
4634  cat >> confdefs.h <<\EOF
4635 #define HAVE_DECL_CLOCK 1
4636 EOF
4637 fi
4638
4639
4640 for ac_func in getrlimit setrlimit getrusage
4641 do
4642   ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4643 echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
4644 echo "configure:4645: checking whether $ac_func is declared" >&5
4645 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
4646   echo $ac_n "(cached) $ac_c" 1>&6
4647 else
4648   cat > conftest.$ac_ext <<EOF
4649 #line 4650 "configure"
4650 #include "confdefs.h"
4651 #undef $ac_tr_decl
4652 #define $ac_tr_decl 1
4653   
4654 #include "ansidecl.h"
4655 #include "system.h"
4656 #ifdef HAVE_SYS_RESOURCE_H
4657 #include <sys/resource.h>
4658 #endif
4659
4660
4661 int main() {
4662 #ifndef $ac_func
4663 char *(*pfn) = (char *(*)) $ac_func ;
4664 #endif
4665 ; return 0; }
4666 EOF
4667 if { (eval echo configure:4668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4668   rm -rf conftest*
4669   eval "gcc_cv_have_decl_$ac_func=yes"
4670 else
4671   echo "configure: failed program was:" >&5
4672   cat conftest.$ac_ext >&5
4673   rm -rf conftest*
4674   eval "gcc_cv_have_decl_$ac_func=no"
4675 fi
4676 rm -f conftest*
4677 fi
4678
4679 if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
4680   echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
4681 #define $ac_tr_decl 1
4682 EOF
4683  
4684 else
4685   echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
4686 #define $ac_tr_decl 0
4687 EOF
4688  
4689 fi
4690
4691 done
4692 if test x = y ; then
4693   cat >> confdefs.h <<\EOF
4694 #define HAVE_DECL_GETRLIMIT 1
4695 EOF
4696  cat >> confdefs.h <<\EOF
4697 #define HAVE_DECL_SETRLIMIT 1
4698 EOF
4699  cat >> confdefs.h <<\EOF
4700 #define HAVE_DECL_GETRUSAGE 1
4701 EOF
4702 fi
4703
4704
4705 cat > conftest.$ac_ext <<EOF
4706 #line 4707 "configure"
4707 #include "confdefs.h"
4708
4709 #include "ansidecl.h"
4710 #include "system.h"
4711 #ifdef HAVE_SYS_RESOURCE_H
4712 #include <sys/resource.h>
4713 #endif
4714
4715 int main() {
4716 rlim_t l = 0;
4717 ; return 0; }
4718 EOF
4719 if { (eval echo configure:4720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4720   :
4721 else
4722   echo "configure: failed program was:" >&5
4723   cat conftest.$ac_ext >&5
4724   rm -rf conftest*
4725   cat >> confdefs.h <<\EOF
4726 #define rlim_t long
4727 EOF
4728
4729 fi
4730 rm -f conftest*
4731
4732 for ac_func in ldgetname
4733 do
4734   ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4735 echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
4736 echo "configure:4737: checking whether $ac_func is declared" >&5
4737 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
4738   echo $ac_n "(cached) $ac_c" 1>&6
4739 else
4740   cat > conftest.$ac_ext <<EOF
4741 #line 4742 "configure"
4742 #include "confdefs.h"
4743 #undef $ac_tr_decl
4744 #define $ac_tr_decl 1
4745   
4746 #include "ansidecl.h"
4747 #include "system.h"
4748 #ifdef HAVE_LDFCN_H
4749 #include <ldfcn.h>
4750 #endif
4751
4752
4753 int main() {
4754 #ifndef $ac_func
4755 char *(*pfn) = (char *(*)) $ac_func ;
4756 #endif
4757 ; return 0; }
4758 EOF
4759 if { (eval echo configure:4760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4760   rm -rf conftest*
4761   eval "gcc_cv_have_decl_$ac_func=yes"
4762 else
4763   echo "configure: failed program was:" >&5
4764   cat conftest.$ac_ext >&5
4765   rm -rf conftest*
4766   eval "gcc_cv_have_decl_$ac_func=no"
4767 fi
4768 rm -f conftest*
4769 fi
4770
4771 if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
4772   echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
4773 #define $ac_tr_decl 1
4774 EOF
4775  
4776 else
4777   echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
4778 #define $ac_tr_decl 0
4779 EOF
4780  
4781 fi
4782
4783 done
4784 if test x = y ; then
4785   cat >> confdefs.h <<\EOF
4786 #define HAVE_DECL_LDGETNAME 1
4787 EOF
4788 fi
4789
4790
4791 for ac_func in times
4792 do
4793   ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4794 echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
4795 echo "configure:4796: checking whether $ac_func is declared" >&5
4796 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
4797   echo $ac_n "(cached) $ac_c" 1>&6
4798 else
4799   cat > conftest.$ac_ext <<EOF
4800 #line 4801 "configure"
4801 #include "confdefs.h"
4802 #undef $ac_tr_decl
4803 #define $ac_tr_decl 1
4804   
4805 #include "ansidecl.h"
4806 #include "system.h"
4807 #ifdef HAVE_SYS_TIMES_H
4808 #include <sys/times.h>
4809 #endif
4810
4811
4812 int main() {
4813 #ifndef $ac_func
4814 char *(*pfn) = (char *(*)) $ac_func ;
4815 #endif
4816 ; return 0; }
4817 EOF
4818 if { (eval echo configure:4819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4819   rm -rf conftest*
4820   eval "gcc_cv_have_decl_$ac_func=yes"
4821 else
4822   echo "configure: failed program was:" >&5
4823   cat conftest.$ac_ext >&5
4824   rm -rf conftest*
4825   eval "gcc_cv_have_decl_$ac_func=no"
4826 fi
4827 rm -f conftest*
4828 fi
4829
4830 if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
4831   echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
4832 #define $ac_tr_decl 1
4833 EOF
4834  
4835 else
4836   echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
4837 #define $ac_tr_decl 0
4838 EOF
4839  
4840 fi
4841
4842 done
4843 if test x = y ; then
4844   cat >> confdefs.h <<\EOF
4845 #define HAVE_DECL_TIMES 1
4846 EOF
4847 fi
4848
4849
4850 # More time-related stuff.
4851 echo $ac_n "checking for struct tms""... $ac_c" 1>&6
4852 echo "configure:4853: checking for struct tms" >&5
4853 if eval "test \"`echo '$''{'ac_cv_struct_tms'+set}'`\" = set"; then
4854   echo $ac_n "(cached) $ac_c" 1>&6
4855 else
4856   
4857 cat > conftest.$ac_ext <<EOF
4858 #line 4859 "configure"
4859 #include "confdefs.h"
4860
4861 #include "ansidecl.h"
4862 #include "system.h"
4863 #ifdef HAVE_SYS_TIMES_H
4864 #include <sys/times.h>
4865 #endif
4866
4867 int main() {
4868 struct tms tms;
4869 ; return 0; }
4870 EOF
4871 if { (eval echo configure:4872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4872   rm -rf conftest*
4873   ac_cv_struct_tms=yes
4874 else
4875   echo "configure: failed program was:" >&5
4876   cat conftest.$ac_ext >&5
4877   rm -rf conftest*
4878   ac_cv_struct_tms=no
4879 fi
4880 rm -f conftest*
4881 fi
4882
4883 echo "$ac_t""$ac_cv_struct_tms" 1>&6
4884 if test $ac_cv_struct_tms = yes; then
4885   cat >> confdefs.h <<\EOF
4886 #define HAVE_STRUCT_TMS 1
4887 EOF
4888
4889 fi
4890
4891 # use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE.
4892 # revisit after autoconf 2.50.
4893 echo $ac_n "checking for clock_t""... $ac_c" 1>&6
4894 echo "configure:4895: checking for clock_t" >&5
4895 if eval "test \"`echo '$''{'gcc_cv_type_clock_t'+set}'`\" = set"; then
4896   echo $ac_n "(cached) $ac_c" 1>&6
4897 else
4898   
4899 cat > conftest.$ac_ext <<EOF
4900 #line 4901 "configure"
4901 #include "confdefs.h"
4902
4903 #include "ansidecl.h"
4904 #include "system.h"
4905
4906 int main() {
4907 clock_t x;
4908 ; return 0; }
4909 EOF
4910 if { (eval echo configure:4911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4911   rm -rf conftest*
4912   gcc_cv_type_clock_t=yes
4913 else
4914   echo "configure: failed program was:" >&5
4915   cat conftest.$ac_ext >&5
4916   rm -rf conftest*
4917   gcc_cv_type_clock_t=no
4918 fi
4919 rm -f conftest*
4920 fi
4921
4922 echo "$ac_t""$gcc_cv_type_clock_t" 1>&6
4923 if test $gcc_cv_type_clock_t = yes; then
4924   cat >> confdefs.h <<\EOF
4925 #define HAVE_CLOCK_T 1
4926 EOF
4927
4928 fi
4929
4930 echo $ac_n "checking for uchar""... $ac_c" 1>&6
4931 echo "configure:4932: checking for uchar" >&5
4932 if eval "test \"`echo '$''{'gcc_cv_type_uchar'+set}'`\" = set"; then
4933   echo $ac_n "(cached) $ac_c" 1>&6
4934 else
4935   cat > conftest.$ac_ext <<EOF
4936 #line 4937 "configure"
4937 #include "confdefs.h"
4938
4939 #include "ansidecl.h"
4940 #include "system.h"
4941
4942 int main() {
4943 if ((uchar *)0) return 0;
4944  if (sizeof(uchar)) return 0;
4945 ; return 0; }
4946 EOF
4947 if { (eval echo configure:4948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4948   rm -rf conftest*
4949   ac_cv_type_uchar=yes
4950 else
4951   echo "configure: failed program was:" >&5
4952   cat conftest.$ac_ext >&5
4953   rm -rf conftest*
4954   ac_cv_type_uchar=no
4955 fi
4956 rm -f conftest*
4957 fi
4958
4959 echo "$ac_t""$gcc_cv_type_uchar" 1>&6
4960 if test $ac_cv_type_uchar = yes; then
4961   cat >> confdefs.h <<\EOF
4962 #define HAVE_UCHAR 1
4963 EOF
4964
4965 fi
4966
4967 # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
4968 CFLAGS="$saved_CFLAGS"
4969
4970 # Check whether --enable-initfini-array or --disable-initfini-array was given.
4971 if test "${enable_initfini_array+set}" = set; then
4972   enableval="$enable_initfini_array"
4973   :
4974 else
4975   
4976 echo $ac_n "checking for .preinit_array/.init_array/.fini_array support""... $ac_c" 1>&6
4977 echo "configure:4978: checking for .preinit_array/.init_array/.fini_array support" >&5
4978 if eval "test \"`echo '$''{'gcc_cv_initfini_array'+set}'`\" = set"; then
4979   echo $ac_n "(cached) $ac_c" 1>&6
4980 else
4981     if test "$cross_compiling" = yes; then
4982   gcc_cv_initfini_array=no
4983 else
4984   cat > conftest.$ac_ext <<EOF
4985 #line 4986 "configure"
4986 #include "confdefs.h"
4987
4988 static int x = -1;
4989 int main (void) { return x; }
4990 int foo (void) { x = 0; }
4991 int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
4992 EOF
4993 if { (eval echo configure:4994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4994 then
4995   gcc_cv_initfini_array=yes
4996 else
4997   echo "configure: failed program was:" >&5
4998   cat conftest.$ac_ext >&5
4999   rm -fr conftest*
5000   gcc_cv_initfini_array=no
5001 fi
5002 rm -fr conftest*
5003 fi
5004
5005 fi
5006
5007 echo "$ac_t""$gcc_cv_initfini_array" 1>&6
5008   enable_initfini_array=$gcc_cv_initfini_array
5009
5010 fi
5011
5012 if test $enable_initfini_array = yes; then
5013   cat >> confdefs.h <<\EOF
5014 #define HAVE_INITFINI_ARRAY 1
5015 EOF
5016
5017 fi
5018
5019 # mkdir takes a single argument on some systems. 
5020 echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6
5021 echo "configure:5022: checking if mkdir takes one argument" >&5
5022 if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then
5023   echo $ac_n "(cached) $ac_c" 1>&6
5024 else
5025   cat > conftest.$ac_ext <<EOF
5026 #line 5027 "configure"
5027 #include "confdefs.h"
5028
5029 #include <sys/types.h>
5030 #ifdef HAVE_SYS_STAT_H
5031 # include <sys/stat.h>
5032 #endif
5033 #ifdef HAVE_UNISTD_H
5034 # include <unistd.h>
5035 #endif
5036 #ifdef HAVE_DIRECT_H
5037 # include <direct.h>
5038 #endif
5039 int main() {
5040 mkdir ("foo", 0);
5041 ; return 0; }
5042 EOF
5043 if { (eval echo configure:5044: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5044   rm -rf conftest*
5045   gcc_cv_mkdir_takes_one_arg=no
5046 else
5047   echo "configure: failed program was:" >&5
5048   cat conftest.$ac_ext >&5
5049   rm -rf conftest*
5050   gcc_cv_mkdir_takes_one_arg=yes
5051 fi
5052 rm -f conftest*
5053 fi
5054
5055 echo "$ac_t""$gcc_cv_mkdir_takes_one_arg" 1>&6
5056 if test $gcc_cv_mkdir_takes_one_arg = yes ; then
5057   cat >> confdefs.h <<\EOF
5058 #define MKDIR_TAKES_ONE_ARG 1
5059 EOF
5060
5061 fi
5062
5063
5064 # File extensions
5065 manext='.1'
5066 objext='.o'
5067
5068
5069
5070 # With Setjmp/Longjmp based exception handling.
5071 # Check whether --enable-sjlj-exceptions or --disable-sjlj-exceptions was given.
5072 if test "${enable_sjlj_exceptions+set}" = set; then
5073   enableval="$enable_sjlj_exceptions"
5074   sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi`
5075 cat >> confdefs.h <<EOF
5076 #define CONFIG_SJLJ_EXCEPTIONS $sjlj
5077 EOF
5078
5079 fi
5080
5081
5082 echo $ac_n "checking for main in -lunwind""... $ac_c" 1>&6
5083 echo "configure:5084: checking for main in -lunwind" >&5
5084 ac_lib_var=`echo unwind'_'main | sed 'y%./+-%__p_%'`
5085 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5086   echo $ac_n "(cached) $ac_c" 1>&6
5087 else
5088   ac_save_LIBS="$LIBS"
5089 LIBS="-lunwind  $LIBS"
5090 cat > conftest.$ac_ext <<EOF
5091 #line 5092 "configure"
5092 #include "confdefs.h"
5093
5094 int main() {
5095 main()
5096 ; return 0; }
5097 EOF
5098 if { (eval echo configure:5099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5099   rm -rf conftest*
5100   eval "ac_cv_lib_$ac_lib_var=yes"
5101 else
5102   echo "configure: failed program was:" >&5
5103   cat conftest.$ac_ext >&5
5104   rm -rf conftest*
5105   eval "ac_cv_lib_$ac_lib_var=no"
5106 fi
5107 rm -f conftest*
5108 LIBS="$ac_save_LIBS"
5109
5110 fi
5111 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5112   echo "$ac_t""yes" 1>&6
5113   use_libunwind_default=yes
5114 else
5115   echo "$ac_t""no" 1>&6
5116 use_libunwind_default=no
5117 fi
5118
5119 # Use libunwind based exception handling.
5120 # Check whether --enable-libunwind-exceptions or --disable-libunwind-exceptions was given.
5121 if test "${enable_libunwind_exceptions+set}" = set; then
5122   enableval="$enable_libunwind_exceptions"
5123   use_libunwind_exceptions=$enableval
5124 else
5125   use_libunwind_exceptions=$use_libunwind_default
5126 fi
5127
5128 if test x"$use_libunwind_exceptions" = xyes; then
5129    cat >> confdefs.h <<\EOF
5130 #define USE_LIBUNWIND_EXCEPTIONS 1
5131 EOF
5132
5133 fi
5134
5135 # --------------------------------------------------------
5136 # Build, host, and target specific configuration fragments
5137 # --------------------------------------------------------
5138
5139 # Collect build-machine-specific information.
5140 . ${srcdir}/config.build
5141
5142 # Collect host-machine-specific information.
5143 . ${srcdir}/config.host
5144
5145 target_gtfiles=
5146
5147 # Collect target-machine-specific information.
5148 for machine in $target ; do
5149         . ${srcdir}/config.gcc
5150 done
5151
5152 extra_objs="${host_extra_objs} ${extra_objs}"
5153
5154 # Default the target-machine variables that were not explicitly set.
5155 if test x"$tm_file" = x
5156 then tm_file=$cpu_type/$cpu_type.h; fi
5157
5158 if test x"$extra_headers" = x
5159 then extra_headers=; fi
5160
5161 if test x$md_file = x
5162 then md_file=$cpu_type/$cpu_type.md; fi
5163
5164 if test x$out_file = x
5165 then out_file=$cpu_type/$cpu_type.c; fi
5166
5167 if test x"$tmake_file" = x
5168 then tmake_file=$cpu_type/t-$cpu_type
5169 fi
5170
5171 if test x"$dwarf2" = xyes
5172 then tm_file="$tm_file tm-dwarf2.h"
5173 fi
5174
5175 # Say what files are being used for the output code and MD file.
5176 echo "Using \`$srcdir/config/$out_file' for machine-specific logic."
5177 echo "Using \`$srcdir/config/$md_file' as machine description file."
5178
5179 # If any of the xm_file variables contain nonexistent files, warn
5180 # about them and drop them.
5181
5182 bx=
5183 for x in $build_xm_file; do
5184   if    test -f $srcdir/config/$x
5185   then      bx="$bx $x"
5186   else      echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
5187   fi
5188 done
5189 build_xm_file="$bx"
5190
5191 hx=
5192 for x in $host_xm_file; do
5193   if    test -f $srcdir/config/$x
5194   then      hx="$hx $x"
5195   else      echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
5196   fi
5197 done
5198 host_xm_file="$hx"
5199
5200 tx=
5201 for x in $xm_file; do
5202   if    test -f $srcdir/config/$x
5203   then      tx="$tx $x"
5204   else      echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
5205   fi
5206 done
5207 xm_file="$tx"
5208
5209 count=a
5210 for f in $tm_file; do
5211         count=${count}x
5212 done
5213 if test $count = ax; then
5214         echo "Using \`$srcdir/config/$tm_file' as target machine macro file."
5215 else
5216         echo "Using the following target machine macro files:"
5217         for f in $tm_file; do
5218                 echo "  $srcdir/config/$f"
5219         done
5220 fi
5221
5222 if test x$need_64bit_hwint = xyes; then
5223         cat >> confdefs.h <<\EOF
5224 #define NEED_64BIT_HOST_WIDE_INT 1
5225 EOF
5226
5227 fi
5228
5229 count=a
5230 for f in $host_xm_file; do
5231         count=${count}x
5232 done
5233 if test $count = a; then
5234         :
5235 elif test $count = ax; then
5236         echo "Using \`$srcdir/config/$host_xm_file' as host machine macro file."
5237 else
5238         echo "Using the following host machine macro files:"
5239         for f in $host_xm_file; do
5240                 echo "  $srcdir/config/$f"
5241         done
5242 fi
5243 echo "Using ${out_host_hook_obj} for host machine hooks."
5244
5245 if test "$host_xm_file" != "$build_xm_file"; then
5246         count=a
5247         for f in $build_xm_file; do
5248                 count=${count}x
5249         done
5250         if test $count = a; then
5251                 :
5252         elif test $count = ax; then
5253                 echo "Using \`$srcdir/config/$build_xm_file' as build machine macro file."
5254         else
5255                 echo "Using the following build machine macro files:"
5256                 for f in $build_xm_file; do
5257                         echo "  $srcdir/config/$f"
5258                 done
5259         fi
5260 fi
5261
5262 if test x$thread_file = x; then
5263         if test x$target_thread_file != x; then
5264                 thread_file=$target_thread_file
5265         else
5266                 thread_file='single'
5267         fi
5268 fi
5269
5270 if test x$enable___cxa_atexit = xyes || \
5271    test x$enable___cxa_atexit = x -a x$default_use_cxa_atexit = xyes; then
5272   cat >> confdefs.h <<\EOF
5273 #define DEFAULT_USE_CXA_ATEXIT 1
5274 EOF
5275
5276 fi
5277
5278 # Look for a file containing extra machine modes.
5279 if test -n "$extra_modes" && test -f $srcdir/config/$extra_modes; then
5280   extra_modes_file='$(srcdir)'/config/${extra_modes}
5281   
5282   cat >> confdefs.h <<EOF
5283 #define EXTRA_MODES_FILE "config/$extra_modes"
5284 EOF
5285
5286   cat >> confdefs.h <<\EOF
5287 #define EXTRA_CC_MODES 1
5288 EOF
5289
5290 fi
5291
5292 # auto-host.h is the file containing items generated by autoconf and is
5293 # the first file included by config.h.
5294 # If host=build, it is correct to have bconfig include auto-host.h
5295 # as well.  If host!=build, we are in error and need to do more 
5296 # work to find out the build config parameters.
5297 if test x$host = x$build
5298 then
5299         build_auto=auto-host.h
5300         FORBUILD=..
5301 else
5302         # We create a subdir, then run autoconf in the subdir.
5303         # To prevent recursion we set host and build for the new
5304         # invocation of configure to the build for this invocation
5305         # of configure. 
5306         tempdir=build.$$
5307         rm -rf $tempdir
5308         mkdir $tempdir
5309         cd $tempdir
5310         case ${srcdir} in
5311         /* | A-Za-z:\\/* ) realsrcdir=${srcdir};;
5312         *) realsrcdir=../${srcdir};;
5313         esac
5314         saved_CFLAGS="${CFLAGS}"
5315         CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
5316         ${realsrcdir}/configure \
5317                 --target=$target_alias --host=$build_alias --build=$build_alias
5318         CFLAGS="${saved_CFLAGS}"
5319
5320         # We just finished tests for the build machine, so rename
5321         # the file auto-build.h in the gcc directory.
5322         mv auto-host.h ../auto-build.h
5323         cd ..
5324         rm -rf $tempdir
5325         build_auto=auto-build.h
5326         FORBUILD=../${build_subdir}
5327 fi
5328
5329
5330 tm_file="${tm_file} defaults.h"
5331 tm_p_file="${tm_p_file} tm-preds.h"
5332 host_xm_file="auto-host.h ansidecl.h ${host_xm_file}"
5333 build_xm_file="${build_auto} ansidecl.h ${build_xm_file}"
5334 # We don't want ansidecl.h in target files, write code there in ISO/GNU C.
5335 # put this back in temporarily.
5336 xm_file="ansidecl.h ${xm_file}"
5337
5338 # --------
5339 # UNSORTED
5340 # --------
5341
5342 # Get the version trigger filename from the toplevel
5343 if test "${with_gcc_version_trigger+set}" = set; then
5344         gcc_version_trigger=$with_gcc_version_trigger
5345 else
5346         gcc_version_trigger=${srcdir}/version.c
5347 fi
5348 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
5349 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
5350
5351 # Compile in configure arguments.
5352 if test -f configargs.h ; then
5353         # Being re-configured.
5354         gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'`
5355         gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
5356 else
5357         gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
5358 fi
5359 cat > configargs.h <<EOF
5360 /* Generated automatically. */
5361 static const char configuration_arguments[] = "$gcc_config_arguments";
5362 static const char thread_model[] = "$thread_file";
5363
5364 static const struct {
5365   const char *name, *value;
5366 } configure_default_options[] = $configure_default_options;
5367 EOF
5368
5369 # Internationalization
5370 PACKAGE=gcc
5371 VERSION="$gcc_version"
5372
5373
5374
5375 # If we haven't got the data from the intl directory,
5376 # assume NLS is disabled.
5377 USE_NLS=no      
5378 LIBINTL=        
5379 LIBINTL_DEP=    
5380 INCINTL=        
5381 XGETTEXT=       
5382 GMSGFMT=        
5383 POSUB=          
5384 if test -f ../intl/config.intl; then
5385   . ../intl/config.intl
5386 fi
5387 echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
5388 echo "configure:5389: checking whether NLS is requested" >&5
5389 if test x"$USE_NLS" != xyes; then
5390   echo "$ac_t""no" 1>&6
5391 else
5392   echo "$ac_t""yes" 1>&6
5393   cat >> confdefs.h <<\EOF
5394 #define ENABLE_NLS 1
5395 EOF
5396
5397
5398   echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
5399 echo "configure:5400: checking for catalogs to be installed" >&5
5400   # Look for .po and .gmo files in the source directory.
5401   CATALOGS=  
5402   XLINGUAS=
5403   for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do
5404     # If there aren't any .gmo files the shell will give us the
5405     # literal string "../path/to/srcdir/po/*.gmo" which has to be
5406     # weeded out.
5407     case "$cat" in *\**)
5408       continue;;
5409     esac
5410     # The quadruple backslash is collapsed to a double backslash
5411     # by the backticks, then collapsed again by the double quotes,
5412     # leaving us with one backslash in the sed expression (right
5413     # before the dot that mustn't act as a wildcard).
5414     cat=`echo $cat | sed -e "s!$srcdir/!!" -e "s!\\\\.po!.gmo!"`
5415     lang=`echo $cat | sed -e 's!po/!!' -e "s!\\\\.gmo!!"`
5416     # The user is allowed to set LINGUAS to a list of languages to
5417     # install catalogs for.  If it's empty that means "all of them."
5418     if test "x$LINGUAS" = x; then
5419       CATALOGS="$CATALOGS $cat"
5420       XLINGUAS="$XLINGUAS $lang"
5421     else
5422       case "$LINGUAS" in *$lang*)
5423         CATALOGS="$CATALOGS $cat"
5424         XLINGUAS="$XLINGUAS $lang"
5425         ;;
5426       esac
5427     fi
5428   done
5429   LINGUAS="$XLINGUAS"
5430   echo "$ac_t""$LINGUAS" 1>&6
5431 fi
5432
5433 # If LIBINTL contains LIBICONV, then clear LIBICONV so we don't get
5434 # -liconv on the link line twice.
5435 case "$LIBINTL" in *$LIBICONV*)
5436         LIBICONV= ;;
5437 esac
5438
5439 # Windows32 Registry support for specifying GCC installation paths.
5440 # Check whether --enable-win32-registry or --disable-win32-registry was given.
5441 if test "${enable_win32_registry+set}" = set; then
5442   enableval="$enable_win32_registry"
5443   :
5444 fi
5445
5446 case $host_os in
5447         win32 | pe | cygwin* | mingw32* | uwin*)
5448 echo $ac_n "checking whether windows registry support is requested""... $ac_c" 1>&6
5449 echo "configure:5450: checking whether windows registry support is requested" >&5
5450 if test "x$enable_win32_registry" != xno; then
5451   cat >> confdefs.h <<\EOF
5452 #define ENABLE_WIN32_REGISTRY 1
5453 EOF
5454
5455   echo "$ac_t""yes" 1>&6
5456   
5457 echo $ac_n "checking for library containing RegOpenKeyExA""... $ac_c" 1>&6
5458 echo "configure:5459: checking for library containing RegOpenKeyExA" >&5
5459 if eval "test \"`echo '$''{'ac_cv_search_RegOpenKeyExA'+set}'`\" = set"; then
5460   echo $ac_n "(cached) $ac_c" 1>&6
5461 else
5462   ac_func_search_save_LIBS="$LIBS"
5463 ac_cv_search_RegOpenKeyExA="no"
5464 cat > conftest.$ac_ext <<EOF
5465 #line 5466 "configure"
5466 #include "confdefs.h"
5467 /* Override any gcc2 internal prototype to avoid an error.  */
5468 /* We use char because int might match the return type of a gcc2
5469     builtin and then its argument prototype would still apply.  */
5470 char RegOpenKeyExA();
5471
5472 int main() {
5473 RegOpenKeyExA()
5474 ; return 0; }
5475 EOF
5476 if { (eval echo configure:5477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5477   rm -rf conftest*
5478   ac_cv_search_RegOpenKeyExA="none required"
5479 else
5480   echo "configure: failed program was:" >&5
5481   cat conftest.$ac_ext >&5
5482 fi
5483 rm -f conftest*
5484 test "$ac_cv_search_RegOpenKeyExA" = "no" && for i in advapi32; do
5485 LIBS="-l$i  $ac_func_search_save_LIBS"
5486 cat > conftest.$ac_ext <<EOF
5487 #line 5488 "configure"
5488 #include "confdefs.h"
5489 /* Override any gcc2 internal prototype to avoid an error.  */
5490 /* We use char because int might match the return type of a gcc2
5491     builtin and then its argument prototype would still apply.  */
5492 char RegOpenKeyExA();
5493
5494 int main() {
5495 RegOpenKeyExA()
5496 ; return 0; }
5497 EOF
5498 if { (eval echo configure:5499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5499   rm -rf conftest*
5500   ac_cv_search_RegOpenKeyExA="-l$i"
5501 break
5502 else
5503   echo "configure: failed program was:" >&5
5504   cat conftest.$ac_ext >&5
5505 fi
5506 rm -f conftest*
5507 done
5508 LIBS="$ac_func_search_save_LIBS"
5509 fi
5510
5511 echo "$ac_t""$ac_cv_search_RegOpenKeyExA" 1>&6
5512 if test "$ac_cv_search_RegOpenKeyExA" != "no"; then
5513   test "$ac_cv_search_RegOpenKeyExA" = "none required" || LIBS="$ac_cv_search_RegOpenKeyExA $LIBS"
5514   
5515 else :
5516   
5517 fi
5518 else
5519   echo "$ac_t""no" 1>&6
5520 fi
5521
5522 # Check if user specified a different registry key.
5523 case "x${enable_win32_registry}" in
5524 x | xyes)
5525   # default.
5526   gcc_cv_win32_registry_key="$VERSION"
5527   ;;
5528 xno)
5529   # no registry lookup.
5530   gcc_cv_win32_registry_key=''
5531   ;;
5532 *)
5533   # user-specified key.
5534   gcc_cv_win32_registry_key="$enable_win32_registry"
5535   ;;
5536 esac
5537
5538 if test "x$enable_win32_registry" != xno; then
5539   echo $ac_n "checking registry key on windows hosts""... $ac_c" 1>&6
5540 echo "configure:5541: checking registry key on windows hosts" >&5
5541   cat >> confdefs.h <<EOF
5542 #define WIN32_REGISTRY_KEY "$gcc_cv_win32_registry_key"
5543 EOF
5544
5545   echo "$ac_t""$gcc_cv_win32_registry_key" 1>&6
5546 fi
5547 ;;
5548 esac
5549
5550 # Get an absolute path to the GCC top-level source directory
5551 holddir=`${PWDCMD-pwd}`
5552 cd $srcdir
5553 topdir=`${PWDCMD-pwd}`
5554 cd $holddir
5555
5556 # Conditionalize the makefile for this host machine.
5557 xmake_file=
5558 for f in ${host_xmake_file}
5559 do
5560         if test -f ${srcdir}/config/$f
5561         then
5562                 xmake_file="${xmake_file} \$(srcdir)/config/$f"
5563         fi
5564 done
5565
5566 # Conditionalize the makefile for this target machine.
5567 tmake_file_=
5568 for f in ${tmake_file}
5569 do
5570         if test -f ${srcdir}/config/$f
5571         then
5572                 tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
5573         fi
5574 done
5575 tmake_file="${tmake_file_}"
5576
5577 symbolic_link='ln -s'
5578
5579 # If the host doesn't support symlinks, modify CC in
5580 # FLAGS_TO_PASS so CC="stage1/xgcc -Bstage1/" works.
5581 # Otherwise, we can use "CC=$(CC)".
5582 rm -f symtest.tem
5583 if $symbolic_link $srcdir/gcc.c symtest.tem 2>/dev/null
5584 then
5585         cc_set_by_configure="\$(CC)"
5586         quoted_cc_set_by_configure="\$(CC)"
5587         stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
5588         quoted_stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
5589 else
5590         rm -f symtest.tem
5591         if cp -p $srcdir/gcc.c symtest.tem 2>/dev/null
5592         then
5593                 symbolic_link="cp -p"
5594         else
5595                 symbolic_link="cp"
5596         fi
5597         cc_set_by_configure="\`case '\$(CC)' in stage*) echo '\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\$(CC)';; esac\`"
5598         quoted_cc_set_by_configure="\\\`case '\\\$(CC)' in stage*) echo '\\\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(CC)';; esac\\\`"
5599         stage_prefix_set_by_configure="\`case '\$(STAGE_PREFIX)' in stage*) echo '\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\$(STAGE_PREFIX)';; esac\`"
5600         quoted_stage_prefix_set_by_configure="\\\`case '\\\$(STAGE_PREFIX)' in stage*) echo '\\\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(STAGE_PREFIX)';; esac\\\`"
5601 fi
5602 rm -f symtest.tem
5603
5604 out_object_file=`basename $out_file .c`.o
5605
5606 tm_file_list=
5607 tm_include_list=
5608 for f in $tm_file; do
5609   case $f in
5610     defaults.h )
5611        tm_file_list="${tm_file_list} \$(srcdir)/$f"
5612        tm_include_list="${tm_include_list} $f"
5613        ;;
5614     * )
5615        tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
5616        tm_include_list="${tm_include_list} config/$f"
5617        ;;
5618   esac
5619 done
5620
5621 tm_p_file_list=
5622 tm_p_include_list=
5623 for f in $tm_p_file; do
5624   case $f in
5625     tm-preds.h )
5626        tm_p_file_list="${tm_p_file_list} $f"
5627        tm_p_include_list="${tm_p_include_list} $f"
5628        ;;
5629     * )
5630        tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f"
5631        tm_p_include_list="${tm_p_include_list} config/$f"
5632   esac
5633 done
5634
5635 xm_file_list=
5636 xm_include_list=
5637 for f in $xm_file; do
5638   case $f in
5639     ansidecl.h )
5640        xm_file_list="${xm_file_list} \$(srcdir)/../include/$f"
5641        xm_include_list="${xm_include_list} $f"
5642        ;;
5643     auto-host.h )
5644        xm_file_list="${xm_file_list} $f"
5645        xm_include_list="${xm_include_list} $f"
5646        ;;
5647     * )
5648        xm_file_list="${xm_file_list} \$(srcdir)/config/$f"
5649        xm_include_list="${xm_include_list} config/$f"
5650        ;;
5651   esac
5652 done
5653
5654 host_xm_file_list=
5655 host_xm_include_list=
5656 for f in $host_xm_file; do
5657   case $f in
5658     ansidecl.h )
5659        host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/$f"
5660        host_xm_include_list="${host_xm_include_list} $f"
5661        ;;
5662     auto-host.h )
5663        host_xm_file_list="${host_xm_file_list} $f"
5664        host_xm_include_list="${host_xm_include_list} $f"
5665        ;;
5666     * )
5667        host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f"
5668        host_xm_include_list="${host_xm_include_list} config/$f"
5669        ;;
5670   esac
5671 done
5672
5673 build_xm_file_list=
5674 for f in $build_xm_file; do
5675   case $f in
5676     ansidecl.h )
5677        build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/$f"
5678        build_xm_include_list="${build_xm_include_list} $f"
5679        ;;
5680     auto-build.h | auto-host.h )
5681        build_xm_file_list="${build_xm_file_list} $f"
5682        build_xm_include_list="${build_xm_include_list} $f"
5683        ;;
5684     * )
5685        build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f"
5686        build_xm_include_list="${build_xm_include_list} config/$f"
5687        ;;
5688   esac
5689 done
5690
5691 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
5692 # Also use all.cross instead of all.internal and adjust SYSTEM_HEADER_DIR.
5693 CROSS=                                          
5694 ALL=all.internal                                
5695 SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)' 
5696 if test x$host != x$target
5697 then
5698         CROSS="-DCROSS_COMPILE"
5699         ALL=all.cross
5700         SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
5701         case "$host","$target" in
5702         # Darwin crosses can use the host system's libraries and headers,
5703         # because of the fat library support.  Of course, it must be the
5704         # same version of Darwin on both sides.  Allow the user to
5705         # just say --target=foo-darwin without a version number to mean
5706         # "the version on this system".
5707             *-*-darwin*,*-*-darwin*)
5708                 hostos=`echo $host | sed 's/.*-darwin/darwin/'`
5709                 targetos=`echo $target | sed 's/.*-darwin/darwin/'`
5710                 if test $hostos = $targetos -o $targetos = darwin ; then
5711                     CROSS=
5712                     SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)'
5713                     with_headers=yes
5714                 fi
5715                 ;;
5716
5717             i?86-*-*,x86_64-*-* \
5718             | powerpc*-*-*,powerpc64*-*-*)
5719                 CROSS="$CROSS -DNATIVE_CROSS" ;;
5720         esac
5721 elif test "x$TARGET_SYSTEM_ROOT" != x; then
5722         # This is just $(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR)
5723         SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
5724 fi
5725
5726 # If this is a cross-compiler that does not
5727 # have its own set of headers then define
5728 # inhibit_libc
5729
5730 # If this is using newlib, without having the headers available now,
5731 # then define inhibit_libc in LIBGCC2_CFLAGS.
5732 # This prevents libgcc2 from containing any code which requires libc
5733 # support.
5734 inhibit_libc=
5735 if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
5736        test x$with_newlib = xyes ; } &&
5737      { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then
5738        inhibit_libc=-Dinhibit_libc
5739 fi
5740
5741
5742 # When building gcc with a cross-compiler, we need to adjust things so
5743 # that the generator programs are still built with the native compiler.
5744 # Also, we cannot run fixincludes or fix-header.
5745
5746 # These are the normal (build=host) settings:
5747 BUILD_PREFIX=                   
5748 BUILD_PREFIX_1=ignore-          
5749 CC_FOR_BUILD='$(CC)'            
5750 BUILD_CFLAGS='$(ALL_CFLAGS)'    
5751
5752 STMP_FIXINC=stmp-fixinc         
5753 STMP_FIXPROTO=stmp-fixproto     
5754
5755 # And these apply if build != host, or we are generating coverage data
5756 if test x$build != x$host || test "x$coverage_flags" != x
5757 then
5758     BUILD_PREFIX=build-
5759     BUILD_PREFIX_1=build-
5760     BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
5761
5762     if test "x$TARGET_SYSTEM_ROOT" = x; then
5763         STMP_FIXINC=
5764         STMP_FIXPROTO=
5765     fi
5766 fi
5767
5768 # Expand extra_headers to include complete path.
5769 # This substitutes for lots of t-* files.
5770 extra_headers_list=
5771 if test "x$extra_headers" = x
5772 then true
5773 else
5774         # Prepend ${srcdir}/config/${cpu_type}/ to every entry in extra_headers.
5775         for file in $extra_headers;
5776         do
5777                 extra_headers_list="${extra_headers_list} \$(srcdir)/config/${cpu_type}/${file}"
5778         done
5779 fi
5780
5781 # Add a definition of USE_COLLECT2 if system wants one.
5782 case $use_collect2 in
5783   no) use_collect2= ;;
5784   "") ;;
5785   *) 
5786     host_xm_defines="${host_xm_defines} USE_COLLECT2"
5787     xm_defines="${xm_defines} USE_COLLECT2"
5788     ;;
5789 esac
5790
5791 # Identify the assembler which will work hand-in-glove with the newly
5792 # built GCC, so that we can examine its features.  This is the assembler
5793 # which will be driven by the driver program.
5794 #
5795 # If build != host, and we aren't building gas in-tree, we identify a
5796 # build->target assembler and hope that it will have the same features
5797 # as the host->target assembler we'll be using.
5798 echo $ac_n "checking what assembler to use""... $ac_c" 1>&6
5799 echo "configure:5800: checking what assembler to use" >&5
5800 in_tree_gas=no
5801 gcc_cv_as=
5802 gcc_cv_gas_major_version=
5803 gcc_cv_gas_minor_version=
5804 gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
5805 if test -x "$DEFAULT_ASSEMBLER"; then
5806         gcc_cv_as="$DEFAULT_ASSEMBLER"
5807 elif test -x "$AS"; then
5808         gcc_cv_as="$AS"
5809 elif test -x as$host_exeext; then
5810         # Build using assembler in the current directory.
5811         gcc_cv_as=./as$host_exeext
5812 elif test -f $gcc_cv_as_gas_srcdir/configure.in \
5813      && test -f ../gas/Makefile; then
5814   # Single tree build which includes gas.
5815   in_tree_gas=yes
5816   gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
5817 for f in $gcc_cv_as_bfd_srcdir/configure \
5818          $gcc_cv_as_gas_srcdir/configure \
5819          $gcc_cv_as_gas_srcdir/configure.in \
5820          $gcc_cv_as_gas_srcdir/Makefile.in ; do
5821   gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
5822   if test x$gcc_cv_gas_version != x; then
5823     break
5824   fi
5825 done
5826 gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
5827 gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
5828 gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.[0-9]*\.\([0-9]*\)"`
5829 case $gcc_cv_gas_patch_version in
5830   "") gcc_cv_gas_patch_version="0" ;;
5831 esac
5832 gcc_cv_gas_vers=`expr \( \( $gcc_cv_gas_major_version \* 1000 \) \
5833                             + $gcc_cv_gas_minor_version \) \* 1000 \
5834                             + $gcc_cv_gas_patch_version`
5835
5836   rm -f as$host_exeext
5837   $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null
5838   in_tree_gas_is_elf=no
5839   if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
5840      || (grep 'obj_format = multi' ../gas/Makefile \
5841          && grep 'extra_objects =.* obj-elf' ../gas/Makefile) > /dev/null
5842   then
5843     in_tree_gas_is_elf=yes
5844   fi
5845 fi
5846
5847 if test "x$gcc_cv_as" = x; then
5848         # Search the same directories that the installed compiler will
5849         # search.  Else we may find the wrong assembler and lose.  If we
5850         # do not find a suitable assembler binary, then try the user's
5851         # path.
5852         #
5853         # Also note we have to check MD_EXEC_PREFIX before checking the
5854         # user's path.  Unfortunately, there is no good way to get at the
5855         # value of MD_EXEC_PREFIX here.  So we do a brute force search
5856         # through all the known MD_EXEC_PREFIX values.  Ugh.  This needs
5857         # to be fixed as part of the make/configure rewrite too.
5858
5859         if test "x$exec_prefix" = xNONE; then
5860                 if test "x$prefix" = xNONE; then
5861                         test_prefix=/usr/local
5862                 else
5863                         test_prefix=$prefix
5864                 fi
5865         else
5866                 test_prefix=$exec_prefix
5867         fi
5868
5869         # If the loop below does not find an assembler, then use whatever
5870         # one we can find in the users's path.
5871         # user's path.
5872         if test "x$program_prefix" != xNONE; then
5873                 gcc_cv_as=${program_prefix}as$host_exeext
5874         else
5875                 gcc_cv_as=`echo as | sed ${program_transform_name}`$host_exeext
5876         fi
5877
5878         test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
5879                    $test_prefix/lib/gcc-lib/$target_alias \
5880                    /usr/lib/gcc/$target_alias/$gcc_version \
5881                    /usr/lib/gcc/$target_alias \
5882                    $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
5883                    $test_prefix/$target_alias/bin"
5884
5885         if test x$host = x$target; then
5886             test_dirs="$test_dirs \
5887                    /usr/libexec \
5888                    /usr/ccs/gcc \
5889                    /usr/ccs/bin \
5890                    /udk/usr/ccs/bin \
5891                    /bsd43/usr/lib/cmplrs/cc \
5892                    /usr/cross64/usr/bin \
5893                    /usr/lib/cmplrs/cc \
5894                    /sysv/usr/lib/cmplrs/cc \
5895                    /svr4/usr/lib/cmplrs/cc \
5896                    /usr/bin"
5897         fi
5898
5899         for dir in $test_dirs; do
5900                 if test -x $dir/as$host_exeext; then
5901                         gcc_cv_as=$dir/as$host_exeext
5902                         break;
5903                 fi
5904         done
5905 fi
5906 case $in_tree_gas in
5907   yes)
5908     echo "$ac_t"""newly built gas"" 1>&6
5909     ;;
5910   no)
5911     echo "$ac_t""$gcc_cv_as" 1>&6
5912     ;;
5913 esac
5914
5915 # Identify the linker which will work hand-in-glove with the newly
5916 # built GCC, so that we can examine its features.  This is the linker
5917 # which will be driven by the driver program.
5918 #
5919 # If build != host, and we aren't building gas in-tree, we identify a
5920 # build->target linker and hope that it will have the same features
5921 # as the host->target linker we'll be using.
5922 echo $ac_n "checking what linker to use""... $ac_c" 1>&6
5923 echo "configure:5924: checking what linker to use" >&5
5924 in_tree_ld=no
5925 gcc_cv_ld=
5926 gcc_cv_gld_major_version=
5927 gcc_cv_gld_minor_version=
5928 gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/ld
5929 gcc_cv_ld_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
5930 if test -x "$DEFAULT_LINKER"; then
5931         gcc_cv_ld="$DEFAULT_LINKER"
5932 elif test -x "$LD"; then
5933         gcc_cv_ld="$LD"
5934 elif test -x collect-ld$host_exeext; then
5935         # Build using linker in the current directory.
5936         gcc_cv_ld=./collect-ld$host_exeext
5937 elif test -f $gcc_cv_ld_gld_srcdir/configure.in \
5938      && test -f ../ld/Makefile; then
5939         # Single tree build which includes ld.
5940         in_tree_ld=yes
5941         in_tree_ld_is_elf=no
5942         if (grep 'EMUL = .*elf' ../ld/Makefile \
5943             || grep 'EMUL = .*linux' ../ld/Makefile) > /dev/null; then
5944           in_tree_ld_is_elf=yes
5945         fi
5946         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
5947         do
5948                 gcc_cv_gld_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
5949                 if test x$gcc_cv_gld_version != x; then
5950                         break
5951                 fi
5952         done
5953         gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"`
5954         gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
5955         rm -f collect-ld$host_exeext
5956         $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext \
5957                 2>/dev/null
5958 fi
5959
5960 if test "x$gcc_cv_ld" = x; then
5961         # Search the same directories that the installed compiler will
5962         # search.  Else we may find the wrong linker and lose.  If we
5963         # do not find a suitable linker binary, then try the user's
5964         # path.
5965         #
5966         # Also note we have to check MD_EXEC_PREFIX before checking the
5967         # user's path.  Unfortunately, there is no good way to get at the
5968         # value of MD_EXEC_PREFIX here.  So we do a brute force search
5969         # through all the known MD_EXEC_PREFIX values.  Ugh.  This needs
5970         # to be fixed as part of the make/configure rewrite too.
5971
5972         if test "x$exec_prefix" = xNONE; then
5973                 if test "x$prefix" = xNONE; then
5974                         test_prefix=/usr/local
5975                 else
5976                         test_prefix=$prefix
5977                 fi
5978         else
5979                 test_prefix=$exec_prefix
5980         fi
5981
5982         # If the loop below does not find an linker, then use whatever
5983         # one we can find in the users's path.
5984         # user's path.
5985         if test "x$program_prefix" != xNONE; then
5986                 gcc_cv_ld=${program_prefix}ld$host_exeext
5987         else
5988                 gcc_cv_ld=`echo ld | sed ${program_transform_name}`$host_exeext
5989         fi
5990
5991         test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
5992                    $test_prefix/lib/gcc-lib/$target_alias \
5993                    /usr/lib/gcc/$target_alias/$gcc_version \
5994                    /usr/lib/gcc/$target_alias \
5995                    $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
5996                    $test_prefix/$target_alias/bin"
5997
5998         if test x$host = x$target; then
5999             test_dirs="$test_dirs \
6000                    /usr/libexec \
6001                    /usr/ccs/gcc \
6002                    /usr/ccs/bin \
6003                    /udk/usr/ccs/bin \
6004                    /bsd43/usr/lib/cmplrs/cc \
6005                    /usr/cross64/usr/bin \
6006                    /usr/lib/cmplrs/cc \
6007                    /sysv/usr/lib/cmplrs/cc \
6008                    /svr4/usr/lib/cmplrs/cc \
6009                    /usr/bin"
6010         fi
6011
6012         for dir in $test_dirs; do
6013                 if test -x $dir/ld$host_exeext; then
6014                         gcc_cv_ld=$dir/ld$host_exeext
6015                         break;
6016                 fi
6017         done
6018 fi
6019 case $in_tree_ld in
6020   yes)
6021     echo "$ac_t"""newly built ld"" 1>&6
6022     ;;
6023   no)
6024     echo "$ac_t""$gcc_cv_ld" 1>&6
6025     ;;
6026 esac
6027
6028 # Figure out what nm we will be using.
6029 gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils
6030 echo $ac_n "checking what nm to use""... $ac_c" 1>&6
6031 echo "configure:6032: checking what nm to use" >&5
6032 in_tree_nm=no
6033 if test -x nm$host_exeext; then
6034         gcc_cv_nm=./nm$host_exeext
6035 elif test -f $gcc_cv_binutils_srcdir/configure.in \
6036      && test -f ../binutils/Makefile; then
6037         # Single tree build which includes binutils.
6038         in_tree_nm=yes
6039         gcc_cv_nm=./nm$host_exeext
6040         rm -f nm$host_exeext
6041         $symbolic_link ../binutils/nm-new$host_exeext nm$host_exeext 2>/dev/null
6042 elif test "x$program_prefix" != xNONE; then
6043         gcc_cv_nm=${program_prefix}nm$host_exeext
6044 else
6045         gcc_cv_nm=`echo nm | sed ${program_transform_name}`$host_exeext
6046 fi
6047 case $in_tree_nm in
6048   yes) echo "$ac_t"""newly built nm"" 1>&6 ;;
6049   no)  echo "$ac_t""$gcc_cv_nm" 1>&6 ;;
6050 esac
6051
6052 # Figure out what objdump we will be using.
6053 echo $ac_n "checking what objdump to use""... $ac_c" 1>&6
6054 echo "configure:6055: checking what objdump to use" >&5
6055 in_tree_objdump=no
6056 if test -x objdump$host_exeext; then
6057         gcc_cv_objdump=./objdump$host_exeext
6058 elif test -f $gcc_cv_binutils_srcdir/configure.in \
6059      && test -f ../binutils/Makefile; then
6060         # Single tree build which includes binutils.
6061         in_tree_objdump=yes
6062         gcc_cv_objdump=./objdump$host_exeext
6063         rm -f objdump$host_exeext
6064         $symbolic_link ../binutils/objdump$host_exeext \
6065                 objdump$host_exeext 2>/dev/null
6066 elif test "x$program_prefix" != xNONE; then
6067         gcc_cv_objdump=${program_prefix}objdump$host_exeext
6068 else
6069         gcc_cv_objdump=`echo objdump | \
6070                 sed ${program_transform_name}`$host_exeext
6071 fi
6072 case $in_tree_objdump in
6073   yes) echo "$ac_t"""newly built objdump"" 1>&6 ;;
6074   no)  echo "$ac_t""$gcc_cv_objdump" 1>&6 ;;
6075 esac
6076
6077 # Figure out what assembler alignment features are present.
6078 echo $ac_n "checking assembler for .balign and .p2align""... $ac_c" 1>&6
6079 echo "configure:6080: checking assembler for .balign and .p2align" >&5
6080 if eval "test \"`echo '$''{'gcc_cv_as_balign_and_p2align'+set}'`\" = set"; then
6081   echo $ac_n "(cached) $ac_c" 1>&6
6082 else
6083   gcc_cv_as_balign_and_p2align=no
6084     if test $in_tree_gas = yes; then
6085     if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 6 \) \* 1000 + 0`
6086   then gcc_cv_as_balign_and_p2align=yes
6087 fi
6088   elif test x$gcc_cv_as != x; then
6089     echo '.balign 4
6090 .p2align 2' > conftest.s
6091     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:6092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6092     then
6093         gcc_cv_as_balign_and_p2align=yes
6094     else
6095       echo "configure: failed program was" >&5
6096       cat conftest.s >&5
6097     fi
6098     rm -f conftest.o conftest.s
6099   fi
6100 fi
6101
6102 echo "$ac_t""$gcc_cv_as_balign_and_p2align" 1>&6
6103 if test $gcc_cv_as_balign_and_p2align = yes; then
6104   cat >> confdefs.h <<\EOF
6105 #define HAVE_GAS_BALIGN_AND_P2ALIGN 1
6106 EOF
6107
6108 fi
6109
6110 echo $ac_n "checking assembler for .p2align with maximum skip""... $ac_c" 1>&6
6111 echo "configure:6112: checking assembler for .p2align with maximum skip" >&5
6112 if eval "test \"`echo '$''{'gcc_cv_as_max_skip_p2align'+set}'`\" = set"; then
6113   echo $ac_n "(cached) $ac_c" 1>&6
6114 else
6115   gcc_cv_as_max_skip_p2align=no
6116     if test $in_tree_gas = yes; then
6117     if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 8 \) \* 1000 + 0`
6118   then gcc_cv_as_max_skip_p2align=yes
6119 fi
6120   elif test x$gcc_cv_as != x; then
6121     echo '.p2align 4,,7' > conftest.s
6122     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:6123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6123     then
6124         gcc_cv_as_max_skip_p2align=yes
6125     else
6126       echo "configure: failed program was" >&5
6127       cat conftest.s >&5
6128     fi
6129     rm -f conftest.o conftest.s
6130   fi
6131 fi
6132
6133 echo "$ac_t""$gcc_cv_as_max_skip_p2align" 1>&6
6134 if test $gcc_cv_as_max_skip_p2align = yes; then
6135   cat >> confdefs.h <<\EOF
6136 #define HAVE_GAS_MAX_SKIP_P2ALIGN 1
6137 EOF
6138
6139 fi
6140
6141 echo $ac_n "checking assembler for working .subsection -1""... $ac_c" 1>&6
6142 echo "configure:6143: checking assembler for working .subsection -1" >&5
6143 if eval "test \"`echo '$''{'gcc_cv_as_subsection_m1'+set}'`\" = set"; then
6144   echo $ac_n "(cached) $ac_c" 1>&6
6145 else
6146   gcc_cv_as_subsection_m1=no
6147     if test $in_tree_gas = yes; then
6148     if test $in_tree_gas_is_elf = yes \
6149   && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 9 \) \* 1000 + 0`
6150   then gcc_cv_as_subsection_m1=yes
6151 fi
6152   elif test x$gcc_cv_as != x; then
6153     echo 'conftest_label1: .word 0
6154 .subsection -1
6155 conftest_label2: .word 0
6156 .previous' > conftest.s
6157     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:6158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6158     then
6159         if test x$gcc_cv_nm != x; then
6160     $gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1
6161     $gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2
6162     if cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1
6163     then :
6164     else gcc_cv_as_subsection_m1=yes
6165     fi
6166     rm -f conftest.nm1 conftest.nm2
6167   fi
6168     else
6169       echo "configure: failed program was" >&5
6170       cat conftest.s >&5
6171     fi
6172     rm -f conftest.o conftest.s
6173   fi
6174 fi
6175
6176 echo "$ac_t""$gcc_cv_as_subsection_m1" 1>&6
6177 if test $gcc_cv_as_subsection_m1 = yes; then
6178   cat >> confdefs.h <<\EOF
6179 #define HAVE_GAS_SUBSECTION_ORDERING 1
6180 EOF
6181
6182 fi
6183
6184 echo $ac_n "checking assembler for .weak""... $ac_c" 1>&6
6185 echo "configure:6186: checking assembler for .weak" >&5
6186 if eval "test \"`echo '$''{'gcc_cv_as_weak'+set}'`\" = set"; then
6187   echo $ac_n "(cached) $ac_c" 1>&6
6188 else
6189   gcc_cv_as_weak=no
6190     if test $in_tree_gas = yes; then
6191     if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 2 \) \* 1000 + 0`
6192   then gcc_cv_as_weak=yes
6193 fi
6194   elif test x$gcc_cv_as != x; then
6195     echo '      .weak foobar' > conftest.s
6196     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:6197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6197     then
6198         gcc_cv_as_weak=yes
6199     else
6200       echo "configure: failed program was" >&5
6201       cat conftest.s >&5
6202     fi
6203     rm -f conftest.o conftest.s
6204   fi
6205 fi
6206
6207 echo "$ac_t""$gcc_cv_as_weak" 1>&6
6208 if test $gcc_cv_as_weak = yes; then
6209   cat >> confdefs.h <<\EOF
6210 #define HAVE_GAS_WEAK 1
6211 EOF
6212
6213 fi
6214
6215 # .hidden needs to be supported in both the assembler and the linker,
6216 # because GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN.
6217 # This is irritatingly difficult to feature test for; we have to check the
6218 # date string after the version number.  If we've got an in-tree
6219 # ld, we don't know its patchlevel version, so we set the baseline at 2.13
6220 # to be safe.
6221 # The gcc_GAS_CHECK_FEATURE call just sets a cache variable.
6222 echo $ac_n "checking assembler for .hidden""... $ac_c" 1>&6
6223 echo "configure:6224: checking assembler for .hidden" >&5
6224 if eval "test \"`echo '$''{'gcc_cv_as_hidden'+set}'`\" = set"; then
6225   echo $ac_n "(cached) $ac_c" 1>&6
6226 else
6227   gcc_cv_as_hidden=no
6228     if test $in_tree_gas = yes; then
6229     if test $in_tree_gas_is_elf = yes \
6230   && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 13 \) \* 1000 + 0`
6231   then gcc_cv_as_hidden=yes
6232 fi
6233   elif test x$gcc_cv_as != x; then
6234     echo '      .hidden foobar
6235 foobar:' > conftest.s
6236     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:6237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6237     then
6238         gcc_cv_as_hidden=yes
6239     else
6240       echo "configure: failed program was" >&5
6241       cat conftest.s >&5
6242     fi
6243     rm -f conftest.o conftest.s
6244   fi
6245 fi
6246
6247 echo "$ac_t""$gcc_cv_as_hidden" 1>&6
6248
6249
6250 echo $ac_n "checking linker for .hidden support""... $ac_c" 1>&6
6251 echo "configure:6252: checking linker for .hidden support" >&5
6252 if eval "test \"`echo '$''{'gcc_cv_ld_hidden'+set}'`\" = set"; then
6253   echo $ac_n "(cached) $ac_c" 1>&6
6254 else
6255   if test $in_tree_ld = yes ; then
6256   gcc_cv_ld_hidden=no
6257   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 \
6258      && test $in_tree_ld_is_elf = yes; then
6259      gcc_cv_ld_hidden=yes
6260   fi
6261 else
6262   gcc_cv_ld_hidden=yes
6263   ld_ver=`$gcc_cv_ld --version 2>/dev/null | sed 1q`
6264   if echo "$ld_ver" | grep GNU > /dev/null; then
6265     ld_vers=`echo $ld_ver | sed -n \
6266         -e 's,^.*[       ]\([0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
6267         -e 's,^.*[       ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
6268         -e 's,^.*[       ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
6269         -e 's,^.*[       ]\([0-9][0-9]*\.[0-9][0-9]*\)[  ].*$,\1,p' \
6270         -e 's,^.*[       ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[     ].*$,\1,p' \
6271         -e 's,^.*[       ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[        ].*$,\1,p'`
6272     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'`
6273     if test 0"$ld_date" -lt 20020404; then
6274       if test -n "$ld_date"; then
6275         # If there was date string, but was earlier than 2002-04-04, fail
6276         gcc_cv_ld_hidden=no
6277       elif test -z "$ld_vers"; then
6278         # If there was no date string nor ld version number, something is wrong
6279         gcc_cv_ld_hidden=no
6280       else
6281         ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
6282         ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
6283         ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
6284         test -z "$ld_vers_patch" && ld_vers_patch=0
6285         if test "$ld_vers_major" -lt 2; then
6286           gcc_cv_ld_hidden=no
6287         elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 12; then
6288           gcc_cv_ld_hidden="no"
6289         elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -eq 12 -a "$ld_vers_patch" -eq 0; then
6290           gcc_cv_ld_hidden=no
6291         fi
6292       fi
6293     fi
6294   else
6295     # non-GNU linkers don't seem to support .hidden yet
6296     if test x"$gnu_ld_flag" = x"no"; then
6297       gcc_cv_ld_hidden=no
6298     fi
6299   fi
6300 fi
6301 fi
6302
6303 echo "$ac_t""$gcc_cv_ld_hidden" 1>&6
6304 libgcc_visibility=no
6305
6306 if test $gcc_cv_as_hidden = yes && test $gcc_cv_ld_hidden = yes; then
6307   libgcc_visibility=yes
6308   cat >> confdefs.h <<\EOF
6309 #define HAVE_GAS_HIDDEN 1
6310 EOF
6311
6312 fi
6313
6314 # Check if we have .[us]leb128, and support symbol arithmetic with it.
6315 echo $ac_n "checking assembler for .sleb128 and .uleb128""... $ac_c" 1>&6
6316 echo "configure:6317: checking assembler for .sleb128 and .uleb128" >&5
6317 if eval "test \"`echo '$''{'gcc_cv_as_leb128'+set}'`\" = set"; then
6318   echo $ac_n "(cached) $ac_c" 1>&6
6319 else
6320   gcc_cv_as_leb128=no
6321     if test $in_tree_gas = yes; then
6322     if test $in_tree_gas_is_elf = yes \
6323   && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
6324   then gcc_cv_as_leb128=yes
6325 fi
6326   elif test x$gcc_cv_as != x; then
6327     echo '      .data
6328         .uleb128 L2 - L1
6329 L1:
6330         .uleb128 1280
6331         .sleb128 -1010
6332 L2:' > conftest.s
6333     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:6334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6334     then
6335         # GAS versions before 2.11 do not support uleb128,
6336   # despite appearing to.
6337   # ??? There exists an elf-specific test that will crash
6338   # the assembler.  Perhaps it's better to figure out whether
6339   # arbitrary sections are supported and try the test.
6340   as_ver=`$gcc_cv_as --version 2>/dev/null | sed 1q`
6341   if echo "$as_ver" | grep GNU > /dev/null; then
6342     as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
6343     as_major=`echo $as_ver | sed 's/\..*//'`
6344     as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
6345     if test $as_major -eq 2 && test $as_minor -lt 11
6346     then :
6347     else gcc_cv_as_leb128=yes
6348     fi
6349   fi
6350     else
6351       echo "configure: failed program was" >&5
6352       cat conftest.s >&5
6353     fi
6354     rm -f conftest.o conftest.s
6355   fi
6356 fi
6357
6358 echo "$ac_t""$gcc_cv_as_leb128" 1>&6
6359 if test $gcc_cv_as_leb128 = yes; then
6360   cat >> confdefs.h <<\EOF
6361 #define HAVE_AS_LEB128 1
6362 EOF
6363
6364 fi
6365
6366 # GAS versions up to and including 2.11.0 may mis-optimize
6367 # .eh_frame data.
6368 echo $ac_n "checking assembler for eh_frame optimization""... $ac_c" 1>&6
6369 echo "configure:6370: checking assembler for eh_frame optimization" >&5
6370 if eval "test \"`echo '$''{'gcc_cv_as_eh_frame'+set}'`\" = set"; then
6371   echo $ac_n "(cached) $ac_c" 1>&6
6372 else
6373   gcc_cv_as_eh_frame=no
6374     if test $in_tree_gas = yes; then
6375     if test $in_tree_gas_is_elf = yes \
6376   && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 12 \) \* 1000 + 0`
6377   then gcc_cv_as_eh_frame=yes
6378 fi
6379   elif test x$gcc_cv_as != x; then
6380     echo '      .text
6381 .LFB1:
6382         .4byte  0
6383 .L1:
6384         .4byte  0
6385 .LFE1:
6386         .section        .eh_frame,"aw",@progbits
6387 __FRAME_BEGIN__:
6388         .4byte  .LECIE1-.LSCIE1
6389 .LSCIE1:
6390         .4byte  0x0
6391         .byte   0x1
6392         .ascii "z\0"
6393         .byte   0x1
6394         .byte   0x78
6395         .byte   0x1a
6396         .byte   0x0
6397         .byte   0x4
6398         .4byte  1
6399         .p2align 1
6400 .LECIE1:
6401 .LSFDE1:
6402         .4byte  .LEFDE1-.LASFDE1
6403 .LASFDE1:
6404         .4byte  .LASFDE1-__FRAME_BEGIN__
6405         .4byte  .LFB1
6406         .4byte  .LFE1-.LFB1
6407         .byte   0x4
6408         .4byte  .LFE1-.LFB1
6409         .byte   0x4
6410         .4byte  .L1-.LFB1
6411 .LEFDE1:' > conftest.s
6412     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:6413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6413     then
6414           cat > conftest.lit <<EOF
6415  0000 10000000 00000000 017a0001 781a0004  .........z..x...
6416  0010 01000000 12000000 18000000 00000000  ................
6417  0020 08000000 04080000 0044               .........D      
6418 EOF
6419   cat > conftest.big <<EOF
6420  0000 00000010 00000000 017a0001 781a0004  .........z..x...
6421  0010 00000001 00000012 00000018 00000000  ................
6422  0020 00000008 04000000 0844               .........D      
6423 EOF
6424   # If the assembler didn't choke, and we can objdump,
6425   # and we got the correct data, then succeed.
6426   if test x$gcc_cv_objdump != x \
6427   && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
6428      | tail -3 > conftest.got \
6429   && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
6430     || cmp conftest.big conftest.got > /dev/null 2>&1; }
6431   then
6432     gcc_cv_as_eh_frame=yes
6433   elif { ac_try='$gcc_cv_as -o conftest.o --traditional-format /dev/null'; { (eval echo configure:6434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
6434     gcc_cv_as_eh_frame=buggy
6435   else
6436     # Uh oh, what do we do now?
6437     gcc_cv_as_eh_frame=no
6438   fi
6439     else
6440       echo "configure: failed program was" >&5
6441       cat conftest.s >&5
6442     fi
6443     rm -f conftest.o conftest.s
6444   fi
6445 fi
6446
6447 echo "$ac_t""$gcc_cv_as_eh_frame" 1>&6
6448
6449
6450 if test $gcc_cv_as_eh_frame = buggy; then
6451   cat >> confdefs.h <<\EOF
6452 #define USE_AS_TRADITIONAL_FORMAT 1
6453 EOF
6454
6455 fi
6456
6457 echo $ac_n "checking assembler for section merging support""... $ac_c" 1>&6
6458 echo "configure:6459: checking assembler for section merging support" >&5
6459 if eval "test \"`echo '$''{'gcc_cv_as_shf_merge'+set}'`\" = set"; then
6460   echo $ac_n "(cached) $ac_c" 1>&6
6461 else
6462   gcc_cv_as_shf_merge=no
6463     if test $in_tree_gas = yes; then
6464     if test $in_tree_gas_is_elf = yes \
6465   && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 12 \) \* 1000 + 0`
6466   then gcc_cv_as_shf_merge=yes
6467 fi
6468   elif test x$gcc_cv_as != x; then
6469     echo '.section .rodata.str, "aMS", @progbits, 1' > conftest.s
6470     if { ac_try='$gcc_cv_as --fatal-warnings -o conftest.o conftest.s >&5'; { (eval echo configure:6471: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6471     then
6472         gcc_cv_as_shf_merge=yes
6473     else
6474       echo "configure: failed program was" >&5
6475       cat conftest.s >&5
6476     fi
6477     rm -f conftest.o conftest.s
6478   fi
6479 fi
6480
6481 echo "$ac_t""$gcc_cv_as_shf_merge" 1>&6
6482 if test $gcc_cv_as_shf_merge = yes; then
6483   cat >> confdefs.h <<\EOF
6484 #define HAVE_GAS_SHF_MERGE 1
6485 EOF
6486
6487 fi
6488
6489 # Thread-local storage - the check is heavily parametrized.
6490 conftest_s=
6491 tls_first_major=
6492 tls_first_minor=
6493 tls_as_opt=
6494 case "$target" in
6495   alpha*-*-*)
6496     conftest_s='
6497         .section ".tdata","awT",@progbits
6498 foo:    .long   25
6499         .text
6500         ldq     $27,__tls_get_addr($29)         !literal!1
6501         lda     $16,foo($29)                    !tlsgd!1
6502         jsr     $26,($27),__tls_get_addr        !lituse_tlsgd!1
6503         ldq     $27,__tls_get_addr($29)         !literal!2
6504         lda     $16,foo($29)                    !tlsldm!2
6505         jsr     $26,($27),__tls_get_addr        !lituse_tlsldm!2
6506         ldq     $1,foo($29)                     !gotdtprel
6507         ldah    $2,foo($29)                     !dtprelhi
6508         lda     $3,foo($2)                      !dtprello
6509         lda     $4,foo($29)                     !dtprel
6510         ldq     $1,foo($29)                     !gottprel
6511         ldah    $2,foo($29)                     !tprelhi
6512         lda     $3,foo($2)                      !tprello
6513         lda     $4,foo($29)                     !tprel'
6514         tls_first_major=2
6515         tls_first_minor=13
6516         ;;
6517   i[34567]86-*-*)
6518     conftest_s='
6519         .section ".tdata","awT",@progbits
6520 foo:    .long   25
6521         .text
6522         movl    %gs:0, %eax
6523         leal    foo@TLSGD(,%ebx,1), %eax
6524         leal    foo@TLSLDM(%ebx), %eax
6525         leal    foo@DTPOFF(%eax), %edx
6526         movl    foo@GOTTPOFF(%ebx), %eax
6527         subl    foo@GOTTPOFF(%ebx), %eax
6528         addl    foo@GOTNTPOFF(%ebx), %eax
6529         movl    foo@INDNTPOFF, %eax
6530         movl    $foo@TPOFF, %eax
6531         subl    $foo@TPOFF, %eax
6532         leal    foo@NTPOFF(%ecx), %eax'
6533         tls_first_major=2
6534         tls_first_minor=14
6535         ;;
6536   x86_64-*-*)
6537     conftest_s='
6538         .section ".tdata","awT",@progbits
6539 foo:    .long   25
6540         .text
6541         movq    %fs:0, %rax
6542         leaq    foo@TLSGD(%rip), %rdi
6543         leaq    foo@TLSLD(%rip), %rdi
6544         leaq    foo@DTPOFF(%rax), %rdx
6545         movq    foo@GOTTPOFF(%rip), %rax
6546         movq    $foo@TPOFF, %rax'
6547         tls_first_major=2
6548         tls_first_minor=14
6549         ;;
6550   ia64-*-*)
6551     conftest_s='
6552         .section ".tdata","awT",@progbits
6553 foo:    data8   25
6554         .text
6555         addl    r16 = @ltoff(@dtpmod(foo#)), gp
6556         addl    r17 = @ltoff(@dtprel(foo#)), gp
6557         addl    r18 = @ltoff(@tprel(foo#)), gp
6558         addl    r19 = @dtprel(foo#), gp
6559         adds    r21 = @dtprel(foo#), r13
6560         movl    r23 = @dtprel(foo#)
6561         addl    r20 = @tprel(foo#), gp
6562         adds    r22 = @tprel(foo#), r13
6563         movl    r24 = @tprel(foo#)'
6564         tls_first_major=2
6565         tls_first_minor=13
6566         ;;
6567   powerpc-*-*)
6568     conftest_s='
6569         .section ".tdata","awT",@progbits
6570         .align 2
6571 ld0:    .space 4
6572 ld1:    .space 4
6573 x1:     .space 4
6574 x2:     .space 4
6575 x3:     .space 4
6576         .text
6577         addi 3,31,ld0@got@tlsgd
6578         bl __tls_get_addr
6579         addi 3,31,x1@got@tlsld
6580         bl __tls_get_addr
6581         addi 9,3,x1@dtprel
6582         addis 9,3,x2@dtprel@ha
6583         addi 9,9,x2@dtprel@l
6584         lwz 9,x3@got@tprel(31)
6585         add 9,9,x@tls
6586         addi 9,2,x1@tprel
6587         addis 9,2,x2@tprel@ha
6588         addi 9,9,x2@tprel@l'
6589         tls_first_major=2
6590         tls_first_minor=14
6591         tls_as_opt=-a32
6592         ;;
6593   powerpc64-*-*)
6594     conftest_s='
6595         .section ".tdata","awT",@progbits
6596         .align 3
6597 ld0:    .space 8
6598 ld1:    .space 8
6599 x1:     .space 8
6600 x2:     .space 8
6601 x3:     .space 8
6602         .text
6603         addi 3,2,ld0@got@tlsgd
6604         bl .__tls_get_addr
6605         nop
6606         addi 3,2,ld1@toc
6607         bl .__tls_get_addr
6608         nop
6609         addi 3,2,x1@got@tlsld
6610         bl .__tls_get_addr
6611         nop
6612         addi 9,3,x1@dtprel
6613         bl .__tls_get_addr
6614         nop
6615         addis 9,3,x2@dtprel@ha
6616         addi 9,9,x2@dtprel@l
6617         bl .__tls_get_addr
6618         nop
6619         ld 9,x3@got@dtprel(2)
6620         add 9,9,3
6621         bl .__tls_get_addr
6622         nop'
6623         tls_first_major=2
6624         tls_first_minor=14
6625         tls_as_opt=-a64
6626         ;;
6627   s390-*-*)
6628     conftest_s='
6629         .section ".tdata","awT",@progbits
6630 foo:    .long   25
6631         .text
6632         .long   foo@TLSGD
6633         .long   foo@TLSLDM
6634         .long   foo@DTPOFF
6635         .long   foo@NTPOFF
6636         .long   foo@GOTNTPOFF
6637         .long   foo@INDNTPOFF
6638         l       %r1,foo@GOTNTPOFF(%r12)
6639         l       %r1,0(%r1):tls_load:foo
6640         bas     %r14,0(%r1,%r13):tls_gdcall:foo
6641         bas     %r14,0(%r1,%r13):tls_ldcall:foo'
6642         tls_first_major=2
6643         tls_first_minor=14
6644         tls_as_opt=-m31
6645         ;;
6646   s390x-*-*)
6647     conftest_s='
6648         .section ".tdata","awT",@progbits
6649 foo:    .long   25
6650         .text
6651         .quad   foo@TLSGD
6652         .quad   foo@TLSLDM
6653         .quad   foo@DTPOFF
6654         .quad   foo@NTPOFF
6655         .quad   foo@GOTNTPOFF
6656         lg      %r1,foo@GOTNTPOFF(%r12)
6657         larl    %r1,foo@INDNTPOFF
6658         brasl   %r14,__tls_get_offset@PLT:tls_gdcall:foo
6659         brasl   %r14,__tls_get_offset@PLT:tls_ldcall:foo'
6660         tls_first_major=2
6661         tls_first_minor=14
6662         tls_as_opt="-m64 -Aesame"
6663         ;;
6664   sparc*-*-*)
6665     conftest_s='
6666         .section ".tdata","awT",@progbits
6667 foo:    .long   25
6668         .text
6669         sethi   %tgd_hi22(foo), %o0
6670         add     %o0, %tgd_lo10(foo), %o1
6671         add     %l7, %o1, %o0, %tgd_add(foo)
6672         call    __tls_get_addr, %tgd_call(foo)
6673         sethi   %tldm_hi22(foo), %l1
6674         add     %l1, %tldm_lo10(foo), %l2
6675         add     %l7, %l2, %o0, %tldm_add(foo)
6676         call    __tls_get_addr, %tldm_call(foo)
6677         sethi   %tldo_hix22(foo), %l3
6678         xor     %l3, %tldo_lox10(foo), %l4
6679         add     %o0, %l4, %l5, %tldo_add(foo)
6680         sethi   %tie_hi22(foo), %o3
6681         add     %o3, %tie_lo10(foo), %o3
6682         ld      [%l7 + %o3], %o2, %tie_ld(foo)
6683         add     %g7, %o2, %o4, %tie_add(foo)
6684         sethi   %tle_hix22(foo), %l1
6685         xor     %l1, %tle_lox10(foo), %o5
6686         ld      [%g7 + %o5], %o1'
6687         tls_first_major=2
6688         tls_first_minor=14
6689         tls_as_opt=-32
6690         ;;
6691 esac
6692 if test -z "$tls_first_major"; then
6693   : # If we don't have a check, assume no support.
6694 else
6695   echo $ac_n "checking assembler for thread-local storage support""... $ac_c" 1>&6
6696 echo "configure:6697: checking assembler for thread-local storage support" >&5
6697 if eval "test \"`echo '$''{'gcc_cv_as_tls'+set}'`\" = set"; then
6698   echo $ac_n "(cached) $ac_c" 1>&6
6699 else
6700   gcc_cv_as_tls=no
6701     if test $in_tree_gas = yes; then
6702     if test $gcc_cv_gas_vers -ge `expr \( \( $tls_first_major \* 1000 \) + $tls_first_minor \) \* 1000 + 0`
6703   then gcc_cv_as_tls=yes
6704 fi
6705   elif test x$gcc_cv_as != x; then
6706     echo "$conftest_s" > conftest.s
6707     if { ac_try='$gcc_cv_as $tls_as_opt --fatal-warnings -o conftest.o conftest.s >&5'; { (eval echo configure:6708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6708     then
6709         gcc_cv_as_tls=yes
6710     else
6711       echo "configure: failed program was" >&5
6712       cat conftest.s >&5
6713     fi
6714     rm -f conftest.o conftest.s
6715   fi
6716 fi
6717
6718 echo "$ac_t""$gcc_cv_as_tls" 1>&6
6719 if test $gcc_cv_as_tls = yes; then
6720   cat >> confdefs.h <<\EOF
6721 #define HAVE_AS_TLS 1
6722 EOF
6723
6724 fi
6725 fi
6726
6727 # Target-specific assembler checks.
6728
6729 case "$target" in
6730   # All TARGET_ABI_OSF targets.
6731   alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
6732     echo $ac_n "checking assembler for explicit relocation support""... $ac_c" 1>&6
6733 echo "configure:6734: checking assembler for explicit relocation support" >&5
6734 if eval "test \"`echo '$''{'gcc_cv_as_alpha_explicit_relocs'+set}'`\" = set"; then
6735   echo $ac_n "(cached) $ac_c" 1>&6
6736 else
6737   gcc_cv_as_alpha_explicit_relocs=no
6738     if test $in_tree_gas = yes; then
6739     if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 12 \) \* 1000 + 0`
6740   then gcc_cv_as_alpha_explicit_relocs=yes
6741 fi
6742   elif test x$gcc_cv_as != x; then
6743     echo '      .set nomacro
6744         .text
6745         extbl   $3, $2, $3      !lituse_bytoff!1
6746         ldq     $2, a($29)      !literal!1
6747         ldq     $4, b($29)      !literal!2
6748         ldq_u   $3, 0($2)       !lituse_base!1
6749         ldq     $27, f($29)     !literal!5
6750         jsr     $26, ($27), f   !lituse_jsr!5
6751         ldah    $29, 0($26)     !gpdisp!3
6752         lda     $0, c($29)      !gprel
6753         ldah    $1, d($29)      !gprelhigh
6754         lda     $1, d($1)       !gprellow
6755         lda     $29, 0($29)     !gpdisp!3' > conftest.s
6756     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:6757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6757     then
6758         gcc_cv_as_alpha_explicit_relocs=yes
6759     else
6760       echo "configure: failed program was" >&5
6761       cat conftest.s >&5
6762     fi
6763     rm -f conftest.o conftest.s
6764   fi
6765 fi
6766
6767 echo "$ac_t""$gcc_cv_as_alpha_explicit_relocs" 1>&6
6768 if test $gcc_cv_as_alpha_explicit_relocs = yes; then
6769   cat >> confdefs.h <<\EOF
6770 #define HAVE_AS_EXPLICIT_RELOCS 1
6771 EOF
6772
6773 fi
6774     ;;
6775
6776   sparc*-*-*)
6777     echo $ac_n "checking assembler for .register""... $ac_c" 1>&6
6778 echo "configure:6779: checking assembler for .register" >&5
6779 if eval "test \"`echo '$''{'gcc_cv_as_sparc_register_op'+set}'`\" = set"; then
6780   echo $ac_n "(cached) $ac_c" 1>&6
6781 else
6782   gcc_cv_as_sparc_register_op=no
6783   if test x$gcc_cv_as != x; then
6784     echo '.register %g2, #scratch' > conftest.s
6785     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:6786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6786     then
6787         gcc_cv_as_sparc_register_op=yes
6788     else
6789       echo "configure: failed program was" >&5
6790       cat conftest.s >&5
6791     fi
6792     rm -f conftest.o conftest.s
6793   fi
6794 fi
6795
6796 echo "$ac_t""$gcc_cv_as_sparc_register_op" 1>&6
6797 if test $gcc_cv_as_sparc_register_op = yes; then
6798   cat >> confdefs.h <<\EOF
6799 #define HAVE_AS_REGISTER_PSEUDO_OP 1
6800 EOF
6801
6802 fi
6803
6804     echo $ac_n "checking assembler for -relax option""... $ac_c" 1>&6
6805 echo "configure:6806: checking assembler for -relax option" >&5
6806 if eval "test \"`echo '$''{'gcc_cv_as_sparc_relax'+set}'`\" = set"; then
6807   echo $ac_n "(cached) $ac_c" 1>&6
6808 else
6809   gcc_cv_as_sparc_relax=no
6810   if test x$gcc_cv_as != x; then
6811     echo '.text' > conftest.s
6812     if { ac_try='$gcc_cv_as -relax -o conftest.o conftest.s >&5'; { (eval echo configure:6813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6813     then
6814         gcc_cv_as_sparc_relax=yes
6815     else
6816       echo "configure: failed program was" >&5
6817       cat conftest.s >&5
6818     fi
6819     rm -f conftest.o conftest.s
6820   fi
6821 fi
6822
6823 echo "$ac_t""$gcc_cv_as_sparc_relax" 1>&6
6824 if test $gcc_cv_as_sparc_relax = yes; then
6825   cat >> confdefs.h <<\EOF
6826 #define HAVE_AS_RELAX_OPTION 1
6827 EOF
6828
6829 fi
6830
6831     echo $ac_n "checking assembler for unaligned pcrel relocs""... $ac_c" 1>&6
6832 echo "configure:6833: checking assembler for unaligned pcrel relocs" >&5
6833 if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then
6834   echo $ac_n "(cached) $ac_c" 1>&6
6835 else
6836   gcc_cv_as_sparc_ua_pcrel=no
6837   if test x$gcc_cv_as != x; then
6838     echo '.text
6839 foo:
6840         nop
6841 .data
6842 .align 4
6843 .byte 0
6844 .uaword %r_disp32(foo)' > conftest.s
6845     if { ac_try='$gcc_cv_as -K PIC -o conftest.o conftest.s >&5'; { (eval echo configure:6846: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6846     then
6847         if test x$gcc_cv_ld != x \
6848        && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
6849          gcc_cv_as_sparc_ua_pcrel=yes
6850        fi
6851        rm -f conftest
6852     else
6853       echo "configure: failed program was" >&5
6854       cat conftest.s >&5
6855     fi
6856     rm -f conftest.o conftest.s
6857   fi
6858 fi
6859
6860 echo "$ac_t""$gcc_cv_as_sparc_ua_pcrel" 1>&6
6861 if test $gcc_cv_as_sparc_ua_pcrel = yes; then
6862   cat >> confdefs.h <<\EOF
6863 #define HAVE_AS_SPARC_UA_PCREL 1
6864 EOF
6865
6866
6867       echo $ac_n "checking assembler for unaligned pcrel relocs against hidden symbols""... $ac_c" 1>&6
6868 echo "configure:6869: checking assembler for unaligned pcrel relocs against hidden symbols" >&5
6869 if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel_hidden'+set}'`\" = set"; then
6870   echo $ac_n "(cached) $ac_c" 1>&6
6871 else
6872   gcc_cv_as_sparc_ua_pcrel_hidden=no
6873   if test x$gcc_cv_as != x; then
6874     echo '.data
6875 .align 4
6876 .byte 0x31
6877 .uaword %r_disp32(foo)
6878 .byte 0x32, 0x33, 0x34
6879 .global foo
6880 .hidden foo
6881 foo:
6882 .skip 4' > conftest.s
6883     if { ac_try='$gcc_cv_as -K PIC -o conftest.o conftest.s >&5'; { (eval echo configure:6884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6884     then
6885         if test x$gcc_cv_ld != x && test x$gcc_cv_objdump != x \
6886          && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1 \
6887          && $gcc_cv_objdump -s -j .data conftest 2> /dev/null \
6888             | grep ' 31000000 07323334' > /dev/null 2>&1; then
6889             if $gcc_cv_objdump -R conftest 2> /dev/null \
6890                | grep 'DISP32' > /dev/null 2>&1; then
6891                 :
6892             else
6893                 gcc_cv_as_sparc_ua_pcrel_hidden=yes
6894             fi
6895          fi
6896          rm -f conftest
6897     else
6898       echo "configure: failed program was" >&5
6899       cat conftest.s >&5
6900     fi
6901     rm -f conftest.o conftest.s
6902   fi
6903 fi
6904
6905 echo "$ac_t""$gcc_cv_as_sparc_ua_pcrel_hidden" 1>&6
6906 if test $gcc_cv_as_sparc_ua_pcrel_hidden = yes; then
6907   cat >> confdefs.h <<\EOF
6908 #define HAVE_AS_SPARC_UA_PCREL_HIDDEN 1
6909 EOF
6910
6911 fi
6912     
6913 fi # unaligned pcrel relocs
6914
6915     echo $ac_n "checking assembler for offsetable %lo()""... $ac_c" 1>&6
6916 echo "configure:6917: checking assembler for offsetable %lo()" >&5
6917 if eval "test \"`echo '$''{'gcc_cv_as_sparc_offsetable_lo10'+set}'`\" = set"; then
6918   echo $ac_n "(cached) $ac_c" 1>&6
6919 else
6920   gcc_cv_as_sparc_offsetable_lo10=no
6921   if test x$gcc_cv_as != x; then
6922     echo '.text
6923         or %g1, %lo(ab) + 12, %g1
6924         or %g1, %lo(ab + 12), %g1' > conftest.s
6925     if { ac_try='$gcc_cv_as -xarch=v9 -o conftest.o conftest.s >&5'; { (eval echo configure:6926: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6926     then
6927         if test x$gcc_cv_objdump != x \
6928        && %gcc_cv_objdump -s -j .text conftest.o 2> /dev/null \
6929           | grep ' 82106000 82106000' > /dev/null 2>&1; then
6930          gcc_cv_as_offsetable_lo10=yes
6931        fi
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_sparc_offsetable_lo10" 1>&6
6941 if test $gcc_cv_as_sparc_offsetable_lo10 = yes; then
6942   cat >> confdefs.h <<\EOF
6943 #define HAVE_AS_OFFSETABLE_LO10 1
6944 EOF
6945
6946 fi
6947     ;;
6948
6949   i[34567]86-*-* | x86_64-*-*)
6950     echo $ac_n "checking assembler for filds and fists mnemonics""... $ac_c" 1>&6
6951 echo "configure:6952: checking assembler for filds and fists mnemonics" >&5
6952 if eval "test \"`echo '$''{'gcc_cv_as_ix86_filds_fists'+set}'`\" = set"; then
6953   echo $ac_n "(cached) $ac_c" 1>&6
6954 else
6955   gcc_cv_as_ix86_filds_fists=no
6956     if test $in_tree_gas = yes; then
6957     if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 9 \) \* 1000 + 0`
6958   then gcc_cv_as_ix86_filds_fists=yes
6959 fi
6960   elif test x$gcc_cv_as != x; then
6961     echo 'filds mem; fists mem' > conftest.s
6962     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:6963: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6963     then
6964         gcc_cv_as_ix86_filds_fists=yes
6965     else
6966       echo "configure: failed program was" >&5
6967       cat conftest.s >&5
6968     fi
6969     rm -f conftest.o conftest.s
6970   fi
6971 fi
6972
6973 echo "$ac_t""$gcc_cv_as_ix86_filds_fists" 1>&6
6974 if test $gcc_cv_as_ix86_filds_fists = yes; then
6975   cat >> confdefs.h <<\EOF
6976 #define HAVE_GAS_FILDS_FISTS 1
6977 EOF
6978
6979 fi
6980
6981     echo $ac_n "checking assembler for cmov syntax""... $ac_c" 1>&6
6982 echo "configure:6983: checking assembler for cmov syntax" >&5
6983 if eval "test \"`echo '$''{'gcc_cv_as_ix86_cmov_sun_syntax'+set}'`\" = set"; then
6984   echo $ac_n "(cached) $ac_c" 1>&6
6985 else
6986   gcc_cv_as_ix86_cmov_sun_syntax=no
6987   if test x$gcc_cv_as != x; then
6988     echo 'cmovl.l %edx, %eax' > conftest.s
6989     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:6990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
6990     then
6991         gcc_cv_as_ix86_cmov_sun_syntax=yes
6992     else
6993       echo "configure: failed program was" >&5
6994       cat conftest.s >&5
6995     fi
6996     rm -f conftest.o conftest.s
6997   fi
6998 fi
6999
7000 echo "$ac_t""$gcc_cv_as_ix86_cmov_sun_syntax" 1>&6
7001 if test $gcc_cv_as_ix86_cmov_sun_syntax = yes; then
7002   cat >> confdefs.h <<\EOF
7003 #define HAVE_AS_IX86_CMOV_SUN_SYNTAX 1
7004 EOF
7005
7006 fi
7007
7008     # This one is used unconditionally by i386.[ch]; it is to be defined
7009     # to 1 if the feature is present, 0 otherwise.
7010     echo $ac_n "checking assembler for GOTOFF in data""... $ac_c" 1>&6
7011 echo "configure:7012: checking assembler for GOTOFF in data" >&5
7012 if eval "test \"`echo '$''{'gcc_cv_as_ix86_gotoff_in_data'+set}'`\" = set"; then
7013   echo $ac_n "(cached) $ac_c" 1>&6
7014 else
7015   gcc_cv_as_ix86_gotoff_in_data=no
7016     if test $in_tree_gas = yes; then
7017     if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
7018   then gcc_cv_as_ix86_gotoff_in_data=yes
7019 fi
7020   elif test x$gcc_cv_as != x; then
7021     echo '      .text
7022 .L0:
7023         nop
7024         .data
7025         .long .L0@GOTOFF' > conftest.s
7026     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:7027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
7027     then
7028         gcc_cv_as_ix86_gotoff_in_data=yes
7029     else
7030       echo "configure: failed program was" >&5
7031       cat conftest.s >&5
7032     fi
7033     rm -f conftest.o conftest.s
7034   fi
7035 fi
7036
7037 echo "$ac_t""$gcc_cv_as_ix86_gotoff_in_data" 1>&6
7038
7039     cat >> confdefs.h <<EOF
7040 #define HAVE_AS_GOTOFF_IN_DATA `if test $gcc_cv_as_ix86_gotoff_in_data = yes; then echo 1; else echo 0; fi`
7041 EOF
7042
7043     ;;
7044
7045   ia64*-*-*)
7046     echo $ac_n "checking assembler for ltoffx and ldxmov relocs""... $ac_c" 1>&6
7047 echo "configure:7048: checking assembler for ltoffx and ldxmov relocs" >&5
7048 if eval "test \"`echo '$''{'gcc_cv_as_ia64_ltoffx_ldxmov_relocs'+set}'`\" = set"; then
7049   echo $ac_n "(cached) $ac_c" 1>&6
7050 else
7051   gcc_cv_as_ia64_ltoffx_ldxmov_relocs=no
7052     if test $in_tree_gas = yes; then
7053     if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 14 \) \* 1000 + 0`
7054   then gcc_cv_as_ia64_ltoffx_ldxmov_relocs=yes
7055 fi
7056   elif test x$gcc_cv_as != x; then
7057     echo '      .text
7058         addl r15 = @ltoffx(x#), gp
7059         ;;
7060         ld8.mov r16 = [r15], x#' > conftest.s
7061     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:7062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
7062     then
7063         gcc_cv_as_ia64_ltoffx_ldxmov_relocs=yes
7064     else
7065       echo "configure: failed program was" >&5
7066       cat conftest.s >&5
7067     fi
7068     rm -f conftest.o conftest.s
7069   fi
7070 fi
7071
7072 echo "$ac_t""$gcc_cv_as_ia64_ltoffx_ldxmov_relocs" 1>&6
7073 if test $gcc_cv_as_ia64_ltoffx_ldxmov_relocs = yes; then
7074   cat >> confdefs.h <<\EOF
7075 #define HAVE_AS_LTOFFX_LDXMOV_RELOCS 1
7076 EOF
7077
7078 fi
7079
7080     ;;
7081
7082   powerpc*-*-*)
7083     case $target in
7084       *-*-aix) conftest_s='     .csect .textPR';;
7085       *)       conftest_s='     .text';;
7086     esac
7087     conftest_s="$conftest_s
7088         mfcr 3,128"
7089
7090     echo $ac_n "checking assembler for mfcr field support""... $ac_c" 1>&6
7091 echo "configure:7092: checking assembler for mfcr field support" >&5
7092 if eval "test \"`echo '$''{'gcc_cv_as_powerpc_mfcrf'+set}'`\" = set"; then
7093   echo $ac_n "(cached) $ac_c" 1>&6
7094 else
7095   gcc_cv_as_powerpc_mfcrf=no
7096     if test $in_tree_gas = yes; then
7097     if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 14 \) \* 1000 + 0`
7098   then gcc_cv_as_powerpc_mfcrf=yes
7099 fi
7100   elif test x$gcc_cv_as != x; then
7101     echo "$conftest_s" > conftest.s
7102     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:7103: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
7103     then
7104         gcc_cv_as_powerpc_mfcrf=yes
7105     else
7106       echo "configure: failed program was" >&5
7107       cat conftest.s >&5
7108     fi
7109     rm -f conftest.o conftest.s
7110   fi
7111 fi
7112
7113 echo "$ac_t""$gcc_cv_as_powerpc_mfcrf" 1>&6
7114 if test $gcc_cv_as_powerpc_mfcrf = yes; then
7115   cat >> confdefs.h <<\EOF
7116 #define HAVE_AS_MFCRF 1
7117 EOF
7118
7119 fi
7120     ;;
7121
7122   mips*-*-*)
7123     echo $ac_n "checking assembler for explicit relocation support""... $ac_c" 1>&6
7124 echo "configure:7125: checking assembler for explicit relocation support" >&5
7125 if eval "test \"`echo '$''{'gcc_cv_as_mips_explicit_relocs'+set}'`\" = set"; then
7126   echo $ac_n "(cached) $ac_c" 1>&6
7127 else
7128   gcc_cv_as_mips_explicit_relocs=no
7129     if test $in_tree_gas = yes; then
7130     if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 14 \) \* 1000 + 0`
7131   then gcc_cv_as_mips_explicit_relocs=yes
7132 fi
7133   elif test x$gcc_cv_as != x; then
7134     echo '      lw $4,%gp_rel(foo)($4)' > conftest.s
7135     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:7136: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
7136     then
7137         gcc_cv_as_mips_explicit_relocs=yes
7138     else
7139       echo "configure: failed program was" >&5
7140       cat conftest.s >&5
7141     fi
7142     rm -f conftest.o conftest.s
7143   fi
7144 fi
7145
7146 echo "$ac_t""$gcc_cv_as_mips_explicit_relocs" 1>&6
7147 if test $gcc_cv_as_mips_explicit_relocs = yes; then
7148   if test x$target_cpu_default = x
7149        then target_cpu_default=MASK_EXPLICIT_RELOCS
7150        else target_cpu_default="($target_cpu_default)|MASK_EXPLICIT_RELOCS"
7151        fi
7152 fi
7153
7154     ;;
7155 esac
7156 # ??? Not all targets support dwarf2 debug_line, even within a version
7157 # of gas.  Moreover, we need to emit a valid instruction to trigger any
7158 # info to the output file.  So, as supported targets are added to gas 2.11,
7159 # add some instruction here to (also) show we expect this might work.
7160 # ??? Once 2.11 is released, probably need to add first known working
7161 # version to the per-target configury.
7162 case "$target" in
7163   i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
7164   | x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-* \
7165   | xstormy16*-*-* | cris-*-*)
7166     insn="nop"
7167     ;;
7168   ia64*-*-*)
7169     insn="nop 0"
7170     ;;
7171   mmix-*-*)
7172     insn="swym 0"
7173     ;;
7174 esac
7175 if test x"$insn" != x; then
7176  conftest_s="\
7177         .file 1 \"conftest.s\"
7178         .loc 1 3 0
7179         $insn"
7180  echo $ac_n "checking assembler for dwarf2 debug_line support""... $ac_c" 1>&6
7181 echo "configure:7182: checking assembler for dwarf2 debug_line support" >&5
7182 if eval "test \"`echo '$''{'gcc_cv_as_dwarf2_debug_line'+set}'`\" = set"; then
7183   echo $ac_n "(cached) $ac_c" 1>&6
7184 else
7185   gcc_cv_as_dwarf2_debug_line=no
7186     if test $in_tree_gas = yes; then
7187     if test $in_tree_gas_is_elf = yes \
7188   && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
7189   then gcc_cv_as_dwarf2_debug_line=yes
7190 fi
7191   elif test x$gcc_cv_as != x; then
7192     echo "$conftest_s" > conftest.s
7193     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:7194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
7194     then
7195         # ??? This fails with non-gnu grep.  Maybe use objdump?
7196    if grep debug_line conftest.o > /dev/null 2>&1; then
7197      gcc_cv_as_dwarf2_debug_line=yes
7198    fi
7199     else
7200       echo "configure: failed program was" >&5
7201       cat conftest.s >&5
7202     fi
7203     rm -f conftest.o conftest.s
7204   fi
7205 fi
7206
7207 echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
7208
7209
7210 # The .debug_line file table must be in the exact order that
7211 # we specified the files, since these indices are also used
7212 # by DW_AT_decl_file.  Approximate this test by testing if
7213 # the assembler bitches if the same index is assigned twice.
7214  echo $ac_n "checking assembler for buggy dwarf2 .file directive""... $ac_c" 1>&6
7215 echo "configure:7216: checking assembler for buggy dwarf2 .file directive" >&5
7216 if eval "test \"`echo '$''{'gcc_cv_as_dwarf2_file_buggy'+set}'`\" = set"; then
7217   echo $ac_n "(cached) $ac_c" 1>&6
7218 else
7219   gcc_cv_as_dwarf2_file_buggy=no
7220   if test x$gcc_cv_as != x; then
7221     echo '      .file 1 "foo.s"
7222         .file 1 "bar.s"' > conftest.s
7223     if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'; { (eval echo configure:7224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
7224     then
7225         gcc_cv_as_dwarf2_file_buggy=yes
7226     else
7227       echo "configure: failed program was" >&5
7228       cat conftest.s >&5
7229     fi
7230     rm -f conftest.o conftest.s
7231   fi
7232 fi
7233
7234 echo "$ac_t""$gcc_cv_as_dwarf2_file_buggy" 1>&6
7235
7236
7237  if test $gcc_cv_as_dwarf2_debug_line = yes \
7238  && test $gcc_cv_as_dwarf2_file_buggy = no; then
7239         cat >> confdefs.h <<\EOF
7240 #define HAVE_AS_DWARF2_DEBUG_LINE 1
7241 EOF
7242
7243  fi
7244
7245  echo $ac_n "checking assembler for --gdwarf2 option""... $ac_c" 1>&6
7246 echo "configure:7247: checking assembler for --gdwarf2 option" >&5
7247 if eval "test \"`echo '$''{'gcc_cv_as_gdwarf2_flag'+set}'`\" = set"; then
7248   echo $ac_n "(cached) $ac_c" 1>&6
7249 else
7250   gcc_cv_as_gdwarf2_flag=no
7251     if test $in_tree_gas = yes; then
7252     if test $in_tree_gas_is_elf = yes \
7253   && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
7254   then gcc_cv_as_gdwarf2_flag=yes
7255 fi
7256   elif test x$gcc_cv_as != x; then
7257     echo "$insn" > conftest.s
7258     if { ac_try='$gcc_cv_as --gdwarf2 -o conftest.o conftest.s >&5'; { (eval echo configure:7259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
7259     then
7260         gcc_cv_as_gdwarf2_flag=yes
7261     else
7262       echo "configure: failed program was" >&5
7263       cat conftest.s >&5
7264     fi
7265     rm -f conftest.o conftest.s
7266   fi
7267 fi
7268
7269 echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6
7270 if test $gcc_cv_as_gdwarf2_flag = yes; then
7271   cat >> confdefs.h <<\EOF
7272 #define HAVE_AS_GDWARF2_DEBUG_FLAG 1
7273 EOF
7274
7275 fi
7276
7277  echo $ac_n "checking assembler for --gstabs option""... $ac_c" 1>&6
7278 echo "configure:7279: checking assembler for --gstabs option" >&5
7279 if eval "test \"`echo '$''{'gcc_cv_as_gstabs_flag'+set}'`\" = set"; then
7280   echo $ac_n "(cached) $ac_c" 1>&6
7281 else
7282   gcc_cv_as_gstabs_flag=no
7283     if test $in_tree_gas = yes; then
7284     if test $in_tree_gas_is_elf = yes \
7285   && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
7286   then gcc_cv_as_gstabs_flag=yes
7287 fi
7288   elif test x$gcc_cv_as != x; then
7289     echo "$insn" > conftest.s
7290     if { ac_try='$gcc_cv_as --gstabs -o conftest.o conftest.s >&5'; { (eval echo configure:7291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
7291     then
7292         # The native Solaris 9/Intel assembler doesn't understand --gstabs
7293    # and warns about it, but still exits successfully.  So check for
7294    # this.
7295    if { ac_try='$gcc_cv_as --gstabs -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null'; { (eval echo configure:7296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
7296    then :
7297    else gcc_cv_as_gstabs_flag=yes
7298    fi
7299     else
7300       echo "configure: failed program was" >&5
7301       cat conftest.s >&5
7302     fi
7303     rm -f conftest.o conftest.s
7304   fi
7305 fi
7306
7307 echo "$ac_t""$gcc_cv_as_gstabs_flag" 1>&6
7308 if test $gcc_cv_as_gstabs_flag = yes; then
7309   cat >> confdefs.h <<\EOF
7310 #define HAVE_AS_GSTABS_DEBUG_FLAG 1
7311 EOF
7312
7313 fi
7314 fi
7315
7316 echo $ac_n "checking linker read-only and read-write section mixing""... $ac_c" 1>&6
7317 echo "configure:7318: checking linker read-only and read-write section mixing" >&5
7318 gcc_cv_ld_ro_rw_mix=unknown
7319 if test $in_tree_ld = yes ; then
7320   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 \
7321      && test $in_tree_ld_is_elf = yes; then
7322     gcc_cv_ld_ro_rw_mix=read-write
7323   fi
7324 elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then
7325   echo '.section myfoosect, "a"' > conftest1.s
7326   echo '.section myfoosect, "aw"' > conftest2.s
7327   echo '.byte 1' >> conftest2.s
7328   echo '.section myfoosect, "a"' > conftest3.s
7329   echo '.byte 0' >> conftest3.s
7330   if $gcc_cv_as -o conftest1.o conftest1.s > /dev/null 2>&1 \
7331      && $gcc_cv_as -o conftest2.o conftest2.s > /dev/null 2>&1 \
7332      && $gcc_cv_as -o conftest3.o conftest3.s > /dev/null 2>&1 \
7333      && $gcc_cv_ld -shared -o conftest1.so conftest1.o \
7334         conftest2.o conftest3.o > /dev/null 2>&1; then
7335     gcc_cv_ld_ro_rw_mix=`$gcc_cv_objdump -h conftest1.so \
7336                          | sed -e '/myfoosect/!d' -e N`
7337     if echo "$gcc_cv_ld_ro_rw_mix" | grep CONTENTS > /dev/null; then
7338       if echo "$gcc_cv_ld_ro_rw_mix" | grep READONLY > /dev/null; then
7339         gcc_cv_ld_ro_rw_mix=read-only
7340       else
7341         gcc_cv_ld_ro_rw_mix=read-write
7342       fi
7343     fi
7344   fi
7345   rm -f conftest.* conftest[123].*
7346 fi
7347 if test x$gcc_cv_ld_ro_rw_mix = xread-write; then
7348         cat >> confdefs.h <<\EOF
7349 #define HAVE_LD_RO_RW_SECTION_MIXING 1
7350 EOF
7351
7352 fi
7353 echo "$ac_t""$gcc_cv_ld_ro_rw_mix" 1>&6
7354
7355 echo $ac_n "checking linker PT_GNU_EH_FRAME support""... $ac_c" 1>&6
7356 echo "configure:7357: checking linker PT_GNU_EH_FRAME support" >&5
7357 gcc_cv_ld_eh_frame_hdr=no
7358 if test $in_tree_ld = yes ; then
7359   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 \
7360      && test $in_tree_ld_is_elf = yes; then
7361     gcc_cv_ld_eh_frame_hdr=yes
7362   fi
7363 elif test x$gcc_cv_ld != x; then
7364         # Check if linker supports --eh-frame-hdr option
7365         if $gcc_cv_ld --help 2>/dev/null | grep eh-frame-hdr > /dev/null; then
7366                 gcc_cv_ld_eh_frame_hdr=yes
7367         fi
7368 fi
7369 if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
7370         cat >> confdefs.h <<\EOF
7371 #define HAVE_LD_EH_FRAME_HDR 1
7372 EOF
7373
7374 fi
7375 echo "$ac_t""$gcc_cv_ld_eh_frame_hdr" 1>&6
7376
7377 echo $ac_n "checking linker position independent executable support""... $ac_c" 1>&6
7378 echo "configure:7379: checking linker position independent executable support" >&5
7379 gcc_cv_ld_pie=no
7380 if test $in_tree_ld = yes ; then
7381   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 \
7382      && test $in_tree_ld_is_elf = yes; then
7383     gcc_cv_ld_pie=yes
7384   fi
7385 elif test x$gcc_cv_ld != x; then
7386         # Check if linker supports -pie option
7387         if $gcc_cv_ld --help 2>/dev/null | grep -- -pie > /dev/null; then
7388                 gcc_cv_ld_pie=yes
7389         fi
7390 fi
7391 if test x"$gcc_cv_ld_pie" = xyes; then
7392         cat >> confdefs.h <<\EOF
7393 #define HAVE_LD_PIE 1
7394 EOF
7395
7396 fi
7397 echo "$ac_t""$gcc_cv_ld_pie" 1>&6
7398
7399 # Miscellaneous target-specific checks.
7400 case "$target" in
7401   mips*-*-*)
7402     echo $ac_n "checking whether libgloss uses STARTUP directives consistently""... $ac_c" 1>&6
7403 echo "configure:7404: checking whether libgloss uses STARTUP directives consistently" >&5
7404     gcc_cv_mips_libgloss_startup=no
7405     gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss
7406     if test "x$exec_prefix" = xNONE; then
7407       if test "x$prefix" = xNONE; then
7408         test_prefix=/usr/local
7409       else
7410         test_prefix=$prefix
7411       fi
7412     else
7413       test_prefix=$exec_prefix
7414     fi
7415     for f in $gcc_cv_libgloss_srcdir/mips/idt.ld $test_prefix/$target_alias/lib/idt.ld
7416     do
7417       if grep '^STARTUP' $f > /dev/null 2>&1; then
7418         gcc_cv_mips_libgloss_startup=yes
7419         break
7420       fi
7421     done
7422     if test x"$gcc_cv_mips_libgloss_startup" = xyes; then
7423       cat >> confdefs.h <<\EOF
7424 #define HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES 1
7425 EOF
7426
7427     fi
7428     echo "$ac_t""$gcc_cv_mips_libgloss_startup" 1>&6
7429     ;;
7430 esac
7431
7432 if test x$with_sysroot = x && test x$host = x$target \
7433    && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then
7434   cat >> confdefs.h <<EOF
7435 #define PREFIX_INCLUDE_DIR "$prefix/include"
7436 EOF
7437
7438 fi
7439
7440 # Figure out what language subdirectories are present.
7441 # Look if the user specified --enable-languages="..."; if not, use
7442 # the environment variable $LANGUAGES if defined. $LANGUAGES might
7443 # go away some day.
7444 # NB:  embedded tabs in this IF block -- do not untabify
7445 if test x"${enable_languages+set}" != xset; then
7446         if test x"${LANGUAGES+set}" = xset; then
7447                 enable_languages="${LANGUAGES}"
7448                 echo "configure: warning: setting LANGUAGES is deprecated, use --enable-languages instead" 1>&2
7449
7450         else
7451                 enable_languages=all
7452         fi
7453 else
7454         if test x"${enable_languages}" = x \
7455         || test x"${enable_languages}" = xyes;
7456         then
7457                 { echo "configure: error: --enable-languages needs at least one language argument" 1>&2; exit 1; }
7458         fi
7459 fi
7460 enable_languages=`echo "${enable_languages}" | sed -e 's/[      ,][     ,]*/,/g' -e 's/,$//'`
7461
7462 # First scan to see if an enabled language requires some other language.
7463 # We assume that a given config-lang.in will list all the language
7464 # front ends it requires, even if some are required indirectly.
7465 for lang in ${srcdir}/*/config-lang.in
7466 do
7467    case $lang in
7468     # The odd quoting in the next line works around
7469     # an apparent bug in bash 1.12 on linux.
7470     ${srcdir}/[*]/config-lang.in)
7471        ;;
7472     *)
7473        lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^      ]*\).*$,\1,p' $lang`
7474        this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^    ]*\).*$,\1,p' $lang`
7475        for other in $this_lang_requires
7476        do
7477           case ,${enable_languages}, in
7478            *,$other,*)
7479               ;;
7480            *,all,*)
7481               ;;
7482            *,$lang_alias,*)
7483               enable_languages="$enable_languages,$other"
7484               ;;
7485           esac
7486        done
7487        ;;
7488    esac
7489 done
7490
7491 expected_languages=`echo ,${enable_languages}, | sed -e 's:,: :g' -e 's:  *: :g' -e 's:  *: :g' -e 's:^ ::' -e 's: $::'`
7492 found_languages=
7493 subdirs=
7494 for lang in ${srcdir}/*/config-lang.in
7495 do
7496         case $lang in
7497         # The odd quoting in the next line works around
7498         # an apparent bug in bash 1.12 on linux.
7499         ${srcdir}/[*]/config-lang.in) ;;
7500         *)
7501           lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^   ]*\).*$,\1,p' $lang`
7502           this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^         ]*\).*$,\1,p' $lang`
7503           build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^     ]*\).*$,\1,p' $lang`
7504           if test "x$lang_alias" = x
7505           then
7506                 echo "$lang doesn't set \$language." 1>&2
7507                 exit 1
7508           fi
7509           case ${build_by_default},${enable_languages}, in
7510           *,$lang_alias,*) add_this_lang=yes ;;
7511           no,*) add_this_lang=no ;;
7512           *,all,*) add_this_lang=yes ;;
7513           *) add_this_lang=no ;;
7514           esac
7515           found_languages="${found_languages} ${lang_alias}"
7516           if test x"${add_this_lang}" = xyes; then
7517                 case $lang in
7518                     ${srcdir}/ada/config-lang.in)
7519                         if test x$have_gnat = xyes ; then
7520                                 subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
7521                         fi
7522                         ;;
7523                     *)
7524                         subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
7525                         ;;
7526                 esac
7527           fi
7528           ;;
7529         esac
7530 done
7531
7532 missing_languages=
7533 for expected_language in ${expected_languages} ..
7534 do 
7535     if test "${expected_language}" != ..; then
7536         missing_language="${expected_language}"
7537         if test "${expected_language}" = "c" \
7538            || test "${expected_language}" = "all"; then
7539                 missing_language=
7540         fi
7541         for found_language in ${found_languages} ..
7542         do 
7543             if test "${found_language}" != ..; then
7544                 if test "${expected_language}" = "${found_language}"; then
7545                     missing_language=
7546                 fi
7547             fi
7548         done
7549         if test "x${missing_language}" != x; then
7550            missing_languages="${missing_languages} ${missing_language}"
7551         fi
7552     fi
7553 done
7554
7555 if test "x$missing_languages" != x; then
7556   { echo "configure: error: 
7557 The following requested languages were not found:${missing_languages}
7558 The following languages were available: c${found_languages}" 1>&2; exit 1; }
7559 fi
7560
7561 # Make gthr-default.h if we have a thread file.
7562 gthread_flags=
7563 if test $thread_file != single; then
7564     rm -f gthr-default.h
7565     echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h
7566     gthread_flags=-DHAVE_GTHR_DEFAULT
7567 fi
7568
7569
7570 # Find out what GC implementation we want, or may, use.
7571 # Check whether --with-gc or --without-gc was given.
7572 if test "${with_gc+set}" = set; then
7573   withval="$with_gc"
7574   case "$withval" in
7575   simple | page)
7576     GGC=ggc-$withval
7577     ;;
7578   *)
7579     { echo "configure: error: $withval is an invalid option to --with-gc" 1>&2; exit 1; }
7580     ;;
7581 esac
7582 else
7583   GGC=ggc-page
7584 fi
7585
7586
7587 echo "Using $GGC for garbage collection."
7588
7589 # Use the system's zlib library.
7590 zlibdir=-L../zlib
7591 zlibinc="-I\$(srcdir)/../zlib"
7592 # Check whether --with-system-zlib or --without-system-zlib was given.
7593 if test "${with_system_zlib+set}" = set; then
7594   withval="$with_system_zlib"
7595   zlibdir=
7596 zlibinc=
7597
7598 fi
7599
7600
7601
7602
7603
7604 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
7605 echo "configure:7606: checking whether to enable maintainer-specific portions of Makefiles" >&5
7606     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
7607 if test "${enable_maintainer_mode+set}" = set; then
7608   enableval="$enable_maintainer_mode"
7609   maintainer_mode=$enableval
7610 else
7611   maintainer_mode=no
7612 fi
7613
7614
7615 echo "$ac_t""$maintainer_mode" 1>&6
7616
7617 if test "$maintainer_mode" = "yes"; then
7618   MAINT=''
7619 else
7620   MAINT='#'
7621 fi
7622
7623 # Make empty files to contain the specs and options for each language.
7624 # Then add #include lines to for a compiler that has specs and/or options.
7625
7626 lang_opt_files=
7627 lang_specs_files=
7628 lang_tree_files=
7629 for subdir in . $subdirs
7630 do
7631         if test -f $srcdir/$subdir/lang.opt; then
7632             lang_opt_files="$lang_opt_files $srcdir/$subdir/lang.opt"
7633         fi
7634         if test -f $srcdir/$subdir/lang-specs.h; then
7635             lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
7636         fi
7637         if test -f $srcdir/$subdir/$subdir-tree.def; then
7638             lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def"
7639         fi
7640 done
7641
7642 # These (without "all_") are set in each config-lang.in.
7643 # `language' must be a single word so is spelled singularly.
7644 all_languages=
7645 all_boot_languages=
7646 all_compilers=
7647 all_stagestuff=
7648 all_outputs='Makefile fixinc/Makefile gccbug mklibgcc mkheaders'
7649 # List of language makefile fragments.
7650 all_lang_makefrags=
7651 # List of language subdirectory makefiles.  Deprecated.
7652 all_lang_makefiles=
7653 # Files for gengtype
7654 all_gtfiles="$target_gtfiles"
7655 # Files for gengtype with language
7656 all_gtfiles_files_langs=
7657 all_gtfiles_files_files=
7658
7659 # Add the language fragments.
7660 # Languages are added via two mechanisms.  Some information must be
7661 # recorded in makefile variables, these are defined in config-lang.in.
7662 # We accumulate them and plug them into the main Makefile.
7663 # The other mechanism is a set of hooks for each of the main targets
7664 # like `clean', `install', etc.
7665
7666 language_hooks="Make-hooks"
7667
7668 for s in $subdirs
7669 do
7670                 language=
7671                 boot_language=
7672                 compilers=
7673                 stagestuff=
7674                 outputs=
7675                 gtfiles=
7676                 . ${srcdir}/$s/config-lang.in
7677                 if test "x$language" = x
7678                 then
7679                         echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2
7680                         exit 1
7681                 fi
7682                 all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$s/Make-lang.in"
7683                 if test -f ${srcdir}/$s/Makefile.in
7684                 then all_lang_makefiles="$s/Makefile"
7685                 fi
7686                 all_languages="$all_languages $language"
7687                 if test "x$boot_language" = xyes
7688                 then
7689                         all_boot_languages="$all_boot_languages $language"
7690                 fi
7691                 all_compilers="$all_compilers $compilers"
7692                 all_stagestuff="$all_stagestuff $stagestuff"
7693                 all_outputs="$all_outputs $outputs"
7694                 all_gtfiles="$all_gtfiles $gtfiles"
7695                 for f in $gtfiles
7696                 do
7697                          all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} "
7698                          all_gtfiles_files_files="$all_gtfiles_files_files ${f} "
7699                 done
7700 done
7701
7702 # Pick up gtfiles for c
7703 gtfiles=
7704 s="c"
7705 . ${srcdir}/c-config-lang.in
7706 all_gtfiles="$all_gtfiles $gtfiles"
7707 for f in $gtfiles
7708 do
7709         all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} "
7710         all_gtfiles_files_files="$all_gtfiles_files_files ${f} "
7711 done
7712
7713 check_languages=
7714 for language in $all_languages
7715 do
7716                 check_languages="$check_languages check-$language"
7717 done
7718
7719 # Since we can't use `::' targets, we link each language in
7720 # with a set of hooks, reached indirectly via lang.${target}.
7721
7722 rm -f Make-hooks
7723 touch Make-hooks
7724 target_list="all.build all.cross start.encap rest.encap tags \
7725         info dvi generated-manpages \
7726         install-normal install-common install-info install-man \
7727         uninstall \
7728         mostlyclean clean distclean extraclean maintainer-clean \
7729         stage1 stage2 stage3 stage4 stageprofile stagefeedback"
7730 for t in $target_list
7731 do
7732         x=
7733         for lang in $all_languages
7734         do
7735                         x="$x $lang.$t"
7736         done
7737         echo "lang.$t: $x" >> Make-hooks
7738 done
7739
7740 # Create .gdbinit.
7741
7742 echo "dir ." > .gdbinit
7743 echo "dir ${srcdir}" >> .gdbinit
7744 if test x$gdb_needs_out_file_path = xyes
7745 then
7746         echo "dir ${srcdir}/config/"`dirname ${out_file}` >> .gdbinit
7747 fi
7748 if test "x$subdirs" != x; then
7749         for s in $subdirs
7750         do
7751                 echo "dir ${srcdir}/$s" >> .gdbinit
7752         done
7753 fi
7754 echo "source ${srcdir}/gdbinit.in" >> .gdbinit
7755
7756 # If $(exec_prefix) exists and is not the same as $(prefix), then compute an
7757 # absolute path for gcc_tooldir based on inserting the number of up-directory
7758 # movements required to get from $(exec_prefix) to $(prefix) into the basic
7759 # $(libsubdir)/@(unlibsubdir) based path.
7760 # Don't set gcc_tooldir to tooldir since that's only passed in by the toplevel
7761 # make and thus we'd get different behavior depending on where we built the
7762 # sources.
7763 if test x$exec_prefix = xNONE -o x$exec_prefix = x$prefix; then
7764     gcc_tooldir='$(libsubdir)/$(unlibsubdir)/../$(target_alias)'
7765 else
7766 # An explanation of the sed strings:
7767 #  -e 's|^\$(prefix)||'   matches and eliminates 'prefix' from 'exec_prefix'
7768 #  -e 's|/$||'            match a trailing forward slash and eliminates it
7769 #  -e 's|^[^/]|/|'        forces the string to start with a forward slash (*)
7770 #  -e 's|/[^/]*|../|g'    replaces each occurrence of /<directory> with ../
7771 #
7772 # (*) Note this pattern overwrites the first character of the string
7773 # with a forward slash if one is not already present.  This is not a
7774 # problem because the exact names of the sub-directories concerned is
7775 # unimportant, just the number of them matters.
7776 #
7777 # The practical upshot of these patterns is like this:
7778 #
7779 #  prefix     exec_prefix        result
7780 #  ------     -----------        ------
7781 #   /foo        /foo/bar          ../
7782 #   /foo/       /foo/bar          ../
7783 #   /foo        /foo/bar/         ../
7784 #   /foo/       /foo/bar/         ../
7785 #   /foo        /foo/bar/ugg      ../../
7786 #
7787     dollar='$$'
7788     gcc_tooldir="\$(libsubdir)/\$(unlibsubdir)/\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/\$(dollar)||' -e 's|^[^/]|/|' -e 's|/[^/]*|../|g'\`\$(target_alias)"
7789 fi
7790
7791
7792
7793 # Find a directory in which to install a shared libgcc.
7794
7795 # Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given.
7796 if test "${enable_version_specific_runtime_libs+set}" = set; then
7797   enableval="$enable_version_specific_runtime_libs"
7798   :
7799 fi
7800
7801
7802 # Check whether --with-slibdir or --without-slibdir was given.
7803 if test "${with_slibdir+set}" = set; then
7804   withval="$with_slibdir"
7805   slibdir="$with_slibdir"
7806 else
7807   if test "${enable_version_specific_runtime_libs+set}" = set; then
7808   slibdir='$(libsubdir)'
7809 elif test "$host" != "$target"; then
7810   slibdir='$(build_tooldir)/lib'
7811 else
7812   slibdir='$(libdir)'
7813 fi
7814 fi
7815
7816
7817
7818 objdir=`${PWDCMD-pwd}`
7819
7820
7821 # Substitute configuration variables
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890 # Echo that links are built
7891 if test x$host = x$target
7892 then
7893         str1="native "
7894 else
7895         str1="cross-"
7896         str2=" from $host"
7897 fi
7898
7899 if test x$host != x$build
7900 then
7901         str3=" on a $build system"
7902 fi
7903
7904 if test "x$str2" != x || test "x$str3" != x
7905 then
7906         str4=
7907 fi
7908
7909 echo "Links are now set up to build a ${str1}compiler for ${target}$str4" 1>&2
7910
7911 if test "x$str2" != x || test "x$str3" != x
7912 then
7913         echo " ${str2}${str3}." 1>&2
7914 fi
7915
7916 # Configure the subdirectories
7917 # AC_CONFIG_SUBDIRS($subdirs)
7918
7919 # Create the Makefile
7920 # and configure language subdirectories
7921 trap '' 1 2 15
7922 cat > confcache <<\EOF
7923 # This file is a shell script that caches the results of configure
7924 # tests run on this system so they can be shared between configure
7925 # scripts and configure runs.  It is not useful on other systems.
7926 # If it contains results you don't want to keep, you may remove or edit it.
7927 #
7928 # By default, configure uses ./config.cache as the cache file,
7929 # creating it if it does not exist already.  You can give configure
7930 # the --cache-file=FILE option to use a different cache file; that is
7931 # what configure does when it calls configure scripts in
7932 # subdirectories, so they share the cache.
7933 # Giving --cache-file=/dev/null disables caching, for debugging configure.
7934 # config.status only pays attention to the cache file if you give it the
7935 # --recheck option to rerun configure.
7936 #
7937 EOF
7938 # The following way of writing the cache mishandles newlines in values,
7939 # but we know of no workaround that is simple, portable, and efficient.
7940 # So, don't put newlines in cache variables' values.
7941 # Ultrix sh set writes to stderr and can't be redirected directly,
7942 # and sets the high bit in the cache file unless we assign to the vars.
7943 (set) 2>&1 |
7944   case `(ac_space=' '; set | grep ac_space) 2>&1` in
7945   *ac_space=\ *)
7946     # `set' does not quote correctly, so add quotes (double-quote substitution
7947     # turns \\\\ into \\, and sed turns \\ into \).
7948     sed -n \
7949       -e "s/'/'\\\\''/g" \
7950       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
7951     ;;
7952   *)
7953     # `set' quotes correctly as required by POSIX, so do not add quotes.
7954     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
7955     ;;
7956   esac >> confcache
7957 if cmp -s $cache_file confcache; then
7958   :
7959 else
7960   if test -w $cache_file; then
7961     echo "updating cache $cache_file"
7962     cat confcache > $cache_file
7963   else
7964     echo "not updating unwritable cache $cache_file"
7965   fi
7966 fi
7967 rm -f confcache
7968
7969 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
7970
7971 test "x$prefix" = xNONE && prefix=$ac_default_prefix
7972 # Let make expand exec_prefix.
7973 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
7974
7975 # Any assignment to VPATH causes Sun make to only execute
7976 # the first set of double-colon rules, so remove it if not needed.
7977 # If there is a colon in the path, we need to keep it.
7978 if test "x$srcdir" = x.; then
7979   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
7980 fi
7981
7982 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
7983
7984 DEFS=-DHAVE_CONFIG_H
7985
7986 # Without the "./", some shells look in PATH for config.status.
7987 : ${CONFIG_STATUS=./config.status}
7988
7989 echo creating $CONFIG_STATUS
7990 rm -f $CONFIG_STATUS
7991 cat > $CONFIG_STATUS <<EOF
7992 #! /bin/sh
7993 # Generated automatically by configure.
7994 # Run this file to recreate the current configuration.
7995 # This directory was configured as follows,
7996 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7997 #
7998 # $0 $ac_configure_args
7999 #
8000 # Compiler output produced by configure, useful for debugging
8001 # configure, is in ./config.log if it exists.
8002
8003 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
8004 for ac_option
8005 do
8006   case "\$ac_option" in
8007   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
8008     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
8009     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
8010   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
8011     echo "$CONFIG_STATUS generated by autoconf version 2.13"
8012     exit 0 ;;
8013   -help | --help | --hel | --he | --h)
8014     echo "\$ac_cs_usage"; exit 0 ;;
8015   *) echo "\$ac_cs_usage"; exit 1 ;;
8016   esac
8017 done
8018
8019 ac_given_srcdir=$srcdir
8020
8021 trap 'rm -fr `echo "$all_outputs auto-host.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
8022 EOF
8023 cat >> $CONFIG_STATUS <<EOF
8024
8025 # Protect against being on the right side of a sed subst in config.status.
8026 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
8027  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
8028 $ac_vpsub
8029 $extrasub
8030 s%@SHELL@%$SHELL%g
8031 s%@CFLAGS@%$CFLAGS%g
8032 s%@CPPFLAGS@%$CPPFLAGS%g
8033 s%@CXXFLAGS@%$CXXFLAGS%g
8034 s%@FFLAGS@%$FFLAGS%g
8035 s%@DEFS@%$DEFS%g
8036 s%@LDFLAGS@%$LDFLAGS%g
8037 s%@LIBS@%$LIBS%g
8038 s%@exec_prefix@%$exec_prefix%g
8039 s%@prefix@%$prefix%g
8040 s%@program_transform_name@%$program_transform_name%g
8041 s%@bindir@%$bindir%g
8042 s%@sbindir@%$sbindir%g
8043 s%@libexecdir@%$libexecdir%g
8044 s%@datadir@%$datadir%g
8045 s%@sysconfdir@%$sysconfdir%g
8046 s%@sharedstatedir@%$sharedstatedir%g
8047 s%@localstatedir@%$localstatedir%g
8048 s%@libdir@%$libdir%g
8049 s%@includedir@%$includedir%g
8050 s%@oldincludedir@%$oldincludedir%g
8051 s%@infodir@%$infodir%g
8052 s%@mandir@%$mandir%g
8053 s%@host@%$host%g
8054 s%@host_alias@%$host_alias%g
8055 s%@host_cpu@%$host_cpu%g
8056 s%@host_vendor@%$host_vendor%g
8057 s%@host_os@%$host_os%g
8058 s%@target@%$target%g
8059 s%@target_alias@%$target_alias%g
8060 s%@target_cpu@%$target_cpu%g
8061 s%@target_vendor@%$target_vendor%g
8062 s%@target_os@%$target_os%g
8063 s%@build@%$build%g
8064 s%@build_alias@%$build_alias%g
8065 s%@build_cpu@%$build_cpu%g
8066 s%@build_vendor@%$build_vendor%g
8067 s%@build_os@%$build_os%g
8068 s%@build_subdir@%$build_subdir%g
8069 s%@host_subdir@%$host_subdir%g
8070 s%@target_subdir@%$target_subdir%g
8071 s%@CC@%$CC%g
8072 s%@NO_MINUS_C_MINUS_O@%$NO_MINUS_C_MINUS_O%g
8073 s%@OUTPUT_OPTION@%$OUTPUT_OPTION%g
8074 s%@CPP@%$CPP%g
8075 s%@GNATBIND@%$GNATBIND%g
8076 s%@ADAC@%$ADAC%g
8077 s%@strict1_warn@%$strict1_warn%g
8078 s%@warn_cflags@%$warn_cflags%g
8079 s%@WERROR@%$WERROR%g
8080 s%@nocommon_flag@%$nocommon_flag%g
8081 s%@valgrind_path@%$valgrind_path%g
8082 s%@valgrind_path_defines@%$valgrind_path_defines%g
8083 s%@valgrind_command@%$valgrind_command%g
8084 s%@coverage_flags@%$coverage_flags%g
8085 s%@enable_multilib@%$enable_multilib%g
8086 s%@enable_shared@%$enable_shared%g
8087 s%@TARGET_SYSTEM_ROOT@%$TARGET_SYSTEM_ROOT%g
8088 s%@TARGET_SYSTEM_ROOT_DEFINE@%$TARGET_SYSTEM_ROOT_DEFINE%g
8089 s%@CROSS_SYSTEM_HEADER_DIR@%$CROSS_SYSTEM_HEADER_DIR%g
8090 s%@onestep@%$onestep%g
8091 s%@SET_MAKE@%$SET_MAKE%g
8092 s%@AWK@%$AWK%g
8093 s%@LN@%$LN%g
8094 s%@LN_S@%$LN_S%g
8095 s%@RANLIB@%$RANLIB%g
8096 s%@INSTALL@%$INSTALL%g
8097 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
8098 s%@INSTALL_DATA@%$INSTALL_DATA%g
8099 s%@make_compare_target@%$make_compare_target%g
8100 s%@have_mktemp_command@%$have_mktemp_command%g
8101 s%@MAKEINFO@%$MAKEINFO%g
8102 s%@BUILD_INFO@%$BUILD_INFO%g
8103 s%@GENERATED_MANPAGES@%$GENERATED_MANPAGES%g
8104 s%@FLEX@%$FLEX%g
8105 s%@BISON@%$BISON%g
8106 s%@stage1_cflags@%$stage1_cflags%g
8107 s%@COLLECT2_LIBS@%$COLLECT2_LIBS%g
8108 s%@GNAT_LIBEXC@%$GNAT_LIBEXC%g
8109 s%@LDEXP_LIB@%$LDEXP_LIB%g
8110 s%@TARGET_GETGROUPS_T@%$TARGET_GETGROUPS_T%g
8111 s%@LIBICONV@%$LIBICONV%g
8112 s%@LIBICONV_DEP@%$LIBICONV_DEP%g
8113 s%@manext@%$manext%g
8114 s%@objext@%$objext%g
8115 s%@extra_modes_file@%$extra_modes_file%g
8116 s%@FORBUILD@%$FORBUILD%g
8117 s%@PACKAGE@%$PACKAGE%g
8118 s%@VERSION@%$VERSION%g
8119 s%@USE_NLS@%$USE_NLS%g
8120 s%@LIBINTL@%$LIBINTL%g
8121 s%@LIBINTL_DEP@%$LIBINTL_DEP%g
8122 s%@INCINTL@%$INCINTL%g
8123 s%@XGETTEXT@%$XGETTEXT%g
8124 s%@GMSGFMT@%$GMSGFMT%g
8125 s%@POSUB@%$POSUB%g
8126 s%@CATALOGS@%$CATALOGS%g
8127 s%@CROSS@%$CROSS%g
8128 s%@ALL@%$ALL%g
8129 s%@SYSTEM_HEADER_DIR@%$SYSTEM_HEADER_DIR%g
8130 s%@inhibit_libc@%$inhibit_libc%g
8131 s%@BUILD_PREFIX@%$BUILD_PREFIX%g
8132 s%@BUILD_PREFIX_1@%$BUILD_PREFIX_1%g
8133 s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
8134 s%@BUILD_CFLAGS@%$BUILD_CFLAGS%g
8135 s%@STMP_FIXINC@%$STMP_FIXINC%g
8136 s%@STMP_FIXPROTO@%$STMP_FIXPROTO%g
8137 s%@libgcc_visibility@%$libgcc_visibility%g
8138 s%@gthread_flags@%$gthread_flags%g
8139 s%@GGC@%$GGC%g
8140 s%@zlibdir@%$zlibdir%g
8141 s%@zlibinc@%$zlibinc%g
8142 s%@MAINT@%$MAINT%g
8143 s%@gcc_tooldir@%$gcc_tooldir%g
8144 s%@dollar@%$dollar%g
8145 s%@slibdir@%$slibdir%g
8146 s%@objdir@%$objdir%g
8147 s%@subdirs@%$subdirs%g
8148 s%@srcdir@%$srcdir%g
8149 s%@all_boot_languages@%$all_boot_languages%g
8150 s%@all_compilers@%$all_compilers%g
8151 s%@all_gtfiles@%$all_gtfiles%g
8152 s%@all_gtfiles_files_langs@%$all_gtfiles_files_langs%g
8153 s%@all_gtfiles_files_files@%$all_gtfiles_files_files%g
8154 s%@all_lang_makefrags@%$all_lang_makefrags%g
8155 s%@all_lang_makefiles@%$all_lang_makefiles%g
8156 s%@all_languages@%$all_languages%g
8157 s%@all_stagestuff@%$all_stagestuff%g
8158 s%@build_exeext@%$build_exeext%g
8159 s%@build_install_headers_dir@%$build_install_headers_dir%g
8160 s%@build_xm_file_list@%$build_xm_file_list%g
8161 s%@build_xm_include_list@%$build_xm_include_list%g
8162 s%@build_xm_defines@%$build_xm_defines%g
8163 s%@check_languages@%$check_languages%g
8164 s%@cc_set_by_configure@%$cc_set_by_configure%g
8165 s%@quoted_cc_set_by_configure@%$quoted_cc_set_by_configure%g
8166 s%@cpp_install_dir@%$cpp_install_dir%g
8167 s%@xmake_file@%$xmake_file%g
8168 s%@tmake_file@%$tmake_file%g
8169 s%@extra_headers_list@%$extra_headers_list%g
8170 s%@extra_objs@%$extra_objs%g
8171 s%@extra_parts@%$extra_parts%g
8172 s%@extra_passes@%$extra_passes%g
8173 s%@extra_programs@%$extra_programs%g
8174 s%@float_h_file@%$float_h_file%g
8175 s%@gcc_config_arguments@%$gcc_config_arguments%g
8176 s%@gcc_gxx_include_dir@%$gcc_gxx_include_dir%g
8177 s%@libstdcxx_incdir@%$libstdcxx_incdir%g
8178 s%@gcc_version@%$gcc_version%g
8179 s%@gcc_version_full@%$gcc_version_full%g
8180 s%@gcc_version_trigger@%$gcc_version_trigger%g
8181 s%@host_exeext@%$host_exeext%g
8182 s%@host_extra_gcc_objs@%$host_extra_gcc_objs%g
8183 s%@host_xm_file_list@%$host_xm_file_list%g
8184 s%@host_xm_include_list@%$host_xm_include_list%g
8185 s%@host_xm_defines@%$host_xm_defines%g
8186 s%@out_host_hook_obj@%$out_host_hook_obj%g
8187 s%@install@%$install%g
8188 s%@lang_opt_files@%$lang_opt_files%g
8189 s%@lang_specs_files@%$lang_specs_files%g
8190 s%@lang_tree_files@%$lang_tree_files%g
8191 s%@local_prefix@%$local_prefix%g
8192 s%@md_file@%$md_file%g
8193 s%@objc_boehm_gc@%$objc_boehm_gc%g
8194 s%@out_file@%$out_file%g
8195 s%@out_object_file@%$out_object_file%g
8196 s%@stage_prefix_set_by_configure@%$stage_prefix_set_by_configure%g
8197 s%@quoted_stage_prefix_set_by_configure@%$quoted_stage_prefix_set_by_configure%g
8198 s%@symbolic_link@%$symbolic_link%g
8199 s%@thread_file@%$thread_file%g
8200 s%@tm_file_list@%$tm_file_list%g
8201 s%@tm_include_list@%$tm_include_list%g
8202 s%@tm_defines@%$tm_defines%g
8203 s%@tm_p_file_list@%$tm_p_file_list%g
8204 s%@tm_p_include_list@%$tm_p_include_list%g
8205 s%@xm_file_list@%$xm_file_list%g
8206 s%@xm_include_list@%$xm_include_list%g
8207 s%@xm_defines@%$xm_defines%g
8208 s%@c_target_objs@%$c_target_objs%g
8209 s%@cxx_target_objs@%$cxx_target_objs%g
8210 s%@target_cpu_default@%$target_cpu_default%g
8211 /@language_hooks@/r $language_hooks
8212 s%@language_hooks@%%g
8213
8214 CEOF
8215 EOF
8216
8217 cat >> $CONFIG_STATUS <<\EOF
8218
8219 # Split the substitutions into bite-sized pieces for seds with
8220 # small command number limits, like on Digital OSF/1 and HP-UX.
8221 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
8222 ac_file=1 # Number of current file.
8223 ac_beg=1 # First line for current file.
8224 ac_end=$ac_max_sed_cmds # Line after last line for current file.
8225 ac_more_lines=:
8226 ac_sed_cmds=""
8227 while $ac_more_lines; do
8228   if test $ac_beg -gt 1; then
8229     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
8230   else
8231     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
8232   fi
8233   if test ! -s conftest.s$ac_file; then
8234     ac_more_lines=false
8235     rm -f conftest.s$ac_file
8236   else
8237     if test -z "$ac_sed_cmds"; then
8238       ac_sed_cmds="sed -f conftest.s$ac_file"
8239     else
8240       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
8241     fi
8242     ac_file=`expr $ac_file + 1`
8243     ac_beg=$ac_end
8244     ac_end=`expr $ac_end + $ac_max_sed_cmds`
8245   fi
8246 done
8247 if test -z "$ac_sed_cmds"; then
8248   ac_sed_cmds=cat
8249 fi
8250 EOF
8251
8252 cat >> $CONFIG_STATUS <<EOF
8253
8254 CONFIG_FILES=\${CONFIG_FILES-"$all_outputs"}
8255 EOF
8256 cat >> $CONFIG_STATUS <<\EOF
8257 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
8258   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8259   case "$ac_file" in
8260   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8261        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8262   *) ac_file_in="${ac_file}.in" ;;
8263   esac
8264
8265   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
8266
8267   # Remove last slash and all that follows it.  Not all systems have dirname.
8268   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
8269   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
8270     # The file is in a subdirectory.
8271     test ! -d "$ac_dir" && mkdir "$ac_dir"
8272     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
8273     # A "../" for each directory in $ac_dir_suffix.
8274     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
8275   else
8276     ac_dir_suffix= ac_dots=
8277   fi
8278
8279   case "$ac_given_srcdir" in
8280   .)  srcdir=.
8281       if test -z "$ac_dots"; then top_srcdir=.
8282       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
8283   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
8284   *) # Relative path.
8285     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
8286     top_srcdir="$ac_dots$ac_given_srcdir" ;;
8287   esac
8288
8289
8290   echo creating "$ac_file"
8291   rm -f "$ac_file"
8292   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
8293   case "$ac_file" in
8294   *Makefile*) ac_comsub="1i\\
8295 # $configure_input" ;;
8296   *) ac_comsub= ;;
8297   esac
8298
8299   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8300   sed -e "$ac_comsub
8301 s%@configure_input@%$configure_input%g
8302 s%@srcdir@%$srcdir%g
8303 s%@top_srcdir@%$top_srcdir%g
8304 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
8305 fi; done
8306 rm -f conftest.s*
8307
8308 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
8309 # NAME is the cpp macro being defined and VALUE is the value it is being given.
8310 #
8311 # ac_d sets the value in "#define NAME VALUE" lines.
8312 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
8313 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
8314 ac_dC='\3'
8315 ac_dD='%g'
8316 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
8317 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
8318 ac_uB='\([      ]\)%\1#\2define\3'
8319 ac_uC=' '
8320 ac_uD='\4%g'
8321 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
8322 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
8323 ac_eB='$%\1#\2define\3'
8324 ac_eC=' '
8325 ac_eD='%g'
8326
8327 if test "${CONFIG_HEADERS+set}" != set; then
8328 EOF
8329 cat >> $CONFIG_STATUS <<EOF
8330   CONFIG_HEADERS="auto-host.h:config.in"
8331 EOF
8332 cat >> $CONFIG_STATUS <<\EOF
8333 fi
8334 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
8335   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8336   case "$ac_file" in
8337   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8338        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8339   *) ac_file_in="${ac_file}.in" ;;
8340   esac
8341
8342   echo creating $ac_file
8343
8344   rm -f conftest.frag conftest.in conftest.out
8345   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8346   cat $ac_file_inputs > conftest.in
8347
8348 EOF
8349
8350 # Transform confdefs.h into a sed script conftest.vals that substitutes
8351 # the proper values into config.h.in to produce config.h.  And first:
8352 # Protect against being on the right side of a sed subst in config.status.
8353 # Protect against being in an unquoted here document in config.status.
8354 rm -f conftest.vals
8355 cat > conftest.hdr <<\EOF
8356 s/[\\&%]/\\&/g
8357 s%[\\$`]%\\&%g
8358 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
8359 s%ac_d%ac_u%gp
8360 s%ac_u%ac_e%gp
8361 EOF
8362 sed -n -f conftest.hdr confdefs.h > conftest.vals
8363 rm -f conftest.hdr
8364
8365 # This sed command replaces #undef with comments.  This is necessary, for
8366 # example, in the case of _POSIX_SOURCE, which is predefined and required
8367 # on some systems where configure will not decide to define it.
8368 cat >> conftest.vals <<\EOF
8369 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
8370 EOF
8371
8372 # Break up conftest.vals because some shells have a limit on
8373 # the size of here documents, and old seds have small limits too.
8374
8375 rm -f conftest.tail
8376 while :
8377 do
8378   ac_lines=`grep -c . conftest.vals`
8379   # grep -c gives empty output for an empty file on some AIX systems.
8380   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
8381   # Write a limited-size here document to conftest.frag.
8382   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
8383   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
8384   echo 'CEOF
8385   sed -f conftest.frag conftest.in > conftest.out
8386   rm -f conftest.in
8387   mv conftest.out conftest.in
8388 ' >> $CONFIG_STATUS
8389   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
8390   rm -f conftest.vals
8391   mv conftest.tail conftest.vals
8392 done
8393 rm -f conftest.vals
8394
8395 cat >> $CONFIG_STATUS <<\EOF
8396   rm -f conftest.frag conftest.h
8397   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
8398   cat conftest.in >> conftest.h
8399   rm -f conftest.in
8400   if cmp -s $ac_file conftest.h 2>/dev/null; then
8401     echo "$ac_file is unchanged"
8402     rm -f conftest.h
8403   else
8404     # Remove last slash and all that follows it.  Not all systems have dirname.
8405       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
8406       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
8407       # The file is in a subdirectory.
8408       test ! -d "$ac_dir" && mkdir "$ac_dir"
8409     fi
8410     rm -f $ac_file
8411     mv conftest.h $ac_file
8412   fi
8413 fi; done
8414
8415 EOF
8416 cat >> $CONFIG_STATUS <<EOF
8417 subdirs='$subdirs'
8418 symbolic_link='$symbolic_link'
8419
8420 EOF
8421 cat >> $CONFIG_STATUS <<\EOF
8422
8423 case x$CONFIG_HEADERS in
8424 xauto-host.h:config.in)
8425 echo > cstamp-h ;;
8426 esac
8427 # Make sure all the subdirs exist.
8428 for d in $subdirs
8429 do
8430     test -d $d || mkdir $d
8431 done
8432 # If the host supports symlinks, point stage[1234] at ../stage[1234] so
8433 # bootstrapping and the installation procedure can still use
8434 # CC="stage1/xgcc -Bstage1/".  If the host doesn't support symlinks,
8435 # FLAGS_TO_PASS has been modified to solve the problem there.
8436 # This is virtually a duplicate of what happens in configure.lang; we do
8437 # an extra check to make sure this only happens if ln -s can be used.
8438 if test "$symbolic_link" = "ln -s"; then
8439  for d in ${subdirs} fixinc ; do
8440         STARTDIR=`${PWDCMD-pwd}`
8441         cd $d
8442         for t in stage1 stage2 stage3 stage4 stageprofile stagefeedback include
8443         do
8444                 rm -f $t
8445                 $symbolic_link ../$t $t 2>/dev/null
8446         done
8447         cd $STARTDIR
8448  done
8449 else true ; fi
8450
8451 exit 0
8452 EOF
8453 chmod +x $CONFIG_STATUS
8454 rm -fr confdefs* $ac_clean_files
8455 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
8456