OSDN Git Service

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