* cpu-mn10x00.c, elf32-mn10x00.c: New files.
[deliverable/binutils-gdb.git] / bfd / configure
CommitLineData
8c693660
KR
1#! /bin/sh
2
3# Guess values for system-dependent variables and create Makefiles.
a4322a77
ILT
4# Generated automatically using autoconf version 2.10
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)
a4322a77 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.
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).
448if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
449if test "${LANG+set}" = set; then LANG=C; export LANG; fi
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`
641host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
642host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
643host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
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`
658target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
659target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
660target_os=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
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`
675build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
676build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
677build_os=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
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
a4322a77 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
ILT
823 GCC=yes
824 if test "${CFLAGS+set}" != set; then
85e493f0
ILT
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
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
831 ac_cv_prog_gcc_g=yes
832else
833 ac_cv_prog_gcc_g=no
834fi
835rm -f conftest*
836
837fi
838
839echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
840 if test $ac_cv_prog_gcc_g = yes; then
f515fb2f
ILT
841 CFLAGS="-g -O"
842 else
843 CFLAGS="-O"
844 fi
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
991 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
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
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
f515fb2f
ILT
1082# If we cannot run a trivial program, we must be cross compiling.
1083echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
1084if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
1085 echo $ac_n "(cached) $ac_c" 1>&6
1086else
1087 if test "$cross_compiling" = yes; then
1088 ac_cv_c_cross=yes
1089else
1090cat > conftest.$ac_ext <<EOF
f4e14cb9 1091#line 1092 "configure"
f515fb2f
ILT
1092#include "confdefs.h"
1093main(){return(0);}
1094EOF
f4e14cb9 1095{ (eval echo configure:1096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
f515fb2f
ILT
1096if test -s conftest && (./conftest; exit) 2>/dev/null; then
1097 ac_cv_c_cross=no
1098else
1099 ac_cv_c_cross=yes
1100fi
1101fi
1102rm -fr conftest*
1103fi
85e493f0 1104
f515fb2f 1105echo "$ac_t""$ac_cv_c_cross" 1>&6
85e493f0 1106cross_compiling=$ac_cv_c_cross
8c693660 1107
b7577823 1108# Put a plausible default for CC_FOR_BUILD in Makefile.
6a468850
ILT
1109if test -z "$CC_FOR_BUILD"; then
1110 if test "x$cross_compiling" = "xno"; then
1111 CC_FOR_BUILD='$(CC)'
1112 else
1113 CC_FOR_BUILD=gcc
1114 fi
8c693660
KR
1115fi
1116
f515fb2f 1117
b7577823
ILT
1118echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1119# On Suns, sometimes $CPP names a directory.
1120if test -n "$CPP" && test -d "$CPP"; then
1121 CPP=
1122fi
1123if test -z "$CPP"; then
1124if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1125 echo $ac_n "(cached) $ac_c" 1>&6
1126else
1127 # This must be in double quotes, not single quotes, because CPP may get
1128 # substituted into the Makefile and "${CC-cc}" will confuse make.
1129 CPP="${CC-cc} -E"
1130 # On the NeXT, cc -E runs the code through the compiler's parser,
1131 # not just through cpp.
1132 cat > conftest.$ac_ext <<EOF
f4e14cb9 1133#line 1134 "configure"
b7577823
ILT
1134#include "confdefs.h"
1135#include <assert.h>
1136Syntax Error
1137EOF
986cf3b8 1138ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
f4e14cb9 1139{ (eval echo configure:1140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
b7577823
ILT
1140ac_err=`grep -v '^ *+' conftest.out`
1141if test -z "$ac_err"; then
1142 :
1143else
1144 echo "$ac_err" >&5
1145 rm -rf conftest*
1146 CPP="${CC-cc} -E -traditional-cpp"
1147 cat > conftest.$ac_ext <<EOF
f4e14cb9 1148#line 1149 "configure"
b7577823
ILT
1149#include "confdefs.h"
1150#include <assert.h>
1151Syntax Error
1152EOF
986cf3b8 1153ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
f4e14cb9 1154{ (eval echo configure:1155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
b7577823
ILT
1155ac_err=`grep -v '^ *+' conftest.out`
1156if test -z "$ac_err"; then
1157 :
1158else
1159 echo "$ac_err" >&5
1160 rm -rf conftest*
1161 CPP=/lib/cpp
1162fi
1163rm -f conftest*
1164fi
1165rm -f conftest*
1166 ac_cv_prog_CPP="$CPP"
1167fi
1168 CPP="$ac_cv_prog_CPP"
1169else
1170 ac_cv_prog_CPP="$CPP"
1171fi
1172echo "$ac_t""$CPP" 1>&6
1173
1174for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h
1175do
1176ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
1177echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1178if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1179 echo $ac_n "(cached) $ac_c" 1>&6
1180else
1181 cat > conftest.$ac_ext <<EOF
f4e14cb9 1182#line 1183 "configure"
b7577823
ILT
1183#include "confdefs.h"
1184#include <$ac_hdr>
1185EOF
986cf3b8 1186ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
f4e14cb9 1187{ (eval echo configure:1188: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
b7577823
ILT
1188ac_err=`grep -v '^ *+' conftest.out`
1189if test -z "$ac_err"; then
1190 rm -rf conftest*
1191 eval "ac_cv_header_$ac_safe=yes"
1192else
1193 echo "$ac_err" >&5
1194 rm -rf conftest*
1195 eval "ac_cv_header_$ac_safe=no"
1196fi
1197rm -f conftest*
1198fi
1199if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1200 echo "$ac_t""yes" 1>&6
85e493f0 1201 ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
b7577823
ILT
1202 cat >> confdefs.h <<EOF
1203#define $ac_tr_hdr 1
1204EOF
1205
1206else
1207 echo "$ac_t""no" 1>&6
1208fi
1209done
1210
ab1aa5cd 1211for ac_hdr in fcntl.h sys/file.h sys/time.h
b7577823
ILT
1212do
1213ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
1214echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1215if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1216 echo $ac_n "(cached) $ac_c" 1>&6
1217else
1218 cat > conftest.$ac_ext <<EOF
f4e14cb9 1219#line 1220 "configure"
b7577823
ILT
1220#include "confdefs.h"
1221#include <$ac_hdr>
1222EOF
986cf3b8 1223ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
f4e14cb9 1224{ (eval echo configure:1225: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
b7577823
ILT
1225ac_err=`grep -v '^ *+' conftest.out`
1226if test -z "$ac_err"; then
1227 rm -rf conftest*
1228 eval "ac_cv_header_$ac_safe=yes"
1229else
1230 echo "$ac_err" >&5
1231 rm -rf conftest*
1232 eval "ac_cv_header_$ac_safe=no"
1233fi
1234rm -f conftest*
1235fi
1236if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1237 echo "$ac_t""yes" 1>&6
85e493f0 1238 ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
b7577823
ILT
1239 cat >> confdefs.h <<EOF
1240#define $ac_tr_hdr 1
1241EOF
1242
1243else
1244 echo "$ac_t""no" 1>&6
1245fi
1246done
1247
ab1aa5cd
FF
1248echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1249if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1250 echo $ac_n "(cached) $ac_c" 1>&6
1251else
1252 cat > conftest.$ac_ext <<EOF
f4e14cb9 1253#line 1254 "configure"
ab1aa5cd
FF
1254#include "confdefs.h"
1255#include <sys/types.h>
1256#include <sys/time.h>
1257#include <time.h>
1258int main() { return 0; }
1259int t() {
1260struct tm *tp;
1261; return 0; }
1262EOF
f4e14cb9 1263if { (eval echo configure:1264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ab1aa5cd
FF
1264 rm -rf conftest*
1265 ac_cv_header_time=yes
1266else
1267 rm -rf conftest*
1268 ac_cv_header_time=no
1269fi
1270rm -f conftest*
1271
1272fi
1273
1274echo "$ac_t""$ac_cv_header_time" 1>&6
1275if test $ac_cv_header_time = yes; then
1276 cat >> confdefs.h <<\EOF
1277#define TIME_WITH_SYS_TIME 1
1278EOF
1279
1280fi
1281
50bd50d4 1282for ac_func in fcntl getpagesize setitimer sysconf
b7577823
ILT
1283do
1284echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1285if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1286 echo $ac_n "(cached) $ac_c" 1>&6
1287else
1288 cat > conftest.$ac_ext <<EOF
f4e14cb9 1289#line 1290 "configure"
b7577823
ILT
1290#include "confdefs.h"
1291/* System header to define __stub macros and hopefully few prototypes,
1292 which can conflict with char $ac_func(); below. */
1293#include <assert.h>
1294/* Override any gcc2 internal prototype to avoid an error. */
a4322a77
ILT
1295/* We use char because int might match the return type of a gcc2
1296 builtin and then its argument prototype would still apply. */
85e493f0 1297char $ac_func();
b7577823
ILT
1298
1299int main() { return 0; }
1300int t() {
1301
1302/* The GNU C library defines this for functions which it implements
1303 to always fail with ENOSYS. Some functions are actually named
1304 something starting with __ and the normal name is an alias. */
1305#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1306choke me
1307#else
1308$ac_func();
1309#endif
1310
1311; return 0; }
1312EOF
f4e14cb9 1313if { (eval echo configure:1314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
b7577823
ILT
1314 rm -rf conftest*
1315 eval "ac_cv_func_$ac_func=yes"
1316else
1317 rm -rf conftest*
1318 eval "ac_cv_func_$ac_func=no"
1319fi
1320rm -f conftest*
1321
1322fi
1323if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1324 echo "$ac_t""yes" 1>&6
85e493f0 1325 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
b7577823
ILT
1326 cat >> confdefs.h <<EOF
1327#define $ac_tr_func 1
1328EOF
1329
1330else
1331 echo "$ac_t""no" 1>&6
1332fi
1333done
1334
1335
85e493f0 1336
b7577823 1337case "${host}" in
55626bf0 1338i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32)
b7577823
ILT
1339 cat >> confdefs.h <<\EOF
1340#define USE_BINARY_FOPEN 1
1341EOF
1342 ;;
1343esac
1344
f7954d86
MM
1345echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
1346if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
1347 echo $ac_n "(cached) $ac_c" 1>&6
1348else
1349 cat > conftest.$ac_ext <<EOF
1350#line 1351 "configure"
1351#include "confdefs.h"
1352
1353#include <stdio.h>
1354#ifdef HAVE_STRING_H
1355#include <string.h>
1356#else
1357#ifdef HAVE_STRINGS_H
1358#include <strings.h>
1359#endif
1360#endif
1361#ifdef HAVE_STDLIB_H
1362#include <stdlib.h>
1363#endif
1364#ifdef HAVE_UNISTD_H
1365#include <unistd.h>
1366#endif
1367int main() { return 0; }
1368int t() {
1369char *(*pfn) = (char *(*)) strstr
1370; return 0; }
1371EOF
1372if { (eval echo configure:1373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1373 rm -rf conftest*
1374 bfd_cv_decl_needed_strstr=no
1375else
1376 rm -rf conftest*
1377 bfd_cv_decl_needed_strstr=yes
1378fi
1379rm -f conftest*
1380
1381fi
1382
1383echo "$ac_t""$bfd_cv_decl_needed_strstr" 1>&6
1384if test $bfd_cv_decl_needed_strstr = yes; then
1385 bfd_tr_decl=NEED_DECLARATION_`echo strstr | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1386 cat >> confdefs.h <<EOF
1387#define $bfd_tr_decl 1
1388EOF
1389
1390fi
1391
b7577823
ILT
1392echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
1393if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
1394 echo $ac_n "(cached) $ac_c" 1>&6
1395else
1396 cat > conftest.$ac_ext <<EOF
f7954d86 1397#line 1398 "configure"
b7577823
ILT
1398#include "confdefs.h"
1399
1400#include <stdio.h>
f7954d86
MM
1401#ifdef HAVE_STRING_H
1402#include <string.h>
1403#else
1404#ifdef HAVE_STRINGS_H
1405#include <strings.h>
1406#endif
1407#endif
b7577823
ILT
1408#ifdef HAVE_STDLIB_H
1409#include <stdlib.h>
1410#endif
1411#ifdef HAVE_UNISTD_H
1412#include <unistd.h>
1413#endif
1414int main() { return 0; }
1415int t() {
1416char *(*pfn) = (char *(*)) malloc
1417; return 0; }
1418EOF
f7954d86 1419if { (eval echo configure:1420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
b7577823
ILT
1420 rm -rf conftest*
1421 bfd_cv_decl_needed_malloc=no
1422else
1423 rm -rf conftest*
1424 bfd_cv_decl_needed_malloc=yes
1425fi
1426rm -f conftest*
1427
1428fi
1429
1430echo "$ac_t""$bfd_cv_decl_needed_malloc" 1>&6
1431if test $bfd_cv_decl_needed_malloc = yes; then
85e493f0
ILT
1432 bfd_tr_decl=NEED_DECLARATION_`echo malloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1433 cat >> confdefs.h <<EOF
1434#define $bfd_tr_decl 1
b7577823 1435EOF
f515fb2f 1436
2b79a104
ILT
1437fi
1438
f7954d86
MM
1439echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
1440if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
1441 echo $ac_n "(cached) $ac_c" 1>&6
1442else
1443 cat > conftest.$ac_ext <<EOF
1444#line 1445 "configure"
1445#include "confdefs.h"
1446
1447#include <stdio.h>
1448#ifdef HAVE_STRING_H
1449#include <string.h>
1450#else
1451#ifdef HAVE_STRINGS_H
1452#include <strings.h>
1453#endif
1454#endif
1455#ifdef HAVE_STDLIB_H
1456#include <stdlib.h>
1457#endif
1458#ifdef HAVE_UNISTD_H
1459#include <unistd.h>
1460#endif
1461int main() { return 0; }
1462int t() {
1463char *(*pfn) = (char *(*)) realloc
1464; return 0; }
1465EOF
1466if { (eval echo configure:1467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1467 rm -rf conftest*
1468 bfd_cv_decl_needed_realloc=no
1469else
1470 rm -rf conftest*
1471 bfd_cv_decl_needed_realloc=yes
1472fi
1473rm -f conftest*
1474
1475fi
1476
1477echo "$ac_t""$bfd_cv_decl_needed_realloc" 1>&6
1478if test $bfd_cv_decl_needed_realloc = yes; then
1479 bfd_tr_decl=NEED_DECLARATION_`echo realloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1480 cat >> confdefs.h <<EOF
1481#define $bfd_tr_decl 1
1482EOF
1483
1484fi
1485
b7577823
ILT
1486echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
1487if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
1488 echo $ac_n "(cached) $ac_c" 1>&6
1489else
1490 cat > conftest.$ac_ext <<EOF
f7954d86 1491#line 1492 "configure"
b7577823 1492#include "confdefs.h"
8c693660 1493
b7577823 1494#include <stdio.h>
f7954d86
MM
1495#ifdef HAVE_STRING_H
1496#include <string.h>
1497#else
1498#ifdef HAVE_STRINGS_H
1499#include <strings.h>
1500#endif
1501#endif
b7577823
ILT
1502#ifdef HAVE_STDLIB_H
1503#include <stdlib.h>
1504#endif
1505#ifdef HAVE_UNISTD_H
1506#include <unistd.h>
1507#endif
1508int main() { return 0; }
1509int t() {
85e493f0 1510char *(*pfn) = (char *(*)) free
b7577823
ILT
1511; return 0; }
1512EOF
f7954d86 1513if { (eval echo configure:1514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
b7577823
ILT
1514 rm -rf conftest*
1515 bfd_cv_decl_needed_free=no
1516else
1517 rm -rf conftest*
1518 bfd_cv_decl_needed_free=yes
1519fi
1520rm -f conftest*
1521
1522fi
1523
1524echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6
1525if test $bfd_cv_decl_needed_free = yes; then
85e493f0
ILT
1526 bfd_tr_decl=NEED_DECLARATION_`echo free | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1527 cat >> confdefs.h <<EOF
1528#define $bfd_tr_decl 1
b7577823
ILT
1529EOF
1530
1531fi
f515fb2f 1532
85e493f0 1533
a52a3ce8
ILT
1534# If we are configured native, pick a core file support file.
1535COREFILE=
1536COREFLAG=
1537if test "${target}" = "${host}"; then
1538 case "${host}" in
999cc186
ILT
1539 alpha*-*-linux*)
1540 COREFILE=trad-core.o
1541 cat >> confdefs.h <<\EOF
1542#define TRAD_HEADER "hosts/alphalinux.h"
1543EOF
1544
1545 ;;
1546 alpha*-*-*) COREFILE=osf-core.o ;;
a52a3ce8
ILT
1547 arm-*-riscix) COREFILE=trad-core.o ;;
1548 hppa*-*-hpux*) COREFILE=hpux-core.o ;;
1549 hppa*-*-hiux*) COREFILE=hpux-core.o ;;
1550 hppa*-*-bsd*) COREFILE="hpux-core.o hppabsd-core.o"
1551 COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
f7954d86 1552 i[3456]86-sequent-bsd*)
b7577823
ILT
1553 COREFILE=trad-core.o;
1554 cat >> confdefs.h <<\EOF
1555#define TRAD_HEADER "hosts/symmetry.h"
1556EOF
1557
1558 ;;
f7954d86
MM
1559 i[3456]86-sequent-sysv4*) ;;
1560 i[3456]86-sequent-sysv*)
b7577823
ILT
1561 COREFILE=trad-core.o
1562 cat >> confdefs.h <<\EOF
1563#define TRAD_HEADER "hosts/symmetry.h"
1564EOF
1565
1566 ;;
f7954d86 1567 i[3456]86-*-bsd* | i[3456]86-*-freebsd*)
b7577823
ILT
1568 COREFILE=trad-core.o
1569 cat >> confdefs.h <<\EOF
1570#define TRAD_HEADER "hosts/i386bsd.h"
69a374c0
NH
1571EOF
1572
1573 ;;
f7954d86 1574 i[3456]86-*-netbsd*)
fe16107d 1575 COREFILE=netbsd-core.o
b7577823 1576 ;;
f7954d86 1577 i[3456]86-esix-sysv3*)
b7577823
ILT
1578 COREFILE=trad-core.o
1579 cat >> confdefs.h <<\EOF
1580#define TRAD_HEADER "hosts/esix.h"
1581EOF
1582
1583 ;;
f7954d86 1584 i[3456]86-*-sco* | i[3456]86-*-isc*)
b7577823
ILT
1585 COREFILE=trad-core.o
1586 cat >> confdefs.h <<\EOF
1587#define TRAD_HEADER "hosts/i386sco.h"
1588EOF
1589
1590 ;;
f7954d86 1591 i[3456]86-*-mach3*)
b7577823
ILT
1592 COREFILE=trad-core.o
1593 cat >> confdefs.h <<\EOF
1594#define TRAD_HEADER "hosts/i386mach3.h"
1595EOF
1596
1597 ;;
f7954d86 1598 i[3456]86-*-linux*)
b7577823
ILT
1599 COREFILE=trad-core.o
1600 cat >> confdefs.h <<\EOF
1601#define TRAD_HEADER "hosts/i386linux.h"
1602EOF
1603
1604 ;;
f7954d86
MM
1605 i[3456]86-*-isc*) COREFILE=trad-core.o ;;
1606 i[3456]86-*-aix*) COREFILE=aix386-core.o ;;
cf587de8
ILT
1607 i860-*-mach3* | i860-*-osf1*)
1608 COREFILE=trad-core.o
1609 cat >> confdefs.h <<\EOF
1610#define TRAD_HEADER "hosts/i860mach3.h"
1611EOF
1612
1613 ;;
b7577823
ILT
1614 mips-dec-bsd*)
1615 COREFILE=trad-core.o
1616 cat >> confdefs.h <<\EOF
1617#define TRAD_HEADER "hosts/mipsbsd.h"
1618EOF
1619
1620 ;;
1621 mips-dec-mach3*)
1622 COREFILE=trad-core.o
1623 cat >> confdefs.h <<\EOF
1624#define TRAD_HEADER "hosts/mipsmach3.h"
1625EOF
1626
1627 ;;
69a374c0 1628 mips-*-netbsd*)
fe16107d 1629 COREFILE=netbsd-core.o
69a374c0 1630 ;;
b7577823
ILT
1631 mips-dec-*)
1632 COREFILE=trad-core.o
1633 cat >> confdefs.h <<\EOF
1634#define TRAD_HEADER "hosts/decstation.h"
1635EOF
1636
1637 ;;
a52a3ce8
ILT
1638 mips-sgi-irix4*) COREFILE=irix-core.o ;;
1639 mips-sgi-irix5*) COREFILE=irix-core.o ;;
b7577823
ILT
1640 mips-*-mach3*)
1641 COREFILE=trad-core.o
1642 cat >> confdefs.h <<\EOF
1643#define TRAD_HEADER "hosts/mipsmach3.h"
1644EOF
1645
1646 ;;
a52a3ce8 1647 mips-*-sysv4*) ;;
b7577823
ILT
1648 mips-*-sysv* | mips-*-riscos*)
1649 COREFILE=trad-core.o
1650 cat >> confdefs.h <<\EOF
1651#define TRAD_HEADER "hosts/riscos.h"
1652EOF
1653
1654 ;;
1655 mips-sony-bsd*)
1656 COREFILE=trad-core.o
1657 cat >> confdefs.h <<\EOF
ab1aa5cd 1658#define TRAD_HEADER "hosts/news-mips.h"
b7577823
ILT
1659EOF
1660
1661 ;;
1662 m68*-bull*-sysv*)
1663 COREFILE=trad-core.o
1664 cat >> confdefs.h <<\EOF
1665#define TRAD_HEADER "hosts/dpx2.h"
1666EOF
1667
1668 ;;
a52a3ce8 1669 m68*-hp-hpux*) COREFILE=hpux-core.o ;;
b7577823
ILT
1670 m68*-hp-bsd*)
1671 COREFILE=trad-core.o
1672 cat >> confdefs.h <<\EOF
1673#define TRAD_HEADER "hosts/hp300bsd.h"
55626bf0
ILT
1674EOF
1675
1676 ;;
1677 m68*-*-linux*)
1678 COREFILE=trad-core.o
1679 cat >> confdefs.h <<\EOF
1680#define TRAD_HEADER "hosts/m68klinux.h"
7f82c7e1
ILT
1681EOF
1682
1683 ;;
4c8b9746 1684 m68*-motorola-sysv*)
7f82c7e1
ILT
1685 COREFILE=trad-core.o
1686 cat >> confdefs.h <<\EOF
1687#define TRAD_HEADER "hosts/delta68.h"
b7577823
ILT
1688EOF
1689
1690 ;;
b7577823
ILT
1691 m68*-sony-*)
1692 COREFILE=trad-core.o
1693 cat >> confdefs.h <<\EOF
1694#define TRAD_HEADER "hosts/news.h"
69a374c0
NH
1695EOF
1696
1697 ;;
1698 m68*-*-netbsd*)
fe16107d 1699 COREFILE=netbsd-core.o
d19df9b5
ILT
1700 ;;
1701 m68*-apple-aux*)
1702 COREFILE=trad-core.o
1703 cat >> confdefs.h <<\EOF
1704#define TRAD_HEADER "hosts/m68kaux.h"
b7577823
ILT
1705EOF
1706
1707 ;;
a52a3ce8 1708 m88*-*-sysv4*) ;;
7f82c7e1 1709 m88*-motorola-sysv*) COREFILE=ptrace-core.o ;;
b7577823
ILT
1710 m88*-*-mach3*)
1711 COREFILE=trad-core.o
1712 cat >> confdefs.h <<\EOF
1713#define TRAD_HEADER "hosts/m88kmach3.h"
1714EOF
1715
1716 ;;
1717 ns32k-pc532-mach)
1718 COREFILE=trad-core.o
1719 cat >> confdefs.h <<\EOF
1720#define TRAD_HEADER "hosts/pc532mach.h"
69a374c0
NH
1721EOF
1722
1723 ;;
1724 ns32k-*-netbsd*)
fe16107d 1725 COREFILE=netbsd-core.o
b7577823 1726 ;;
a52a3ce8 1727 rs6000-*-lynx*) COREFILE=lynx-core.o ;;
aadf04f7 1728 rs6000-*-aix4*) COREFILE=rs6000-core.o ;;
a52a3ce8 1729 rs6000-*-*) COREFILE=rs6000-core.o ;;
aadf04f7 1730 powerpc-*-aix4*) COREFILE=rs6000-core.o ;;
a52a3ce8 1731 powerpc-*-aix*) COREFILE=rs6000-core.o ;;
69a374c0 1732 sparc-*-netbsd*)
fe16107d 1733 COREFILE=netbsd-core.o
69a374c0 1734 ;;
b7577823
ILT
1735 tahoe-*-*)
1736 COREFILE=trad-core.o
1737 cat >> confdefs.h <<\EOF
1738#define TRAD_HEADER "hosts/tahoe.h"
1739EOF
1740
1741 ;;
1742 vax-*-ultrix2*)
1743 COREFILE=trad-core.o
1744 cat >> confdefs.h <<\EOF
1745#define TRAD_HEADER "hosts/vaxult2.h"
1746EOF
1747
1748 ;;
1749 vax-*-ultrix*)
1750 COREFILE=trad-core.o
1751 cat >> confdefs.h <<\EOF
1752#define TRAD_HEADER "hosts/vaxult2.h"
1753EOF
1754
1755 ;;
1756 vax-*-*)
1757 COREFILE=trad-core.o
1758 cat >> confdefs.h <<\EOF
1759#define TRAD_HEADER "hosts/vaxbsd.h"
1760EOF
1761
1762 ;;
a52a3ce8
ILT
1763 esac
1764
1765 case "$COREFILE" in
1766 aix386-core.o) COREFLAG=-DAIX386_CORE ;;
1767 hppabsd-core.o) COREFLAG=-DHPPABSD_CORE ;;
1768 hpux-core.o) COREFLAG=-DHPUX_CORE ;;
1769 irix-core.o) COREFLAG=-DIRIX_CORE ;;
1770 lynx-core.o) COREFLAG=-DLYNX_CORE ;;
1771 osf-core.o) COREFLAG=-DOSF_CORE ;;
1772 ptrace-core.o) COREFLAG=-DPTRACE_CORE ;;
1773 rs6000-core.o) COREFLAG="$COREFLAG -DAIX_CORE" ;;
b7577823 1774 trad-core.o) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
a52a3ce8 1775 esac
1dff7902
ILT
1776
1777 # The ELF code uses the native <sys/procfs.h> to handle core files.
1778 # Define HAVE_SYS_PROCFS_H if the file exists and defines
1779 # prstatus_t.
1780 echo $ac_n "checking for sys/procfs.h""... $ac_c" 1>&6
1781 if eval "test \"`echo '$''{'bfd_cv_header_sys_procfs_h'+set}'`\" = set"; then
1782 echo $ac_n "(cached) $ac_c" 1>&6
1783else
1784 cat > conftest.$ac_ext <<EOF
f7954d86 1785#line 1786 "configure"
1dff7902
ILT
1786#include "confdefs.h"
1787#include <sys/procfs.h>
1788int main() { return 0; }
1789int t() {
1790prstatus_t t;
1791; return 0; }
1792EOF
f7954d86 1793if { (eval echo configure:1794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1dff7902
ILT
1794 rm -rf conftest*
1795 bfd_cv_header_sys_procfs_h=yes
1796else
1797 rm -rf conftest*
1798 bfd_cv_header_sys_procfs_h=no
1799fi
1800rm -f conftest*
1801
1802fi
1803
1804 echo "$ac_t""$bfd_cv_header_sys_procfs_h" 1>&6
1805 if test $bfd_cv_header_sys_procfs_h = yes; then
1806 cat >> confdefs.h <<\EOF
1807#define HAVE_SYS_PROCFS_H 1
1808EOF
1809
1810 fi
1811
a52a3ce8
ILT
1812fi
1813
1814
1815
8c693660
KR
1816# target stuff:
1817
1818# Canonicalize the secondary target names.
1819if test -n "$enable_targets" ; then
1820 for targ in `echo $enable_targets | sed 's/,/ /g'`
1821 do
9525b61b 1822 result=`$ac_config_sub $targ 2>/dev/null`
8c693660
KR
1823 if test -n "$result" ; then
1824 canon_targets="$canon_targets $result"
1825 else
1826 # Allow targets that config.sub doesn't recognize, like "all".
1827 canon_targets="$canon_targets $targ"
1828 fi
1829 done
1830fi
1831
1832all_targets=false
2b79a104
ILT
1833defvec=
1834selvecs=
1835selarchs=
1836TDEFINES=
8c693660
KR
1837for targ in $target $canon_targets
1838do
2b79a104 1839 if test "x$targ" = "xall"; then
8c693660
KR
1840 all_targets=true
1841 else
2b79a104
ILT
1842 . $srcdir/config.bfd
1843 if test "x$targ" = "x$target"; then
1844 defvec=$targ_defvec
8c693660 1845 fi
2b79a104
ILT
1846 selvecs="$selvecs $targ_defvec $targ_selvecs"
1847 selarchs="$selarchs $targ_archs"
1848 TDEFINES="$TDEFINES $targ_cflags"
8c693660
KR
1849 fi
1850done
1851
8c693660
KR
1852
1853# This processing still needs to be done if we're to decide properly whether
1854# 64-bit support needs to be compiled in. Currently, it will be included if
1855# the default or any other explicitly requested target requires it; it
1856# will not be included on a 32-bit host if no 64-bit target is requested, and
1857# no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
1858# used.
1859
2b79a104 1860# uniq the default and selected vectors in all the configured targets.
8c693660 1861f=""
2b79a104 1862for i in $selvecs ; do
8c693660
KR
1863 case " $f " in
1864 *" $i "*) ;;
1865 *) f="$f $i" ;;
1866 esac
1867done
2b79a104 1868selvecs="$f"
8c693660 1869
2b79a104 1870# uniq the architectures in all the configured targets.
8c693660 1871f=""
2b79a104 1872for i in $selarchs ; do
8c693660
KR
1873 case " $f " in
1874 *" $i "*) ;;
1875 *) f="$f $i" ;;
1876 esac
1877done
2b79a104 1878selarchs="$f"
8c693660
KR
1879
1880# Target backend .o files.
1881tb=
1882
a52a3ce8
ILT
1883elf="elf.o elflink.o"
1884
2b79a104 1885for vec in $selvecs
8c693660
KR
1886do
1887 case "$vec" in
1888 # This list is alphabetized to make it easy to compare
1889 # with the two vector lists in targets.c.
1890 a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;;
c189fdfb 1891 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o" ;;
a11e10fe
DE
1892 armcoff_little_vec) tb="$tb coff-arm.o cofflink.o " ;;
1893 armcoff_big_vec) tb="$tb coff-arm.o cofflink.o " ;;
a52a3ce8
ILT
1894 armpe_little_vec) tb="$tb pe-arm.o cofflink.o " ;;
1895 armpe_big_vec) tb="$tb pe-arm.o cofflink.o " ;;
1896 armpei_little_vec) tb="$tb pei-arm.o cofflink.o " ;;
1897 armpei_big_vec) tb="$tb pei-arm.o cofflink.o " ;;
c189fdfb
ILT
1898 aout0_big_vec) tb="$tb aout0.o aout32.o" ;;
1899 aout_arm_big_vec) tb="$tb aout-arm.o aout32.o" ;;
1900 aout_arm_little_vec) tb="$tb aout-arm.o aout32.o" ;;
1901 aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o" ;;
1902 aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o" ;;
8c693660 1903 apollocoff_vec) tb="$tb coff-apollo.o" ;;
c189fdfb
ILT
1904 b_out_vec_big_host) tb="$tb bout.o aout32.o" ;;
1905 b_out_vec_little_host) tb="$tb bout.o aout32.o" ;;
50bd50d4
MH
1906 bfd_elf64_alpha_vec) tb="$tb elf64-alpha.o elf64.o $elf"
1907 target64=true ;;
8c693660 1908# start-sanitize-arc
a52a3ce8
ILT
1909 bfd_elf32_littlearc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
1910 bfd_elf32_bigarc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
8c693660 1911# end-sanitize-arc
a52a3ce8
ILT
1912 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
1913 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
d1bf45aa
ILT
1914 bfd_elf64_bigmips_vec) tb="$tb elf64-mips.o elf64.o elf32-mips.o elf32.o $elf ecofflink.o"
1915 target64=true ;;
50bd50d4
MH
1916# start-sanitize-d10v
1917 bfd_elf32_d10v_vec) tb="$tb elf32-d10v.o elf32.o $elf" ;;
1918# end-sanitize-d10v
a52a3ce8
ILT
1919 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o $elf" ;;
1920 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o $elf" ;;
1921 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o $elf" ;;
1922 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
1923 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
d1bf45aa
ILT
1924 bfd_elf64_littlemips_vec) tb="$tb elf64-mips.o elf64.o elf32-mips.o elf32.o $elf ecofflink.o"
1925 target64=true ;;
efc2b064
JL
1926# start-sanitize-m32r
1927 bfd_elf32_m32r_vec) tb="$tb elf32-m32r.o elf32.o $elf" ;;
1928# end-sanitize-m32r
a52a3ce8
ILT
1929 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o $elf" ;;
1930 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o $elf" ;;
efc2b064 1931 bfd_elf32_mn10x00_vec) tb="$tb elf32-mn10x00.o elf32.o $elf" ;;
a52a3ce8
ILT
1932 bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
1933 bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
efc2b064
JL
1934 bfd_elf32_sh_vec) tb="$tb elf32-sh.o elf32.o $elf coff-sh.o" ;;
1935 bfd_elf32_shl_vec) tb="$tb elf32-sh.o elf32.o $elf coff-sh.o" ;;
a52a3ce8 1936 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o $elf" ;;
f7954d86
MM
1937# start-sanitize-v850
1938 bfd_elf32_v850_vec) tb="$tb elf32-v850.o elf32.o $elf" ;;
1939# end-sanitize-v850
a52a3ce8 1940 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
8c693660 1941 target64=true ;;
a52a3ce8 1942 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
8c693660 1943 target64=true ;;
a52a3ce8 1944 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o $elf"
8c693660
KR
1945 target64=true ;;
1946 cisco_core_vec) tb="$tb cisco-core.o" ;;
c189fdfb 1947 demo_64_vec) tb="$tb demo64.o aout64.o"
8c693660
KR
1948 target64=true ;;
1949 ecoff_big_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
1950 ecoff_little_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
1951 ecoffalpha_little_vec) tb="$tb coff-alpha.o ecoff.o ecofflink.o"
1952 target64=true ;;
50bd50d4
MH
1953 evax_alpha_vec) tb="$tb evax-alpha.o evax-emh.o evax-egsd.o evax-etir.o evax-misc.o"
1954 target64=true ;;
8c693660
KR
1955 h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
1956 h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
c189fdfb
ILT
1957 host_aout_vec) tb="$tb host-aout.o aout32.o" ;;
1958 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o" ;;
1959 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o" ;;
1960 i386aout_vec) tb="$tb i386aout.o aout32.o" ;;
1961 i386bsd_vec) tb="$tb i386bsd.o aout32.o" ;;
8c693660 1962 i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;;
c189fdfb
ILT
1963 i386dynix_vec) tb="$tb i386dynix.o aout32.o" ;;
1964 i386freebsd_vec) tb="$tb i386freebsd.o aout32.o" ;;
8c693660
KR
1965 i386msdos_vec) tb="$tb i386msdos.o" ;;
1966 i386pe_vec) tb="$tb pe-i386.o cofflink.o " ;;
1967 i386pei_vec) tb="$tb pei-i386.o cofflink.o" ;;
c189fdfb
ILT
1968 i386linux_vec) tb="$tb i386linux.o aout32.o" ;;
1969 i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o" ;;
1970 i386lynx_coff_vec) tb="$tb cf-i386lynx.o cofflink.o lynx-core.o" ;;
1971 i386mach3_vec) tb="$tb i386mach3.o aout32.o" ;;
1972 i386netbsd_vec) tb="$tb i386netbsd.o aout32.o" ;;
1973 i386os9k_vec) tb="$tb i386os9k.o aout32.o" ;;
cf587de8 1974 i860coff_vec) tb="$tb coff-i860.o cofflink.o" ;;
a208a70f
ILT
1975 icoff_big_vec) tb="$tb coff-i960.o cofflink.o" ;;
1976 icoff_little_vec) tb="$tb coff-i960.o cofflink.o" ;;
8c693660
KR
1977 ieee_vec) tb="$tb ieee.o" ;;
1978 m68kcoff_vec) tb="$tb coff-m68k.o cofflink.o" ;;
1979 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
c189fdfb
ILT
1980 m68klinux_vec) tb="$tb m68klinux.o aout32.o" ;;
1981 m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o" ;;
1982 m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o" ;;
1983 m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o" ;;
1984 m68k4knetbsd_vec) tb="$tb m68k4knetbsd.o aout32.o" ;;
d19df9b5 1985 m68kaux_coff_vec) tb="$tb coff-aux.o coff-m68k.o cofflink.o" ;;
8c693660 1986 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
c189fdfb 1987 newsos3_vec) tb="$tb newsos3.o aout32.o" ;;
8c693660
KR
1988 nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
1989 nlm32_sparc_vec) tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;;
1990 nlm32_alpha_vec) tb="$tb nlm32-alpha.o nlm32.o nlm.o"
1991 target64=true ;;
c189fdfb 1992 riscix_vec) tb="$tb aout32.o riscix.o" ;;
8c693660 1993 nlm32_powerpc_vec) tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;;
c189fdfb
ILT
1994 pc532netbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o" ;;
1995 pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o" ;;
aadf04f7
SS
1996 pmac_xcoff_vec) tb="$tb coff-pmac.o xcofflink.o" ;;
1997 rs6000coff_vec) tb="$tb coff-rs6000.o xcofflink.o" ;;
e0c10737
KK
1998 bfd_powerpc_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
1999 bfd_powerpcle_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
2000 bfd_powerpc_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
2001 bfd_powerpcle_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
a4322a77 2002 ppcboot_vec) tb="$tb ppcboot.o" ;;
8c693660 2003 shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
8c693660
KR
2004 shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
2005 som_vec) tb="$tb som.o" ;;
efc2b064 2006 sparcle_aout_vec) tb="$tb aout-sparcle.o aout32.o" ;;
c189fdfb
ILT
2007 sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o" ;;
2008 sparclynx_coff_vec) tb="$tb cf-sparclynx.o lynx-core.o" ;;
2009 sparcnetbsd_vec) tb="$tb sparcnetbsd.o aout32.o" ;;
8c693660
KR
2010 sparccoff_vec) tb="$tb coff-sparc.o" ;;
2011 srec_vec) tb="$tb srec.o" ;;
c189fdfb 2012 sunos_big_vec) tb="$tb sunos.o aout32.o" ;;
8c693660
KR
2013 symbolsrec_vec) tb="$tb srec.o" ;;
2014 tekhex_vec) tb="$tb tekhex.o" ;;
2015 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
2016 z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;;
2017 w65_vec) tb="$tb coff-w65.o reloc16.o" ;;
2018 versados_vec) tb="$tb versados.o" ;;
2019
2020 "") ;;
2021 *) { echo "configure: error: *** unknown target vector $vec" 1>&2; exit 1; } ;;
2022 esac
2023done
2024
2025# Target architecture .o files.
2b79a104 2026ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
8c693660
KR
2027
2028# Weed out duplicate .o files.
2029f=""
2030for i in $tb ; do
2031 case " $f " in
2032 *" $i "*) ;;
2033 *) f="$f $i" ;;
2034 esac
2035done
2036tb="$f"
2037
2038f=""
2039for i in $ta ; do
2040 case " $f " in
2041 *" $i "*) ;;
2042 *) f="$f $i" ;;
2043 esac
2044done
2045ta="$f"
2046
2047bfd_backends="$tb"
2048bfd_machines="$ta"
2049
2050if test x${all_targets} = xtrue ; then
2051 bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
2052 bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
2b79a104
ILT
2053 selvecs=
2054 selarchs=
8c693660
KR
2055else # all_targets is true
2056 # Only set these if they will be nonempty, for the clever echo.
2b79a104
ILT
2057 test -n "$selvecs" &&
2058 selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
2059 test -n "$selarchs" &&
2ffbb79a 2060 selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
8c693660
KR
2061fi # all_targets is true
2062
2063case ${host64}-${target64}-${want64} in
2064 *true*)
2065 wordsize=64
2066 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
194141a9 2067 if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then
50bd50d4
MH
2068 echo "configure: warning: You have requested a 64 bit BFD configuration, but" 1>&2
2069 echo "configure: warning: your compiler may not have a 64 bit integral type" 1>&2
2070 fi
8c693660
KR
2071 ;;
2072 false-false-false)
2073 wordsize=32
2074 all_backends='$(BFD32_BACKENDS)'
2075 ;;
2076esac
2077
2078
2079
2080
2081
2082
8c693660
KR
2083tdefaults=""
2084test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
2085test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
2086test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
2087
2088
d19df9b5
ILT
2089for ac_func in valloc getpagesize
2090do
2091echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2092if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2093 echo $ac_n "(cached) $ac_c" 1>&6
2094else
2095 cat > conftest.$ac_ext <<EOF
efc2b064 2096#line 2096 "configure"
d19df9b5
ILT
2097#include "confdefs.h"
2098/* System header to define __stub macros and hopefully few prototypes,
2099 which can conflict with char $ac_func(); below. */
2100#include <assert.h>
2101/* Override any gcc2 internal prototype to avoid an error. */
a4322a77
ILT
2102/* We use char because int might match the return type of a gcc2
2103 builtin and then its argument prototype would still apply. */
d19df9b5
ILT
2104char $ac_func();
2105
2106int main() { return 0; }
2107int t() {
2108
2109/* The GNU C library defines this for functions which it implements
2110 to always fail with ENOSYS. Some functions are actually named
2111 something starting with __ and the normal name is an alias. */
2112#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2113choke me
2114#else
2115$ac_func();
2116#endif
2117
2118; return 0; }
2119EOF
efc2b064 2120if { (eval echo configure:2120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
d19df9b5
ILT
2121 rm -rf conftest*
2122 eval "ac_cv_func_$ac_func=yes"
2123else
2124 rm -rf conftest*
2125 eval "ac_cv_func_$ac_func=no"
2126fi
2127rm -f conftest*
2128
2129fi
2130if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2131 echo "$ac_t""yes" 1>&6
2132 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2133 cat >> confdefs.h <<EOF
2134#define $ac_tr_func 1
2135EOF
2136
2137else
2138 echo "$ac_t""no" 1>&6
2139fi
2140done
2141
4fe6d901
KR
2142echo $ac_n "checking for working mmap""... $ac_c" 1>&6
2143if eval "test \"`echo '$''{'ac_cv_func_mmap'+set}'`\" = set"; then
2144 echo $ac_n "(cached) $ac_c" 1>&6
2145else
2146 if test "$cross_compiling" = yes; then
2147 ac_cv_func_mmap=no
2148else
2149cat > conftest.$ac_ext <<EOF
efc2b064 2150#line 2150 "configure"
4fe6d901
KR
2151#include "confdefs.h"
2152
2153/* Thanks to Mike Haertel and Jim Avera for this test. */
2154#include <sys/types.h>
2155#include <fcntl.h>
2156#include <sys/mman.h>
2157
4fe6d901
KR
2158#ifndef HAVE_GETPAGESIZE
2159# include <sys/param.h>
2160# ifdef EXEC_PAGESIZE
2161# define getpagesize() EXEC_PAGESIZE
2162# else
2163# ifdef NBPG
2164# define getpagesize() NBPG * CLSIZE
2165# ifndef CLSIZE
2166# define CLSIZE 1
2167# endif
2168# else
2169# ifdef NBPC
2170# define getpagesize() NBPC
2171# else
2172# define getpagesize() PAGESIZE /* SVR4 */
2173# endif
2174# endif
2175# endif
2176#endif
2177
d19df9b5 2178#ifndef HAVE_VALLOC
4fe6d901
KR
2179# define valloc malloc
2180#endif
2181
2182#ifdef __cplusplus
2183extern "C" { void *valloc(unsigned), *malloc(unsigned); }
2184#else
2185char *valloc(), *malloc();
2186#endif
2187
2188int
2189main()
2190{
2191 char *buf1, *buf2, *buf3;
2192 int i = getpagesize(), j;
d19df9b5 2193 int i2 = i * 2;
4fe6d901
KR
2194 int fd;
2195
2196 buf1 = (char *)valloc(i2);
2197 buf2 = (char *)valloc(i);
2198 buf3 = (char *)malloc(i2);
2199 for (j = 0; j < i2; ++j)
2200 *(buf1 + j) = rand();
2201 fd = open("conftestmmap", O_CREAT | O_RDWR, 0666);
2202 write(fd, buf1, i2);
2203 mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0);
2204 for (j = 0; j < i; ++j)
2205 if (*(buf1 + j) != *(buf2 + j))
2206 exit(1);
2207 lseek(fd, (long)i, 0);
2208 read(fd, buf2, i); /* read into mapped memory -- file should not change */
2209 /* (it does in i386 SVR4.0 - Jim Avera, jima@netcom.com) */
2210 lseek(fd, (long)0, 0);
2211 read(fd, buf3, i2);
2212 for (j = 0; j < i2; ++j)
2213 if (*(buf1 + j) != *(buf3 + j))
2214 exit(1);
2215 exit(0);
2216}
2217
2218EOF
efc2b064 2219{ (eval echo configure:2219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
4fe6d901
KR
2220if test -s conftest && (./conftest; exit) 2>/dev/null; then
2221 ac_cv_func_mmap=yes
2222else
2223 ac_cv_func_mmap=no
2224fi
2225fi
2226rm -fr conftest*
2227fi
85e493f0 2228
4fe6d901
KR
2229echo "$ac_t""$ac_cv_func_mmap" 1>&6
2230if test $ac_cv_func_mmap = yes; then
2231 cat >> confdefs.h <<\EOF
2232#define HAVE_MMAP 1
2233EOF
2234
2235fi
2236
2237for ac_func in madvise mprotect
2238do
2239echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2240if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2241 echo $ac_n "(cached) $ac_c" 1>&6
2242else
2243 cat > conftest.$ac_ext <<EOF
efc2b064 2244#line 2244 "configure"
4fe6d901
KR
2245#include "confdefs.h"
2246/* System header to define __stub macros and hopefully few prototypes,
2247 which can conflict with char $ac_func(); below. */
2248#include <assert.h>
2249/* Override any gcc2 internal prototype to avoid an error. */
a4322a77
ILT
2250/* We use char because int might match the return type of a gcc2
2251 builtin and then its argument prototype would still apply. */
85e493f0 2252char $ac_func();
4fe6d901
KR
2253
2254int main() { return 0; }
2255int t() {
2256
2257/* The GNU C library defines this for functions which it implements
2258 to always fail with ENOSYS. Some functions are actually named
2259 something starting with __ and the normal name is an alias. */
2260#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2261choke me
2262#else
2263$ac_func();
2264#endif
2265
2266; return 0; }
2267EOF
efc2b064 2268if { (eval echo configure:2268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4fe6d901
KR
2269 rm -rf conftest*
2270 eval "ac_cv_func_$ac_func=yes"
2271else
2272 rm -rf conftest*
2273 eval "ac_cv_func_$ac_func=no"
2274fi
2275rm -f conftest*
2276
2277fi
2278if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2279 echo "$ac_t""yes" 1>&6
85e493f0 2280 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4fe6d901
KR
2281 cat >> confdefs.h <<EOF
2282#define $ac_tr_func 1
2283EOF
2284
2285else
2286 echo "$ac_t""no" 1>&6
2287fi
2288done
2289
85e493f0
ILT
2290case ${want_mmap}+${ac_cv_func_mmap} in
2291 true+yes ) cat >> confdefs.h <<\EOF
2292#define USE_MMAP 1
2293EOF
2294 ;;
2295esac
4fe6d901 2296
8c693660
KR
2297rm -f doc/config.status
2298trap '' 1 2 15
2299cat > confcache <<\EOF
2300# This file is a shell script that caches the results of configure
2301# tests run on this system so they can be shared between configure
2302# scripts and configure runs. It is not useful on other systems.
2303# If it contains results you don't want to keep, you may remove or edit it.
2304#
2305# By default, configure uses ./config.cache as the cache file,
2306# creating it if it does not exist already. You can give configure
2307# the --cache-file=FILE option to use a different cache file; that is
2308# what configure does when it calls configure scripts in
2309# subdirectories, so they share the cache.
2310# Giving --cache-file=/dev/null disables caching, for debugging configure.
2311# config.status only pays attention to the cache file if you give it the
2312# --recheck option to rerun configure.
2313#
2314EOF
2315# Ultrix sh set writes to stderr and can't be redirected directly,
2316# and sets the high bit in the cache file unless we assign to the vars.
2317(set) 2>&1 |
2318 sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
2319 >> confcache
2320if cmp -s $cache_file confcache; then
2321 :
2322else
2323 if test -w $cache_file; then
2324 echo "updating cache $cache_file"
2325 cat confcache > $cache_file
2326 else
2327 echo "not updating unwritable cache $cache_file"
2328 fi
2329fi
2330rm -f confcache
2331
2332trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
2333
2334test "x$prefix" = xNONE && prefix=$ac_default_prefix
2335# Let make expand exec_prefix.
2336test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2337
2338# Any assignment to VPATH causes Sun make to only execute
2339# the first set of double-colon rules, so remove it if not needed.
2340# If there is a colon in the path, we need to keep it.
2341if test "x$srcdir" = x.; then
2342 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
2343fi
2344
2345trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2346
b7577823 2347DEFS=-DHAVE_CONFIG_H
8c693660
KR
2348
2349# Without the "./", some shells look in PATH for config.status.
2350: ${CONFIG_STATUS=./config.status}
2351
2352echo creating $CONFIG_STATUS
2353rm -f $CONFIG_STATUS
2354cat > $CONFIG_STATUS <<EOF
2355#! /bin/sh
2356# Generated automatically by configure.
2357# Run this file to recreate the current configuration.
2358# This directory was configured as follows,
2359# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2360#
2361# $0 $ac_configure_args
2362#
2363# Compiler output produced by configure, useful for debugging
2364# configure, is in ./config.log if it exists.
2365
2366ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
2367for ac_option
2368do
2369 case "\$ac_option" in
2370 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
2371 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
2372 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
2373 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
a4322a77 2374 echo "$CONFIG_STATUS generated by autoconf version 2.10"
8c693660
KR
2375 exit 0 ;;
2376 -help | --help | --hel | --he | --h)
2377 echo "\$ac_cs_usage"; exit 0 ;;
2378 *) echo "\$ac_cs_usage"; exit 1 ;;
2379 esac
2380done
2381
2382ac_given_srcdir=$srcdir
f515fb2f 2383ac_given_INSTALL="$INSTALL"
8c693660 2384
f4e14cb9 2385trap '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
2386EOF
2387cat >> $CONFIG_STATUS <<EOF
8c693660 2388
85e493f0 2389# Protect against being on the right side of a sed subst in config.status.
d19df9b5
ILT
2390sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2391 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
8c693660
KR
2392$ac_vpsub
2393$extrasub
2394s%@CFLAGS@%$CFLAGS%g
2395s%@CPPFLAGS@%$CPPFLAGS%g
2396s%@CXXFLAGS@%$CXXFLAGS%g
2397s%@DEFS@%$DEFS%g
2398s%@LDFLAGS@%$LDFLAGS%g
2399s%@LIBS@%$LIBS%g
2400s%@exec_prefix@%$exec_prefix%g
2401s%@prefix@%$prefix%g
2402s%@program_transform_name@%$program_transform_name%g
85e493f0
ILT
2403s%@bindir@%$bindir%g
2404s%@sbindir@%$sbindir%g
2405s%@libexecdir@%$libexecdir%g
2406s%@datadir@%$datadir%g
2407s%@sysconfdir@%$sysconfdir%g
2408s%@sharedstatedir@%$sharedstatedir%g
2409s%@localstatedir@%$localstatedir%g
2410s%@libdir@%$libdir%g
2411s%@includedir@%$includedir%g
2412s%@oldincludedir@%$oldincludedir%g
2413s%@infodir@%$infodir%g
2414s%@mandir@%$mandir%g
8c693660
KR
2415s%@host@%$host%g
2416s%@host_alias@%$host_alias%g
2417s%@host_cpu@%$host_cpu%g
2418s%@host_vendor@%$host_vendor%g
2419s%@host_os@%$host_os%g
2420s%@target@%$target%g
2421s%@target_alias@%$target_alias%g
2422s%@target_cpu@%$target_cpu%g
2423s%@target_vendor@%$target_vendor%g
2424s%@target_os@%$target_os%g
2425s%@build@%$build%g
2426s%@build_alias@%$build_alias%g
2427s%@build_cpu@%$build_cpu%g
2428s%@build_vendor@%$build_vendor%g
2429s%@build_os@%$build_os%g
f515fb2f
ILT
2430s%@CC@%$CC%g
2431s%@HDEFINES@%$HDEFINES%g
2432s%@AR@%$AR%g
8c693660 2433s%@RANLIB@%$RANLIB%g
f515fb2f
ILT
2434s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
2435s%@INSTALL_DATA@%$INSTALL_DATA%g
44f795f7
ILT
2436s%@ALLLIBS@%$ALLLIBS%g
2437s%@PICFLAG@%$PICFLAG%g
2438s%@SHLIB@%$SHLIB%g
2439s%@SHLIB_CC@%$SHLIB_CC%g
2440s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g
2441s%@COMMON_SHLIB@%$COMMON_SHLIB%g
2442s%@PICLIST@%$PICLIST%g
2443s%@SHLINK@%$SHLINK%g
ab659fd6 2444s%@INSTALL_SHLIB@%$INSTALL_SHLIB%g
f4e14cb9
ILT
2445s%@VERSION@%$VERSION%g
2446s%@BFD_HOST_64BIT_LONG@%$BFD_HOST_64BIT_LONG%g
2447s%@BFD_HOST_64_BIT_DEFINED@%$BFD_HOST_64_BIT_DEFINED%g
2448s%@BFD_HOST_64_BIT@%$BFD_HOST_64_BIT%g
2449s%@BFD_HOST_U_64_BIT@%$BFD_HOST_U_64_BIT%g
f515fb2f 2450s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
b7577823 2451s%@CPP@%$CPP%g
a52a3ce8
ILT
2452s%@COREFILE@%$COREFILE%g
2453s%@COREFLAG@%$COREFLAG%g
2b79a104 2454s%@TDEFINES@%$TDEFINES%g
8c693660
KR
2455s%@wordsize@%$wordsize%g
2456s%@all_backends@%$all_backends%g
2457s%@bfd_backends@%$bfd_backends%g
2458s%@bfd_machines@%$bfd_machines%g
2459s%@tdefaults@%$tdefaults%g
2460
2461CEOF
2462EOF
2463cat >> $CONFIG_STATUS <<EOF
2464
f4e14cb9 2465CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile bfd-in3.h:bfd-in2.h"}
8c693660
KR
2466EOF
2467cat >> $CONFIG_STATUS <<\EOF
2468for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
2469 # Support "outfile[:infile]", defaulting infile="outfile.in".
2470 case "$ac_file" in
2471 *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
2472 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2473 *) ac_file_in="${ac_file}.in" ;;
2474 esac
2475
2476 # Adjust relative srcdir, etc. for subdirectories.
2477
2478 # Remove last slash and all that follows it. Not all systems have dirname.
2479 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2480 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2481 # The file is in a subdirectory.
2482 test ! -d "$ac_dir" && mkdir "$ac_dir"
2483 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2484 # A "../" for each directory in $ac_dir_suffix.
2485 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2486 else
2487 ac_dir_suffix= ac_dots=
2488 fi
2489
2490 case "$ac_given_srcdir" in
2491 .) srcdir=.
2492 if test -z "$ac_dots"; then top_srcdir=.
2493 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2494 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2495 *) # Relative path.
2496 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2497 top_srcdir="$ac_dots$ac_given_srcdir" ;;
2498 esac
2499
f515fb2f
ILT
2500 case "$ac_given_INSTALL" in
2501 [/$]*) INSTALL="$ac_given_INSTALL" ;;
2502 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2503 esac
8c693660
KR
2504 echo creating "$ac_file"
2505 rm -f "$ac_file"
2506 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2507 case "$ac_file" in
2508 *Makefile*) ac_comsub="1i\\
2509# $configure_input" ;;
2510 *) ac_comsub= ;;
2511 esac
2512 sed -e "$ac_comsub
2513s%@configure_input@%$configure_input%g
2514s%@srcdir@%$srcdir%g
2515s%@top_srcdir@%$top_srcdir%g
f515fb2f 2516s%@INSTALL@%$INSTALL%g
8c693660
KR
2517" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
2518fi; done
2519rm -f conftest.subs
2520
b7577823
ILT
2521# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
2522# NAME is the cpp macro being defined and VALUE is the value it is being given.
2523#
2524# ac_d sets the value in "#define NAME VALUE" lines.
2525ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
2526ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
2527ac_dC='\3'
2528ac_dD='%g'
2529# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
2530ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
2531ac_uB='\([ ]\)%\1#\2define\3'
2532ac_uC=' '
2533ac_uD='\4%g'
2534# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
2535ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
2536ac_eB='$%\1#\2define\3'
2537ac_eC=' '
2538ac_eD='%g'
2539
936b870c 2540CONFIG_HEADERS=${CONFIG_HEADERS-"config.h:config.in"}
b7577823
ILT
2541for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
2542 # Support "outfile[:infile]", defaulting infile="outfile.in".
2543 case "$ac_file" in
2544 *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
2545 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2546 *) ac_file_in="${ac_file}.in" ;;
2547 esac
8c693660 2548
b7577823 2549 echo creating $ac_file
8c693660 2550
b7577823
ILT
2551 rm -f conftest.frag conftest.in conftest.out
2552 cp $ac_given_srcdir/$ac_file_in conftest.in
8c693660 2553
b7577823 2554EOF
8c693660 2555
b7577823
ILT
2556# Transform confdefs.h into a sed script conftest.vals that substitutes
2557# the proper values into config.h.in to produce config.h. And first:
85e493f0 2558# Protect against being on the right side of a sed subst in config.status.
b7577823
ILT
2559# Protect against being in an unquoted here document in config.status.
2560rm -f conftest.vals
2561cat > conftest.hdr <<\EOF
2562s/[\\&%]/\\&/g
2563s%[\\$`]%\\&%g
a4322a77 2564s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
b7577823
ILT
2565s%ac_d%ac_u%gp
2566s%ac_u%ac_e%gp
2567EOF
2568sed -n -f conftest.hdr confdefs.h > conftest.vals
2569rm -f conftest.hdr
2570
2571# This sed command replaces #undef with comments. This is necessary, for
2572# example, in the case of _POSIX_SOURCE, which is predefined and required
2573# on some systems where configure will not decide to define it.
2574cat >> conftest.vals <<\EOF
2575s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
2576EOF
8c693660 2577
b7577823
ILT
2578# Break up conftest.vals because some shells have a limit on
2579# the size of here documents, and old seds have small limits too.
2580# Maximum number of lines to put in a single here document.
2581ac_max_here_lines=12
8c693660 2582
b7577823
ILT
2583rm -f conftest.tail
2584while :
2585do
2586 ac_lines=`grep -c . conftest.vals`
2587 # grep -c gives empty output for an empty file on some AIX systems.
2588 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
2589 # Write a limited-size here document to conftest.frag.
2590 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
2591 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
2592 echo 'CEOF
2593 sed -f conftest.frag conftest.in > conftest.out
2594 rm -f conftest.in
2595 mv conftest.out conftest.in
2596' >> $CONFIG_STATUS
2597 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
2598 rm -f conftest.vals
2599 mv conftest.tail conftest.vals
2600done
2601rm -f conftest.vals
8c693660 2602
b7577823
ILT
2603cat >> $CONFIG_STATUS <<\EOF
2604 rm -f conftest.frag conftest.h
2605 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
2606 cat conftest.in >> conftest.h
2607 rm -f conftest.in
2608 if cmp -s $ac_file conftest.h 2>/dev/null; then
2609 echo "$ac_file is unchanged"
2610 rm -f conftest.h
8c693660 2611 else
a4322a77
ILT
2612 # Remove last slash and all that follows it. Not all systems have dirname.
2613 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2614 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2615 # The file is in a subdirectory.
2616 test ! -d "$ac_dir" && mkdir "$ac_dir"
2617 fi
b7577823
ILT
2618 rm -f $ac_file
2619 mv conftest.h $ac_file
8c693660 2620 fi
b7577823
ILT
2621fi; done
2622
8c693660 2623
a7873a6c 2624case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac
8c693660
KR
2625exit 0
2626EOF
2627chmod +x $CONFIG_STATUS
2628rm -fr confdefs* $ac_clean_files
2629test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2630
This page took 0.181863 seconds and 4 git commands to generate.