OSDN Git Service

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