OSDN Git Service

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