OSDN Git Service

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