OSDN Git Service

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