]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - bfd/configure
* stab-syms.c (__define_stab_duplicate): Define.
[thirdparty/binutils-gdb.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=unused-shlib
718 SHLINK=unused-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 # Extract the first word of "gcc", so it can be a program name with args.
731 set dummy gcc; ac_word=$2
732 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
733 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
734 echo $ac_n "(cached) $ac_c" 1>&6
735 else
736 if test -n "$CC"; then
737 ac_cv_prog_CC="$CC" # Let the user override the test.
738 else
739 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
740 for ac_dir in $PATH; do
741 test -z "$ac_dir" && ac_dir=.
742 if test -f $ac_dir/$ac_word; then
743 ac_cv_prog_CC="gcc"
744 break
745 fi
746 done
747 IFS="$ac_save_ifs"
748 test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc"
749 fi
750 fi
751 CC="$ac_cv_prog_CC"
752 if test -n "$CC"; then
753 echo "$ac_t""$CC" 1>&6
754 else
755 echo "$ac_t""no" 1>&6
756 fi
757
758
759 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
760 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
761 echo $ac_n "(cached) $ac_c" 1>&6
762 else
763 cat > conftest.c <<EOF
764 #ifdef __GNUC__
765 yes;
766 #endif
767 EOF
768 if ${CC-cc} -E conftest.c 2>&5 | egrep yes >/dev/null 2>&1; then
769 ac_cv_prog_gcc=yes
770 else
771 ac_cv_prog_gcc=no
772 fi
773 fi
774
775 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
776 if test $ac_cv_prog_gcc = yes; then
777 GCC=yes
778 if test "${CFLAGS+set}" != set; then
779 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
780 if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then
781 echo $ac_n "(cached) $ac_c" 1>&6
782 else
783 echo 'void f(){}' > conftest.c
784 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
785 ac_cv_prog_gcc_g=yes
786 else
787 ac_cv_prog_gcc_g=no
788 fi
789 rm -f conftest*
790
791 fi
792
793 echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
794 if test $ac_cv_prog_gcc_g = yes; then
795 CFLAGS="-g -O"
796 else
797 CFLAGS="-O"
798 fi
799 fi
800 else
801 GCC=
802 test "${CFLAGS+set}" = set || CFLAGS="-g"
803 fi
804
805
806 # Permit host specific settings.
807 . ${srcdir}/configure.host
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 ALLLIBS='$(TARGETLIB)'
931 PICFLAG=
932 SHLIB=unused-shlib
933 fi
934 fi
935
936
937
938
939
940
941 if test "${commonbfdlib}" = "true"; then
942 COMMON_SHLIB=yes
943 PICLIST=piclist
944 else
945 COMMON_SHLIB=
946 PICLIST=
947 fi
948
949
950
951
952 HOST_64BIT_LONG=0
953 if test "x${HOST_64BIT_TYPE}" = "xlong"; then
954 HOST_64BIT_LONG=1
955 fi
956
957
958 # If we cannot run a trivial program, we must be cross compiling.
959 echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
960 if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
961 echo $ac_n "(cached) $ac_c" 1>&6
962 else
963 if test "$cross_compiling" = yes; then
964 ac_cv_c_cross=yes
965 else
966 cat > conftest.$ac_ext <<EOF
967 #line 968 "configure"
968 #include "confdefs.h"
969 main(){return(0);}
970 EOF
971 eval $ac_link
972 if test -s conftest && (./conftest; exit) 2>/dev/null; then
973 ac_cv_c_cross=no
974 else
975 ac_cv_c_cross=yes
976 fi
977 fi
978 rm -fr conftest*
979 fi
980
981 echo "$ac_t""$ac_cv_c_cross" 1>&6
982 cross_compiling=$ac_cv_c_cross
983
984 # Put a plausible default for CC_FOR_BUILD in Makefile.
985 if test -z "$CC_FOR_BUILD"; then
986 if test "x$cross_compiling" = "xno"; then
987 CC_FOR_BUILD='$(CC)'
988 else
989 CC_FOR_BUILD=gcc
990 fi
991 fi
992
993
994 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
995 # On Suns, sometimes $CPP names a directory.
996 if test -n "$CPP" && test -d "$CPP"; then
997 CPP=
998 fi
999 if test -z "$CPP"; then
1000 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1001 echo $ac_n "(cached) $ac_c" 1>&6
1002 else
1003 # This must be in double quotes, not single quotes, because CPP may get
1004 # substituted into the Makefile and "${CC-cc}" will confuse make.
1005 CPP="${CC-cc} -E"
1006 # On the NeXT, cc -E runs the code through the compiler's parser,
1007 # not just through cpp.
1008 cat > conftest.$ac_ext <<EOF
1009 #line 1010 "configure"
1010 #include "confdefs.h"
1011 #include <assert.h>
1012 Syntax Error
1013 EOF
1014 eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1015 ac_err=`grep -v '^ *+' conftest.out`
1016 if test -z "$ac_err"; then
1017 :
1018 else
1019 echo "$ac_err" >&5
1020 rm -rf conftest*
1021 CPP="${CC-cc} -E -traditional-cpp"
1022 cat > conftest.$ac_ext <<EOF
1023 #line 1024 "configure"
1024 #include "confdefs.h"
1025 #include <assert.h>
1026 Syntax Error
1027 EOF
1028 eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1029 ac_err=`grep -v '^ *+' conftest.out`
1030 if test -z "$ac_err"; then
1031 :
1032 else
1033 echo "$ac_err" >&5
1034 rm -rf conftest*
1035 CPP=/lib/cpp
1036 fi
1037 rm -f conftest*
1038 fi
1039 rm -f conftest*
1040 ac_cv_prog_CPP="$CPP"
1041 fi
1042 CPP="$ac_cv_prog_CPP"
1043 else
1044 ac_cv_prog_CPP="$CPP"
1045 fi
1046 echo "$ac_t""$CPP" 1>&6
1047
1048 for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h
1049 do
1050 ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
1051 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1052 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1053 echo $ac_n "(cached) $ac_c" 1>&6
1054 else
1055 cat > conftest.$ac_ext <<EOF
1056 #line 1057 "configure"
1057 #include "confdefs.h"
1058 #include <$ac_hdr>
1059 EOF
1060 eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1061 ac_err=`grep -v '^ *+' conftest.out`
1062 if test -z "$ac_err"; then
1063 rm -rf conftest*
1064 eval "ac_cv_header_$ac_safe=yes"
1065 else
1066 echo "$ac_err" >&5
1067 rm -rf conftest*
1068 eval "ac_cv_header_$ac_safe=no"
1069 fi
1070 rm -f conftest*
1071 fi
1072 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1073 echo "$ac_t""yes" 1>&6
1074 ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
1075 cat >> confdefs.h <<EOF
1076 #define $ac_tr_hdr 1
1077 EOF
1078
1079 else
1080 echo "$ac_t""no" 1>&6
1081 fi
1082 done
1083
1084 for ac_hdr in fcntl.h sys/file.h
1085 do
1086 ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
1087 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1088 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1089 echo $ac_n "(cached) $ac_c" 1>&6
1090 else
1091 cat > conftest.$ac_ext <<EOF
1092 #line 1093 "configure"
1093 #include "confdefs.h"
1094 #include <$ac_hdr>
1095 EOF
1096 eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1097 ac_err=`grep -v '^ *+' conftest.out`
1098 if test -z "$ac_err"; then
1099 rm -rf conftest*
1100 eval "ac_cv_header_$ac_safe=yes"
1101 else
1102 echo "$ac_err" >&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 | tr 'abcdefghijklmnopqrstuvwxyz./\055' '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 fcntl getpagesize
1121 do
1122 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1123 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1124 echo $ac_n "(cached) $ac_c" 1>&6
1125 else
1126 cat > conftest.$ac_ext <<EOF
1127 #line 1128 "configure"
1128 #include "confdefs.h"
1129 /* System header to define __stub macros and hopefully few prototypes,
1130 which can conflict with char $ac_func(); below. */
1131 #include <assert.h>
1132 /* Override any gcc2 internal prototype to avoid an error. */
1133 char $ac_func();
1134
1135 int main() { return 0; }
1136 int t() {
1137
1138 /* The GNU C library defines this for functions which it implements
1139 to always fail with ENOSYS. Some functions are actually named
1140 something starting with __ and the normal name is an alias. */
1141 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1142 choke me
1143 #else
1144 $ac_func();
1145 #endif
1146
1147 ; return 0; }
1148 EOF
1149 if eval $ac_link; then
1150 rm -rf conftest*
1151 eval "ac_cv_func_$ac_func=yes"
1152 else
1153 rm -rf conftest*
1154 eval "ac_cv_func_$ac_func=no"
1155 fi
1156 rm -f conftest*
1157
1158 fi
1159 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1160 echo "$ac_t""yes" 1>&6
1161 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1162 cat >> confdefs.h <<EOF
1163 #define $ac_tr_func 1
1164 EOF
1165
1166 else
1167 echo "$ac_t""no" 1>&6
1168 fi
1169 done
1170
1171
1172
1173 case "${host}" in
1174 i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32)
1175 cat >> confdefs.h <<\EOF
1176 #define USE_BINARY_FOPEN 1
1177 EOF
1178 ;;
1179 esac
1180
1181 echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
1182 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
1183 echo $ac_n "(cached) $ac_c" 1>&6
1184 else
1185 cat > conftest.$ac_ext <<EOF
1186 #line 1187 "configure"
1187 #include "confdefs.h"
1188
1189 #include <stdio.h>
1190 #ifdef HAVE_STDLIB_H
1191 #include <stdlib.h>
1192 #endif
1193 #ifdef HAVE_UNISTD_H
1194 #include <unistd.h>
1195 #endif
1196 int main() { return 0; }
1197 int t() {
1198 char *(*pfn) = (char *(*)) malloc
1199 ; return 0; }
1200 EOF
1201 if eval $ac_compile; then
1202 rm -rf conftest*
1203 bfd_cv_decl_needed_malloc=no
1204 else
1205 rm -rf conftest*
1206 bfd_cv_decl_needed_malloc=yes
1207 fi
1208 rm -f conftest*
1209
1210 fi
1211
1212 echo "$ac_t""$bfd_cv_decl_needed_malloc" 1>&6
1213 if test $bfd_cv_decl_needed_malloc = yes; then
1214 bfd_tr_decl=NEED_DECLARATION_`echo malloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1215 cat >> confdefs.h <<EOF
1216 #define $bfd_tr_decl 1
1217 EOF
1218
1219 fi
1220
1221 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
1222 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
1223 echo $ac_n "(cached) $ac_c" 1>&6
1224 else
1225 cat > conftest.$ac_ext <<EOF
1226 #line 1227 "configure"
1227 #include "confdefs.h"
1228
1229 #include <stdio.h>
1230 #ifdef HAVE_STDLIB_H
1231 #include <stdlib.h>
1232 #endif
1233 #ifdef HAVE_UNISTD_H
1234 #include <unistd.h>
1235 #endif
1236 int main() { return 0; }
1237 int t() {
1238 char *(*pfn) = (char *(*)) free
1239 ; return 0; }
1240 EOF
1241 if eval $ac_compile; then
1242 rm -rf conftest*
1243 bfd_cv_decl_needed_free=no
1244 else
1245 rm -rf conftest*
1246 bfd_cv_decl_needed_free=yes
1247 fi
1248 rm -f conftest*
1249
1250 fi
1251
1252 echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6
1253 if test $bfd_cv_decl_needed_free = yes; then
1254 bfd_tr_decl=NEED_DECLARATION_`echo free | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1255 cat >> confdefs.h <<EOF
1256 #define $bfd_tr_decl 1
1257 EOF
1258
1259 fi
1260
1261
1262 # If we are configured native, pick a core file support file.
1263 COREFILE=
1264 COREFLAG=
1265 if test "${target}" = "${host}"; then
1266 case "${host}" in
1267 alpha*-*-linux*)
1268 COREFILE=trad-core.o
1269 cat >> confdefs.h <<\EOF
1270 #define TRAD_HEADER "hosts/alphalinux.h"
1271 EOF
1272
1273 ;;
1274 alpha*-*-*) COREFILE=osf-core.o ;;
1275 arm-*-riscix) COREFILE=trad-core.o ;;
1276 hppa*-*-hpux*) COREFILE=hpux-core.o ;;
1277 hppa*-*-hiux*) COREFILE=hpux-core.o ;;
1278 hppa*-*-bsd*) COREFILE="hpux-core.o hppabsd-core.o"
1279 COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
1280 i[345]86-sequent-bsd*)
1281 COREFILE=trad-core.o;
1282 cat >> confdefs.h <<\EOF
1283 #define TRAD_HEADER "hosts/symmetry.h"
1284 EOF
1285
1286 ;;
1287 i[345]86-sequent-sysv4*) ;;
1288 i[345]86-sequent-sysv*)
1289 COREFILE=trad-core.o
1290 cat >> confdefs.h <<\EOF
1291 #define TRAD_HEADER "hosts/symmetry.h"
1292 EOF
1293
1294 ;;
1295 i[345]86-*-bsd* | i[345]86-*-freebsd*)
1296 COREFILE=trad-core.o
1297 cat >> confdefs.h <<\EOF
1298 #define TRAD_HEADER "hosts/i386bsd.h"
1299 EOF
1300
1301 ;;
1302 i[345]86-*-netbsd*)
1303 COREFILE=netbsd-core.o
1304 ;;
1305 i[345]86-esix-sysv3*)
1306 COREFILE=trad-core.o
1307 cat >> confdefs.h <<\EOF
1308 #define TRAD_HEADER "hosts/esix.h"
1309 EOF
1310
1311 ;;
1312 i[345]86-*-sco* | i[345]86-*-isc*)
1313 COREFILE=trad-core.o
1314 cat >> confdefs.h <<\EOF
1315 #define TRAD_HEADER "hosts/i386sco.h"
1316 EOF
1317
1318 ;;
1319 i[345]86-*-mach3*)
1320 COREFILE=trad-core.o
1321 cat >> confdefs.h <<\EOF
1322 #define TRAD_HEADER "hosts/i386mach3.h"
1323 EOF
1324
1325 ;;
1326 i[345]86-*-linux*)
1327 COREFILE=trad-core.o
1328 cat >> confdefs.h <<\EOF
1329 #define TRAD_HEADER "hosts/i386linux.h"
1330 EOF
1331
1332 ;;
1333 i[345]86-*-isc*) COREFILE=trad-core.o ;;
1334 i[345]86-*-aix*) COREFILE=aix386-core.o ;;
1335 i860-*-mach3* | i860-*-osf1*)
1336 COREFILE=trad-core.o
1337 cat >> confdefs.h <<\EOF
1338 #define TRAD_HEADER "hosts/i860mach3.h"
1339 EOF
1340
1341 ;;
1342 mips-dec-bsd*)
1343 COREFILE=trad-core.o
1344 cat >> confdefs.h <<\EOF
1345 #define TRAD_HEADER "hosts/mipsbsd.h"
1346 EOF
1347
1348 ;;
1349 mips-dec-mach3*)
1350 COREFILE=trad-core.o
1351 cat >> confdefs.h <<\EOF
1352 #define TRAD_HEADER "hosts/mipsmach3.h"
1353 EOF
1354
1355 ;;
1356 mips-*-netbsd*)
1357 COREFILE=netbsd-core.o
1358 ;;
1359 mips-dec-*)
1360 COREFILE=trad-core.o
1361 cat >> confdefs.h <<\EOF
1362 #define TRAD_HEADER "hosts/decstation.h"
1363 EOF
1364
1365 ;;
1366 mips-sgi-irix4*) COREFILE=irix-core.o ;;
1367 mips-sgi-irix5*) COREFILE=irix-core.o ;;
1368 mips-*-mach3*)
1369 COREFILE=trad-core.o
1370 cat >> confdefs.h <<\EOF
1371 #define TRAD_HEADER "hosts/mipsmach3.h"
1372 EOF
1373
1374 ;;
1375 mips-*-sysv4*) ;;
1376 mips-*-sysv* | mips-*-riscos*)
1377 COREFILE=trad-core.o
1378 cat >> confdefs.h <<\EOF
1379 #define TRAD_HEADER "hosts/riscos.h"
1380 EOF
1381
1382 ;;
1383 mips-sony-bsd*)
1384 COREFILE=trad-core.o
1385 cat >> confdefs.h <<\EOF
1386 #define TRAD_HEADER "hosts/news-mips".h
1387 EOF
1388
1389 ;;
1390 m68*-bull*-sysv*)
1391 COREFILE=trad-core.o
1392 cat >> confdefs.h <<\EOF
1393 #define TRAD_HEADER "hosts/dpx2.h"
1394 EOF
1395
1396 ;;
1397 m68*-hp-hpux*) COREFILE=hpux-core.o ;;
1398 m68*-hp-bsd*)
1399 COREFILE=trad-core.o
1400 cat >> confdefs.h <<\EOF
1401 #define TRAD_HEADER "hosts/hp300bsd.h"
1402 EOF
1403
1404 ;;
1405 m68*-*-linux*)
1406 COREFILE=trad-core.o
1407 cat >> confdefs.h <<\EOF
1408 #define TRAD_HEADER "hosts/m68klinux.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=netbsd-core.o
1428 ;;
1429 m68*-apple-aux*)
1430 COREFILE=trad-core.o
1431 cat >> confdefs.h <<\EOF
1432 #define TRAD_HEADER "hosts/m68kaux.h"
1433 EOF
1434
1435 ;;
1436 m88*-*-sysv4*) ;;
1437 m88*-motorola-sysv*) COREFILE=ptrace-core.o ;;
1438 m88*-*-mach3*)
1439 COREFILE=trad-core.o
1440 cat >> confdefs.h <<\EOF
1441 #define TRAD_HEADER "hosts/m88kmach3.h"
1442 EOF
1443
1444 ;;
1445 ns32k-pc532-mach)
1446 COREFILE=trad-core.o
1447 cat >> confdefs.h <<\EOF
1448 #define TRAD_HEADER "hosts/pc532mach.h"
1449 EOF
1450
1451 ;;
1452 ns32k-*-netbsd*)
1453 COREFILE=netbsd-core.o
1454 ;;
1455 rs6000-*-lynx*) COREFILE=lynx-core.o ;;
1456 rs6000-*-aix4*) COREFILE=rs6000-core.o ;;
1457 rs6000-*-*) COREFILE=rs6000-core.o ;;
1458 powerpc-*-aix4*) COREFILE=rs6000-core.o ;;
1459 powerpc-*-aix*) COREFILE=rs6000-core.o ;;
1460 sparc-*-netbsd*)
1461 COREFILE=netbsd-core.o
1462 ;;
1463 tahoe-*-*)
1464 COREFILE=trad-core.o
1465 cat >> confdefs.h <<\EOF
1466 #define TRAD_HEADER "hosts/tahoe.h"
1467 EOF
1468
1469 ;;
1470 vax-*-ultrix2*)
1471 COREFILE=trad-core.o
1472 cat >> confdefs.h <<\EOF
1473 #define TRAD_HEADER "hosts/vaxult2.h"
1474 EOF
1475
1476 ;;
1477 vax-*-ultrix*)
1478 COREFILE=trad-core.o
1479 cat >> confdefs.h <<\EOF
1480 #define TRAD_HEADER "hosts/vaxult2.h"
1481 EOF
1482
1483 ;;
1484 vax-*-*)
1485 COREFILE=trad-core.o
1486 cat >> confdefs.h <<\EOF
1487 #define TRAD_HEADER "hosts/vaxbsd.h"
1488 EOF
1489
1490 ;;
1491 esac
1492
1493 case "$COREFILE" in
1494 aix386-core.o) COREFLAG=-DAIX386_CORE ;;
1495 hppabsd-core.o) COREFLAG=-DHPPABSD_CORE ;;
1496 hpux-core.o) COREFLAG=-DHPUX_CORE ;;
1497 irix-core.o) COREFLAG=-DIRIX_CORE ;;
1498 lynx-core.o) COREFLAG=-DLYNX_CORE ;;
1499 osf-core.o) COREFLAG=-DOSF_CORE ;;
1500 ptrace-core.o) COREFLAG=-DPTRACE_CORE ;;
1501 rs6000-core.o) COREFLAG="$COREFLAG -DAIX_CORE" ;;
1502 trad-core.o) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
1503 esac
1504
1505 # The ELF code uses the native <sys/procfs.h> to handle core files.
1506 # Define HAVE_SYS_PROCFS_H if the file exists and defines
1507 # prstatus_t.
1508 echo $ac_n "checking for sys/procfs.h""... $ac_c" 1>&6
1509 if eval "test \"`echo '$''{'bfd_cv_header_sys_procfs_h'+set}'`\" = set"; then
1510 echo $ac_n "(cached) $ac_c" 1>&6
1511 else
1512 cat > conftest.$ac_ext <<EOF
1513 #line 1514 "configure"
1514 #include "confdefs.h"
1515 #include <sys/procfs.h>
1516 int main() { return 0; }
1517 int t() {
1518 prstatus_t t;
1519 ; return 0; }
1520 EOF
1521 if eval $ac_compile; then
1522 rm -rf conftest*
1523 bfd_cv_header_sys_procfs_h=yes
1524 else
1525 rm -rf conftest*
1526 bfd_cv_header_sys_procfs_h=no
1527 fi
1528 rm -f conftest*
1529
1530 fi
1531
1532 echo "$ac_t""$bfd_cv_header_sys_procfs_h" 1>&6
1533 if test $bfd_cv_header_sys_procfs_h = yes; then
1534 cat >> confdefs.h <<\EOF
1535 #define HAVE_SYS_PROCFS_H 1
1536 EOF
1537
1538 fi
1539
1540 fi
1541
1542
1543
1544 # target stuff:
1545
1546 # Canonicalize the secondary target names.
1547 if test -n "$enable_targets" ; then
1548 for targ in `echo $enable_targets | sed 's/,/ /g'`
1549 do
1550 result=`$ac_config_sub $targ 2>/dev/null`
1551 if test -n "$result" ; then
1552 canon_targets="$canon_targets $result"
1553 else
1554 # Allow targets that config.sub doesn't recognize, like "all".
1555 canon_targets="$canon_targets $targ"
1556 fi
1557 done
1558 fi
1559
1560 all_targets=false
1561 defvec=
1562 selvecs=
1563 selarchs=
1564 TDEFINES=
1565 for targ in $target $canon_targets
1566 do
1567 if test "x$targ" = "xall"; then
1568 all_targets=true
1569 else
1570 . $srcdir/config.bfd
1571 if test "x$targ" = "x$target"; then
1572 defvec=$targ_defvec
1573 fi
1574 selvecs="$selvecs $targ_defvec $targ_selvecs"
1575 selarchs="$selarchs $targ_archs"
1576 TDEFINES="$TDEFINES $targ_cflags"
1577 fi
1578 done
1579
1580
1581 # This processing still needs to be done if we're to decide properly whether
1582 # 64-bit support needs to be compiled in. Currently, it will be included if
1583 # the default or any other explicitly requested target requires it; it
1584 # will not be included on a 32-bit host if no 64-bit target is requested, and
1585 # no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
1586 # used.
1587
1588 # uniq the default and selected vectors in all the configured targets.
1589 f=""
1590 for i in $selvecs ; do
1591 case " $f " in
1592 *" $i "*) ;;
1593 *) f="$f $i" ;;
1594 esac
1595 done
1596 selvecs="$f"
1597
1598 # uniq the architectures in all the configured targets.
1599 f=""
1600 for i in $selarchs ; do
1601 case " $f " in
1602 *" $i "*) ;;
1603 *) f="$f $i" ;;
1604 esac
1605 done
1606 selarchs="$f"
1607
1608 # Target backend .o files.
1609 tb=
1610
1611 elf="elf.o elflink.o"
1612
1613 for vec in $selvecs
1614 do
1615 case "$vec" in
1616 # This list is alphabetized to make it easy to compare
1617 # with the two vector lists in targets.c.
1618 a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;;
1619 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o" ;;
1620 armcoff_little_vec) tb="$tb coff-arm.o cofflink.o " ;;
1621 armcoff_big_vec) tb="$tb coff-arm.o cofflink.o " ;;
1622 armpe_little_vec) tb="$tb pe-arm.o cofflink.o " ;;
1623 armpe_big_vec) tb="$tb pe-arm.o cofflink.o " ;;
1624 armpei_little_vec) tb="$tb pei-arm.o cofflink.o " ;;
1625 armpei_big_vec) tb="$tb pei-arm.o cofflink.o " ;;
1626 aout0_big_vec) tb="$tb aout0.o aout32.o" ;;
1627 aout_arm_big_vec) tb="$tb aout-arm.o aout32.o" ;;
1628 aout_arm_little_vec) tb="$tb aout-arm.o aout32.o" ;;
1629 aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o" ;;
1630 aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o" ;;
1631 apollocoff_vec) tb="$tb coff-apollo.o" ;;
1632 b_out_vec_big_host) tb="$tb bout.o aout32.o" ;;
1633 b_out_vec_little_host) tb="$tb bout.o aout32.o" ;;
1634 # start-sanitize-arc
1635 bfd_elf32_littlearc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
1636 bfd_elf32_bigarc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
1637 # end-sanitize-arc
1638 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
1639 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
1640 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o $elf" ;;
1641 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o $elf" ;;
1642 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o $elf" ;;
1643 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
1644 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
1645 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o $elf" ;;
1646 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o $elf" ;;
1647 bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
1648 bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
1649 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o $elf" ;;
1650 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
1651 target64=true ;;
1652 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
1653 target64=true ;;
1654 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o $elf"
1655 target64=true ;;
1656 cisco_core_vec) tb="$tb cisco-core.o" ;;
1657 demo_64_vec) tb="$tb demo64.o aout64.o"
1658 target64=true ;;
1659 ecoff_big_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
1660 ecoff_little_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
1661 ecoffalpha_little_vec) tb="$tb coff-alpha.o ecoff.o ecofflink.o"
1662 target64=true ;;
1663 h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
1664 h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
1665 host_aout_vec) tb="$tb host-aout.o aout32.o" ;;
1666 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o" ;;
1667 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o" ;;
1668 i386aout_vec) tb="$tb i386aout.o aout32.o" ;;
1669 i386bsd_vec) tb="$tb i386bsd.o aout32.o" ;;
1670 i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;;
1671 i386dynix_vec) tb="$tb i386dynix.o aout32.o" ;;
1672 i386freebsd_vec) tb="$tb i386freebsd.o aout32.o" ;;
1673 i386msdos_vec) tb="$tb i386msdos.o" ;;
1674 i386pe_vec) tb="$tb pe-i386.o cofflink.o " ;;
1675 i386pei_vec) tb="$tb pei-i386.o cofflink.o" ;;
1676 i386linux_vec) tb="$tb i386linux.o aout32.o" ;;
1677 i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o" ;;
1678 i386lynx_coff_vec) tb="$tb cf-i386lynx.o cofflink.o lynx-core.o" ;;
1679 i386mach3_vec) tb="$tb i386mach3.o aout32.o" ;;
1680 i386netbsd_vec) tb="$tb i386netbsd.o aout32.o" ;;
1681 i386os9k_vec) tb="$tb i386os9k.o aout32.o" ;;
1682 i860coff_vec) tb="$tb coff-i860.o cofflink.o" ;;
1683 icoff_big_vec) tb="$tb coff-i960.o cofflink.o" ;;
1684 icoff_little_vec) tb="$tb coff-i960.o cofflink.o" ;;
1685 ieee_vec) tb="$tb ieee.o" ;;
1686 m68kcoff_vec) tb="$tb coff-m68k.o cofflink.o" ;;
1687 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
1688 m68klinux_vec) tb="$tb m68klinux.o aout32.o" ;;
1689 m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o" ;;
1690 m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o" ;;
1691 m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o" ;;
1692 m68k4knetbsd_vec) tb="$tb m68k4knetbsd.o aout32.o" ;;
1693 m68kaux_coff_vec) tb="$tb coff-aux.o coff-m68k.o cofflink.o" ;;
1694 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
1695 newsos3_vec) tb="$tb newsos3.o aout32.o" ;;
1696 nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
1697 nlm32_sparc_vec) tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;;
1698 nlm32_alpha_vec) tb="$tb nlm32-alpha.o nlm32.o nlm.o"
1699 target64=true ;;
1700 riscix_vec) tb="$tb aout32.o riscix.o" ;;
1701 nlm32_powerpc_vec) tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;;
1702 pc532netbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o" ;;
1703 pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o" ;;
1704 pmac_xcoff_vec) tb="$tb coff-pmac.o xcofflink.o" ;;
1705 rs6000coff_vec) tb="$tb coff-rs6000.o xcofflink.o" ;;
1706 bfd_powerpc_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
1707 bfd_powerpcle_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
1708 bfd_powerpc_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
1709 bfd_powerpcle_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
1710 shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
1711 # start-sanitize-rce
1712 rce_aout_vec) tb="$tb aout-rce.o aout32.o" ;;
1713 # end-sanitize-rce
1714 shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
1715 som_vec) tb="$tb som.o" ;;
1716 sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o" ;;
1717 sparclynx_coff_vec) tb="$tb cf-sparclynx.o lynx-core.o" ;;
1718 sparcnetbsd_vec) tb="$tb sparcnetbsd.o aout32.o" ;;
1719 sparccoff_vec) tb="$tb coff-sparc.o" ;;
1720 srec_vec) tb="$tb srec.o" ;;
1721 sunos_big_vec) tb="$tb sunos.o aout32.o" ;;
1722 symbolsrec_vec) tb="$tb srec.o" ;;
1723 tekhex_vec) tb="$tb tekhex.o" ;;
1724 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
1725 z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;;
1726 w65_vec) tb="$tb coff-w65.o reloc16.o" ;;
1727 versados_vec) tb="$tb versados.o" ;;
1728
1729 "") ;;
1730 *) { echo "configure: error: *** unknown target vector $vec" 1>&2; exit 1; } ;;
1731 esac
1732 done
1733
1734 # Target architecture .o files.
1735 ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
1736
1737 # Weed out duplicate .o files.
1738 f=""
1739 for i in $tb ; do
1740 case " $f " in
1741 *" $i "*) ;;
1742 *) f="$f $i" ;;
1743 esac
1744 done
1745 tb="$f"
1746
1747 f=""
1748 for i in $ta ; do
1749 case " $f " in
1750 *" $i "*) ;;
1751 *) f="$f $i" ;;
1752 esac
1753 done
1754 ta="$f"
1755
1756 bfd_backends="$tb"
1757 bfd_machines="$ta"
1758
1759 if test x${all_targets} = xtrue ; then
1760 bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
1761 bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
1762 selvecs=
1763 selarchs=
1764 else # all_targets is true
1765 # Only set these if they will be nonempty, for the clever echo.
1766 test -n "$selvecs" &&
1767 selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
1768 test -n "$selarchs" &&
1769 selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
1770 fi # all_targets is true
1771
1772 case ${host64}-${target64}-${want64} in
1773 *true*)
1774 wordsize=64
1775 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
1776 ;;
1777 false-false-false)
1778 wordsize=32
1779 all_backends='$(BFD32_BACKENDS)'
1780 ;;
1781 esac
1782
1783
1784
1785
1786
1787
1788 tdefaults=""
1789 test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
1790 test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
1791 test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
1792
1793
1794 for ac_func in valloc getpagesize
1795 do
1796 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1797 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1798 echo $ac_n "(cached) $ac_c" 1>&6
1799 else
1800 cat > conftest.$ac_ext <<EOF
1801 #line 1802 "configure"
1802 #include "confdefs.h"
1803 /* System header to define __stub macros and hopefully few prototypes,
1804 which can conflict with char $ac_func(); below. */
1805 #include <assert.h>
1806 /* Override any gcc2 internal prototype to avoid an error. */
1807 char $ac_func();
1808
1809 int main() { return 0; }
1810 int t() {
1811
1812 /* The GNU C library defines this for functions which it implements
1813 to always fail with ENOSYS. Some functions are actually named
1814 something starting with __ and the normal name is an alias. */
1815 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1816 choke me
1817 #else
1818 $ac_func();
1819 #endif
1820
1821 ; return 0; }
1822 EOF
1823 if eval $ac_link; then
1824 rm -rf conftest*
1825 eval "ac_cv_func_$ac_func=yes"
1826 else
1827 rm -rf conftest*
1828 eval "ac_cv_func_$ac_func=no"
1829 fi
1830 rm -f conftest*
1831
1832 fi
1833 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1834 echo "$ac_t""yes" 1>&6
1835 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1836 cat >> confdefs.h <<EOF
1837 #define $ac_tr_func 1
1838 EOF
1839
1840 else
1841 echo "$ac_t""no" 1>&6
1842 fi
1843 done
1844
1845 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
1846 if eval "test \"`echo '$''{'ac_cv_func_mmap'+set}'`\" = set"; then
1847 echo $ac_n "(cached) $ac_c" 1>&6
1848 else
1849 if test "$cross_compiling" = yes; then
1850 ac_cv_func_mmap=no
1851 else
1852 cat > conftest.$ac_ext <<EOF
1853 #line 1854 "configure"
1854 #include "confdefs.h"
1855
1856 /* Thanks to Mike Haertel and Jim Avera for this test. */
1857 #include <sys/types.h>
1858 #include <fcntl.h>
1859 #include <sys/mman.h>
1860
1861 #ifndef HAVE_GETPAGESIZE
1862 # include <sys/param.h>
1863 # ifdef EXEC_PAGESIZE
1864 # define getpagesize() EXEC_PAGESIZE
1865 # else
1866 # ifdef NBPG
1867 # define getpagesize() NBPG * CLSIZE
1868 # ifndef CLSIZE
1869 # define CLSIZE 1
1870 # endif
1871 # else
1872 # ifdef NBPC
1873 # define getpagesize() NBPC
1874 # else
1875 # define getpagesize() PAGESIZE /* SVR4 */
1876 # endif
1877 # endif
1878 # endif
1879 #endif
1880
1881 #ifndef HAVE_VALLOC
1882 # define valloc malloc
1883 #endif
1884
1885 #ifdef __cplusplus
1886 extern "C" { void *valloc(unsigned), *malloc(unsigned); }
1887 #else
1888 char *valloc(), *malloc();
1889 #endif
1890
1891 int
1892 main()
1893 {
1894 char *buf1, *buf2, *buf3;
1895 int i = getpagesize(), j;
1896 int i2 = i * 2;
1897 int fd;
1898
1899 buf1 = (char *)valloc(i2);
1900 buf2 = (char *)valloc(i);
1901 buf3 = (char *)malloc(i2);
1902 for (j = 0; j < i2; ++j)
1903 *(buf1 + j) = rand();
1904 fd = open("conftestmmap", O_CREAT | O_RDWR, 0666);
1905 write(fd, buf1, i2);
1906 mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0);
1907 for (j = 0; j < i; ++j)
1908 if (*(buf1 + j) != *(buf2 + j))
1909 exit(1);
1910 lseek(fd, (long)i, 0);
1911 read(fd, buf2, i); /* read into mapped memory -- file should not change */
1912 /* (it does in i386 SVR4.0 - Jim Avera, jima@netcom.com) */
1913 lseek(fd, (long)0, 0);
1914 read(fd, buf3, i2);
1915 for (j = 0; j < i2; ++j)
1916 if (*(buf1 + j) != *(buf3 + j))
1917 exit(1);
1918 exit(0);
1919 }
1920
1921 EOF
1922 eval $ac_link
1923 if test -s conftest && (./conftest; exit) 2>/dev/null; then
1924 ac_cv_func_mmap=yes
1925 else
1926 ac_cv_func_mmap=no
1927 fi
1928 fi
1929 rm -fr conftest*
1930 fi
1931
1932 echo "$ac_t""$ac_cv_func_mmap" 1>&6
1933 if test $ac_cv_func_mmap = yes; then
1934 cat >> confdefs.h <<\EOF
1935 #define HAVE_MMAP 1
1936 EOF
1937
1938 fi
1939
1940 for ac_func in madvise mprotect
1941 do
1942 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1943 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1944 echo $ac_n "(cached) $ac_c" 1>&6
1945 else
1946 cat > conftest.$ac_ext <<EOF
1947 #line 1948 "configure"
1948 #include "confdefs.h"
1949 /* System header to define __stub macros and hopefully few prototypes,
1950 which can conflict with char $ac_func(); below. */
1951 #include <assert.h>
1952 /* Override any gcc2 internal prototype to avoid an error. */
1953 char $ac_func();
1954
1955 int main() { return 0; }
1956 int t() {
1957
1958 /* The GNU C library defines this for functions which it implements
1959 to always fail with ENOSYS. Some functions are actually named
1960 something starting with __ and the normal name is an alias. */
1961 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1962 choke me
1963 #else
1964 $ac_func();
1965 #endif
1966
1967 ; return 0; }
1968 EOF
1969 if eval $ac_link; then
1970 rm -rf conftest*
1971 eval "ac_cv_func_$ac_func=yes"
1972 else
1973 rm -rf conftest*
1974 eval "ac_cv_func_$ac_func=no"
1975 fi
1976 rm -f conftest*
1977
1978 fi
1979 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1980 echo "$ac_t""yes" 1>&6
1981 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1982 cat >> confdefs.h <<EOF
1983 #define $ac_tr_func 1
1984 EOF
1985
1986 else
1987 echo "$ac_t""no" 1>&6
1988 fi
1989 done
1990
1991 case ${want_mmap}+${ac_cv_func_mmap} in
1992 true+yes ) cat >> confdefs.h <<\EOF
1993 #define USE_MMAP 1
1994 EOF
1995 ;;
1996 esac
1997
1998 rm -f doc/config.status
1999 trap '' 1 2 15
2000 cat > confcache <<\EOF
2001 # This file is a shell script that caches the results of configure
2002 # tests run on this system so they can be shared between configure
2003 # scripts and configure runs. It is not useful on other systems.
2004 # If it contains results you don't want to keep, you may remove or edit it.
2005 #
2006 # By default, configure uses ./config.cache as the cache file,
2007 # creating it if it does not exist already. You can give configure
2008 # the --cache-file=FILE option to use a different cache file; that is
2009 # what configure does when it calls configure scripts in
2010 # subdirectories, so they share the cache.
2011 # Giving --cache-file=/dev/null disables caching, for debugging configure.
2012 # config.status only pays attention to the cache file if you give it the
2013 # --recheck option to rerun configure.
2014 #
2015 EOF
2016 # Ultrix sh set writes to stderr and can't be redirected directly,
2017 # and sets the high bit in the cache file unless we assign to the vars.
2018 (set) 2>&1 |
2019 sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
2020 >> confcache
2021 if cmp -s $cache_file confcache; then
2022 :
2023 else
2024 if test -w $cache_file; then
2025 echo "updating cache $cache_file"
2026 cat confcache > $cache_file
2027 else
2028 echo "not updating unwritable cache $cache_file"
2029 fi
2030 fi
2031 rm -f confcache
2032
2033 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
2034
2035 test "x$prefix" = xNONE && prefix=$ac_default_prefix
2036 # Let make expand exec_prefix.
2037 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2038
2039 # Any assignment to VPATH causes Sun make to only execute
2040 # the first set of double-colon rules, so remove it if not needed.
2041 # If there is a colon in the path, we need to keep it.
2042 if test "x$srcdir" = x.; then
2043 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
2044 fi
2045
2046 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2047
2048 DEFS=-DHAVE_CONFIG_H
2049
2050 # Without the "./", some shells look in PATH for config.status.
2051 : ${CONFIG_STATUS=./config.status}
2052
2053 echo creating $CONFIG_STATUS
2054 rm -f $CONFIG_STATUS
2055 cat > $CONFIG_STATUS <<EOF
2056 #! /bin/sh
2057 # Generated automatically by configure.
2058 # Run this file to recreate the current configuration.
2059 # This directory was configured as follows,
2060 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2061 #
2062 # $0 $ac_configure_args
2063 #
2064 # Compiler output produced by configure, useful for debugging
2065 # configure, is in ./config.log if it exists.
2066
2067 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
2068 for ac_option
2069 do
2070 case "\$ac_option" in
2071 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
2072 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
2073 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
2074 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
2075 echo "$CONFIG_STATUS generated by autoconf version 2.7"
2076 exit 0 ;;
2077 -help | --help | --hel | --he | --h)
2078 echo "\$ac_cs_usage"; exit 0 ;;
2079 *) echo "\$ac_cs_usage"; exit 1 ;;
2080 esac
2081 done
2082
2083 ac_given_srcdir=$srcdir
2084 ac_given_INSTALL="$INSTALL"
2085
2086 trap 'rm -fr `echo "Makefile doc/Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
2087 EOF
2088 cat >> $CONFIG_STATUS <<EOF
2089
2090 # Protect against being on the right side of a sed subst in config.status.
2091 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2092 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
2093 $ac_vpsub
2094 $extrasub
2095 s%@CFLAGS@%$CFLAGS%g
2096 s%@CPPFLAGS@%$CPPFLAGS%g
2097 s%@CXXFLAGS@%$CXXFLAGS%g
2098 s%@DEFS@%$DEFS%g
2099 s%@LDFLAGS@%$LDFLAGS%g
2100 s%@LIBS@%$LIBS%g
2101 s%@exec_prefix@%$exec_prefix%g
2102 s%@prefix@%$prefix%g
2103 s%@program_transform_name@%$program_transform_name%g
2104 s%@bindir@%$bindir%g
2105 s%@sbindir@%$sbindir%g
2106 s%@libexecdir@%$libexecdir%g
2107 s%@datadir@%$datadir%g
2108 s%@sysconfdir@%$sysconfdir%g
2109 s%@sharedstatedir@%$sharedstatedir%g
2110 s%@localstatedir@%$localstatedir%g
2111 s%@libdir@%$libdir%g
2112 s%@includedir@%$includedir%g
2113 s%@oldincludedir@%$oldincludedir%g
2114 s%@infodir@%$infodir%g
2115 s%@mandir@%$mandir%g
2116 s%@host@%$host%g
2117 s%@host_alias@%$host_alias%g
2118 s%@host_cpu@%$host_cpu%g
2119 s%@host_vendor@%$host_vendor%g
2120 s%@host_os@%$host_os%g
2121 s%@target@%$target%g
2122 s%@target_alias@%$target_alias%g
2123 s%@target_cpu@%$target_cpu%g
2124 s%@target_vendor@%$target_vendor%g
2125 s%@target_os@%$target_os%g
2126 s%@build@%$build%g
2127 s%@build_alias@%$build_alias%g
2128 s%@build_cpu@%$build_cpu%g
2129 s%@build_vendor@%$build_vendor%g
2130 s%@build_os@%$build_os%g
2131 s%@CC@%$CC%g
2132 s%@HDEFINES@%$HDEFINES%g
2133 s%@AR@%$AR%g
2134 s%@RANLIB@%$RANLIB%g
2135 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
2136 s%@INSTALL_DATA@%$INSTALL_DATA%g
2137 s%@ALLLIBS@%$ALLLIBS%g
2138 s%@PICFLAG@%$PICFLAG%g
2139 s%@SHLIB@%$SHLIB%g
2140 s%@SHLIB_CC@%$SHLIB_CC%g
2141 s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g
2142 s%@COMMON_SHLIB@%$COMMON_SHLIB%g
2143 s%@PICLIST@%$PICLIST%g
2144 s%@SHLINK@%$SHLINK%g
2145 s%@HOST_64BIT_LONG@%$HOST_64BIT_LONG%g
2146 s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
2147 s%@CPP@%$CPP%g
2148 s%@COREFILE@%$COREFILE%g
2149 s%@COREFLAG@%$COREFLAG%g
2150 s%@TDEFINES@%$TDEFINES%g
2151 s%@wordsize@%$wordsize%g
2152 s%@all_backends@%$all_backends%g
2153 s%@bfd_backends@%$bfd_backends%g
2154 s%@bfd_machines@%$bfd_machines%g
2155 s%@tdefaults@%$tdefaults%g
2156
2157 CEOF
2158 EOF
2159 cat >> $CONFIG_STATUS <<EOF
2160
2161 CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile"}
2162 EOF
2163 cat >> $CONFIG_STATUS <<\EOF
2164 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
2165 # Support "outfile[:infile]", defaulting infile="outfile.in".
2166 case "$ac_file" in
2167 *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
2168 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2169 *) ac_file_in="${ac_file}.in" ;;
2170 esac
2171
2172 # Adjust relative srcdir, etc. for subdirectories.
2173
2174 # Remove last slash and all that follows it. Not all systems have dirname.
2175 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2176 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2177 # The file is in a subdirectory.
2178 test ! -d "$ac_dir" && mkdir "$ac_dir"
2179 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2180 # A "../" for each directory in $ac_dir_suffix.
2181 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2182 else
2183 ac_dir_suffix= ac_dots=
2184 fi
2185
2186 case "$ac_given_srcdir" in
2187 .) srcdir=.
2188 if test -z "$ac_dots"; then top_srcdir=.
2189 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2190 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2191 *) # Relative path.
2192 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2193 top_srcdir="$ac_dots$ac_given_srcdir" ;;
2194 esac
2195
2196 case "$ac_given_INSTALL" in
2197 [/$]*) INSTALL="$ac_given_INSTALL" ;;
2198 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2199 esac
2200 echo creating "$ac_file"
2201 rm -f "$ac_file"
2202 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2203 case "$ac_file" in
2204 *Makefile*) ac_comsub="1i\\
2205 # $configure_input" ;;
2206 *) ac_comsub= ;;
2207 esac
2208 sed -e "$ac_comsub
2209 s%@configure_input@%$configure_input%g
2210 s%@srcdir@%$srcdir%g
2211 s%@top_srcdir@%$top_srcdir%g
2212 s%@INSTALL@%$INSTALL%g
2213 " -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
2214 fi; done
2215 rm -f conftest.subs
2216
2217 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
2218 # NAME is the cpp macro being defined and VALUE is the value it is being given.
2219 #
2220 # ac_d sets the value in "#define NAME VALUE" lines.
2221 ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
2222 ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
2223 ac_dC='\3'
2224 ac_dD='%g'
2225 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
2226 ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
2227 ac_uB='\([ ]\)%\1#\2define\3'
2228 ac_uC=' '
2229 ac_uD='\4%g'
2230 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
2231 ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
2232 ac_eB='$%\1#\2define\3'
2233 ac_eC=' '
2234 ac_eD='%g'
2235
2236 CONFIG_HEADERS=${CONFIG_HEADERS-"config.h:config.in"}
2237 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
2238 # Support "outfile[:infile]", defaulting infile="outfile.in".
2239 case "$ac_file" in
2240 *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
2241 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2242 *) ac_file_in="${ac_file}.in" ;;
2243 esac
2244
2245 echo creating $ac_file
2246
2247 rm -f conftest.frag conftest.in conftest.out
2248 cp $ac_given_srcdir/$ac_file_in conftest.in
2249
2250 EOF
2251
2252 # Transform confdefs.h into a sed script conftest.vals that substitutes
2253 # the proper values into config.h.in to produce config.h. And first:
2254 # Protect against being on the right side of a sed subst in config.status.
2255 # Protect against being in an unquoted here document in config.status.
2256 rm -f conftest.vals
2257 cat > conftest.hdr <<\EOF
2258 s/[\\&%]/\\&/g
2259 s%[\\$`]%\\&%g
2260 s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
2261 s%ac_d%ac_u%gp
2262 s%ac_u%ac_e%gp
2263 EOF
2264 sed -n -f conftest.hdr confdefs.h > conftest.vals
2265 rm -f conftest.hdr
2266
2267 # This sed command replaces #undef with comments. This is necessary, for
2268 # example, in the case of _POSIX_SOURCE, which is predefined and required
2269 # on some systems where configure will not decide to define it.
2270 cat >> conftest.vals <<\EOF
2271 s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
2272 EOF
2273
2274 # Break up conftest.vals because some shells have a limit on
2275 # the size of here documents, and old seds have small limits too.
2276 # Maximum number of lines to put in a single here document.
2277 ac_max_here_lines=12
2278
2279 rm -f conftest.tail
2280 while :
2281 do
2282 ac_lines=`grep -c . conftest.vals`
2283 # grep -c gives empty output for an empty file on some AIX systems.
2284 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
2285 # Write a limited-size here document to conftest.frag.
2286 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
2287 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
2288 echo 'CEOF
2289 sed -f conftest.frag conftest.in > conftest.out
2290 rm -f conftest.in
2291 mv conftest.out conftest.in
2292 ' >> $CONFIG_STATUS
2293 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
2294 rm -f conftest.vals
2295 mv conftest.tail conftest.vals
2296 done
2297 rm -f conftest.vals
2298
2299 cat >> $CONFIG_STATUS <<\EOF
2300 rm -f conftest.frag conftest.h
2301 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
2302 cat conftest.in >> conftest.h
2303 rm -f conftest.in
2304 if cmp -s $ac_file conftest.h 2>/dev/null; then
2305 echo "$ac_file is unchanged"
2306 rm -f conftest.h
2307 else
2308 rm -f $ac_file
2309 mv conftest.h $ac_file
2310 fi
2311 fi; done
2312
2313
2314 case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac
2315 exit 0
2316 EOF
2317 chmod +x $CONFIG_STATUS
2318 rm -fr confdefs* $ac_clean_files
2319 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2320