* acinclude.m4: Include bfd/acinclude.m4, not bfd/acmacros.m4.
[platform/upstream/binutils.git] / binutils / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.12 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_help="$ac_help
15   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
16 ac_help="$ac_help
17   --enable-shared         build shared libraries [default=yes]"
18 ac_help="$ac_help
19   --enable-static         build static libraries [default=yes]"
20 ac_help="$ac_help
21   --enable-targets        alternative target configurations"
22 ac_help="$ac_help
23   --enable-commonbfdlib   build shared BFD/opcodes/libiberty library"
24 ac_help="$ac_help
25   --enable-maintainer-mode enable make rules and dependencies not useful
26                           (and sometimes confusing) to the casual installer"
27
28 # Initialize some variables set by options.
29 # The variables have the same names as the options, with
30 # dashes changed to underlines.
31 build=NONE
32 cache_file=./config.cache
33 exec_prefix=NONE
34 host=NONE
35 no_create=
36 nonopt=NONE
37 no_recursion=
38 prefix=NONE
39 program_prefix=NONE
40 program_suffix=NONE
41 program_transform_name=s,x,x,
42 silent=
43 site=
44 srcdir=
45 target=NONE
46 verbose=
47 x_includes=NONE
48 x_libraries=NONE
49 bindir='${exec_prefix}/bin'
50 sbindir='${exec_prefix}/sbin'
51 libexecdir='${exec_prefix}/libexec'
52 datadir='${prefix}/share'
53 sysconfdir='${prefix}/etc'
54 sharedstatedir='${prefix}/com'
55 localstatedir='${prefix}/var'
56 libdir='${exec_prefix}/lib'
57 includedir='${prefix}/include'
58 oldincludedir='/usr/include'
59 infodir='${prefix}/info'
60 mandir='${prefix}/man'
61
62 # Initialize some other variables.
63 subdirs=
64 MFLAGS= MAKEFLAGS=
65 # Maximum number of lines to put in a shell here document.
66 ac_max_here_lines=12
67
68 ac_prev=
69 for ac_option
70 do
71
72   # If the previous option needs an argument, assign it.
73   if test -n "$ac_prev"; then
74     eval "$ac_prev=\$ac_option"
75     ac_prev=
76     continue
77   fi
78
79   case "$ac_option" in
80   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
81   *) ac_optarg= ;;
82   esac
83
84   # Accept the important Cygnus configure options, so we can diagnose typos.
85
86   case "$ac_option" in
87
88   -bindir | --bindir | --bindi | --bind | --bin | --bi)
89     ac_prev=bindir ;;
90   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
91     bindir="$ac_optarg" ;;
92
93   -build | --build | --buil | --bui | --bu)
94     ac_prev=build ;;
95   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
96     build="$ac_optarg" ;;
97
98   -cache-file | --cache-file | --cache-fil | --cache-fi \
99   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
100     ac_prev=cache_file ;;
101   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
102   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
103     cache_file="$ac_optarg" ;;
104
105   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
106     ac_prev=datadir ;;
107   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
108   | --da=*)
109     datadir="$ac_optarg" ;;
110
111   -disable-* | --disable-*)
112     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
113     # Reject names that are not valid shell variable names.
114     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
115       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
116     fi
117     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
118     eval "enable_${ac_feature}=no" ;;
119
120   -enable-* | --enable-*)
121     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
122     # Reject names that are not valid shell variable names.
123     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
124       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
125     fi
126     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
127     case "$ac_option" in
128       *=*) ;;
129       *) ac_optarg=yes ;;
130     esac
131     eval "enable_${ac_feature}='$ac_optarg'" ;;
132
133   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
134   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
135   | --exec | --exe | --ex)
136     ac_prev=exec_prefix ;;
137   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
138   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
139   | --exec=* | --exe=* | --ex=*)
140     exec_prefix="$ac_optarg" ;;
141
142   -gas | --gas | --ga | --g)
143     # Obsolete; use --with-gas.
144     with_gas=yes ;;
145
146   -help | --help | --hel | --he)
147     # Omit some internal or obsolete options to make the list less imposing.
148     # This message is too long to be a string in the A/UX 3.1 sh.
149     cat << EOF
150 Usage: configure [options] [host]
151 Options: [defaults in brackets after descriptions]
152 Configuration:
153   --cache-file=FILE       cache test results in FILE
154   --help                  print this message
155   --no-create             do not create output files
156   --quiet, --silent       do not print \`checking...' messages
157   --version               print the version of autoconf that created configure
158 Directory and file names:
159   --prefix=PREFIX         install architecture-independent files in PREFIX
160                           [$ac_default_prefix]
161   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
162                           [same as prefix]
163   --bindir=DIR            user executables in DIR [EPREFIX/bin]
164   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
165   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
166   --datadir=DIR           read-only architecture-independent data in DIR
167                           [PREFIX/share]
168   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
169   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
170                           [PREFIX/com]
171   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
172   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
173   --includedir=DIR        C header files in DIR [PREFIX/include]
174   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
175   --infodir=DIR           info documentation in DIR [PREFIX/info]
176   --mandir=DIR            man documentation in DIR [PREFIX/man]
177   --srcdir=DIR            find the sources in DIR [configure dir or ..]
178   --program-prefix=PREFIX prepend PREFIX to installed program names
179   --program-suffix=SUFFIX append SUFFIX to installed program names
180   --program-transform-name=PROGRAM
181                           run sed PROGRAM on installed program names
182 EOF
183     cat << EOF
184 Host type:
185   --build=BUILD           configure for building on BUILD [BUILD=HOST]
186   --host=HOST             configure for HOST [guessed]
187   --target=TARGET         configure for TARGET [TARGET=HOST]
188 Features and packages:
189   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
190   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
191   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
192   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
193   --x-includes=DIR        X include files are in DIR
194   --x-libraries=DIR       X library files are in DIR
195 EOF
196     if test -n "$ac_help"; then
197       echo "--enable and --with options recognized:$ac_help"
198     fi
199     exit 0 ;;
200
201   -host | --host | --hos | --ho)
202     ac_prev=host ;;
203   -host=* | --host=* | --hos=* | --ho=*)
204     host="$ac_optarg" ;;
205
206   -includedir | --includedir | --includedi | --included | --include \
207   | --includ | --inclu | --incl | --inc)
208     ac_prev=includedir ;;
209   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
210   | --includ=* | --inclu=* | --incl=* | --inc=*)
211     includedir="$ac_optarg" ;;
212
213   -infodir | --infodir | --infodi | --infod | --info | --inf)
214     ac_prev=infodir ;;
215   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
216     infodir="$ac_optarg" ;;
217
218   -libdir | --libdir | --libdi | --libd)
219     ac_prev=libdir ;;
220   -libdir=* | --libdir=* | --libdi=* | --libd=*)
221     libdir="$ac_optarg" ;;
222
223   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
224   | --libexe | --libex | --libe)
225     ac_prev=libexecdir ;;
226   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
227   | --libexe=* | --libex=* | --libe=*)
228     libexecdir="$ac_optarg" ;;
229
230   -localstatedir | --localstatedir | --localstatedi | --localstated \
231   | --localstate | --localstat | --localsta | --localst \
232   | --locals | --local | --loca | --loc | --lo)
233     ac_prev=localstatedir ;;
234   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
235   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
236   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
237     localstatedir="$ac_optarg" ;;
238
239   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
240     ac_prev=mandir ;;
241   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
242     mandir="$ac_optarg" ;;
243
244   -nfp | --nfp | --nf)
245     # Obsolete; use --without-fp.
246     with_fp=no ;;
247
248   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
249   | --no-cr | --no-c)
250     no_create=yes ;;
251
252   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
253   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
254     no_recursion=yes ;;
255
256   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
257   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
258   | --oldin | --oldi | --old | --ol | --o)
259     ac_prev=oldincludedir ;;
260   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
261   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
262   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
263     oldincludedir="$ac_optarg" ;;
264
265   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
266     ac_prev=prefix ;;
267   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
268     prefix="$ac_optarg" ;;
269
270   -program-prefix | --program-prefix | --program-prefi | --program-pref \
271   | --program-pre | --program-pr | --program-p)
272     ac_prev=program_prefix ;;
273   -program-prefix=* | --program-prefix=* | --program-prefi=* \
274   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
275     program_prefix="$ac_optarg" ;;
276
277   -program-suffix | --program-suffix | --program-suffi | --program-suff \
278   | --program-suf | --program-su | --program-s)
279     ac_prev=program_suffix ;;
280   -program-suffix=* | --program-suffix=* | --program-suffi=* \
281   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
282     program_suffix="$ac_optarg" ;;
283
284   -program-transform-name | --program-transform-name \
285   | --program-transform-nam | --program-transform-na \
286   | --program-transform-n | --program-transform- \
287   | --program-transform | --program-transfor \
288   | --program-transfo | --program-transf \
289   | --program-trans | --program-tran \
290   | --progr-tra | --program-tr | --program-t)
291     ac_prev=program_transform_name ;;
292   -program-transform-name=* | --program-transform-name=* \
293   | --program-transform-nam=* | --program-transform-na=* \
294   | --program-transform-n=* | --program-transform-=* \
295   | --program-transform=* | --program-transfor=* \
296   | --program-transfo=* | --program-transf=* \
297   | --program-trans=* | --program-tran=* \
298   | --progr-tra=* | --program-tr=* | --program-t=*)
299     program_transform_name="$ac_optarg" ;;
300
301   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
302   | -silent | --silent | --silen | --sile | --sil)
303     silent=yes ;;
304
305   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
306     ac_prev=sbindir ;;
307   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
308   | --sbi=* | --sb=*)
309     sbindir="$ac_optarg" ;;
310
311   -sharedstatedir | --sharedstatedir | --sharedstatedi \
312   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
313   | --sharedst | --shareds | --shared | --share | --shar \
314   | --sha | --sh)
315     ac_prev=sharedstatedir ;;
316   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
317   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
318   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
319   | --sha=* | --sh=*)
320     sharedstatedir="$ac_optarg" ;;
321
322   -site | --site | --sit)
323     ac_prev=site ;;
324   -site=* | --site=* | --sit=*)
325     site="$ac_optarg" ;;
326
327   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
328     ac_prev=srcdir ;;
329   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
330     srcdir="$ac_optarg" ;;
331
332   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
333   | --syscon | --sysco | --sysc | --sys | --sy)
334     ac_prev=sysconfdir ;;
335   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
336   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
337     sysconfdir="$ac_optarg" ;;
338
339   -target | --target | --targe | --targ | --tar | --ta | --t)
340     ac_prev=target ;;
341   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
342     target="$ac_optarg" ;;
343
344   -v | -verbose | --verbose | --verbos | --verbo | --verb)
345     verbose=yes ;;
346
347   -version | --version | --versio | --versi | --vers)
348     echo "configure generated by autoconf version 2.12"
349     exit 0 ;;
350
351   -with-* | --with-*)
352     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
353     # Reject names that are not valid shell variable names.
354     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
355       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
356     fi
357     ac_package=`echo $ac_package| sed 's/-/_/g'`
358     case "$ac_option" in
359       *=*) ;;
360       *) ac_optarg=yes ;;
361     esac
362     eval "with_${ac_package}='$ac_optarg'" ;;
363
364   -without-* | --without-*)
365     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
366     # Reject names that are not valid shell variable names.
367     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
368       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
369     fi
370     ac_package=`echo $ac_package| sed 's/-/_/g'`
371     eval "with_${ac_package}=no" ;;
372
373   --x)
374     # Obsolete; use --with-x.
375     with_x=yes ;;
376
377   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
378   | --x-incl | --x-inc | --x-in | --x-i)
379     ac_prev=x_includes ;;
380   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
381   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
382     x_includes="$ac_optarg" ;;
383
384   -x-libraries | --x-libraries | --x-librarie | --x-librari \
385   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
386     ac_prev=x_libraries ;;
387   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
388   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
389     x_libraries="$ac_optarg" ;;
390
391   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
392     ;;
393
394   *)
395     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
396       echo "configure: warning: $ac_option: invalid host type" 1>&2
397     fi
398     if test "x$nonopt" != xNONE; then
399       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
400     fi
401     nonopt="$ac_option"
402     ;;
403
404   esac
405 done
406
407 if test -n "$ac_prev"; then
408   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
409 fi
410
411 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
412
413 # File descriptor usage:
414 # 0 standard input
415 # 1 file creation
416 # 2 errors and warnings
417 # 3 some systems may open it to /dev/tty
418 # 4 used on the Kubota Titan
419 # 6 checking for... messages and results
420 # 5 compiler messages saved in config.log
421 if test "$silent" = yes; then
422   exec 6>/dev/null
423 else
424   exec 6>&1
425 fi
426 exec 5>./config.log
427
428 echo "\
429 This file contains any messages produced by compilers while
430 running configure, to aid debugging if configure makes a mistake.
431 " 1>&5
432
433 # Strip out --no-create and --no-recursion so they do not pile up.
434 # Also quote any args containing shell metacharacters.
435 ac_configure_args=
436 for ac_arg
437 do
438   case "$ac_arg" in
439   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
440   | --no-cr | --no-c) ;;
441   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
442   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
443   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
444   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
445   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
446   esac
447 done
448
449 # NLS nuisances.
450 # Only set these to C if already set.  These must not be set unconditionally
451 # because not all systems understand e.g. LANG=C (notably SCO).
452 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
453 # Non-C LC_CTYPE values break the ctype check.
454 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
455 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
456 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
457 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
458
459 # confdefs.h avoids OS command line length limits that DEFS can exceed.
460 rm -rf conftest* confdefs.h
461 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
462 echo > confdefs.h
463
464 # A filename unique to this package, relative to the directory that
465 # configure is in, which we can look for to find out if srcdir is correct.
466 ac_unique_file=ar.c
467
468 # Find the source files, if location was not specified.
469 if test -z "$srcdir"; then
470   ac_srcdir_defaulted=yes
471   # Try the directory containing this script, then its parent.
472   ac_prog=$0
473   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
474   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
475   srcdir=$ac_confdir
476   if test ! -r $srcdir/$ac_unique_file; then
477     srcdir=..
478   fi
479 else
480   ac_srcdir_defaulted=no
481 fi
482 if test ! -r $srcdir/$ac_unique_file; then
483   if test "$ac_srcdir_defaulted" = yes; then
484     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
485   else
486     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
487   fi
488 fi
489 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
490
491 # Prefer explicitly selected file to automatically selected ones.
492 if test -z "$CONFIG_SITE"; then
493   if test "x$prefix" != xNONE; then
494     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
495   else
496     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
497   fi
498 fi
499 for ac_site_file in $CONFIG_SITE; do
500   if test -r "$ac_site_file"; then
501     echo "loading site script $ac_site_file"
502     . "$ac_site_file"
503   fi
504 done
505
506 if test -r "$cache_file"; then
507   echo "loading cache $cache_file"
508   . $cache_file
509 else
510   echo "creating cache $cache_file"
511   > $cache_file
512 fi
513
514 ac_ext=c
515 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
516 ac_cpp='$CPP $CPPFLAGS'
517 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
518 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
519 cross_compiling=$ac_cv_prog_cc_cross
520
521 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
522   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
523   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
524     ac_n= ac_c='
525 ' ac_t='        '
526   else
527     ac_n=-n ac_c= ac_t=
528   fi
529 else
530   ac_n= ac_c='\c' ac_t=
531 fi
532
533
534
535 ac_aux_dir=
536 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
537   if test -f $ac_dir/install-sh; then
538     ac_aux_dir=$ac_dir
539     ac_install_sh="$ac_aux_dir/install-sh -c"
540     break
541   elif test -f $ac_dir/install.sh; then
542     ac_aux_dir=$ac_dir
543     ac_install_sh="$ac_aux_dir/install.sh -c"
544     break
545   fi
546 done
547 if test -z "$ac_aux_dir"; then
548   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
549 fi
550 ac_config_guess=$ac_aux_dir/config.guess
551 ac_config_sub=$ac_aux_dir/config.sub
552 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
553
554
555 # Do some error checking and defaulting for the host and target type.
556 # The inputs are:
557 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
558 #
559 # The rules are:
560 # 1. You are not allowed to specify --host, --target, and nonopt at the
561 #    same time.
562 # 2. Host defaults to nonopt.
563 # 3. If nonopt is not specified, then host defaults to the current host,
564 #    as determined by config.guess.
565 # 4. Target and build default to nonopt.
566 # 5. If nonopt is not specified, then target and build default to host.
567
568 # The aliases save the names the user supplied, while $host etc.
569 # will get canonicalized.
570 case $host---$target---$nonopt in
571 NONE---*---* | *---NONE---* | *---*---NONE) ;;
572 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
573 esac
574
575
576 # Make sure we can run config.sub.
577 if $ac_config_sub sun4 >/dev/null 2>&1; then :
578 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
579 fi
580
581 echo $ac_n "checking host system type""... $ac_c" 1>&6
582 echo "configure:583: checking host system type" >&5
583
584 host_alias=$host
585 case "$host_alias" in
586 NONE)
587   case $nonopt in
588   NONE)
589     if host_alias=`$ac_config_guess`; then :
590     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
591     fi ;;
592   *) host_alias=$nonopt ;;
593   esac ;;
594 esac
595
596 host=`$ac_config_sub $host_alias`
597 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
598 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
599 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
600 echo "$ac_t""$host" 1>&6
601
602 echo $ac_n "checking target system type""... $ac_c" 1>&6
603 echo "configure:604: checking target system type" >&5
604
605 target_alias=$target
606 case "$target_alias" in
607 NONE)
608   case $nonopt in
609   NONE) target_alias=$host_alias ;;
610   *) target_alias=$nonopt ;;
611   esac ;;
612 esac
613
614 target=`$ac_config_sub $target_alias`
615 target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
616 target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
617 target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
618 echo "$ac_t""$target" 1>&6
619
620 echo $ac_n "checking build system type""... $ac_c" 1>&6
621 echo "configure:622: checking build system type" >&5
622
623 build_alias=$build
624 case "$build_alias" in
625 NONE)
626   case $nonopt in
627   NONE) build_alias=$host_alias ;;
628   *) build_alias=$nonopt ;;
629   esac ;;
630 esac
631
632 build=`$ac_config_sub $build_alias`
633 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
634 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
635 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
636 echo "$ac_t""$build" 1>&6
637
638 test "$host_alias" != "$target_alias" &&
639   test "$program_prefix$program_suffix$program_transform_name" = \
640     NONENONEs,x,x, &&
641   program_prefix=${target_alias}-
642
643
644 # Find a good install program.  We prefer a C program (faster),
645 # so one script is as good as another.  But avoid the broken or
646 # incompatible versions:
647 # SysV /etc/install, /usr/sbin/install
648 # SunOS /usr/etc/install
649 # IRIX /sbin/install
650 # AIX /bin/install
651 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
652 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
653 # ./install, which can be erroneously created by make from ./install.sh.
654 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
655 echo "configure:656: checking for a BSD compatible install" >&5
656 if test -z "$INSTALL"; then
657 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
658   echo $ac_n "(cached) $ac_c" 1>&6
659 else
660     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
661   for ac_dir in $PATH; do
662     # Account for people who put trailing slashes in PATH elements.
663     case "$ac_dir/" in
664     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
665     *)
666       # OSF1 and SCO ODT 3.0 have their own names for install.
667       for ac_prog in ginstall installbsd scoinst install; do
668         if test -f $ac_dir/$ac_prog; then
669           if test $ac_prog = install &&
670             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
671             # AIX install.  It has an incompatible calling convention.
672             # OSF/1 installbsd also uses dspmsg, but is usable.
673             :
674           else
675             ac_cv_path_install="$ac_dir/$ac_prog -c"
676             break 2
677           fi
678         fi
679       done
680       ;;
681     esac
682   done
683   IFS="$ac_save_IFS"
684
685 fi
686   if test "${ac_cv_path_install+set}" = set; then
687     INSTALL="$ac_cv_path_install"
688   else
689     # As a last resort, use the slow shell script.  We don't cache a
690     # path for INSTALL within a source directory, because that will
691     # break other packages using the cache if that directory is
692     # removed, or if the path is relative.
693     INSTALL="$ac_install_sh"
694   fi
695 fi
696 echo "$ac_t""$INSTALL" 1>&6
697
698 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
699 # It thinks the first close brace ends the variable substitution.
700 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
701
702 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
703
704
705 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
706
707
708 PACKAGE=binutils
709
710 VERSION=2.8.2
711
712 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
713   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
714 fi
715 cat >> confdefs.h <<EOF
716 #define PACKAGE "$PACKAGE"
717 EOF
718
719 cat >> confdefs.h <<EOF
720 #define VERSION "$VERSION"
721 EOF
722
723 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
724 echo "configure:725: checking whether build environment is sane" >&5
725 # Just in case
726 sleep 1
727 echo timestamp > conftestfile
728 # Do `set' in a subshell so we don't clobber the current shell's
729 # arguments.  Must try -L first in case configure is actually a
730 # symlink; some systems play weird games with the mod time of symlinks
731 # (eg FreeBSD returns the mod time of the symlink's containing
732 # directory).
733 if (
734    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
735    if test "" = "X"; then
736       # -L didn't work.
737       set X `ls -t $srcdir/configure conftestfile`
738    fi
739    test "$2" = conftestfile
740    )
741 then
742    # Ok.
743    :
744 else
745    { echo "configure: error: newly created file is older than distributed files!
746 Check your system clock" 1>&2; exit 1; }
747 fi
748 rm -f conftest*
749 echo "$ac_t""yes" 1>&6
750 if test "$program_transform_name" = s,x,x,; then
751   program_transform_name=
752 else
753   # Double any \ or $.  echo might interpret backslashes.
754   cat <<\EOF_SED > conftestsed
755 s,\\,\\\\,g; s,\$,$$,g
756 EOF_SED
757   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
758   rm -f conftestsed
759 fi
760 test "$program_prefix" != NONE &&
761   program_transform_name="s,^,${program_prefix},; $program_transform_name"
762 # Use a double $ so make ignores it.
763 test "$program_suffix" != NONE &&
764   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
765
766 # sed with no file args requires a program.
767 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
768
769 missing_dir=`cd $ac_aux_dir && pwd`
770 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
771 echo "configure:772: checking for working aclocal" >&5
772 # Run test in a subshell; some versions of sh will print an error if
773 # an executable is not found, even if stderr is redirected.
774 # Redirect stdin to placate older versions of autoconf.  Sigh.
775 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
776    ACLOCAL=aclocal
777    echo "$ac_t""found" 1>&6
778 else
779    ACLOCAL="$missing_dir/missing aclocal"
780    echo "$ac_t""missing" 1>&6
781 fi
782
783 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
784 echo "configure:785: checking for working autoconf" >&5
785 # Run test in a subshell; some versions of sh will print an error if
786 # an executable is not found, even if stderr is redirected.
787 # Redirect stdin to placate older versions of autoconf.  Sigh.
788 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
789    AUTOCONF=autoconf
790    echo "$ac_t""found" 1>&6
791 else
792    AUTOCONF="$missing_dir/missing autoconf"
793    echo "$ac_t""missing" 1>&6
794 fi
795
796 echo $ac_n "checking for working automake""... $ac_c" 1>&6
797 echo "configure:798: checking for working automake" >&5
798 # Run test in a subshell; some versions of sh will print an error if
799 # an executable is not found, even if stderr is redirected.
800 # Redirect stdin to placate older versions of autoconf.  Sigh.
801 if (automake --version) < /dev/null > /dev/null 2>&1; then
802    AUTOMAKE=automake
803    echo "$ac_t""found" 1>&6
804 else
805    AUTOMAKE="$missing_dir/missing automake"
806    echo "$ac_t""missing" 1>&6
807 fi
808
809 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
810 echo "configure:811: checking for working autoheader" >&5
811 # Run test in a subshell; some versions of sh will print an error if
812 # an executable is not found, even if stderr is redirected.
813 # Redirect stdin to placate older versions of autoconf.  Sigh.
814 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
815    AUTOHEADER=autoheader
816    echo "$ac_t""found" 1>&6
817 else
818    AUTOHEADER="$missing_dir/missing autoheader"
819    echo "$ac_t""missing" 1>&6
820 fi
821
822 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
823 echo "configure:824: checking for working makeinfo" >&5
824 # Run test in a subshell; some versions of sh will print an error if
825 # an executable is not found, even if stderr is redirected.
826 # Redirect stdin to placate older versions of autoconf.  Sigh.
827 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
828    MAKEINFO=makeinfo
829    echo "$ac_t""found" 1>&6
830 else
831    MAKEINFO="$missing_dir/missing makeinfo"
832    echo "$ac_t""missing" 1>&6
833 fi
834
835 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
836 echo "configure:837: checking whether ${MAKE-make} sets \${MAKE}" >&5
837 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
838 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
839   echo $ac_n "(cached) $ac_c" 1>&6
840 else
841   cat > conftestmake <<\EOF
842 all:
843         @echo 'ac_maketemp="${MAKE}"'
844 EOF
845 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
846 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
847 if test -n "$ac_maketemp"; then
848   eval ac_cv_prog_make_${ac_make}_set=yes
849 else
850   eval ac_cv_prog_make_${ac_make}_set=no
851 fi
852 rm -f conftestmake
853 fi
854 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
855   echo "$ac_t""yes" 1>&6
856   SET_MAKE=
857 else
858   echo "$ac_t""no" 1>&6
859   SET_MAKE="MAKE=${MAKE-make}"
860 fi
861
862
863 # Extract the first word of "gcc", so it can be a program name with args.
864 set dummy gcc; ac_word=$2
865 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
866 echo "configure:867: checking for $ac_word" >&5
867 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
868   echo $ac_n "(cached) $ac_c" 1>&6
869 else
870   if test -n "$CC"; then
871   ac_cv_prog_CC="$CC" # Let the user override the test.
872 else
873   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
874   for ac_dir in $PATH; do
875     test -z "$ac_dir" && ac_dir=.
876     if test -f $ac_dir/$ac_word; then
877       ac_cv_prog_CC="gcc"
878       break
879     fi
880   done
881   IFS="$ac_save_ifs"
882 fi
883 fi
884 CC="$ac_cv_prog_CC"
885 if test -n "$CC"; then
886   echo "$ac_t""$CC" 1>&6
887 else
888   echo "$ac_t""no" 1>&6
889 fi
890
891 if test -z "$CC"; then
892   # Extract the first word of "cc", so it can be a program name with args.
893 set dummy cc; ac_word=$2
894 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
895 echo "configure:896: checking for $ac_word" >&5
896 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
897   echo $ac_n "(cached) $ac_c" 1>&6
898 else
899   if test -n "$CC"; then
900   ac_cv_prog_CC="$CC" # Let the user override the test.
901 else
902   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
903   ac_prog_rejected=no
904   for ac_dir in $PATH; do
905     test -z "$ac_dir" && ac_dir=.
906     if test -f $ac_dir/$ac_word; then
907       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
908         ac_prog_rejected=yes
909         continue
910       fi
911       ac_cv_prog_CC="cc"
912       break
913     fi
914   done
915   IFS="$ac_save_ifs"
916 if test $ac_prog_rejected = yes; then
917   # We found a bogon in the path, so make sure we never use it.
918   set dummy $ac_cv_prog_CC
919   shift
920   if test $# -gt 0; then
921     # We chose a different compiler from the bogus one.
922     # However, it has the same basename, so the bogon will be chosen
923     # first if we set CC to just the basename; use the full file name.
924     shift
925     set dummy "$ac_dir/$ac_word" "$@"
926     shift
927     ac_cv_prog_CC="$@"
928   fi
929 fi
930 fi
931 fi
932 CC="$ac_cv_prog_CC"
933 if test -n "$CC"; then
934   echo "$ac_t""$CC" 1>&6
935 else
936   echo "$ac_t""no" 1>&6
937 fi
938
939   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
940 fi
941
942 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
943 echo "configure:944: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
944
945 ac_ext=c
946 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
947 ac_cpp='$CPP $CPPFLAGS'
948 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
949 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
950 cross_compiling=$ac_cv_prog_cc_cross
951
952 cat > conftest.$ac_ext <<EOF
953 #line 954 "configure"
954 #include "confdefs.h"
955 main(){return(0);}
956 EOF
957 if { (eval echo configure:958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
958   ac_cv_prog_cc_works=yes
959   # If we can't run a trivial program, we are probably using a cross compiler.
960   if (./conftest; exit) 2>/dev/null; then
961     ac_cv_prog_cc_cross=no
962   else
963     ac_cv_prog_cc_cross=yes
964   fi
965 else
966   echo "configure: failed program was:" >&5
967   cat conftest.$ac_ext >&5
968   ac_cv_prog_cc_works=no
969 fi
970 rm -fr conftest*
971
972 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
973 if test $ac_cv_prog_cc_works = no; then
974   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
975 fi
976 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
977 echo "configure:978: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
978 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
979 cross_compiling=$ac_cv_prog_cc_cross
980
981 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
982 echo "configure:983: checking whether we are using GNU C" >&5
983 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
984   echo $ac_n "(cached) $ac_c" 1>&6
985 else
986   cat > conftest.c <<EOF
987 #ifdef __GNUC__
988   yes;
989 #endif
990 EOF
991 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:992: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
992   ac_cv_prog_gcc=yes
993 else
994   ac_cv_prog_gcc=no
995 fi
996 fi
997
998 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
999
1000 if test $ac_cv_prog_gcc = yes; then
1001   GCC=yes
1002   ac_test_CFLAGS="${CFLAGS+set}"
1003   ac_save_CFLAGS="$CFLAGS"
1004   CFLAGS=
1005   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1006 echo "configure:1007: checking whether ${CC-cc} accepts -g" >&5
1007 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1008   echo $ac_n "(cached) $ac_c" 1>&6
1009 else
1010   echo 'void f(){}' > conftest.c
1011 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1012   ac_cv_prog_cc_g=yes
1013 else
1014   ac_cv_prog_cc_g=no
1015 fi
1016 rm -f conftest*
1017
1018 fi
1019
1020 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1021   if test "$ac_test_CFLAGS" = set; then
1022     CFLAGS="$ac_save_CFLAGS"
1023   elif test $ac_cv_prog_cc_g = yes; then
1024     CFLAGS="-g -O2"
1025   else
1026     CFLAGS="-O2"
1027   fi
1028 else
1029   GCC=
1030   test "${CFLAGS+set}" = set || CFLAGS="-g"
1031 fi
1032
1033 # Extract the first word of "ranlib", so it can be a program name with args.
1034 set dummy ranlib; ac_word=$2
1035 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1036 echo "configure:1037: checking for $ac_word" >&5
1037 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1038   echo $ac_n "(cached) $ac_c" 1>&6
1039 else
1040   if test -n "$RANLIB"; then
1041   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1042 else
1043   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1044   for ac_dir in $PATH; do
1045     test -z "$ac_dir" && ac_dir=.
1046     if test -f $ac_dir/$ac_word; then
1047       ac_cv_prog_RANLIB="ranlib"
1048       break
1049     fi
1050   done
1051   IFS="$ac_save_ifs"
1052   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1053 fi
1054 fi
1055 RANLIB="$ac_cv_prog_RANLIB"
1056 if test -n "$RANLIB"; then
1057   echo "$ac_t""$RANLIB" 1>&6
1058 else
1059   echo "$ac_t""no" 1>&6
1060 fi
1061
1062 # Check whether --with-gnu-ld or --without-gnu-ld was given.
1063 if test "${with_gnu_ld+set}" = set; then
1064   withval="$with_gnu_ld"
1065   test "$withval" = no || with_gnu_ld=yes
1066 else
1067   with_gnu_ld=no
1068 fi
1069
1070 if test "$with_gnu_ld" = yes; then
1071   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
1072 echo "configure:1073: checking for GNU ld" >&5
1073 else
1074   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
1075 echo "configure:1076: checking for non-GNU ld" >&5
1076 fi
1077 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
1078   echo $ac_n "(cached) $ac_c" 1>&6
1079 else
1080   case "$LD" in
1081   /*)
1082   ac_cv_path_LD="$LD" # Let the user override the test with a path.
1083   ;;
1084   *)
1085   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1086   for ac_dir in $PATH; do
1087     test -z "$ac_dir" && ac_dir=.
1088     if test -f "$ac_dir/ld"; then
1089       ac_cv_path_LD="$ac_dir/ld"
1090       # Check to see if the program is GNU ld.  I'd rather use --version,
1091       # but apparently some GNU ld's only accept -v.
1092       # Break only if it was the GNU/non-GNU ld that we prefer.
1093       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
1094         test "$with_gnu_ld" = yes && break
1095       else
1096         test "$with_gnu_ld" != yes && break
1097       fi
1098     fi
1099   done
1100   IFS="$ac_save_ifs"
1101   ;;
1102 esac
1103 fi
1104
1105 LD="$ac_cv_path_LD"
1106 if test -n "$LD"; then
1107   echo "$ac_t""$LD" 1>&6
1108 else
1109   echo "$ac_t""no" 1>&6
1110 fi
1111 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
1112
1113 echo $ac_n "checking whether we are using GNU ld""... $ac_c" 1>&6
1114 echo "configure:1115: checking whether we are using GNU ld" >&5
1115 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
1116   echo $ac_n "(cached) $ac_c" 1>&6
1117 else
1118   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
1119 if $LD -v 2>&1 </dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
1120   ac_cv_prog_gnu_ld=yes
1121 else
1122   ac_cv_prog_gnu_ld=no
1123 fi
1124 fi
1125
1126 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
1127
1128
1129 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
1130 echo "configure:1131: checking whether ln -s works" >&5
1131 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
1132   echo $ac_n "(cached) $ac_c" 1>&6
1133 else
1134   rm -f conftestdata
1135 if ln -s X conftestdata 2>/dev/null
1136 then
1137   rm -f conftestdata
1138   ac_cv_prog_LN_S="ln -s"
1139 else
1140   ac_cv_prog_LN_S=ln
1141 fi
1142 fi
1143 LN_S="$ac_cv_prog_LN_S"
1144 if test "$ac_cv_prog_LN_S" = "ln -s"; then
1145   echo "$ac_t""yes" 1>&6
1146 else
1147   echo "$ac_t""no" 1>&6
1148 fi
1149
1150
1151
1152
1153
1154
1155
1156 # Always use our own libtool.
1157 LIBTOOL='$(top_builddir)/libtool'
1158
1159
1160 # Check whether --enable-shared or --disable-shared was given.
1161 if test "${enable_shared+set}" = set; then
1162   enableval="$enable_shared"
1163   if test "$enableval" = no; then
1164   enable_shared=no
1165 else
1166   enable_shared=yes
1167 fi
1168 fi
1169
1170 libtool_shared=
1171 test "$enable_shared" = no && libtool_shared=" --disable-shared"
1172
1173 # Check whether --enable-static or --disable-static was given.
1174 if test "${enable_static+set}" = set; then
1175   enableval="$enable_static"
1176   if test "$enableval" = no; then
1177   enable_static=no
1178 else
1179   enable_static=yes
1180 fi
1181 fi
1182
1183 libtool_static=
1184 test "$enable_static" = no && libtool_static=" --disable-static"
1185
1186 libtool_flags="$libtool_shared$libtool_static"
1187 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
1188 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
1189 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
1190
1191 # Some flags need to be propagated to the compiler or linker for good
1192 # libtool support.
1193 case "$host" in
1194 *-*-irix6*)
1195   ac_save_CFLAGS="$CFLAGS"
1196   # -n32 always needs to be added to the linker when using GCC.
1197   test "$ac_cv_prog_gcc" = yes && CFLAGS="$CFLAGS -n32"
1198   for f in '-32' '-64' '-cckr' '-n32' '-mips1' '-mips2' '-mips3' '-mips4'; do
1199     if echo " $CC $CFLAGS " | egrep -e "[       ]$f[     ]" > /dev/null; then
1200       LD="${LD-ld} $f"
1201     fi
1202   done
1203   CFLAGS="$ac_save_CFLAGS"
1204   ;;
1205
1206 *-*-sco3.2v5*)
1207   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1208   CFLAGS="$CFLAGS -belf"
1209   ;;
1210 esac
1211
1212 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
1213 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
1214 LD="$LD" RANLIB="$RANLIB" LN_S="$LN_S" \
1215 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
1216 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
1217 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
1218
1219
1220 # Check whether --enable-targets or --disable-targets was given.
1221 if test "${enable_targets+set}" = set; then
1222   enableval="$enable_targets"
1223   case "${enableval}" in
1224   yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
1225             ;;
1226   no)       enable_targets= ;;
1227   *)        enable_targets=$enableval ;;
1228 esac
1229 fi
1230 # Check whether --enable-commonbfdlib or --disable-commonbfdlib was given.
1231 if test "${enable_commonbfdlib+set}" = set; then
1232   enableval="$enable_commonbfdlib"
1233   case "${enableval}" in
1234   yes) commonbfdlib=true ;;
1235   no)  commonbfdlib=false ;;
1236   *)   { echo "configure: error: bad value ${enableval} for BFD commonbfdlib option" 1>&2; exit 1; } ;;
1237 esac
1238 fi
1239
1240
1241
1242
1243
1244 if test -z "$target" ; then
1245     { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
1246 fi
1247 if test -z "$host" ; then
1248     { echo "configure: error: Unrecognized host system type; please check config.sub." 1>&2; exit 1; }
1249 fi
1250 if test "$program_transform_name" = s,x,x,; then
1251   program_transform_name=
1252 else
1253   # Double any \ or $.  echo might interpret backslashes.
1254   cat <<\EOF_SED > conftestsed
1255 s,\\,\\\\,g; s,\$,$$,g
1256 EOF_SED
1257   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1258   rm -f conftestsed
1259 fi
1260 test "$program_prefix" != NONE &&
1261   program_transform_name="s,^,${program_prefix},; $program_transform_name"
1262 # Use a double $ so make ignores it.
1263 test "$program_suffix" != NONE &&
1264   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
1265
1266 # sed with no file args requires a program.
1267 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1268
1269
1270 # Extract the first word of "gcc", so it can be a program name with args.
1271 set dummy gcc; ac_word=$2
1272 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1273 echo "configure:1274: checking for $ac_word" >&5
1274 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1275   echo $ac_n "(cached) $ac_c" 1>&6
1276 else
1277   if test -n "$CC"; then
1278   ac_cv_prog_CC="$CC" # Let the user override the test.
1279 else
1280   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1281   for ac_dir in $PATH; do
1282     test -z "$ac_dir" && ac_dir=.
1283     if test -f $ac_dir/$ac_word; then
1284       ac_cv_prog_CC="gcc"
1285       break
1286     fi
1287   done
1288   IFS="$ac_save_ifs"
1289 fi
1290 fi
1291 CC="$ac_cv_prog_CC"
1292 if test -n "$CC"; then
1293   echo "$ac_t""$CC" 1>&6
1294 else
1295   echo "$ac_t""no" 1>&6
1296 fi
1297
1298 if test -z "$CC"; then
1299   # Extract the first word of "cc", so it can be a program name with args.
1300 set dummy cc; ac_word=$2
1301 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1302 echo "configure:1303: checking for $ac_word" >&5
1303 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1304   echo $ac_n "(cached) $ac_c" 1>&6
1305 else
1306   if test -n "$CC"; then
1307   ac_cv_prog_CC="$CC" # Let the user override the test.
1308 else
1309   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1310   ac_prog_rejected=no
1311   for ac_dir in $PATH; do
1312     test -z "$ac_dir" && ac_dir=.
1313     if test -f $ac_dir/$ac_word; then
1314       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1315         ac_prog_rejected=yes
1316         continue
1317       fi
1318       ac_cv_prog_CC="cc"
1319       break
1320     fi
1321   done
1322   IFS="$ac_save_ifs"
1323 if test $ac_prog_rejected = yes; then
1324   # We found a bogon in the path, so make sure we never use it.
1325   set dummy $ac_cv_prog_CC
1326   shift
1327   if test $# -gt 0; then
1328     # We chose a different compiler from the bogus one.
1329     # However, it has the same basename, so the bogon will be chosen
1330     # first if we set CC to just the basename; use the full file name.
1331     shift
1332     set dummy "$ac_dir/$ac_word" "$@"
1333     shift
1334     ac_cv_prog_CC="$@"
1335   fi
1336 fi
1337 fi
1338 fi
1339 CC="$ac_cv_prog_CC"
1340 if test -n "$CC"; then
1341   echo "$ac_t""$CC" 1>&6
1342 else
1343   echo "$ac_t""no" 1>&6
1344 fi
1345
1346   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1347 fi
1348
1349 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1350 echo "configure:1351: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1351
1352 ac_ext=c
1353 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1354 ac_cpp='$CPP $CPPFLAGS'
1355 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1356 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1357 cross_compiling=$ac_cv_prog_cc_cross
1358
1359 cat > conftest.$ac_ext <<EOF
1360 #line 1361 "configure"
1361 #include "confdefs.h"
1362 main(){return(0);}
1363 EOF
1364 if { (eval echo configure:1365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1365   ac_cv_prog_cc_works=yes
1366   # If we can't run a trivial program, we are probably using a cross compiler.
1367   if (./conftest; exit) 2>/dev/null; then
1368     ac_cv_prog_cc_cross=no
1369   else
1370     ac_cv_prog_cc_cross=yes
1371   fi
1372 else
1373   echo "configure: failed program was:" >&5
1374   cat conftest.$ac_ext >&5
1375   ac_cv_prog_cc_works=no
1376 fi
1377 rm -fr conftest*
1378
1379 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1380 if test $ac_cv_prog_cc_works = no; then
1381   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1382 fi
1383 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1384 echo "configure:1385: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1385 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1386 cross_compiling=$ac_cv_prog_cc_cross
1387
1388 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1389 echo "configure:1390: checking whether we are using GNU C" >&5
1390 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1391   echo $ac_n "(cached) $ac_c" 1>&6
1392 else
1393   cat > conftest.c <<EOF
1394 #ifdef __GNUC__
1395   yes;
1396 #endif
1397 EOF
1398 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1399: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1399   ac_cv_prog_gcc=yes
1400 else
1401   ac_cv_prog_gcc=no
1402 fi
1403 fi
1404
1405 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1406
1407 if test $ac_cv_prog_gcc = yes; then
1408   GCC=yes
1409   ac_test_CFLAGS="${CFLAGS+set}"
1410   ac_save_CFLAGS="$CFLAGS"
1411   CFLAGS=
1412   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1413 echo "configure:1414: checking whether ${CC-cc} accepts -g" >&5
1414 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1415   echo $ac_n "(cached) $ac_c" 1>&6
1416 else
1417   echo 'void f(){}' > conftest.c
1418 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1419   ac_cv_prog_cc_g=yes
1420 else
1421   ac_cv_prog_cc_g=no
1422 fi
1423 rm -f conftest*
1424
1425 fi
1426
1427 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1428   if test "$ac_test_CFLAGS" = set; then
1429     CFLAGS="$ac_save_CFLAGS"
1430   elif test $ac_cv_prog_cc_g = yes; then
1431     CFLAGS="-g -O2"
1432   else
1433     CFLAGS="-O2"
1434   fi
1435 else
1436   GCC=
1437   test "${CFLAGS+set}" = set || CFLAGS="-g"
1438 fi
1439
1440
1441 for ac_prog in 'bison -y' byacc
1442 do
1443 # Extract the first word of "$ac_prog", so it can be a program name with args.
1444 set dummy $ac_prog; ac_word=$2
1445 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1446 echo "configure:1447: checking for $ac_word" >&5
1447 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
1448   echo $ac_n "(cached) $ac_c" 1>&6
1449 else
1450   if test -n "$YACC"; then
1451   ac_cv_prog_YACC="$YACC" # Let the user override the test.
1452 else
1453   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1454   for ac_dir in $PATH; do
1455     test -z "$ac_dir" && ac_dir=.
1456     if test -f $ac_dir/$ac_word; then
1457       ac_cv_prog_YACC="$ac_prog"
1458       break
1459     fi
1460   done
1461   IFS="$ac_save_ifs"
1462 fi
1463 fi
1464 YACC="$ac_cv_prog_YACC"
1465 if test -n "$YACC"; then
1466   echo "$ac_t""$YACC" 1>&6
1467 else
1468   echo "$ac_t""no" 1>&6
1469 fi
1470
1471 test -n "$YACC" && break
1472 done
1473 test -n "$YACC" || YACC="yacc"
1474
1475 # Extract the first word of "flex", so it can be a program name with args.
1476 set dummy flex; ac_word=$2
1477 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1478 echo "configure:1479: checking for $ac_word" >&5
1479 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
1480   echo $ac_n "(cached) $ac_c" 1>&6
1481 else
1482   if test -n "$LEX"; then
1483   ac_cv_prog_LEX="$LEX" # Let the user override the test.
1484 else
1485   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1486   for ac_dir in $PATH; do
1487     test -z "$ac_dir" && ac_dir=.
1488     if test -f $ac_dir/$ac_word; then
1489       ac_cv_prog_LEX="flex"
1490       break
1491     fi
1492   done
1493   IFS="$ac_save_ifs"
1494   test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
1495 fi
1496 fi
1497 LEX="$ac_cv_prog_LEX"
1498 if test -n "$LEX"; then
1499   echo "$ac_t""$LEX" 1>&6
1500 else
1501   echo "$ac_t""no" 1>&6
1502 fi
1503
1504 if test -z "$LEXLIB"
1505 then
1506   case "$LEX" in
1507   flex*) ac_lib=fl ;;
1508   *) ac_lib=l ;;
1509   esac
1510   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
1511 echo "configure:1512: checking for yywrap in -l$ac_lib" >&5
1512 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
1513 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1514   echo $ac_n "(cached) $ac_c" 1>&6
1515 else
1516   ac_save_LIBS="$LIBS"
1517 LIBS="-l$ac_lib  $LIBS"
1518 cat > conftest.$ac_ext <<EOF
1519 #line 1520 "configure"
1520 #include "confdefs.h"
1521 /* Override any gcc2 internal prototype to avoid an error.  */
1522 /* We use char because int might match the return type of a gcc2
1523     builtin and then its argument prototype would still apply.  */
1524 char yywrap();
1525
1526 int main() {
1527 yywrap()
1528 ; return 0; }
1529 EOF
1530 if { (eval echo configure:1531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1531   rm -rf conftest*
1532   eval "ac_cv_lib_$ac_lib_var=yes"
1533 else
1534   echo "configure: failed program was:" >&5
1535   cat conftest.$ac_ext >&5
1536   rm -rf conftest*
1537   eval "ac_cv_lib_$ac_lib_var=no"
1538 fi
1539 rm -f conftest*
1540 LIBS="$ac_save_LIBS"
1541
1542 fi
1543 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1544   echo "$ac_t""yes" 1>&6
1545   LEXLIB="-l$ac_lib"
1546 else
1547   echo "$ac_t""no" 1>&6
1548 fi
1549
1550 fi
1551
1552 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1553 echo "configure:1554: checking how to run the C preprocessor" >&5
1554 # On Suns, sometimes $CPP names a directory.
1555 if test -n "$CPP" && test -d "$CPP"; then
1556   CPP=
1557 fi
1558 if test -z "$CPP"; then
1559 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1560   echo $ac_n "(cached) $ac_c" 1>&6
1561 else
1562     # This must be in double quotes, not single quotes, because CPP may get
1563   # substituted into the Makefile and "${CC-cc}" will confuse make.
1564   CPP="${CC-cc} -E"
1565   # On the NeXT, cc -E runs the code through the compiler's parser,
1566   # not just through cpp.
1567   cat > conftest.$ac_ext <<EOF
1568 #line 1569 "configure"
1569 #include "confdefs.h"
1570 #include <assert.h>
1571 Syntax Error
1572 EOF
1573 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1574 { (eval echo configure:1575: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1575 ac_err=`grep -v '^ *+' conftest.out`
1576 if test -z "$ac_err"; then
1577   :
1578 else
1579   echo "$ac_err" >&5
1580   echo "configure: failed program was:" >&5
1581   cat conftest.$ac_ext >&5
1582   rm -rf conftest*
1583   CPP="${CC-cc} -E -traditional-cpp"
1584   cat > conftest.$ac_ext <<EOF
1585 #line 1586 "configure"
1586 #include "confdefs.h"
1587 #include <assert.h>
1588 Syntax Error
1589 EOF
1590 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1591 { (eval echo configure:1592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1592 ac_err=`grep -v '^ *+' conftest.out`
1593 if test -z "$ac_err"; then
1594   :
1595 else
1596   echo "$ac_err" >&5
1597   echo "configure: failed program was:" >&5
1598   cat conftest.$ac_ext >&5
1599   rm -rf conftest*
1600   CPP=/lib/cpp
1601 fi
1602 rm -f conftest*
1603 fi
1604 rm -f conftest*
1605   ac_cv_prog_CPP="$CPP"
1606 fi
1607   CPP="$ac_cv_prog_CPP"
1608 else
1609   ac_cv_prog_CPP="$CPP"
1610 fi
1611 echo "$ac_t""$CPP" 1>&6
1612
1613 echo $ac_n "checking lex output file root""... $ac_c" 1>&6
1614 echo "configure:1615: checking lex output file root" >&5
1615 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
1616   echo $ac_n "(cached) $ac_c" 1>&6
1617 else
1618   # The minimal lex program is just a single line: %%.  But some broken lexes
1619 # (Solaris, I think it was) want two %% lines, so accommodate them.
1620 echo '%%
1621 %%' | $LEX
1622 if test -f lex.yy.c; then
1623   ac_cv_prog_lex_root=lex.yy
1624 elif test -f lexyy.c; then
1625   ac_cv_prog_lex_root=lexyy
1626 else
1627   { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; }
1628 fi
1629 fi
1630
1631 echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
1632 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
1633
1634 echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
1635 echo "configure:1636: checking whether yytext is a pointer" >&5
1636 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
1637   echo $ac_n "(cached) $ac_c" 1>&6
1638 else
1639   # POSIX says lex can declare yytext either as a pointer or an array; the
1640 # default is implementation-dependent. Figure out which it is, since
1641 # not all implementations provide the %pointer and %array declarations.
1642 ac_cv_prog_lex_yytext_pointer=no
1643 echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
1644 ac_save_LIBS="$LIBS"
1645 LIBS="$LIBS $LEXLIB"
1646 cat > conftest.$ac_ext <<EOF
1647 #line 1648 "configure"
1648 #include "confdefs.h"
1649 `cat $LEX_OUTPUT_ROOT.c`
1650 int main() {
1651
1652 ; return 0; }
1653 EOF
1654 if { (eval echo configure:1655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1655   rm -rf conftest*
1656   ac_cv_prog_lex_yytext_pointer=yes
1657 else
1658   echo "configure: failed program was:" >&5
1659   cat conftest.$ac_ext >&5
1660 fi
1661 rm -f conftest*
1662 LIBS="$ac_save_LIBS"
1663 rm -f "${LEX_OUTPUT_ROOT}.c"
1664
1665 fi
1666
1667 echo "$ac_t""$ac_cv_prog_lex_yytext_pointer" 1>&6
1668 if test $ac_cv_prog_lex_yytext_pointer = yes; then
1669   cat >> confdefs.h <<\EOF
1670 #define YYTEXT_POINTER 1
1671 EOF
1672
1673 fi
1674
1675
1676 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
1677 echo "configure:1678: checking whether to enable maintainer-specific portions of Makefiles" >&5
1678     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
1679 if test "${enable_maintainer_mode+set}" = set; then
1680   enableval="$enable_maintainer_mode"
1681   USE_MAINTAINER_MODE=$enableval
1682 else
1683   USE_MAINTAINER_MODE=no
1684 fi
1685
1686   echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
1687   if test $USE_MAINTAINER_MODE = yes; then
1688     MAINT=
1689   else
1690     MAINT='#M#'
1691   fi
1692   
1693
1694 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
1695 echo "configure:1696: checking for Cygwin32 environment" >&5
1696 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
1697   echo $ac_n "(cached) $ac_c" 1>&6
1698 else
1699   cat > conftest.$ac_ext <<EOF
1700 #line 1701 "configure"
1701 #include "confdefs.h"
1702
1703 int main() {
1704 int main () { return __CYGWIN32__; }
1705 ; return 0; }
1706 EOF
1707 if { (eval echo configure:1708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1708   rm -rf conftest*
1709   am_cv_cygwin32=yes
1710 else
1711   echo "configure: failed program was:" >&5
1712   cat conftest.$ac_ext >&5
1713   rm -rf conftest*
1714   am_cv_cygwin32=no
1715 fi
1716 rm -f conftest*
1717 rm -f conftest*
1718 fi
1719
1720 echo "$ac_t""$am_cv_cygwin32" 1>&6
1721 CYGWIN32=
1722 test "$am_cv_cygwin32" = yes && CYGWIN32=yes
1723 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
1724 echo "configure:1725: checking for executable suffix" >&5
1725 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
1726   echo $ac_n "(cached) $ac_c" 1>&6
1727 else
1728   if test "$CYGWIN32" = yes; then
1729 am_cv_exeext=.exe
1730 else
1731 cat > am_c_test.c << 'EOF'
1732 int main() {
1733 /* Nothing needed here */
1734 }
1735 EOF
1736 ${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
1737 am_cv_exeext=`ls am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
1738 rm -f am_c_test*
1739 fi
1740
1741 test x"${am_cv_exeext}" = x && am_cv_exeext=no
1742 fi
1743 EXEEXT=""
1744 test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
1745 echo "$ac_t""${am_cv_exeext}" 1>&6
1746
1747
1748 # host-specific stuff:
1749
1750 HDEFINES=
1751
1752 . ${srcdir}/../bfd/configure.host
1753
1754
1755 AR=${AR-ar}
1756
1757 # Extract the first word of "ranlib", so it can be a program name with args.
1758 set dummy ranlib; ac_word=$2
1759 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1760 echo "configure:1761: checking for $ac_word" >&5
1761 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1762   echo $ac_n "(cached) $ac_c" 1>&6
1763 else
1764   if test -n "$RANLIB"; then
1765   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1766 else
1767   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1768   for ac_dir in $PATH; do
1769     test -z "$ac_dir" && ac_dir=.
1770     if test -f $ac_dir/$ac_word; then
1771       ac_cv_prog_RANLIB="ranlib"
1772       break
1773     fi
1774   done
1775   IFS="$ac_save_ifs"
1776   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1777 fi
1778 fi
1779 RANLIB="$ac_cv_prog_RANLIB"
1780 if test -n "$RANLIB"; then
1781   echo "$ac_t""$RANLIB" 1>&6
1782 else
1783   echo "$ac_t""no" 1>&6
1784 fi
1785
1786
1787 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1788
1789
1790 # Put a plausible default for CC_FOR_BUILD in Makefile.
1791 if test -z "$CC_FOR_BUILD"; then
1792   if test "x$cross_compiling" = "xno"; then
1793     CC_FOR_BUILD='$(CC)'
1794   else
1795     CC_FOR_BUILD=gcc
1796   fi
1797 fi
1798
1799
1800 for ac_hdr in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h
1801 do
1802 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1803 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1804 echo "configure:1805: checking for $ac_hdr" >&5
1805 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1806   echo $ac_n "(cached) $ac_c" 1>&6
1807 else
1808   cat > conftest.$ac_ext <<EOF
1809 #line 1810 "configure"
1810 #include "confdefs.h"
1811 #include <$ac_hdr>
1812 EOF
1813 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1814 { (eval echo configure:1815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1815 ac_err=`grep -v '^ *+' conftest.out`
1816 if test -z "$ac_err"; then
1817   rm -rf conftest*
1818   eval "ac_cv_header_$ac_safe=yes"
1819 else
1820   echo "$ac_err" >&5
1821   echo "configure: failed program was:" >&5
1822   cat conftest.$ac_ext >&5
1823   rm -rf conftest*
1824   eval "ac_cv_header_$ac_safe=no"
1825 fi
1826 rm -f conftest*
1827 fi
1828 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1829   echo "$ac_t""yes" 1>&6
1830     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1831   cat >> confdefs.h <<EOF
1832 #define $ac_tr_hdr 1
1833 EOF
1834  
1835 else
1836   echo "$ac_t""no" 1>&6
1837 fi
1838 done
1839
1840 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
1841 echo "configure:1842: checking for sys/wait.h that is POSIX.1 compatible" >&5
1842 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
1843   echo $ac_n "(cached) $ac_c" 1>&6
1844 else
1845   cat > conftest.$ac_ext <<EOF
1846 #line 1847 "configure"
1847 #include "confdefs.h"
1848 #include <sys/types.h>
1849 #include <sys/wait.h>
1850 #ifndef WEXITSTATUS
1851 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
1852 #endif
1853 #ifndef WIFEXITED
1854 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
1855 #endif
1856 int main() {
1857 int s;
1858 wait (&s);
1859 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
1860 ; return 0; }
1861 EOF
1862 if { (eval echo configure:1863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1863   rm -rf conftest*
1864   ac_cv_header_sys_wait_h=yes
1865 else
1866   echo "configure: failed program was:" >&5
1867   cat conftest.$ac_ext >&5
1868   rm -rf conftest*
1869   ac_cv_header_sys_wait_h=no
1870 fi
1871 rm -f conftest*
1872 fi
1873
1874 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
1875 if test $ac_cv_header_sys_wait_h = yes; then
1876   cat >> confdefs.h <<\EOF
1877 #define HAVE_SYS_WAIT_H 1
1878 EOF
1879
1880 fi
1881
1882 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
1883 # for constant arguments.  Useless!
1884 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
1885 echo "configure:1886: checking for working alloca.h" >&5
1886 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
1887   echo $ac_n "(cached) $ac_c" 1>&6
1888 else
1889   cat > conftest.$ac_ext <<EOF
1890 #line 1891 "configure"
1891 #include "confdefs.h"
1892 #include <alloca.h>
1893 int main() {
1894 char *p = alloca(2 * sizeof(int));
1895 ; return 0; }
1896 EOF
1897 if { (eval echo configure:1898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1898   rm -rf conftest*
1899   ac_cv_header_alloca_h=yes
1900 else
1901   echo "configure: failed program was:" >&5
1902   cat conftest.$ac_ext >&5
1903   rm -rf conftest*
1904   ac_cv_header_alloca_h=no
1905 fi
1906 rm -f conftest*
1907 fi
1908
1909 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
1910 if test $ac_cv_header_alloca_h = yes; then
1911   cat >> confdefs.h <<\EOF
1912 #define HAVE_ALLOCA_H 1
1913 EOF
1914
1915 fi
1916
1917 echo $ac_n "checking for alloca""... $ac_c" 1>&6
1918 echo "configure:1919: checking for alloca" >&5
1919 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
1920   echo $ac_n "(cached) $ac_c" 1>&6
1921 else
1922   cat > conftest.$ac_ext <<EOF
1923 #line 1924 "configure"
1924 #include "confdefs.h"
1925
1926 #ifdef __GNUC__
1927 # define alloca __builtin_alloca
1928 #else
1929 # if HAVE_ALLOCA_H
1930 #  include <alloca.h>
1931 # else
1932 #  ifdef _AIX
1933  #pragma alloca
1934 #  else
1935 #   ifndef alloca /* predefined by HP cc +Olibcalls */
1936 char *alloca ();
1937 #   endif
1938 #  endif
1939 # endif
1940 #endif
1941
1942 int main() {
1943 char *p = (char *) alloca(1);
1944 ; return 0; }
1945 EOF
1946 if { (eval echo configure:1947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1947   rm -rf conftest*
1948   ac_cv_func_alloca_works=yes
1949 else
1950   echo "configure: failed program was:" >&5
1951   cat conftest.$ac_ext >&5
1952   rm -rf conftest*
1953   ac_cv_func_alloca_works=no
1954 fi
1955 rm -f conftest*
1956 fi
1957
1958 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
1959 if test $ac_cv_func_alloca_works = yes; then
1960   cat >> confdefs.h <<\EOF
1961 #define HAVE_ALLOCA 1
1962 EOF
1963
1964 fi
1965
1966 if test $ac_cv_func_alloca_works = no; then
1967   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
1968   # that cause trouble.  Some versions do not even contain alloca or
1969   # contain a buggy version.  If you still want to use their alloca,
1970   # use ar to extract alloca.o from them instead of compiling alloca.c.
1971   ALLOCA=alloca.o
1972   cat >> confdefs.h <<\EOF
1973 #define C_ALLOCA 1
1974 EOF
1975
1976
1977 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
1978 echo "configure:1979: checking whether alloca needs Cray hooks" >&5
1979 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
1980   echo $ac_n "(cached) $ac_c" 1>&6
1981 else
1982   cat > conftest.$ac_ext <<EOF
1983 #line 1984 "configure"
1984 #include "confdefs.h"
1985 #if defined(CRAY) && ! defined(CRAY2)
1986 webecray
1987 #else
1988 wenotbecray
1989 #endif
1990
1991 EOF
1992 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1993   egrep "webecray" >/dev/null 2>&1; then
1994   rm -rf conftest*
1995   ac_cv_os_cray=yes
1996 else
1997   rm -rf conftest*
1998   ac_cv_os_cray=no
1999 fi
2000 rm -f conftest*
2001
2002 fi
2003
2004 echo "$ac_t""$ac_cv_os_cray" 1>&6
2005 if test $ac_cv_os_cray = yes; then
2006 for ac_func in _getb67 GETB67 getb67; do
2007   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2008 echo "configure:2009: checking for $ac_func" >&5
2009 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2010   echo $ac_n "(cached) $ac_c" 1>&6
2011 else
2012   cat > conftest.$ac_ext <<EOF
2013 #line 2014 "configure"
2014 #include "confdefs.h"
2015 /* System header to define __stub macros and hopefully few prototypes,
2016     which can conflict with char $ac_func(); below.  */
2017 #include <assert.h>
2018 /* Override any gcc2 internal prototype to avoid an error.  */
2019 /* We use char because int might match the return type of a gcc2
2020     builtin and then its argument prototype would still apply.  */
2021 char $ac_func();
2022
2023 int main() {
2024
2025 /* The GNU C library defines this for functions which it implements
2026     to always fail with ENOSYS.  Some functions are actually named
2027     something starting with __ and the normal name is an alias.  */
2028 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2029 choke me
2030 #else
2031 $ac_func();
2032 #endif
2033
2034 ; return 0; }
2035 EOF
2036 if { (eval echo configure:2037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2037   rm -rf conftest*
2038   eval "ac_cv_func_$ac_func=yes"
2039 else
2040   echo "configure: failed program was:" >&5
2041   cat conftest.$ac_ext >&5
2042   rm -rf conftest*
2043   eval "ac_cv_func_$ac_func=no"
2044 fi
2045 rm -f conftest*
2046 fi
2047
2048 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2049   echo "$ac_t""yes" 1>&6
2050   cat >> confdefs.h <<EOF
2051 #define CRAY_STACKSEG_END $ac_func
2052 EOF
2053
2054   break
2055 else
2056   echo "$ac_t""no" 1>&6
2057 fi
2058
2059 done
2060 fi
2061
2062 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
2063 echo "configure:2064: checking stack direction for C alloca" >&5
2064 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
2065   echo $ac_n "(cached) $ac_c" 1>&6
2066 else
2067   if test "$cross_compiling" = yes; then
2068   ac_cv_c_stack_direction=0
2069 else
2070   cat > conftest.$ac_ext <<EOF
2071 #line 2072 "configure"
2072 #include "confdefs.h"
2073 find_stack_direction ()
2074 {
2075   static char *addr = 0;
2076   auto char dummy;
2077   if (addr == 0)
2078     {
2079       addr = &dummy;
2080       return find_stack_direction ();
2081     }
2082   else
2083     return (&dummy > addr) ? 1 : -1;
2084 }
2085 main ()
2086 {
2087   exit (find_stack_direction() < 0);
2088 }
2089 EOF
2090 if { (eval echo configure:2091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2091 then
2092   ac_cv_c_stack_direction=1
2093 else
2094   echo "configure: failed program was:" >&5
2095   cat conftest.$ac_ext >&5
2096   rm -fr conftest*
2097   ac_cv_c_stack_direction=-1
2098 fi
2099 rm -fr conftest*
2100 fi
2101
2102 fi
2103
2104 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
2105 cat >> confdefs.h <<EOF
2106 #define STACK_DIRECTION $ac_cv_c_stack_direction
2107 EOF
2108
2109 fi
2110
2111 for ac_func in sbrk utimes
2112 do
2113 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2114 echo "configure:2115: checking for $ac_func" >&5
2115 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2116   echo $ac_n "(cached) $ac_c" 1>&6
2117 else
2118   cat > conftest.$ac_ext <<EOF
2119 #line 2120 "configure"
2120 #include "confdefs.h"
2121 /* System header to define __stub macros and hopefully few prototypes,
2122     which can conflict with char $ac_func(); below.  */
2123 #include <assert.h>
2124 /* Override any gcc2 internal prototype to avoid an error.  */
2125 /* We use char because int might match the return type of a gcc2
2126     builtin and then its argument prototype would still apply.  */
2127 char $ac_func();
2128
2129 int main() {
2130
2131 /* The GNU C library defines this for functions which it implements
2132     to always fail with ENOSYS.  Some functions are actually named
2133     something starting with __ and the normal name is an alias.  */
2134 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2135 choke me
2136 #else
2137 $ac_func();
2138 #endif
2139
2140 ; return 0; }
2141 EOF
2142 if { (eval echo configure:2143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2143   rm -rf conftest*
2144   eval "ac_cv_func_$ac_func=yes"
2145 else
2146   echo "configure: failed program was:" >&5
2147   cat conftest.$ac_ext >&5
2148   rm -rf conftest*
2149   eval "ac_cv_func_$ac_func=no"
2150 fi
2151 rm -f conftest*
2152 fi
2153
2154 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2155   echo "$ac_t""yes" 1>&6
2156     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2157   cat >> confdefs.h <<EOF
2158 #define $ac_tr_func 1
2159 EOF
2160  
2161 else
2162   echo "$ac_t""no" 1>&6
2163 fi
2164 done
2165
2166 if test "x$cross_compiling" = "xno"; then
2167   echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
2168 echo "configure:2169: checking for ANSI C header files" >&5
2169 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
2170   echo $ac_n "(cached) $ac_c" 1>&6
2171 else
2172   cat > conftest.$ac_ext <<EOF
2173 #line 2174 "configure"
2174 #include "confdefs.h"
2175 #include <stdlib.h>
2176 #include <stdarg.h>
2177 #include <string.h>
2178 #include <float.h>
2179 EOF
2180 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2181 { (eval echo configure:2182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2182 ac_err=`grep -v '^ *+' conftest.out`
2183 if test -z "$ac_err"; then
2184   rm -rf conftest*
2185   ac_cv_header_stdc=yes
2186 else
2187   echo "$ac_err" >&5
2188   echo "configure: failed program was:" >&5
2189   cat conftest.$ac_ext >&5
2190   rm -rf conftest*
2191   ac_cv_header_stdc=no
2192 fi
2193 rm -f conftest*
2194
2195 if test $ac_cv_header_stdc = yes; then
2196   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
2197 cat > conftest.$ac_ext <<EOF
2198 #line 2199 "configure"
2199 #include "confdefs.h"
2200 #include <string.h>
2201 EOF
2202 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2203   egrep "memchr" >/dev/null 2>&1; then
2204   :
2205 else
2206   rm -rf conftest*
2207   ac_cv_header_stdc=no
2208 fi
2209 rm -f conftest*
2210
2211 fi
2212
2213 if test $ac_cv_header_stdc = yes; then
2214   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
2215 cat > conftest.$ac_ext <<EOF
2216 #line 2217 "configure"
2217 #include "confdefs.h"
2218 #include <stdlib.h>
2219 EOF
2220 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2221   egrep "free" >/dev/null 2>&1; then
2222   :
2223 else
2224   rm -rf conftest*
2225   ac_cv_header_stdc=no
2226 fi
2227 rm -f conftest*
2228
2229 fi
2230
2231 if test $ac_cv_header_stdc = yes; then
2232   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
2233 if test "$cross_compiling" = yes; then
2234   :
2235 else
2236   cat > conftest.$ac_ext <<EOF
2237 #line 2238 "configure"
2238 #include "confdefs.h"
2239 #include <ctype.h>
2240 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
2241 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
2242 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
2243 int main () { int i; for (i = 0; i < 256; i++)
2244 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
2245 exit (0); }
2246
2247 EOF
2248 if { (eval echo configure:2249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2249 then
2250   :
2251 else
2252   echo "configure: failed program was:" >&5
2253   cat conftest.$ac_ext >&5
2254   rm -fr conftest*
2255   ac_cv_header_stdc=no
2256 fi
2257 rm -fr conftest*
2258 fi
2259
2260 fi
2261 fi
2262
2263 echo "$ac_t""$ac_cv_header_stdc" 1>&6
2264 if test $ac_cv_header_stdc = yes; then
2265   cat >> confdefs.h <<\EOF
2266 #define STDC_HEADERS 1
2267 EOF
2268
2269 fi
2270
2271 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
2272 echo "configure:2273: checking for pid_t" >&5
2273 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
2274   echo $ac_n "(cached) $ac_c" 1>&6
2275 else
2276   cat > conftest.$ac_ext <<EOF
2277 #line 2278 "configure"
2278 #include "confdefs.h"
2279 #include <sys/types.h>
2280 #if STDC_HEADERS
2281 #include <stdlib.h>
2282 #include <stddef.h>
2283 #endif
2284 EOF
2285 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2286   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
2287   rm -rf conftest*
2288   ac_cv_type_pid_t=yes
2289 else
2290   rm -rf conftest*
2291   ac_cv_type_pid_t=no
2292 fi
2293 rm -f conftest*
2294
2295 fi
2296 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
2297 if test $ac_cv_type_pid_t = no; then
2298   cat >> confdefs.h <<\EOF
2299 #define pid_t int
2300 EOF
2301
2302 fi
2303
2304 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
2305 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
2306 echo "configure:2307: checking for vfork.h" >&5
2307 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2308   echo $ac_n "(cached) $ac_c" 1>&6
2309 else
2310   cat > conftest.$ac_ext <<EOF
2311 #line 2312 "configure"
2312 #include "confdefs.h"
2313 #include <vfork.h>
2314 EOF
2315 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2316 { (eval echo configure:2317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2317 ac_err=`grep -v '^ *+' conftest.out`
2318 if test -z "$ac_err"; then
2319   rm -rf conftest*
2320   eval "ac_cv_header_$ac_safe=yes"
2321 else
2322   echo "$ac_err" >&5
2323   echo "configure: failed program was:" >&5
2324   cat conftest.$ac_ext >&5
2325   rm -rf conftest*
2326   eval "ac_cv_header_$ac_safe=no"
2327 fi
2328 rm -f conftest*
2329 fi
2330 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2331   echo "$ac_t""yes" 1>&6
2332   cat >> confdefs.h <<\EOF
2333 #define HAVE_VFORK_H 1
2334 EOF
2335
2336 else
2337   echo "$ac_t""no" 1>&6
2338 fi
2339
2340 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
2341 echo "configure:2342: checking for working vfork" >&5
2342 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
2343   echo $ac_n "(cached) $ac_c" 1>&6
2344 else
2345   if test "$cross_compiling" = yes; then
2346   echo $ac_n "checking for vfork""... $ac_c" 1>&6
2347 echo "configure:2348: checking for vfork" >&5
2348 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
2349   echo $ac_n "(cached) $ac_c" 1>&6
2350 else
2351   cat > conftest.$ac_ext <<EOF
2352 #line 2353 "configure"
2353 #include "confdefs.h"
2354 /* System header to define __stub macros and hopefully few prototypes,
2355     which can conflict with char vfork(); below.  */
2356 #include <assert.h>
2357 /* Override any gcc2 internal prototype to avoid an error.  */
2358 /* We use char because int might match the return type of a gcc2
2359     builtin and then its argument prototype would still apply.  */
2360 char vfork();
2361
2362 int main() {
2363
2364 /* The GNU C library defines this for functions which it implements
2365     to always fail with ENOSYS.  Some functions are actually named
2366     something starting with __ and the normal name is an alias.  */
2367 #if defined (__stub_vfork) || defined (__stub___vfork)
2368 choke me
2369 #else
2370 vfork();
2371 #endif
2372
2373 ; return 0; }
2374 EOF
2375 if { (eval echo configure:2376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2376   rm -rf conftest*
2377   eval "ac_cv_func_vfork=yes"
2378 else
2379   echo "configure: failed program was:" >&5
2380   cat conftest.$ac_ext >&5
2381   rm -rf conftest*
2382   eval "ac_cv_func_vfork=no"
2383 fi
2384 rm -f conftest*
2385 fi
2386
2387 if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
2388   echo "$ac_t""yes" 1>&6
2389   :
2390 else
2391   echo "$ac_t""no" 1>&6
2392 fi
2393
2394 else
2395   cat > conftest.$ac_ext <<EOF
2396 #line 2397 "configure"
2397 #include "confdefs.h"
2398 /* Thanks to Paul Eggert for this test.  */
2399 #include <stdio.h>
2400 #include <sys/types.h>
2401 #include <sys/stat.h>
2402 #ifdef HAVE_UNISTD_H
2403 #include <unistd.h>
2404 #endif
2405 #ifdef HAVE_VFORK_H
2406 #include <vfork.h>
2407 #endif
2408 /* On some sparc systems, changes by the child to local and incoming
2409    argument registers are propagated back to the parent.
2410    The compiler is told about this with #include <vfork.h>,
2411    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
2412    Test for this by using a static variable whose address
2413    is put into a register that is clobbered by the vfork.  */
2414 static
2415 #ifdef __cplusplus
2416 sparc_address_test (int arg)
2417 #else
2418 sparc_address_test (arg) int arg;
2419 #endif
2420 {
2421   static pid_t child;
2422   if (!child) {
2423     child = vfork ();
2424     if (child < 0) {
2425       perror ("vfork");
2426       _exit(2);
2427     }
2428     if (!child) {
2429       arg = getpid();
2430       write(-1, "", 0);
2431       _exit (arg);
2432     }
2433   }
2434 }
2435 main() {
2436   pid_t parent = getpid ();
2437   pid_t child;
2438
2439   sparc_address_test ();
2440
2441   child = vfork ();
2442
2443   if (child == 0) {
2444     /* Here is another test for sparc vfork register problems.
2445        This test uses lots of local variables, at least
2446        as many local variables as main has allocated so far
2447        including compiler temporaries.  4 locals are enough for
2448        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
2449        A buggy compiler should reuse the register of parent
2450        for one of the local variables, since it will think that
2451        parent can't possibly be used any more in this routine.
2452        Assigning to the local variable will thus munge parent
2453        in the parent process.  */
2454     pid_t
2455       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
2456       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
2457     /* Convince the compiler that p..p7 are live; otherwise, it might
2458        use the same hardware register for all 8 local variables.  */
2459     if (p != p1 || p != p2 || p != p3 || p != p4
2460         || p != p5 || p != p6 || p != p7)
2461       _exit(1);
2462
2463     /* On some systems (e.g. IRIX 3.3),
2464        vfork doesn't separate parent from child file descriptors.
2465        If the child closes a descriptor before it execs or exits,
2466        this munges the parent's descriptor as well.
2467        Test for this by closing stdout in the child.  */
2468     _exit(close(fileno(stdout)) != 0);
2469   } else {
2470     int status;
2471     struct stat st;
2472
2473     while (wait(&status) != child)
2474       ;
2475     exit(
2476          /* Was there some problem with vforking?  */
2477          child < 0
2478
2479          /* Did the child fail?  (This shouldn't happen.)  */
2480          || status
2481
2482          /* Did the vfork/compiler bug occur?  */
2483          || parent != getpid()
2484
2485          /* Did the file descriptor bug occur?  */
2486          || fstat(fileno(stdout), &st) != 0
2487          );
2488   }
2489 }
2490 EOF
2491 if { (eval echo configure:2492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2492 then
2493   ac_cv_func_vfork_works=yes
2494 else
2495   echo "configure: failed program was:" >&5
2496   cat conftest.$ac_ext >&5
2497   rm -fr conftest*
2498   ac_cv_func_vfork_works=no
2499 fi
2500 rm -fr conftest*
2501 fi
2502
2503 fi
2504
2505 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
2506 if test $ac_cv_func_vfork_works = no; then
2507   cat >> confdefs.h <<\EOF
2508 #define vfork fork
2509 EOF
2510
2511 fi
2512
2513 else
2514   echo $ac_n "checking for vfork""... $ac_c" 1>&6
2515 echo "configure:2516: checking for vfork" >&5
2516 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
2517   echo $ac_n "(cached) $ac_c" 1>&6
2518 else
2519   cat > conftest.$ac_ext <<EOF
2520 #line 2521 "configure"
2521 #include "confdefs.h"
2522 /* System header to define __stub macros and hopefully few prototypes,
2523     which can conflict with char vfork(); below.  */
2524 #include <assert.h>
2525 /* Override any gcc2 internal prototype to avoid an error.  */
2526 /* We use char because int might match the return type of a gcc2
2527     builtin and then its argument prototype would still apply.  */
2528 char vfork();
2529
2530 int main() {
2531
2532 /* The GNU C library defines this for functions which it implements
2533     to always fail with ENOSYS.  Some functions are actually named
2534     something starting with __ and the normal name is an alias.  */
2535 #if defined (__stub_vfork) || defined (__stub___vfork)
2536 choke me
2537 #else
2538 vfork();
2539 #endif
2540
2541 ; return 0; }
2542 EOF
2543 if { (eval echo configure:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2544   rm -rf conftest*
2545   eval "ac_cv_func_vfork=yes"
2546 else
2547   echo "configure: failed program was:" >&5
2548   cat conftest.$ac_ext >&5
2549   rm -rf conftest*
2550   eval "ac_cv_func_vfork=no"
2551 fi
2552 rm -f conftest*
2553 fi
2554
2555 if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
2556   echo "$ac_t""yes" 1>&6
2557   :
2558 else
2559   echo "$ac_t""no" 1>&6
2560 cat >> confdefs.h <<\EOF
2561 #define vfork fork
2562 EOF
2563
2564 fi
2565
2566 fi
2567
2568 echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6
2569 echo "configure:2570: checking for time_t in time.h" >&5
2570 if eval "test \"`echo '$''{'bu_cv_decl_time_t_time_h'+set}'`\" = set"; then
2571   echo $ac_n "(cached) $ac_c" 1>&6
2572 else
2573   cat > conftest.$ac_ext <<EOF
2574 #line 2575 "configure"
2575 #include "confdefs.h"
2576 #include <time.h>
2577 int main() {
2578 time_t i;
2579 ; return 0; }
2580 EOF
2581 if { (eval echo configure:2582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2582   rm -rf conftest*
2583   bu_cv_decl_time_t_time_h=yes
2584 else
2585   echo "configure: failed program was:" >&5
2586   cat conftest.$ac_ext >&5
2587   rm -rf conftest*
2588   bu_cv_decl_time_t_time_h=no
2589 fi
2590 rm -f conftest*
2591 fi
2592
2593 echo "$ac_t""$bu_cv_decl_time_t_time_h" 1>&6
2594 if test $bu_cv_decl_time_t_time_h = yes; then
2595   cat >> confdefs.h <<\EOF
2596 #define HAVE_TIME_T_IN_TIME_H 1
2597 EOF
2598
2599 fi
2600
2601 echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6
2602 echo "configure:2603: checking for time_t in sys/types.h" >&5
2603 if eval "test \"`echo '$''{'bu_cv_decl_time_t_types_h'+set}'`\" = set"; then
2604   echo $ac_n "(cached) $ac_c" 1>&6
2605 else
2606   cat > conftest.$ac_ext <<EOF
2607 #line 2608 "configure"
2608 #include "confdefs.h"
2609 #include <sys/types.h>
2610 int main() {
2611 time_t i;
2612 ; return 0; }
2613 EOF
2614 if { (eval echo configure:2615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2615   rm -rf conftest*
2616   bu_cv_decl_time_t_types_h=yes
2617 else
2618   echo "configure: failed program was:" >&5
2619   cat conftest.$ac_ext >&5
2620   rm -rf conftest*
2621   bu_cv_decl_time_t_types_h=no
2622 fi
2623 rm -f conftest*
2624 fi
2625
2626 echo "$ac_t""$bu_cv_decl_time_t_types_h" 1>&6
2627 if test $bu_cv_decl_time_t_types_h = yes; then
2628   cat >> confdefs.h <<\EOF
2629 #define HAVE_TIME_T_IN_TYPES_H 1
2630 EOF
2631
2632 fi
2633
2634 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
2635 # by default.
2636 echo $ac_n "checking for utime.h""... $ac_c" 1>&6
2637 echo "configure:2638: checking for utime.h" >&5
2638 if eval "test \"`echo '$''{'bu_cv_header_utime_h'+set}'`\" = set"; then
2639   echo $ac_n "(cached) $ac_c" 1>&6
2640 else
2641   cat > conftest.$ac_ext <<EOF
2642 #line 2643 "configure"
2643 #include "confdefs.h"
2644 #include <sys/types.h>
2645 #ifdef HAVE_TIME_H
2646 #include <time.h>
2647 #endif
2648 #include <utime.h>
2649 int main() {
2650 struct utimbuf s;
2651 ; return 0; }
2652 EOF
2653 if { (eval echo configure:2654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2654   rm -rf conftest*
2655   bu_cv_header_utime_h=yes
2656 else
2657   echo "configure: failed program was:" >&5
2658   cat conftest.$ac_ext >&5
2659   rm -rf conftest*
2660   bu_cv_header_utime_h=no
2661 fi
2662 rm -f conftest*
2663 fi
2664
2665 echo "$ac_t""$bu_cv_header_utime_h" 1>&6
2666 if test $bu_cv_header_utime_h = yes; then
2667   cat >> confdefs.h <<\EOF
2668 #define HAVE_GOOD_UTIME_H 1
2669 EOF
2670
2671 fi
2672
2673 echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6
2674 echo "configure:2675: checking whether fprintf must be declared" >&5
2675 if eval "test \"`echo '$''{'bfd_cv_decl_needed_fprintf'+set}'`\" = set"; then
2676   echo $ac_n "(cached) $ac_c" 1>&6
2677 else
2678   cat > conftest.$ac_ext <<EOF
2679 #line 2680 "configure"
2680 #include "confdefs.h"
2681
2682 #include <stdio.h>
2683 #ifdef HAVE_STRING_H
2684 #include <string.h>
2685 #else
2686 #ifdef HAVE_STRINGS_H
2687 #include <strings.h>
2688 #endif
2689 #endif
2690 #ifdef HAVE_STDLIB_H
2691 #include <stdlib.h>
2692 #endif
2693 #ifdef HAVE_UNISTD_H
2694 #include <unistd.h>
2695 #endif
2696 int main() {
2697 char *(*pfn) = (char *(*)) fprintf
2698 ; return 0; }
2699 EOF
2700 if { (eval echo configure:2701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2701   rm -rf conftest*
2702   bfd_cv_decl_needed_fprintf=no
2703 else
2704   echo "configure: failed program was:" >&5
2705   cat conftest.$ac_ext >&5
2706   rm -rf conftest*
2707   bfd_cv_decl_needed_fprintf=yes
2708 fi
2709 rm -f conftest*
2710 fi
2711
2712 echo "$ac_t""$bfd_cv_decl_needed_fprintf" 1>&6
2713 if test $bfd_cv_decl_needed_fprintf = yes; then
2714   bfd_tr_decl=NEED_DECLARATION_`echo fprintf | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2715   cat >> confdefs.h <<EOF
2716 #define $bfd_tr_decl 1
2717 EOF
2718
2719 fi
2720
2721 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
2722 echo "configure:2723: checking whether strstr must be declared" >&5
2723 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
2724   echo $ac_n "(cached) $ac_c" 1>&6
2725 else
2726   cat > conftest.$ac_ext <<EOF
2727 #line 2728 "configure"
2728 #include "confdefs.h"
2729
2730 #include <stdio.h>
2731 #ifdef HAVE_STRING_H
2732 #include <string.h>
2733 #else
2734 #ifdef HAVE_STRINGS_H
2735 #include <strings.h>
2736 #endif
2737 #endif
2738 #ifdef HAVE_STDLIB_H
2739 #include <stdlib.h>
2740 #endif
2741 #ifdef HAVE_UNISTD_H
2742 #include <unistd.h>
2743 #endif
2744 int main() {
2745 char *(*pfn) = (char *(*)) strstr
2746 ; return 0; }
2747 EOF
2748 if { (eval echo configure:2749: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2749   rm -rf conftest*
2750   bfd_cv_decl_needed_strstr=no
2751 else
2752   echo "configure: failed program was:" >&5
2753   cat conftest.$ac_ext >&5
2754   rm -rf conftest*
2755   bfd_cv_decl_needed_strstr=yes
2756 fi
2757 rm -f conftest*
2758 fi
2759
2760 echo "$ac_t""$bfd_cv_decl_needed_strstr" 1>&6
2761 if test $bfd_cv_decl_needed_strstr = yes; then
2762   bfd_tr_decl=NEED_DECLARATION_`echo strstr | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2763   cat >> confdefs.h <<EOF
2764 #define $bfd_tr_decl 1
2765 EOF
2766
2767 fi
2768
2769 echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
2770 echo "configure:2771: checking whether sbrk must be declared" >&5
2771 if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then
2772   echo $ac_n "(cached) $ac_c" 1>&6
2773 else
2774   cat > conftest.$ac_ext <<EOF
2775 #line 2776 "configure"
2776 #include "confdefs.h"
2777
2778 #include <stdio.h>
2779 #ifdef HAVE_STRING_H
2780 #include <string.h>
2781 #else
2782 #ifdef HAVE_STRINGS_H
2783 #include <strings.h>
2784 #endif
2785 #endif
2786 #ifdef HAVE_STDLIB_H
2787 #include <stdlib.h>
2788 #endif
2789 #ifdef HAVE_UNISTD_H
2790 #include <unistd.h>
2791 #endif
2792 int main() {
2793 char *(*pfn) = (char *(*)) sbrk
2794 ; return 0; }
2795 EOF
2796 if { (eval echo configure:2797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2797   rm -rf conftest*
2798   bfd_cv_decl_needed_sbrk=no
2799 else
2800   echo "configure: failed program was:" >&5
2801   cat conftest.$ac_ext >&5
2802   rm -rf conftest*
2803   bfd_cv_decl_needed_sbrk=yes
2804 fi
2805 rm -f conftest*
2806 fi
2807
2808 echo "$ac_t""$bfd_cv_decl_needed_sbrk" 1>&6
2809 if test $bfd_cv_decl_needed_sbrk = yes; then
2810   bfd_tr_decl=NEED_DECLARATION_`echo sbrk | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2811   cat >> confdefs.h <<EOF
2812 #define $bfd_tr_decl 1
2813 EOF
2814
2815 fi
2816
2817 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
2818 echo "configure:2819: checking whether getenv must be declared" >&5
2819 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
2820   echo $ac_n "(cached) $ac_c" 1>&6
2821 else
2822   cat > conftest.$ac_ext <<EOF
2823 #line 2824 "configure"
2824 #include "confdefs.h"
2825
2826 #include <stdio.h>
2827 #ifdef HAVE_STRING_H
2828 #include <string.h>
2829 #else
2830 #ifdef HAVE_STRINGS_H
2831 #include <strings.h>
2832 #endif
2833 #endif
2834 #ifdef HAVE_STDLIB_H
2835 #include <stdlib.h>
2836 #endif
2837 #ifdef HAVE_UNISTD_H
2838 #include <unistd.h>
2839 #endif
2840 int main() {
2841 char *(*pfn) = (char *(*)) getenv
2842 ; return 0; }
2843 EOF
2844 if { (eval echo configure:2845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2845   rm -rf conftest*
2846   bfd_cv_decl_needed_getenv=no
2847 else
2848   echo "configure: failed program was:" >&5
2849   cat conftest.$ac_ext >&5
2850   rm -rf conftest*
2851   bfd_cv_decl_needed_getenv=yes
2852 fi
2853 rm -f conftest*
2854 fi
2855
2856 echo "$ac_t""$bfd_cv_decl_needed_getenv" 1>&6
2857 if test $bfd_cv_decl_needed_getenv = yes; then
2858   bfd_tr_decl=NEED_DECLARATION_`echo getenv | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2859   cat >> confdefs.h <<EOF
2860 #define $bfd_tr_decl 1
2861 EOF
2862
2863 fi
2864
2865
2866
2867 case "${host}" in
2868 i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32 | *-*-windows)
2869   cat >> confdefs.h <<\EOF
2870 #define USE_BINARY_FOPEN 1
2871 EOF
2872  ;;
2873 esac
2874
2875 # target-specific stuff:
2876
2877 # Canonicalize the secondary target names.
2878 if test -n "$enable_targets"; then
2879     for targ in `echo $enable_targets | sed 's/,/ /g'`
2880     do
2881         result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
2882         if test -n "$result"; then
2883             canon_targets="$canon_targets $result"
2884         else
2885             # Allow targets that config.sub doesn't recognize, like "all".
2886             canon_targets="$canon_targets $targ"
2887         fi
2888     done
2889 fi
2890
2891 all_targets=false
2892 BUILD_NLMCONV=
2893 NLMCONV_DEFS=
2894 BUILD_SRCONV=
2895 BUILD_DLLTOOL=
2896 DLLTOOL_DEFS=
2897 BUILD_WINDRES=
2898
2899 for targ in $target $canon_targets
2900 do
2901     if test "x$targ" = "xall"; then
2902         all_targets=true
2903         BUILD_NLMCONV='$(NLMCONV_PROG)'
2904         BUILD_SRCONV='$(SRCONV_PROG)'
2905         NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
2906     else
2907         case $targ in
2908         i[3456]86*-*-netware*) 
2909           BUILD_NLMCONV='$(NLMCONV_PROG)'
2910           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
2911           ;;
2912         alpha*-*-netware*)
2913           BUILD_NLMCONV='$(NLMCONV_PROG)'
2914           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
2915           ;;
2916         powerpc*-*-netware*)
2917           BUILD_NLMCONV='$(NLMCONV_PROG)'
2918           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
2919           ;;
2920         sparc*-*-netware*)
2921           BUILD_NLMCONV='$(NLMCONV_PROG)'
2922           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
2923           ;;
2924         esac
2925         case $targ in
2926         *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
2927         esac
2928         case $targ in
2929         arm-*pe*)
2930           BUILD_DLLTOOL='$(DLLTOOL_PROG)'
2931           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
2932           BUILD_WINDRES='$(WINDRES_PROG)'
2933          ;;
2934         i[3-6]86-*pe* | i[3-6]86-*-cygwin32)
2935           BUILD_DLLTOOL='$(DLLTOOL_PROG)'
2936           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
2937           BUILD_WINDRES='$(WINDRES_PROG)'
2938          ;;
2939         powerpc*-*-*pe* | powerpc*-*-cygwin32)
2940           BUILD_DLLTOOL='$(DLLTOOL_PROG)'
2941           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
2942           BUILD_WINDRES='$(WINDRES_PROG)'
2943          ;;
2944         esac
2945     fi
2946 done
2947
2948
2949
2950
2951
2952
2953
2954
2955 targ=$target
2956 . $srcdir/../bfd/config.bfd
2957 if test "x$targ_underscore" = "xyes"; then
2958     UNDERSCORE=1
2959 else
2960     UNDERSCORE=0
2961 fi
2962
2963
2964 trap '' 1 2 15
2965 cat > confcache <<\EOF
2966 # This file is a shell script that caches the results of configure
2967 # tests run on this system so they can be shared between configure
2968 # scripts and configure runs.  It is not useful on other systems.
2969 # If it contains results you don't want to keep, you may remove or edit it.
2970 #
2971 # By default, configure uses ./config.cache as the cache file,
2972 # creating it if it does not exist already.  You can give configure
2973 # the --cache-file=FILE option to use a different cache file; that is
2974 # what configure does when it calls configure scripts in
2975 # subdirectories, so they share the cache.
2976 # Giving --cache-file=/dev/null disables caching, for debugging configure.
2977 # config.status only pays attention to the cache file if you give it the
2978 # --recheck option to rerun configure.
2979 #
2980 EOF
2981 # The following way of writing the cache mishandles newlines in values,
2982 # but we know of no workaround that is simple, portable, and efficient.
2983 # So, don't put newlines in cache variables' values.
2984 # Ultrix sh set writes to stderr and can't be redirected directly,
2985 # and sets the high bit in the cache file unless we assign to the vars.
2986 (set) 2>&1 |
2987   case `(ac_space=' '; set) 2>&1` in
2988   *ac_space=\ *)
2989     # `set' does not quote correctly, so add quotes (double-quote substitution
2990     # turns \\\\ into \\, and sed turns \\ into \).
2991     sed -n \
2992       -e "s/'/'\\\\''/g" \
2993       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2994     ;;
2995   *)
2996     # `set' quotes correctly as required by POSIX, so do not add quotes.
2997     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2998     ;;
2999   esac >> confcache
3000 if cmp -s $cache_file confcache; then
3001   :
3002 else
3003   if test -w $cache_file; then
3004     echo "updating cache $cache_file"
3005     cat confcache > $cache_file
3006   else
3007     echo "not updating unwritable cache $cache_file"
3008   fi
3009 fi
3010 rm -f confcache
3011
3012 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
3013
3014 test "x$prefix" = xNONE && prefix=$ac_default_prefix
3015 # Let make expand exec_prefix.
3016 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
3017
3018 # Any assignment to VPATH causes Sun make to only execute
3019 # the first set of double-colon rules, so remove it if not needed.
3020 # If there is a colon in the path, we need to keep it.
3021 if test "x$srcdir" = x.; then
3022   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
3023 fi
3024
3025 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
3026
3027 DEFS=-DHAVE_CONFIG_H
3028
3029 # Without the "./", some shells look in PATH for config.status.
3030 : ${CONFIG_STATUS=./config.status}
3031
3032 echo creating $CONFIG_STATUS
3033 rm -f $CONFIG_STATUS
3034 cat > $CONFIG_STATUS <<EOF
3035 #! /bin/sh
3036 # Generated automatically by configure.
3037 # Run this file to recreate the current configuration.
3038 # This directory was configured as follows,
3039 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3040 #
3041 # $0 $ac_configure_args
3042 #
3043 # Compiler output produced by configure, useful for debugging
3044 # configure, is in ./config.log if it exists.
3045
3046 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
3047 for ac_option
3048 do
3049   case "\$ac_option" in
3050   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
3051     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
3052     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
3053   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
3054     echo "$CONFIG_STATUS generated by autoconf version 2.12"
3055     exit 0 ;;
3056   -help | --help | --hel | --he | --h)
3057     echo "\$ac_cs_usage"; exit 0 ;;
3058   *) echo "\$ac_cs_usage"; exit 1 ;;
3059   esac
3060 done
3061
3062 ac_given_srcdir=$srcdir
3063 ac_given_INSTALL="$INSTALL"
3064
3065 trap 'rm -fr `echo "Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
3066 EOF
3067 cat >> $CONFIG_STATUS <<EOF
3068
3069 # Protect against being on the right side of a sed subst in config.status.
3070 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
3071  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
3072 $ac_vpsub
3073 $extrasub
3074 s%@CFLAGS@%$CFLAGS%g
3075 s%@CPPFLAGS@%$CPPFLAGS%g
3076 s%@CXXFLAGS@%$CXXFLAGS%g
3077 s%@DEFS@%$DEFS%g
3078 s%@LDFLAGS@%$LDFLAGS%g
3079 s%@LIBS@%$LIBS%g
3080 s%@exec_prefix@%$exec_prefix%g
3081 s%@prefix@%$prefix%g
3082 s%@program_transform_name@%$program_transform_name%g
3083 s%@bindir@%$bindir%g
3084 s%@sbindir@%$sbindir%g
3085 s%@libexecdir@%$libexecdir%g
3086 s%@datadir@%$datadir%g
3087 s%@sysconfdir@%$sysconfdir%g
3088 s%@sharedstatedir@%$sharedstatedir%g
3089 s%@localstatedir@%$localstatedir%g
3090 s%@libdir@%$libdir%g
3091 s%@includedir@%$includedir%g
3092 s%@oldincludedir@%$oldincludedir%g
3093 s%@infodir@%$infodir%g
3094 s%@mandir@%$mandir%g
3095 s%@host@%$host%g
3096 s%@host_alias@%$host_alias%g
3097 s%@host_cpu@%$host_cpu%g
3098 s%@host_vendor@%$host_vendor%g
3099 s%@host_os@%$host_os%g
3100 s%@target@%$target%g
3101 s%@target_alias@%$target_alias%g
3102 s%@target_cpu@%$target_cpu%g
3103 s%@target_vendor@%$target_vendor%g
3104 s%@target_os@%$target_os%g
3105 s%@build@%$build%g
3106 s%@build_alias@%$build_alias%g
3107 s%@build_cpu@%$build_cpu%g
3108 s%@build_vendor@%$build_vendor%g
3109 s%@build_os@%$build_os%g
3110 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
3111 s%@INSTALL_DATA@%$INSTALL_DATA%g
3112 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
3113 s%@PACKAGE@%$PACKAGE%g
3114 s%@VERSION@%$VERSION%g
3115 s%@ACLOCAL@%$ACLOCAL%g
3116 s%@AUTOCONF@%$AUTOCONF%g
3117 s%@AUTOMAKE@%$AUTOMAKE%g
3118 s%@AUTOHEADER@%$AUTOHEADER%g
3119 s%@MAKEINFO@%$MAKEINFO%g
3120 s%@SET_MAKE@%$SET_MAKE%g
3121 s%@CC@%$CC%g
3122 s%@RANLIB@%$RANLIB%g
3123 s%@LD@%$LD%g
3124 s%@LN_S@%$LN_S%g
3125 s%@LIBTOOL@%$LIBTOOL%g
3126 s%@YACC@%$YACC%g
3127 s%@LEX@%$LEX%g
3128 s%@LEXLIB@%$LEXLIB%g
3129 s%@CPP@%$CPP%g
3130 s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g
3131 s%@MAINT@%$MAINT%g
3132 s%@EXEEXT@%$EXEEXT%g
3133 s%@HDEFINES@%$HDEFINES%g
3134 s%@AR@%$AR%g
3135 s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
3136 s%@ALLOCA@%$ALLOCA%g
3137 s%@NLMCONV_DEFS@%$NLMCONV_DEFS%g
3138 s%@BUILD_NLMCONV@%$BUILD_NLMCONV%g
3139 s%@BUILD_SRCONV@%$BUILD_SRCONV%g
3140 s%@BUILD_DLLTOOL@%$BUILD_DLLTOOL%g
3141 s%@DLLTOOL_DEFS@%$DLLTOOL_DEFS%g
3142 s%@BUILD_WINDRES@%$BUILD_WINDRES%g
3143 s%@UNDERSCORE@%$UNDERSCORE%g
3144
3145 CEOF
3146 EOF
3147
3148 cat >> $CONFIG_STATUS <<\EOF
3149
3150 # Split the substitutions into bite-sized pieces for seds with
3151 # small command number limits, like on Digital OSF/1 and HP-UX.
3152 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
3153 ac_file=1 # Number of current file.
3154 ac_beg=1 # First line for current file.
3155 ac_end=$ac_max_sed_cmds # Line after last line for current file.
3156 ac_more_lines=:
3157 ac_sed_cmds=""
3158 while $ac_more_lines; do
3159   if test $ac_beg -gt 1; then
3160     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
3161   else
3162     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
3163   fi
3164   if test ! -s conftest.s$ac_file; then
3165     ac_more_lines=false
3166     rm -f conftest.s$ac_file
3167   else
3168     if test -z "$ac_sed_cmds"; then
3169       ac_sed_cmds="sed -f conftest.s$ac_file"
3170     else
3171       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
3172     fi
3173     ac_file=`expr $ac_file + 1`
3174     ac_beg=$ac_end
3175     ac_end=`expr $ac_end + $ac_max_sed_cmds`
3176   fi
3177 done
3178 if test -z "$ac_sed_cmds"; then
3179   ac_sed_cmds=cat
3180 fi
3181 EOF
3182
3183 cat >> $CONFIG_STATUS <<EOF
3184
3185 CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
3186 EOF
3187 cat >> $CONFIG_STATUS <<\EOF
3188 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
3189   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3190   case "$ac_file" in
3191   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3192        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3193   *) ac_file_in="${ac_file}.in" ;;
3194   esac
3195
3196   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
3197
3198   # Remove last slash and all that follows it.  Not all systems have dirname.
3199   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3200   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3201     # The file is in a subdirectory.
3202     test ! -d "$ac_dir" && mkdir "$ac_dir"
3203     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
3204     # A "../" for each directory in $ac_dir_suffix.
3205     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
3206   else
3207     ac_dir_suffix= ac_dots=
3208   fi
3209
3210   case "$ac_given_srcdir" in
3211   .)  srcdir=.
3212       if test -z "$ac_dots"; then top_srcdir=.
3213       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
3214   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
3215   *) # Relative path.
3216     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
3217     top_srcdir="$ac_dots$ac_given_srcdir" ;;
3218   esac
3219
3220   case "$ac_given_INSTALL" in
3221   [/$]*) INSTALL="$ac_given_INSTALL" ;;
3222   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
3223   esac
3224
3225   echo creating "$ac_file"
3226   rm -f "$ac_file"
3227   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
3228   case "$ac_file" in
3229   *Makefile*) ac_comsub="1i\\
3230 # $configure_input" ;;
3231   *) ac_comsub= ;;
3232   esac
3233
3234   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3235   sed -e "$ac_comsub
3236 s%@configure_input@%$configure_input%g
3237 s%@srcdir@%$srcdir%g
3238 s%@top_srcdir@%$top_srcdir%g
3239 s%@INSTALL@%$INSTALL%g
3240 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
3241 fi; done
3242 rm -f conftest.s*
3243
3244 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
3245 # NAME is the cpp macro being defined and VALUE is the value it is being given.
3246 #
3247 # ac_d sets the value in "#define NAME VALUE" lines.
3248 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
3249 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
3250 ac_dC='\3'
3251 ac_dD='%g'
3252 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
3253 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3254 ac_uB='\([      ]\)%\1#\2define\3'
3255 ac_uC=' '
3256 ac_uD='\4%g'
3257 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
3258 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3259 ac_eB='$%\1#\2define\3'
3260 ac_eC=' '
3261 ac_eD='%g'
3262
3263 if test "${CONFIG_HEADERS+set}" != set; then
3264 EOF
3265 cat >> $CONFIG_STATUS <<EOF
3266   CONFIG_HEADERS="config.h:config.in"
3267 EOF
3268 cat >> $CONFIG_STATUS <<\EOF
3269 fi
3270 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
3271   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3272   case "$ac_file" in
3273   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3274        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3275   *) ac_file_in="${ac_file}.in" ;;
3276   esac
3277
3278   echo creating $ac_file
3279
3280   rm -f conftest.frag conftest.in conftest.out
3281   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3282   cat $ac_file_inputs > conftest.in
3283
3284 EOF
3285
3286 # Transform confdefs.h into a sed script conftest.vals that substitutes
3287 # the proper values into config.h.in to produce config.h.  And first:
3288 # Protect against being on the right side of a sed subst in config.status.
3289 # Protect against being in an unquoted here document in config.status.
3290 rm -f conftest.vals
3291 cat > conftest.hdr <<\EOF
3292 s/[\\&%]/\\&/g
3293 s%[\\$`]%\\&%g
3294 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
3295 s%ac_d%ac_u%gp
3296 s%ac_u%ac_e%gp
3297 EOF
3298 sed -n -f conftest.hdr confdefs.h > conftest.vals
3299 rm -f conftest.hdr
3300
3301 # This sed command replaces #undef with comments.  This is necessary, for
3302 # example, in the case of _POSIX_SOURCE, which is predefined and required
3303 # on some systems where configure will not decide to define it.
3304 cat >> conftest.vals <<\EOF
3305 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
3306 EOF
3307
3308 # Break up conftest.vals because some shells have a limit on
3309 # the size of here documents, and old seds have small limits too.
3310
3311 rm -f conftest.tail
3312 while :
3313 do
3314   ac_lines=`grep -c . conftest.vals`
3315   # grep -c gives empty output for an empty file on some AIX systems.
3316   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
3317   # Write a limited-size here document to conftest.frag.
3318   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
3319   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
3320   echo 'CEOF
3321   sed -f conftest.frag conftest.in > conftest.out
3322   rm -f conftest.in
3323   mv conftest.out conftest.in
3324 ' >> $CONFIG_STATUS
3325   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
3326   rm -f conftest.vals
3327   mv conftest.tail conftest.vals
3328 done
3329 rm -f conftest.vals
3330
3331 cat >> $CONFIG_STATUS <<\EOF
3332   rm -f conftest.frag conftest.h
3333   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
3334   cat conftest.in >> conftest.h
3335   rm -f conftest.in
3336   if cmp -s $ac_file conftest.h 2>/dev/null; then
3337     echo "$ac_file is unchanged"
3338     rm -f conftest.h
3339   else
3340     # Remove last slash and all that follows it.  Not all systems have dirname.
3341       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3342       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3343       # The file is in a subdirectory.
3344       test ! -d "$ac_dir" && mkdir "$ac_dir"
3345     fi
3346     rm -f $ac_file
3347     mv conftest.h $ac_file
3348   fi
3349 fi; done
3350
3351 EOF
3352 cat >> $CONFIG_STATUS <<EOF
3353
3354
3355 EOF
3356 cat >> $CONFIG_STATUS <<\EOF
3357 test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
3358
3359 exit 0
3360 EOF
3361 chmod +x $CONFIG_STATUS
3362 rm -fr confdefs* $ac_clean_files
3363 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
3364