OSDN Git Service

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