OSDN Git Service

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