OSDN Git Service

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