OSDN Git Service

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