remote-sim.h moved to include directory
[deliverable/binutils-gdb.git] / bfd / configure
CommitLineData
8c693660
KR
1#! /bin/sh
2
3# Guess values for system-dependent variables and create Makefiles.
fd8d7c31 4# Generated automatically using autoconf version 2.10
a4322a77 5# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
8c693660
KR
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:
11ac_help=
12ac_default_prefix=/usr/local
13# Any additions from configure.in:
14ac_help="$ac_help
e818c22e 15 --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)"
8c693660 16ac_help="$ac_help
e818c22e 17 --enable-targets alternative target configurations"
44f795f7
ILT
18ac_help="$ac_help
19 --enable-shared build shared BFD library"
20ac_help="$ac_help
21 --enable-commonbfdlib build shared BFD/opcodes/libiberty library"
85e493f0
ILT
22ac_help="$ac_help
23 --with-mmap try using mmap for BFD input files if available"
8c693660
KR
24
25# Initialize some variables set by options.
26# The variables have the same names as the options, with
27# dashes changed to underlines.
28build=NONE
29cache_file=./config.cache
30exec_prefix=NONE
31host=NONE
32no_create=
33nonopt=NONE
34no_recursion=
35prefix=NONE
36program_prefix=NONE
37program_suffix=NONE
38program_transform_name=s,x,x,
39silent=
40site=
41srcdir=
42target=NONE
43verbose=
44x_includes=NONE
45x_libraries=NONE
85e493f0
ILT
46bindir='${exec_prefix}/bin'
47sbindir='${exec_prefix}/sbin'
48libexecdir='${exec_prefix}/libexec'
49datadir='${prefix}/share'
50sysconfdir='${prefix}/etc'
51sharedstatedir='${prefix}/com'
52localstatedir='${prefix}/var'
53libdir='${exec_prefix}/lib'
54includedir='${prefix}/include'
55oldincludedir='/usr/include'
56infodir='${prefix}/info'
57mandir='${prefix}/man'
8c693660
KR
58
59# Initialize some other variables.
60subdirs=
85e493f0 61MFLAGS= MAKEFLAGS=
8c693660
KR
62
63ac_prev=
64for ac_option
65do
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
85e493f0
ILT
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)
8c693660 89 ac_prev=build ;;
85e493f0 90 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
8c693660
KR
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
85e493f0
ILT
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
8c693660
KR
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
145Usage: configure [options] [host]
146Options: [defaults in brackets after descriptions]
147Configuration:
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
153Directory and file names:
154 --prefix=PREFIX install architecture-independent files in PREFIX
155 [$ac_default_prefix]
85e493f0 156 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
8c693660 157 [same as prefix]
85e493f0
ILT
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]
8c693660
KR
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
85e493f0
ILT
175 --program-transform-name=PROGRAM
176 run sed PROGRAM on installed program names
177EOF
178 cat << EOF
8c693660
KR
179Host 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]
183Features 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
8c693660 190EOF
85e493f0
ILT
191 if test -n "$ac_help"; then
192 echo "--enable and --with options recognized:$ac_help"
193 fi
8c693660
KR
194 exit 0 ;;
195
196 -host | --host | --hos | --ho)
197 ac_prev=host ;;
198 -host=* | --host=* | --hos=* | --ho=*)
199 host="$ac_optarg" ;;
200
85e493f0
ILT
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
8c693660
KR
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
85e493f0
ILT
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
8c693660
KR
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
85e493f0
ILT
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
8c693660
KR
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
85e493f0
ILT
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
8c693660
KR
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)
fd8d7c31 343 echo "configure generated by autoconf version 2.10"
8c693660
KR
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
85e493f0 389 *)
8c693660
KR
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
400done
401
402if test -n "$ac_prev"; then
403 { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
404fi
405
406trap '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
416if test "$silent" = yes; then
417 exec 6>/dev/null
418else
419 exec 6>&1
420fi
421exec 5>./config.log
422
423echo "\
424This file contains any messages produced by compilers while
425running 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.
430ac_configure_args=
431for ac_arg
432do
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
442done
443
444# NLS nuisances.
fd8d7c31
MH
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).
dfc7020d 448if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
fd8d7c31 449if test "${LANG+set}" = set; then LANG=C; export LANG; fi
8c693660
KR
450
451# confdefs.h avoids OS command line length limits that DEFS can exceed.
452rm -rf conftest* confdefs.h
453# AIX cpp loses on an empty file, so make sure it contains at least a newline.
454echo > 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.
458ac_unique_file=libbfd.c
459
460# Find the source files, if location was not specified.
461if 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
471else
472 ac_srcdir_defaulted=no
473fi
474if 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
480fi
481srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
482
483# Prefer explicitly selected file to automatically selected ones.
484if 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
490fi
491for 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
496done
497
498if test -r "$cache_file"; then
499 echo "loading cache $cache_file"
500 . $cache_file
501else
502 echo "creating cache $cache_file"
503 > $cache_file
504fi
505
506ac_ext=c
507# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
986cf3b8
ILT
508ac_cpp='$CPP $CPPFLAGS'
509ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
510ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
8c693660
KR
511
512if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
513 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
514 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
515 ac_n= ac_c='
516' ac_t=' '
517 else
518 ac_n=-n ac_c= ac_t=
519 fi
520else
521 ac_n= ac_c='\c' ac_t=
522fi
523
524
525
526# Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given.
85e493f0
ILT
527if test "${enable_64_bit_bfd+set}" = set; then
528 enableval="$enable_64_bit_bfd"
a52a3ce8 529 case "${enableval}" in
8c693660
KR
530 yes) want64=true ;;
531 no) want64=false ;;
532 *) { echo "configure: error: bad value ${enableval} for 64-bit-bfd option" 1>&2; exit 1; } ;;
533esac
534else
535 want64=false
536fi
537# Check whether --enable-targets or --disable-targets was given.
85e493f0
ILT
538if test "${enable_targets+set}" = set; then
539 enableval="$enable_targets"
8c693660
KR
540 case "${enableval}" in
541 yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
542 ;;
543 no) enable_targets= ;;
544 *) enable_targets=$enableval ;;
545esac
546fi
44f795f7
ILT
547# Check whether --enable-shared or --disable-shared was given.
548if test "${enable_shared+set}" = set; then
549 enableval="$enable_shared"
550 case "${enableval}" in
551 yes) shared=true ;;
552 no) shared=false ;;
a4322a77
ILT
553 *bfd*) shared=true ;;
554 *) shared=false ;;
44f795f7
ILT
555esac
556fi
557# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given.
558if test "${enable_commonbfdlib+set}" = set; then
559 enableval="$enable_commonbfdlib"
560 case "${enableval}" in
561 yes) commonbfdlib=true ;;
562 no) commonbfdlib=false ;;
563 *) { echo "configure: error: bad value ${enableval} for BFD commonbfdlib option" 1>&2; exit 1; } ;;
564esac
565fi
85e493f0
ILT
566# Check whether --with-mmap or --without-mmap was given.
567if test "${with_mmap+set}" = set; then
568 withval="$with_mmap"
569 case "${withval}" in
570 yes) want_mmap=true ;;
571 no) want_mmap=false ;;
572 *) { echo "configure: error: bad value ${withval} for BFD with-mmap option" 1>&2; exit 1; } ;;
573esac
574else
575 want_mmap=false
576fi
8c693660 577
b7577823
ILT
578
579
8c693660
KR
580ac_aux_dir=
581for ac_dir in `cd $srcdir/..;pwd` $srcdir/`cd $srcdir/..;pwd`; do
582 if test -f $ac_dir/install-sh; then
583 ac_aux_dir=$ac_dir
584 ac_install_sh="$ac_aux_dir/install-sh -c"
585 break
586 elif test -f $ac_dir/install.sh; then
587 ac_aux_dir=$ac_dir
588 ac_install_sh="$ac_aux_dir/install.sh -c"
589 break
590 fi
591done
592if test -z "$ac_aux_dir"; then
593 { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir/..;pwd` $srcdir/`cd $srcdir/..;pwd`" 1>&2; exit 1; }
594fi
595ac_config_guess=$ac_aux_dir/config.guess
596ac_config_sub=$ac_aux_dir/config.sub
597ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
598
599
600# Do some error checking and defaulting for the host and target type.
601# The inputs are:
602# configure --host=HOST --target=TARGET --build=BUILD NONOPT
603#
604# The rules are:
605# 1. You are not allowed to specify --host, --target, and nonopt at the
85e493f0 606# same time.
8c693660
KR
607# 2. Host defaults to nonopt.
608# 3. If nonopt is not specified, then host defaults to the current host,
609# as determined by config.guess.
610# 4. Target and build default to nonopt.
611# 5. If nonopt is not specified, then target and build default to host.
612
613# The aliases save the names the user supplied, while $host etc.
614# will get canonicalized.
615case $host---$target---$nonopt in
616NONE---*---* | *---NONE---* | *---*---NONE) ;;
617*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
618esac
619
620
621# Make sure we can run config.sub.
622if $ac_config_sub sun4 >/dev/null 2>&1; then :
623else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
624fi
625
626echo $ac_n "checking host system type""... $ac_c" 1>&6
627
628host_alias=$host
629case "$host_alias" in
630NONE)
631 case $nonopt in
632 NONE)
633 if host_alias=`$ac_config_guess`; then :
634 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
635 fi ;;
636 *) host_alias=$nonopt ;;
637 esac ;;
638esac
639
640host=`$ac_config_sub $host_alias`
fd8d7c31
MH
641host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
642host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
643host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
8c693660
KR
644echo "$ac_t""$host" 1>&6
645
646echo $ac_n "checking target system type""... $ac_c" 1>&6
647
648target_alias=$target
649case "$target_alias" in
650NONE)
651 case $nonopt in
652 NONE) target_alias=$host_alias ;;
653 *) target_alias=$nonopt ;;
654 esac ;;
655esac
656
657target=`$ac_config_sub $target_alias`
fd8d7c31
MH
658target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
659target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
660target_os=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
8c693660
KR
661echo "$ac_t""$target" 1>&6
662
663echo $ac_n "checking build system type""... $ac_c" 1>&6
664
665build_alias=$build
666case "$build_alias" in
667NONE)
668 case $nonopt in
669 NONE) build_alias=$host_alias ;;
670 *) build_alias=$nonopt ;;
671 esac ;;
672esac
673
674build=`$ac_config_sub $build_alias`
fd8d7c31
MH
675build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
676build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
677build_os=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
8c693660
KR
678echo "$ac_t""$build" 1>&6
679
680test "$host_alias" != "$target_alias" &&
681 test "$program_prefix$program_suffix$program_transform_name" = \
682 NONENONEs,x,x, &&
683 program_prefix=${target_alias}-
684
685if test -z "$target" ; then
686 { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
687fi
688if test "$program_transform_name" = s,x,x,; then
689 program_transform_name=
690else
d19df9b5
ILT
691 # Double any \ or $. echo might interpret backslashes.
692 cat <<\EOF_SED > conftestsed
693s,\\,\\\\,g; s,\$,$$,g
694EOF_SED
8c693660
KR
695 program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
696 rm -f conftestsed
697fi
698test "$program_prefix" != NONE &&
699 program_transform_name="s,^,${program_prefix},; $program_transform_name"
700# Use a double $ so make ignores it.
701test "$program_suffix" != NONE &&
702 program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
703
704# sed with no file args requires a program.
705test "$program_transform_name" = "" && program_transform_name="s,x,x,"
706
707
708host64=false
709target64=false
710
711# host stuff:
712
44f795f7
ILT
713ALLLIBS='$(TARGETLIB)'
714PICFLAG=
c189fdfb
ILT
715SHLIB=unused-shlib
716SHLINK=unused-shlink
44f795f7
ILT
717if test "${shared}" = "true"; then
718 PICFLAG=-fpic
719 if test "${commonbfdlib}" = "true"; then
720 ALLLIBS='$(TARGETLIB)'
721 else
722 ALLLIBS='$(TARGETLIB) $(SHLIB) $(SHLINK)'
723 SHLIB=libbfd.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/VERSION`
724 SHLINK=libbfd.so
725 fi
726fi
727
85e493f0
ILT
728# Extract the first word of "gcc", so it can be a program name with args.
729set dummy gcc; ac_word=$2
730echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
731if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
732 echo $ac_n "(cached) $ac_c" 1>&6
733else
734 if test -n "$CC"; then
735 ac_cv_prog_CC="$CC" # Let the user override the test.
736else
737 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
738 for ac_dir in $PATH; do
739 test -z "$ac_dir" && ac_dir=.
740 if test -f $ac_dir/$ac_word; then
741 ac_cv_prog_CC="gcc"
742 break
743 fi
744 done
745 IFS="$ac_save_ifs"
85e493f0
ILT
746fi
747fi
748CC="$ac_cv_prog_CC"
749if test -n "$CC"; then
750 echo "$ac_t""$CC" 1>&6
751else
752 echo "$ac_t""no" 1>&6
753fi
754
986cf3b8
ILT
755if test -z "$CC"; then
756 # Extract the first word of "cc", so it can be a program name with args.
757set dummy cc; ac_word=$2
758echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
759if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
760 echo $ac_n "(cached) $ac_c" 1>&6
761else
762 if test -n "$CC"; then
763 ac_cv_prog_CC="$CC" # Let the user override the test.
764else
765 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
766 ac_prog_rejected=no
767 for ac_dir in $PATH; do
768 test -z "$ac_dir" && ac_dir=.
769 if test -f $ac_dir/$ac_word; then
770 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
771 ac_prog_rejected=yes
772 continue
773 fi
774 ac_cv_prog_CC="cc"
775 break
776 fi
777 done
778 IFS="$ac_save_ifs"
779if test $ac_prog_rejected = yes; then
780 # We found a bogon in the path, so make sure we never use it.
781 set dummy $ac_cv_prog_CC
782 shift
783 if test $# -gt 0; then
784 # We chose a different compiler from the bogus one.
785 # However, it has the same basename, so the bogon will be chosen
786 # first if we set CC to just the basename; use the full file name.
787 shift
788 set dummy "$ac_dir/$ac_word" "$@"
789 shift
790 ac_cv_prog_CC="$@"
791 fi
792fi
793fi
794fi
795CC="$ac_cv_prog_CC"
796if test -n "$CC"; then
797 echo "$ac_t""$CC" 1>&6
798else
799 echo "$ac_t""no" 1>&6
800fi
801
802 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
803fi
f515fb2f 804
85e493f0
ILT
805echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
806if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
807 echo $ac_n "(cached) $ac_c" 1>&6
808else
809 cat > conftest.c <<EOF
f515fb2f
ILT
810#ifdef __GNUC__
811 yes;
812#endif
813EOF
fd8d7c31 814if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
85e493f0
ILT
815 ac_cv_prog_gcc=yes
816else
817 ac_cv_prog_gcc=no
818fi
819fi
820
821echo "$ac_t""$ac_cv_prog_gcc" 1>&6
822if test $ac_cv_prog_gcc = yes; then
f515fb2f 823 GCC=yes
fd8d7c31
MH
824 if test "${CFLAGS+set}" != set; then
825 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
826if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then
85e493f0
ILT
827 echo $ac_n "(cached) $ac_c" 1>&6
828else
829 echo 'void f(){}' > conftest.c
830if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
fd8d7c31 831 ac_cv_prog_gcc_g=yes
85e493f0 832else
fd8d7c31 833 ac_cv_prog_gcc_g=no
85e493f0
ILT
834fi
835rm -f conftest*
836
837fi
838
fd8d7c31
MH
839echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
840 if test $ac_cv_prog_gcc_g = yes; then
841 CFLAGS="-g -O"
842 else
843 CFLAGS="-O"
844 fi
f515fb2f
ILT
845 fi
846else
847 GCC=
848 test "${CFLAGS+set}" = set || CFLAGS="-g"
849fi
f515fb2f
ILT
850
851
50bd50d4
MH
852echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
853if test -d /etc/conf/kconfig.d &&
854 grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
855then
856 echo "$ac_t""yes" 1>&6
857 ISC=yes # If later tests want to check for ISC.
858 cat >> confdefs.h <<\EOF
859#define _POSIX_SOURCE 1
860EOF
861
862 if test "$GCC" = yes; then
863 CC="$CC -posix"
864 else
865 CC="$CC -Xp"
866 fi
867else
868 echo "$ac_t""no" 1>&6
869 ISC=
870fi
871
872
55626bf0
ILT
873# Permit host specific settings.
874. ${srcdir}/configure.host
875
f515fb2f 876
986cf3b8
ILT
877if test $host != $build; then
878 ac_tool_prefix=${host_alias}-
879else
880 ac_tool_prefix=
881fi
882
883# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
884set dummy ${ac_tool_prefix}ar; ac_word=$2
6a468850
ILT
885echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
886if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
887 echo $ac_n "(cached) $ac_c" 1>&6
888else
889 if test -n "$AR"; then
890 ac_cv_prog_AR="$AR" # Let the user override the test.
891else
892 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
893 for ac_dir in $PATH; do
894 test -z "$ac_dir" && ac_dir=.
895 if test -f $ac_dir/$ac_word; then
986cf3b8 896 ac_cv_prog_AR="${ac_tool_prefix}ar"
6a468850
ILT
897 break
898 fi
899 done
900 IFS="$ac_save_ifs"
986cf3b8 901 test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
6a468850
ILT
902fi
903fi
904AR="$ac_cv_prog_AR"
905if test -n "$AR"; then
906 echo "$ac_t""$AR" 1>&6
907else
908 echo "$ac_t""no" 1>&6
909fi
f515fb2f 910
986cf3b8
ILT
911
912
913# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
914set dummy ${ac_tool_prefix}ranlib; ac_word=$2
915echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
916if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
917 echo $ac_n "(cached) $ac_c" 1>&6
918else
919 if test -n "$RANLIB"; then
920 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
921else
922 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
923 for ac_dir in $PATH; do
924 test -z "$ac_dir" && ac_dir=.
925 if test -f $ac_dir/$ac_word; then
926 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
927 break
928 fi
929 done
930 IFS="$ac_save_ifs"
931fi
932fi
933RANLIB="$ac_cv_prog_RANLIB"
934if test -n "$RANLIB"; then
935 echo "$ac_t""$RANLIB" 1>&6
936else
937 echo "$ac_t""no" 1>&6
938fi
939
940
941if test -z "$ac_cv_prog_RANLIB"; then
942if test -n "$ac_tool_prefix"; then
943 # Extract the first word of "ranlib", so it can be a program name with args.
8c693660
KR
944set dummy ranlib; ac_word=$2
945echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
946if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
947 echo $ac_n "(cached) $ac_c" 1>&6
948else
949 if test -n "$RANLIB"; then
950 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
951else
952 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
953 for ac_dir in $PATH; do
954 test -z "$ac_dir" && ac_dir=.
955 if test -f $ac_dir/$ac_word; then
956 ac_cv_prog_RANLIB="ranlib"
957 break
958 fi
959 done
960 IFS="$ac_save_ifs"
961 test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
962fi
963fi
964RANLIB="$ac_cv_prog_RANLIB"
965if test -n "$RANLIB"; then
966 echo "$ac_t""$RANLIB" 1>&6
967else
968 echo "$ac_t""no" 1>&6
969fi
970
986cf3b8
ILT
971else
972 RANLIB=":"
973fi
974fi
975
f515fb2f
ILT
976# Find a good install program. We prefer a C program (faster),
977# so one script is as good as another. But avoid the broken or
978# incompatible versions:
979# SysV /etc/install, /usr/sbin/install
980# SunOS /usr/etc/install
981# IRIX /sbin/install
982# AIX /bin/install
983# AFS /usr/afsws/bin/install, which mishandles nonexistent args
984# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
985# ./install, which can be erroneously created by make from ./install.sh.
986echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
987if test -z "$INSTALL"; then
988if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
989 echo $ac_n "(cached) $ac_c" 1>&6
990else
fd8d7c31 991 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
f515fb2f
ILT
992 for ac_dir in $PATH; do
993 # Account for people who put trailing slashes in PATH elements.
994 case "$ac_dir/" in
995 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
996 *)
997 # OSF1 and SCO ODT 3.0 have their own names for install.
998 for ac_prog in ginstall installbsd scoinst install; do
999 if test -f $ac_dir/$ac_prog; then
1000 if test $ac_prog = install &&
1001 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1002 # AIX install. It has an incompatible calling convention.
1003 # OSF/1 installbsd also uses dspmsg, but is usable.
1004 :
1005 else
1006 ac_cv_path_install="$ac_dir/$ac_prog -c"
1007 break 2
1008 fi
1009 fi
1010 done
1011 ;;
1012 esac
1013 done
fd8d7c31 1014 IFS="$ac_save_ifs"
85e493f0 1015
f515fb2f 1016fi
85e493f0
ILT
1017 if test "${ac_cv_path_install+set}" = set; then
1018 INSTALL="$ac_cv_path_install"
1019 else
1020 # As a last resort, use the slow shell script. We don't cache a
1021 # path for INSTALL within a source directory, because that will
1022 # break other packages using the cache if that directory is
1023 # removed, or if the path is relative.
1024 INSTALL="$ac_install_sh"
1025 fi
f515fb2f
ILT
1026fi
1027echo "$ac_t""$INSTALL" 1>&6
8c693660 1028
f515fb2f
ILT
1029# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1030# It thinks the first close brace ends the variable substitution.
1031test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
8c693660 1032
f515fb2f 1033test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
8c693660
KR
1034
1035
44f795f7
ILT
1036if test "${shared}" = "true"; then
1037 if test "${GCC}" != "yes" && test "${shared_non_gcc}" != "yes"; then
1038 echo "configure: warning: BFD --enable-shared only supported when using gcc" 1>&2
1039 shared=false
c189fdfb 1040 ALLLIBS='$(TARGETLIB)'
44f795f7 1041 PICFLAG=
c189fdfb 1042 SHLIB=unused-shlib
44f795f7
ILT
1043 fi
1044fi
1045
1046
1047
1048
1049
1050
1051if test "${commonbfdlib}" = "true"; then
1052 COMMON_SHLIB=yes
1053 PICLIST=piclist
1054else
1055 COMMON_SHLIB=
1056 PICLIST=
1057fi
1058
1059
1060
1061
ab659fd6 1062
f4e14cb9
ILT
1063VERSION=`cat ${srcdir}/VERSION`
1064
1065
1066BFD_HOST_64BIT_LONG=0
1067BFD_HOST_64_BIT_DEFINED=0
1068BFD_HOST_64_BIT=
1069BFD_HOST_U_64_BIT=
b7577823 1070if test "x${HOST_64BIT_TYPE}" = "xlong"; then
f4e14cb9
ILT
1071 BFD_HOST_64BIT_LONG=1
1072elif test "x${HOST_64BIT_TYPE}" != "x"; then
1073 BFD_HOST_64_BIT_DEFINED=1
1074 BFD_HOST_64_BIT=${HOST_64BIT_TYPE}
1075 BFD_HOST_U_64_BIT=${HOST_U_64BIT_TYPE}
b7577823
ILT
1076fi
1077
1078
f4e14cb9
ILT
1079
1080
1081
b7577823 1082# Put a plausible default for CC_FOR_BUILD in Makefile.
6a468850
ILT
1083if test -z "$CC_FOR_BUILD"; then
1084 if test "x$cross_compiling" = "xno"; then
1085 CC_FOR_BUILD='$(CC)'
1086 else
1087 CC_FOR_BUILD=gcc
1088 fi
8c693660
KR
1089fi
1090
f515fb2f 1091
b7577823
ILT
1092echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1093# On Suns, sometimes $CPP names a directory.
1094if test -n "$CPP" && test -d "$CPP"; then
1095 CPP=
1096fi
1097if test -z "$CPP"; then
1098if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1099 echo $ac_n "(cached) $ac_c" 1>&6
1100else
1101 # This must be in double quotes, not single quotes, because CPP may get
1102 # substituted into the Makefile and "${CC-cc}" will confuse make.
1103 CPP="${CC-cc} -E"
1104 # On the NeXT, cc -E runs the code through the compiler's parser,
1105 # not just through cpp.
1106 cat > conftest.$ac_ext <<EOF
fd8d7c31 1107#line 1108 "configure"
b7577823
ILT
1108#include "confdefs.h"
1109#include <assert.h>
1110Syntax Error
1111EOF
986cf3b8 1112ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
fd8d7c31 1113{ (eval echo configure:1114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
b7577823
ILT
1114ac_err=`grep -v '^ *+' conftest.out`
1115if test -z "$ac_err"; then
1116 :
1117else
1118 echo "$ac_err" >&5
1119 rm -rf conftest*
1120 CPP="${CC-cc} -E -traditional-cpp"
1121 cat > conftest.$ac_ext <<EOF
fd8d7c31 1122#line 1123 "configure"
b7577823
ILT
1123#include "confdefs.h"
1124#include <assert.h>
1125Syntax Error
1126EOF
986cf3b8 1127ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
fd8d7c31 1128{ (eval echo configure:1129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
b7577823
ILT
1129ac_err=`grep -v '^ *+' conftest.out`
1130if test -z "$ac_err"; then
1131 :
1132else
1133 echo "$ac_err" >&5
1134 rm -rf conftest*
1135 CPP=/lib/cpp
1136fi
1137rm -f conftest*
1138fi
1139rm -f conftest*
1140 ac_cv_prog_CPP="$CPP"
1141fi
1142 CPP="$ac_cv_prog_CPP"
1143else
1144 ac_cv_prog_CPP="$CPP"
1145fi
1146echo "$ac_t""$CPP" 1>&6
1147
1148for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h
1149do
fd8d7c31 1150ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
b7577823
ILT
1151echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1152if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1153 echo $ac_n "(cached) $ac_c" 1>&6
1154else
1155 cat > conftest.$ac_ext <<EOF
fd8d7c31 1156#line 1157 "configure"
b7577823
ILT
1157#include "confdefs.h"
1158#include <$ac_hdr>
1159EOF
986cf3b8 1160ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
fd8d7c31 1161{ (eval echo configure:1162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
b7577823
ILT
1162ac_err=`grep -v '^ *+' conftest.out`
1163if test -z "$ac_err"; then
1164 rm -rf conftest*
1165 eval "ac_cv_header_$ac_safe=yes"
1166else
1167 echo "$ac_err" >&5
1168 rm -rf conftest*
1169 eval "ac_cv_header_$ac_safe=no"
1170fi
1171rm -f conftest*
1172fi
1173if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1174 echo "$ac_t""yes" 1>&6
fd8d7c31 1175 ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
b7577823
ILT
1176 cat >> confdefs.h <<EOF
1177#define $ac_tr_hdr 1
1178EOF
1179
1180else
1181 echo "$ac_t""no" 1>&6
1182fi
1183done
1184
ab1aa5cd 1185for ac_hdr in fcntl.h sys/file.h sys/time.h
b7577823 1186do
fd8d7c31 1187ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
b7577823
ILT
1188echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1189if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1190 echo $ac_n "(cached) $ac_c" 1>&6
1191else
1192 cat > conftest.$ac_ext <<EOF
fd8d7c31 1193#line 1194 "configure"
b7577823
ILT
1194#include "confdefs.h"
1195#include <$ac_hdr>
1196EOF
986cf3b8 1197ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
fd8d7c31 1198{ (eval echo configure:1199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
b7577823
ILT
1199ac_err=`grep -v '^ *+' conftest.out`
1200if test -z "$ac_err"; then
1201 rm -rf conftest*
1202 eval "ac_cv_header_$ac_safe=yes"
1203else
1204 echo "$ac_err" >&5
1205 rm -rf conftest*
1206 eval "ac_cv_header_$ac_safe=no"
1207fi
1208rm -f conftest*
1209fi
1210if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1211 echo "$ac_t""yes" 1>&6
fd8d7c31 1212 ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
b7577823
ILT
1213 cat >> confdefs.h <<EOF
1214#define $ac_tr_hdr 1
1215EOF
1216
1217else
1218 echo "$ac_t""no" 1>&6
1219fi
1220done
1221
ab1aa5cd
FF
1222echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1223if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1224 echo $ac_n "(cached) $ac_c" 1>&6
1225else
1226 cat > conftest.$ac_ext <<EOF
fd8d7c31 1227#line 1228 "configure"
ab1aa5cd
FF
1228#include "confdefs.h"
1229#include <sys/types.h>
1230#include <sys/time.h>
1231#include <time.h>
fd8d7c31
MH
1232int main() { return 0; }
1233int t() {
ab1aa5cd
FF
1234struct tm *tp;
1235; return 0; }
1236EOF
fd8d7c31 1237if { (eval echo configure:1238: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ab1aa5cd
FF
1238 rm -rf conftest*
1239 ac_cv_header_time=yes
1240else
1241 rm -rf conftest*
1242 ac_cv_header_time=no
1243fi
1244rm -f conftest*
fd8d7c31 1245
ab1aa5cd
FF
1246fi
1247
1248echo "$ac_t""$ac_cv_header_time" 1>&6
1249if test $ac_cv_header_time = yes; then
1250 cat >> confdefs.h <<\EOF
1251#define TIME_WITH_SYS_TIME 1
1252EOF
1253
1254fi
1255
50bd50d4 1256for ac_func in fcntl getpagesize setitimer sysconf
b7577823
ILT
1257do
1258echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1259if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1260 echo $ac_n "(cached) $ac_c" 1>&6
1261else
1262 cat > conftest.$ac_ext <<EOF
fd8d7c31 1263#line 1264 "configure"
b7577823
ILT
1264#include "confdefs.h"
1265/* System header to define __stub macros and hopefully few prototypes,
1266 which can conflict with char $ac_func(); below. */
1267#include <assert.h>
1268/* Override any gcc2 internal prototype to avoid an error. */
a4322a77
ILT
1269/* We use char because int might match the return type of a gcc2
1270 builtin and then its argument prototype would still apply. */
85e493f0 1271char $ac_func();
b7577823 1272
fd8d7c31
MH
1273int main() { return 0; }
1274int t() {
b7577823
ILT
1275
1276/* The GNU C library defines this for functions which it implements
1277 to always fail with ENOSYS. Some functions are actually named
1278 something starting with __ and the normal name is an alias. */
1279#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1280choke me
1281#else
1282$ac_func();
1283#endif
1284
1285; return 0; }
1286EOF
fd8d7c31 1287if { (eval echo configure:1288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
b7577823
ILT
1288 rm -rf conftest*
1289 eval "ac_cv_func_$ac_func=yes"
1290else
1291 rm -rf conftest*
1292 eval "ac_cv_func_$ac_func=no"
1293fi
1294rm -f conftest*
dfc7020d 1295
fd8d7c31 1296fi
b7577823
ILT
1297if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1298 echo "$ac_t""yes" 1>&6
85e493f0 1299 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
b7577823
ILT
1300 cat >> confdefs.h <<EOF
1301#define $ac_tr_func 1
1302EOF
1303
1304else
1305 echo "$ac_t""no" 1>&6
1306fi
1307done
1308
1309
85e493f0 1310
b7577823 1311case "${host}" in
dfc7020d 1312i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32 | *-*-windows)
b7577823
ILT
1313 cat >> confdefs.h <<\EOF
1314#define USE_BINARY_FOPEN 1
1315EOF
1316 ;;
1317esac
1318
f7954d86
MM
1319echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
1320if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
1321 echo $ac_n "(cached) $ac_c" 1>&6
1322else
1323 cat > conftest.$ac_ext <<EOF
fd8d7c31 1324#line 1325 "configure"
f7954d86
MM
1325#include "confdefs.h"
1326
1327#include <stdio.h>
1328#ifdef HAVE_STRING_H
1329#include <string.h>
1330#else
1331#ifdef HAVE_STRINGS_H
1332#include <strings.h>
1333#endif
1334#endif
1335#ifdef HAVE_STDLIB_H
1336#include <stdlib.h>
1337#endif
1338#ifdef HAVE_UNISTD_H
1339#include <unistd.h>
1340#endif
fd8d7c31
MH
1341int main() { return 0; }
1342int t() {
f7954d86
MM
1343char *(*pfn) = (char *(*)) strstr
1344; return 0; }
1345EOF
fd8d7c31 1346if { (eval echo configure:1347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f7954d86
MM
1347 rm -rf conftest*
1348 bfd_cv_decl_needed_strstr=no
1349else
1350 rm -rf conftest*
1351 bfd_cv_decl_needed_strstr=yes
1352fi
1353rm -f conftest*
fd8d7c31 1354
f7954d86
MM
1355fi
1356
1357echo "$ac_t""$bfd_cv_decl_needed_strstr" 1>&6
1358if test $bfd_cv_decl_needed_strstr = yes; then
1359 bfd_tr_decl=NEED_DECLARATION_`echo strstr | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1360 cat >> confdefs.h <<EOF
1361#define $bfd_tr_decl 1
1362EOF
1363
1364fi
1365
b7577823
ILT
1366echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
1367if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
1368 echo $ac_n "(cached) $ac_c" 1>&6
1369else
1370 cat > conftest.$ac_ext <<EOF
fd8d7c31 1371#line 1372 "configure"
b7577823
ILT
1372#include "confdefs.h"
1373
1374#include <stdio.h>
f7954d86
MM
1375#ifdef HAVE_STRING_H
1376#include <string.h>
1377#else
1378#ifdef HAVE_STRINGS_H
1379#include <strings.h>
1380#endif
1381#endif
b7577823
ILT
1382#ifdef HAVE_STDLIB_H
1383#include <stdlib.h>
1384#endif
1385#ifdef HAVE_UNISTD_H
1386#include <unistd.h>
1387#endif
fd8d7c31
MH
1388int main() { return 0; }
1389int t() {
b7577823
ILT
1390char *(*pfn) = (char *(*)) malloc
1391; return 0; }
1392EOF
fd8d7c31 1393if { (eval echo configure:1394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
b7577823
ILT
1394 rm -rf conftest*
1395 bfd_cv_decl_needed_malloc=no
1396else
1397 rm -rf conftest*
1398 bfd_cv_decl_needed_malloc=yes
1399fi
1400rm -f conftest*
fd8d7c31 1401
b7577823
ILT
1402fi
1403
1404echo "$ac_t""$bfd_cv_decl_needed_malloc" 1>&6
1405if test $bfd_cv_decl_needed_malloc = yes; then
85e493f0
ILT
1406 bfd_tr_decl=NEED_DECLARATION_`echo malloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1407 cat >> confdefs.h <<EOF
1408#define $bfd_tr_decl 1
b7577823 1409EOF
f515fb2f 1410
2b79a104
ILT
1411fi
1412
f7954d86
MM
1413echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
1414if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
1415 echo $ac_n "(cached) $ac_c" 1>&6
1416else
1417 cat > conftest.$ac_ext <<EOF
fd8d7c31 1418#line 1419 "configure"
f7954d86
MM
1419#include "confdefs.h"
1420
1421#include <stdio.h>
1422#ifdef HAVE_STRING_H
1423#include <string.h>
1424#else
1425#ifdef HAVE_STRINGS_H
1426#include <strings.h>
1427#endif
1428#endif
1429#ifdef HAVE_STDLIB_H
1430#include <stdlib.h>
1431#endif
1432#ifdef HAVE_UNISTD_H
1433#include <unistd.h>
1434#endif
fd8d7c31
MH
1435int main() { return 0; }
1436int t() {
f7954d86
MM
1437char *(*pfn) = (char *(*)) realloc
1438; return 0; }
1439EOF
fd8d7c31 1440if { (eval echo configure:1441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f7954d86
MM
1441 rm -rf conftest*
1442 bfd_cv_decl_needed_realloc=no
1443else
1444 rm -rf conftest*
1445 bfd_cv_decl_needed_realloc=yes
1446fi
1447rm -f conftest*
fd8d7c31 1448
f7954d86
MM
1449fi
1450
1451echo "$ac_t""$bfd_cv_decl_needed_realloc" 1>&6
1452if test $bfd_cv_decl_needed_realloc = yes; then
1453 bfd_tr_decl=NEED_DECLARATION_`echo realloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1454 cat >> confdefs.h <<EOF
1455#define $bfd_tr_decl 1
1456EOF
1457
1458fi
1459
b7577823
ILT
1460echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
1461if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
1462 echo $ac_n "(cached) $ac_c" 1>&6
1463else
1464 cat > conftest.$ac_ext <<EOF
fd8d7c31 1465#line 1466 "configure"
b7577823 1466#include "confdefs.h"
8c693660 1467
b7577823 1468#include <stdio.h>
f7954d86
MM
1469#ifdef HAVE_STRING_H
1470#include <string.h>
1471#else
1472#ifdef HAVE_STRINGS_H
1473#include <strings.h>
1474#endif
1475#endif
b7577823
ILT
1476#ifdef HAVE_STDLIB_H
1477#include <stdlib.h>
1478#endif
1479#ifdef HAVE_UNISTD_H
1480#include <unistd.h>
1481#endif
fd8d7c31
MH
1482int main() { return 0; }
1483int t() {
85e493f0 1484char *(*pfn) = (char *(*)) free
b7577823
ILT
1485; return 0; }
1486EOF
fd8d7c31 1487if { (eval echo configure:1488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
b7577823
ILT
1488 rm -rf conftest*
1489 bfd_cv_decl_needed_free=no
1490else
1491 rm -rf conftest*
1492 bfd_cv_decl_needed_free=yes
1493fi
1494rm -f conftest*
fd8d7c31 1495
b7577823
ILT
1496fi
1497
1498echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6
1499if test $bfd_cv_decl_needed_free = yes; then
85e493f0
ILT
1500 bfd_tr_decl=NEED_DECLARATION_`echo free | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1501 cat >> confdefs.h <<EOF
1502#define $bfd_tr_decl 1
b7577823
ILT
1503EOF
1504
1505fi
f515fb2f 1506
dee99794
ILT
1507echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
1508if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
1509 echo $ac_n "(cached) $ac_c" 1>&6
1510else
1511 cat > conftest.$ac_ext <<EOF
fd8d7c31 1512#line 1513 "configure"
dee99794
ILT
1513#include "confdefs.h"
1514
1515#include <stdio.h>
1516#ifdef HAVE_STRING_H
1517#include <string.h>
1518#else
1519#ifdef HAVE_STRINGS_H
1520#include <strings.h>
1521#endif
1522#endif
1523#ifdef HAVE_STDLIB_H
1524#include <stdlib.h>
1525#endif
1526#ifdef HAVE_UNISTD_H
1527#include <unistd.h>
1528#endif
fd8d7c31
MH
1529int main() { return 0; }
1530int t() {
dee99794
ILT
1531char *(*pfn) = (char *(*)) getenv
1532; return 0; }
1533EOF
fd8d7c31 1534if { (eval echo configure:1535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
dee99794
ILT
1535 rm -rf conftest*
1536 bfd_cv_decl_needed_getenv=no
1537else
1538 rm -rf conftest*
1539 bfd_cv_decl_needed_getenv=yes
1540fi
1541rm -f conftest*
fd8d7c31 1542
dee99794
ILT
1543fi
1544
1545echo "$ac_t""$bfd_cv_decl_needed_getenv" 1>&6
1546if test $bfd_cv_decl_needed_getenv = yes; then
1547 bfd_tr_decl=NEED_DECLARATION_`echo getenv | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1548 cat >> confdefs.h <<EOF
1549#define $bfd_tr_decl 1
1550EOF
1551
1552fi
1553
85e493f0 1554
a52a3ce8
ILT
1555# If we are configured native, pick a core file support file.
1556COREFILE=
1557COREFLAG=
1558if test "${target}" = "${host}"; then
1559 case "${host}" in
999cc186
ILT
1560 alpha*-*-linux*)
1561 COREFILE=trad-core.o
1562 cat >> confdefs.h <<\EOF
1563#define TRAD_HEADER "hosts/alphalinux.h"
1564EOF
1565
1566 ;;
1567 alpha*-*-*) COREFILE=osf-core.o ;;
a52a3ce8
ILT
1568 arm-*-riscix) COREFILE=trad-core.o ;;
1569 hppa*-*-hpux*) COREFILE=hpux-core.o ;;
1570 hppa*-*-hiux*) COREFILE=hpux-core.o ;;
1571 hppa*-*-bsd*) COREFILE="hpux-core.o hppabsd-core.o"
1572 COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
f7954d86 1573 i[3456]86-sequent-bsd*)
b7577823
ILT
1574 COREFILE=trad-core.o;
1575 cat >> confdefs.h <<\EOF
1576#define TRAD_HEADER "hosts/symmetry.h"
1577EOF
1578
1579 ;;
f7954d86
MM
1580 i[3456]86-sequent-sysv4*) ;;
1581 i[3456]86-sequent-sysv*)
b7577823
ILT
1582 COREFILE=trad-core.o
1583 cat >> confdefs.h <<\EOF
1584#define TRAD_HEADER "hosts/symmetry.h"
1585EOF
1586
1587 ;;
f7954d86 1588 i[3456]86-*-bsd* | i[3456]86-*-freebsd*)
b7577823
ILT
1589 COREFILE=trad-core.o
1590 cat >> confdefs.h <<\EOF
1591#define TRAD_HEADER "hosts/i386bsd.h"
69a374c0
NH
1592EOF
1593
1594 ;;
f7954d86 1595 i[3456]86-*-netbsd*)
fe16107d 1596 COREFILE=netbsd-core.o
b7577823 1597 ;;
f7954d86 1598 i[3456]86-esix-sysv3*)
b7577823
ILT
1599 COREFILE=trad-core.o
1600 cat >> confdefs.h <<\EOF
1601#define TRAD_HEADER "hosts/esix.h"
1602EOF
1603
1604 ;;
f7954d86 1605 i[3456]86-*-sco* | i[3456]86-*-isc*)
b7577823
ILT
1606 COREFILE=trad-core.o
1607 cat >> confdefs.h <<\EOF
1608#define TRAD_HEADER "hosts/i386sco.h"
1609EOF
1610
1611 ;;
f7954d86 1612 i[3456]86-*-mach3*)
b7577823
ILT
1613 COREFILE=trad-core.o
1614 cat >> confdefs.h <<\EOF
1615#define TRAD_HEADER "hosts/i386mach3.h"
1616EOF
1617
1618 ;;
f7954d86 1619 i[3456]86-*-linux*)
b7577823
ILT
1620 COREFILE=trad-core.o
1621 cat >> confdefs.h <<\EOF
1622#define TRAD_HEADER "hosts/i386linux.h"
1623EOF
1624
1625 ;;
f7954d86
MM
1626 i[3456]86-*-isc*) COREFILE=trad-core.o ;;
1627 i[3456]86-*-aix*) COREFILE=aix386-core.o ;;
cf587de8
ILT
1628 i860-*-mach3* | i860-*-osf1*)
1629 COREFILE=trad-core.o
1630 cat >> confdefs.h <<\EOF
1631#define TRAD_HEADER "hosts/i860mach3.h"
1632EOF
1633
1634 ;;
b7577823
ILT
1635 mips-dec-bsd*)
1636 COREFILE=trad-core.o
1637 cat >> confdefs.h <<\EOF
1638#define TRAD_HEADER "hosts/mipsbsd.h"
1639EOF
1640
1641 ;;
1642 mips-dec-mach3*)
1643 COREFILE=trad-core.o
1644 cat >> confdefs.h <<\EOF
1645#define TRAD_HEADER "hosts/mipsmach3.h"
1646EOF
1647
1648 ;;
69a374c0 1649 mips-*-netbsd*)
fe16107d 1650 COREFILE=netbsd-core.o
69a374c0 1651 ;;
b7577823
ILT
1652 mips-dec-*)
1653 COREFILE=trad-core.o
1654 cat >> confdefs.h <<\EOF
1655#define TRAD_HEADER "hosts/decstation.h"
1656EOF
1657
1658 ;;
a52a3ce8
ILT
1659 mips-sgi-irix4*) COREFILE=irix-core.o ;;
1660 mips-sgi-irix5*) COREFILE=irix-core.o ;;
cd6213ff 1661 mips-sgi-irix6*) COREFILE=irix-core.o ;;
b7577823
ILT
1662 mips-*-mach3*)
1663 COREFILE=trad-core.o
1664 cat >> confdefs.h <<\EOF
1665#define TRAD_HEADER "hosts/mipsmach3.h"
1666EOF
1667
1668 ;;
a52a3ce8 1669 mips-*-sysv4*) ;;
b7577823
ILT
1670 mips-*-sysv* | mips-*-riscos*)
1671 COREFILE=trad-core.o
1672 cat >> confdefs.h <<\EOF
1673#define TRAD_HEADER "hosts/riscos.h"
1674EOF
1675
1676 ;;
1677 mips-sony-bsd*)
1678 COREFILE=trad-core.o
1679 cat >> confdefs.h <<\EOF
ab1aa5cd 1680#define TRAD_HEADER "hosts/news-mips.h"
b7577823
ILT
1681EOF
1682
1683 ;;
1684 m68*-bull*-sysv*)
1685 COREFILE=trad-core.o
1686 cat >> confdefs.h <<\EOF
1687#define TRAD_HEADER "hosts/dpx2.h"
1688EOF
1689
1690 ;;
a52a3ce8 1691 m68*-hp-hpux*) COREFILE=hpux-core.o ;;
b7577823
ILT
1692 m68*-hp-bsd*)
1693 COREFILE=trad-core.o
1694 cat >> confdefs.h <<\EOF
1695#define TRAD_HEADER "hosts/hp300bsd.h"
55626bf0
ILT
1696EOF
1697
1698 ;;
1699 m68*-*-linux*)
1700 COREFILE=trad-core.o
1701 cat >> confdefs.h <<\EOF
1702#define TRAD_HEADER "hosts/m68klinux.h"
7f82c7e1
ILT
1703EOF
1704
1705 ;;
4c8b9746 1706 m68*-motorola-sysv*)
7f82c7e1
ILT
1707 COREFILE=trad-core.o
1708 cat >> confdefs.h <<\EOF
1709#define TRAD_HEADER "hosts/delta68.h"
b7577823
ILT
1710EOF
1711
1712 ;;
b7577823
ILT
1713 m68*-sony-*)
1714 COREFILE=trad-core.o
1715 cat >> confdefs.h <<\EOF
1716#define TRAD_HEADER "hosts/news.h"
69a374c0
NH
1717EOF
1718
1719 ;;
1720 m68*-*-netbsd*)
fe16107d 1721 COREFILE=netbsd-core.o
d19df9b5
ILT
1722 ;;
1723 m68*-apple-aux*)
1724 COREFILE=trad-core.o
1725 cat >> confdefs.h <<\EOF
1726#define TRAD_HEADER "hosts/m68kaux.h"
b7577823
ILT
1727EOF
1728
1729 ;;
a52a3ce8 1730 m88*-*-sysv4*) ;;
7f82c7e1 1731 m88*-motorola-sysv*) COREFILE=ptrace-core.o ;;
b7577823
ILT
1732 m88*-*-mach3*)
1733 COREFILE=trad-core.o
1734 cat >> confdefs.h <<\EOF
1735#define TRAD_HEADER "hosts/m88kmach3.h"
1736EOF
1737
1738 ;;
1739 ns32k-pc532-mach)
1740 COREFILE=trad-core.o
1741 cat >> confdefs.h <<\EOF
1742#define TRAD_HEADER "hosts/pc532mach.h"
69a374c0
NH
1743EOF
1744
1745 ;;
1746 ns32k-*-netbsd*)
fe16107d 1747 COREFILE=netbsd-core.o
b7577823 1748 ;;
a52a3ce8 1749 rs6000-*-lynx*) COREFILE=lynx-core.o ;;
aadf04f7 1750 rs6000-*-aix4*) COREFILE=rs6000-core.o ;;
a52a3ce8 1751 rs6000-*-*) COREFILE=rs6000-core.o ;;
aadf04f7 1752 powerpc-*-aix4*) COREFILE=rs6000-core.o ;;
a52a3ce8 1753 powerpc-*-aix*) COREFILE=rs6000-core.o ;;
69a374c0 1754 sparc-*-netbsd*)
fe16107d 1755 COREFILE=netbsd-core.o
69a374c0 1756 ;;
b7577823
ILT
1757 tahoe-*-*)
1758 COREFILE=trad-core.o
1759 cat >> confdefs.h <<\EOF
1760#define TRAD_HEADER "hosts/tahoe.h"
1761EOF
1762
1763 ;;
1764 vax-*-ultrix2*)
1765 COREFILE=trad-core.o
1766 cat >> confdefs.h <<\EOF
1767#define TRAD_HEADER "hosts/vaxult2.h"
1768EOF
1769
1770 ;;
1771 vax-*-ultrix*)
1772 COREFILE=trad-core.o
1773 cat >> confdefs.h <<\EOF
1774#define TRAD_HEADER "hosts/vaxult2.h"
1775EOF
1776
1777 ;;
1778 vax-*-*)
1779 COREFILE=trad-core.o
1780 cat >> confdefs.h <<\EOF
1781#define TRAD_HEADER "hosts/vaxbsd.h"
1782EOF
1783
1784 ;;
a52a3ce8
ILT
1785 esac
1786
1787 case "$COREFILE" in
1788 aix386-core.o) COREFLAG=-DAIX386_CORE ;;
1789 hppabsd-core.o) COREFLAG=-DHPPABSD_CORE ;;
1790 hpux-core.o) COREFLAG=-DHPUX_CORE ;;
1791 irix-core.o) COREFLAG=-DIRIX_CORE ;;
1792 lynx-core.o) COREFLAG=-DLYNX_CORE ;;
1793 osf-core.o) COREFLAG=-DOSF_CORE ;;
1794 ptrace-core.o) COREFLAG=-DPTRACE_CORE ;;
1795 rs6000-core.o) COREFLAG="$COREFLAG -DAIX_CORE" ;;
b7577823 1796 trad-core.o) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
a52a3ce8 1797 esac
1dff7902
ILT
1798
1799 # The ELF code uses the native <sys/procfs.h> to handle core files.
1800 # Define HAVE_SYS_PROCFS_H if the file exists and defines
1801 # prstatus_t.
1802 echo $ac_n "checking for sys/procfs.h""... $ac_c" 1>&6
1803 if eval "test \"`echo '$''{'bfd_cv_header_sys_procfs_h'+set}'`\" = set"; then
1804 echo $ac_n "(cached) $ac_c" 1>&6
1805else
1806 cat > conftest.$ac_ext <<EOF
fd8d7c31 1807#line 1808 "configure"
1dff7902
ILT
1808#include "confdefs.h"
1809#include <sys/procfs.h>
fd8d7c31
MH
1810int main() { return 0; }
1811int t() {
1dff7902
ILT
1812prstatus_t t;
1813; return 0; }
1814EOF
fd8d7c31 1815if { (eval echo configure:1816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1dff7902
ILT
1816 rm -rf conftest*
1817 bfd_cv_header_sys_procfs_h=yes
1818else
1819 rm -rf conftest*
1820 bfd_cv_header_sys_procfs_h=no
1821fi
1822rm -f conftest*
fd8d7c31 1823
1dff7902
ILT
1824fi
1825
1826 echo "$ac_t""$bfd_cv_header_sys_procfs_h" 1>&6
1827 if test $bfd_cv_header_sys_procfs_h = yes; then
1828 cat >> confdefs.h <<\EOF
1829#define HAVE_SYS_PROCFS_H 1
1830EOF
1831
1832 fi
1833
a52a3ce8
ILT
1834fi
1835
1836
1837
8c693660
KR
1838# target stuff:
1839
1840# Canonicalize the secondary target names.
1841if test -n "$enable_targets" ; then
1842 for targ in `echo $enable_targets | sed 's/,/ /g'`
1843 do
9525b61b 1844 result=`$ac_config_sub $targ 2>/dev/null`
8c693660
KR
1845 if test -n "$result" ; then
1846 canon_targets="$canon_targets $result"
1847 else
1848 # Allow targets that config.sub doesn't recognize, like "all".
1849 canon_targets="$canon_targets $targ"
1850 fi
1851 done
1852fi
1853
1854all_targets=false
2b79a104
ILT
1855defvec=
1856selvecs=
1857selarchs=
1858TDEFINES=
8c693660
KR
1859for targ in $target $canon_targets
1860do
2b79a104 1861 if test "x$targ" = "xall"; then
8c693660
KR
1862 all_targets=true
1863 else
2b79a104
ILT
1864 . $srcdir/config.bfd
1865 if test "x$targ" = "x$target"; then
1866 defvec=$targ_defvec
8c693660 1867 fi
2b79a104
ILT
1868 selvecs="$selvecs $targ_defvec $targ_selvecs"
1869 selarchs="$selarchs $targ_archs"
1870 TDEFINES="$TDEFINES $targ_cflags"
8c693660
KR
1871 fi
1872done
1873
8c693660
KR
1874
1875# This processing still needs to be done if we're to decide properly whether
1876# 64-bit support needs to be compiled in. Currently, it will be included if
1877# the default or any other explicitly requested target requires it; it
1878# will not be included on a 32-bit host if no 64-bit target is requested, and
1879# no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
1880# used.
1881
2b79a104 1882# uniq the default and selected vectors in all the configured targets.
8c693660 1883f=""
2b79a104 1884for i in $selvecs ; do
8c693660
KR
1885 case " $f " in
1886 *" $i "*) ;;
1887 *) f="$f $i" ;;
1888 esac
1889done
2b79a104 1890selvecs="$f"
8c693660 1891
2b79a104 1892# uniq the architectures in all the configured targets.
8c693660 1893f=""
2b79a104 1894for i in $selarchs ; do
8c693660
KR
1895 case " $f " in
1896 *" $i "*) ;;
1897 *) f="$f $i" ;;
1898 esac
1899done
2b79a104 1900selarchs="$f"
8c693660
KR
1901
1902# Target backend .o files.
1903tb=
1904
a52a3ce8
ILT
1905elf="elf.o elflink.o"
1906
2b79a104 1907for vec in $selvecs
8c693660
KR
1908do
1909 case "$vec" in
1910 # This list is alphabetized to make it easy to compare
1911 # with the two vector lists in targets.c.
1912 a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;;
c189fdfb 1913 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o" ;;
a11e10fe
DE
1914 armcoff_little_vec) tb="$tb coff-arm.o cofflink.o " ;;
1915 armcoff_big_vec) tb="$tb coff-arm.o cofflink.o " ;;
a52a3ce8
ILT
1916 armpe_little_vec) tb="$tb pe-arm.o cofflink.o " ;;
1917 armpe_big_vec) tb="$tb pe-arm.o cofflink.o " ;;
1918 armpei_little_vec) tb="$tb pei-arm.o cofflink.o " ;;
1919 armpei_big_vec) tb="$tb pei-arm.o cofflink.o " ;;
c189fdfb
ILT
1920 aout0_big_vec) tb="$tb aout0.o aout32.o" ;;
1921 aout_arm_big_vec) tb="$tb aout-arm.o aout32.o" ;;
1922 aout_arm_little_vec) tb="$tb aout-arm.o aout32.o" ;;
1923 aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o" ;;
1924 aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o" ;;
8c693660 1925 apollocoff_vec) tb="$tb coff-apollo.o" ;;
c189fdfb
ILT
1926 b_out_vec_big_host) tb="$tb bout.o aout32.o" ;;
1927 b_out_vec_little_host) tb="$tb bout.o aout32.o" ;;
50bd50d4
MH
1928 bfd_elf64_alpha_vec) tb="$tb elf64-alpha.o elf64.o $elf"
1929 target64=true ;;
8c693660 1930# start-sanitize-arc
a52a3ce8
ILT
1931 bfd_elf32_littlearc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
1932 bfd_elf32_bigarc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
8c693660 1933# end-sanitize-arc
a52a3ce8
ILT
1934 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
1935 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
d1bf45aa
ILT
1936 bfd_elf64_bigmips_vec) tb="$tb elf64-mips.o elf64.o elf32-mips.o elf32.o $elf ecofflink.o"
1937 target64=true ;;
50bd50d4
MH
1938# start-sanitize-d10v
1939 bfd_elf32_d10v_vec) tb="$tb elf32-d10v.o elf32.o $elf" ;;
1940# end-sanitize-d10v
fd8d7c31
MH
1941# start-sanitize-d30v
1942 bfd_elf32_d30v_vec) tb="$tb elf32-d30v.o elf32.o $elf" ;;
1943# end-sanitize-d30v
a52a3ce8
ILT
1944 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o $elf" ;;
1945 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o $elf" ;;
1946 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o $elf" ;;
1947 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
1948 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
d1bf45aa
ILT
1949 bfd_elf64_littlemips_vec) tb="$tb elf64-mips.o elf64.o elf32-mips.o elf32.o $elf ecofflink.o"
1950 target64=true ;;
efc2b064
JL
1951# start-sanitize-m32r
1952 bfd_elf32_m32r_vec) tb="$tb elf32-m32r.o elf32.o $elf" ;;
1953# end-sanitize-m32r
a52a3ce8
ILT
1954 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o $elf" ;;
1955 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o $elf" ;;
ae1b99e4
JL
1956 bfd_elf32_mn10200_vec) tb="$tb elf32-mn10200.o elf32.o $elf" ;;
1957 bfd_elf32_mn10300_vec) tb="$tb elf32-mn10300.o elf32.o $elf" ;;
a52a3ce8
ILT
1958 bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
1959 bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
efc2b064
JL
1960 bfd_elf32_sh_vec) tb="$tb elf32-sh.o elf32.o $elf coff-sh.o" ;;
1961 bfd_elf32_shl_vec) tb="$tb elf32-sh.o elf32.o $elf coff-sh.o" ;;
a52a3ce8 1962 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o $elf" ;;
f7954d86
MM
1963# start-sanitize-v850
1964 bfd_elf32_v850_vec) tb="$tb elf32-v850.o elf32.o $elf" ;;
1965# end-sanitize-v850
a52a3ce8 1966 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
8c693660 1967 target64=true ;;
a52a3ce8 1968 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
8c693660 1969 target64=true ;;
a52a3ce8 1970 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o $elf"
8c693660
KR
1971 target64=true ;;
1972 cisco_core_vec) tb="$tb cisco-core.o" ;;
c189fdfb 1973 demo_64_vec) tb="$tb demo64.o aout64.o"
8c693660
KR
1974 target64=true ;;
1975 ecoff_big_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
1976 ecoff_little_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
1977 ecoffalpha_little_vec) tb="$tb coff-alpha.o ecoff.o ecofflink.o"
1978 target64=true ;;
50bd50d4
MH
1979 evax_alpha_vec) tb="$tb evax-alpha.o evax-emh.o evax-egsd.o evax-etir.o evax-misc.o"
1980 target64=true ;;
8c693660
KR
1981 h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
1982 h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
c189fdfb
ILT
1983 host_aout_vec) tb="$tb host-aout.o aout32.o" ;;
1984 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o" ;;
1985 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o" ;;
1986 i386aout_vec) tb="$tb i386aout.o aout32.o" ;;
1987 i386bsd_vec) tb="$tb i386bsd.o aout32.o" ;;
8c693660 1988 i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;;
c189fdfb
ILT
1989 i386dynix_vec) tb="$tb i386dynix.o aout32.o" ;;
1990 i386freebsd_vec) tb="$tb i386freebsd.o aout32.o" ;;
8c693660
KR
1991 i386msdos_vec) tb="$tb i386msdos.o" ;;
1992 i386pe_vec) tb="$tb pe-i386.o cofflink.o " ;;
1993 i386pei_vec) tb="$tb pei-i386.o cofflink.o" ;;
c189fdfb
ILT
1994 i386linux_vec) tb="$tb i386linux.o aout32.o" ;;
1995 i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o" ;;
1996 i386lynx_coff_vec) tb="$tb cf-i386lynx.o cofflink.o lynx-core.o" ;;
1997 i386mach3_vec) tb="$tb i386mach3.o aout32.o" ;;
1998 i386netbsd_vec) tb="$tb i386netbsd.o aout32.o" ;;
1999 i386os9k_vec) tb="$tb i386os9k.o aout32.o" ;;
cf587de8 2000 i860coff_vec) tb="$tb coff-i860.o cofflink.o" ;;
a208a70f
ILT
2001 icoff_big_vec) tb="$tb coff-i960.o cofflink.o" ;;
2002 icoff_little_vec) tb="$tb coff-i960.o cofflink.o" ;;
8c693660
KR
2003 ieee_vec) tb="$tb ieee.o" ;;
2004 m68kcoff_vec) tb="$tb coff-m68k.o cofflink.o" ;;
2005 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
c189fdfb
ILT
2006 m68klinux_vec) tb="$tb m68klinux.o aout32.o" ;;
2007 m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o" ;;
2008 m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o" ;;
2009 m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o" ;;
2010 m68k4knetbsd_vec) tb="$tb m68k4knetbsd.o aout32.o" ;;
d19df9b5 2011 m68kaux_coff_vec) tb="$tb coff-aux.o coff-m68k.o cofflink.o" ;;
8c693660 2012 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
c189fdfb 2013 newsos3_vec) tb="$tb newsos3.o aout32.o" ;;
8c693660
KR
2014 nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
2015 nlm32_sparc_vec) tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;;
2016 nlm32_alpha_vec) tb="$tb nlm32-alpha.o nlm32.o nlm.o"
2017 target64=true ;;
c189fdfb 2018 riscix_vec) tb="$tb aout32.o riscix.o" ;;
8c693660 2019 nlm32_powerpc_vec) tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;;
c189fdfb
ILT
2020 pc532netbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o" ;;
2021 pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o" ;;
aadf04f7
SS
2022 pmac_xcoff_vec) tb="$tb coff-pmac.o xcofflink.o" ;;
2023 rs6000coff_vec) tb="$tb coff-rs6000.o xcofflink.o" ;;
e0c10737
KK
2024 bfd_powerpc_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
2025 bfd_powerpcle_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
2026 bfd_powerpc_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
2027 bfd_powerpcle_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
a4322a77 2028 ppcboot_vec) tb="$tb ppcboot.o" ;;
8c693660 2029 shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
8c693660
KR
2030 shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
2031 som_vec) tb="$tb som.o" ;;
efc2b064 2032 sparcle_aout_vec) tb="$tb aout-sparcle.o aout32.o" ;;
c189fdfb
ILT
2033 sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o" ;;
2034 sparclynx_coff_vec) tb="$tb cf-sparclynx.o lynx-core.o" ;;
2035 sparcnetbsd_vec) tb="$tb sparcnetbsd.o aout32.o" ;;
8c693660
KR
2036 sparccoff_vec) tb="$tb coff-sparc.o" ;;
2037 srec_vec) tb="$tb srec.o" ;;
c189fdfb 2038 sunos_big_vec) tb="$tb sunos.o aout32.o" ;;
8c693660
KR
2039 symbolsrec_vec) tb="$tb srec.o" ;;
2040 tekhex_vec) tb="$tb tekhex.o" ;;
cd6213ff 2041# start-sanitize-tic80
60b26712 2042 tic80coff_vec) tb="$tb coff-tic80.o cofflink.o" ;;
cd6213ff 2043# end-sanitize-tic80
8c693660
KR
2044 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
2045 z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;;
2046 w65_vec) tb="$tb coff-w65.o reloc16.o" ;;
2047 versados_vec) tb="$tb versados.o" ;;
2048
2049 "") ;;
2050 *) { echo "configure: error: *** unknown target vector $vec" 1>&2; exit 1; } ;;
2051 esac
2052done
2053
2054# Target architecture .o files.
2b79a104 2055ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
8c693660
KR
2056
2057# Weed out duplicate .o files.
2058f=""
2059for i in $tb ; do
2060 case " $f " in
2061 *" $i "*) ;;
2062 *) f="$f $i" ;;
2063 esac
2064done
2065tb="$f"
2066
2067f=""
2068for i in $ta ; do
2069 case " $f " in
2070 *" $i "*) ;;
2071 *) f="$f $i" ;;
2072 esac
2073done
2074ta="$f"
2075
2076bfd_backends="$tb"
2077bfd_machines="$ta"
2078
2079if test x${all_targets} = xtrue ; then
2080 bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
2081 bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
2b79a104 2082 selvecs=
dee99794 2083 havevecs=
2b79a104 2084 selarchs=
8c693660
KR
2085else # all_targets is true
2086 # Only set these if they will be nonempty, for the clever echo.
dee99794
ILT
2087 havevecs=
2088 test -n "$selvecs" &&
2089 havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'`
2b79a104
ILT
2090 test -n "$selvecs" &&
2091 selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
2092 test -n "$selarchs" &&
2ffbb79a 2093 selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
8c693660
KR
2094fi # all_targets is true
2095
2096case ${host64}-${target64}-${want64} in
2097 *true*)
2098 wordsize=64
2099 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
194141a9 2100 if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then
50bd50d4
MH
2101 echo "configure: warning: You have requested a 64 bit BFD configuration, but" 1>&2
2102 echo "configure: warning: your compiler may not have a 64 bit integral type" 1>&2
2103 fi
8c693660
KR
2104 ;;
2105 false-false-false)
2106 wordsize=32
2107 all_backends='$(BFD32_BACKENDS)'
2108 ;;
2109esac
2110
2111
2112
2113
2114
2115
8c693660
KR
2116tdefaults=""
2117test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
2118test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
2119test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
dee99794 2120test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}"
8c693660
KR
2121
2122
fd8d7c31
MH
2123# If we cannot run a trivial program, we must be cross compiling.
2124echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
2125if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
dfc7020d
ILT
2126 echo $ac_n "(cached) $ac_c" 1>&6
2127else
fd8d7c31
MH
2128 if test "$cross_compiling" = yes; then
2129 ac_cv_c_cross=yes
2130else
2131cat > conftest.$ac_ext <<EOF
2132#line 2133 "configure"
dfc7020d 2133#include "confdefs.h"
fd8d7c31 2134main(){return(0);}
dfc7020d 2135EOF
fd8d7c31
MH
2136{ (eval echo configure:2137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
2137if test -s conftest && (./conftest; exit) 2>/dev/null; then
2138 ac_cv_c_cross=no
dfc7020d 2139else
fd8d7c31 2140 ac_cv_c_cross=yes
dfc7020d 2141fi
dfc7020d 2142fi
fd8d7c31 2143rm -fr conftest*
dfc7020d 2144fi
dfc7020d 2145
fd8d7c31
MH
2146echo "$ac_t""$ac_cv_c_cross" 1>&6
2147cross_compiling=$ac_cv_c_cross
2148
2149for ac_func in valloc getpagesize
d19df9b5
ILT
2150do
2151echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2152if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2153 echo $ac_n "(cached) $ac_c" 1>&6
2154else
2155 cat > conftest.$ac_ext <<EOF
fd8d7c31 2156#line 2157 "configure"
d19df9b5
ILT
2157#include "confdefs.h"
2158/* System header to define __stub macros and hopefully few prototypes,
2159 which can conflict with char $ac_func(); below. */
2160#include <assert.h>
2161/* Override any gcc2 internal prototype to avoid an error. */
a4322a77
ILT
2162/* We use char because int might match the return type of a gcc2
2163 builtin and then its argument prototype would still apply. */
d19df9b5
ILT
2164char $ac_func();
2165
fd8d7c31
MH
2166int main() { return 0; }
2167int t() {
d19df9b5
ILT
2168
2169/* The GNU C library defines this for functions which it implements
2170 to always fail with ENOSYS. Some functions are actually named
2171 something starting with __ and the normal name is an alias. */
2172#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2173choke me
2174#else
2175$ac_func();
2176#endif
2177
2178; return 0; }
2179EOF
fd8d7c31 2180if { (eval echo configure:2181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
d19df9b5
ILT
2181 rm -rf conftest*
2182 eval "ac_cv_func_$ac_func=yes"
2183else
2184 rm -rf conftest*
2185 eval "ac_cv_func_$ac_func=no"
2186fi
2187rm -f conftest*
dfc7020d 2188
fd8d7c31 2189fi
d19df9b5
ILT
2190if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2191 echo "$ac_t""yes" 1>&6
2192 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2193 cat >> confdefs.h <<EOF
2194#define $ac_tr_func 1
2195EOF
2196
2197else
2198 echo "$ac_t""no" 1>&6
2199fi
2200done
2201
4fe6d901 2202echo $ac_n "checking for working mmap""... $ac_c" 1>&6
fd8d7c31 2203if eval "test \"`echo '$''{'ac_cv_func_mmap'+set}'`\" = set"; then
4fe6d901
KR
2204 echo $ac_n "(cached) $ac_c" 1>&6
2205else
2206 if test "$cross_compiling" = yes; then
fd8d7c31 2207 ac_cv_func_mmap=no
4fe6d901 2208else
fd8d7c31
MH
2209cat > conftest.$ac_ext <<EOF
2210#line 2211 "configure"
4fe6d901
KR
2211#include "confdefs.h"
2212
fd8d7c31 2213/* Thanks to Mike Haertel and Jim Avera for this test. */
4fe6d901
KR
2214#include <sys/types.h>
2215#include <fcntl.h>
2216#include <sys/mman.h>
2217
4fe6d901 2218#ifndef HAVE_GETPAGESIZE
fd8d7c31
MH
2219# include <sys/param.h>
2220# ifdef EXEC_PAGESIZE
2221# define getpagesize() EXEC_PAGESIZE
2222# else
2223# ifdef NBPG
2224# define getpagesize() NBPG * CLSIZE
2225# ifndef CLSIZE
2226# define CLSIZE 1
2227# endif
2228# else
2229# ifdef NBPC
2230# define getpagesize() NBPC
2231# else
2232# define getpagesize() PAGESIZE /* SVR4 */
2233# endif
2234# endif
dfc7020d 2235# endif
fd8d7c31 2236#endif
dfc7020d 2237
fd8d7c31
MH
2238#ifndef HAVE_VALLOC
2239# define valloc malloc
2240#endif
4fe6d901
KR
2241
2242#ifdef __cplusplus
fd8d7c31 2243extern "C" { void *valloc(unsigned), *malloc(unsigned); }
4fe6d901 2244#else
fd8d7c31 2245char *valloc(), *malloc();
4fe6d901
KR
2246#endif
2247
2248int
2249main()
2250{
fd8d7c31
MH
2251 char *buf1, *buf2, *buf3;
2252 int i = getpagesize(), j;
2253 int i2 = i * 2;
2254 int fd;
2255
2256 buf1 = (char *)valloc(i2);
2257 buf2 = (char *)valloc(i);
2258 buf3 = (char *)malloc(i2);
2259 for (j = 0; j < i2; ++j)
2260 *(buf1 + j) = rand();
2261 fd = open("conftestmmap", O_CREAT | O_RDWR, 0666);
2262 write(fd, buf1, i2);
2263 mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0);
2264 for (j = 0; j < i; ++j)
2265 if (*(buf1 + j) != *(buf2 + j))
2266 exit(1);
2267 lseek(fd, (long)i, 0);
2268 read(fd, buf2, i); /* read into mapped memory -- file should not change */
2269 /* (it does in i386 SVR4.0 - Jim Avera, jima@netcom.com) */
2270 lseek(fd, (long)0, 0);
2271 read(fd, buf3, i2);
2272 for (j = 0; j < i2; ++j)
2273 if (*(buf1 + j) != *(buf3 + j))
2274 exit(1);
2275 exit(0);
4fe6d901
KR
2276}
2277
2278EOF
fd8d7c31
MH
2279{ (eval echo configure:2280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
2280if test -s conftest && (./conftest; exit) 2>/dev/null; then
2281 ac_cv_func_mmap=yes
4fe6d901 2282else
fd8d7c31 2283 ac_cv_func_mmap=no
4fe6d901 2284fi
4fe6d901 2285fi
fd8d7c31 2286rm -fr conftest*
dfc7020d
ILT
2287fi
2288
fd8d7c31
MH
2289echo "$ac_t""$ac_cv_func_mmap" 1>&6
2290if test $ac_cv_func_mmap = yes; then
4fe6d901
KR
2291 cat >> confdefs.h <<\EOF
2292#define HAVE_MMAP 1
2293EOF
2294
2295fi
2296
2297for ac_func in madvise mprotect
2298do
2299echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2300if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2301 echo $ac_n "(cached) $ac_c" 1>&6
2302else
2303 cat > conftest.$ac_ext <<EOF
fd8d7c31 2304#line 2305 "configure"
4fe6d901
KR
2305#include "confdefs.h"
2306/* System header to define __stub macros and hopefully few prototypes,
2307 which can conflict with char $ac_func(); below. */
2308#include <assert.h>
2309/* Override any gcc2 internal prototype to avoid an error. */
a4322a77
ILT
2310/* We use char because int might match the return type of a gcc2
2311 builtin and then its argument prototype would still apply. */
85e493f0 2312char $ac_func();
4fe6d901 2313
fd8d7c31
MH
2314int main() { return 0; }
2315int t() {
4fe6d901
KR
2316
2317/* The GNU C library defines this for functions which it implements
2318 to always fail with ENOSYS. Some functions are actually named
2319 something starting with __ and the normal name is an alias. */
2320#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2321choke me
2322#else
2323$ac_func();
2324#endif
2325
2326; return 0; }
2327EOF
fd8d7c31 2328if { (eval echo configure:2329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4fe6d901
KR
2329 rm -rf conftest*
2330 eval "ac_cv_func_$ac_func=yes"
2331else
2332 rm -rf conftest*
2333 eval "ac_cv_func_$ac_func=no"
2334fi
2335rm -f conftest*
dfc7020d 2336
fd8d7c31 2337fi
4fe6d901
KR
2338if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2339 echo "$ac_t""yes" 1>&6
85e493f0 2340 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4fe6d901
KR
2341 cat >> confdefs.h <<EOF
2342#define $ac_tr_func 1
2343EOF
2344
2345else
2346 echo "$ac_t""no" 1>&6
2347fi
2348done
2349
fd8d7c31 2350case ${want_mmap}+${ac_cv_func_mmap_fixed_mapped} in
85e493f0
ILT
2351 true+yes ) cat >> confdefs.h <<\EOF
2352#define USE_MMAP 1
2353EOF
2354 ;;
2355esac
4fe6d901 2356
8c693660
KR
2357rm -f doc/config.status
2358trap '' 1 2 15
2359cat > confcache <<\EOF
2360# This file is a shell script that caches the results of configure
2361# tests run on this system so they can be shared between configure
2362# scripts and configure runs. It is not useful on other systems.
2363# If it contains results you don't want to keep, you may remove or edit it.
2364#
2365# By default, configure uses ./config.cache as the cache file,
2366# creating it if it does not exist already. You can give configure
2367# the --cache-file=FILE option to use a different cache file; that is
2368# what configure does when it calls configure scripts in
2369# subdirectories, so they share the cache.
2370# Giving --cache-file=/dev/null disables caching, for debugging configure.
2371# config.status only pays attention to the cache file if you give it the
2372# --recheck option to rerun configure.
2373#
2374EOF
2375# Ultrix sh set writes to stderr and can't be redirected directly,
2376# and sets the high bit in the cache file unless we assign to the vars.
2377(set) 2>&1 |
fd8d7c31
MH
2378 sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
2379 >> confcache
8c693660
KR
2380if cmp -s $cache_file confcache; then
2381 :
2382else
2383 if test -w $cache_file; then
2384 echo "updating cache $cache_file"
2385 cat confcache > $cache_file
2386 else
2387 echo "not updating unwritable cache $cache_file"
2388 fi
2389fi
2390rm -f confcache
2391
2392trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
2393
2394test "x$prefix" = xNONE && prefix=$ac_default_prefix
2395# Let make expand exec_prefix.
2396test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2397
2398# Any assignment to VPATH causes Sun make to only execute
2399# the first set of double-colon rules, so remove it if not needed.
2400# If there is a colon in the path, we need to keep it.
2401if test "x$srcdir" = x.; then
2402 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
2403fi
2404
2405trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2406
b7577823 2407DEFS=-DHAVE_CONFIG_H
8c693660
KR
2408
2409# Without the "./", some shells look in PATH for config.status.
2410: ${CONFIG_STATUS=./config.status}
2411
2412echo creating $CONFIG_STATUS
2413rm -f $CONFIG_STATUS
2414cat > $CONFIG_STATUS <<EOF
2415#! /bin/sh
2416# Generated automatically by configure.
2417# Run this file to recreate the current configuration.
2418# This directory was configured as follows,
2419# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2420#
2421# $0 $ac_configure_args
2422#
2423# Compiler output produced by configure, useful for debugging
2424# configure, is in ./config.log if it exists.
2425
2426ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
2427for ac_option
2428do
2429 case "\$ac_option" in
2430 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
2431 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
2432 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
2433 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
fd8d7c31 2434 echo "$CONFIG_STATUS generated by autoconf version 2.10"
8c693660
KR
2435 exit 0 ;;
2436 -help | --help | --hel | --he | --h)
2437 echo "\$ac_cs_usage"; exit 0 ;;
2438 *) echo "\$ac_cs_usage"; exit 1 ;;
2439 esac
2440done
2441
2442ac_given_srcdir=$srcdir
f515fb2f 2443ac_given_INSTALL="$INSTALL"
8c693660 2444
f4e14cb9 2445trap 'rm -fr `echo "Makefile doc/Makefile bfd-in3.h:bfd-in2.h config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
d19df9b5
ILT
2446EOF
2447cat >> $CONFIG_STATUS <<EOF
8c693660 2448
85e493f0 2449# Protect against being on the right side of a sed subst in config.status.
d19df9b5
ILT
2450sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2451 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
8c693660
KR
2452$ac_vpsub
2453$extrasub
2454s%@CFLAGS@%$CFLAGS%g
2455s%@CPPFLAGS@%$CPPFLAGS%g
2456s%@CXXFLAGS@%$CXXFLAGS%g
2457s%@DEFS@%$DEFS%g
2458s%@LDFLAGS@%$LDFLAGS%g
2459s%@LIBS@%$LIBS%g
2460s%@exec_prefix@%$exec_prefix%g
2461s%@prefix@%$prefix%g
2462s%@program_transform_name@%$program_transform_name%g
85e493f0
ILT
2463s%@bindir@%$bindir%g
2464s%@sbindir@%$sbindir%g
2465s%@libexecdir@%$libexecdir%g
2466s%@datadir@%$datadir%g
2467s%@sysconfdir@%$sysconfdir%g
2468s%@sharedstatedir@%$sharedstatedir%g
2469s%@localstatedir@%$localstatedir%g
2470s%@libdir@%$libdir%g
2471s%@includedir@%$includedir%g
2472s%@oldincludedir@%$oldincludedir%g
2473s%@infodir@%$infodir%g
2474s%@mandir@%$mandir%g
8c693660
KR
2475s%@host@%$host%g
2476s%@host_alias@%$host_alias%g
2477s%@host_cpu@%$host_cpu%g
2478s%@host_vendor@%$host_vendor%g
2479s%@host_os@%$host_os%g
2480s%@target@%$target%g
2481s%@target_alias@%$target_alias%g
2482s%@target_cpu@%$target_cpu%g
2483s%@target_vendor@%$target_vendor%g
2484s%@target_os@%$target_os%g
2485s%@build@%$build%g
2486s%@build_alias@%$build_alias%g
2487s%@build_cpu@%$build_cpu%g
2488s%@build_vendor@%$build_vendor%g
2489s%@build_os@%$build_os%g
f515fb2f
ILT
2490s%@CC@%$CC%g
2491s%@HDEFINES@%$HDEFINES%g
2492s%@AR@%$AR%g
8c693660 2493s%@RANLIB@%$RANLIB%g
f515fb2f
ILT
2494s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
2495s%@INSTALL_DATA@%$INSTALL_DATA%g
44f795f7
ILT
2496s%@ALLLIBS@%$ALLLIBS%g
2497s%@PICFLAG@%$PICFLAG%g
2498s%@SHLIB@%$SHLIB%g
2499s%@SHLIB_CC@%$SHLIB_CC%g
2500s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g
2501s%@COMMON_SHLIB@%$COMMON_SHLIB%g
2502s%@PICLIST@%$PICLIST%g
2503s%@SHLINK@%$SHLINK%g
ab659fd6 2504s%@INSTALL_SHLIB@%$INSTALL_SHLIB%g
f4e14cb9
ILT
2505s%@VERSION@%$VERSION%g
2506s%@BFD_HOST_64BIT_LONG@%$BFD_HOST_64BIT_LONG%g
2507s%@BFD_HOST_64_BIT_DEFINED@%$BFD_HOST_64_BIT_DEFINED%g
2508s%@BFD_HOST_64_BIT@%$BFD_HOST_64_BIT%g
2509s%@BFD_HOST_U_64_BIT@%$BFD_HOST_U_64_BIT%g
f515fb2f 2510s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
b7577823 2511s%@CPP@%$CPP%g
a52a3ce8
ILT
2512s%@COREFILE@%$COREFILE%g
2513s%@COREFLAG@%$COREFLAG%g
2b79a104 2514s%@TDEFINES@%$TDEFINES%g
8c693660
KR
2515s%@wordsize@%$wordsize%g
2516s%@all_backends@%$all_backends%g
2517s%@bfd_backends@%$bfd_backends%g
2518s%@bfd_machines@%$bfd_machines%g
2519s%@tdefaults@%$tdefaults%g
2520
2521CEOF
2522EOF
2523cat >> $CONFIG_STATUS <<EOF
2524
f4e14cb9 2525CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile bfd-in3.h:bfd-in2.h"}
8c693660
KR
2526EOF
2527cat >> $CONFIG_STATUS <<\EOF
2528for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
fd8d7c31 2529 # Support "outfile[:infile]", defaulting infile="outfile.in".
8c693660 2530 case "$ac_file" in
fd8d7c31 2531 *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
8c693660
KR
2532 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2533 *) ac_file_in="${ac_file}.in" ;;
2534 esac
2535
fd8d7c31 2536 # Adjust relative srcdir, etc. for subdirectories.
8c693660
KR
2537
2538 # Remove last slash and all that follows it. Not all systems have dirname.
2539 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2540 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2541 # The file is in a subdirectory.
2542 test ! -d "$ac_dir" && mkdir "$ac_dir"
2543 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2544 # A "../" for each directory in $ac_dir_suffix.
2545 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2546 else
2547 ac_dir_suffix= ac_dots=
2548 fi
2549
2550 case "$ac_given_srcdir" in
2551 .) srcdir=.
2552 if test -z "$ac_dots"; then top_srcdir=.
2553 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2554 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2555 *) # Relative path.
2556 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2557 top_srcdir="$ac_dots$ac_given_srcdir" ;;
2558 esac
2559
f515fb2f
ILT
2560 case "$ac_given_INSTALL" in
2561 [/$]*) INSTALL="$ac_given_INSTALL" ;;
2562 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2563 esac
8c693660
KR
2564 echo creating "$ac_file"
2565 rm -f "$ac_file"
2566 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2567 case "$ac_file" in
2568 *Makefile*) ac_comsub="1i\\
2569# $configure_input" ;;
2570 *) ac_comsub= ;;
2571 esac
2572 sed -e "$ac_comsub
2573s%@configure_input@%$configure_input%g
2574s%@srcdir@%$srcdir%g
2575s%@top_srcdir@%$top_srcdir%g
f515fb2f 2576s%@INSTALL@%$INSTALL%g
fd8d7c31 2577" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
8c693660 2578fi; done
fd8d7c31 2579rm -f conftest.subs
8c693660 2580
b7577823
ILT
2581# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
2582# NAME is the cpp macro being defined and VALUE is the value it is being given.
2583#
2584# ac_d sets the value in "#define NAME VALUE" lines.
2585ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
2586ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
2587ac_dC='\3'
2588ac_dD='%g'
2589# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
2590ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
2591ac_uB='\([ ]\)%\1#\2define\3'
2592ac_uC=' '
2593ac_uD='\4%g'
2594# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
2595ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
2596ac_eB='$%\1#\2define\3'
2597ac_eC=' '
2598ac_eD='%g'
2599
fd8d7c31 2600CONFIG_HEADERS=${CONFIG_HEADERS-"config.h:config.in"}
b7577823 2601for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
fd8d7c31 2602 # Support "outfile[:infile]", defaulting infile="outfile.in".
b7577823 2603 case "$ac_file" in
fd8d7c31 2604 *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
b7577823
ILT
2605 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2606 *) ac_file_in="${ac_file}.in" ;;
2607 esac
8c693660 2608
b7577823 2609 echo creating $ac_file
8c693660 2610
b7577823 2611 rm -f conftest.frag conftest.in conftest.out
fd8d7c31 2612 cp $ac_given_srcdir/$ac_file_in conftest.in
8c693660 2613
b7577823 2614EOF
8c693660 2615
b7577823
ILT
2616# Transform confdefs.h into a sed script conftest.vals that substitutes
2617# the proper values into config.h.in to produce config.h. And first:
85e493f0 2618# Protect against being on the right side of a sed subst in config.status.
b7577823
ILT
2619# Protect against being in an unquoted here document in config.status.
2620rm -f conftest.vals
2621cat > conftest.hdr <<\EOF
2622s/[\\&%]/\\&/g
2623s%[\\$`]%\\&%g
a4322a77 2624s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
b7577823
ILT
2625s%ac_d%ac_u%gp
2626s%ac_u%ac_e%gp
2627EOF
2628sed -n -f conftest.hdr confdefs.h > conftest.vals
2629rm -f conftest.hdr
2630
2631# This sed command replaces #undef with comments. This is necessary, for
2632# example, in the case of _POSIX_SOURCE, which is predefined and required
2633# on some systems where configure will not decide to define it.
2634cat >> conftest.vals <<\EOF
2635s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
2636EOF
8c693660 2637
b7577823
ILT
2638# Break up conftest.vals because some shells have a limit on
2639# the size of here documents, and old seds have small limits too.
fd8d7c31
MH
2640# Maximum number of lines to put in a single here document.
2641ac_max_here_lines=12
8c693660 2642
b7577823
ILT
2643rm -f conftest.tail
2644while :
2645do
2646 ac_lines=`grep -c . conftest.vals`
2647 # grep -c gives empty output for an empty file on some AIX systems.
2648 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
2649 # Write a limited-size here document to conftest.frag.
2650 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
2651 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
2652 echo 'CEOF
2653 sed -f conftest.frag conftest.in > conftest.out
2654 rm -f conftest.in
2655 mv conftest.out conftest.in
2656' >> $CONFIG_STATUS
2657 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
2658 rm -f conftest.vals
2659 mv conftest.tail conftest.vals
2660done
2661rm -f conftest.vals
8c693660 2662
b7577823
ILT
2663cat >> $CONFIG_STATUS <<\EOF
2664 rm -f conftest.frag conftest.h
2665 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
2666 cat conftest.in >> conftest.h
2667 rm -f conftest.in
2668 if cmp -s $ac_file conftest.h 2>/dev/null; then
2669 echo "$ac_file is unchanged"
2670 rm -f conftest.h
8c693660 2671 else
a4322a77
ILT
2672 # Remove last slash and all that follows it. Not all systems have dirname.
2673 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2674 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2675 # The file is in a subdirectory.
2676 test ! -d "$ac_dir" && mkdir "$ac_dir"
2677 fi
b7577823
ILT
2678 rm -f $ac_file
2679 mv conftest.h $ac_file
8c693660 2680 fi
b7577823
ILT
2681fi; done
2682
8c693660 2683
a7873a6c 2684case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac
8c693660
KR
2685exit 0
2686EOF
2687chmod +x $CONFIG_STATUS
2688rm -fr confdefs* $ac_clean_files
2689test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2690
This page took 0.204021 seconds and 4 git commands to generate.