* configure.in: Use CYGWIN and EXEEXT autoconf macro to look for
[external/binutils.git] / ld / 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   --enable-targets        alternative target configurations"
16 ac_help="$ac_help
17   --enable-shared         build shared BFD library"
18 ac_help="$ac_help
19   --enable-64-bit-bfd     64-bit support (on hosts with narrower word sizes)"
20
21 # Initialize some variables set by options.
22 # The variables have the same names as the options, with
23 # dashes changed to underlines.
24 build=NONE
25 cache_file=./config.cache
26 exec_prefix=NONE
27 host=NONE
28 no_create=
29 nonopt=NONE
30 no_recursion=
31 prefix=NONE
32 program_prefix=NONE
33 program_suffix=NONE
34 program_transform_name=s,x,x,
35 silent=
36 site=
37 srcdir=
38 target=NONE
39 verbose=
40 x_includes=NONE
41 x_libraries=NONE
42 bindir='${exec_prefix}/bin'
43 sbindir='${exec_prefix}/sbin'
44 libexecdir='${exec_prefix}/libexec'
45 datadir='${prefix}/share'
46 sysconfdir='${prefix}/etc'
47 sharedstatedir='${prefix}/com'
48 localstatedir='${prefix}/var'
49 libdir='${exec_prefix}/lib'
50 includedir='${prefix}/include'
51 oldincludedir='/usr/include'
52 infodir='${prefix}/info'
53 mandir='${prefix}/man'
54
55 # Initialize some other variables.
56 subdirs=
57 MFLAGS= MAKEFLAGS=
58 # Maximum number of lines to put in a shell here document.
59 ac_max_here_lines=12
60
61 ac_prev=
62 for ac_option
63 do
64
65   # If the previous option needs an argument, assign it.
66   if test -n "$ac_prev"; then
67     eval "$ac_prev=\$ac_option"
68     ac_prev=
69     continue
70   fi
71
72   case "$ac_option" in
73   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
74   *) ac_optarg= ;;
75   esac
76
77   # Accept the important Cygnus configure options, so we can diagnose typos.
78
79   case "$ac_option" in
80
81   -bindir | --bindir | --bindi | --bind | --bin | --bi)
82     ac_prev=bindir ;;
83   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
84     bindir="$ac_optarg" ;;
85
86   -build | --build | --buil | --bui | --bu)
87     ac_prev=build ;;
88   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
89     build="$ac_optarg" ;;
90
91   -cache-file | --cache-file | --cache-fil | --cache-fi \
92   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
93     ac_prev=cache_file ;;
94   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
95   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
96     cache_file="$ac_optarg" ;;
97
98   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
99     ac_prev=datadir ;;
100   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
101   | --da=*)
102     datadir="$ac_optarg" ;;
103
104   -disable-* | --disable-*)
105     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
106     # Reject names that are not valid shell variable names.
107     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
108       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
109     fi
110     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
111     eval "enable_${ac_feature}=no" ;;
112
113   -enable-* | --enable-*)
114     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
115     # Reject names that are not valid shell variable names.
116     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
117       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
118     fi
119     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
120     case "$ac_option" in
121       *=*) ;;
122       *) ac_optarg=yes ;;
123     esac
124     eval "enable_${ac_feature}='$ac_optarg'" ;;
125
126   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
127   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
128   | --exec | --exe | --ex)
129     ac_prev=exec_prefix ;;
130   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
131   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
132   | --exec=* | --exe=* | --ex=*)
133     exec_prefix="$ac_optarg" ;;
134
135   -gas | --gas | --ga | --g)
136     # Obsolete; use --with-gas.
137     with_gas=yes ;;
138
139   -help | --help | --hel | --he)
140     # Omit some internal or obsolete options to make the list less imposing.
141     # This message is too long to be a string in the A/UX 3.1 sh.
142     cat << EOF
143 Usage: configure [options] [host]
144 Options: [defaults in brackets after descriptions]
145 Configuration:
146   --cache-file=FILE       cache test results in FILE
147   --help                  print this message
148   --no-create             do not create output files
149   --quiet, --silent       do not print \`checking...' messages
150   --version               print the version of autoconf that created configure
151 Directory and file names:
152   --prefix=PREFIX         install architecture-independent files in PREFIX
153                           [$ac_default_prefix]
154   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
155                           [same as prefix]
156   --bindir=DIR            user executables in DIR [EPREFIX/bin]
157   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
158   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
159   --datadir=DIR           read-only architecture-independent data in DIR
160                           [PREFIX/share]
161   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
162   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
163                           [PREFIX/com]
164   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
165   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
166   --includedir=DIR        C header files in DIR [PREFIX/include]
167   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
168   --infodir=DIR           info documentation in DIR [PREFIX/info]
169   --mandir=DIR            man documentation in DIR [PREFIX/man]
170   --srcdir=DIR            find the sources in DIR [configure dir or ..]
171   --program-prefix=PREFIX prepend PREFIX to installed program names
172   --program-suffix=SUFFIX append SUFFIX to installed program names
173   --program-transform-name=PROGRAM
174                           run sed PROGRAM on installed program names
175 EOF
176     cat << EOF
177 Host type:
178   --build=BUILD           configure for building on BUILD [BUILD=HOST]
179   --host=HOST             configure for HOST [guessed]
180   --target=TARGET         configure for TARGET [TARGET=HOST]
181 Features and packages:
182   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
183   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
184   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
185   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
186   --x-includes=DIR        X include files are in DIR
187   --x-libraries=DIR       X library files are in DIR
188 EOF
189     if test -n "$ac_help"; then
190       echo "--enable and --with options recognized:$ac_help"
191     fi
192     exit 0 ;;
193
194   -host | --host | --hos | --ho)
195     ac_prev=host ;;
196   -host=* | --host=* | --hos=* | --ho=*)
197     host="$ac_optarg" ;;
198
199   -includedir | --includedir | --includedi | --included | --include \
200   | --includ | --inclu | --incl | --inc)
201     ac_prev=includedir ;;
202   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
203   | --includ=* | --inclu=* | --incl=* | --inc=*)
204     includedir="$ac_optarg" ;;
205
206   -infodir | --infodir | --infodi | --infod | --info | --inf)
207     ac_prev=infodir ;;
208   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
209     infodir="$ac_optarg" ;;
210
211   -libdir | --libdir | --libdi | --libd)
212     ac_prev=libdir ;;
213   -libdir=* | --libdir=* | --libdi=* | --libd=*)
214     libdir="$ac_optarg" ;;
215
216   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
217   | --libexe | --libex | --libe)
218     ac_prev=libexecdir ;;
219   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
220   | --libexe=* | --libex=* | --libe=*)
221     libexecdir="$ac_optarg" ;;
222
223   -localstatedir | --localstatedir | --localstatedi | --localstated \
224   | --localstate | --localstat | --localsta | --localst \
225   | --locals | --local | --loca | --loc | --lo)
226     ac_prev=localstatedir ;;
227   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
228   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
229   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
230     localstatedir="$ac_optarg" ;;
231
232   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
233     ac_prev=mandir ;;
234   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
235     mandir="$ac_optarg" ;;
236
237   -nfp | --nfp | --nf)
238     # Obsolete; use --without-fp.
239     with_fp=no ;;
240
241   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
242   | --no-cr | --no-c)
243     no_create=yes ;;
244
245   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
246   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
247     no_recursion=yes ;;
248
249   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
250   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
251   | --oldin | --oldi | --old | --ol | --o)
252     ac_prev=oldincludedir ;;
253   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
254   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
255   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
256     oldincludedir="$ac_optarg" ;;
257
258   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
259     ac_prev=prefix ;;
260   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
261     prefix="$ac_optarg" ;;
262
263   -program-prefix | --program-prefix | --program-prefi | --program-pref \
264   | --program-pre | --program-pr | --program-p)
265     ac_prev=program_prefix ;;
266   -program-prefix=* | --program-prefix=* | --program-prefi=* \
267   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
268     program_prefix="$ac_optarg" ;;
269
270   -program-suffix | --program-suffix | --program-suffi | --program-suff \
271   | --program-suf | --program-su | --program-s)
272     ac_prev=program_suffix ;;
273   -program-suffix=* | --program-suffix=* | --program-suffi=* \
274   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
275     program_suffix="$ac_optarg" ;;
276
277   -program-transform-name | --program-transform-name \
278   | --program-transform-nam | --program-transform-na \
279   | --program-transform-n | --program-transform- \
280   | --program-transform | --program-transfor \
281   | --program-transfo | --program-transf \
282   | --program-trans | --program-tran \
283   | --progr-tra | --program-tr | --program-t)
284     ac_prev=program_transform_name ;;
285   -program-transform-name=* | --program-transform-name=* \
286   | --program-transform-nam=* | --program-transform-na=* \
287   | --program-transform-n=* | --program-transform-=* \
288   | --program-transform=* | --program-transfor=* \
289   | --program-transfo=* | --program-transf=* \
290   | --program-trans=* | --program-tran=* \
291   | --progr-tra=* | --program-tr=* | --program-t=*)
292     program_transform_name="$ac_optarg" ;;
293
294   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
295   | -silent | --silent | --silen | --sile | --sil)
296     silent=yes ;;
297
298   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
299     ac_prev=sbindir ;;
300   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
301   | --sbi=* | --sb=*)
302     sbindir="$ac_optarg" ;;
303
304   -sharedstatedir | --sharedstatedir | --sharedstatedi \
305   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
306   | --sharedst | --shareds | --shared | --share | --shar \
307   | --sha | --sh)
308     ac_prev=sharedstatedir ;;
309   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
310   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
311   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
312   | --sha=* | --sh=*)
313     sharedstatedir="$ac_optarg" ;;
314
315   -site | --site | --sit)
316     ac_prev=site ;;
317   -site=* | --site=* | --sit=*)
318     site="$ac_optarg" ;;
319
320   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
321     ac_prev=srcdir ;;
322   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
323     srcdir="$ac_optarg" ;;
324
325   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
326   | --syscon | --sysco | --sysc | --sys | --sy)
327     ac_prev=sysconfdir ;;
328   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
329   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
330     sysconfdir="$ac_optarg" ;;
331
332   -target | --target | --targe | --targ | --tar | --ta | --t)
333     ac_prev=target ;;
334   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
335     target="$ac_optarg" ;;
336
337   -v | -verbose | --verbose | --verbos | --verbo | --verb)
338     verbose=yes ;;
339
340   -version | --version | --versio | --versi | --vers)
341     echo "configure generated by autoconf version 2.12"
342     exit 0 ;;
343
344   -with-* | --with-*)
345     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
346     # Reject names that are not valid shell variable names.
347     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
348       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
349     fi
350     ac_package=`echo $ac_package| sed 's/-/_/g'`
351     case "$ac_option" in
352       *=*) ;;
353       *) ac_optarg=yes ;;
354     esac
355     eval "with_${ac_package}='$ac_optarg'" ;;
356
357   -without-* | --without-*)
358     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
359     # Reject names that are not valid shell variable names.
360     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
361       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
362     fi
363     ac_package=`echo $ac_package| sed 's/-/_/g'`
364     eval "with_${ac_package}=no" ;;
365
366   --x)
367     # Obsolete; use --with-x.
368     with_x=yes ;;
369
370   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
371   | --x-incl | --x-inc | --x-in | --x-i)
372     ac_prev=x_includes ;;
373   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
374   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
375     x_includes="$ac_optarg" ;;
376
377   -x-libraries | --x-libraries | --x-librarie | --x-librari \
378   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
379     ac_prev=x_libraries ;;
380   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
381   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
382     x_libraries="$ac_optarg" ;;
383
384   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
385     ;;
386
387   *)
388     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
389       echo "configure: warning: $ac_option: invalid host type" 1>&2
390     fi
391     if test "x$nonopt" != xNONE; then
392       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
393     fi
394     nonopt="$ac_option"
395     ;;
396
397   esac
398 done
399
400 if test -n "$ac_prev"; then
401   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
402 fi
403
404 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
405
406 # File descriptor usage:
407 # 0 standard input
408 # 1 file creation
409 # 2 errors and warnings
410 # 3 some systems may open it to /dev/tty
411 # 4 used on the Kubota Titan
412 # 6 checking for... messages and results
413 # 5 compiler messages saved in config.log
414 if test "$silent" = yes; then
415   exec 6>/dev/null
416 else
417   exec 6>&1
418 fi
419 exec 5>./config.log
420
421 echo "\
422 This file contains any messages produced by compilers while
423 running configure, to aid debugging if configure makes a mistake.
424 " 1>&5
425
426 # Strip out --no-create and --no-recursion so they do not pile up.
427 # Also quote any args containing shell metacharacters.
428 ac_configure_args=
429 for ac_arg
430 do
431   case "$ac_arg" in
432   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
433   | --no-cr | --no-c) ;;
434   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
435   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
436   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
437   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
438   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
439   esac
440 done
441
442 # NLS nuisances.
443 # Only set these to C if already set.  These must not be set unconditionally
444 # because not all systems understand e.g. LANG=C (notably SCO).
445 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
446 # Non-C LC_CTYPE values break the ctype check.
447 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
448 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
449 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
450 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
451
452 # confdefs.h avoids OS command line length limits that DEFS can exceed.
453 rm -rf conftest* confdefs.h
454 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
455 echo > confdefs.h
456
457 # A filename unique to this package, relative to the directory that
458 # configure is in, which we can look for to find out if srcdir is correct.
459 ac_unique_file=ldmain.c
460
461 # Find the source files, if location was not specified.
462 if test -z "$srcdir"; then
463   ac_srcdir_defaulted=yes
464   # Try the directory containing this script, then its parent.
465   ac_prog=$0
466   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
467   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
468   srcdir=$ac_confdir
469   if test ! -r $srcdir/$ac_unique_file; then
470     srcdir=..
471   fi
472 else
473   ac_srcdir_defaulted=no
474 fi
475 if test ! -r $srcdir/$ac_unique_file; then
476   if test "$ac_srcdir_defaulted" = yes; then
477     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
478   else
479     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
480   fi
481 fi
482 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
483
484 # Prefer explicitly selected file to automatically selected ones.
485 if test -z "$CONFIG_SITE"; then
486   if test "x$prefix" != xNONE; then
487     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
488   else
489     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
490   fi
491 fi
492 for ac_site_file in $CONFIG_SITE; do
493   if test -r "$ac_site_file"; then
494     echo "loading site script $ac_site_file"
495     . "$ac_site_file"
496   fi
497 done
498
499 if test -r "$cache_file"; then
500   echo "loading cache $cache_file"
501   . $cache_file
502 else
503   echo "creating cache $cache_file"
504   > $cache_file
505 fi
506
507 ac_ext=c
508 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
509 ac_cpp='$CPP $CPPFLAGS'
510 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
511 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
512 cross_compiling=$ac_cv_prog_cc_cross
513
514 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
515   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
516   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
517     ac_n= ac_c='
518 ' ac_t='        '
519   else
520     ac_n=-n ac_c= ac_t=
521   fi
522 else
523   ac_n= ac_c='\c' ac_t=
524 fi
525
526
527
528 # Check whether --enable-targets or --disable-targets was given.
529 if test "${enable_targets+set}" = set; then
530   enableval="$enable_targets"
531   case "${enableval}" in
532   yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
533             ;;
534   no)       enable_targets= ;;
535   *)        enable_targets=$enableval ;;
536 esac
537 fi
538 # Check whether --enable-shared or --disable-shared was given.
539 if test "${enable_shared+set}" = set; then
540   enableval="$enable_shared"
541   case "${enableval}" in
542   yes) shared=true ;;
543   no)  shared=false ;;
544   *bfd*) shared=true ;;
545   *) shared=false ;;
546 esac
547 fi
548 # Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given.
549 if test "${enable_64_bit_bfd+set}" = set; then
550   enableval="$enable_64_bit_bfd"
551   case "${enableval}" in
552   yes)  want64=true  ;;
553   no)   want64=false ;;
554   *)    { echo "configure: error: bad value ${enableval} for 64-bit-bfd option" 1>&2; exit 1; } ;;
555 esac
556 else
557   want64=false
558 fi
559
560
561
562 ac_aux_dir=
563 for ac_dir in `cd $srcdir/..; pwd` $srcdir/`cd $srcdir/..; pwd`; do
564   if test -f $ac_dir/install-sh; then
565     ac_aux_dir=$ac_dir
566     ac_install_sh="$ac_aux_dir/install-sh -c"
567     break
568   elif test -f $ac_dir/install.sh; then
569     ac_aux_dir=$ac_dir
570     ac_install_sh="$ac_aux_dir/install.sh -c"
571     break
572   fi
573 done
574 if test -z "$ac_aux_dir"; then
575   { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir/..; pwd` $srcdir/`cd $srcdir/..; pwd`" 1>&2; exit 1; }
576 fi
577 ac_config_guess=$ac_aux_dir/config.guess
578 ac_config_sub=$ac_aux_dir/config.sub
579 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
580
581
582 # Do some error checking and defaulting for the host and target type.
583 # The inputs are:
584 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
585 #
586 # The rules are:
587 # 1. You are not allowed to specify --host, --target, and nonopt at the
588 #    same time.
589 # 2. Host defaults to nonopt.
590 # 3. If nonopt is not specified, then host defaults to the current host,
591 #    as determined by config.guess.
592 # 4. Target and build default to nonopt.
593 # 5. If nonopt is not specified, then target and build default to host.
594
595 # The aliases save the names the user supplied, while $host etc.
596 # will get canonicalized.
597 case $host---$target---$nonopt in
598 NONE---*---* | *---NONE---* | *---*---NONE) ;;
599 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
600 esac
601
602
603 # Make sure we can run config.sub.
604 if $ac_config_sub sun4 >/dev/null 2>&1; then :
605 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
606 fi
607
608 echo $ac_n "checking host system type""... $ac_c" 1>&6
609 echo "configure:610: checking host system type" >&5
610
611 host_alias=$host
612 case "$host_alias" in
613 NONE)
614   case $nonopt in
615   NONE)
616     if host_alias=`$ac_config_guess`; then :
617     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
618     fi ;;
619   *) host_alias=$nonopt ;;
620   esac ;;
621 esac
622
623 host=`$ac_config_sub $host_alias`
624 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
625 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
626 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
627 echo "$ac_t""$host" 1>&6
628
629 echo $ac_n "checking target system type""... $ac_c" 1>&6
630 echo "configure:631: checking target system type" >&5
631
632 target_alias=$target
633 case "$target_alias" in
634 NONE)
635   case $nonopt in
636   NONE) target_alias=$host_alias ;;
637   *) target_alias=$nonopt ;;
638   esac ;;
639 esac
640
641 target=`$ac_config_sub $target_alias`
642 target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
643 target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
644 target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
645 echo "$ac_t""$target" 1>&6
646
647 echo $ac_n "checking build system type""... $ac_c" 1>&6
648 echo "configure:649: checking build system type" >&5
649
650 build_alias=$build
651 case "$build_alias" in
652 NONE)
653   case $nonopt in
654   NONE) build_alias=$host_alias ;;
655   *) build_alias=$nonopt ;;
656   esac ;;
657 esac
658
659 build=`$ac_config_sub $build_alias`
660 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
661 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
662 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
663 echo "$ac_t""$build" 1>&6
664
665 test "$host_alias" != "$target_alias" &&
666   test "$program_prefix$program_suffix$program_transform_name" = \
667     NONENONEs,x,x, &&
668   program_prefix=${target_alias}-
669
670 if test -z "$target" ; then
671     { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
672 fi
673 if test -z "$host" ; then
674     { echo "configure: error: Unrecognized host system type; please check config.sub." 1>&2; exit 1; }
675 fi
676 if test "$program_transform_name" = s,x,x,; then
677   program_transform_name=
678 else
679   # Double any \ or $.  echo might interpret backslashes.
680   cat <<\EOF_SED > conftestsed
681 s,\\,\\\\,g; s,\$,$$,g
682 EOF_SED
683   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
684   rm -f conftestsed
685 fi
686 test "$program_prefix" != NONE &&
687   program_transform_name="s,^,${program_prefix},; $program_transform_name"
688 # Use a double $ so make ignores it.
689 test "$program_suffix" != NONE &&
690   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
691
692 # sed with no file args requires a program.
693 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
694
695
696 # host-specific stuff:
697
698 # Extract the first word of "gcc", so it can be a program name with args.
699 set dummy gcc; ac_word=$2
700 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
701 echo "configure:702: checking for $ac_word" >&5
702 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
703   echo $ac_n "(cached) $ac_c" 1>&6
704 else
705   if test -n "$CC"; then
706   ac_cv_prog_CC="$CC" # Let the user override the test.
707 else
708   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
709   for ac_dir in $PATH; do
710     test -z "$ac_dir" && ac_dir=.
711     if test -f $ac_dir/$ac_word; then
712       ac_cv_prog_CC="gcc"
713       break
714     fi
715   done
716   IFS="$ac_save_ifs"
717 fi
718 fi
719 CC="$ac_cv_prog_CC"
720 if test -n "$CC"; then
721   echo "$ac_t""$CC" 1>&6
722 else
723   echo "$ac_t""no" 1>&6
724 fi
725
726 if test -z "$CC"; then
727   # Extract the first word of "cc", so it can be a program name with args.
728 set dummy cc; ac_word=$2
729 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
730 echo "configure:731: checking for $ac_word" >&5
731 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
732   echo $ac_n "(cached) $ac_c" 1>&6
733 else
734   if test -n "$CC"; then
735   ac_cv_prog_CC="$CC" # Let the user override the test.
736 else
737   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
738   ac_prog_rejected=no
739   for ac_dir in $PATH; do
740     test -z "$ac_dir" && ac_dir=.
741     if test -f $ac_dir/$ac_word; then
742       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
743         ac_prog_rejected=yes
744         continue
745       fi
746       ac_cv_prog_CC="cc"
747       break
748     fi
749   done
750   IFS="$ac_save_ifs"
751 if test $ac_prog_rejected = yes; then
752   # We found a bogon in the path, so make sure we never use it.
753   set dummy $ac_cv_prog_CC
754   shift
755   if test $# -gt 0; then
756     # We chose a different compiler from the bogus one.
757     # However, it has the same basename, so the bogon will be chosen
758     # first if we set CC to just the basename; use the full file name.
759     shift
760     set dummy "$ac_dir/$ac_word" "$@"
761     shift
762     ac_cv_prog_CC="$@"
763   fi
764 fi
765 fi
766 fi
767 CC="$ac_cv_prog_CC"
768 if test -n "$CC"; then
769   echo "$ac_t""$CC" 1>&6
770 else
771   echo "$ac_t""no" 1>&6
772 fi
773
774   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
775 fi
776
777 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
778 echo "configure:779: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
779
780 ac_ext=c
781 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
782 ac_cpp='$CPP $CPPFLAGS'
783 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
784 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
785 cross_compiling=$ac_cv_prog_cc_cross
786
787 cat > conftest.$ac_ext <<EOF
788 #line 789 "configure"
789 #include "confdefs.h"
790 main(){return(0);}
791 EOF
792 if { (eval echo configure:793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
793   ac_cv_prog_cc_works=yes
794   # If we can't run a trivial program, we are probably using a cross compiler.
795   if (./conftest; exit) 2>/dev/null; then
796     ac_cv_prog_cc_cross=no
797   else
798     ac_cv_prog_cc_cross=yes
799   fi
800 else
801   echo "configure: failed program was:" >&5
802   cat conftest.$ac_ext >&5
803   ac_cv_prog_cc_works=no
804 fi
805 rm -fr conftest*
806
807 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
808 if test $ac_cv_prog_cc_works = no; then
809   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
810 fi
811 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
812 echo "configure:813: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
813 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
814 cross_compiling=$ac_cv_prog_cc_cross
815
816 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
817 echo "configure:818: checking whether we are using GNU C" >&5
818 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
819   echo $ac_n "(cached) $ac_c" 1>&6
820 else
821   cat > conftest.c <<EOF
822 #ifdef __GNUC__
823   yes;
824 #endif
825 EOF
826 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
827   ac_cv_prog_gcc=yes
828 else
829   ac_cv_prog_gcc=no
830 fi
831 fi
832
833 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
834
835 if test $ac_cv_prog_gcc = yes; then
836   GCC=yes
837   ac_test_CFLAGS="${CFLAGS+set}"
838   ac_save_CFLAGS="$CFLAGS"
839   CFLAGS=
840   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
841 echo "configure:842: checking whether ${CC-cc} accepts -g" >&5
842 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
843   echo $ac_n "(cached) $ac_c" 1>&6
844 else
845   echo 'void f(){}' > conftest.c
846 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
847   ac_cv_prog_cc_g=yes
848 else
849   ac_cv_prog_cc_g=no
850 fi
851 rm -f conftest*
852
853 fi
854
855 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
856   if test "$ac_test_CFLAGS" = set; then
857     CFLAGS="$ac_save_CFLAGS"
858   elif test $ac_cv_prog_cc_g = yes; then
859     CFLAGS="-g -O2"
860   else
861     CFLAGS="-O2"
862   fi
863 else
864   GCC=
865   test "${CFLAGS+set}" = set || CFLAGS="-g"
866 fi
867
868 # Find a good install program.  We prefer a C program (faster),
869 # so one script is as good as another.  But avoid the broken or
870 # incompatible versions:
871 # SysV /etc/install, /usr/sbin/install
872 # SunOS /usr/etc/install
873 # IRIX /sbin/install
874 # AIX /bin/install
875 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
876 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
877 # ./install, which can be erroneously created by make from ./install.sh.
878 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
879 echo "configure:880: checking for a BSD compatible install" >&5
880 if test -z "$INSTALL"; then
881 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
882   echo $ac_n "(cached) $ac_c" 1>&6
883 else
884     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
885   for ac_dir in $PATH; do
886     # Account for people who put trailing slashes in PATH elements.
887     case "$ac_dir/" in
888     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
889     *)
890       # OSF1 and SCO ODT 3.0 have their own names for install.
891       for ac_prog in ginstall installbsd scoinst install; do
892         if test -f $ac_dir/$ac_prog; then
893           if test $ac_prog = install &&
894             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
895             # AIX install.  It has an incompatible calling convention.
896             # OSF/1 installbsd also uses dspmsg, but is usable.
897             :
898           else
899             ac_cv_path_install="$ac_dir/$ac_prog -c"
900             break 2
901           fi
902         fi
903       done
904       ;;
905     esac
906   done
907   IFS="$ac_save_IFS"
908
909 fi
910   if test "${ac_cv_path_install+set}" = set; then
911     INSTALL="$ac_cv_path_install"
912   else
913     # As a last resort, use the slow shell script.  We don't cache a
914     # path for INSTALL within a source directory, because that will
915     # break other packages using the cache if that directory is
916     # removed, or if the path is relative.
917     INSTALL="$ac_install_sh"
918   fi
919 fi
920 echo "$ac_t""$INSTALL" 1>&6
921
922 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
923 # It thinks the first close brace ends the variable substitution.
924 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
925
926 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
927
928 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
929 echo "configure:930: checking for Cygwin32 environment" >&5
930 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
931   echo $ac_n "(cached) $ac_c" 1>&6
932 else
933   cat > conftest.$ac_ext <<EOF
934 #line 935 "configure"
935 #include "confdefs.h"
936
937 int main() {
938 int main () { return __CYGWIN32__; }
939 ; return 0; }
940 EOF
941 if { (eval echo configure:942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
942   rm -rf conftest*
943   am_cv_cygwin32=yes
944 else
945   echo "configure: failed program was:" >&5
946   cat conftest.$ac_ext >&5
947   rm -rf conftest*
948   am_cv_cygwin32=no
949 fi
950 rm -f conftest*
951 rm -f conftest*
952 fi
953
954 echo "$ac_t""$am_cv_cygwin32" 1>&6
955 CYGWIN32=
956 test "$am_cv_cygwin32" = yes && CYGWIN32=yes
957 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
958 echo "configure:959: checking for executable suffix" >&5
959 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
960   echo $ac_n "(cached) $ac_c" 1>&6
961 else
962   if test "$CYGWIN32" = yes; then
963 am_cv_exeext=.exe
964 else
965 cat > am_c_test.c << 'EOF'
966 int main() {
967 /* Nothing needed here */
968 }
969 EOF
970 ${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
971 am_cv_exeext=`ls am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
972 rm -f am_c_test*
973 fi
974
975 test x"${am_cv_exeext}" = x && am_cv_exeext=no
976 fi
977 EXEEXT=""
978 test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
979 echo "$ac_t""${am_cv_exeext}" 1>&6
980
981
982 . ${srcdir}/configure.host
983
984
985
986
987
988
989
990
991
992 # For most hosts we can use a simple definition to pick up the BFD and
993 # opcodes libraries.  However, if we are building shared libraries, we
994 # need to handle some hosts specially.
995 BFDLIB='-L../bfd -lbfd'
996 case "${host}" in
997 *-*-sunos*)
998   # On SunOS, we must link against the name we are going to install,
999   # not -lbfd, since SunOS does not support SONAME.
1000   if test "${shared}" = "true"; then
1001     BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
1002   fi
1003   ;;
1004 alpha*-*-osf*)
1005   # On Alpha OSF/1, the native linker searches all the -L
1006   # directories for any LIB.so files, and only then searches for any
1007   # LIB.a files.  That means that if there is an installed
1008   # libbfd.so, but this build is not done with --enable-shared, the
1009   # link will wind up being against the install libbfd.so rather
1010   # than the newly built libbfd.  To avoid this, we must explicitly
1011   # link against libbfd.a when --enable-shared is not used.
1012   if test "${shared}" != "true"; then
1013     BFDLIB='../bfd/libbfd.a'
1014   fi
1015   ;;
1016 esac
1017
1018
1019 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1020 echo "configure:1021: checking how to run the C preprocessor" >&5
1021 # On Suns, sometimes $CPP names a directory.
1022 if test -n "$CPP" && test -d "$CPP"; then
1023   CPP=
1024 fi
1025 if test -z "$CPP"; then
1026 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1027   echo $ac_n "(cached) $ac_c" 1>&6
1028 else
1029     # This must be in double quotes, not single quotes, because CPP may get
1030   # substituted into the Makefile and "${CC-cc}" will confuse make.
1031   CPP="${CC-cc} -E"
1032   # On the NeXT, cc -E runs the code through the compiler's parser,
1033   # not just through cpp.
1034   cat > conftest.$ac_ext <<EOF
1035 #line 1036 "configure"
1036 #include "confdefs.h"
1037 #include <assert.h>
1038 Syntax Error
1039 EOF
1040 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1041 { (eval echo configure:1042: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1042 ac_err=`grep -v '^ *+' conftest.out`
1043 if test -z "$ac_err"; then
1044   :
1045 else
1046   echo "$ac_err" >&5
1047   echo "configure: failed program was:" >&5
1048   cat conftest.$ac_ext >&5
1049   rm -rf conftest*
1050   CPP="${CC-cc} -E -traditional-cpp"
1051   cat > conftest.$ac_ext <<EOF
1052 #line 1053 "configure"
1053 #include "confdefs.h"
1054 #include <assert.h>
1055 Syntax Error
1056 EOF
1057 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1058 { (eval echo configure:1059: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1059 ac_err=`grep -v '^ *+' conftest.out`
1060 if test -z "$ac_err"; then
1061   :
1062 else
1063   echo "$ac_err" >&5
1064   echo "configure: failed program was:" >&5
1065   cat conftest.$ac_ext >&5
1066   rm -rf conftest*
1067   CPP=/lib/cpp
1068 fi
1069 rm -f conftest*
1070 fi
1071 rm -f conftest*
1072   ac_cv_prog_CPP="$CPP"
1073 fi
1074   CPP="$ac_cv_prog_CPP"
1075 else
1076   ac_cv_prog_CPP="$CPP"
1077 fi
1078 echo "$ac_t""$CPP" 1>&6
1079
1080 for ac_hdr in string.h strings.h stdlib.h unistd.h
1081 do
1082 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1083 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1084 echo "configure:1085: checking for $ac_hdr" >&5
1085 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1086   echo $ac_n "(cached) $ac_c" 1>&6
1087 else
1088   cat > conftest.$ac_ext <<EOF
1089 #line 1090 "configure"
1090 #include "confdefs.h"
1091 #include <$ac_hdr>
1092 EOF
1093 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1094 { (eval echo configure:1095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1095 ac_err=`grep -v '^ *+' conftest.out`
1096 if test -z "$ac_err"; then
1097   rm -rf conftest*
1098   eval "ac_cv_header_$ac_safe=yes"
1099 else
1100   echo "$ac_err" >&5
1101   echo "configure: failed program was:" >&5
1102   cat conftest.$ac_ext >&5
1103   rm -rf conftest*
1104   eval "ac_cv_header_$ac_safe=no"
1105 fi
1106 rm -f conftest*
1107 fi
1108 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1109   echo "$ac_t""yes" 1>&6
1110     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1111   cat >> confdefs.h <<EOF
1112 #define $ac_tr_hdr 1
1113 EOF
1114  
1115 else
1116   echo "$ac_t""no" 1>&6
1117 fi
1118 done
1119
1120 for ac_func in sbrk
1121 do
1122 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1123 echo "configure:1124: checking for $ac_func" >&5
1124 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1125   echo $ac_n "(cached) $ac_c" 1>&6
1126 else
1127   cat > conftest.$ac_ext <<EOF
1128 #line 1129 "configure"
1129 #include "confdefs.h"
1130 /* System header to define __stub macros and hopefully few prototypes,
1131     which can conflict with char $ac_func(); below.  */
1132 #include <assert.h>
1133 /* Override any gcc2 internal prototype to avoid an error.  */
1134 /* We use char because int might match the return type of a gcc2
1135     builtin and then its argument prototype would still apply.  */
1136 char $ac_func();
1137
1138 int main() {
1139
1140 /* The GNU C library defines this for functions which it implements
1141     to always fail with ENOSYS.  Some functions are actually named
1142     something starting with __ and the normal name is an alias.  */
1143 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1144 choke me
1145 #else
1146 $ac_func();
1147 #endif
1148
1149 ; return 0; }
1150 EOF
1151 if { (eval echo configure:1152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1152   rm -rf conftest*
1153   eval "ac_cv_func_$ac_func=yes"
1154 else
1155   echo "configure: failed program was:" >&5
1156   cat conftest.$ac_ext >&5
1157   rm -rf conftest*
1158   eval "ac_cv_func_$ac_func=no"
1159 fi
1160 rm -f conftest*
1161 fi
1162
1163 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1164   echo "$ac_t""yes" 1>&6
1165     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1166   cat >> confdefs.h <<EOF
1167 #define $ac_tr_func 1
1168 EOF
1169  
1170 else
1171   echo "$ac_t""no" 1>&6
1172 fi
1173 done
1174
1175 ac_header_dirent=no
1176 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
1177 do
1178 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1179 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
1180 echo "configure:1181: checking for $ac_hdr that defines DIR" >&5
1181 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
1182   echo $ac_n "(cached) $ac_c" 1>&6
1183 else
1184   cat > conftest.$ac_ext <<EOF
1185 #line 1186 "configure"
1186 #include "confdefs.h"
1187 #include <sys/types.h>
1188 #include <$ac_hdr>
1189 int main() {
1190 DIR *dirp = 0;
1191 ; return 0; }
1192 EOF
1193 if { (eval echo configure:1194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1194   rm -rf conftest*
1195   eval "ac_cv_header_dirent_$ac_safe=yes"
1196 else
1197   echo "configure: failed program was:" >&5
1198   cat conftest.$ac_ext >&5
1199   rm -rf conftest*
1200   eval "ac_cv_header_dirent_$ac_safe=no"
1201 fi
1202 rm -f conftest*
1203 fi
1204 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
1205   echo "$ac_t""yes" 1>&6
1206     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1207   cat >> confdefs.h <<EOF
1208 #define $ac_tr_hdr 1
1209 EOF
1210  ac_header_dirent=$ac_hdr; break
1211 else
1212   echo "$ac_t""no" 1>&6
1213 fi
1214 done
1215 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
1216 if test $ac_header_dirent = dirent.h; then
1217 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
1218 echo "configure:1219: checking for opendir in -ldir" >&5
1219 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
1220 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1221   echo $ac_n "(cached) $ac_c" 1>&6
1222 else
1223   ac_save_LIBS="$LIBS"
1224 LIBS="-ldir  $LIBS"
1225 cat > conftest.$ac_ext <<EOF
1226 #line 1227 "configure"
1227 #include "confdefs.h"
1228 /* Override any gcc2 internal prototype to avoid an error.  */
1229 /* We use char because int might match the return type of a gcc2
1230     builtin and then its argument prototype would still apply.  */
1231 char opendir();
1232
1233 int main() {
1234 opendir()
1235 ; return 0; }
1236 EOF
1237 if { (eval echo configure:1238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1238   rm -rf conftest*
1239   eval "ac_cv_lib_$ac_lib_var=yes"
1240 else
1241   echo "configure: failed program was:" >&5
1242   cat conftest.$ac_ext >&5
1243   rm -rf conftest*
1244   eval "ac_cv_lib_$ac_lib_var=no"
1245 fi
1246 rm -f conftest*
1247 LIBS="$ac_save_LIBS"
1248
1249 fi
1250 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1251   echo "$ac_t""yes" 1>&6
1252   LIBS="$LIBS -ldir"
1253 else
1254   echo "$ac_t""no" 1>&6
1255 fi
1256
1257 else
1258 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
1259 echo "configure:1260: checking for opendir in -lx" >&5
1260 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
1261 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1262   echo $ac_n "(cached) $ac_c" 1>&6
1263 else
1264   ac_save_LIBS="$LIBS"
1265 LIBS="-lx  $LIBS"
1266 cat > conftest.$ac_ext <<EOF
1267 #line 1268 "configure"
1268 #include "confdefs.h"
1269 /* Override any gcc2 internal prototype to avoid an error.  */
1270 /* We use char because int might match the return type of a gcc2
1271     builtin and then its argument prototype would still apply.  */
1272 char opendir();
1273
1274 int main() {
1275 opendir()
1276 ; return 0; }
1277 EOF
1278 if { (eval echo configure:1279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1279   rm -rf conftest*
1280   eval "ac_cv_lib_$ac_lib_var=yes"
1281 else
1282   echo "configure: failed program was:" >&5
1283   cat conftest.$ac_ext >&5
1284   rm -rf conftest*
1285   eval "ac_cv_lib_$ac_lib_var=no"
1286 fi
1287 rm -f conftest*
1288 LIBS="$ac_save_LIBS"
1289
1290 fi
1291 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1292   echo "$ac_t""yes" 1>&6
1293   LIBS="$LIBS -lx"
1294 else
1295   echo "$ac_t""no" 1>&6
1296 fi
1297
1298 fi
1299
1300
1301
1302 case "${host}" in
1303 i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32 | *-*-windows)
1304   cat >> confdefs.h <<\EOF
1305 #define USE_BINARY_FOPEN 1
1306 EOF
1307  ;;
1308 esac
1309
1310 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
1311 echo "configure:1312: checking whether strstr must be declared" >&5
1312 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
1313   echo $ac_n "(cached) $ac_c" 1>&6
1314 else
1315   cat > conftest.$ac_ext <<EOF
1316 #line 1317 "configure"
1317 #include "confdefs.h"
1318
1319 #include <stdio.h>
1320 #ifdef HAVE_STRING_H
1321 #include <string.h>
1322 #else
1323 #ifdef HAVE_STRINGS_H
1324 #include <strings.h>
1325 #endif
1326 #endif
1327 #ifdef HAVE_STDLIB_H
1328 #include <stdlib.h>
1329 #endif
1330 #ifdef HAVE_UNISTD_H
1331 #include <unistd.h>
1332 #endif
1333 int main() {
1334 char *(*pfn) = (char *(*)) strstr
1335 ; return 0; }
1336 EOF
1337 if { (eval echo configure:1338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1338   rm -rf conftest*
1339   bfd_cv_decl_needed_strstr=no
1340 else
1341   echo "configure: failed program was:" >&5
1342   cat conftest.$ac_ext >&5
1343   rm -rf conftest*
1344   bfd_cv_decl_needed_strstr=yes
1345 fi
1346 rm -f conftest*
1347 fi
1348
1349 echo "$ac_t""$bfd_cv_decl_needed_strstr" 1>&6
1350 if test $bfd_cv_decl_needed_strstr = yes; then
1351   bfd_tr_decl=NEED_DECLARATION_`echo strstr | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1352   cat >> confdefs.h <<EOF
1353 #define $bfd_tr_decl 1
1354 EOF
1355
1356 fi
1357
1358 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
1359 echo "configure:1360: checking whether free must be declared" >&5
1360 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
1361   echo $ac_n "(cached) $ac_c" 1>&6
1362 else
1363   cat > conftest.$ac_ext <<EOF
1364 #line 1365 "configure"
1365 #include "confdefs.h"
1366
1367 #include <stdio.h>
1368 #ifdef HAVE_STRING_H
1369 #include <string.h>
1370 #else
1371 #ifdef HAVE_STRINGS_H
1372 #include <strings.h>
1373 #endif
1374 #endif
1375 #ifdef HAVE_STDLIB_H
1376 #include <stdlib.h>
1377 #endif
1378 #ifdef HAVE_UNISTD_H
1379 #include <unistd.h>
1380 #endif
1381 int main() {
1382 char *(*pfn) = (char *(*)) free
1383 ; return 0; }
1384 EOF
1385 if { (eval echo configure:1386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1386   rm -rf conftest*
1387   bfd_cv_decl_needed_free=no
1388 else
1389   echo "configure: failed program was:" >&5
1390   cat conftest.$ac_ext >&5
1391   rm -rf conftest*
1392   bfd_cv_decl_needed_free=yes
1393 fi
1394 rm -f conftest*
1395 fi
1396
1397 echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6
1398 if test $bfd_cv_decl_needed_free = yes; then
1399   bfd_tr_decl=NEED_DECLARATION_`echo free | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1400   cat >> confdefs.h <<EOF
1401 #define $bfd_tr_decl 1
1402 EOF
1403
1404 fi
1405
1406 echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
1407 echo "configure:1408: checking whether sbrk must be declared" >&5
1408 if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then
1409   echo $ac_n "(cached) $ac_c" 1>&6
1410 else
1411   cat > conftest.$ac_ext <<EOF
1412 #line 1413 "configure"
1413 #include "confdefs.h"
1414
1415 #include <stdio.h>
1416 #ifdef HAVE_STRING_H
1417 #include <string.h>
1418 #else
1419 #ifdef HAVE_STRINGS_H
1420 #include <strings.h>
1421 #endif
1422 #endif
1423 #ifdef HAVE_STDLIB_H
1424 #include <stdlib.h>
1425 #endif
1426 #ifdef HAVE_UNISTD_H
1427 #include <unistd.h>
1428 #endif
1429 int main() {
1430 char *(*pfn) = (char *(*)) sbrk
1431 ; return 0; }
1432 EOF
1433 if { (eval echo configure:1434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1434   rm -rf conftest*
1435   bfd_cv_decl_needed_sbrk=no
1436 else
1437   echo "configure: failed program was:" >&5
1438   cat conftest.$ac_ext >&5
1439   rm -rf conftest*
1440   bfd_cv_decl_needed_sbrk=yes
1441 fi
1442 rm -f conftest*
1443 fi
1444
1445 echo "$ac_t""$bfd_cv_decl_needed_sbrk" 1>&6
1446 if test $bfd_cv_decl_needed_sbrk = yes; then
1447   bfd_tr_decl=NEED_DECLARATION_`echo sbrk | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1448   cat >> confdefs.h <<EOF
1449 #define $bfd_tr_decl 1
1450 EOF
1451
1452 fi
1453
1454 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
1455 echo "configure:1456: checking whether getenv must be declared" >&5
1456 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
1457   echo $ac_n "(cached) $ac_c" 1>&6
1458 else
1459   cat > conftest.$ac_ext <<EOF
1460 #line 1461 "configure"
1461 #include "confdefs.h"
1462
1463 #include <stdio.h>
1464 #ifdef HAVE_STRING_H
1465 #include <string.h>
1466 #else
1467 #ifdef HAVE_STRINGS_H
1468 #include <strings.h>
1469 #endif
1470 #endif
1471 #ifdef HAVE_STDLIB_H
1472 #include <stdlib.h>
1473 #endif
1474 #ifdef HAVE_UNISTD_H
1475 #include <unistd.h>
1476 #endif
1477 int main() {
1478 char *(*pfn) = (char *(*)) getenv
1479 ; return 0; }
1480 EOF
1481 if { (eval echo configure:1482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1482   rm -rf conftest*
1483   bfd_cv_decl_needed_getenv=no
1484 else
1485   echo "configure: failed program was:" >&5
1486   cat conftest.$ac_ext >&5
1487   rm -rf conftest*
1488   bfd_cv_decl_needed_getenv=yes
1489 fi
1490 rm -f conftest*
1491 fi
1492
1493 echo "$ac_t""$bfd_cv_decl_needed_getenv" 1>&6
1494 if test $bfd_cv_decl_needed_getenv = yes; then
1495   bfd_tr_decl=NEED_DECLARATION_`echo getenv | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1496   cat >> confdefs.h <<EOF
1497 #define $bfd_tr_decl 1
1498 EOF
1499
1500 fi
1501
1502
1503 # target-specific stuff:
1504
1505 all_targets=
1506 EMUL=
1507 all_emuls=
1508 TDIRS=
1509
1510 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
1511 do
1512   if test "$targ_alias" = "all"; then
1513     all_targets=true
1514   else
1515     # Canonicalize the secondary target names.
1516     result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ_alias 2>/dev/null`
1517     if test -n "$result"; then
1518         targ=$result
1519     else
1520         targ=$targ_alias
1521     fi
1522
1523     . ${srcdir}/configure.tgt
1524
1525     if test "$targ" = "$target"; then
1526       EMUL=$targ_emul
1527     fi
1528
1529     for i in $targ_emul $targ_extra_emuls; do
1530         case " $all_emuls " in
1531         *" e${i}.o "*) ;;
1532         *)
1533           all_emuls="$all_emuls e${i}.o"
1534           eval result=\$tdir_$i
1535           test -z "$result" && result=$targ_alias
1536           TDIRS="$TDIRS\\
1537 tdir_$i=$result"
1538           ;;
1539         esac
1540     done
1541   fi
1542 done
1543
1544
1545
1546
1547 if test x${all_targets} = xtrue; then
1548   if test x${want64} = xtrue; then
1549     EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)'
1550   else
1551     EMULATION_OFILES='$(ALL_EMULATIONS)'
1552   fi
1553 else
1554   EMULATION_OFILES=$all_emuls
1555 fi
1556
1557
1558 trap '' 1 2 15
1559 cat > confcache <<\EOF
1560 # This file is a shell script that caches the results of configure
1561 # tests run on this system so they can be shared between configure
1562 # scripts and configure runs.  It is not useful on other systems.
1563 # If it contains results you don't want to keep, you may remove or edit it.
1564 #
1565 # By default, configure uses ./config.cache as the cache file,
1566 # creating it if it does not exist already.  You can give configure
1567 # the --cache-file=FILE option to use a different cache file; that is
1568 # what configure does when it calls configure scripts in
1569 # subdirectories, so they share the cache.
1570 # Giving --cache-file=/dev/null disables caching, for debugging configure.
1571 # config.status only pays attention to the cache file if you give it the
1572 # --recheck option to rerun configure.
1573 #
1574 EOF
1575 # The following way of writing the cache mishandles newlines in values,
1576 # but we know of no workaround that is simple, portable, and efficient.
1577 # So, don't put newlines in cache variables' values.
1578 # Ultrix sh set writes to stderr and can't be redirected directly,
1579 # and sets the high bit in the cache file unless we assign to the vars.
1580 (set) 2>&1 |
1581   case `(ac_space=' '; set) 2>&1` in
1582   *ac_space=\ *)
1583     # `set' does not quote correctly, so add quotes (double-quote substitution
1584     # turns \\\\ into \\, and sed turns \\ into \).
1585     sed -n \
1586       -e "s/'/'\\\\''/g" \
1587       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
1588     ;;
1589   *)
1590     # `set' quotes correctly as required by POSIX, so do not add quotes.
1591     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
1592     ;;
1593   esac >> confcache
1594 if cmp -s $cache_file confcache; then
1595   :
1596 else
1597   if test -w $cache_file; then
1598     echo "updating cache $cache_file"
1599     cat confcache > $cache_file
1600   else
1601     echo "not updating unwritable cache $cache_file"
1602   fi
1603 fi
1604 rm -f confcache
1605
1606 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
1607
1608 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1609 # Let make expand exec_prefix.
1610 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1611
1612 # Any assignment to VPATH causes Sun make to only execute
1613 # the first set of double-colon rules, so remove it if not needed.
1614 # If there is a colon in the path, we need to keep it.
1615 if test "x$srcdir" = x.; then
1616   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
1617 fi
1618
1619 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
1620
1621 DEFS=-DHAVE_CONFIG_H
1622
1623 # Without the "./", some shells look in PATH for config.status.
1624 : ${CONFIG_STATUS=./config.status}
1625
1626 echo creating $CONFIG_STATUS
1627 rm -f $CONFIG_STATUS
1628 cat > $CONFIG_STATUS <<EOF
1629 #! /bin/sh
1630 # Generated automatically by configure.
1631 # Run this file to recreate the current configuration.
1632 # This directory was configured as follows,
1633 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1634 #
1635 # $0 $ac_configure_args
1636 #
1637 # Compiler output produced by configure, useful for debugging
1638 # configure, is in ./config.log if it exists.
1639
1640 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
1641 for ac_option
1642 do
1643   case "\$ac_option" in
1644   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1645     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
1646     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
1647   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
1648     echo "$CONFIG_STATUS generated by autoconf version 2.12"
1649     exit 0 ;;
1650   -help | --help | --hel | --he | --h)
1651     echo "\$ac_cs_usage"; exit 0 ;;
1652   *) echo "\$ac_cs_usage"; exit 1 ;;
1653   esac
1654 done
1655
1656 ac_given_srcdir=$srcdir
1657 ac_given_INSTALL="$INSTALL"
1658
1659 trap 'rm -fr `echo "Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
1660 EOF
1661 cat >> $CONFIG_STATUS <<EOF
1662
1663 # Protect against being on the right side of a sed subst in config.status.
1664 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
1665  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
1666 $ac_vpsub
1667 $extrasub
1668 s%@CFLAGS@%$CFLAGS%g
1669 s%@CPPFLAGS@%$CPPFLAGS%g
1670 s%@CXXFLAGS@%$CXXFLAGS%g
1671 s%@DEFS@%$DEFS%g
1672 s%@LDFLAGS@%$LDFLAGS%g
1673 s%@LIBS@%$LIBS%g
1674 s%@exec_prefix@%$exec_prefix%g
1675 s%@prefix@%$prefix%g
1676 s%@program_transform_name@%$program_transform_name%g
1677 s%@bindir@%$bindir%g
1678 s%@sbindir@%$sbindir%g
1679 s%@libexecdir@%$libexecdir%g
1680 s%@datadir@%$datadir%g
1681 s%@sysconfdir@%$sysconfdir%g
1682 s%@sharedstatedir@%$sharedstatedir%g
1683 s%@localstatedir@%$localstatedir%g
1684 s%@libdir@%$libdir%g
1685 s%@includedir@%$includedir%g
1686 s%@oldincludedir@%$oldincludedir%g
1687 s%@infodir@%$infodir%g
1688 s%@mandir@%$mandir%g
1689 s%@host@%$host%g
1690 s%@host_alias@%$host_alias%g
1691 s%@host_cpu@%$host_cpu%g
1692 s%@host_vendor@%$host_vendor%g
1693 s%@host_os@%$host_os%g
1694 s%@target@%$target%g
1695 s%@target_alias@%$target_alias%g
1696 s%@target_cpu@%$target_cpu%g
1697 s%@target_vendor@%$target_vendor%g
1698 s%@target_os@%$target_os%g
1699 s%@build@%$build%g
1700 s%@build_alias@%$build_alias%g
1701 s%@build_cpu@%$build_cpu%g
1702 s%@build_vendor@%$build_vendor%g
1703 s%@build_os@%$build_os%g
1704 s%@CC@%$CC%g
1705 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
1706 s%@INSTALL_DATA@%$INSTALL_DATA%g
1707 s%@EXEEXT@%$EXEEXT%g
1708 s%@HLDFLAGS@%$HLDFLAGS%g
1709 s%@HLDENV@%$HLDENV%g
1710 s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g
1711 s%@HDEFINES@%$HDEFINES%g
1712 s%@HOSTING_CRT0@%$HOSTING_CRT0%g
1713 s%@HOSTING_LIBS@%$HOSTING_LIBS%g
1714 s%@NATIVE_LIB_DIRS@%$NATIVE_LIB_DIRS%g
1715 s%@BFDLIB@%$BFDLIB%g
1716 s%@CPP@%$CPP%g
1717 s%@EMUL@%$EMUL%g
1718 s%@TDIRS@%$TDIRS%g
1719 s%@EMULATION_OFILES@%$EMULATION_OFILES%g
1720
1721 CEOF
1722 EOF
1723
1724 cat >> $CONFIG_STATUS <<\EOF
1725
1726 # Split the substitutions into bite-sized pieces for seds with
1727 # small command number limits, like on Digital OSF/1 and HP-UX.
1728 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
1729 ac_file=1 # Number of current file.
1730 ac_beg=1 # First line for current file.
1731 ac_end=$ac_max_sed_cmds # Line after last line for current file.
1732 ac_more_lines=:
1733 ac_sed_cmds=""
1734 while $ac_more_lines; do
1735   if test $ac_beg -gt 1; then
1736     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
1737   else
1738     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
1739   fi
1740   if test ! -s conftest.s$ac_file; then
1741     ac_more_lines=false
1742     rm -f conftest.s$ac_file
1743   else
1744     if test -z "$ac_sed_cmds"; then
1745       ac_sed_cmds="sed -f conftest.s$ac_file"
1746     else
1747       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
1748     fi
1749     ac_file=`expr $ac_file + 1`
1750     ac_beg=$ac_end
1751     ac_end=`expr $ac_end + $ac_max_sed_cmds`
1752   fi
1753 done
1754 if test -z "$ac_sed_cmds"; then
1755   ac_sed_cmds=cat
1756 fi
1757 EOF
1758
1759 cat >> $CONFIG_STATUS <<EOF
1760
1761 CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
1762 EOF
1763 cat >> $CONFIG_STATUS <<\EOF
1764 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
1765   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
1766   case "$ac_file" in
1767   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
1768        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1769   *) ac_file_in="${ac_file}.in" ;;
1770   esac
1771
1772   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
1773
1774   # Remove last slash and all that follows it.  Not all systems have dirname.
1775   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
1776   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
1777     # The file is in a subdirectory.
1778     test ! -d "$ac_dir" && mkdir "$ac_dir"
1779     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
1780     # A "../" for each directory in $ac_dir_suffix.
1781     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
1782   else
1783     ac_dir_suffix= ac_dots=
1784   fi
1785
1786   case "$ac_given_srcdir" in
1787   .)  srcdir=.
1788       if test -z "$ac_dots"; then top_srcdir=.
1789       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
1790   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
1791   ?:*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
1792   *) # Relative path.
1793     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
1794     top_srcdir="$ac_dots$ac_given_srcdir" ;;
1795   esac
1796
1797   case "$ac_given_INSTALL" in
1798   [/$]*) INSTALL="$ac_given_INSTALL" ;;
1799   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
1800   esac
1801
1802   echo creating "$ac_file"
1803   rm -f "$ac_file"
1804   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
1805   case "$ac_file" in
1806   *Makefile*) ac_comsub="1i\\
1807 # $configure_input" ;;
1808   *) ac_comsub= ;;
1809   esac
1810
1811   ac_file_inputs=`echo $ac_file_in|sed -e "s%:% $ac_given_srcdir/%" -e "s%^%$ac_given_srcdir/%g"`
1812   sed -e "$ac_comsub
1813 s%@configure_input@%$configure_input%g
1814 s%@srcdir@%$srcdir%g
1815 s%@top_srcdir@%$top_srcdir%g
1816 s%@INSTALL@%$INSTALL%g
1817 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
1818 fi; done
1819 rm -f conftest.s*
1820
1821 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
1822 # NAME is the cpp macro being defined and VALUE is the value it is being given.
1823 #
1824 # ac_d sets the value in "#define NAME VALUE" lines.
1825 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
1826 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
1827 ac_dC='\3'
1828 ac_dD='%g'
1829 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
1830 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
1831 ac_uB='\([      ]\)%\1#\2define\3'
1832 ac_uC=' '
1833 ac_uD='\4%g'
1834 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
1835 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
1836 ac_eB='$%\1#\2define\3'
1837 ac_eC=' '
1838 ac_eD='%g'
1839
1840 if test "${CONFIG_HEADERS+set}" != set; then
1841 EOF
1842 cat >> $CONFIG_STATUS <<EOF
1843   CONFIG_HEADERS="config.h:config.in"
1844 EOF
1845 cat >> $CONFIG_STATUS <<\EOF
1846 fi
1847 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
1848   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
1849   case "$ac_file" in
1850   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
1851        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1852   *) ac_file_in="${ac_file}.in" ;;
1853   esac
1854
1855   echo creating $ac_file
1856
1857   rm -f conftest.frag conftest.in conftest.out
1858   ac_file_inputs=`echo $ac_file_in|sed -e "s%:% $ac_given_srcdir/%" -e "s%^%$ac_given_srcdir/%g"`
1859   cat $ac_file_inputs > conftest.in
1860
1861 EOF
1862
1863 # Transform confdefs.h into a sed script conftest.vals that substitutes
1864 # the proper values into config.h.in to produce config.h.  And first:
1865 # Protect against being on the right side of a sed subst in config.status.
1866 # Protect against being in an unquoted here document in config.status.
1867 rm -f conftest.vals
1868 cat > conftest.hdr <<\EOF
1869 s/[\\&%]/\\&/g
1870 s%[\\$`]%\\&%g
1871 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
1872 s%ac_d%ac_u%gp
1873 s%ac_u%ac_e%gp
1874 EOF
1875 sed -n -f conftest.hdr confdefs.h > conftest.vals
1876 rm -f conftest.hdr
1877
1878 # This sed command replaces #undef with comments.  This is necessary, for
1879 # example, in the case of _POSIX_SOURCE, which is predefined and required
1880 # on some systems where configure will not decide to define it.
1881 cat >> conftest.vals <<\EOF
1882 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
1883 EOF
1884
1885 # Break up conftest.vals because some shells have a limit on
1886 # the size of here documents, and old seds have small limits too.
1887
1888 rm -f conftest.tail
1889 while :
1890 do
1891   ac_lines=`grep -c . conftest.vals`
1892   # grep -c gives empty output for an empty file on some AIX systems.
1893   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
1894   # Write a limited-size here document to conftest.frag.
1895   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
1896   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
1897   echo 'CEOF
1898   sed -f conftest.frag conftest.in > conftest.out
1899   rm -f conftest.in
1900   mv conftest.out conftest.in
1901 ' >> $CONFIG_STATUS
1902   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
1903   rm -f conftest.vals
1904   mv conftest.tail conftest.vals
1905 done
1906 rm -f conftest.vals
1907
1908 cat >> $CONFIG_STATUS <<\EOF
1909   rm -f conftest.frag conftest.h
1910   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
1911   cat conftest.in >> conftest.h
1912   rm -f conftest.in
1913   if cmp -s $ac_file conftest.h 2>/dev/null; then
1914     echo "$ac_file is unchanged"
1915     rm -f conftest.h
1916   else
1917     # Remove last slash and all that follows it.  Not all systems have dirname.
1918       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
1919       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
1920       # The file is in a subdirectory.
1921       test ! -d "$ac_dir" && mkdir "$ac_dir"
1922     fi
1923     rm -f $ac_file
1924     mv conftest.h $ac_file
1925   fi
1926 fi; done
1927
1928 EOF
1929 cat >> $CONFIG_STATUS <<EOF
1930
1931 EOF
1932 cat >> $CONFIG_STATUS <<\EOF
1933 case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac
1934 exit 0
1935 EOF
1936 chmod +x $CONFIG_STATUS
1937 rm -fr confdefs* $ac_clean_files
1938 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
1939