Support for building as a shared library, based on patches from
[external/binutils.git] / bfd / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.7 
5 # Copyright (C) 1992, 1993, 1994 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-64-bit-bfd     64-bit support (on hosts with narrower word sizes)"
16 ac_help="$ac_help
17   --enable-targets        alternative target configurations"
18 ac_help="$ac_help
19   --enable-shared         build shared BFD library"
20 ac_help="$ac_help
21   --enable-commonbfdlib   build shared BFD/opcodes/libiberty library"
22 ac_help="$ac_help
23   --with-mmap             try using mmap for BFD input files if available"
24
25 # Initialize some variables set by options.
26 # The variables have the same names as the options, with
27 # dashes changed to underlines.
28 build=NONE
29 cache_file=./config.cache
30 exec_prefix=NONE
31 host=NONE
32 no_create=
33 nonopt=NONE
34 no_recursion=
35 prefix=NONE
36 program_prefix=NONE
37 program_suffix=NONE
38 program_transform_name=s,x,x,
39 silent=
40 site=
41 srcdir=
42 target=NONE
43 verbose=
44 x_includes=NONE
45 x_libraries=NONE
46 bindir='${exec_prefix}/bin'
47 sbindir='${exec_prefix}/sbin'
48 libexecdir='${exec_prefix}/libexec'
49 datadir='${prefix}/share'
50 sysconfdir='${prefix}/etc'
51 sharedstatedir='${prefix}/com'
52 localstatedir='${prefix}/var'
53 libdir='${exec_prefix}/lib'
54 includedir='${prefix}/include'
55 oldincludedir='/usr/include'
56 infodir='${prefix}/info'
57 mandir='${prefix}/man'
58
59 # Initialize some other variables.
60 subdirs=
61 MFLAGS= MAKEFLAGS=
62
63 ac_prev=
64 for ac_option
65 do
66
67   # If the previous option needs an argument, assign it.
68   if test -n "$ac_prev"; then
69     eval "$ac_prev=\$ac_option"
70     ac_prev=
71     continue
72   fi
73
74   case "$ac_option" in
75   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
76   *) ac_optarg= ;;
77   esac
78
79   # Accept the important Cygnus configure options, so we can diagnose typos.
80
81   case "$ac_option" in
82
83   -bindir | --bindir | --bindi | --bind | --bin | --bi)
84     ac_prev=bindir ;;
85   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
86     bindir="$ac_optarg" ;;
87
88   -build | --build | --buil | --bui | --bu)
89     ac_prev=build ;;
90   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
91     build="$ac_optarg" ;;
92
93   -cache-file | --cache-file | --cache-fil | --cache-fi \
94   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
95     ac_prev=cache_file ;;
96   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
97   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
98     cache_file="$ac_optarg" ;;
99
100   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
101     ac_prev=datadir ;;
102   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
103   | --da=*)
104     datadir="$ac_optarg" ;;
105
106   -disable-* | --disable-*)
107     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
108     # Reject names that are not valid shell variable names.
109     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
110       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
111     fi
112     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
113     eval "enable_${ac_feature}=no" ;;
114
115   -enable-* | --enable-*)
116     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
117     # Reject names that are not valid shell variable names.
118     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
119       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
120     fi
121     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
122     case "$ac_option" in
123       *=*) ;;
124       *) ac_optarg=yes ;;
125     esac
126     eval "enable_${ac_feature}='$ac_optarg'" ;;
127
128   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
129   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
130   | --exec | --exe | --ex)
131     ac_prev=exec_prefix ;;
132   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
133   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
134   | --exec=* | --exe=* | --ex=*)
135     exec_prefix="$ac_optarg" ;;
136
137   -gas | --gas | --ga | --g)
138     # Obsolete; use --with-gas.
139     with_gas=yes ;;
140
141   -help | --help | --hel | --he)
142     # Omit some internal or obsolete options to make the list less imposing.
143     # This message is too long to be a string in the A/UX 3.1 sh.
144     cat << EOF
145 Usage: configure [options] [host]
146 Options: [defaults in brackets after descriptions]
147 Configuration:
148   --cache-file=FILE       cache test results in FILE
149   --help                  print this message
150   --no-create             do not create output files
151   --quiet, --silent       do not print \`checking...' messages
152   --version               print the version of autoconf that created configure
153 Directory and file names:
154   --prefix=PREFIX         install architecture-independent files in PREFIX
155                           [$ac_default_prefix]
156   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
157                           [same as prefix]
158   --bindir=DIR            user executables in DIR [EPREFIX/bin]
159   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
160   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
161   --datadir=DIR           read-only architecture-independent data in DIR
162                           [PREFIX/share]
163   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
164   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
165                           [PREFIX/com]
166   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
167   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
168   --includedir=DIR        C header files in DIR [PREFIX/include]
169   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
170   --infodir=DIR           info documentation in DIR [PREFIX/info]
171   --mandir=DIR            man documentation in DIR [PREFIX/man]
172   --srcdir=DIR            find the sources in DIR [configure dir or ..]
173   --program-prefix=PREFIX prepend PREFIX to installed program names
174   --program-suffix=SUFFIX append SUFFIX to installed program names
175   --program-transform-name=PROGRAM
176                           run sed PROGRAM on installed program names
177 EOF
178     cat << EOF
179 Host type:
180   --build=BUILD           configure for building on BUILD [BUILD=HOST]
181   --host=HOST             configure for HOST [guessed]
182   --target=TARGET         configure for TARGET [TARGET=HOST]
183 Features and packages:
184   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
185   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
186   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
187   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
188   --x-includes=DIR        X include files are in DIR
189   --x-libraries=DIR       X library files are in DIR
190 EOF
191     if test -n "$ac_help"; then
192       echo "--enable and --with options recognized:$ac_help"
193     fi
194     exit 0 ;;
195
196   -host | --host | --hos | --ho)
197     ac_prev=host ;;
198   -host=* | --host=* | --hos=* | --ho=*)
199     host="$ac_optarg" ;;
200
201   -includedir | --includedir | --includedi | --included | --include \
202   | --includ | --inclu | --incl | --inc)
203     ac_prev=includedir ;;
204   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
205   | --includ=* | --inclu=* | --incl=* | --inc=*)
206     includedir="$ac_optarg" ;;
207
208   -infodir | --infodir | --infodi | --infod | --info | --inf)
209     ac_prev=infodir ;;
210   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
211     infodir="$ac_optarg" ;;
212
213   -libdir | --libdir | --libdi | --libd)
214     ac_prev=libdir ;;
215   -libdir=* | --libdir=* | --libdi=* | --libd=*)
216     libdir="$ac_optarg" ;;
217
218   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
219   | --libexe | --libex | --libe)
220     ac_prev=libexecdir ;;
221   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
222   | --libexe=* | --libex=* | --libe=*)
223     libexecdir="$ac_optarg" ;;
224
225   -localstatedir | --localstatedir | --localstatedi | --localstated \
226   | --localstate | --localstat | --localsta | --localst \
227   | --locals | --local | --loca | --loc | --lo)
228     ac_prev=localstatedir ;;
229   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
230   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
231   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
232     localstatedir="$ac_optarg" ;;
233
234   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
235     ac_prev=mandir ;;
236   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
237     mandir="$ac_optarg" ;;
238
239   -nfp | --nfp | --nf)
240     # Obsolete; use --without-fp.
241     with_fp=no ;;
242
243   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
244   | --no-cr | --no-c)
245     no_create=yes ;;
246
247   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
248   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
249     no_recursion=yes ;;
250
251   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
252   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
253   | --oldin | --oldi | --old | --ol | --o)
254     ac_prev=oldincludedir ;;
255   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
256   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
257   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
258     oldincludedir="$ac_optarg" ;;
259
260   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
261     ac_prev=prefix ;;
262   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
263     prefix="$ac_optarg" ;;
264
265   -program-prefix | --program-prefix | --program-prefi | --program-pref \
266   | --program-pre | --program-pr | --program-p)
267     ac_prev=program_prefix ;;
268   -program-prefix=* | --program-prefix=* | --program-prefi=* \
269   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
270     program_prefix="$ac_optarg" ;;
271
272   -program-suffix | --program-suffix | --program-suffi | --program-suff \
273   | --program-suf | --program-su | --program-s)
274     ac_prev=program_suffix ;;
275   -program-suffix=* | --program-suffix=* | --program-suffi=* \
276   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
277     program_suffix="$ac_optarg" ;;
278
279   -program-transform-name | --program-transform-name \
280   | --program-transform-nam | --program-transform-na \
281   | --program-transform-n | --program-transform- \
282   | --program-transform | --program-transfor \
283   | --program-transfo | --program-transf \
284   | --program-trans | --program-tran \
285   | --progr-tra | --program-tr | --program-t)
286     ac_prev=program_transform_name ;;
287   -program-transform-name=* | --program-transform-name=* \
288   | --program-transform-nam=* | --program-transform-na=* \
289   | --program-transform-n=* | --program-transform-=* \
290   | --program-transform=* | --program-transfor=* \
291   | --program-transfo=* | --program-transf=* \
292   | --program-trans=* | --program-tran=* \
293   | --progr-tra=* | --program-tr=* | --program-t=*)
294     program_transform_name="$ac_optarg" ;;
295
296   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
297   | -silent | --silent | --silen | --sile | --sil)
298     silent=yes ;;
299
300   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
301     ac_prev=sbindir ;;
302   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
303   | --sbi=* | --sb=*)
304     sbindir="$ac_optarg" ;;
305
306   -sharedstatedir | --sharedstatedir | --sharedstatedi \
307   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
308   | --sharedst | --shareds | --shared | --share | --shar \
309   | --sha | --sh)
310     ac_prev=sharedstatedir ;;
311   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
312   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
313   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
314   | --sha=* | --sh=*)
315     sharedstatedir="$ac_optarg" ;;
316
317   -site | --site | --sit)
318     ac_prev=site ;;
319   -site=* | --site=* | --sit=*)
320     site="$ac_optarg" ;;
321
322   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
323     ac_prev=srcdir ;;
324   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
325     srcdir="$ac_optarg" ;;
326
327   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
328   | --syscon | --sysco | --sysc | --sys | --sy)
329     ac_prev=sysconfdir ;;
330   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
331   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
332     sysconfdir="$ac_optarg" ;;
333
334   -target | --target | --targe | --targ | --tar | --ta | --t)
335     ac_prev=target ;;
336   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
337     target="$ac_optarg" ;;
338
339   -v | -verbose | --verbose | --verbos | --verbo | --verb)
340     verbose=yes ;;
341
342   -version | --version | --versio | --versi | --vers)
343     echo "configure generated by autoconf version 2.7"
344     exit 0 ;;
345
346   -with-* | --with-*)
347     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
348     # Reject names that are not valid shell variable names.
349     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
350       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
351     fi
352     ac_package=`echo $ac_package| sed 's/-/_/g'`
353     case "$ac_option" in
354       *=*) ;;
355       *) ac_optarg=yes ;;
356     esac
357     eval "with_${ac_package}='$ac_optarg'" ;;
358
359   -without-* | --without-*)
360     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
361     # Reject names that are not valid shell variable names.
362     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
363       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
364     fi
365     ac_package=`echo $ac_package| sed 's/-/_/g'`
366     eval "with_${ac_package}=no" ;;
367
368   --x)
369     # Obsolete; use --with-x.
370     with_x=yes ;;
371
372   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
373   | --x-incl | --x-inc | --x-in | --x-i)
374     ac_prev=x_includes ;;
375   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
376   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
377     x_includes="$ac_optarg" ;;
378
379   -x-libraries | --x-libraries | --x-librarie | --x-librari \
380   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
381     ac_prev=x_libraries ;;
382   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
383   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
384     x_libraries="$ac_optarg" ;;
385
386   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
387     ;;
388
389   *)
390     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
391       echo "configure: warning: $ac_option: invalid host type" 1>&2
392     fi
393     if test "x$nonopt" != xNONE; then
394       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
395     fi
396     nonopt="$ac_option"
397     ;;
398
399   esac
400 done
401
402 if test -n "$ac_prev"; then
403   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
404 fi
405
406 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
407
408 # File descriptor usage:
409 # 0 standard input
410 # 1 file creation
411 # 2 errors and warnings
412 # 3 some systems may open it to /dev/tty
413 # 4 used on the Kubota Titan
414 # 6 checking for... messages and results
415 # 5 compiler messages saved in config.log
416 if test "$silent" = yes; then
417   exec 6>/dev/null
418 else
419   exec 6>&1
420 fi
421 exec 5>./config.log
422
423 echo "\
424 This file contains any messages produced by compilers while
425 running configure, to aid debugging if configure makes a mistake.
426 " 1>&5
427
428 # Strip out --no-create and --no-recursion so they do not pile up.
429 # Also quote any args containing shell metacharacters.
430 ac_configure_args=
431 for ac_arg
432 do
433   case "$ac_arg" in
434   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
435   | --no-cr | --no-c) ;;
436   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
437   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
438   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
439   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
440   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
441   esac
442 done
443
444 # NLS nuisances.
445 # Only set LANG and LC_ALL to C if already set.
446 # These must not be set unconditionally because not all systems understand
447 # e.g. LANG=C (notably SCO).
448 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
449 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
450
451 # confdefs.h avoids OS command line length limits that DEFS can exceed.
452 rm -rf conftest* confdefs.h
453 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
454 echo > confdefs.h
455
456 # A filename unique to this package, relative to the directory that
457 # configure is in, which we can look for to find out if srcdir is correct.
458 ac_unique_file=libbfd.c
459
460 # Find the source files, if location was not specified.
461 if test -z "$srcdir"; then
462   ac_srcdir_defaulted=yes
463   # Try the directory containing this script, then its parent.
464   ac_prog=$0
465   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
466   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
467   srcdir=$ac_confdir
468   if test ! -r $srcdir/$ac_unique_file; then
469     srcdir=..
470   fi
471 else
472   ac_srcdir_defaulted=no
473 fi
474 if test ! -r $srcdir/$ac_unique_file; then
475   if test "$ac_srcdir_defaulted" = yes; then
476     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
477   else
478     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
479   fi
480 fi
481 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
482
483 # Prefer explicitly selected file to automatically selected ones.
484 if test -z "$CONFIG_SITE"; then
485   if test "x$prefix" != xNONE; then
486     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
487   else
488     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
489   fi
490 fi
491 for ac_site_file in $CONFIG_SITE; do
492   if test -r "$ac_site_file"; then
493     echo "loading site script $ac_site_file"
494     . "$ac_site_file"
495   fi
496 done
497
498 if test -r "$cache_file"; then
499   echo "loading cache $cache_file"
500   . $cache_file
501 else
502   echo "creating cache $cache_file"
503   > $cache_file
504 fi
505
506 ac_ext=c
507 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
508 ac_cpp='echo $CPP $CPPFLAGS 1>&5;
509 $CPP $CPPFLAGS'
510 ac_compile='echo ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5;
511 ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5'
512 ac_link='echo ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5;
513 ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5'
514
515 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
516   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
517   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
518     ac_n= ac_c='
519 ' ac_t='        '
520   else
521     ac_n=-n ac_c= ac_t=
522   fi
523 else
524   ac_n= ac_c='\c' ac_t=
525 fi
526
527
528
529 # Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given.
530 if test "${enable_64_bit_bfd+set}" = set; then
531   enableval="$enable_64_bit_bfd"
532   case "${enableval}" in
533   yes)  want64=true  ;;
534   no)   want64=false ;;
535   *)    { echo "configure: error: bad value ${enableval} for 64-bit-bfd option" 1>&2; exit 1; } ;;
536 esac
537 else
538   want64=false
539 fi
540 # Check whether --enable-targets or --disable-targets was given.
541 if test "${enable_targets+set}" = set; then
542   enableval="$enable_targets"
543   case "${enableval}" in
544   yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
545             ;;
546   no)       enable_targets= ;;
547   *)        enable_targets=$enableval ;;
548 esac
549 fi
550 # Check whether --enable-shared or --disable-shared was given.
551 if test "${enable_shared+set}" = set; then
552   enableval="$enable_shared"
553   case "${enableval}" in
554   yes) shared=true ;;
555   no)  shared=false ;;
556   *)   { echo "configure: error: bad value ${enableval} for BFD shared option" 1>&2; exit 1; } ;;
557 esac
558 fi
559 # Check whether --enable-commonbfdlib or --disable-commonbfdlib was given.
560 if test "${enable_commonbfdlib+set}" = set; then
561   enableval="$enable_commonbfdlib"
562   case "${enableval}" in
563   yes) commonbfdlib=true ;;
564   no)  commonbfdlib=false ;;
565   *)   { echo "configure: error: bad value ${enableval} for BFD commonbfdlib option" 1>&2; exit 1; } ;;
566 esac
567 fi
568 # Check whether --with-mmap or --without-mmap was given.
569 if test "${with_mmap+set}" = set; then
570   withval="$with_mmap"
571   case "${withval}" in
572   yes)  want_mmap=true ;;
573   no)   want_mmap=false ;;
574   *)    { echo "configure: error: bad value ${withval} for BFD with-mmap option" 1>&2; exit 1; } ;;
575 esac
576 else
577   want_mmap=false
578 fi
579
580
581
582 ac_aux_dir=
583 for ac_dir in `cd $srcdir/..;pwd` $srcdir/`cd $srcdir/..;pwd`; do
584   if test -f $ac_dir/install-sh; then
585     ac_aux_dir=$ac_dir
586     ac_install_sh="$ac_aux_dir/install-sh -c"
587     break
588   elif test -f $ac_dir/install.sh; then
589     ac_aux_dir=$ac_dir
590     ac_install_sh="$ac_aux_dir/install.sh -c"
591     break
592   fi
593 done
594 if test -z "$ac_aux_dir"; then
595   { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir/..;pwd` $srcdir/`cd $srcdir/..;pwd`" 1>&2; exit 1; }
596 fi
597 ac_config_guess=$ac_aux_dir/config.guess
598 ac_config_sub=$ac_aux_dir/config.sub
599 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
600
601
602 # Do some error checking and defaulting for the host and target type.
603 # The inputs are:
604 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
605 #
606 # The rules are:
607 # 1. You are not allowed to specify --host, --target, and nonopt at the
608 #    same time.
609 # 2. Host defaults to nonopt.
610 # 3. If nonopt is not specified, then host defaults to the current host,
611 #    as determined by config.guess.
612 # 4. Target and build default to nonopt.
613 # 5. If nonopt is not specified, then target and build default to host.
614
615 # The aliases save the names the user supplied, while $host etc.
616 # will get canonicalized.
617 case $host---$target---$nonopt in
618 NONE---*---* | *---NONE---* | *---*---NONE) ;;
619 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
620 esac
621
622
623 # Make sure we can run config.sub.
624 if $ac_config_sub sun4 >/dev/null 2>&1; then :
625 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
626 fi
627
628 echo $ac_n "checking host system type""... $ac_c" 1>&6
629
630 host_alias=$host
631 case "$host_alias" in
632 NONE)
633   case $nonopt in
634   NONE)
635     if host_alias=`$ac_config_guess`; then :
636     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
637     fi ;;
638   *) host_alias=$nonopt ;;
639   esac ;;
640 esac
641
642 host=`$ac_config_sub $host_alias`
643 host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
644 host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
645 host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
646 echo "$ac_t""$host" 1>&6
647
648 echo $ac_n "checking target system type""... $ac_c" 1>&6
649
650 target_alias=$target
651 case "$target_alias" in
652 NONE)
653   case $nonopt in
654   NONE) target_alias=$host_alias ;;
655   *) target_alias=$nonopt ;;
656   esac ;;
657 esac
658
659 target=`$ac_config_sub $target_alias`
660 target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
661 target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
662 target_os=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
663 echo "$ac_t""$target" 1>&6
664
665 echo $ac_n "checking build system type""... $ac_c" 1>&6
666
667 build_alias=$build
668 case "$build_alias" in
669 NONE)
670   case $nonopt in
671   NONE) build_alias=$host_alias ;;
672   *) build_alias=$nonopt ;;
673   esac ;;
674 esac
675
676 build=`$ac_config_sub $build_alias`
677 build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
678 build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
679 build_os=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
680 echo "$ac_t""$build" 1>&6
681
682 test "$host_alias" != "$target_alias" &&
683   test "$program_prefix$program_suffix$program_transform_name" = \
684     NONENONEs,x,x, &&
685   program_prefix=${target_alias}-
686
687 if test -z "$target" ; then
688     { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
689 fi
690 if test "$program_transform_name" = s,x,x,; then
691   program_transform_name=
692 else
693   # Double any \ or $.  echo might interpret backslashes.
694   cat <<\EOF_SED > conftestsed
695 s,\\,\\\\,g; s,\$,$$,g
696 EOF_SED
697   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
698   rm -f conftestsed
699 fi
700 test "$program_prefix" != NONE &&
701   program_transform_name="s,^,${program_prefix},; $program_transform_name"
702 # Use a double $ so make ignores it.
703 test "$program_suffix" != NONE &&
704   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
705
706 # sed with no file args requires a program.
707 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
708
709
710 host64=false
711 target64=false
712
713 # host stuff:
714
715 ALLLIBS='$(TARGETLIB)'
716 PICFLAG=
717 SHLIB=
718 SHLINK=
719 if test "${shared}" = "true"; then
720   PICFLAG=-fpic
721   if test "${commonbfdlib}" = "true"; then
722     ALLLIBS='$(TARGETLIB)'
723   else
724     ALLLIBS='$(TARGETLIB) $(SHLIB) $(SHLINK)'
725     SHLIB=libbfd.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/VERSION`
726     SHLINK=libbfd.so
727   fi
728 fi
729
730 # Permit host specific settings.
731 . ${srcdir}/configure.host
732
733 # Extract the first word of "gcc", so it can be a program name with args.
734 set dummy gcc; ac_word=$2
735 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
736 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
737   echo $ac_n "(cached) $ac_c" 1>&6
738 else
739   if test -n "$CC"; then
740   ac_cv_prog_CC="$CC" # Let the user override the test.
741 else
742   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
743   for ac_dir in $PATH; do
744     test -z "$ac_dir" && ac_dir=.
745     if test -f $ac_dir/$ac_word; then
746       ac_cv_prog_CC="gcc"
747       break
748     fi
749   done
750   IFS="$ac_save_ifs"
751   test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc"
752 fi
753 fi
754 CC="$ac_cv_prog_CC"
755 if test -n "$CC"; then
756   echo "$ac_t""$CC" 1>&6
757 else
758   echo "$ac_t""no" 1>&6
759 fi
760
761
762 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
763 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
764   echo $ac_n "(cached) $ac_c" 1>&6
765 else
766   cat > conftest.c <<EOF
767 #ifdef __GNUC__
768   yes;
769 #endif
770 EOF
771 if ${CC-cc} -E conftest.c 2>&5 | egrep yes >/dev/null 2>&1; then
772   ac_cv_prog_gcc=yes
773 else
774   ac_cv_prog_gcc=no
775 fi
776 fi
777
778 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
779 if test $ac_cv_prog_gcc = yes; then
780   GCC=yes
781   if test "${CFLAGS+set}" != set; then
782     echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
783 if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then
784   echo $ac_n "(cached) $ac_c" 1>&6
785 else
786   echo 'void f(){}' > conftest.c
787 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
788   ac_cv_prog_gcc_g=yes
789 else
790   ac_cv_prog_gcc_g=no
791 fi
792 rm -f conftest*
793
794 fi
795
796 echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
797     if test $ac_cv_prog_gcc_g = yes; then
798       CFLAGS="-g -O"
799     else
800       CFLAGS="-O"
801     fi
802   fi
803 else
804   GCC=
805   test "${CFLAGS+set}" = set || CFLAGS="-g"
806 fi
807
808
809
810 # Extract the first word of "ar", so it can be a program name with args.
811 set dummy ar; ac_word=$2
812 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
813 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
814   echo $ac_n "(cached) $ac_c" 1>&6
815 else
816   if test -n "$AR"; then
817   ac_cv_prog_AR="$AR" # Let the user override the test.
818 else
819   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
820   for ac_dir in $PATH; do
821     test -z "$ac_dir" && ac_dir=.
822     if test -f $ac_dir/$ac_word; then
823       ac_cv_prog_AR="ar"
824       break
825     fi
826   done
827   IFS="$ac_save_ifs"
828   test -z "$ac_cv_prog_AR" && ac_cv_prog_AR=":"
829 fi
830 fi
831 AR="$ac_cv_prog_AR"
832 if test -n "$AR"; then
833   echo "$ac_t""$AR" 1>&6
834 else
835   echo "$ac_t""no" 1>&6
836 fi
837
838 # Extract the first word of "ranlib", so it can be a program name with args.
839 set dummy ranlib; ac_word=$2
840 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
841 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
842   echo $ac_n "(cached) $ac_c" 1>&6
843 else
844   if test -n "$RANLIB"; then
845   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
846 else
847   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
848   for ac_dir in $PATH; do
849     test -z "$ac_dir" && ac_dir=.
850     if test -f $ac_dir/$ac_word; then
851       ac_cv_prog_RANLIB="ranlib"
852       break
853     fi
854   done
855   IFS="$ac_save_ifs"
856   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
857 fi
858 fi
859 RANLIB="$ac_cv_prog_RANLIB"
860 if test -n "$RANLIB"; then
861   echo "$ac_t""$RANLIB" 1>&6
862 else
863   echo "$ac_t""no" 1>&6
864 fi
865
866 # Find a good install program.  We prefer a C program (faster),
867 # so one script is as good as another.  But avoid the broken or
868 # incompatible versions:
869 # SysV /etc/install, /usr/sbin/install
870 # SunOS /usr/etc/install
871 # IRIX /sbin/install
872 # AIX /bin/install
873 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
874 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
875 # ./install, which can be erroneously created by make from ./install.sh.
876 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
877 if test -z "$INSTALL"; then
878 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
879   echo $ac_n "(cached) $ac_c" 1>&6
880 else
881     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
882   for ac_dir in $PATH; do
883     # Account for people who put trailing slashes in PATH elements.
884     case "$ac_dir/" in
885     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
886     *)
887       # OSF1 and SCO ODT 3.0 have their own names for install.
888       for ac_prog in ginstall installbsd scoinst install; do
889         if test -f $ac_dir/$ac_prog; then
890           if test $ac_prog = install &&
891             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
892             # AIX install.  It has an incompatible calling convention.
893             # OSF/1 installbsd also uses dspmsg, but is usable.
894             :
895           else
896             ac_cv_path_install="$ac_dir/$ac_prog -c"
897             break 2
898           fi
899         fi
900       done
901       ;;
902     esac
903   done
904   IFS="$ac_save_ifs"
905
906 fi
907   if test "${ac_cv_path_install+set}" = set; then
908     INSTALL="$ac_cv_path_install"
909   else
910     # As a last resort, use the slow shell script.  We don't cache a
911     # path for INSTALL within a source directory, because that will
912     # break other packages using the cache if that directory is
913     # removed, or if the path is relative.
914     INSTALL="$ac_install_sh"
915   fi
916 fi
917 echo "$ac_t""$INSTALL" 1>&6
918
919 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
920 # It thinks the first close brace ends the variable substitution.
921 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
922
923 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
924
925
926 if test "${shared}" = "true"; then
927   if test "${GCC}" != "yes" && test "${shared_non_gcc}" != "yes"; then
928     echo "configure: warning: BFD --enable-shared only supported when using gcc" 1>&2
929     shared=false
930     PICFLAG=
931     SHLIB=
932   fi
933 fi
934
935
936
937
938
939
940 if test "${commonbfdlib}" = "true"; then
941   COMMON_SHLIB=yes
942   PICLIST=piclist
943 else
944   COMMON_SHLIB=
945   PICLIST=
946 fi
947
948
949
950
951 HOST_64BIT_LONG=0
952 if test "x${HOST_64BIT_TYPE}" = "xlong"; then
953   HOST_64BIT_LONG=1
954 fi
955
956
957 # If we cannot run a trivial program, we must be cross compiling.
958 echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
959 if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
960   echo $ac_n "(cached) $ac_c" 1>&6
961 else
962   if test "$cross_compiling" = yes; then
963   ac_cv_c_cross=yes
964 else
965 cat > conftest.$ac_ext <<EOF
966 #line 967 "configure"
967 #include "confdefs.h"
968 main(){return(0);}
969 EOF
970 eval $ac_link
971 if test -s conftest && (./conftest; exit) 2>/dev/null; then
972   ac_cv_c_cross=no
973 else
974   ac_cv_c_cross=yes
975 fi
976 fi
977 rm -fr conftest*
978 fi
979
980 echo "$ac_t""$ac_cv_c_cross" 1>&6
981 cross_compiling=$ac_cv_c_cross
982
983 # Put a plausible default for CC_FOR_BUILD in Makefile.
984 if test -z "$CC_FOR_BUILD"; then
985   if test "x$cross_compiling" = "xno"; then
986     CC_FOR_BUILD='$(CC)'
987   else
988     CC_FOR_BUILD=gcc
989   fi
990 fi
991
992
993 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
994 # On Suns, sometimes $CPP names a directory.
995 if test -n "$CPP" && test -d "$CPP"; then
996   CPP=
997 fi
998 if test -z "$CPP"; then
999 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1000   echo $ac_n "(cached) $ac_c" 1>&6
1001 else
1002     # This must be in double quotes, not single quotes, because CPP may get
1003   # substituted into the Makefile and "${CC-cc}" will confuse make.
1004   CPP="${CC-cc} -E"
1005   # On the NeXT, cc -E runs the code through the compiler's parser,
1006   # not just through cpp.
1007   cat > conftest.$ac_ext <<EOF
1008 #line 1009 "configure"
1009 #include "confdefs.h"
1010 #include <assert.h>
1011 Syntax Error
1012 EOF
1013 eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1014 ac_err=`grep -v '^ *+' conftest.out`
1015 if test -z "$ac_err"; then
1016   :
1017 else
1018   echo "$ac_err" >&5
1019   rm -rf conftest*
1020   CPP="${CC-cc} -E -traditional-cpp"
1021   cat > conftest.$ac_ext <<EOF
1022 #line 1023 "configure"
1023 #include "confdefs.h"
1024 #include <assert.h>
1025 Syntax Error
1026 EOF
1027 eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1028 ac_err=`grep -v '^ *+' conftest.out`
1029 if test -z "$ac_err"; then
1030   :
1031 else
1032   echo "$ac_err" >&5
1033   rm -rf conftest*
1034   CPP=/lib/cpp
1035 fi
1036 rm -f conftest*
1037 fi
1038 rm -f conftest*
1039   ac_cv_prog_CPP="$CPP"
1040 fi
1041   CPP="$ac_cv_prog_CPP"
1042 else
1043   ac_cv_prog_CPP="$CPP"
1044 fi
1045 echo "$ac_t""$CPP" 1>&6
1046
1047 for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h
1048 do
1049 ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
1050 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1051 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1052   echo $ac_n "(cached) $ac_c" 1>&6
1053 else
1054   cat > conftest.$ac_ext <<EOF
1055 #line 1056 "configure"
1056 #include "confdefs.h"
1057 #include <$ac_hdr>
1058 EOF
1059 eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1060 ac_err=`grep -v '^ *+' conftest.out`
1061 if test -z "$ac_err"; then
1062   rm -rf conftest*
1063   eval "ac_cv_header_$ac_safe=yes"
1064 else
1065   echo "$ac_err" >&5
1066   rm -rf conftest*
1067   eval "ac_cv_header_$ac_safe=no"
1068 fi
1069 rm -f conftest*
1070 fi
1071 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1072   echo "$ac_t""yes" 1>&6
1073     ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
1074   cat >> confdefs.h <<EOF
1075 #define $ac_tr_hdr 1
1076 EOF
1077  
1078 else
1079   echo "$ac_t""no" 1>&6
1080 fi
1081 done
1082
1083 for ac_hdr in fcntl.h sys/file.h
1084 do
1085 ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
1086 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1087 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1088   echo $ac_n "(cached) $ac_c" 1>&6
1089 else
1090   cat > conftest.$ac_ext <<EOF
1091 #line 1092 "configure"
1092 #include "confdefs.h"
1093 #include <$ac_hdr>
1094 EOF
1095 eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1096 ac_err=`grep -v '^ *+' conftest.out`
1097 if test -z "$ac_err"; then
1098   rm -rf conftest*
1099   eval "ac_cv_header_$ac_safe=yes"
1100 else
1101   echo "$ac_err" >&5
1102   rm -rf conftest*
1103   eval "ac_cv_header_$ac_safe=no"
1104 fi
1105 rm -f conftest*
1106 fi
1107 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1108   echo "$ac_t""yes" 1>&6
1109     ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
1110   cat >> confdefs.h <<EOF
1111 #define $ac_tr_hdr 1
1112 EOF
1113  
1114 else
1115   echo "$ac_t""no" 1>&6
1116 fi
1117 done
1118
1119 for ac_func in fcntl getpagesize
1120 do
1121 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1122 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1123   echo $ac_n "(cached) $ac_c" 1>&6
1124 else
1125   cat > conftest.$ac_ext <<EOF
1126 #line 1127 "configure"
1127 #include "confdefs.h"
1128 /* System header to define __stub macros and hopefully few prototypes,
1129     which can conflict with char $ac_func(); below.  */
1130 #include <assert.h>
1131 /* Override any gcc2 internal prototype to avoid an error.  */
1132 char $ac_func();
1133
1134 int main() { return 0; }
1135 int t() {
1136
1137 /* The GNU C library defines this for functions which it implements
1138     to always fail with ENOSYS.  Some functions are actually named
1139     something starting with __ and the normal name is an alias.  */
1140 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1141 choke me
1142 #else
1143 $ac_func();
1144 #endif
1145
1146 ; return 0; }
1147 EOF
1148 if eval $ac_link; then
1149   rm -rf conftest*
1150   eval "ac_cv_func_$ac_func=yes"
1151 else
1152   rm -rf conftest*
1153   eval "ac_cv_func_$ac_func=no"
1154 fi
1155 rm -f conftest*
1156
1157 fi
1158 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1159   echo "$ac_t""yes" 1>&6
1160     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1161   cat >> confdefs.h <<EOF
1162 #define $ac_tr_func 1
1163 EOF
1164  
1165 else
1166   echo "$ac_t""no" 1>&6
1167 fi
1168 done
1169
1170
1171
1172 case "${host}" in
1173 i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32)
1174   cat >> confdefs.h <<\EOF
1175 #define USE_BINARY_FOPEN 1
1176 EOF
1177  ;;
1178 esac
1179
1180 echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
1181 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+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
1188 #include <stdio.h>
1189 #ifdef HAVE_STDLIB_H
1190 #include <stdlib.h>
1191 #endif
1192 #ifdef HAVE_UNISTD_H
1193 #include <unistd.h>
1194 #endif
1195 int main() { return 0; }
1196 int t() {
1197 char *(*pfn) = (char *(*)) malloc
1198 ; return 0; }
1199 EOF
1200 if eval $ac_compile; then
1201   rm -rf conftest*
1202   bfd_cv_decl_needed_malloc=no
1203 else
1204   rm -rf conftest*
1205   bfd_cv_decl_needed_malloc=yes
1206 fi
1207 rm -f conftest*
1208
1209 fi
1210
1211 echo "$ac_t""$bfd_cv_decl_needed_malloc" 1>&6
1212 if test $bfd_cv_decl_needed_malloc = yes; then
1213   bfd_tr_decl=NEED_DECLARATION_`echo malloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1214   cat >> confdefs.h <<EOF
1215 #define $bfd_tr_decl 1
1216 EOF
1217
1218 fi
1219
1220 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
1221 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
1222   echo $ac_n "(cached) $ac_c" 1>&6
1223 else
1224   cat > conftest.$ac_ext <<EOF
1225 #line 1226 "configure"
1226 #include "confdefs.h"
1227
1228 #include <stdio.h>
1229 #ifdef HAVE_STDLIB_H
1230 #include <stdlib.h>
1231 #endif
1232 #ifdef HAVE_UNISTD_H
1233 #include <unistd.h>
1234 #endif
1235 int main() { return 0; }
1236 int t() {
1237 char *(*pfn) = (char *(*)) free
1238 ; return 0; }
1239 EOF
1240 if eval $ac_compile; then
1241   rm -rf conftest*
1242   bfd_cv_decl_needed_free=no
1243 else
1244   rm -rf conftest*
1245   bfd_cv_decl_needed_free=yes
1246 fi
1247 rm -f conftest*
1248
1249 fi
1250
1251 echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6
1252 if test $bfd_cv_decl_needed_free = yes; then
1253   bfd_tr_decl=NEED_DECLARATION_`echo free | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1254   cat >> confdefs.h <<EOF
1255 #define $bfd_tr_decl 1
1256 EOF
1257
1258 fi
1259
1260
1261 # If we are configured native, pick a core file support file.
1262 COREFILE=
1263 COREFLAG=
1264 if test "${target}" = "${host}"; then
1265   case "${host}" in
1266   alpha*-*-linux*)
1267         COREFILE=trad-core.o
1268         cat >> confdefs.h <<\EOF
1269 #define TRAD_HEADER "hosts/alphalinux.h"
1270 EOF
1271
1272         ;;
1273   alpha*-*-*)           COREFILE=osf-core.o ;;
1274   arm-*-riscix)         COREFILE=trad-core.o ;;
1275   hppa*-*-hpux*)        COREFILE=hpux-core.o ;;
1276   hppa*-*-hiux*)        COREFILE=hpux-core.o ;;
1277   hppa*-*-bsd*)         COREFILE="hpux-core.o hppabsd-core.o"
1278                         COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
1279   i[345]86-sequent-bsd*)
1280         COREFILE=trad-core.o;
1281         cat >> confdefs.h <<\EOF
1282 #define TRAD_HEADER "hosts/symmetry.h"
1283 EOF
1284
1285         ;;
1286   i[345]86-sequent-sysv4*) ;;
1287   i[345]86-sequent-sysv*)
1288         COREFILE=trad-core.o
1289         cat >> confdefs.h <<\EOF
1290 #define TRAD_HEADER "hosts/symmetry.h"
1291 EOF
1292
1293         ;;
1294   i[345]86-*-bsd* | i[345]86-*-freebsd*)
1295         COREFILE=trad-core.o
1296         cat >> confdefs.h <<\EOF
1297 #define TRAD_HEADER "hosts/i386bsd.h"
1298 EOF
1299
1300         ;;
1301   i[345]86-*-netbsd*)
1302         COREFILE=trad-core.o
1303         cat >> confdefs.h <<\EOF
1304 #define TRAD_HEADER "hosts/i386nbsd.h"
1305 EOF
1306
1307         ;;
1308   i[345]86-esix-sysv3*)
1309         COREFILE=trad-core.o
1310         cat >> confdefs.h <<\EOF
1311 #define TRAD_HEADER "hosts/esix.h"
1312 EOF
1313
1314         ;;
1315   i[345]86-*-sco* | i[345]86-*-isc*)
1316         COREFILE=trad-core.o
1317         cat >> confdefs.h <<\EOF
1318 #define TRAD_HEADER "hosts/i386sco.h"
1319 EOF
1320
1321         ;;
1322   i[345]86-*-mach3*)
1323         COREFILE=trad-core.o
1324         cat >> confdefs.h <<\EOF
1325 #define TRAD_HEADER "hosts/i386mach3.h"
1326 EOF
1327
1328         ;;
1329   i[345]86-*-linux*)
1330         COREFILE=trad-core.o
1331         cat >> confdefs.h <<\EOF
1332 #define TRAD_HEADER "hosts/i386linux.h"
1333 EOF
1334
1335         ;;
1336   i[345]86-*-isc*)      COREFILE=trad-core.o ;;
1337   i[345]86-*-aix*)      COREFILE=aix386-core.o ;;
1338   i860-*-mach3* | i860-*-osf1*)
1339         COREFILE=trad-core.o
1340         cat >> confdefs.h <<\EOF
1341 #define TRAD_HEADER "hosts/i860mach3.h"
1342 EOF
1343
1344         ;;
1345   mips-dec-bsd*)
1346         COREFILE=trad-core.o
1347         cat >> confdefs.h <<\EOF
1348 #define TRAD_HEADER "hosts/mipsbsd.h"
1349 EOF
1350
1351         ;;
1352   mips-dec-mach3*)
1353         COREFILE=trad-core.o
1354         cat >> confdefs.h <<\EOF
1355 #define TRAD_HEADER "hosts/mipsmach3.h"
1356 EOF
1357
1358         ;;
1359   mips-*-netbsd*)
1360         COREFILE=trad-core.o
1361         cat >> confdefs.h <<\EOF
1362 #define TRAD_HEADER "hosts/mipsnbsd.h"
1363 EOF
1364
1365         ;;
1366   mips-dec-*)
1367         COREFILE=trad-core.o
1368         cat >> confdefs.h <<\EOF
1369 #define TRAD_HEADER "hosts/decstation.h"
1370 EOF
1371
1372         ;;
1373   mips-sgi-irix4*)      COREFILE=irix-core.o ;;
1374   mips-sgi-irix5*)      COREFILE=irix-core.o ;;
1375   mips-*-mach3*)
1376         COREFILE=trad-core.o
1377         cat >> confdefs.h <<\EOF
1378 #define TRAD_HEADER "hosts/mipsmach3.h"
1379 EOF
1380
1381         ;;
1382   mips-*-sysv4*)        ;;
1383   mips-*-sysv* | mips-*-riscos*)
1384         COREFILE=trad-core.o
1385         cat >> confdefs.h <<\EOF
1386 #define TRAD_HEADER "hosts/riscos.h"
1387 EOF
1388
1389         ;;
1390   mips-sony-bsd*)
1391         COREFILE=trad-core.o
1392         cat >> confdefs.h <<\EOF
1393 #define TRAD_HEADER "hosts/news-mips".h
1394 EOF
1395
1396         ;;
1397   m68*-bull*-sysv*)
1398         COREFILE=trad-core.o
1399         cat >> confdefs.h <<\EOF
1400 #define TRAD_HEADER "hosts/dpx2.h"
1401 EOF
1402
1403         ;;
1404   m68*-hp-hpux*)        COREFILE=hpux-core.o ;;
1405   m68*-hp-bsd*)
1406         COREFILE=trad-core.o
1407         cat >> confdefs.h <<\EOF
1408 #define TRAD_HEADER "hosts/hp300bsd.h"
1409 EOF
1410
1411         ;;
1412   m68*-motorola-sysv*)
1413         COREFILE=trad-core.o
1414         cat >> confdefs.h <<\EOF
1415 #define TRAD_HEADER "hosts/delta68.h"
1416 EOF
1417
1418         ;;
1419   m68*-sony-*)
1420         COREFILE=trad-core.o
1421         cat >> confdefs.h <<\EOF
1422 #define TRAD_HEADER "hosts/news.h"
1423 EOF
1424
1425         ;;
1426   m68*-*-netbsd*)
1427         COREFILE=trad-core.o
1428         cat >> confdefs.h <<\EOF
1429 #define TRAD_HEADER "hosts/m68knbsd.h"
1430 EOF
1431
1432         ;;
1433   m68*-apple-aux*)
1434         COREFILE=trad-core.o
1435         cat >> confdefs.h <<\EOF
1436 #define TRAD_HEADER "hosts/m68kaux.h"
1437 EOF
1438
1439         ;;
1440   m88*-*-sysv4*)        ;;
1441   m88*-motorola-sysv*)  COREFILE=ptrace-core.o ;;
1442   m88*-*-mach3*)
1443         COREFILE=trad-core.o
1444         cat >> confdefs.h <<\EOF
1445 #define TRAD_HEADER "hosts/m88kmach3.h"
1446 EOF
1447
1448         ;;
1449   ns32k-pc532-mach)
1450         COREFILE=trad-core.o
1451         cat >> confdefs.h <<\EOF
1452 #define TRAD_HEADER "hosts/pc532mach.h"
1453 EOF
1454
1455         ;;
1456   ns32k-*-netbsd*)
1457         COREFILE=trad-core.o
1458         cat >> confdefs.h <<\EOF
1459 #define TRAD_HEADER "hosts/ns32knbsd.h"
1460 EOF
1461
1462         ;;
1463   rs6000-*-lynx*)       COREFILE=lynx-core.o ;;
1464   rs6000-*-aix4*)       COREFILE=rs6000-core.o ;;
1465   rs6000-*-*)           COREFILE=rs6000-core.o ;;
1466   powerpc-*-aix4*)      COREFILE=rs6000-core.o ;;
1467   powerpc-*-aix*)       COREFILE=rs6000-core.o ;;
1468   sparc-*-netbsd*)
1469         COREFILE=trad-core.o
1470         cat >> confdefs.h <<\EOF
1471 #define TRAD_HEADER "hosts/sparcnbsd.h"
1472 EOF
1473
1474         ;;
1475   tahoe-*-*)
1476         COREFILE=trad-core.o
1477         cat >> confdefs.h <<\EOF
1478 #define TRAD_HEADER "hosts/tahoe.h"
1479 EOF
1480
1481         ;;
1482   vax-*-ultrix2*)
1483         COREFILE=trad-core.o
1484         cat >> confdefs.h <<\EOF
1485 #define TRAD_HEADER "hosts/vaxult2.h"
1486 EOF
1487
1488         ;;
1489   vax-*-ultrix*)
1490         COREFILE=trad-core.o
1491         cat >> confdefs.h <<\EOF
1492 #define TRAD_HEADER "hosts/vaxult2.h"
1493 EOF
1494
1495         ;;
1496   vax-*-*)
1497         COREFILE=trad-core.o
1498         cat >> confdefs.h <<\EOF
1499 #define TRAD_HEADER "hosts/vaxbsd.h"
1500 EOF
1501
1502         ;;
1503   esac
1504
1505   case "$COREFILE" in
1506   aix386-core.o)        COREFLAG=-DAIX386_CORE ;;
1507   hppabsd-core.o)       COREFLAG=-DHPPABSD_CORE ;;
1508   hpux-core.o)          COREFLAG=-DHPUX_CORE ;;
1509   irix-core.o)          COREFLAG=-DIRIX_CORE ;;
1510   lynx-core.o)          COREFLAG=-DLYNX_CORE ;;
1511   osf-core.o)           COREFLAG=-DOSF_CORE ;;
1512   ptrace-core.o)        COREFLAG=-DPTRACE_CORE ;;
1513   rs6000-core.o)        COREFLAG="$COREFLAG -DAIX_CORE" ;;
1514   trad-core.o)          COREFLAG="$COREFLAG -DTRAD_CORE" ;;
1515   esac
1516
1517   # The ELF code uses the native <sys/procfs.h> to handle core files.
1518   # Define HAVE_SYS_PROCFS_H if the file exists and defines
1519   # prstatus_t.
1520   echo $ac_n "checking for sys/procfs.h""... $ac_c" 1>&6
1521   if eval "test \"`echo '$''{'bfd_cv_header_sys_procfs_h'+set}'`\" = set"; then
1522   echo $ac_n "(cached) $ac_c" 1>&6
1523 else
1524   cat > conftest.$ac_ext <<EOF
1525 #line 1526 "configure"
1526 #include "confdefs.h"
1527 #include <sys/procfs.h>
1528 int main() { return 0; }
1529 int t() {
1530 prstatus_t t;
1531 ; return 0; }
1532 EOF
1533 if eval $ac_compile; then
1534   rm -rf conftest*
1535   bfd_cv_header_sys_procfs_h=yes
1536 else
1537   rm -rf conftest*
1538   bfd_cv_header_sys_procfs_h=no
1539 fi
1540 rm -f conftest*
1541
1542 fi
1543
1544   echo "$ac_t""$bfd_cv_header_sys_procfs_h" 1>&6
1545   if test $bfd_cv_header_sys_procfs_h = yes; then
1546     cat >> confdefs.h <<\EOF
1547 #define HAVE_SYS_PROCFS_H 1
1548 EOF
1549
1550   fi
1551
1552 fi
1553
1554
1555
1556 # target stuff:
1557
1558 # Canonicalize the secondary target names.
1559 if test -n "$enable_targets" ; then
1560     for targ in `echo $enable_targets | sed 's/,/ /g'`
1561     do
1562         result=`$ac_config_sub $targ 2>/dev/null`
1563         if test -n "$result" ; then
1564             canon_targets="$canon_targets $result"
1565         else
1566             # Allow targets that config.sub doesn't recognize, like "all".
1567             canon_targets="$canon_targets $targ"
1568         fi
1569     done
1570 fi
1571
1572 all_targets=false
1573 defvec=
1574 selvecs=
1575 selarchs=
1576 TDEFINES=
1577 for targ in $target $canon_targets
1578 do
1579     if test "x$targ" = "xall"; then
1580         all_targets=true
1581     else
1582         . $srcdir/config.bfd
1583         if test "x$targ" = "x$target"; then
1584             defvec=$targ_defvec
1585         fi
1586         selvecs="$selvecs $targ_defvec $targ_selvecs"
1587         selarchs="$selarchs $targ_archs"
1588         TDEFINES="$TDEFINES $targ_cflags"
1589     fi
1590 done
1591
1592
1593 # This processing still needs to be done if we're to decide properly whether
1594 # 64-bit support needs to be compiled in.  Currently, it will be included if
1595 # the default or any other explicitly requested target requires it; it
1596 # will not be included on a 32-bit host if no 64-bit target is requested, and
1597 # no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
1598 # used.
1599
1600 # uniq the default and selected vectors in all the configured targets.
1601 f=""
1602 for i in $selvecs ; do
1603     case " $f " in
1604     *" $i "*) ;;
1605     *) f="$f $i" ;;
1606     esac
1607 done
1608 selvecs="$f"
1609
1610 # uniq the architectures in all the configured targets.
1611 f=""
1612 for i in $selarchs ; do
1613     case " $f " in
1614     *" $i "*) ;;
1615     *) f="$f $i" ;;
1616     esac
1617 done
1618 selarchs="$f"
1619
1620 # Target backend .o files.
1621 tb=
1622
1623 elf="elf.o elflink.o"
1624
1625 for vec in $selvecs
1626 do
1627     case "$vec" in
1628     # This list is alphabetized to make it easy to compare
1629     # with the two vector lists in targets.c.
1630     a29kcoff_big_vec)           tb="$tb coff-a29k.o cofflink.o" ;;
1631     a_out_adobe_vec)            tb="$tb aout-adobe.o aout32.o stab-syms.o" ;;
1632     armcoff_little_vec)         tb="$tb coff-arm.o cofflink.o " ;;
1633     armcoff_big_vec)            tb="$tb coff-arm.o cofflink.o " ;;
1634     armpe_little_vec)           tb="$tb pe-arm.o cofflink.o " ;;
1635     armpe_big_vec)              tb="$tb pe-arm.o cofflink.o " ;;
1636     armpei_little_vec)          tb="$tb pei-arm.o cofflink.o " ;;
1637     armpei_big_vec)             tb="$tb pei-arm.o cofflink.o " ;;
1638     aout0_big_vec)              tb="$tb aout0.o aout32.o stab-syms.o" ;;
1639     aout_arm_big_vec)           tb="$tb aout-arm.o aout32.o stab-syms.o" ;;
1640     aout_arm_little_vec)        tb="$tb aout-arm.o aout32.o stab-syms.o" ;;
1641     aout_mips_big_vec)          tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
1642     aout_mips_little_vec)       tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
1643     apollocoff_vec)             tb="$tb coff-apollo.o" ;;
1644     b_out_vec_big_host)         tb="$tb bout.o aout32.o stab-syms.o" ;;
1645     b_out_vec_little_host)      tb="$tb bout.o aout32.o stab-syms.o" ;;
1646 # start-sanitize-arc
1647     bfd_elf32_littlearc_vec)    tb="$tb elf32-arc.o elf32.o $elf" ;;
1648     bfd_elf32_bigarc_vec)       tb="$tb elf32-arc.o elf32.o $elf" ;;
1649 # end-sanitize-arc
1650     bfd_elf32_big_generic_vec)  tb="$tb elf32-gen.o elf32.o $elf" ;;
1651     bfd_elf32_bigmips_vec)      tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
1652     bfd_elf32_hppa_vec)         tb="$tb elf32-hppa.o elf32.o $elf" ;;
1653     bfd_elf32_i386_vec)         tb="$tb elf32-i386.o elf32.o $elf" ;;
1654     bfd_elf32_i860_vec)         tb="$tb elf32-i860.o elf32.o $elf" ;;
1655     bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
1656     bfd_elf32_littlemips_vec)   tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
1657     bfd_elf32_m68k_vec)         tb="$tb elf32-m68k.o elf32.o $elf" ;;
1658     bfd_elf32_m88k_vec)         tb="$tb elf32-m88k.o elf32.o $elf" ;;
1659     bfd_elf32_powerpc_vec)      tb="$tb elf32-ppc.o elf32.o $elf" ;;
1660     bfd_elf32_powerpcle_vec)    tb="$tb elf32-ppc.o elf32.o $elf" ;;
1661     bfd_elf32_sparc_vec)        tb="$tb elf32-sparc.o elf32.o $elf" ;;
1662     bfd_elf64_big_generic_vec)  tb="$tb elf64-gen.o elf64.o $elf"
1663                                 target64=true ;;
1664     bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
1665                                 target64=true ;;
1666     bfd_elf64_sparc_vec)        tb="$tb elf64-sparc.o elf64.o $elf"
1667                                 target64=true ;;
1668     cisco_core_vec)             tb="$tb cisco-core.o" ;;
1669     demo_64_vec)                tb="$tb demo64.o aout64.o stab-syms.o"
1670                                 target64=true ;;
1671     ecoff_big_vec)              tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
1672     ecoff_little_vec)           tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
1673     ecoffalpha_little_vec)      tb="$tb coff-alpha.o ecoff.o ecofflink.o"
1674                                 target64=true ;;
1675     h8300coff_vec)              tb="$tb coff-h8300.o reloc16.o" ;;
1676     h8500coff_vec)              tb="$tb coff-h8500.o reloc16.o" ;;
1677     host_aout_vec)              tb="$tb host-aout.o aout32.o stab-syms.o" ;;
1678     hp300bsd_vec)               tb="$tb hp300bsd.o aout32.o stab-syms.o" ;;
1679     hp300hpux_vec)              tb="$tb hp300hpux.o aout32.o stab-syms.o" ;;
1680     i386aout_vec)               tb="$tb i386aout.o aout32.o stab-syms.o" ;;
1681     i386bsd_vec)                tb="$tb i386bsd.o aout32.o stab-syms.o" ;;
1682     i386coff_vec)               tb="$tb coff-i386.o cofflink.o" ;;
1683     i386dynix_vec)              tb="$tb i386dynix.o aout32.o stab-syms.o" ;;
1684     i386freebsd_vec)            tb="$tb i386freebsd.o aout32.o stab-syms.o" ;;
1685     i386msdos_vec)              tb="$tb i386msdos.o" ;;
1686     i386pe_vec)                 tb="$tb pe-i386.o cofflink.o " ;;
1687     i386pei_vec)                tb="$tb pei-i386.o cofflink.o" ;;
1688     i386linux_vec)              tb="$tb i386linux.o aout32.o stab-syms.o" ;;
1689     i386lynx_aout_vec)          tb="$tb i386lynx.o lynx-core.o aout32.o stab-syms.o" ;;
1690     i386lynx_coff_vec)          tb="$tb cf-i386lynx.o cofflink.o lynx-core.o stab-syms.o" ;;
1691     i386mach3_vec)              tb="$tb i386mach3.o aout32.o stab-syms.o" ;;
1692     i386netbsd_vec)             tb="$tb i386netbsd.o aout32.o stab-syms.o" ;;
1693     i386os9k_vec)               tb="$tb i386os9k.o aout32.o stab-syms.o" ;;
1694     i860coff_vec)               tb="$tb coff-i860.o cofflink.o" ;;
1695     icoff_big_vec)              tb="$tb coff-i960.o cofflink.o" ;;
1696     icoff_little_vec)           tb="$tb coff-i960.o cofflink.o" ;;
1697     ieee_vec)                   tb="$tb ieee.o" ;;
1698     m68kcoff_vec)               tb="$tb coff-m68k.o cofflink.o" ;;
1699     m68kcoffun_vec)             tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
1700     m68klynx_aout_vec)          tb="$tb m68klynx.o lynx-core.o aout32.o stab-syms.o" ;;
1701     m68klynx_coff_vec)          tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o stab-syms.o" ;;
1702     m68knetbsd_vec)             tb="$tb m68knetbsd.o aout32.o stab-syms.o" ;;
1703     m68k4knetbsd_vec)           tb="$tb m68k4knetbsd.o aout32.o stab-syms.o" ;;
1704     m68kaux_coff_vec)           tb="$tb coff-aux.o coff-m68k.o cofflink.o" ;;
1705     m88kbcs_vec)                tb="$tb coff-m88k.o" ;;
1706     newsos3_vec)                tb="$tb newsos3.o aout32.o stab-syms.o" ;;
1707     nlm32_i386_vec)             tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
1708     nlm32_sparc_vec)            tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;;
1709     nlm32_alpha_vec)            tb="$tb nlm32-alpha.o nlm32.o nlm.o"
1710                                 target64=true ;;
1711     riscix_vec)                 tb="$tb aout32.o riscix.o stab-syms.o" ;;
1712     nlm32_powerpc_vec)          tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;;
1713     pc532netbsd_vec)            tb="$tb ns32knetbsd.o aout-ns32k.o stab-syms.o" ;;
1714     pc532machaout_vec)          tb="$tb pc532-mach.o aout-ns32k.o stab-syms.o" ;;
1715     pmac_xcoff_vec)             tb="$tb coff-pmac.o xcofflink.o" ;;
1716     rs6000coff_vec)             tb="$tb coff-rs6000.o xcofflink.o" ;;
1717     bfd_powerpc_pe_vec)         tb="$tb pe-ppc.o cofflink.o" ;;  
1718     bfd_powerpcle_pe_vec)       tb="$tb pe-ppc.o cofflink.o" ;;  
1719     bfd_powerpc_pei_vec)        tb="$tb pei-ppc.o cofflink.o" ;;
1720     bfd_powerpcle_pei_vec)      tb="$tb pei-ppc.o cofflink.o" ;;
1721     shcoff_vec)                 tb="$tb coff-sh.o cofflink.o" ;;
1722 # start-sanitize-rce
1723     rce_aout_vec)               tb="$tb aout-rce.o aout32.o stab-syms.o" ;;
1724 # end-sanitize-rce
1725     shlcoff_vec)                tb="$tb coff-sh.o cofflink.o" ;;
1726     som_vec)                    tb="$tb som.o" ;;
1727     sparclynx_aout_vec)         tb="$tb sparclynx.o lynx-core.o aout32.o stab-syms.o" ;;
1728     sparclynx_coff_vec)         tb="$tb cf-sparclynx.o lynx-core.o stab-syms.o" ;;
1729     sparcnetbsd_vec)            tb="$tb sparcnetbsd.o aout32.o stab-syms.o" ;;
1730     sparccoff_vec)              tb="$tb coff-sparc.o" ;;
1731     srec_vec)                   tb="$tb srec.o" ;;
1732     sunos_big_vec)              tb="$tb sunos.o aout32.o stab-syms.o" ;;
1733     symbolsrec_vec)             tb="$tb srec.o" ;;
1734     tekhex_vec)                 tb="$tb tekhex.o" ;;
1735     we32kcoff_vec)              tb="$tb coff-we32k.o" ;;
1736     z8kcoff_vec)                tb="$tb coff-z8k.o reloc16.o" ;;
1737     w65_vec)                    tb="$tb coff-w65.o reloc16.o" ;;
1738     versados_vec)               tb="$tb versados.o" ;;
1739
1740     "")                 ;;
1741     *) { echo "configure: error: *** unknown target vector $vec" 1>&2; exit 1; } ;;
1742     esac
1743 done
1744
1745 # Target architecture .o files.
1746 ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
1747
1748 # Weed out duplicate .o files.
1749 f=""
1750 for i in $tb ; do
1751     case " $f " in
1752     *" $i "*) ;;
1753     *) f="$f $i" ;;
1754     esac
1755 done
1756 tb="$f"
1757
1758 f=""
1759 for i in $ta ; do
1760     case " $f " in
1761     *" $i "*) ;;
1762     *) f="$f $i" ;;
1763     esac
1764 done
1765 ta="$f"
1766
1767 bfd_backends="$tb"
1768 bfd_machines="$ta"
1769
1770 if test x${all_targets} = xtrue ; then
1771   bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
1772   bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
1773   selvecs=
1774   selarchs=
1775 else    # all_targets is true
1776   # Only set these if they will be nonempty, for the clever echo.
1777   test -n "$selvecs" &&
1778     selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
1779   test -n "$selarchs" &&
1780     selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
1781 fi      # all_targets is true
1782
1783 case ${host64}-${target64}-${want64} in
1784   *true*)
1785     wordsize=64
1786     all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
1787     ;;
1788   false-false-false)
1789     wordsize=32
1790     all_backends='$(BFD32_BACKENDS)'
1791     ;;
1792 esac
1793
1794
1795
1796
1797
1798
1799 tdefaults=""
1800 test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
1801 test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
1802 test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
1803
1804
1805 for ac_func in valloc getpagesize
1806 do
1807 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1808 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1809   echo $ac_n "(cached) $ac_c" 1>&6
1810 else
1811   cat > conftest.$ac_ext <<EOF
1812 #line 1813 "configure"
1813 #include "confdefs.h"
1814 /* System header to define __stub macros and hopefully few prototypes,
1815     which can conflict with char $ac_func(); below.  */
1816 #include <assert.h>
1817 /* Override any gcc2 internal prototype to avoid an error.  */
1818 char $ac_func();
1819
1820 int main() { return 0; }
1821 int t() {
1822
1823 /* The GNU C library defines this for functions which it implements
1824     to always fail with ENOSYS.  Some functions are actually named
1825     something starting with __ and the normal name is an alias.  */
1826 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1827 choke me
1828 #else
1829 $ac_func();
1830 #endif
1831
1832 ; return 0; }
1833 EOF
1834 if eval $ac_link; then
1835   rm -rf conftest*
1836   eval "ac_cv_func_$ac_func=yes"
1837 else
1838   rm -rf conftest*
1839   eval "ac_cv_func_$ac_func=no"
1840 fi
1841 rm -f conftest*
1842
1843 fi
1844 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1845   echo "$ac_t""yes" 1>&6
1846     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1847   cat >> confdefs.h <<EOF
1848 #define $ac_tr_func 1
1849 EOF
1850  
1851 else
1852   echo "$ac_t""no" 1>&6
1853 fi
1854 done
1855
1856 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
1857 if eval "test \"`echo '$''{'ac_cv_func_mmap'+set}'`\" = set"; then
1858   echo $ac_n "(cached) $ac_c" 1>&6
1859 else
1860   if test "$cross_compiling" = yes; then
1861   ac_cv_func_mmap=no
1862 else
1863 cat > conftest.$ac_ext <<EOF
1864 #line 1865 "configure"
1865 #include "confdefs.h"
1866
1867 /* Thanks to Mike Haertel and Jim Avera for this test. */
1868 #include <sys/types.h>
1869 #include <fcntl.h>
1870 #include <sys/mman.h>
1871
1872 #ifndef HAVE_GETPAGESIZE
1873 # include <sys/param.h>
1874 # ifdef EXEC_PAGESIZE
1875 #  define getpagesize() EXEC_PAGESIZE
1876 # else
1877 #  ifdef NBPG
1878 #   define getpagesize() NBPG * CLSIZE
1879 #   ifndef CLSIZE
1880 #    define CLSIZE 1
1881 #   endif
1882 #  else
1883 #   ifdef NBPC
1884 #    define getpagesize() NBPC
1885 #   else
1886 #    define getpagesize() PAGESIZE /* SVR4 */
1887 #   endif
1888 #  endif
1889 # endif
1890 #endif
1891
1892 #ifndef HAVE_VALLOC
1893 # define valloc malloc
1894 #endif
1895
1896 #ifdef __cplusplus
1897 extern "C" { void *valloc(unsigned), *malloc(unsigned); }
1898 #else
1899 char *valloc(), *malloc();
1900 #endif
1901
1902 int
1903 main()
1904 {
1905   char *buf1, *buf2, *buf3;
1906   int i = getpagesize(), j;
1907   int i2 = i * 2;
1908   int fd;
1909
1910   buf1 = (char *)valloc(i2);
1911   buf2 = (char *)valloc(i);
1912   buf3 = (char *)malloc(i2);
1913   for (j = 0; j < i2; ++j)
1914     *(buf1 + j) = rand();
1915   fd = open("conftestmmap", O_CREAT | O_RDWR, 0666);
1916   write(fd, buf1, i2);
1917   mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0);
1918   for (j = 0; j < i; ++j)
1919     if (*(buf1 + j) != *(buf2 + j))
1920       exit(1);
1921   lseek(fd, (long)i, 0);
1922   read(fd, buf2, i); /* read into mapped memory -- file should not change */
1923   /* (it does in i386 SVR4.0 - Jim Avera, jima@netcom.com) */
1924   lseek(fd, (long)0, 0);
1925   read(fd, buf3, i2);
1926   for (j = 0; j < i2; ++j)
1927     if (*(buf1 + j) != *(buf3 + j))
1928       exit(1);
1929   exit(0);
1930 }
1931
1932 EOF
1933 eval $ac_link
1934 if test -s conftest && (./conftest; exit) 2>/dev/null; then
1935   ac_cv_func_mmap=yes
1936 else
1937   ac_cv_func_mmap=no
1938 fi
1939 fi
1940 rm -fr conftest*
1941 fi
1942
1943 echo "$ac_t""$ac_cv_func_mmap" 1>&6
1944 if test $ac_cv_func_mmap = yes; then
1945   cat >> confdefs.h <<\EOF
1946 #define HAVE_MMAP 1
1947 EOF
1948
1949 fi
1950
1951 for ac_func in madvise mprotect
1952 do
1953 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1954 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1955   echo $ac_n "(cached) $ac_c" 1>&6
1956 else
1957   cat > conftest.$ac_ext <<EOF
1958 #line 1959 "configure"
1959 #include "confdefs.h"
1960 /* System header to define __stub macros and hopefully few prototypes,
1961     which can conflict with char $ac_func(); below.  */
1962 #include <assert.h>
1963 /* Override any gcc2 internal prototype to avoid an error.  */
1964 char $ac_func();
1965
1966 int main() { return 0; }
1967 int t() {
1968
1969 /* The GNU C library defines this for functions which it implements
1970     to always fail with ENOSYS.  Some functions are actually named
1971     something starting with __ and the normal name is an alias.  */
1972 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1973 choke me
1974 #else
1975 $ac_func();
1976 #endif
1977
1978 ; return 0; }
1979 EOF
1980 if eval $ac_link; then
1981   rm -rf conftest*
1982   eval "ac_cv_func_$ac_func=yes"
1983 else
1984   rm -rf conftest*
1985   eval "ac_cv_func_$ac_func=no"
1986 fi
1987 rm -f conftest*
1988
1989 fi
1990 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1991   echo "$ac_t""yes" 1>&6
1992     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1993   cat >> confdefs.h <<EOF
1994 #define $ac_tr_func 1
1995 EOF
1996  
1997 else
1998   echo "$ac_t""no" 1>&6
1999 fi
2000 done
2001
2002 case ${want_mmap}+${ac_cv_func_mmap} in
2003   true+yes )  cat >> confdefs.h <<\EOF
2004 #define USE_MMAP 1
2005 EOF
2006  ;;
2007 esac
2008
2009 rm -f doc/config.status
2010 trap '' 1 2 15
2011 cat > confcache <<\EOF
2012 # This file is a shell script that caches the results of configure
2013 # tests run on this system so they can be shared between configure
2014 # scripts and configure runs.  It is not useful on other systems.
2015 # If it contains results you don't want to keep, you may remove or edit it.
2016 #
2017 # By default, configure uses ./config.cache as the cache file,
2018 # creating it if it does not exist already.  You can give configure
2019 # the --cache-file=FILE option to use a different cache file; that is
2020 # what configure does when it calls configure scripts in
2021 # subdirectories, so they share the cache.
2022 # Giving --cache-file=/dev/null disables caching, for debugging configure.
2023 # config.status only pays attention to the cache file if you give it the
2024 # --recheck option to rerun configure.
2025 #
2026 EOF
2027 # Ultrix sh set writes to stderr and can't be redirected directly,
2028 # and sets the high bit in the cache file unless we assign to the vars.
2029 (set) 2>&1 |
2030   sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
2031   >> confcache
2032 if cmp -s $cache_file confcache; then
2033   :
2034 else
2035   if test -w $cache_file; then
2036     echo "updating cache $cache_file"
2037     cat confcache > $cache_file
2038   else
2039     echo "not updating unwritable cache $cache_file"
2040   fi
2041 fi
2042 rm -f confcache
2043
2044 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
2045
2046 test "x$prefix" = xNONE && prefix=$ac_default_prefix
2047 # Let make expand exec_prefix.
2048 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2049
2050 # Any assignment to VPATH causes Sun make to only execute
2051 # the first set of double-colon rules, so remove it if not needed.
2052 # If there is a colon in the path, we need to keep it.
2053 if test "x$srcdir" = x.; then
2054   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
2055 fi
2056
2057 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2058
2059 DEFS=-DHAVE_CONFIG_H
2060
2061 # Without the "./", some shells look in PATH for config.status.
2062 : ${CONFIG_STATUS=./config.status}
2063
2064 echo creating $CONFIG_STATUS
2065 rm -f $CONFIG_STATUS
2066 cat > $CONFIG_STATUS <<EOF
2067 #! /bin/sh
2068 # Generated automatically by configure.
2069 # Run this file to recreate the current configuration.
2070 # This directory was configured as follows,
2071 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2072 #
2073 # $0 $ac_configure_args
2074 #
2075 # Compiler output produced by configure, useful for debugging
2076 # configure, is in ./config.log if it exists.
2077
2078 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
2079 for ac_option
2080 do
2081   case "\$ac_option" in
2082   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
2083     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
2084     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
2085   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
2086     echo "$CONFIG_STATUS generated by autoconf version 2.7"
2087     exit 0 ;;
2088   -help | --help | --hel | --he | --h)
2089     echo "\$ac_cs_usage"; exit 0 ;;
2090   *) echo "\$ac_cs_usage"; exit 1 ;;
2091   esac
2092 done
2093
2094 ac_given_srcdir=$srcdir
2095 ac_given_INSTALL="$INSTALL"
2096
2097 trap 'rm -fr `echo "Makefile doc/Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
2098 EOF
2099 cat >> $CONFIG_STATUS <<EOF
2100
2101 # Protect against being on the right side of a sed subst in config.status.
2102 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2103  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
2104 $ac_vpsub
2105 $extrasub
2106 s%@CFLAGS@%$CFLAGS%g
2107 s%@CPPFLAGS@%$CPPFLAGS%g
2108 s%@CXXFLAGS@%$CXXFLAGS%g
2109 s%@DEFS@%$DEFS%g
2110 s%@LDFLAGS@%$LDFLAGS%g
2111 s%@LIBS@%$LIBS%g
2112 s%@exec_prefix@%$exec_prefix%g
2113 s%@prefix@%$prefix%g
2114 s%@program_transform_name@%$program_transform_name%g
2115 s%@bindir@%$bindir%g
2116 s%@sbindir@%$sbindir%g
2117 s%@libexecdir@%$libexecdir%g
2118 s%@datadir@%$datadir%g
2119 s%@sysconfdir@%$sysconfdir%g
2120 s%@sharedstatedir@%$sharedstatedir%g
2121 s%@localstatedir@%$localstatedir%g
2122 s%@libdir@%$libdir%g
2123 s%@includedir@%$includedir%g
2124 s%@oldincludedir@%$oldincludedir%g
2125 s%@infodir@%$infodir%g
2126 s%@mandir@%$mandir%g
2127 s%@host@%$host%g
2128 s%@host_alias@%$host_alias%g
2129 s%@host_cpu@%$host_cpu%g
2130 s%@host_vendor@%$host_vendor%g
2131 s%@host_os@%$host_os%g
2132 s%@target@%$target%g
2133 s%@target_alias@%$target_alias%g
2134 s%@target_cpu@%$target_cpu%g
2135 s%@target_vendor@%$target_vendor%g
2136 s%@target_os@%$target_os%g
2137 s%@build@%$build%g
2138 s%@build_alias@%$build_alias%g
2139 s%@build_cpu@%$build_cpu%g
2140 s%@build_vendor@%$build_vendor%g
2141 s%@build_os@%$build_os%g
2142 s%@CC@%$CC%g
2143 s%@HDEFINES@%$HDEFINES%g
2144 s%@AR@%$AR%g
2145 s%@RANLIB@%$RANLIB%g
2146 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
2147 s%@INSTALL_DATA@%$INSTALL_DATA%g
2148 s%@ALLLIBS@%$ALLLIBS%g
2149 s%@PICFLAG@%$PICFLAG%g
2150 s%@SHLIB@%$SHLIB%g
2151 s%@SHLIB_CC@%$SHLIB_CC%g
2152 s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g
2153 s%@COMMON_SHLIB@%$COMMON_SHLIB%g
2154 s%@PICLIST@%$PICLIST%g
2155 s%@SHLINK@%$SHLINK%g
2156 s%@HOST_64BIT_LONG@%$HOST_64BIT_LONG%g
2157 s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
2158 s%@CPP@%$CPP%g
2159 s%@COREFILE@%$COREFILE%g
2160 s%@COREFLAG@%$COREFLAG%g
2161 s%@TDEFINES@%$TDEFINES%g
2162 s%@wordsize@%$wordsize%g
2163 s%@all_backends@%$all_backends%g
2164 s%@bfd_backends@%$bfd_backends%g
2165 s%@bfd_machines@%$bfd_machines%g
2166 s%@tdefaults@%$tdefaults%g
2167
2168 CEOF
2169 EOF
2170 cat >> $CONFIG_STATUS <<EOF
2171
2172 CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile"}
2173 EOF
2174 cat >> $CONFIG_STATUS <<\EOF
2175 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
2176   # Support "outfile[:infile]", defaulting infile="outfile.in".
2177   case "$ac_file" in
2178   *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
2179        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2180   *) ac_file_in="${ac_file}.in" ;;
2181   esac
2182
2183   # Adjust relative srcdir, etc. for subdirectories.
2184
2185   # Remove last slash and all that follows it.  Not all systems have dirname.
2186   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2187   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2188     # The file is in a subdirectory.
2189     test ! -d "$ac_dir" && mkdir "$ac_dir"
2190     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2191     # A "../" for each directory in $ac_dir_suffix.
2192     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2193   else
2194     ac_dir_suffix= ac_dots=
2195   fi
2196
2197   case "$ac_given_srcdir" in
2198   .)  srcdir=.
2199       if test -z "$ac_dots"; then top_srcdir=.
2200       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2201   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2202   *) # Relative path.
2203     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2204     top_srcdir="$ac_dots$ac_given_srcdir" ;;
2205   esac
2206
2207   case "$ac_given_INSTALL" in
2208   [/$]*) INSTALL="$ac_given_INSTALL" ;;
2209   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2210   esac
2211   echo creating "$ac_file"
2212   rm -f "$ac_file"
2213   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2214   case "$ac_file" in
2215   *Makefile*) ac_comsub="1i\\
2216 # $configure_input" ;;
2217   *) ac_comsub= ;;
2218   esac
2219   sed -e "$ac_comsub
2220 s%@configure_input@%$configure_input%g
2221 s%@srcdir@%$srcdir%g
2222 s%@top_srcdir@%$top_srcdir%g
2223 s%@INSTALL@%$INSTALL%g
2224 " -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
2225 fi; done
2226 rm -f conftest.subs
2227
2228 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
2229 # NAME is the cpp macro being defined and VALUE is the value it is being given.
2230 #
2231 # ac_d sets the value in "#define NAME VALUE" lines.
2232 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
2233 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
2234 ac_dC='\3'
2235 ac_dD='%g'
2236 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
2237 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
2238 ac_uB='\([      ]\)%\1#\2define\3'
2239 ac_uC=' '
2240 ac_uD='\4%g'
2241 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
2242 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
2243 ac_eB='$%\1#\2define\3'
2244 ac_eC=' '
2245 ac_eD='%g'
2246
2247 CONFIG_HEADERS=${CONFIG_HEADERS-"config.h:config.in"}
2248 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
2249   # Support "outfile[:infile]", defaulting infile="outfile.in".
2250   case "$ac_file" in
2251   *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
2252        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2253   *) ac_file_in="${ac_file}.in" ;;
2254   esac
2255
2256   echo creating $ac_file
2257
2258   rm -f conftest.frag conftest.in conftest.out
2259   cp $ac_given_srcdir/$ac_file_in conftest.in
2260
2261 EOF
2262
2263 # Transform confdefs.h into a sed script conftest.vals that substitutes
2264 # the proper values into config.h.in to produce config.h.  And first:
2265 # Protect against being on the right side of a sed subst in config.status.
2266 # Protect against being in an unquoted here document in config.status.
2267 rm -f conftest.vals
2268 cat > conftest.hdr <<\EOF
2269 s/[\\&%]/\\&/g
2270 s%[\\$`]%\\&%g
2271 s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
2272 s%ac_d%ac_u%gp
2273 s%ac_u%ac_e%gp
2274 EOF
2275 sed -n -f conftest.hdr confdefs.h > conftest.vals
2276 rm -f conftest.hdr
2277
2278 # This sed command replaces #undef with comments.  This is necessary, for
2279 # example, in the case of _POSIX_SOURCE, which is predefined and required
2280 # on some systems where configure will not decide to define it.
2281 cat >> conftest.vals <<\EOF
2282 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
2283 EOF
2284
2285 # Break up conftest.vals because some shells have a limit on
2286 # the size of here documents, and old seds have small limits too.
2287 # Maximum number of lines to put in a single here document.
2288 ac_max_here_lines=12
2289
2290 rm -f conftest.tail
2291 while :
2292 do
2293   ac_lines=`grep -c . conftest.vals`
2294   # grep -c gives empty output for an empty file on some AIX systems.
2295   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
2296   # Write a limited-size here document to conftest.frag.
2297   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
2298   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
2299   echo 'CEOF
2300   sed -f conftest.frag conftest.in > conftest.out
2301   rm -f conftest.in
2302   mv conftest.out conftest.in
2303 ' >> $CONFIG_STATUS
2304   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
2305   rm -f conftest.vals
2306   mv conftest.tail conftest.vals
2307 done
2308 rm -f conftest.vals
2309
2310 cat >> $CONFIG_STATUS <<\EOF
2311   rm -f conftest.frag conftest.h
2312   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
2313   cat conftest.in >> conftest.h
2314   rm -f conftest.in
2315   if cmp -s $ac_file conftest.h 2>/dev/null; then
2316     echo "$ac_file is unchanged"
2317     rm -f conftest.h
2318   else
2319     rm -f $ac_file
2320     mv conftest.h $ac_file
2321   fi
2322 fi; done
2323
2324
2325 case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac
2326 exit 0
2327 EOF
2328 chmod +x $CONFIG_STATUS
2329 rm -fr confdefs* $ac_clean_files
2330 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2331