OSDN Git Service

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