OSDN Git Service

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