OSDN Git Service

* configure.in: Update error message for missing GMP/MPFR.
[pf3gnuchains/gcc-fork.git] / 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-build-libsubdir=[DIR]  Directory where to find libraries for build system"
16 ac_help="$ac_help
17   --enable-libada        Builds libada directory"
18 ac_help="$ac_help
19   --enable-libssp        Builds libssp directory"
20 ac_help="$ac_help
21   --with-mpfr-dir=PATH    This option has been REMOVED"
22 ac_help="$ac_help
23   --with-mpfr=PATH        Specify prefix directory for installed MPFR package
24                           Equivalent to --with-mpfr-include=PATH/include
25                           plus --with-mpfr-lib=PATH/lib"
26 ac_help="$ac_help
27   --with-mpfr-include=PATH
28                           Specify directory for installed MPFR include files"
29 ac_help="$ac_help
30   --with-mpfr-lib=PATH    Specify the directory for the installed MPFR library"
31 ac_help="$ac_help
32   --with-gmp-dir=PATH     This option has been REMOVED"
33 ac_help="$ac_help
34   --with-gmp=PATH         Specify prefix directory for the installed GMP package
35                           Equivalent to --with-gmp-include=PATH/include
36                           plus --with-gmp-lib=PATH/lib"
37 ac_help="$ac_help
38   --with-gmp-include=PATH Specify directory for installed GMP include files"
39 ac_help="$ac_help
40   --with-gmp-lib=PATH     Specify the directory for the installed GMP library"
41 ac_help="$ac_help
42   --enable-objc-gc       enable the use of Boehm's garbage collector with
43                           the GNU Objective-C runtime."
44 ac_help="$ac_help
45   --with-build-sysroot=sysroot
46                           use sysroot as the system root during the build"
47 ac_help="$ac_help
48   --enable-bootstrap           Enable bootstrapping [yes if native build]"
49 ac_help="$ac_help
50   --enable-serial-[{host,target,build}-]configure
51                           Force sequential configuration of
52                           sub-packages for the host, target or build
53                           machine, or all sub-packages"
54 ac_help="$ac_help
55   --with-build-time-tools=path
56                           use given path to find target tools during the build"
57 ac_help="$ac_help
58   --enable-maintainer-mode enable make rules and dependencies not useful
59                           (and sometimes confusing) to the casual installer"
60 ac_help="$ac_help
61   --enable-werror         enable -Werror in bootstrap stage2 and later"
62 ac_help="$ac_help
63   --with-datarootdir    Use datarootdir as the data root directory."
64 ac_help="$ac_help
65   --with-docdir Install documentation in this directory."
66 ac_help="$ac_help
67   --with-htmldir        Install html in this directory."
68
69 # Initialize some variables set by options.
70 # The variables have the same names as the options, with
71 # dashes changed to underlines.
72 build=NONE
73 cache_file=./config.cache
74 exec_prefix=NONE
75 host=NONE
76 no_create=
77 nonopt=NONE
78 no_recursion=
79 prefix=NONE
80 program_prefix=NONE
81 program_suffix=NONE
82 program_transform_name=s,x,x,
83 silent=
84 site=
85 srcdir=
86 target=NONE
87 verbose=
88 x_includes=NONE
89 x_libraries=NONE
90 bindir='${exec_prefix}/bin'
91 sbindir='${exec_prefix}/sbin'
92 libexecdir='${exec_prefix}/libexec'
93 datadir='${prefix}/share'
94 sysconfdir='${prefix}/etc'
95 sharedstatedir='${prefix}/com'
96 localstatedir='${prefix}/var'
97 libdir='${exec_prefix}/lib'
98 includedir='${prefix}/include'
99 oldincludedir='/usr/include'
100 infodir='${prefix}/info'
101 mandir='${prefix}/man'
102
103 # Initialize some other variables.
104 subdirs=
105 MFLAGS= MAKEFLAGS=
106 SHELL=${CONFIG_SHELL-/bin/sh}
107 # Maximum number of lines to put in a shell here document.
108 ac_max_here_lines=12
109
110 ac_prev=
111 for ac_option
112 do
113
114   # If the previous option needs an argument, assign it.
115   if test -n "$ac_prev"; then
116     eval "$ac_prev=\$ac_option"
117     ac_prev=
118     continue
119   fi
120
121   case "$ac_option" in
122   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
123   *) ac_optarg= ;;
124   esac
125
126   # Accept the important Cygnus configure options, so we can diagnose typos.
127
128   case "$ac_option" in
129
130   -bindir | --bindir | --bindi | --bind | --bin | --bi)
131     ac_prev=bindir ;;
132   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
133     bindir="$ac_optarg" ;;
134
135   -build | --build | --buil | --bui | --bu)
136     ac_prev=build ;;
137   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
138     build="$ac_optarg" ;;
139
140   -cache-file | --cache-file | --cache-fil | --cache-fi \
141   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
142     ac_prev=cache_file ;;
143   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
144   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
145     cache_file="$ac_optarg" ;;
146
147   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
148     ac_prev=datadir ;;
149   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
150   | --da=*)
151     datadir="$ac_optarg" ;;
152
153   -disable-* | --disable-*)
154     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
155     # Reject names that are not valid shell variable names.
156     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
157       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
158     fi
159     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
160     eval "enable_${ac_feature}=no" ;;
161
162   -enable-* | --enable-*)
163     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
164     # Reject names that are not valid shell variable names.
165     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
166       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
167     fi
168     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
169     case "$ac_option" in
170       *=*) ;;
171       *) ac_optarg=yes ;;
172     esac
173     eval "enable_${ac_feature}='$ac_optarg'" ;;
174
175   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
176   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
177   | --exec | --exe | --ex)
178     ac_prev=exec_prefix ;;
179   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
180   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
181   | --exec=* | --exe=* | --ex=*)
182     exec_prefix="$ac_optarg" ;;
183
184   -gas | --gas | --ga | --g)
185     # Obsolete; use --with-gas.
186     with_gas=yes ;;
187
188   -help | --help | --hel | --he)
189     # Omit some internal or obsolete options to make the list less imposing.
190     # This message is too long to be a string in the A/UX 3.1 sh.
191     cat << EOF
192 Usage: configure [options] [host]
193 Options: [defaults in brackets after descriptions]
194 Configuration:
195   --cache-file=FILE       cache test results in FILE
196   --help                  print this message
197   --no-create             do not create output files
198   --quiet, --silent       do not print \`checking...' messages
199   --version               print the version of autoconf that created configure
200 Directory and file names:
201   --prefix=PREFIX         install architecture-independent files in PREFIX
202                           [$ac_default_prefix]
203   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
204                           [same as prefix]
205   --bindir=DIR            user executables in DIR [EPREFIX/bin]
206   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
207   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
208   --datadir=DIR           read-only architecture-independent data in DIR
209                           [PREFIX/share]
210   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
211   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
212                           [PREFIX/com]
213   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
214   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
215   --includedir=DIR        C header files in DIR [PREFIX/include]
216   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
217   --infodir=DIR           info documentation in DIR [PREFIX/info]
218   --mandir=DIR            man documentation in DIR [PREFIX/man]
219   --srcdir=DIR            find the sources in DIR [configure dir or ..]
220   --program-prefix=PREFIX prepend PREFIX to installed program names
221   --program-suffix=SUFFIX append SUFFIX to installed program names
222   --program-transform-name=PROGRAM
223                           run sed PROGRAM on installed program names
224 EOF
225     cat << EOF
226 Host type:
227   --build=BUILD           configure for building on BUILD [BUILD=HOST]
228   --host=HOST             configure for HOST [guessed]
229   --target=TARGET         configure for TARGET [TARGET=HOST]
230 Features and packages:
231   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
232   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
233   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
234   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
235   --x-includes=DIR        X include files are in DIR
236   --x-libraries=DIR       X library files are in DIR
237 EOF
238     if test -n "$ac_help"; then
239       echo "--enable and --with options recognized:$ac_help"
240     fi
241     exit 0 ;;
242
243   -host | --host | --hos | --ho)
244     ac_prev=host ;;
245   -host=* | --host=* | --hos=* | --ho=*)
246     host="$ac_optarg" ;;
247
248   -includedir | --includedir | --includedi | --included | --include \
249   | --includ | --inclu | --incl | --inc)
250     ac_prev=includedir ;;
251   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
252   | --includ=* | --inclu=* | --incl=* | --inc=*)
253     includedir="$ac_optarg" ;;
254
255   -infodir | --infodir | --infodi | --infod | --info | --inf)
256     ac_prev=infodir ;;
257   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
258     infodir="$ac_optarg" ;;
259
260   -libdir | --libdir | --libdi | --libd)
261     ac_prev=libdir ;;
262   -libdir=* | --libdir=* | --libdi=* | --libd=*)
263     libdir="$ac_optarg" ;;
264
265   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
266   | --libexe | --libex | --libe)
267     ac_prev=libexecdir ;;
268   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
269   | --libexe=* | --libex=* | --libe=*)
270     libexecdir="$ac_optarg" ;;
271
272   -localstatedir | --localstatedir | --localstatedi | --localstated \
273   | --localstate | --localstat | --localsta | --localst \
274   | --locals | --local | --loca | --loc | --lo)
275     ac_prev=localstatedir ;;
276   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
277   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
278   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
279     localstatedir="$ac_optarg" ;;
280
281   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
282     ac_prev=mandir ;;
283   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
284     mandir="$ac_optarg" ;;
285
286   -nfp | --nfp | --nf)
287     # Obsolete; use --without-fp.
288     with_fp=no ;;
289
290   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
291   | --no-cr | --no-c)
292     no_create=yes ;;
293
294   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
295   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
296     no_recursion=yes ;;
297
298   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
299   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
300   | --oldin | --oldi | --old | --ol | --o)
301     ac_prev=oldincludedir ;;
302   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
303   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
304   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
305     oldincludedir="$ac_optarg" ;;
306
307   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
308     ac_prev=prefix ;;
309   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
310     prefix="$ac_optarg" ;;
311
312   -program-prefix | --program-prefix | --program-prefi | --program-pref \
313   | --program-pre | --program-pr | --program-p)
314     ac_prev=program_prefix ;;
315   -program-prefix=* | --program-prefix=* | --program-prefi=* \
316   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
317     program_prefix="$ac_optarg" ;;
318
319   -program-suffix | --program-suffix | --program-suffi | --program-suff \
320   | --program-suf | --program-su | --program-s)
321     ac_prev=program_suffix ;;
322   -program-suffix=* | --program-suffix=* | --program-suffi=* \
323   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
324     program_suffix="$ac_optarg" ;;
325
326   -program-transform-name | --program-transform-name \
327   | --program-transform-nam | --program-transform-na \
328   | --program-transform-n | --program-transform- \
329   | --program-transform | --program-transfor \
330   | --program-transfo | --program-transf \
331   | --program-trans | --program-tran \
332   | --progr-tra | --program-tr | --program-t)
333     ac_prev=program_transform_name ;;
334   -program-transform-name=* | --program-transform-name=* \
335   | --program-transform-nam=* | --program-transform-na=* \
336   | --program-transform-n=* | --program-transform-=* \
337   | --program-transform=* | --program-transfor=* \
338   | --program-transfo=* | --program-transf=* \
339   | --program-trans=* | --program-tran=* \
340   | --progr-tra=* | --program-tr=* | --program-t=*)
341     program_transform_name="$ac_optarg" ;;
342
343   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
344   | -silent | --silent | --silen | --sile | --sil)
345     silent=yes ;;
346
347   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
348     ac_prev=sbindir ;;
349   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
350   | --sbi=* | --sb=*)
351     sbindir="$ac_optarg" ;;
352
353   -sharedstatedir | --sharedstatedir | --sharedstatedi \
354   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
355   | --sharedst | --shareds | --shared | --share | --shar \
356   | --sha | --sh)
357     ac_prev=sharedstatedir ;;
358   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
359   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
360   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
361   | --sha=* | --sh=*)
362     sharedstatedir="$ac_optarg" ;;
363
364   -site | --site | --sit)
365     ac_prev=site ;;
366   -site=* | --site=* | --sit=*)
367     site="$ac_optarg" ;;
368
369   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
370     ac_prev=srcdir ;;
371   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
372     srcdir="$ac_optarg" ;;
373
374   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
375   | --syscon | --sysco | --sysc | --sys | --sy)
376     ac_prev=sysconfdir ;;
377   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
378   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
379     sysconfdir="$ac_optarg" ;;
380
381   -target | --target | --targe | --targ | --tar | --ta | --t)
382     ac_prev=target ;;
383   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
384     target="$ac_optarg" ;;
385
386   -v | -verbose | --verbose | --verbos | --verbo | --verb)
387     verbose=yes ;;
388
389   -version | --version | --versio | --versi | --vers)
390     echo "configure generated by autoconf version 2.13"
391     exit 0 ;;
392
393   -with-* | --with-*)
394     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
395     # Reject names that are not valid shell variable names.
396     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
397       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
398     fi
399     ac_package=`echo $ac_package| sed 's/-/_/g'`
400     case "$ac_option" in
401       *=*) ;;
402       *) ac_optarg=yes ;;
403     esac
404     eval "with_${ac_package}='$ac_optarg'" ;;
405
406   -without-* | --without-*)
407     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
408     # Reject names that are not valid shell variable names.
409     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
410       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
411     fi
412     ac_package=`echo $ac_package| sed 's/-/_/g'`
413     eval "with_${ac_package}=no" ;;
414
415   --x)
416     # Obsolete; use --with-x.
417     with_x=yes ;;
418
419   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
420   | --x-incl | --x-inc | --x-in | --x-i)
421     ac_prev=x_includes ;;
422   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
423   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
424     x_includes="$ac_optarg" ;;
425
426   -x-libraries | --x-libraries | --x-librarie | --x-librari \
427   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
428     ac_prev=x_libraries ;;
429   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
430   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
431     x_libraries="$ac_optarg" ;;
432
433   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
434     ;;
435
436   *)
437     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
438       echo "configure: warning: $ac_option: invalid host type" 1>&2
439     fi
440     if test "x$nonopt" != xNONE; then
441       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
442     fi
443     nonopt="$ac_option"
444     ;;
445
446   esac
447 done
448
449 if test -n "$ac_prev"; then
450   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
451 fi
452
453 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
454
455 # File descriptor usage:
456 # 0 standard input
457 # 1 file creation
458 # 2 errors and warnings
459 # 3 some systems may open it to /dev/tty
460 # 4 used on the Kubota Titan
461 # 6 checking for... messages and results
462 # 5 compiler messages saved in config.log
463 if test "$silent" = yes; then
464   exec 6>/dev/null
465 else
466   exec 6>&1
467 fi
468 exec 5>./config.log
469
470 echo "\
471 This file contains any messages produced by compilers while
472 running configure, to aid debugging if configure makes a mistake.
473 " 1>&5
474
475 # Strip out --no-create and --no-recursion so they do not pile up.
476 # Also quote any args containing shell metacharacters.
477 ac_configure_args=
478 for ac_arg
479 do
480   case "$ac_arg" in
481   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
482   | --no-cr | --no-c) ;;
483   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
484   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
485   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
486   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
487   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
488   esac
489 done
490
491 # NLS nuisances.
492 # Only set these to C if already set.  These must not be set unconditionally
493 # because not all systems understand e.g. LANG=C (notably SCO).
494 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
495 # Non-C LC_CTYPE values break the ctype check.
496 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
497 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
498 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
499 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
500
501 # confdefs.h avoids OS command line length limits that DEFS can exceed.
502 rm -rf conftest* confdefs.h
503 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
504 echo > confdefs.h
505
506 # A filename unique to this package, relative to the directory that
507 # configure is in, which we can look for to find out if srcdir is correct.
508 ac_unique_file=move-if-change
509
510 # Find the source files, if location was not specified.
511 if test -z "$srcdir"; then
512   ac_srcdir_defaulted=yes
513   # Try the directory containing this script, then its parent.
514   ac_prog=$0
515   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
516   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
517   srcdir=$ac_confdir
518   if test ! -r $srcdir/$ac_unique_file; then
519     srcdir=..
520   fi
521 else
522   ac_srcdir_defaulted=no
523 fi
524 if test ! -r $srcdir/$ac_unique_file; then
525   if test "$ac_srcdir_defaulted" = yes; then
526     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
527   else
528     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
529   fi
530 fi
531 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
532
533 # Prefer explicitly selected file to automatically selected ones.
534 if test -z "$CONFIG_SITE"; then
535   if test "x$prefix" != xNONE; then
536     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
537   else
538     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
539   fi
540 fi
541 for ac_site_file in $CONFIG_SITE; do
542   if test -r "$ac_site_file"; then
543     echo "loading site script $ac_site_file"
544     . "$ac_site_file"
545   fi
546 done
547
548 if test -r "$cache_file"; then
549   echo "loading cache $cache_file"
550   . $cache_file
551 else
552   echo "creating cache $cache_file"
553   > $cache_file
554 fi
555
556 ac_ext=c
557 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
558 ac_cpp='$CPP $CPPFLAGS'
559 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
560 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
561 cross_compiling=$ac_cv_prog_cc_cross
562
563 ac_exeext=
564 ac_objext=o
565 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
566   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
567   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
568     ac_n= ac_c='
569 ' ac_t='        '
570   else
571     ac_n=-n ac_c= ac_t=
572   fi
573 else
574   ac_n= ac_c='\c' ac_t=
575 fi
576
577
578
579 ac_aux_dir=
580 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
581   if test -f $ac_dir/install-sh; then
582     ac_aux_dir=$ac_dir
583     ac_install_sh="$ac_aux_dir/install-sh -c"
584     break
585   elif test -f $ac_dir/install.sh; then
586     ac_aux_dir=$ac_dir
587     ac_install_sh="$ac_aux_dir/install.sh -c"
588     break
589   fi
590 done
591 if test -z "$ac_aux_dir"; then
592   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
593 fi
594 ac_config_guess=$ac_aux_dir/config.guess
595 ac_config_sub=$ac_aux_dir/config.sub
596 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
597
598
599 # Do some error checking and defaulting for the host and target type.
600 # The inputs are:
601 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
602 #
603 # The rules are:
604 # 1. You are not allowed to specify --host, --target, and nonopt at the
605 #    same time.
606 # 2. Host defaults to nonopt.
607 # 3. If nonopt is not specified, then host defaults to the current host,
608 #    as determined by config.guess.
609 # 4. Target and build default to nonopt.
610 # 5. If nonopt is not specified, then target and build default to host.
611
612 # The aliases save the names the user supplied, while $host etc.
613 # will get canonicalized.
614 case $host---$target---$nonopt in
615 NONE---*---* | *---NONE---* | *---*---NONE) ;;
616 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
617 esac
618
619
620 # Make sure we can run config.sub.
621 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
622 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
623 fi
624
625 echo $ac_n "checking host system type""... $ac_c" 1>&6
626 echo "configure:627: checking host system type" >&5
627
628 host_alias=$host
629 case "$host_alias" in
630 NONE)
631   case $nonopt in
632   NONE)
633     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
634     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
635     fi ;;
636   *) host_alias=$nonopt ;;
637   esac ;;
638 esac
639
640 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
641 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
642 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
643 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
644 echo "$ac_t""$host" 1>&6
645
646 echo $ac_n "checking target system type""... $ac_c" 1>&6
647 echo "configure:648: checking target system type" >&5
648
649 target_alias=$target
650 case "$target_alias" in
651 NONE)
652   case $nonopt in
653   NONE) target_alias=$host_alias ;;
654   *) target_alias=$nonopt ;;
655   esac ;;
656 esac
657
658 target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
659 target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
660 target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
661 target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
662 echo "$ac_t""$target" 1>&6
663
664 echo $ac_n "checking build system type""... $ac_c" 1>&6
665 echo "configure:666: checking build system type" >&5
666
667 build_alias=$build
668 case "$build_alias" in
669 NONE)
670   case $nonopt in
671   NONE) build_alias=$host_alias ;;
672   *) build_alias=$nonopt ;;
673   esac ;;
674 esac
675
676 build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
677 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
678 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
679 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
680 echo "$ac_t""$build" 1>&6
681
682 test "$host_alias" != "$target_alias" &&
683   test "$program_prefix$program_suffix$program_transform_name" = \
684     NONENONEs,x,x, &&
685   program_prefix=${target_alias}-
686
687 if test "$program_transform_name" = s,x,x,; then
688   program_transform_name=
689 else
690   # Double any \ or $.  echo might interpret backslashes.
691   cat <<\EOF_SED > conftestsed
692 s,\\,\\\\,g; s,\$,$$,g
693 EOF_SED
694   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
695   rm -f conftestsed
696 fi
697 test "$program_prefix" != NONE &&
698   program_transform_name="s,^,${program_prefix},; $program_transform_name"
699 # Use a double $ so make ignores it.
700 test "$program_suffix" != NONE &&
701   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
702
703 # sed with no file args requires a program.
704 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
705
706
707 # Get 'install' or 'install-sh' and its variants.
708 # Find a good install program.  We prefer a C program (faster),
709 # so one script is as good as another.  But avoid the broken or
710 # incompatible versions:
711 # SysV /etc/install, /usr/sbin/install
712 # SunOS /usr/etc/install
713 # IRIX /sbin/install
714 # AIX /bin/install
715 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
716 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
717 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
718 # ./install, which can be erroneously created by make from ./install.sh.
719 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
720 echo "configure:721: checking for a BSD compatible install" >&5
721 if test -z "$INSTALL"; then
722 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
723   echo $ac_n "(cached) $ac_c" 1>&6
724 else
725     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
726   for ac_dir in $PATH; do
727     # Account for people who put trailing slashes in PATH elements.
728     case "$ac_dir/" in
729     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
730     *)
731       # OSF1 and SCO ODT 3.0 have their own names for install.
732       # Don't use installbsd from OSF since it installs stuff as root
733       # by default.
734       for ac_prog in ginstall scoinst install; do
735         if test -f $ac_dir/$ac_prog; then
736           if test $ac_prog = install &&
737             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
738             # AIX install.  It has an incompatible calling convention.
739             :
740           else
741             ac_cv_path_install="$ac_dir/$ac_prog -c"
742             break 2
743           fi
744         fi
745       done
746       ;;
747     esac
748   done
749   IFS="$ac_save_IFS"
750
751 fi
752   if test "${ac_cv_path_install+set}" = set; then
753     INSTALL="$ac_cv_path_install"
754   else
755     # As a last resort, use the slow shell script.  We don't cache a
756     # path for INSTALL within a source directory, because that will
757     # break other packages using the cache if that directory is
758     # removed, or if the path is relative.
759     INSTALL="$ac_install_sh"
760   fi
761 fi
762 echo "$ac_t""$INSTALL" 1>&6
763
764 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
765 # It thinks the first close brace ends the variable substitution.
766 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
767
768 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
769
770 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
771
772 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
773 echo "configure:774: checking whether ln works" >&5
774 if eval "test \"`echo '$''{'acx_cv_prog_LN'+set}'`\" = set"; then
775   echo $ac_n "(cached) $ac_c" 1>&6
776 else
777   rm -f conftestdata_t
778 echo >conftestdata_f
779 if ln conftestdata_f conftestdata_t 2>/dev/null
780 then
781   acx_cv_prog_LN=ln
782 else
783   acx_cv_prog_LN=no
784 fi
785 rm -f conftestdata_f conftestdata_t
786
787 fi
788 if test $acx_cv_prog_LN = no; then
789   LN="cp"
790   echo "$ac_t""no, using $LN" 1>&6
791 else
792   LN="$acx_cv_prog_LN"
793   echo "$ac_t""yes" 1>&6
794 fi
795
796 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
797 echo "configure:798: checking whether ln -s works" >&5
798 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
799   echo $ac_n "(cached) $ac_c" 1>&6
800 else
801   rm -f conftestdata
802 if ln -s X conftestdata 2>/dev/null
803 then
804   rm -f conftestdata
805   ac_cv_prog_LN_S="ln -s"
806 else
807   ac_cv_prog_LN_S=ln
808 fi
809 fi
810 LN_S="$ac_cv_prog_LN_S"
811 if test "$ac_cv_prog_LN_S" = "ln -s"; then
812   echo "$ac_t""yes" 1>&6
813 else
814   echo "$ac_t""no" 1>&6
815 fi
816
817
818 ### we might need to use some other shell than /bin/sh for running subshells
819 ### If we are on Windows, search for the shell.  This will permit people
820 ### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure
821 ### without also having to set CONFIG_SHELL.  This code will work when
822 ### using bash, which sets OSTYPE.
823 case "${OSTYPE}" in
824 *win32*)
825   if test x${CONFIG_SHELL} = x ; then
826     if test ! -f /bin/sh ; then
827       if test x${SHELL} != x && test -f ${SHELL} ; then
828         CONFIG_SHELL=${SHELL}
829         export CONFIG_SHELL
830       else
831         for prog in sh sh.exe bash bash.exe; do
832           IFS="${IFS=   }"; save_ifs="$IFS"; IFS="${IFS}:"
833           for dir in $PATH; do
834             test -z "$dir" && dir=.
835             if test -f $dir/$prog; then
836               CONFIG_SHELL=$dir/$prog
837               export CONFIG_SHELL
838               break
839             fi
840           done
841           IFS="$save_ifs"
842           test -n "${CONFIG_SHELL}" && break
843         done
844       fi
845     fi
846   fi
847   ;;
848 esac
849
850 config_shell=${CONFIG_SHELL-/bin/sh}
851
852 progname=$0
853 # if PWD already has a value, it is probably wrong.
854 if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
855
856 # Export original configure arguments for use by sub-configures.  These
857 # will be expanded by make, so quote '$'.
858 tmp="$progname $@"
859 sed -e 's,\$,$$,g' <<EOF_SED > conftestsed.out
860 $tmp
861 EOF_SED
862 TOPLEVEL_CONFIGURE_ARGUMENTS=`cat conftestsed.out`
863 rm -f conftestsed.out
864
865
866 moveifchange=${srcdir}/move-if-change
867
868 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
869
870 # We pass INSTALL explicitly to sub-makes.  Make sure that it is not
871 # a relative path.
872 if test "$INSTALL" = "${srcdir}/install-sh -c"; then
873   INSTALL="${srcpwd}/install-sh -c"
874 fi
875
876 # Set srcdir to "." if that's what it is.
877 # This is important for multilib support.
878 pwd=`${PWDCMD-pwd}`
879 if test "${pwd}" = "${srcpwd}" ; then
880   srcdir=.
881 fi
882
883 topsrcdir=$srcpwd
884
885 extra_host_args=
886
887 ### To add a new directory to the tree, first choose whether it is a target
888 ### or a host dependent tool.  Then put it into the appropriate list
889 ### (library or tools, host or target), doing a dependency sort.
890
891 # Subdirs will be configured in the order listed in build_configdirs, 
892 # configdirs, or target_configdirs; see the serialization section below.
893
894 # Dependency sorting is only needed when *configuration* must be done in 
895 # a particular order.  In all cases a dependency should be specified in 
896 # the Makefile, whether or not it's implicitly specified here.
897
898 # Double entries in build_configdirs, configdirs, or target_configdirs may
899 # cause circular dependencies and break everything horribly.
900
901 # these library is used by various programs built for the build
902 # environment
903 #
904 build_libs="build-libiberty"
905
906 # these tools are built for the build environment
907 build_tools="build-texinfo build-byacc build-flex build-bison build-m4 build-fixincludes"
908
909 # these libraries are used by various programs built for the host environment
910 #
911 host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber"
912
913 # these tools are built for the host environment
914 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
915 # know that we are building the simulator.
916 # binutils, gas and ld appear in that order because it makes sense to run
917 # "make check" in that particular order.
918 host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools"
919
920 # libgcj represents the runtime libraries only used by gcj.
921 libgcj="target-libffi \
922         target-zlib \
923         target-qthreads \
924         target-libjava"
925
926 # these libraries are built for the target environment, and are built after
927 # the host libraries and the host tools (which may be a cross compiler)
928 #
929 target_libraries="target-libiberty \
930                 target-libgloss \
931                 target-newlib \
932                 target-libstdc++-v3 \
933                 target-libmudflap \
934                 target-libssp \
935                 target-libgfortran \
936                 target-boehm-gc \
937                 ${libgcj} \
938                 target-libobjc \
939                 target-libada \
940                 target-libgomp"
941
942 # these tools are built using the target libraries, and are intended to
943 # run only in the target environment
944 #
945 # note: any program that *uses* libraries that are in the "target_libraries"
946 # list belongs in this list.  those programs are also very likely
947 # candidates for the "native_only" list which follows
948 #
949 target_tools="target-examples target-groff target-gperf target-rda"
950
951 ################################################################################
952
953 ## All tools belong in one of the four categories, and are assigned above
954 ## We assign ${configdirs} this way to remove all embedded newlines.  This
955 ## is important because configure will choke if they ever get through.
956 ## ${configdirs} is directories we build using the host tools.
957 ## ${target_configdirs} is directories we build using the target tools.
958 configdirs=`echo ${host_libs} ${host_tools}`
959 target_configdirs=`echo ${target_libraries} ${target_tools}`
960 build_configdirs=`echo ${build_libs} ${build_tools}`
961
962 ################################################################################
963
964 srcname="gnu development package"
965
966 # This gets set non-empty for some net releases of packages.
967 appdirs=""
968
969 # Define is_cross_compiler to save on calls to 'test'.
970 is_cross_compiler=
971 if test x"${host}" = x"${target}" ; then
972   is_cross_compiler=no
973 else
974   is_cross_compiler=yes
975 fi      
976
977 # Find the build and target subdir names.
978  case ${build_alias} in
979   "") build_noncanonical=${build} ;;
980   *) build_noncanonical=${build_alias} ;;
981 esac
982
983  case ${host_alias} in
984   "") host_noncanonical=${build_noncanonical} ;;
985   *) host_noncanonical=${host_alias} ;;
986 esac
987
988  case ${target_alias} in
989   "") target_noncanonical=${host_noncanonical} ;;
990   *) target_noncanonical=${target_alias} ;;
991 esac
992
993   
994 # post-stage1 host modules use a different CC_FOR_BUILD so, in order to
995 # have matching libraries, they should use host libraries: Makefile.tpl
996 # arranges to pass --with-build-libsubdir=$(HOST_SUBDIR).
997 # However, they still use the build modules, because the corresponding
998 # host modules (e.g. bison) are only built for the host when bootstrap
999 # finishes. So:
1000 # - build_subdir is where we find build modules, and never changes.
1001 # - build_libsubdir is where we find build libraries, and can be overridden.
1002
1003 # Prefix 'build-' so this never conflicts with target_subdir.
1004 build_subdir="build-${build_noncanonical}"
1005 # Check whether --with-build-libsubdir or --without-build-libsubdir was given.
1006 if test "${with_build_libsubdir+set}" = set; then
1007   withval="$with_build_libsubdir"
1008   build_libsubdir="$withval"
1009 else
1010   build_libsubdir="$build_subdir"
1011 fi
1012
1013 # --srcdir=. covers the toplevel, while "test -d" covers the subdirectories
1014 if ( test $srcdir = . && test -d gcc ) \
1015    || test -d $srcdir/../host-${host_noncanonical}; then
1016   host_subdir="host-${host_noncanonical}"
1017 else
1018   host_subdir=.
1019 fi
1020 # No prefix.
1021 target_subdir=${target_noncanonical}
1022     
1023
1024 # Skipdirs are removed silently.
1025 skipdirs=
1026 # Noconfigdirs are removed loudly.
1027 noconfigdirs=""
1028
1029 use_gnu_ld=
1030 # Make sure we don't let GNU ld be added if we didn't want it.
1031 if test x$with_gnu_ld = xno ; then
1032   use_gnu_ld=no
1033   noconfigdirs="$noconfigdirs ld"
1034 fi
1035
1036 use_gnu_as=
1037 # Make sure we don't let GNU as be added if we didn't want it.
1038 if test x$with_gnu_as = xno ; then
1039   use_gnu_as=no
1040   noconfigdirs="$noconfigdirs gas"
1041 fi
1042
1043 # some tools are so dependent upon X11 that if we're not building with X, 
1044 # it's not even worth trying to configure, much less build, that tool.
1045
1046 case ${with_x} in
1047   yes | "") ;; # the default value for this tree is that X11 is available
1048   no)
1049     skipdirs="${skipdirs} tk itcl libgui"
1050     # We won't be able to build gdbtk without X.
1051     enable_gdbtk=no 
1052     ;;
1053   *)  echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
1054 esac
1055
1056 # Some tools are only suitable for building in a "native" situation.
1057 # Remove these if host!=target.  
1058 native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
1059
1060 # Similarly, some are only suitable for cross toolchains.
1061 # Remove these if host=target.
1062 cross_only="target-libgloss target-newlib target-opcodes"
1063
1064 case $is_cross_compiler in
1065   no) skipdirs="${skipdirs} ${cross_only}" ;;
1066   yes) skipdirs="${skipdirs} ${native_only}" ;;
1067 esac
1068
1069 # If both --with-headers and --with-libs are specified, default to
1070 # --without-newlib.
1071 if test x"${with_headers}" != x && test x"${with_headers}" != xno \
1072    && test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
1073   if test x"${with_newlib}" = x ; then
1074     with_newlib=no
1075   fi
1076 fi
1077
1078 # Recognize --with-newlib/--without-newlib.
1079 case ${with_newlib} in
1080   no) skipdirs="${skipdirs} target-newlib" ;;
1081   yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
1082 esac
1083
1084 # Configure extra directories which are host specific
1085
1086 case "${host}" in
1087   *-cygwin*)
1088     configdirs="$configdirs libtermcap" ;;
1089 esac
1090
1091 # A target can indicate whether a language isn't supported for some reason.
1092 # Only spaces may be used in this macro; not newlines or tabs.
1093 unsupported_languages=
1094
1095 # Remove more programs from consideration, based on the host or 
1096 # target this usually means that a port of the program doesn't
1097 # exist yet.
1098
1099 case "${host}" in
1100   hppa*64*-*-*)
1101     noconfigdirs="$noconfigdirs byacc"
1102     ;;
1103   i[3456789]86-*-vsta)
1104     noconfigdirs="$noconfigdirs tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl itcl gnuserv gettext"
1105     ;;
1106   i[3456789]86-*-go32* | i[3456789]86-*-msdosdjgpp*)
1107     noconfigdirs="$noconfigdirs tcl tk expect dejagnu send-pr uudecode guile itcl gnuserv libffi"
1108     ;;
1109   i[3456789]86-*-mingw32*)
1110     # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl gnuserv"
1111     noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib"
1112     ;;
1113   i[3456789]86-*-beos*)
1114     noconfigdirs="$noconfigdirs tk itcl libgui gdb"
1115     ;;
1116   *-*-cygwin*)
1117     noconfigdirs="$noconfigdirs autoconf automake send-pr rcs guile perl"
1118     ;;
1119   *-*-netbsd*)
1120     noconfigdirs="$noconfigdirs rcs"
1121     ;;
1122   ppc*-*-pe)
1123     noconfigdirs="$noconfigdirs patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl gnuserv"
1124     ;;
1125   powerpc-*-beos*)
1126     noconfigdirs="$noconfigdirs tk itcl libgui gdb dejagnu readline"
1127     ;;
1128 esac
1129
1130
1131 # Check whether --enable-libada or --disable-libada was given.
1132 if test "${enable_libada+set}" = set; then
1133   enableval="$enable_libada"
1134   ENABLE_LIBADA=$enableval
1135 else
1136   ENABLE_LIBADA=yes
1137 fi
1138
1139 if test "${ENABLE_LIBADA}" != "yes" ; then
1140   noconfigdirs="$noconfigdirs gnattools"
1141 fi
1142
1143 # Check whether --enable-libssp or --disable-libssp was given.
1144 if test "${enable_libssp+set}" = set; then
1145   enableval="$enable_libssp"
1146   ENABLE_LIBSSP=$enableval
1147 else
1148   ENABLE_LIBSSP=yes
1149 fi
1150
1151
1152 # Save it here so that, even in case of --enable-libgcj, if the Java
1153 # front-end isn't enabled, we still get libgcj disabled.
1154 libgcj_saved=$libgcj
1155 case $enable_libgcj in
1156 yes)
1157   # If we reset it here, it won't get added to noconfigdirs in the
1158   # target-specific build rules, so it will be forcibly enabled
1159   # (unless the Java language itself isn't enabled).
1160   libgcj=
1161   ;;
1162 no)
1163   # Make sure we get it printed in the list of not supported target libs.
1164   noconfigdirs="$noconfigdirs ${libgcj}"
1165   ;;
1166 esac
1167
1168
1169 # Disable libmudflap on some systems.
1170 if test x$enable_libmudflap = x ; then
1171     case "${target}" in
1172     *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
1173         # Enable libmudflap by default in GNU and friends.
1174         ;;
1175     *-*-freebsd*)
1176         # Enable libmudflap by default in FreeBSD.
1177         ;;
1178     *)
1179         # Disable it by default everywhere else.
1180         noconfigdirs="$noconfigdirs target-libmudflap"
1181         ;;
1182     esac
1183 fi
1184
1185 # Disable libgomp on non POSIX hosted systems.
1186 if test x$enable_libgomp = x ; then
1187     # Enable libgomp by default on hosted POSIX systems.
1188     case "${target}" in
1189     *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
1190         ;;
1191     *-*-netbsd* | *-*-freebsd* | *-*-openbsd*)
1192         ;;
1193     *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*)
1194         ;;
1195     *-*-darwin* | *-*-aix*)
1196         ;;
1197     *)
1198         noconfigdirs="$noconfigdirs target-libgomp"
1199         ;;
1200     esac
1201 fi
1202
1203
1204 case "${target}" in
1205   *-*-chorusos)
1206     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
1207     ;;
1208   powerpc-*-darwin*)
1209     noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
1210     noconfigdirs="$noconfigdirs sim target-rda"
1211     ;;
1212   *-*-darwin*)
1213     noconfigdirs="$noconfigdirs ld gas gdb gprof"
1214     noconfigdirs="$noconfigdirs sim target-rda"
1215     noconfigdirs="$noconfigdirs ${libgcj}"
1216     ;;
1217   *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
1218     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
1219     ;;
1220   *-*-freebsd*)
1221     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
1222     if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
1223         && test -f /usr/local/include/gmp.h; then
1224       with_gmp=/usr/local
1225     fi
1226
1227     # Skip some stuff that's unsupported on some FreeBSD configurations.
1228     case "${target}" in
1229       i*86-*-*) ;;
1230       alpha*-*-*) ;;
1231       *)
1232         noconfigdirs="$noconfigdirs ${libgcj}"
1233         ;;
1234     esac
1235     ;;
1236   *-*-kaos*)
1237     # Remove unsupported stuff on all kaOS configurations.
1238     skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-librx"
1239     skipdirs="$skipdirs target-libobjc target-examples target-groff target-gperf"
1240     skipdirs="$skipdirs zlib fastjar target-libjava target-boehm-gc target-zlib"
1241     noconfigdirs="$noconfigdirs target-libgloss"
1242     ;;
1243   *-*-netbsd*)
1244     # Skip some stuff on all NetBSD configurations.
1245     noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss"
1246
1247     # Skip some stuff that's unsupported on some NetBSD configurations.
1248     case "${target}" in
1249       i*86-*-netbsdelf*) ;;
1250       arm*-*-netbsdelf*) ;;
1251       *)
1252         noconfigdirs="$noconfigdirs ${libgcj}"
1253         ;;
1254     esac
1255     ;;
1256   *-*-netware*)
1257     noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss ${libgcj} target-libmudflap"
1258     ;;
1259   *-*-rtems*)
1260     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1261     ;;
1262     # The tpf target doesn't support gdb yet.
1263   *-*-tpf*)
1264     noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty ${libgcj} target-libmudflap gdb tcl tk libgui itcl"
1265     ;;
1266   *-*-uclinux*)
1267     noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda ${libgcj}"
1268     ;;
1269   *-*-vxworks*)
1270     noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty target-libstdc++-v3 ${libgcj}"
1271     ;;
1272   alpha*-dec-osf*)
1273     # ld works, but does not support shared libraries.
1274     # newlib is not 64 bit ready.  I'm not sure about fileutils.
1275     # gas doesn't generate exception information.
1276     noconfigdirs="$noconfigdirs gas ld fileutils target-newlib target-libgloss"
1277     ;;
1278   alpha*-*-*vms*)
1279     noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss ${libgcj}"
1280     ;;
1281   alpha*-*-linux*)
1282     # newlib is not 64 bit ready
1283     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
1284     ;;
1285   alpha*-*-*)
1286     # newlib is not 64 bit ready
1287     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
1288     ;;
1289   am33_2.0-*-linux*)
1290     noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
1291     ;;
1292   sh-*-linux*)
1293     noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
1294     ;;    
1295   sh*-*-pe|mips*-*-pe|*arm-wince-pe)
1296     noconfigdirs="$noconfigdirs ${libgcj}"
1297     noconfigdirs="$noconfigdirs target-examples"
1298     noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr"
1299     noconfigdirs="$noconfigdirs tcl tk itcl libgui sim"
1300     noconfigdirs="$noconfigdirs expect dejagnu"
1301     # the C++ libraries don't build on top of CE's C libraries
1302     noconfigdirs="$noconfigdirs target-libstdc++-v3"
1303     noconfigdirs="$noconfigdirs target-newlib"
1304     case "${host}" in
1305       *-*-cygwin*) ;; # keep gdb and readline
1306       *) noconfigdirs="$noconfigdirs gdb readline"
1307          ;;
1308     esac
1309     ;;
1310   arc-*-*)
1311     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1312     ;;
1313   arm-semi-aof )
1314     ;;
1315   arm-*-coff | strongarm-*-coff | xscale-*-coff)
1316     noconfigdirs="$noconfigdirs ${libgcj}"
1317     ;;
1318   arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
1319     noconfigdirs="$noconfigdirs target-libffi target-qthreads"
1320     ;;
1321   arm*-*-linux-gnueabi)
1322     noconfigdirs="$noconfigdirs target-libffi target-qthreads"
1323     noconfigdirs="$noconfigdirs target-libjava target-libobjc"
1324     ;;
1325   arm*-*-symbianelf*)
1326     noconfigdirs="$noconfigdirs ${libgcj} target-libiberty"
1327     ;;
1328   arm-*-pe*)
1329     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1330     ;;
1331   thumb-*-coff)
1332     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1333     ;;
1334   thumb-*-elf)
1335     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1336     ;;
1337   thumb-*-pe)
1338     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1339     ;;
1340   arm-*-riscix*)
1341     noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
1342     ;;
1343   avr-*-*)
1344     noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
1345     ;;
1346   bfin-*-*)
1347     noconfigdirs="$noconfigdirs gdb"
1348     if test x${is_cross_compiler} != xno ; then
1349       target_configdirs="${target_configdirs} target-bsp target-cygmon"
1350     fi
1351     ;;
1352   c4x-*-* | tic4x-*-*)
1353     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
1354     ;;
1355   c54x*-*-* | tic54x-*-*)
1356     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib"
1357     ;;
1358   cris-*-* | crisv32-*-*)
1359     unsupported_languages="$unsupported_languages java"
1360     case "${target}" in
1361       *-*-aout)
1362         unsupported_languages="$unsupported_languages fortran"
1363         noconfigdirs="$noconfigdirs target-libffi target-boehm-gc";;
1364       *-*-elf)
1365         unsupported_languages="$unsupported_languages fortran"
1366         noconfigdirs="$noconfigdirs target-boehm-gc";;
1367       *-*-linux*)
1368         noconfigdirs="$noconfigdirs target-newlib target-libgloss";;
1369       *)
1370         unsupported_languages="$unsupported_languages fortran"
1371         noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss";;
1372     esac
1373     ;;
1374   crx-*-*)
1375     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-mudflap ${libgcj}"
1376     ;;
1377   d10v-*-*)
1378     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
1379     ;;
1380   d30v-*-*)
1381     noconfigdirs="$noconfigdirs ${libgcj} gdb"
1382     ;;
1383   fr30-*-elf*)
1384     noconfigdirs="$noconfigdirs ${libgcj} gdb"
1385     ;;
1386   frv-*-*)
1387     noconfigdirs="$noconfigdirs ${libgcj}"
1388     ;;
1389   h8300*-*-*)
1390     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1391     ;;
1392   h8500-*-*)
1393     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
1394     ;;
1395   hppa1.1-*-osf* | hppa1.1-*-bsd* )
1396     ;;
1397   hppa*64*-*-linux* | parisc*64*-*-linux*)
1398     # In this case, it's because the hppa64-linux target is for
1399     # the kernel only at this point and has no libc, and thus no
1400     # headers, crt*.o, etc., all of which are needed by these.
1401     noconfigdirs="$noconfigdirs target-zlib"
1402     ;;
1403   parisc*-*-linux* | hppa*-*-linux*)
1404     ;;
1405   hppa*-*-*elf* | \
1406   hppa*-*-lites* | \
1407   hppa*-*-openbsd* | \
1408   hppa*64*-*-*)
1409     noconfigdirs="$noconfigdirs ${libgcj}"
1410     ;;
1411   hppa*-hp-hpux11*)
1412     noconfigdirs="$noconfigdirs ld shellutils"
1413     ;;
1414   hppa*-*-*)
1415     # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
1416     # build on HP-UX 10.20.
1417     noconfigdirs="$noconfigdirs ld shellutils ${libgcj}"
1418     ;;
1419   i960-*-*)
1420     noconfigdirs="$noconfigdirs ${libgcj} gdb"
1421     ;;
1422   ia64*-*-elf*)
1423     # No gdb support yet.
1424     noconfigdirs="$noconfigdirs readline mmalloc libgui itcl gdb"
1425     ;;
1426   ia64*-**-hpux*)
1427     # No gdb or ld support yet.
1428     noconfigdirs="$noconfigdirs ${libgcj} readline mmalloc libgui itcl gdb ld"
1429     ;;
1430   i370-*-opened*)
1431     ;;
1432   i[3456789]86-*-coff | i[3456789]86-*-elf)
1433     noconfigdirs="$noconfigdirs ${libgcj}"
1434     ;;
1435   i[3456789]86-*-linux*)
1436     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
1437     # not build java stuff by default.
1438     case "${target}" in
1439       *-*-*libc1*)
1440         noconfigdirs="$noconfigdirs ${libgcj}";;
1441     esac
1442
1443     # This section makes it possible to build newlib natively on linux.
1444     # If we are using a cross compiler then don't configure newlib.
1445     if test x${is_cross_compiler} != xno ; then
1446       noconfigdirs="$noconfigdirs target-newlib"
1447     fi
1448     noconfigdirs="$noconfigdirs target-libgloss"
1449     # If we are not using a cross compiler, do configure newlib.
1450     # Note however, that newlib will only be configured in this situation
1451     # if the --with-newlib option has been given, because otherwise
1452     # 'target-newlib' will appear in skipdirs.
1453     ;;
1454   i[3456789]86-*-mingw32*)
1455     target_configdirs="$target_configdirs target-winsup"
1456     noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
1457     ;;    
1458   *-*-cygwin*)
1459     target_configdirs="$target_configdirs target-libtermcap target-winsup"
1460     noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
1461     # always build newlib if winsup directory is present.
1462     if test -d "$srcdir/winsup/cygwin"; then
1463       skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
1464     elif test -d "$srcdir/newlib"; then
1465       echo "Warning: winsup/cygwin is missing so newlib can't be built."
1466     fi
1467     ;;    
1468   i[3456789]86-moss-msdos | i[3456789]86-*-moss* | \
1469   i[3456789]86-*-uwin* | i[3456789]86-*-interix* )
1470     ;;
1471   i[3456789]86-*-pe)
1472     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
1473     ;;
1474   i[3456789]86-*-sco3.2v5*)
1475     # The linker does not yet know about weak symbols in COFF,
1476     # and is not configured to handle mixed ELF and COFF.
1477     noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
1478     ;;
1479   i[3456789]86-*-sco*)
1480     noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
1481     ;;
1482   i[3456789]86-*-solaris2*)
1483     noconfigdirs="$noconfigdirs target-libgloss"
1484     ;;
1485   i[3456789]86-*-sysv4*)
1486     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1487     ;;
1488   i[3456789]86-*-beos*)
1489     noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
1490     ;;
1491   i[3456789]86-*-rdos*)
1492     noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
1493     ;;
1494   m32r-*-*)
1495     noconfigdirs="$noconfigdirs ${libgcj}"
1496     ;;
1497   m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
1498     noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
1499     ;;
1500   m68k-*-elf*)
1501     noconfigdirs="$noconfigdirs ${libgcj}"
1502     ;;
1503   m68k-*-coff*)
1504     noconfigdirs="$noconfigdirs ${libgcj}"
1505     ;;
1506   mcore-*-pe*)
1507   # The EPOC C++ environment does not support exceptions or rtti,
1508   # and so building libstdc++-v3 tends not to always work.
1509     noconfigdirs="$noconfigdirs target-libstdc++-v3"
1510     ;;
1511   mmix-*-*)
1512     noconfigdirs="$noconfigdirs target-libffi target-boehm-gc gdb libgloss"
1513     unsupported_languages="$unsupported_languages fortran java"
1514     ;;
1515   mn10200-*-*)
1516     noconfigdirs="$noconfigdirs ${libgcj}"
1517     ;;
1518   mn10300-*-*)
1519     noconfigdirs="$noconfigdirs ${libgcj}"
1520     ;;
1521   mt-*-*)
1522     noconfigdirs="$noconfigdirs sim"
1523     ;;
1524   powerpc-*-aix*)
1525     # copied from rs6000-*-* entry
1526     noconfigdirs="$noconfigdirs gprof target-libgloss target-libssp ${libgcj}"
1527     ;;
1528   powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
1529     target_configdirs="$target_configdirs target-winsup"
1530     noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl gnuserv ${libgcj}"
1531     # always build newlib.
1532     skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
1533     ;;
1534     # This is temporary until we can link against shared libraries
1535   powerpcle-*-solaris*)
1536     noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl gnuserv ${libgcj}"
1537     ;;
1538   powerpc-*-beos*)
1539     noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
1540     ;;
1541   powerpc-*-eabi)
1542     noconfigdirs="$noconfigdirs ${libgcj}"
1543     ;;
1544   powerpc-*-eabi* | powerpcle-*-eabi* | powerpc-*-rtems* )
1545     ;;
1546   rs6000-*-lynxos*)
1547     noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}"
1548     ;;
1549   rs6000-*-aix*)
1550     noconfigdirs="$noconfigdirs gprof target-libgloss target-libssp ${libgcj}"
1551     ;;
1552   rs6000-*-*)
1553     noconfigdirs="$noconfigdirs gprof ${libgcj}"
1554     ;;
1555   m68k-apollo-*)
1556     noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}"
1557     ;;
1558   mips*-*-irix5*)
1559     noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
1560     ;;
1561   mips*-*-irix6*)
1562     # Linking libjava exceeds command-line length limits on at least
1563     # IRIX 6.2, but not on IRIX 6.5.
1564     # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham
1565     # <oldham@codesourcery.com>
1566     noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
1567     ;;
1568   mips*-*-bsd*)
1569     noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
1570     ;;
1571   mips64*-*-linux*)
1572     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
1573     ;;
1574   mips*-*-linux*)
1575     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
1576     ;;
1577   mips*-*-*)
1578     noconfigdirs="$noconfigdirs gprof ${libgcj}"
1579     ;;
1580   romp-*-*)
1581     noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
1582     ;;
1583   sh-*-* | sh64-*-*)
1584     case "${host}" in
1585       i[3456789]86-*-vsta) ;; # don't add gprof back in
1586       i[3456789]86-*-go32*) ;; # don't add gprof back in
1587       i[3456789]86-*-msdosdjgpp*) ;; # don't add gprof back in
1588       *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
1589     esac
1590     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1591     ;;
1592   sparc-*-elf*)
1593     noconfigdirs="$noconfigdirs ${libgcj}"
1594     ;;
1595   sparc64-*-elf*)
1596     noconfigdirs="$noconfigdirs ${libgcj}"
1597     ;;
1598   sparclite-*-*)
1599     noconfigdirs="$noconfigdirs ${libgcj}"
1600     ;;
1601   sparc-*-sunos4*)
1602     noconfigdirs="$noconfigdirs ${libgcj}"
1603     if test x${is_cross_compiler} != xno ; then
1604            noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
1605     else
1606            use_gnu_ld=no
1607     fi
1608     ;;
1609   sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
1610     noconfigdirs="$noconfigdirs ${libgcj}"
1611     ;;
1612   sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
1613     ;;
1614   spu-*-*)
1615     skipdirs="target-libiberty target-libssp"
1616     ;;
1617   v810-*-*)
1618     noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}"
1619     ;;
1620   v850-*-*)
1621     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1622     ;;
1623   v850e-*-*)
1624     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1625     ;;
1626   v850ea-*-*)
1627     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1628     ;;
1629   vax-*-vms)
1630     noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss ${libgcj}"
1631     ;;
1632   vax-*-*)
1633     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
1634     ;;
1635   xtensa-*-*)
1636     noconfigdirs="$noconfigdirs ${libgcj}"
1637     ;;
1638   ip2k-*-*)
1639     noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
1640     ;;
1641   *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
1642     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
1643     ;;
1644   *-*-lynxos*)
1645     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
1646     ;; 
1647   *-*-*)
1648     noconfigdirs="$noconfigdirs ${libgcj}"
1649     ;;
1650 esac
1651
1652 # If we aren't building newlib, then don't build libgloss, since libgloss
1653 # depends upon some newlib header files.
1654 case "${noconfigdirs}" in
1655   *target-libgloss*) ;;
1656   *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
1657 esac
1658
1659 # Work in distributions that contain no compiler tools, like Autoconf.
1660 tentative_cc=""
1661 host_makefile_frag=/dev/null
1662 if test -d ${srcdir}/config ; then
1663 case "${host}" in
1664   m68k-hp-hpux*)
1665     # Avoid "too much defining" errors from HPUX compiler.
1666     tentative_cc="cc -Wp,-H256000"
1667     # If "ar" in $PATH is GNU ar, the symbol table may need rebuilding.
1668     # If it's HP/UX ar, this should be harmless.
1669     RANLIB="ar ts"
1670     ;;
1671   m68k-apollo-sysv*)
1672     tentative_cc="cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DUSG"
1673     ;;
1674   m68k-apollo-bsd*)
1675     #None of the Apollo compilers can compile gas or binutils.  The preprocessor
1676     # chokes on bfd, the compiler won't let you assign integers to enums, and
1677     # other problems.  Defining CC to gcc is a questionable way to say "don't use
1678     # the apollo compiler" (the preferred version of GCC could be called cc,
1679     # or whatever), but I'm not sure leaving CC as cc is any better...
1680     #CC=cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_STDARG
1681     # Used to have BISON=yacc.
1682     tentative_cc=gcc
1683     ;;
1684   m88k-dg-dgux*)
1685     tentative_cc="gcc -Wall -ansi -D__using_DGUX"
1686     ;;
1687   m88k-harris-cxux*)
1688     # Under CX/UX, we want to tell the compiler to use ANSI mode.
1689     tentative_cc="cc -Xa"
1690     host_makefile_frag="config/mh-cxux"
1691     ;;
1692   m88k-motorola-sysv*)
1693     ;;
1694   mips*-dec-ultrix*)
1695     tentative_cc="cc -Wf,-XNg1000"
1696     host_makefile_frag="config/mh-decstation"
1697     ;;
1698   mips*-nec-sysv4*)
1699     # The C compiler on NEC MIPS SVR4 needs bigger tables.
1700     tentative_cc="cc -ZXNd=5000 -ZXNg=1000"
1701     host_makefile_frag="config/mh-necv4"
1702     ;;
1703   mips*-sgi-irix4*)
1704     # Tell compiler to use K&R C.  We can't compile under the SGI Ansi
1705     # environment.  Also bump switch table size so that cp-parse will
1706     # compile.  Bump string length limit so linker builds.
1707     tentative_cc="cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000 -Wf,-XNl8192"
1708     ;;
1709   mips*-*-sysv4*)
1710     host_makefile_frag="config/mh-sysv4"
1711     ;;
1712   mips*-*-sysv*)
1713     # This is for a MIPS running RISC/os 4.52C.
1714
1715     # This is needed for GDB, but needs to be in the top-level make because
1716     # if a library is compiled with the bsd headers and gets linked with the
1717     # sysv system libraries all hell can break loose (e.g. a jmp_buf might be
1718     # a different size).
1719     # ptrace(2) apparently has problems in the BSD environment.  No workaround is
1720     # known except to select the sysv environment.  Could we use /proc instead?
1721     # These "sysv environments" and "bsd environments" often end up being a pain.
1722     #
1723     # This is not part of CFLAGS because perhaps not all C compilers have this
1724     # option.
1725     tentative_cc="cc -systype sysv"
1726     ;;
1727   i370-ibm-opened*)
1728     tentative_cc="c89"
1729     ;;
1730   i[3456789]86-*-sysv5*)
1731     host_makefile_frag="config/mh-sysv5"
1732     ;;
1733   i[3456789]86-*-dgux*)
1734     tentative_cc="gcc -Wall -ansi -D__using_DGUX"
1735     host_makefile_frag="config/mh-dgux386"
1736     ;;
1737   i[3456789]86-ncr-sysv4.3*)
1738     # The MetaWare compiler will generate a copyright message unless you
1739     # turn it off by adding the -Hnocopyr flag.
1740     tentative_cc="cc -Hnocopyr"
1741     ;;
1742   i[3456789]86-ncr-sysv4*)
1743     # for an NCR 3000 (i486/SVR4) system.
1744     # The NCR 3000 ships with a MetaWare compiler installed as /bin/cc.
1745     # This compiler not only emits obnoxious copyright messages every time
1746     # you run it, but it chokes and dies on a whole bunch of GNU source
1747     # files.  Default to using the AT&T compiler installed in /usr/ccs/ATT/cc.
1748     tentative_cc="/usr/ccs/ATT/cc"
1749     host_makefile_frag="config/mh-ncr3000"
1750     ;;
1751   i[3456789]86-*-sco3.2v5*)
1752     ;;
1753   i[3456789]86-*-sco*)
1754     # The native C compiler botches some simple uses of const.  Unfortunately,
1755     # it doesn't defined anything like "__sco__" for us to test for in ansidecl.h.
1756     tentative_cc="cc -Dconst="
1757     host_makefile_frag="config/mh-sco"
1758     ;;
1759   i[3456789]86-*-udk*)
1760     host_makefile_frag="config/mh-sysv5"
1761     ;;
1762   i[3456789]86-*-solaris2*)
1763     host_makefile_frag="config/mh-sysv4"
1764     ;;
1765   i[3456789]86-*-msdosdjgpp*)
1766     host_makefile_frag="config/mh-djgpp"
1767     ;;
1768   *-cygwin*)
1769     host_makefile_frag="config/mh-cygwin"
1770     ;;
1771   *-mingw32*)
1772     ;;
1773   *-interix*)
1774     host_makefile_frag="config/mh-interix"
1775     ;;
1776   vax-*-ultrix2*)
1777     # The old BSD pcc isn't up to compiling parts of gdb so use gcc
1778     tentative_cc=gcc
1779     ;;
1780   *-*-solaris2*)
1781     host_makefile_frag="config/mh-solaris"
1782     ;;
1783   m68k-sun-sunos*)
1784     # Sun's C compiler needs the -J flag to be able to compile cp-parse.c
1785     # without overflowing the jump tables (-J says to use a 32 bit table)
1786     tentative_cc="cc -J"
1787     ;;
1788   *-hp-hpux*)
1789     tentative_cc="cc -Wp,-H256000"
1790     ;;
1791   *-*-hiux*)
1792     tentative_cc="cc -Wp,-H256000"
1793     ;;
1794   rs6000-*-lynxos*)
1795     # /bin/cc is less than useful for our purposes.  Always use GCC
1796     tentative_cc="/usr/cygnus/progressive/bin/gcc"
1797     host_makefile_frag="config/mh-lynxrs6k"
1798     ;;
1799   powerpc-*-darwin*)
1800     host_makefile_frag="config/mh-ppc-darwin"
1801     ;;
1802   powerpc-*-aix*)
1803     host_makefile_frag="config/mh-ppc-aix"
1804     ;;
1805   rs6000-*-aix*)
1806     host_makefile_frag="config/mh-ppc-aix"
1807     ;;
1808   *-*-lynxos*)
1809     # /bin/cc is less than useful for our purposes.  Always use GCC
1810     tentative_cc="/bin/gcc"
1811     ;;
1812   *-*-sysv4*)
1813     host_makefile_frag="config/mh-sysv4"
1814     ;;
1815   # This is placed last to prevent interfering with the cases above.
1816   i[3456789]86-*-*)
1817     # Build the stage2 and stage3 compilers with -fomit-frame-pointer.
1818     host_makefile_frag="config/mh-x86omitfp"
1819     ;;
1820 esac
1821 fi
1822
1823 # If we aren't going to be using gcc, see if we can extract a definition
1824 # of CC from the fragment.
1825 # Actually, use the 'pre-extracted' version above.
1826 if test -z "${CC}" && test "${build}" = "${host}" ; then
1827   IFS="${IFS=   }"; save_ifs="$IFS"; IFS="${IFS}:"
1828   found=
1829   for dir in $PATH; do
1830     test -z "$dir" && dir=.
1831     if test -f $dir/gcc; then
1832       found=yes
1833       break
1834     fi
1835   done
1836   IFS="$save_ifs"
1837   if test -z "${found}" && test -n "${tentative_cc}" ; then
1838     CC=$tentative_cc
1839   fi
1840 fi
1841
1842 if test "${build}" != "${host}" ; then
1843   # If we are doing a Canadian Cross, in which the host and build systems
1844   # are not the same, we set reasonable default values for the tools.
1845
1846   CC=${CC-${host_alias}-gcc}
1847   CFLAGS=${CFLAGS-"-g -O2"}
1848   CXX=${CXX-${host_alias}-c++}
1849   CXXFLAGS=${CXXFLAGS-"-g -O2"}
1850   CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
1851
1852 else
1853   # Set reasonable default values for some tools even if not Canadian.
1854   # Of course, these are different reasonable default values, originally
1855   # specified directly in the Makefile.
1856   # We don't export, so that autoconf can do its job.
1857   # Note that all these settings are above the fragment inclusion point
1858   # in Makefile.in, so can still be overridden by fragments.
1859   # This is all going to change when we autoconfiscate...
1860
1861   CC_FOR_BUILD="\$(CC)"
1862   # Extract the first word of "gcc", so it can be a program name with args.
1863 set dummy gcc; ac_word=$2
1864 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1865 echo "configure:1866: checking for $ac_word" >&5
1866 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1867   echo $ac_n "(cached) $ac_c" 1>&6
1868 else
1869   if test -n "$CC"; then
1870   ac_cv_prog_CC="$CC" # Let the user override the test.
1871 else
1872   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1873   ac_dummy="$PATH"
1874   for ac_dir in $ac_dummy; do
1875     test -z "$ac_dir" && ac_dir=.
1876     if test -f $ac_dir/$ac_word; then
1877       ac_cv_prog_CC="gcc"
1878       break
1879     fi
1880   done
1881   IFS="$ac_save_ifs"
1882 fi
1883 fi
1884 CC="$ac_cv_prog_CC"
1885 if test -n "$CC"; then
1886   echo "$ac_t""$CC" 1>&6
1887 else
1888   echo "$ac_t""no" 1>&6
1889 fi
1890
1891 if test -z "$CC"; then
1892   # Extract the first word of "cc", so it can be a program name with args.
1893 set dummy cc; ac_word=$2
1894 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1895 echo "configure:1896: checking for $ac_word" >&5
1896 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1897   echo $ac_n "(cached) $ac_c" 1>&6
1898 else
1899   if test -n "$CC"; then
1900   ac_cv_prog_CC="$CC" # Let the user override the test.
1901 else
1902   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1903   ac_prog_rejected=no
1904   ac_dummy="$PATH"
1905   for ac_dir in $ac_dummy; do
1906     test -z "$ac_dir" && ac_dir=.
1907     if test -f $ac_dir/$ac_word; then
1908       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1909         ac_prog_rejected=yes
1910         continue
1911       fi
1912       ac_cv_prog_CC="cc"
1913       break
1914     fi
1915   done
1916   IFS="$ac_save_ifs"
1917 if test $ac_prog_rejected = yes; then
1918   # We found a bogon in the path, so make sure we never use it.
1919   set dummy $ac_cv_prog_CC
1920   shift
1921   if test $# -gt 0; then
1922     # We chose a different compiler from the bogus one.
1923     # However, it has the same basename, so the bogon will be chosen
1924     # first if we set CC to just the basename; use the full file name.
1925     shift
1926     set dummy "$ac_dir/$ac_word" "$@"
1927     shift
1928     ac_cv_prog_CC="$@"
1929   fi
1930 fi
1931 fi
1932 fi
1933 CC="$ac_cv_prog_CC"
1934 if test -n "$CC"; then
1935   echo "$ac_t""$CC" 1>&6
1936 else
1937   echo "$ac_t""no" 1>&6
1938 fi
1939
1940   if test -z "$CC"; then
1941     case "`uname -s`" in
1942     *win32* | *WIN32*)
1943       # Extract the first word of "cl", so it can be a program name with args.
1944 set dummy cl; ac_word=$2
1945 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1946 echo "configure:1947: checking for $ac_word" >&5
1947 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1948   echo $ac_n "(cached) $ac_c" 1>&6
1949 else
1950   if test -n "$CC"; then
1951   ac_cv_prog_CC="$CC" # Let the user override the test.
1952 else
1953   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1954   ac_dummy="$PATH"
1955   for ac_dir in $ac_dummy; do
1956     test -z "$ac_dir" && ac_dir=.
1957     if test -f $ac_dir/$ac_word; then
1958       ac_cv_prog_CC="cl"
1959       break
1960     fi
1961   done
1962   IFS="$ac_save_ifs"
1963 fi
1964 fi
1965 CC="$ac_cv_prog_CC"
1966 if test -n "$CC"; then
1967   echo "$ac_t""$CC" 1>&6
1968 else
1969   echo "$ac_t""no" 1>&6
1970 fi
1971  ;;
1972     esac
1973   fi
1974   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1975 fi
1976
1977 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1978 echo "configure:1979: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1979
1980 ac_ext=c
1981 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1982 ac_cpp='$CPP $CPPFLAGS'
1983 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1984 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1985 cross_compiling=$ac_cv_prog_cc_cross
1986
1987 cat > conftest.$ac_ext << EOF
1988
1989 #line 1990 "configure"
1990 #include "confdefs.h"
1991
1992 main(){return(0);}
1993 EOF
1994 if { (eval echo configure:1995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1995   ac_cv_prog_cc_works=yes
1996   # If we can't run a trivial program, we are probably using a cross compiler.
1997   if (./conftest; exit) 2>/dev/null; then
1998     ac_cv_prog_cc_cross=no
1999   else
2000     ac_cv_prog_cc_cross=yes
2001   fi
2002 else
2003   echo "configure: failed program was:" >&5
2004   cat conftest.$ac_ext >&5
2005   ac_cv_prog_cc_works=no
2006 fi
2007 rm -fr conftest*
2008 ac_ext=c
2009 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2010 ac_cpp='$CPP $CPPFLAGS'
2011 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2012 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2013 cross_compiling=$ac_cv_prog_cc_cross
2014
2015 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2016 if test $ac_cv_prog_cc_works = no; then
2017   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2018 fi
2019 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2020 echo "configure:2021: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2021 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2022 cross_compiling=$ac_cv_prog_cc_cross
2023
2024 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2025 echo "configure:2026: checking whether we are using GNU C" >&5
2026 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
2027   echo $ac_n "(cached) $ac_c" 1>&6
2028 else
2029   cat > conftest.c <<EOF
2030 #ifdef __GNUC__
2031   yes;
2032 #endif
2033 EOF
2034 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2035   ac_cv_prog_gcc=yes
2036 else
2037   ac_cv_prog_gcc=no
2038 fi
2039 fi
2040
2041 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2042
2043 if test $ac_cv_prog_gcc = yes; then
2044   GCC=yes
2045 else
2046   GCC=
2047 fi
2048
2049 ac_test_CFLAGS="${CFLAGS+set}"
2050 ac_save_CFLAGS="$CFLAGS"
2051 CFLAGS=
2052 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2053 echo "configure:2054: checking whether ${CC-cc} accepts -g" >&5
2054 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
2055   echo $ac_n "(cached) $ac_c" 1>&6
2056 else
2057   echo 'void f(){}' > conftest.c
2058 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2059   ac_cv_prog_cc_g=yes
2060 else
2061   ac_cv_prog_cc_g=no
2062 fi
2063 rm -f conftest*
2064
2065 fi
2066
2067 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2068 if test "$ac_test_CFLAGS" = set; then
2069   CFLAGS="$ac_save_CFLAGS"
2070 elif test $ac_cv_prog_cc_g = yes; then
2071   if test "$GCC" = yes; then
2072     CFLAGS="-g -O2"
2073   else
2074     CFLAGS="-g"
2075   fi
2076 else
2077   if test "$GCC" = yes; then
2078     CFLAGS="-O2"
2079   else
2080     CFLAGS=
2081   fi
2082 fi
2083
2084
2085   # We must set the default linker to the linker used by gcc for the correct
2086   # operation of libtool.  If LD is not defined and we are using gcc, try to
2087   # set the LD default to the ld used by gcc.
2088   if test -z "$LD"; then
2089     if test "$GCC" = yes; then
2090       case $build in
2091       *-*-mingw*)
2092         gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
2093       *)
2094         gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
2095       esac
2096       case $gcc_prog_ld in
2097       # Accept absolute paths.
2098       [\\/]* | [A-Za-z]:[\\/]*)
2099         LD="$gcc_prog_ld" ;;
2100       esac
2101     fi
2102   fi
2103
2104   CXX=${CXX-"c++"}
2105   CFLAGS=${CFLAGS-"-g"}
2106   CXXFLAGS=${CXXFLAGS-"-g -O2"}
2107 fi
2108
2109 if test $host != $build; then
2110   ac_tool_prefix=${host_alias}-
2111 else
2112   ac_tool_prefix=
2113 fi
2114
2115
2116
2117 # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args.
2118 set dummy ${ac_tool_prefix}gnatbind; ac_word=$2
2119 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2120 echo "configure:2121: checking for $ac_word" >&5
2121 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
2122   echo $ac_n "(cached) $ac_c" 1>&6
2123 else
2124   if test -n "$GNATBIND"; then
2125   ac_cv_prog_GNATBIND="$GNATBIND" # Let the user override the test.
2126 else
2127   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2128   ac_dummy="$PATH"
2129   for ac_dir in $ac_dummy; do
2130     test -z "$ac_dir" && ac_dir=.
2131     if test -f $ac_dir/$ac_word; then
2132       ac_cv_prog_GNATBIND="${ac_tool_prefix}gnatbind"
2133       break
2134     fi
2135   done
2136   IFS="$ac_save_ifs"
2137 fi
2138 fi
2139 GNATBIND="$ac_cv_prog_GNATBIND"
2140 if test -n "$GNATBIND"; then
2141   echo "$ac_t""$GNATBIND" 1>&6
2142 else
2143   echo "$ac_t""no" 1>&6
2144 fi
2145
2146
2147 if test -z "$ac_cv_prog_GNATBIND"; then
2148 if test -n "$ac_tool_prefix"; then
2149   # Extract the first word of "gnatbind", so it can be a program name with args.
2150 set dummy gnatbind; ac_word=$2
2151 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2152 echo "configure:2153: checking for $ac_word" >&5
2153 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
2154   echo $ac_n "(cached) $ac_c" 1>&6
2155 else
2156   if test -n "$GNATBIND"; then
2157   ac_cv_prog_GNATBIND="$GNATBIND" # Let the user override the test.
2158 else
2159   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2160   ac_dummy="$PATH"
2161   for ac_dir in $ac_dummy; do
2162     test -z "$ac_dir" && ac_dir=.
2163     if test -f $ac_dir/$ac_word; then
2164       ac_cv_prog_GNATBIND="gnatbind"
2165       break
2166     fi
2167   done
2168   IFS="$ac_save_ifs"
2169   test -z "$ac_cv_prog_GNATBIND" && ac_cv_prog_GNATBIND="no"
2170 fi
2171 fi
2172 GNATBIND="$ac_cv_prog_GNATBIND"
2173 if test -n "$GNATBIND"; then
2174   echo "$ac_t""$GNATBIND" 1>&6
2175 else
2176   echo "$ac_t""no" 1>&6
2177 fi
2178
2179 else
2180   GNATBIND="no"
2181 fi
2182 fi
2183
2184 echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6
2185 echo "configure:2186: checking whether compiler driver understands Ada" >&5
2186 if eval "test \"`echo '$''{'acx_cv_cc_gcc_supports_ada'+set}'`\" = set"; then
2187   echo $ac_n "(cached) $ac_c" 1>&6
2188 else
2189   cat >conftest.adb <<EOF
2190 procedure conftest is begin null; end conftest;
2191 EOF
2192 acx_cv_cc_gcc_supports_ada=no
2193 # There is a bug in old released versions of GCC which causes the
2194 # driver to exit successfully when the appropriate language module
2195 # has not been installed.  This is fixed in 2.95.4, 3.0.2, and 3.1.
2196 # Therefore we must check for the error message as well as an
2197 # unsuccessful exit.
2198 # Other compilers, like HP Tru64 UNIX cc, exit successfully when
2199 # given a .adb file, but produce no object file.  So we must check
2200 # if an object file was really produced to guard against this.
2201 errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
2202 if test x"$errors" = x && test -f conftest.$ac_objext; then
2203   acx_cv_cc_gcc_supports_ada=yes
2204 fi
2205 rm -f conftest.*
2206 fi
2207
2208 echo "$ac_t""$acx_cv_cc_gcc_supports_ada" 1>&6
2209
2210 if test x$GNATBIND != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
2211   have_gnat=yes
2212 else
2213   have_gnat=no
2214 fi
2215
2216 echo $ac_n "checking how to compare bootstrapped objects""... $ac_c" 1>&6
2217 echo "configure:2218: checking how to compare bootstrapped objects" >&5
2218 if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then
2219   echo $ac_n "(cached) $ac_c" 1>&6
2220 else
2221    echo abfoo >t1
2222   echo cdfoo >t2
2223   gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
2224   if cmp t1 t2 2 2 > /dev/null 2>&1; then
2225     if cmp t1 t2 1 1 > /dev/null 2>&1; then
2226       :
2227     else
2228       gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16'
2229     fi
2230   fi
2231   if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
2232     if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
2233       :
2234     else
2235       gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
2236     fi
2237   fi
2238   rm t1 t2
2239
2240 fi
2241
2242 echo "$ac_t""$gcc_cv_prog_cmp_skip" 1>&6
2243 do_compare="$gcc_cv_prog_cmp_skip"
2244
2245
2246
2247 # Check for GMP and MPFR
2248 gmplibs="-lmpfr"
2249 gmpinc=
2250 have_gmp=yes
2251 # Specify a location for mpfr
2252 # check for this first so it ends up on the link line before gmp.
2253 # Check whether --with-mpfr-dir or --without-mpfr-dir was given.
2254 if test "${with_mpfr_dir+set}" = set; then
2255   withval="$with_mpfr_dir"
2256   { echo "configure: error: The --with-mpfr-dir=PATH option has been removed.
2257 Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH" 1>&2; exit 1; }
2258 fi
2259
2260
2261 # Check whether --with-mpfr or --without-mpfr was given.
2262 if test "${with_mpfr+set}" = set; then
2263   withval="$with_mpfr"
2264   :
2265 fi
2266
2267 # Check whether --with-mpfr_include or --without-mpfr_include was given.
2268 if test "${with_mpfr_include+set}" = set; then
2269   withval="$with_mpfr_include"
2270   :
2271 fi
2272
2273 # Check whether --with-mpfr_lib or --without-mpfr_lib was given.
2274 if test "${with_mpfr_lib+set}" = set; then
2275   withval="$with_mpfr_lib"
2276   :
2277 fi
2278
2279
2280 if test "x$with_mpfr" != x; then
2281   gmplibs="-L$with_mpfr/lib $gmplibs"
2282   gmpinc="-I$with_mpfr/include"
2283 fi
2284 if test "x$with_mpfr_include" != x; then
2285   gmpinc="-I$with_mpfr_include"
2286 fi
2287 if test "x$with_mpfr_lib" != x; then
2288   gmplibs="-L$with_mpfr_lib $gmplibs"
2289 fi
2290
2291 # Specify a location for gmp
2292 # Check whether --with-gmp-dir or --without-gmp-dir was given.
2293 if test "${with_gmp_dir+set}" = set; then
2294   withval="$with_gmp_dir"
2295   { echo "configure: error: The --with-gmp-dir=PATH option has been removed.
2296 Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH" 1>&2; exit 1; }
2297 fi
2298
2299
2300 gmplibs="$gmplibs -lgmp"
2301
2302 # Check whether --with-gmp or --without-gmp was given.
2303 if test "${with_gmp+set}" = set; then
2304   withval="$with_gmp"
2305   :
2306 fi
2307
2308 # Check whether --with-gmp_include or --without-gmp_include was given.
2309 if test "${with_gmp_include+set}" = set; then
2310   withval="$with_gmp_include"
2311   :
2312 fi
2313
2314 # Check whether --with-gmp_lib or --without-gmp_lib was given.
2315 if test "${with_gmp_lib+set}" = set; then
2316   withval="$with_gmp_lib"
2317   :
2318 fi
2319
2320
2321
2322 if test "x$with_gmp" != x; then
2323   gmplibs="-L$with_gmp/lib $gmplibs"
2324   gmpinc="-I$with_gmp/include $gmpinc"
2325 fi
2326 if test "x$with_gmp_include" != x; then
2327   gmpinc="-I$with_gmp_include $gmpinc"
2328 fi
2329 if test "x$with_gmp_lib" != x; then
2330   gmplibs="-L$with_gmp_lib $gmplibs"
2331 fi
2332
2333 saved_CFLAGS="$CFLAGS"
2334 CFLAGS="$CFLAGS $gmpinc"
2335 # Check GMP actually works
2336 echo $ac_n "checking for correct version of gmp.h""... $ac_c" 1>&6
2337 echo "configure:2338: checking for correct version of gmp.h" >&5
2338 cat > conftest.$ac_ext <<EOF
2339 #line 2340 "configure"
2340 #include "confdefs.h"
2341 #include "gmp.h"
2342 int main() {
2343
2344 #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1)
2345 choke me
2346 #endif
2347
2348 ; return 0; }
2349 EOF
2350 if { (eval echo configure:2351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2351   rm -rf conftest*
2352   echo "$ac_t""yes" 1>&6
2353 else
2354   echo "configure: failed program was:" >&5
2355   cat conftest.$ac_ext >&5
2356   rm -rf conftest*
2357   echo "$ac_t""no" 1>&6; have_gmp=no
2358 fi
2359 rm -f conftest*
2360
2361 if test x"$have_gmp" = xyes; then
2362   saved_LIBS="$LIBS"
2363   LIBS="$LIBS $gmplibs"
2364   echo $ac_n "checking for correct version of mpfr.h""... $ac_c" 1>&6
2365 echo "configure:2366: checking for correct version of mpfr.h" >&5
2366   cat > conftest.$ac_ext <<EOF
2367 #line 2368 "configure"
2368 #include "confdefs.h"
2369 #include <gmp.h>
2370 #include <mpfr.h>
2371 int main() {
2372
2373 #if MPFR_VERSION_MAJOR < 2 || (MPFR_VERSION_MAJOR == 2 && MPFR_VERSION_MINOR < 2)
2374   choke me
2375 #endif
2376   mpfr_t n; mpfr_init(n);
2377
2378 ; return 0; }
2379 EOF
2380 if { (eval echo configure:2381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2381   rm -rf conftest*
2382   echo "$ac_t""yes" 1>&6
2383 else
2384   echo "configure: failed program was:" >&5
2385   cat conftest.$ac_ext >&5
2386   rm -rf conftest*
2387   echo "$ac_t""no" 1>&6; have_gmp=no
2388 fi
2389 rm -f conftest*
2390   LIBS="$saved_LIBS"
2391 fi
2392 CFLAGS="$saved_CFLAGS"
2393
2394 if test -d ${srcdir}/gcc && test x$have_gmp != xyes; then
2395   { echo "configure: error: Building GCC requires GMP 4.1+ and MPFR 2.2.1+.
2396 Try the --with-gmp and/or --with-mpfr options to specify their locations.
2397 Copies of these libraries' source code can be found at their respective
2398 hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
2399 See also http://gcc.gnu.org/install/prerequisites.html for additional info.
2400 If you obtained GMP and/or MPFR from a vendor distribution package, make
2401 sure that you have installed both the libraries and the header files.
2402 They may be located in separate packages." 1>&2; exit 1; }
2403 fi
2404
2405 # Flags needed for both GMP and/or MPFR
2406
2407
2408
2409 # By default, C is the only stage 1 language.
2410 stage1_languages=c
2411
2412
2413 # Figure out what language subdirectories are present.
2414 # Look if the user specified --enable-languages="..."; if not, use
2415 # the environment variable $LANGUAGES if defined. $LANGUAGES might
2416 # go away some day.
2417 # NB:  embedded tabs in this IF block -- do not untabify
2418 if test -d ${srcdir}/gcc; then
2419   if test x"${enable_languages+set}" != xset; then
2420     if test x"${LANGUAGES+set}" = xset; then
2421       enable_languages="${LANGUAGES}"
2422         echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
2423     else
2424       enable_languages=all
2425     fi
2426   else
2427     if test x"${enable_languages}" = x ||
2428        test x"${enable_languages}" = xyes;
2429        then
2430       echo configure.in: --enable-languages needs at least one language argument 1>&2
2431       exit 1
2432     fi
2433   fi
2434   enable_languages=`echo "${enable_languages}" | sed -e 's/[    ,][     ,]*/,/g' -e 's/,$//'`
2435
2436   # 'f95' is the old name for the 'fortran' language. We issue a warning
2437   # and make the substitution.
2438   case ,${enable_languages}, in
2439     *,f95,*)
2440       echo configure.in: warning: 'f95' as language name is deprecated, use 'fortran' instead 1>&2
2441       enable_languages=`echo "${enable_languages}" | sed -e 's/f95/fortran/g'`
2442       ;;
2443   esac
2444
2445   # First scan to see if an enabled language requires some other language.
2446   # We assume that a given config-lang.in will list all the language
2447   # front ends it requires, even if some are required indirectly.
2448   for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
2449     case ${lang_frag} in
2450       ..) ;;
2451       # The odd quoting in the next line works around
2452       # an apparent bug in bash 1.12 on linux.
2453       ${srcdir}/gcc/[*]/config-lang.in) ;;
2454       *)
2455         # From the config-lang.in, get $language, $lang_requires
2456         language=
2457         lang_requires=
2458         . ${lang_frag}
2459         for other in ${lang_requires} ; do
2460           case ,${enable_languages}, in
2461             *,$other,*) ;;
2462             *,all,*) ;;
2463             *,$language,*)
2464               echo " \`$other' language required by \`$language'; enabling" 1>&2
2465               enable_languages="${enable_languages},${other}"
2466               ;;
2467           esac
2468         done
2469         ;;
2470     esac
2471   done
2472
2473   new_enable_languages=c
2474   missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
2475   potential_languages=c
2476
2477   for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
2478     case ${lang_frag} in
2479       ..) ;;
2480       # The odd quoting in the next line works around
2481       # an apparent bug in bash 1.12 on linux.
2482       ${srcdir}/gcc/[*]/config-lang.in) ;;
2483       *)
2484         # From the config-lang.in, get $language, $target_libs, 
2485         # $lang_dirs, $boot_language, and $build_by_default
2486         language=
2487         target_libs=
2488         lang_dirs=
2489         subdir_requires=
2490         boot_language=
2491         build_by_default=
2492         . ${lang_frag}
2493         potential_languages="${potential_languages},${language}"
2494         # This is quite sensitive to the ordering of the case statement arms.
2495         case ,${enable_languages},:${language}:${have_gnat}:${build_by_default} in
2496           *::*:*)
2497             echo "${lang_frag} doesn't set \$language." 1>&2
2498             exit 1
2499             ;;
2500           *:ada:no:*)
2501             # Ada was requested with no preexisting GNAT.  Disable unconditionally.
2502             add_this_lang=no
2503             ;;
2504           *,${language},*:*:*:*)
2505             # Language was explicitly selected; include it.
2506             add_this_lang=yes
2507             ;;
2508           *,all,*:*:*:no)
2509             # 'all' was selected, but this is not a default language
2510             # so do not include it.
2511             add_this_lang=no
2512             ;;
2513           *,all,*:*:*:*)
2514             # 'all' was selected and this is a default language; include it.
2515             add_this_lang=yes
2516             ;;
2517           *)
2518             add_this_lang=no
2519             ;;
2520         esac
2521
2522         # Disable languages that need other directories if these aren't available.
2523         for i in $subdir_requires; do
2524           test -f "$srcdir/gcc/$i/config-lang.in" && continue
2525           case ,${enable_languages}, in
2526             *,${language},*)
2527               # Specifically requested language; tell them.
2528               { echo "configure: error: The gcc/$i directory contains parts of $language but is missing" 1>&2; exit 1; }
2529               ;;
2530             *)
2531               # Silently disable.
2532               add_this_lang=no
2533               ;;
2534           esac
2535         done
2536
2537         # Disable a language that is unsupported by the target.
2538         case " $unsupported_languages " in
2539           *" $language "*)
2540             add_this_lang=no
2541             ;;
2542         esac
2543
2544         case $add_this_lang in
2545           no)
2546             # Remove language-dependent dirs.
2547             eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\"
2548             ;;
2549           *)
2550             new_enable_languages="$new_enable_languages,$language"
2551             missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"`
2552             case ${boot_language} in
2553               yes)
2554                 # Add to (comma-separated) list of stage 1 languages.
2555                 stage1_languages="${stage1_languages},${language}"
2556                 ;;
2557             esac
2558             ;;
2559         esac
2560         ;;
2561     esac
2562   done
2563
2564   missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"`
2565   if test "x$missing_languages" != x; then
2566     { echo "configure: error: 
2567 The following requested languages could not be built: ${missing_languages}
2568 Recognised languages are: ${potential_languages}" 1>&2; exit 1; }
2569   fi
2570
2571   if test "x$new_enable_languages" != "x$enable_languages"; then
2572     echo The following languages will be built: ${new_enable_languages}
2573   fi
2574   enable_languages="$new_enable_languages"
2575   ac_configure_args=`echo " $ac_configure_args" | sed -e 's/ --enable-languages=[^ ]*//' -e 's/$/ --enable-languages='"$enable_languages"/ `
2576 fi
2577
2578 # Handle --disable-<component> generically.
2579 for dir in $configdirs $build_configdirs $target_configdirs ; do
2580   dirname=`echo $dir | sed -e s/target-//g -e s/build-//g -e s/-/_/g`
2581   if eval test x\${enable_${dirname}} "=" xno ; then
2582     noconfigdirs="$noconfigdirs $dir"
2583   fi
2584 done
2585
2586 # Check for Boehm's garbage collector
2587 # Check whether --enable-objc-gc or --disable-objc-gc was given.
2588 if test "${enable_objc_gc+set}" = set; then
2589   enableval="$enable_objc_gc"
2590   case ,${enable_languages},:${enable_objc_gc}:${noconfigdirs} in
2591   *,objc,*:*:yes:*target-boehm-gc*)
2592     { echo "configure: error: Boehm's garbage collector was requested yet not supported in this configuration" 1>&2; exit 1; }
2593     ;;
2594 esac
2595 fi
2596
2597
2598 # Make sure we only build Boehm's garbage collector if required.
2599 case ,${enable_languages},:${enable_objc_gc} in
2600   *,objc,*:yes)
2601     # Keep target-boehm-gc if requested for Objective-C.
2602     ;;
2603   *)
2604     # Otherwise remove target-boehm-gc depending on target-libjava.
2605     if echo " ${noconfigdirs} " | grep "target-libjava" >/dev/null 2>&1; then
2606       noconfigdirs="$noconfigdirs target-boehm-gc"
2607     fi
2608     ;;
2609 esac
2610
2611 # Remove the entries in $skipdirs and $noconfigdirs from $configdirs,
2612 # $build_configdirs and $target_configdirs.
2613 # If we have the source for $noconfigdirs entries, add them to $notsupp.
2614
2615 notsupp=""
2616 for dir in . $skipdirs $noconfigdirs ; do
2617   dirname=`echo $dir | sed -e s/target-//g -e s/build-//g`
2618   if test $dir != .  && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2619     configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
2620     if test -r $srcdir/$dirname/configure ; then
2621       if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2622         true
2623       else
2624         notsupp="$notsupp $dir"
2625       fi
2626     fi
2627   fi
2628   if test $dir != .  && echo " ${build_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2629     build_configdirs=`echo " ${build_configdirs} " | sed -e "s/ ${dir} / /"`
2630     if test -r $srcdir/$dirname/configure ; then
2631       if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2632         true
2633       else
2634         notsupp="$notsupp $dir"
2635       fi
2636     fi
2637   fi
2638   if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2639     target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
2640     if test -r $srcdir/$dirname/configure ; then
2641       if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2642         true
2643       else
2644         notsupp="$notsupp $dir"
2645       fi
2646     fi
2647   fi
2648 done
2649
2650 # Sometimes the tools are distributed with libiberty but with no other
2651 # libraries.  In that case, we don't want to build target-libiberty.
2652 if test -n "${target_configdirs}" ; then
2653   others=
2654   for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
2655     if test "$i" != "libiberty" ; then
2656       if test -r $srcdir/$i/configure ; then
2657         others=yes;
2658         break;
2659       fi
2660     fi
2661   done
2662   if test -z "${others}" ; then
2663     target_configdirs=
2664   fi
2665 fi
2666
2667 # Quietly strip out all directories which aren't configurable in this tree.
2668 # This relies on all configurable subdirectories being autoconfiscated, which
2669 # is now the case.
2670 build_configdirs_all="$build_configdirs"
2671 build_configdirs=
2672 for i in ${build_configdirs_all} ; do
2673   j=`echo $i | sed -e s/build-//g` 
2674   if test -f ${srcdir}/$j/configure ; then
2675     build_configdirs="${build_configdirs} $i"
2676   fi
2677 done
2678
2679 configdirs_all="$configdirs"
2680 configdirs=
2681 for i in ${configdirs_all} ; do
2682   if test -f ${srcdir}/$i/configure ; then
2683     configdirs="${configdirs} $i"
2684   fi
2685 done
2686
2687 target_configdirs_all="$target_configdirs"
2688 target_configdirs=
2689 for i in ${target_configdirs_all} ; do
2690   j=`echo $i | sed -e s/target-//g` 
2691   if test -f ${srcdir}/$j/configure ; then
2692     target_configdirs="${target_configdirs} $i"
2693   fi
2694 done
2695
2696 # Produce a warning message for the subdirs we can't configure.
2697 # This isn't especially interesting in the Cygnus tree, but in the individual
2698 # FSF releases, it's important to let people know when their machine isn't
2699 # supported by the one or two programs in a package.
2700
2701 if test -n "${notsupp}" && test -z "${norecursion}" ; then
2702   # If $appdirs is non-empty, at least one of those directories must still
2703   # be configured, or we error out.  (E.g., if the gas release supports a
2704   # specified target in some subdirs but not the gas subdir, we shouldn't
2705   # pretend that all is well.)
2706   if test -n "$appdirs" ; then
2707     for dir in $appdirs ; do
2708       if test -r $dir/Makefile.in ; then
2709         if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2710           appdirs=""
2711           break
2712         fi
2713         if echo " ${target_configdirs} " | grep " target-${dir} " >/dev/null 2>&1; then
2714           appdirs=""
2715           break
2716         fi
2717       fi
2718     done
2719     if test -n "$appdirs" ; then
2720       echo "*** This configuration is not supported by this package." 1>&2
2721       exit 1
2722     fi
2723   fi
2724   # Okay, some application will build, or we don't care to check.  Still
2725   # notify of subdirs not getting built.
2726   echo "*** This configuration is not supported in the following subdirectories:" 1>&2
2727   echo "    ${notsupp}" 1>&2
2728   echo "    (Any other directories should still work fine.)" 1>&2
2729 fi
2730
2731 case "$host" in
2732   *msdosdjgpp*)
2733     enable_gdbtk=no ;;
2734 esac
2735
2736 copy_dirs=
2737
2738 # Check whether --with-build-sysroot or --without-build-sysroot was given.
2739 if test "${with_build_sysroot+set}" = set; then
2740   withval="$with_build_sysroot"
2741   if test x"$withval" != x ; then
2742      SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
2743    fi
2744 else
2745   SYSROOT_CFLAGS_FOR_TARGET=
2746 fi
2747
2748
2749
2750 # Handle --with-headers=XXX.  If the value is not "yes", the contents of
2751 # the named directory are copied to $(tooldir)/sys-include.
2752 if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
2753   if test x${is_cross_compiler} = xno ; then
2754     echo 1>&2 '***' --with-headers is only supported when cross compiling
2755     exit 1
2756   fi
2757   if test x"${with_headers}" != xyes ; then
2758     case "${exec_prefixoption}" in
2759     "") x=${prefix} ;;
2760     *) x=${exec_prefix} ;;
2761     esac
2762     copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include"
2763   fi
2764 fi
2765
2766 # Handle --with-libs=XXX.  If the value is not "yes", the contents of
2767 # the name directories are copied to $(tooldir)/lib.  Multiple directories
2768 # are permitted.
2769 if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
2770   if test x${is_cross_compiler} = xno ; then
2771     echo 1>&2 '***' --with-libs is only supported when cross compiling
2772     exit 1
2773   fi
2774   if test x"${with_libs}" != xyes ; then
2775     # Copy the libraries in reverse order, so that files in the first named
2776     # library override files in subsequent libraries.
2777     case "${exec_prefixoption}" in
2778     "") x=${prefix} ;;
2779     *) x=${exec_prefix} ;;
2780     esac
2781     for l in ${with_libs}; do
2782       copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
2783     done
2784   fi
2785 fi
2786
2787 # Set with_gnu_as and with_gnu_ld as appropriate.
2788 #
2789 # This is done by determining whether or not the appropriate directory
2790 # is available, and by checking whether or not specific configurations
2791 # have requested that this magic not happen.
2792
2793 # The command line options always override the explicit settings in 
2794 # configure.in, and the settings in configure.in override this magic.
2795 #
2796 # If the default for a toolchain is to use GNU as and ld, and you don't 
2797 # want to do that, then you should use the --without-gnu-as and
2798 # --without-gnu-ld options for the configure script.
2799
2800 if test x${use_gnu_as} = x &&
2801    echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
2802   with_gnu_as=yes
2803   extra_host_args="$extra_host_args --with-gnu-as"
2804 fi
2805
2806 if test x${use_gnu_ld} = x &&
2807    echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 ; then
2808   with_gnu_ld=yes
2809   extra_host_args="$extra_host_args --with-gnu-ld"
2810 fi
2811
2812 # If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
2813 # can detect this case.
2814
2815 if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then
2816   with_newlib=yes
2817   extra_host_args="$extra_host_args --with-newlib"
2818 fi
2819
2820 # Handle ${copy_dirs}
2821 set fnord ${copy_dirs}
2822 shift
2823 while test $# != 0 ; do
2824   if test -f $2/COPIED && test x"`cat $2/COPIED`" = x"$1" ; then
2825     :
2826   else
2827     echo Copying $1 to $2
2828
2829     # Use the install script to create the directory and all required
2830     # parent directories.
2831     if test -d $2 ; then
2832       :
2833     else
2834       echo >config.temp
2835       ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
2836     fi
2837
2838     # Copy the directory, assuming we have tar.
2839     # FIXME: Should we use B in the second tar?  Not all systems support it.
2840     (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
2841
2842     # It is the responsibility of the user to correctly adjust all
2843     # symlinks.  If somebody can figure out how to handle them correctly
2844     # here, feel free to add the code.
2845
2846     echo $1 > $2/COPIED
2847   fi
2848   shift; shift
2849 done
2850
2851 # Determine a target-dependent exec_prefix that the installed
2852 # gcc will search in.  Keep this list sorted by triplet, with
2853 # the *-*-osname triplets last.
2854 md_exec_prefix=
2855 case "${target}" in
2856   alpha*-*-*vms*)
2857     md_exec_prefix=/gnu/lib/gcc-lib
2858     ;;
2859   i3456786-pc-msdosdjgpp*)
2860     md_exec_prefix=/dev/env/DJDIR/bin
2861     ;;
2862   i3456786-*-sco3.2v5*)
2863     if test $with_gnu_as = yes; then
2864       md_exec_prefix=/usr/gnu/bin
2865     else
2866       md_exec_prefix=/usr/ccs/bin/elf
2867     fi
2868     ;;
2869
2870   mn10300-*-* | \
2871   powerpc-*-chorusos* | \
2872   powerpc*-*-eabi* | \
2873   powerpc*-*-sysv* | \
2874   powerpc*-*-kaos* | \
2875   s390x-ibm-tpf*)
2876     md_exec_prefix=/usr/ccs/bin
2877     ;;
2878   sparc64-*-elf*)
2879     ;;
2880   v850*-*-*)
2881     md_exec_prefix=/usr/ccs/bin
2882     ;;
2883   xtensa-*-elf*)
2884     ;;
2885
2886   *-*-beos* | \
2887   *-*-elf* | \
2888   *-*-hpux* | \
2889   *-*-netware* | \
2890   *-*-nto-qnx* | \
2891   *-*-rtems* | \
2892   *-*-solaris2* | \
2893   *-*-sysv45* | \
2894   *-*-vxworks* | \
2895   *-wrs-windiss)
2896     md_exec_prefix=/usr/ccs/bin
2897     ;;
2898 esac
2899
2900 extra_arflags_for_target=
2901 extra_nmflags_for_target=
2902 extra_ranlibflags_for_target=
2903 target_makefile_frag=/dev/null
2904 case "${target}" in
2905   *-*-netware*)
2906     target_makefile_frag="config/mt-netware"
2907     ;;
2908   *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
2909     target_makefile_frag="config/mt-gnu"
2910     ;;
2911   *-*-aix4.[3456789]* | *-*-aix[56789].*)
2912     # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm 
2913     # commands to handle both 32-bit and 64-bit objects.  These flags are
2914     # harmless if we're using GNU nm or ar.
2915     extra_arflags_for_target=" -X32_64"
2916     extra_nmflags_for_target=" -B -X32_64"
2917     ;;
2918   *-*-darwin*)
2919     # ranlib from Darwin requires the -c flag to look at common symbols.
2920     extra_ranlibflags_for_target=" -c"
2921     ;;
2922   mips*-*-pe | sh*-*-pe | *arm-wince-pe)
2923     target_makefile_frag="config/mt-wince"
2924     ;;
2925 esac
2926
2927 alphaieee_frag=/dev/null
2928 case $target in
2929   alpha*-*-*)
2930     # This just makes sure to use the -mieee option to build target libs.
2931     # This should probably be set individually by each library.
2932     alphaieee_frag="config/mt-alphaieee"
2933     ;;
2934 esac
2935
2936 # If --enable-target-optspace always use -Os instead of -O2 to build
2937 # the target libraries, similarly if it is not specified, use -Os
2938 # on selected platforms.
2939 ospace_frag=/dev/null
2940 case "${enable_target_optspace}:${target}" in
2941   yes:*)
2942     ospace_frag="config/mt-ospace"
2943     ;;
2944   :d30v-*)
2945     ospace_frag="config/mt-d30v"
2946     ;;
2947   :m32r-* | :d10v-* | :fr30-*)
2948     ospace_frag="config/mt-ospace"
2949     ;;
2950   no:* | :*)
2951     ;;
2952   *)
2953     echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
2954     ;;
2955 esac
2956
2957 # Default to using --with-stabs for certain targets.
2958 if test x${with_stabs} = x ; then
2959   case "${target}" in
2960   mips*-*-irix[56]*)
2961     ;;
2962   mips*-*-* | alpha*-*-osf*)
2963     with_stabs=yes;
2964     extra_host_args="${extra_host_args} --with-stabs"
2965     ;;
2966   esac
2967 fi
2968
2969 # hpux11 in 64bit mode has libraries in a weird place.  Arrange to find
2970 # them automatically.
2971 case "${host}" in
2972   hppa*64*-*-hpux11*)   
2973     extra_host_args="$extra_host_args -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include"
2974     ;;
2975 esac
2976
2977 # Some systems (e.g., one of the i386-aix systems the gas testers are
2978 # using) don't handle "\$" correctly, so don't use it here.
2979 tooldir='${exec_prefix}'/${target_alias}
2980 build_tooldir=${tooldir}
2981
2982 # Create a .gdbinit file which runs the one in srcdir
2983 # and tells GDB to look there for source files.
2984
2985 if test -r ${srcdir}/.gdbinit ; then
2986   case ${srcdir} in
2987     .) ;;
2988     *) cat > ./.gdbinit <<EOF
2989 # ${NO_EDIT}
2990 dir ${srcdir}
2991 dir .
2992 source ${srcdir}/.gdbinit
2993 EOF
2994     ;;
2995   esac
2996 fi
2997
2998 # Make sure that the compiler is able to generate an executable.  If it
2999 # can't, we are probably in trouble.  We don't care whether we can run the
3000 # executable--we might be using a cross compiler--we only care whether it
3001 # can be created.  At this point the main configure script has set CC.
3002 we_are_ok=no
3003 echo "int main () { return 0; }" > conftest.c
3004 ${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
3005 if test $? = 0 ; then
3006   if test -s conftest || test -s conftest.exe ; then
3007     we_are_ok=yes
3008   fi
3009 fi 
3010 case $we_are_ok in
3011   no)
3012     echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
3013     echo 1>&2 "*** You must set the environment variable CC to a working compiler."
3014     rm -f conftest*
3015     exit 1
3016     ;;
3017 esac
3018 rm -f conftest*
3019
3020 # The Solaris /usr/ucb/cc compiler does not appear to work.
3021 case "${host}" in
3022   sparc-sun-solaris2*)
3023       CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
3024       if test "`type $CCBASE | sed 's/^[^/]*//'`" = "/usr/ucb/cc" ; then
3025           could_use=
3026           test -d /opt/SUNWspro/bin && could_use="/opt/SUNWspro/bin"
3027           if test -d /opt/cygnus/bin ; then
3028               if test "$could_use" = "" ; then
3029                   could_use="/opt/cygnus/bin"
3030               else
3031                   could_use="$could_use or /opt/cygnus/bin"
3032               fi
3033           fi
3034         if test "$could_use" = "" ; then
3035             echo "Warning: compilation may fail because you're using"
3036             echo "/usr/ucb/cc.  You should change your PATH or CC "
3037             echo "variable and rerun configure."
3038         else
3039             echo "Warning: compilation may fail because you're using"
3040             echo "/usr/ucb/cc, when you should use the C compiler from"
3041             echo "$could_use.  You should change your"
3042             echo "PATH or CC variable and rerun configure."
3043         fi
3044       fi
3045   ;;
3046 esac
3047
3048 case "${host}" in
3049   *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
3050   *-*-darwin* | *-*-rhapsody* ) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;;
3051   *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
3052 esac
3053
3054 # Record target_configdirs and the configure arguments for target and
3055 # build configuration in Makefile.
3056 target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
3057 build_configdirs=`echo "${build_configdirs}" | sed -e 's/build-//g'`
3058
3059 # Determine whether gdb needs tk/tcl or not.
3060 # Use 'maybe' since enable_gdbtk might be true even if tk isn't available
3061 # and in that case we want gdb to be built without tk.  Ugh!
3062 # In fact I believe gdb is the *only* package directly dependent on tk,
3063 # so we should be able to put the 'maybe's in unconditionally and
3064 # leave out the maybe dependencies when enable_gdbtk is false.  I'm not
3065 # 100% sure that that's safe though.
3066
3067 gdb_tk="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-libgui"
3068 case "$enable_gdbtk" in
3069   no)
3070     GDB_TK="" ;;
3071   yes)
3072     GDB_TK="${gdb_tk}" ;;
3073   *)
3074     # Only add the dependency on gdbtk when GDBtk is part of the gdb
3075     # distro.  Eventually someone will fix this and move Insight, nee
3076     # gdbtk to a separate directory.
3077     if test -d ${srcdir}/gdb/gdbtk ; then
3078       GDB_TK="${gdb_tk}"
3079     else
3080       GDB_TK=""
3081     fi
3082     ;;
3083 esac
3084 CONFIGURE_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-configure-/g`
3085 INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`
3086
3087 # Strip out unwanted targets.
3088
3089 # While at that, we remove Makefiles if we were started for recursive
3090 # configuration, so that the top-level Makefile reconfigures them,
3091 # like we used to do when configure itself was recursive.
3092
3093 # Loop over modules.  $extrasub must be used with care, limiting as
3094 # much as possible the usage of range addresses.  That's because autoconf
3095 # splits the sed script to overcome limits in the number of commands,
3096 # and relying on carefully-timed sed passes may turn out to be very hard
3097 # to maintain later.  In this particular case, you just have to be careful
3098 # not to nest @if/@endif pairs, because configure will not warn you at all.
3099
3100 # Check whether --enable-bootstrap or --disable-bootstrap was given.
3101 if test "${enable_bootstrap+set}" = set; then
3102   enableval="$enable_bootstrap"
3103   :
3104 else
3105   enable_bootstrap=default
3106 fi
3107
3108
3109 # Issue errors and warnings for invalid/strange bootstrap combinations.
3110 case "$configdirs" in
3111   *gcc*) have_compiler=yes ;;
3112   *) have_compiler=no ;;
3113 esac
3114
3115 case "$have_compiler:$host:$target:$enable_bootstrap" in
3116   *:*:*:no) ;;
3117
3118   # Default behavior.  Enable bootstrap if we have a compiler
3119   # and we are in a native configuration.
3120   yes:$build:$build:default)
3121     enable_bootstrap=yes ;;
3122
3123   *:*:*:default)
3124     enable_bootstrap=no ;;
3125
3126   # We have a compiler and we are in a native configuration, bootstrap is ok
3127   yes:$build:$build:yes)
3128     ;;
3129
3130   # Other configurations, but we have a compiler.  Assume the user knows
3131   # what he's doing.
3132   yes:*:*:yes)
3133     echo "configure: warning: trying to bootstrap a cross compiler" 1>&2
3134     ;;
3135
3136   # No compiler: if they passed --enable-bootstrap explicitly, fail
3137   no:*:*:yes)
3138     { echo "configure: error: cannot bootstrap without a compiler" 1>&2; exit 1; } ;;
3139
3140   # Fail if wrong command line
3141   *)
3142     { echo "configure: error: invalid option for --enable-bootstrap" 1>&2; exit 1; }
3143     ;;
3144 esac
3145
3146 # Adjust the toplevel makefile according to whether bootstrap was selected.
3147 case "$enable_bootstrap" in
3148   yes)
3149     bootstrap_suffix=bootstrap ;;
3150   no)
3151     bootstrap_suffix=no-bootstrap ;;
3152 esac
3153
3154 for module in ${build_configdirs} ; do
3155   if test -z "${no_recursion}" \
3156      && test -f ${build_subdir}/${module}/Makefile; then
3157     echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
3158     rm -f ${build_subdir}/${module}/Makefile
3159   fi
3160   extrasub="$extrasub
3161 /^@if build-$module\$/d
3162 /^@endif build-$module\$/d
3163 /^@if build-$module-$bootstrap_suffix\$/d
3164 /^@endif build-$module-$bootstrap_suffix\$/d"
3165 done
3166 for module in ${configdirs} ; do
3167   if test -z "${no_recursion}"; then
3168     for file in stage*-${module}/Makefile ${module}/Makefile; do
3169       if test -f ${file}; then
3170         echo 1>&2 "*** removing ${file} to force reconfigure"
3171         rm -f ${file}
3172       fi
3173     done
3174   fi
3175   extrasub="$extrasub
3176 /^@if $module\$/d
3177 /^@endif $module\$/d
3178 /^@if $module-$bootstrap_suffix\$/d
3179 /^@endif $module-$bootstrap_suffix\$/d"
3180 done
3181 for module in ${target_configdirs} ; do
3182   if test -z "${no_recursion}" \
3183      && test -f ${target_subdir}/${module}/Makefile; then
3184     echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure"
3185     rm -f ${target_subdir}/${module}/Makefile
3186   fi
3187   extrasub="$extrasub
3188 /^@if target-$module\$/d
3189 /^@endif target-$module\$/d
3190 /^@if target-$module-$bootstrap_suffix\$/d
3191 /^@endif target-$module-$bootstrap_suffix\$/d"
3192 done
3193
3194 extrasub="$extrasub
3195 /^@if /,/^@endif /d"
3196
3197 # Create the serialization dependencies.  This uses a temporary file.
3198
3199 # Check whether --enable-serial-configure or --disable-serial-configure was given.
3200 if test "${enable_serial_configure+set}" = set; then
3201   enableval="$enable_serial_configure"
3202   :
3203 fi
3204
3205
3206 case ${enable_serial_configure} in
3207   yes)
3208     enable_serial_build_configure=yes
3209     enable_serial_host_configure=yes
3210     enable_serial_target_configure=yes
3211     ;;
3212 esac
3213
3214 # These force 'configure's to be done one at a time, to avoid problems
3215 # with contention over a shared config.cache.
3216 rm -f serdep.tmp
3217 echo '# serdep.tmp' > serdep.tmp
3218 olditem=
3219 test "x${enable_serial_build_configure}" = xyes &&
3220 for item in ${build_configdirs} ; do
3221   case ${olditem} in
3222     "") ;;
3223     *) echo "configure-build-${item}: configure-build-${olditem}" >> serdep.tmp ;;
3224   esac
3225   olditem=${item}
3226 done
3227 olditem=
3228 test "x${enable_serial_host_configure}" = xyes &&
3229 for item in ${configdirs} ; do
3230   case ${olditem} in
3231     "") ;;
3232     *) echo "configure-${item}: configure-${olditem}" >> serdep.tmp ;;
3233   esac
3234   olditem=${item}
3235 done
3236 olditem=
3237 test "x${enable_serial_target_configure}" = xyes &&
3238 for item in ${target_configdirs} ; do
3239   case ${olditem} in
3240     "") ;;
3241     *) echo "configure-target-${item}: configure-target-${olditem}" >> serdep.tmp ;;
3242   esac
3243   olditem=${item}
3244 done
3245 serialization_dependencies=serdep.tmp
3246
3247
3248 # Base args.  Strip norecursion, cache-file, srcdir, host, build,
3249 # target and nonopt.  These are the ones we might not want to pass
3250 # down to subconfigures.  Also strip program-prefix, program-suffix,
3251 # and program-transform-name, so that we can pass down a consistent
3252 # program-transform-name.  If autoconf has put single quotes around
3253 # any of these arguments (because they contain shell metacharacters)
3254 # then this will fail; in practice this only happens for
3255 # --program-transform-name, so be sure to override --program-transform-name
3256 # at the end of the argument list.
3257 # These will be expanded by make, so quote '$'.
3258 cat <<\EOF_SED > conftestsed
3259 s/ --no[^ ]*/ /g
3260 s/ --c[a-z-]*[= ][^ ]*//g
3261 s/ --sr[a-z-]*[= ][^ ]*//g
3262 s/ --ho[a-z-]*[= ][^ ]*//g
3263 s/ --bu[a-z-]*[= ][^ ]*//g
3264 s/ --t[a-z-]*[= ][^ ]*//g
3265 s/ --program-[pst][a-z-]*[= ][^ ]*//g
3266 s/ -cache-file[= ][^ ]*//g
3267 s/ -srcdir[= ][^ ]*//g
3268 s/ -host[= ][^ ]*//g
3269 s/ -build[= ][^ ]*//g
3270 s/ -target[= ][^ ]*//g
3271 s/ -program-prefix[= ][^ ]*//g
3272 s/ -program-suffix[= ][^ ]*//g
3273 s/ -program-transform-name[= ][^ ]*//g
3274 s/ [^' -][^ ]* / /
3275 s/^ *//;s/ *$//
3276 s,\$,$$,g
3277 EOF_SED
3278 sed -f conftestsed <<EOF_SED > conftestsed.out
3279  ${ac_configure_args} 
3280 EOF_SED
3281 baseargs=`cat conftestsed.out`
3282 rm -f conftestsed conftestsed.out
3283
3284 # Add in --program-transform-name, after --program-prefix and
3285 # --program-suffix have been applied to it.  Autoconf has already
3286 # doubled dollar signs and backslashes in program_transform_name; we want
3287 # the backslashes un-doubled, and then the entire thing wrapped in single
3288 # quotes, because this will be expanded first by make and then by the shell. 
3289 # Also, because we want to override the logic in subdir configure scripts to
3290 # choose program_transform_name, replace any s,x,x, with s,y,y,.
3291 sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" <<EOF_SED > conftestsed.out
3292 ${program_transform_name}
3293 EOF_SED
3294 gcc_transform_name=`cat conftestsed.out`
3295 rm -f conftestsed.out
3296 baseargs="$baseargs --program-transform-name='${gcc_transform_name}'"
3297
3298 # For the build-side libraries, we just need to pretend we're native,
3299 # and not use the same cache file.  Multilibs are neither needed nor
3300 # desired.
3301 build_configargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} --target=${target_alias} ${baseargs}"
3302
3303 # For host modules, accept cache file option, or specification as blank.
3304 case "${cache_file}" in
3305 "") # empty
3306   cache_file_option="" ;;
3307 /* | [A-Za-z]:[\\/]* ) # absolute path
3308   cache_file_option="--cache-file=${cache_file}" ;;
3309 *) # relative path
3310   cache_file_option="--cache-file=../${cache_file}" ;;
3311 esac
3312
3313 # Host dirs don't like to share a cache file either, horribly enough.
3314 # This seems to be due to autoconf 2.5x stupidity.
3315 host_configargs="--cache-file=./config.cache --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}"
3316
3317 target_configargs=${baseargs}
3318
3319 # Passing a --with-cross-host argument lets the target libraries know
3320 # whether they are being built with a cross-compiler or being built
3321 # native.  However, it would be better to use other mechanisms to make the
3322 # sorts of decisions they want to make on this basis.  Please consider
3323 # this option to be deprecated.  FIXME.
3324 if test x${is_cross_compiler} = xyes ; then
3325   target_configargs="--with-cross-host=${host_alias} ${target_configargs}"
3326 fi
3327
3328 # Default to --enable-multilib.
3329 if test x${enable_multilib} = x ; then
3330   target_configargs="--enable-multilib ${target_configargs}"
3331 fi
3332
3333 # Pass --with-newlib if appropriate.  Note that target_configdirs has
3334 # changed from the earlier setting of with_newlib.
3335 if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then
3336   target_configargs="--with-newlib ${target_configargs}"
3337 fi
3338
3339 # Different target subdirs use different values of certain variables
3340 # (notably CXX).  Worse, multilibs use *lots* of different values.
3341 # Worse yet, autoconf 2.5x makes some of these 'precious', meaning that
3342 # it doesn't automatically accept command-line overrides of them.
3343 # This means it's not safe for target subdirs to share a cache file,
3344 # which is disgusting, but there you have it.  Hopefully this can be
3345 # fixed in future.  It's still worthwhile to use a cache file for each
3346 # directory.  I think.
3347
3348 # Pass the appropriate --build, --host, --target and --cache-file arguments.
3349 # We need to pass --target, as newer autoconf's requires consistency
3350 # for target_alias and gcc doesn't manage it consistently.
3351 target_configargs="--cache-file=./config.cache --build=${build_alias} --host=${target_alias} --target=${target_alias} ${target_configargs}"
3352
3353 FLAGS_FOR_TARGET=
3354 case " $target_configdirs " in
3355  *" newlib "*)
3356   case " $target_configargs " in
3357   *" --with-newlib "*)
3358    case "$target" in
3359    *-cygwin*)
3360      FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include' ;;
3361    esac
3362
3363    # If we're not building GCC, don't discard standard headers.
3364    if test -d ${srcdir}/gcc; then
3365      FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
3366
3367      if test "${build}" != "${host}"; then
3368        # On Canadian crosses, CC_FOR_TARGET will have already been set
3369        # by `configure', so we won't have an opportunity to add -Bgcc/
3370        # to it.  This is right: we don't want to search that directory
3371        # for binaries, but we want the header files in there, so add
3372        # them explicitly.
3373        FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/$(HOST_SUBDIR)/gcc/include'
3374
3375        # Someone might think of using the pre-installed headers on
3376        # Canadian crosses, in case the installed compiler is not fully
3377        # compatible with the compiler being built.  In this case, it
3378        # would be better to flag an error than risking having
3379        # incompatible object files being constructed.  We can't
3380        # guarantee that an error will be flagged, but let's hope the
3381        # compiler will do it, when presented with incompatible header
3382        # files.
3383      fi
3384    fi
3385
3386    case "${target}-${is_cross_compiler}" in
3387    i[3456789]86-*-linux*-no)
3388       # Here host == target, so we don't need to build gcc,
3389       # so we don't want to discard standard headers.
3390       FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'`
3391       ;;
3392    *)
3393       # If we're building newlib, use its generic headers last, but search
3394       # for any libc-related directories first (so make it the last -B
3395       # switch).
3396       FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
3397       ;;
3398    esac
3399    ;;
3400   esac
3401   ;;
3402 esac
3403 case "$target" in
3404 *-mingw*)
3405   # Can't be handled as Cygwin above since Mingw does not use newlib.
3406   FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include' ;;
3407 esac
3408
3409 # Allow the user to override the flags for
3410 # our build compiler if desired.
3411 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
3412
3413 # On Canadian crosses, we'll be searching the right directories for
3414 # the previously-installed cross compiler, so don't bother to add
3415 # flags for directories within the install tree of the compiler
3416 # being built; programs in there won't even run.
3417 if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
3418   # Search for pre-installed headers if nothing else fits.
3419   FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
3420 fi
3421
3422 if test "x${use_gnu_ld}" = x &&
3423    echo " ${configdirs} " | grep " ld " > /dev/null ; then
3424   # Arrange for us to find uninstalled linker scripts.
3425   FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(HOST_SUBDIR)/ld'
3426 fi
3427
3428 # Search for other target-specific linker scripts and such.
3429 case "${target}" in
3430   m32c-*-* )
3431     if test -d ${srcdir}/libgloss/m32c; then
3432       # This is for crt0.o
3433       FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/libgloss/m32c'
3434       # This is for r8c.ld
3435       FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/m32c'
3436       # This is for libnosys.a
3437       FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/libnosys'
3438     fi
3439     ;;
3440 esac
3441
3442 # Makefile fragments.
3443 for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag;
3444 do
3445   eval fragval=\$$frag
3446   if test $fragval != /dev/null; then
3447     eval $frag=${srcdir}/$fragval
3448   fi
3449 done
3450
3451
3452
3453
3454
3455 # Miscellanea: directories, flags, etc.
3456
3457
3458
3459
3460
3461
3462
3463 # Build module lists & subconfigure args.
3464
3465
3466
3467 # Host module lists & subconfigure args.
3468
3469
3470
3471 # Target module lists & subconfigure args.
3472
3473
3474
3475 # Build tools.
3476
3477
3478
3479 # Generate default definitions for YACC, M4, LEX and other programs that run
3480 # on the build machine.  These are used if the Makefile can't locate these
3481 # programs in objdir.
3482 MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
3483
3484 for ac_prog in 'bison -y' byacc yacc
3485 do
3486 # Extract the first word of "$ac_prog", so it can be a program name with args.
3487 set dummy $ac_prog; ac_word=$2
3488 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3489 echo "configure:3490: checking for $ac_word" >&5
3490 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
3491   echo $ac_n "(cached) $ac_c" 1>&6
3492 else
3493   if test -n "$YACC"; then
3494   ac_cv_prog_YACC="$YACC" # Let the user override the test.
3495 else
3496   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3497   ac_dummy="$PATH"
3498   for ac_dir in $ac_dummy; do
3499     test -z "$ac_dir" && ac_dir=.
3500     if test -f $ac_dir/$ac_word; then
3501       ac_cv_prog_YACC="$ac_prog"
3502       break
3503     fi
3504   done
3505   IFS="$ac_save_ifs"
3506 fi
3507 fi
3508 YACC="$ac_cv_prog_YACC"
3509 if test -n "$YACC"; then
3510   echo "$ac_t""$YACC" 1>&6
3511 else
3512   echo "$ac_t""no" 1>&6
3513 fi
3514
3515 test -n "$YACC" && break
3516 done
3517 test -n "$YACC" || YACC="$MISSING bison -y"
3518
3519 case " $build_configdirs " in
3520   *" bison "*) YACC='$$r/$(BUILD_SUBDIR)/bison/tests/bison -y' ;;
3521   *" byacc "*) YACC='$$r/$(BUILD_SUBDIR)/byacc/byacc' ;;
3522 esac
3523
3524 for ac_prog in bison
3525 do
3526 # Extract the first word of "$ac_prog", so it can be a program name with args.
3527 set dummy $ac_prog; ac_word=$2
3528 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3529 echo "configure:3530: checking for $ac_word" >&5
3530 if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then
3531   echo $ac_n "(cached) $ac_c" 1>&6
3532 else
3533   if test -n "$BISON"; then
3534   ac_cv_prog_BISON="$BISON" # Let the user override the test.
3535 else
3536   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3537   ac_dummy="$PATH"
3538   for ac_dir in $ac_dummy; do
3539     test -z "$ac_dir" && ac_dir=.
3540     if test -f $ac_dir/$ac_word; then
3541       ac_cv_prog_BISON="$ac_prog"
3542       break
3543     fi
3544   done
3545   IFS="$ac_save_ifs"
3546 fi
3547 fi
3548 BISON="$ac_cv_prog_BISON"
3549 if test -n "$BISON"; then
3550   echo "$ac_t""$BISON" 1>&6
3551 else
3552   echo "$ac_t""no" 1>&6
3553 fi
3554
3555 test -n "$BISON" && break
3556 done
3557 test -n "$BISON" || BISON="$MISSING bison"
3558
3559 case " $build_configdirs " in
3560   *" bison "*) BISON='$$r/$(BUILD_SUBDIR)/bison/tests/bison' ;;
3561 esac
3562
3563 for ac_prog in gm4 gnum4 m4
3564 do
3565 # Extract the first word of "$ac_prog", so it can be a program name with args.
3566 set dummy $ac_prog; ac_word=$2
3567 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3568 echo "configure:3569: checking for $ac_word" >&5
3569 if eval "test \"`echo '$''{'ac_cv_prog_M4'+set}'`\" = set"; then
3570   echo $ac_n "(cached) $ac_c" 1>&6
3571 else
3572   if test -n "$M4"; then
3573   ac_cv_prog_M4="$M4" # Let the user override the test.
3574 else
3575   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3576   ac_dummy="$PATH"
3577   for ac_dir in $ac_dummy; do
3578     test -z "$ac_dir" && ac_dir=.
3579     if test -f $ac_dir/$ac_word; then
3580       ac_cv_prog_M4="$ac_prog"
3581       break
3582     fi
3583   done
3584   IFS="$ac_save_ifs"
3585 fi
3586 fi
3587 M4="$ac_cv_prog_M4"
3588 if test -n "$M4"; then
3589   echo "$ac_t""$M4" 1>&6
3590 else
3591   echo "$ac_t""no" 1>&6
3592 fi
3593
3594 test -n "$M4" && break
3595 done
3596 test -n "$M4" || M4="$MISSING m4"
3597
3598 case " $build_configdirs " in
3599   *" m4 "*) M4='$$r/$(BUILD_SUBDIR)/m4/m4' ;;
3600 esac
3601
3602 for ac_prog in flex lex
3603 do
3604 # Extract the first word of "$ac_prog", so it can be a program name with args.
3605 set dummy $ac_prog; ac_word=$2
3606 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3607 echo "configure:3608: checking for $ac_word" >&5
3608 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
3609   echo $ac_n "(cached) $ac_c" 1>&6
3610 else
3611   if test -n "$LEX"; then
3612   ac_cv_prog_LEX="$LEX" # Let the user override the test.
3613 else
3614   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3615   ac_dummy="$PATH"
3616   for ac_dir in $ac_dummy; do
3617     test -z "$ac_dir" && ac_dir=.
3618     if test -f $ac_dir/$ac_word; then
3619       ac_cv_prog_LEX="$ac_prog"
3620       break
3621     fi
3622   done
3623   IFS="$ac_save_ifs"
3624 fi
3625 fi
3626 LEX="$ac_cv_prog_LEX"
3627 if test -n "$LEX"; then
3628   echo "$ac_t""$LEX" 1>&6
3629 else
3630   echo "$ac_t""no" 1>&6
3631 fi
3632
3633 test -n "$LEX" && break
3634 done
3635 test -n "$LEX" || LEX="$MISSING flex"
3636
3637 case " $build_configdirs " in
3638   *" flex "*) LEX='$$r/$(BUILD_SUBDIR)/flex/flex' ;;
3639   *" lex "*) LEX='$$r/$(BUILD_SUBDIR)/lex/lex' ;;
3640 esac
3641
3642 for ac_prog in flex
3643 do
3644 # Extract the first word of "$ac_prog", so it can be a program name with args.
3645 set dummy $ac_prog; ac_word=$2
3646 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3647 echo "configure:3648: checking for $ac_word" >&5
3648 if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then
3649   echo $ac_n "(cached) $ac_c" 1>&6
3650 else
3651   if test -n "$FLEX"; then
3652   ac_cv_prog_FLEX="$FLEX" # Let the user override the test.
3653 else
3654   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3655   ac_dummy="$PATH"
3656   for ac_dir in $ac_dummy; do
3657     test -z "$ac_dir" && ac_dir=.
3658     if test -f $ac_dir/$ac_word; then
3659       ac_cv_prog_FLEX="$ac_prog"
3660       break
3661     fi
3662   done
3663   IFS="$ac_save_ifs"
3664 fi
3665 fi
3666 FLEX="$ac_cv_prog_FLEX"
3667 if test -n "$FLEX"; then
3668   echo "$ac_t""$FLEX" 1>&6
3669 else
3670   echo "$ac_t""no" 1>&6
3671 fi
3672
3673 test -n "$FLEX" && break
3674 done
3675 test -n "$FLEX" || FLEX="$MISSING flex"
3676
3677 case " $build_configdirs " in
3678   *" flex "*) FLEX='$$r/$(BUILD_SUBDIR)/flex/flex' ;;
3679 esac
3680
3681 for ac_prog in makeinfo
3682 do
3683 # Extract the first word of "$ac_prog", so it can be a program name with args.
3684 set dummy $ac_prog; ac_word=$2
3685 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3686 echo "configure:3687: checking for $ac_word" >&5
3687 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then
3688   echo $ac_n "(cached) $ac_c" 1>&6
3689 else
3690   if test -n "$MAKEINFO"; then
3691   ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test.
3692 else
3693   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3694   ac_dummy="$PATH"
3695   for ac_dir in $ac_dummy; do
3696     test -z "$ac_dir" && ac_dir=.
3697     if test -f $ac_dir/$ac_word; then
3698       ac_cv_prog_MAKEINFO="$ac_prog"
3699       break
3700     fi
3701   done
3702   IFS="$ac_save_ifs"
3703 fi
3704 fi
3705 MAKEINFO="$ac_cv_prog_MAKEINFO"
3706 if test -n "$MAKEINFO"; then
3707   echo "$ac_t""$MAKEINFO" 1>&6
3708 else
3709   echo "$ac_t""no" 1>&6
3710 fi
3711
3712 test -n "$MAKEINFO" && break
3713 done
3714 test -n "$MAKEINFO" || MAKEINFO="$MISSING makeinfo"
3715
3716 case " $build_configdirs " in
3717   *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
3718   *)
3719
3720     # For an installed makeinfo, we require it to be from texinfo 4.4 or
3721     # higher, else we use the "missing" dummy.
3722     if ${MAKEINFO} --version \
3723        | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
3724       :
3725     else
3726       MAKEINFO="$MISSING makeinfo"
3727     fi
3728     ;;
3729
3730 esac
3731
3732 # FIXME: expect and dejagnu may become build tools?
3733
3734 for ac_prog in expect
3735 do
3736 # Extract the first word of "$ac_prog", so it can be a program name with args.
3737 set dummy $ac_prog; ac_word=$2
3738 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3739 echo "configure:3740: checking for $ac_word" >&5
3740 if eval "test \"`echo '$''{'ac_cv_prog_EXPECT'+set}'`\" = set"; then
3741   echo $ac_n "(cached) $ac_c" 1>&6
3742 else
3743   if test -n "$EXPECT"; then
3744   ac_cv_prog_EXPECT="$EXPECT" # Let the user override the test.
3745 else
3746   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3747   ac_dummy="$PATH"
3748   for ac_dir in $ac_dummy; do
3749     test -z "$ac_dir" && ac_dir=.
3750     if test -f $ac_dir/$ac_word; then
3751       ac_cv_prog_EXPECT="$ac_prog"
3752       break
3753     fi
3754   done
3755   IFS="$ac_save_ifs"
3756 fi
3757 fi
3758 EXPECT="$ac_cv_prog_EXPECT"
3759 if test -n "$EXPECT"; then
3760   echo "$ac_t""$EXPECT" 1>&6