* Makefile.in: Get header files from libgloss/mn10300/sys.
[deliverable/binutils-gdb.git] / bfd / configure
CommitLineData
8c693660
KR
1#! /bin/sh
2
3# Guess values for system-dependent variables and create Makefiles.
372b296c 4# Generated automatically using autoconf version 2.12.1
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:
c0734708
ILT
14ac_help="$ac_help
15 --with-gnu-ld assume the C compiler uses GNU ld [default=no]"
16ac_help="$ac_help
17 --enable-shared build shared libraries [default=yes]"
18ac_help="$ac_help
19 --enable-static build static libraries [default=yes]"
8c693660 20ac_help="$ac_help
e818c22e 21 --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)"
8c693660 22ac_help="$ac_help
e818c22e 23 --enable-targets alternative target configurations"
44f795f7
ILT
24ac_help="$ac_help
25 --enable-commonbfdlib build shared BFD/opcodes/libiberty library"
85e493f0
ILT
26ac_help="$ac_help
27 --with-mmap try using mmap for BFD input files if available"
c0734708
ILT
28ac_help="$ac_help
29 --enable-maintainer-mode enable make rules and dependencies not useful
30 (and sometimes confusing) to the casual installer"
8c693660
KR
31
32# Initialize some variables set by options.
33# The variables have the same names as the options, with
34# dashes changed to underlines.
35build=NONE
36cache_file=./config.cache
37exec_prefix=NONE
38host=NONE
39no_create=
40nonopt=NONE
41no_recursion=
42prefix=NONE
43program_prefix=NONE
44program_suffix=NONE
45program_transform_name=s,x,x,
46silent=
47site=
48srcdir=
49target=NONE
50verbose=
51x_includes=NONE
52x_libraries=NONE
85e493f0
ILT
53bindir='${exec_prefix}/bin'
54sbindir='${exec_prefix}/sbin'
55libexecdir='${exec_prefix}/libexec'
56datadir='${prefix}/share'
57sysconfdir='${prefix}/etc'
58sharedstatedir='${prefix}/com'
59localstatedir='${prefix}/var'
60libdir='${exec_prefix}/lib'
61includedir='${prefix}/include'
62oldincludedir='/usr/include'
63infodir='${prefix}/info'
64mandir='${prefix}/man'
8c693660
KR
65
66# Initialize some other variables.
67subdirs=
85e493f0 68MFLAGS= MAKEFLAGS=
372b296c 69SHELL=${CONFIG_SHELL-/bin/sh}
ac388f2a
ILT
70# Maximum number of lines to put in a shell here document.
71ac_max_here_lines=12
8c693660
KR
72
73ac_prev=
74for ac_option
75do
76
77 # If the previous option needs an argument, assign it.
78 if test -n "$ac_prev"; then
79 eval "$ac_prev=\$ac_option"
80 ac_prev=
81 continue
82 fi
83
84 case "$ac_option" in
85 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
86 *) ac_optarg= ;;
87 esac
88
89 # Accept the important Cygnus configure options, so we can diagnose typos.
90
91 case "$ac_option" in
92
85e493f0
ILT
93 -bindir | --bindir | --bindi | --bind | --bin | --bi)
94 ac_prev=bindir ;;
95 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
96 bindir="$ac_optarg" ;;
97
98 -build | --build | --buil | --bui | --bu)
8c693660 99 ac_prev=build ;;
85e493f0 100 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
8c693660
KR
101 build="$ac_optarg" ;;
102
103 -cache-file | --cache-file | --cache-fil | --cache-fi \
104 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
105 ac_prev=cache_file ;;
106 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
107 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
108 cache_file="$ac_optarg" ;;
109
85e493f0
ILT
110 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
111 ac_prev=datadir ;;
112 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
113 | --da=*)
114 datadir="$ac_optarg" ;;
115
8c693660
KR
116 -disable-* | --disable-*)
117 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
118 # Reject names that are not valid shell variable names.
119 if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
120 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
121 fi
122 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
123 eval "enable_${ac_feature}=no" ;;
124
125 -enable-* | --enable-*)
126 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
127 # Reject names that are not valid shell variable names.
128 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
129 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
130 fi
131 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
132 case "$ac_option" in
133 *=*) ;;
134 *) ac_optarg=yes ;;
135 esac
136 eval "enable_${ac_feature}='$ac_optarg'" ;;
137
138 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
139 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
140 | --exec | --exe | --ex)
141 ac_prev=exec_prefix ;;
142 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
143 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
144 | --exec=* | --exe=* | --ex=*)
145 exec_prefix="$ac_optarg" ;;
146
147 -gas | --gas | --ga | --g)
148 # Obsolete; use --with-gas.
149 with_gas=yes ;;
150
151 -help | --help | --hel | --he)
152 # Omit some internal or obsolete options to make the list less imposing.
153 # This message is too long to be a string in the A/UX 3.1 sh.
154 cat << EOF
155Usage: configure [options] [host]
156Options: [defaults in brackets after descriptions]
157Configuration:
158 --cache-file=FILE cache test results in FILE
159 --help print this message
160 --no-create do not create output files
161 --quiet, --silent do not print \`checking...' messages
162 --version print the version of autoconf that created configure
163Directory and file names:
164 --prefix=PREFIX install architecture-independent files in PREFIX
165 [$ac_default_prefix]
85e493f0 166 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
8c693660 167 [same as prefix]
85e493f0
ILT
168 --bindir=DIR user executables in DIR [EPREFIX/bin]
169 --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
170 --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
171 --datadir=DIR read-only architecture-independent data in DIR
172 [PREFIX/share]
173 --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
174 --sharedstatedir=DIR modifiable architecture-independent data in DIR
175 [PREFIX/com]
176 --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
177 --libdir=DIR object code libraries in DIR [EPREFIX/lib]
178 --includedir=DIR C header files in DIR [PREFIX/include]
179 --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
180 --infodir=DIR info documentation in DIR [PREFIX/info]
181 --mandir=DIR man documentation in DIR [PREFIX/man]
8c693660
KR
182 --srcdir=DIR find the sources in DIR [configure dir or ..]
183 --program-prefix=PREFIX prepend PREFIX to installed program names
184 --program-suffix=SUFFIX append SUFFIX to installed program names
85e493f0
ILT
185 --program-transform-name=PROGRAM
186 run sed PROGRAM on installed program names
187EOF
188 cat << EOF
8c693660
KR
189Host type:
190 --build=BUILD configure for building on BUILD [BUILD=HOST]
191 --host=HOST configure for HOST [guessed]
192 --target=TARGET configure for TARGET [TARGET=HOST]
193Features and packages:
194 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
195 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
196 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
197 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
198 --x-includes=DIR X include files are in DIR
199 --x-libraries=DIR X library files are in DIR
8c693660 200EOF
85e493f0
ILT
201 if test -n "$ac_help"; then
202 echo "--enable and --with options recognized:$ac_help"
203 fi
8c693660
KR
204 exit 0 ;;
205
206 -host | --host | --hos | --ho)
207 ac_prev=host ;;
208 -host=* | --host=* | --hos=* | --ho=*)
209 host="$ac_optarg" ;;
210
85e493f0
ILT
211 -includedir | --includedir | --includedi | --included | --include \
212 | --includ | --inclu | --incl | --inc)
213 ac_prev=includedir ;;
214 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
215 | --includ=* | --inclu=* | --incl=* | --inc=*)
216 includedir="$ac_optarg" ;;
217
218 -infodir | --infodir | --infodi | --infod | --info | --inf)
219 ac_prev=infodir ;;
220 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
221 infodir="$ac_optarg" ;;
222
223 -libdir | --libdir | --libdi | --libd)
224 ac_prev=libdir ;;
225 -libdir=* | --libdir=* | --libdi=* | --libd=*)
226 libdir="$ac_optarg" ;;
227
228 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
229 | --libexe | --libex | --libe)
230 ac_prev=libexecdir ;;
231 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
232 | --libexe=* | --libex=* | --libe=*)
233 libexecdir="$ac_optarg" ;;
234
235 -localstatedir | --localstatedir | --localstatedi | --localstated \
236 | --localstate | --localstat | --localsta | --localst \
237 | --locals | --local | --loca | --loc | --lo)
238 ac_prev=localstatedir ;;
239 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
240 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
241 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
242 localstatedir="$ac_optarg" ;;
243
244 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
245 ac_prev=mandir ;;
246 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
247 mandir="$ac_optarg" ;;
248
8c693660
KR
249 -nfp | --nfp | --nf)
250 # Obsolete; use --without-fp.
251 with_fp=no ;;
252
253 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
254 | --no-cr | --no-c)
255 no_create=yes ;;
256
257 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
258 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
259 no_recursion=yes ;;
260
85e493f0
ILT
261 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
262 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
263 | --oldin | --oldi | --old | --ol | --o)
264 ac_prev=oldincludedir ;;
265 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
266 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
267 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
268 oldincludedir="$ac_optarg" ;;
269
8c693660
KR
270 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
271 ac_prev=prefix ;;
272 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
273 prefix="$ac_optarg" ;;
274
275 -program-prefix | --program-prefix | --program-prefi | --program-pref \
276 | --program-pre | --program-pr | --program-p)
277 ac_prev=program_prefix ;;
278 -program-prefix=* | --program-prefix=* | --program-prefi=* \
279 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
280 program_prefix="$ac_optarg" ;;
281
282 -program-suffix | --program-suffix | --program-suffi | --program-suff \
283 | --program-suf | --program-su | --program-s)
284 ac_prev=program_suffix ;;
285 -program-suffix=* | --program-suffix=* | --program-suffi=* \
286 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
287 program_suffix="$ac_optarg" ;;
288
289 -program-transform-name | --program-transform-name \
290 | --program-transform-nam | --program-transform-na \
291 | --program-transform-n | --program-transform- \
292 | --program-transform | --program-transfor \
293 | --program-transfo | --program-transf \
294 | --program-trans | --program-tran \
295 | --progr-tra | --program-tr | --program-t)
296 ac_prev=program_transform_name ;;
297 -program-transform-name=* | --program-transform-name=* \
298 | --program-transform-nam=* | --program-transform-na=* \
299 | --program-transform-n=* | --program-transform-=* \
300 | --program-transform=* | --program-transfor=* \
301 | --program-transfo=* | --program-transf=* \
302 | --program-trans=* | --program-tran=* \
303 | --progr-tra=* | --program-tr=* | --program-t=*)
304 program_transform_name="$ac_optarg" ;;
305
306 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
307 | -silent | --silent | --silen | --sile | --sil)
308 silent=yes ;;
309
85e493f0
ILT
310 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
311 ac_prev=sbindir ;;
312 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
313 | --sbi=* | --sb=*)
314 sbindir="$ac_optarg" ;;
315
316 -sharedstatedir | --sharedstatedir | --sharedstatedi \
317 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
318 | --sharedst | --shareds | --shared | --share | --shar \
319 | --sha | --sh)
320 ac_prev=sharedstatedir ;;
321 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
322 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
323 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
324 | --sha=* | --sh=*)
325 sharedstatedir="$ac_optarg" ;;
326
8c693660
KR
327 -site | --site | --sit)
328 ac_prev=site ;;
329 -site=* | --site=* | --sit=*)
330 site="$ac_optarg" ;;
331
332 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
333 ac_prev=srcdir ;;
334 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
335 srcdir="$ac_optarg" ;;
336
85e493f0
ILT
337 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
338 | --syscon | --sysco | --sysc | --sys | --sy)
339 ac_prev=sysconfdir ;;
340 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
341 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
342 sysconfdir="$ac_optarg" ;;
343
8c693660
KR
344 -target | --target | --targe | --targ | --tar | --ta | --t)
345 ac_prev=target ;;
346 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
347 target="$ac_optarg" ;;
348
349 -v | -verbose | --verbose | --verbos | --verbo | --verb)
350 verbose=yes ;;
351
352 -version | --version | --versio | --versi | --vers)
372b296c 353 echo "configure generated by autoconf version 2.12.1"
8c693660
KR
354 exit 0 ;;
355
356 -with-* | --with-*)
357 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
358 # Reject names that are not valid shell variable names.
359 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
360 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
361 fi
362 ac_package=`echo $ac_package| sed 's/-/_/g'`
363 case "$ac_option" in
364 *=*) ;;
365 *) ac_optarg=yes ;;
366 esac
367 eval "with_${ac_package}='$ac_optarg'" ;;
368
369 -without-* | --without-*)
370 ac_package=`echo $ac_option|sed -e 's/-*without-//'`
371 # Reject names that are not valid shell variable names.
372 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
373 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
374 fi
375 ac_package=`echo $ac_package| sed 's/-/_/g'`
376 eval "with_${ac_package}=no" ;;
377
378 --x)
379 # Obsolete; use --with-x.
380 with_x=yes ;;
381
382 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
383 | --x-incl | --x-inc | --x-in | --x-i)
384 ac_prev=x_includes ;;
385 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
386 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
387 x_includes="$ac_optarg" ;;
388
389 -x-libraries | --x-libraries | --x-librarie | --x-librari \
390 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
391 ac_prev=x_libraries ;;
392 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
393 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
394 x_libraries="$ac_optarg" ;;
395
396 -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
397 ;;
398
85e493f0 399 *)
8c693660
KR
400 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
401 echo "configure: warning: $ac_option: invalid host type" 1>&2
402 fi
403 if test "x$nonopt" != xNONE; then
404 { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
405 fi
406 nonopt="$ac_option"
407 ;;
408
409 esac
410done
411
412if test -n "$ac_prev"; then
413 { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
414fi
415
416trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
417
418# File descriptor usage:
419# 0 standard input
420# 1 file creation
421# 2 errors and warnings
422# 3 some systems may open it to /dev/tty
423# 4 used on the Kubota Titan
424# 6 checking for... messages and results
425# 5 compiler messages saved in config.log
426if test "$silent" = yes; then
427 exec 6>/dev/null
428else
429 exec 6>&1
430fi
431exec 5>./config.log
432
433echo "\
434This file contains any messages produced by compilers while
435running configure, to aid debugging if configure makes a mistake.
436" 1>&5
437
438# Strip out --no-create and --no-recursion so they do not pile up.
439# Also quote any args containing shell metacharacters.
440ac_configure_args=
441for ac_arg
442do
443 case "$ac_arg" in
444 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
445 | --no-cr | --no-c) ;;
446 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
447 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
448 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
449 ac_configure_args="$ac_configure_args '$ac_arg'" ;;
450 *) ac_configure_args="$ac_configure_args $ac_arg" ;;
451 esac
452done
453
454# NLS nuisances.
ac388f2a
ILT
455# Only set these to C if already set. These must not be set unconditionally
456# because not all systems understand e.g. LANG=C (notably SCO).
457# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
458# Non-C LC_CTYPE values break the ctype check.
fd8d7c31 459if test "${LANG+set}" = set; then LANG=C; export LANG; fi
ac388f2a
ILT
460if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
461if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
462if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
8c693660
KR
463
464# confdefs.h avoids OS command line length limits that DEFS can exceed.
465rm -rf conftest* confdefs.h
466# AIX cpp loses on an empty file, so make sure it contains at least a newline.
467echo > confdefs.h
468
469# A filename unique to this package, relative to the directory that
470# configure is in, which we can look for to find out if srcdir is correct.
471ac_unique_file=libbfd.c
472
473# Find the source files, if location was not specified.
474if test -z "$srcdir"; then
475 ac_srcdir_defaulted=yes
476 # Try the directory containing this script, then its parent.
477 ac_prog=$0
478 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
479 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
480 srcdir=$ac_confdir
481 if test ! -r $srcdir/$ac_unique_file; then
482 srcdir=..
483 fi
484else
485 ac_srcdir_defaulted=no
486fi
487if test ! -r $srcdir/$ac_unique_file; then
488 if test "$ac_srcdir_defaulted" = yes; then
489 { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
490 else
491 { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
492 fi
493fi
494srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
495
496# Prefer explicitly selected file to automatically selected ones.
497if test -z "$CONFIG_SITE"; then
498 if test "x$prefix" != xNONE; then
499 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
500 else
501 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
502 fi
503fi
504for ac_site_file in $CONFIG_SITE; do
505 if test -r "$ac_site_file"; then
506 echo "loading site script $ac_site_file"
507 . "$ac_site_file"
508 fi
509done
510
511if test -r "$cache_file"; then
512 echo "loading cache $cache_file"
513 . $cache_file
514else
515 echo "creating cache $cache_file"
516 > $cache_file
517fi
518
519ac_ext=c
520# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
986cf3b8
ILT
521ac_cpp='$CPP $CPPFLAGS'
522ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
523ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ac388f2a 524cross_compiling=$ac_cv_prog_cc_cross
8c693660
KR
525
526if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
527 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
528 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
529 ac_n= ac_c='
530' ac_t=' '
531 else
532 ac_n=-n ac_c= ac_t=
533 fi
534else
535 ac_n= ac_c='\c' ac_t=
536fi
537
538
539
8c693660 540ac_aux_dir=
c0734708 541for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
8c693660
KR
542 if test -f $ac_dir/install-sh; then
543 ac_aux_dir=$ac_dir
544 ac_install_sh="$ac_aux_dir/install-sh -c"
545 break
546 elif test -f $ac_dir/install.sh; then
547 ac_aux_dir=$ac_dir
548 ac_install_sh="$ac_aux_dir/install.sh -c"
549 break
550 fi
551done
552if test -z "$ac_aux_dir"; then
c0734708 553 { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
8c693660
KR
554fi
555ac_config_guess=$ac_aux_dir/config.guess
556ac_config_sub=$ac_aux_dir/config.sub
557ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
558
559
560# Do some error checking and defaulting for the host and target type.
561# The inputs are:
562# configure --host=HOST --target=TARGET --build=BUILD NONOPT
563#
564# The rules are:
565# 1. You are not allowed to specify --host, --target, and nonopt at the
85e493f0 566# same time.
8c693660
KR
567# 2. Host defaults to nonopt.
568# 3. If nonopt is not specified, then host defaults to the current host,
569# as determined by config.guess.
570# 4. Target and build default to nonopt.
571# 5. If nonopt is not specified, then target and build default to host.
572
573# The aliases save the names the user supplied, while $host etc.
574# will get canonicalized.
575case $host---$target---$nonopt in
576NONE---*---* | *---NONE---* | *---*---NONE) ;;
577*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
578esac
579
580
c0734708 581# Make sure we can run config.sub.
372b296c 582if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
c0734708
ILT
583else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
584fi
585
586echo $ac_n "checking host system type""... $ac_c" 1>&6
9a837903 587echo "configure:588: checking host system type" >&5
c0734708
ILT
588
589host_alias=$host
590case "$host_alias" in
591NONE)
592 case $nonopt in
593 NONE)
372b296c 594 if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
c0734708
ILT
595 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
596 fi ;;
597 *) host_alias=$nonopt ;;
598 esac ;;
599esac
600
372b296c 601host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
c0734708
ILT
602host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
603host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
604host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
605echo "$ac_t""$host" 1>&6
606
607echo $ac_n "checking target system type""... $ac_c" 1>&6
9a837903 608echo "configure:609: checking target system type" >&5
c0734708
ILT
609
610target_alias=$target
611case "$target_alias" in
612NONE)
613 case $nonopt in
614 NONE) target_alias=$host_alias ;;
615 *) target_alias=$nonopt ;;
616 esac ;;
617esac
618
372b296c 619target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
c0734708
ILT
620target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
621target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
622target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
623echo "$ac_t""$target" 1>&6
624
625echo $ac_n "checking build system type""... $ac_c" 1>&6
9a837903 626echo "configure:627: checking build system type" >&5
c0734708
ILT
627
628build_alias=$build
629case "$build_alias" in
630NONE)
631 case $nonopt in
632 NONE) build_alias=$host_alias ;;
633 *) build_alias=$nonopt ;;
634 esac ;;
635esac
636
372b296c 637build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
c0734708
ILT
638build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
639build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
640build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
641echo "$ac_t""$build" 1>&6
642
643test "$host_alias" != "$target_alias" &&
644 test "$program_prefix$program_suffix$program_transform_name" = \
645 NONENONEs,x,x, &&
646 program_prefix=${target_alias}-
647
648# Extract the first word of "gcc", so it can be a program name with args.
649set dummy gcc; ac_word=$2
650echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
9a837903 651echo "configure:652: checking for $ac_word" >&5
c0734708
ILT
652if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
653 echo $ac_n "(cached) $ac_c" 1>&6
654else
655 if test -n "$CC"; then
656 ac_cv_prog_CC="$CC" # Let the user override the test.
657else
658 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
659 for ac_dir in $PATH; do
660 test -z "$ac_dir" && ac_dir=.
661 if test -f $ac_dir/$ac_word; then
662 ac_cv_prog_CC="gcc"
663 break
664 fi
665 done
666 IFS="$ac_save_ifs"
667fi
668fi
669CC="$ac_cv_prog_CC"
670if test -n "$CC"; then
671 echo "$ac_t""$CC" 1>&6
672else
673 echo "$ac_t""no" 1>&6
674fi
675
676if test -z "$CC"; then
677 # Extract the first word of "cc", so it can be a program name with args.
678set dummy cc; ac_word=$2
679echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
9a837903 680echo "configure:681: checking for $ac_word" >&5
c0734708
ILT
681if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
682 echo $ac_n "(cached) $ac_c" 1>&6
683else
684 if test -n "$CC"; then
685 ac_cv_prog_CC="$CC" # Let the user override the test.
686else
687 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
688 ac_prog_rejected=no
689 for ac_dir in $PATH; do
690 test -z "$ac_dir" && ac_dir=.
691 if test -f $ac_dir/$ac_word; then
692 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
693 ac_prog_rejected=yes
694 continue
695 fi
696 ac_cv_prog_CC="cc"
697 break
698 fi
699 done
700 IFS="$ac_save_ifs"
701if test $ac_prog_rejected = yes; then
702 # We found a bogon in the path, so make sure we never use it.
703 set dummy $ac_cv_prog_CC
704 shift
705 if test $# -gt 0; then
706 # We chose a different compiler from the bogus one.
707 # However, it has the same basename, so the bogon will be chosen
708 # first if we set CC to just the basename; use the full file name.
709 shift
710 set dummy "$ac_dir/$ac_word" "$@"
711 shift
712 ac_cv_prog_CC="$@"
713 fi
714fi
715fi
716fi
717CC="$ac_cv_prog_CC"
718if test -n "$CC"; then
719 echo "$ac_t""$CC" 1>&6
720else
721 echo "$ac_t""no" 1>&6
722fi
723
724 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
725fi
726
727echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
9a837903 728echo "configure:729: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
c0734708
ILT
729
730ac_ext=c
731# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
732ac_cpp='$CPP $CPPFLAGS'
733ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
734ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
735cross_compiling=$ac_cv_prog_cc_cross
736
737cat > conftest.$ac_ext <<EOF
9a837903 738#line 739 "configure"
c0734708
ILT
739#include "confdefs.h"
740main(){return(0);}
741EOF
9a837903 742if { (eval echo configure:743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
c0734708
ILT
743 ac_cv_prog_cc_works=yes
744 # If we can't run a trivial program, we are probably using a cross compiler.
745 if (./conftest; exit) 2>/dev/null; then
746 ac_cv_prog_cc_cross=no
747 else
748 ac_cv_prog_cc_cross=yes
749 fi
750else
751 echo "configure: failed program was:" >&5
752 cat conftest.$ac_ext >&5
753 ac_cv_prog_cc_works=no
754fi
755rm -fr conftest*
756
757echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
758if test $ac_cv_prog_cc_works = no; then
759 { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
760fi
761echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
9a837903 762echo "configure:763: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
c0734708
ILT
763echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
764cross_compiling=$ac_cv_prog_cc_cross
765
766echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
9a837903 767echo "configure:768: checking whether we are using GNU C" >&5
c0734708
ILT
768if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
769 echo $ac_n "(cached) $ac_c" 1>&6
770else
771 cat > conftest.c <<EOF
772#ifdef __GNUC__
773 yes;
774#endif
775EOF
9a837903 776if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
c0734708
ILT
777 ac_cv_prog_gcc=yes
778else
779 ac_cv_prog_gcc=no
780fi
781fi
782
783echo "$ac_t""$ac_cv_prog_gcc" 1>&6
784
785if test $ac_cv_prog_gcc = yes; then
786 GCC=yes
787 ac_test_CFLAGS="${CFLAGS+set}"
788 ac_save_CFLAGS="$CFLAGS"
789 CFLAGS=
790 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
9a837903 791echo "configure:792: checking whether ${CC-cc} accepts -g" >&5
c0734708
ILT
792if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
793 echo $ac_n "(cached) $ac_c" 1>&6
794else
795 echo 'void f(){}' > conftest.c
796if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
797 ac_cv_prog_cc_g=yes
798else
799 ac_cv_prog_cc_g=no
800fi
801rm -f conftest*
802
803fi
804
805echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
806 if test "$ac_test_CFLAGS" = set; then
807 CFLAGS="$ac_save_CFLAGS"
808 elif test $ac_cv_prog_cc_g = yes; then
809 CFLAGS="-g -O2"
810 else
811 CFLAGS="-O2"
812 fi
813else
814 GCC=
815 test "${CFLAGS+set}" = set || CFLAGS="-g"
816fi
817
818echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
9a837903 819echo "configure:820: checking for POSIXized ISC" >&5
c0734708
ILT
820if test -d /etc/conf/kconfig.d &&
821 grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
822then
823 echo "$ac_t""yes" 1>&6
824 ISC=yes # If later tests want to check for ISC.
825 cat >> confdefs.h <<\EOF
826#define _POSIX_SOURCE 1
827EOF
828
829 if test "$GCC" = yes; then
830 CC="$CC -posix"
831 else
832 CC="$CC -Xp"
833 fi
834else
835 echo "$ac_t""no" 1>&6
836 ISC=
837fi
838
839
840# Find a good install program. We prefer a C program (faster),
841# so one script is as good as another. But avoid the broken or
842# incompatible versions:
843# SysV /etc/install, /usr/sbin/install
844# SunOS /usr/etc/install
845# IRIX /sbin/install
846# AIX /bin/install
372b296c 847# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
c0734708
ILT
848# AFS /usr/afsws/bin/install, which mishandles nonexistent args
849# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
850# ./install, which can be erroneously created by make from ./install.sh.
851echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
9a837903 852echo "configure:853: checking for a BSD compatible install" >&5
c0734708
ILT
853if test -z "$INSTALL"; then
854if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
855 echo $ac_n "(cached) $ac_c" 1>&6
856else
857 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
858 for ac_dir in $PATH; do
859 # Account for people who put trailing slashes in PATH elements.
860 case "$ac_dir/" in
861 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
862 *)
863 # OSF1 and SCO ODT 3.0 have their own names for install.
372b296c
ILT
864 # Don't use installbsd from OSF since it installs stuff as root
865 # by default.
866 for ac_prog in ginstall scoinst install; do
c0734708
ILT
867 if test -f $ac_dir/$ac_prog; then
868 if test $ac_prog = install &&
869 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
870 # AIX install. It has an incompatible calling convention.
c0734708
ILT
871 :
872 else
873 ac_cv_path_install="$ac_dir/$ac_prog -c"
874 break 2
875 fi
876 fi
877 done
878 ;;
879 esac
880 done
881 IFS="$ac_save_IFS"
882
883fi
884 if test "${ac_cv_path_install+set}" = set; then
885 INSTALL="$ac_cv_path_install"
886 else
887 # As a last resort, use the slow shell script. We don't cache a
888 # path for INSTALL within a source directory, because that will
889 # break other packages using the cache if that directory is
890 # removed, or if the path is relative.
891 INSTALL="$ac_install_sh"
892 fi
893fi
894echo "$ac_t""$INSTALL" 1>&6
895
896# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
897# It thinks the first close brace ends the variable substitution.
898test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
899
900test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
901
902
903test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
904
905
906PACKAGE=bfd
907
229811d1 908VERSION=2.8.4
c0734708
ILT
909
910if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
911 { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
912fi
913cat >> confdefs.h <<EOF
914#define PACKAGE "$PACKAGE"
915EOF
916
917cat >> confdefs.h <<EOF
918#define VERSION "$VERSION"
919EOF
920
921echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
9a837903 922echo "configure:923: checking whether build environment is sane" >&5
c0734708
ILT
923# Just in case
924sleep 1
925echo timestamp > conftestfile
926# Do `set' in a subshell so we don't clobber the current shell's
927# arguments. Must try -L first in case configure is actually a
928# symlink; some systems play weird games with the mod time of symlinks
929# (eg FreeBSD returns the mod time of the symlink's containing
930# directory).
931if (
932 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
933 if test "" = "X"; then
934 # -L didn't work.
935 set X `ls -t $srcdir/configure conftestfile`
936 fi
937 test "$2" = conftestfile
938 )
939then
940 # Ok.
941 :
942else
943 { echo "configure: error: newly created file is older than distributed files!
944Check your system clock" 1>&2; exit 1; }
945fi
946rm -f conftest*
947echo "$ac_t""yes" 1>&6
948if test "$program_transform_name" = s,x,x,; then
949 program_transform_name=
950else
951 # Double any \ or $. echo might interpret backslashes.
952 cat <<\EOF_SED > conftestsed
953s,\\,\\\\,g; s,\$,$$,g
954EOF_SED
955 program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
956 rm -f conftestsed
957fi
958test "$program_prefix" != NONE &&
959 program_transform_name="s,^,${program_prefix},; $program_transform_name"
960# Use a double $ so make ignores it.
961test "$program_suffix" != NONE &&
962 program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
963
964# sed with no file args requires a program.
965test "$program_transform_name" = "" && program_transform_name="s,x,x,"
966
967missing_dir=`cd $ac_aux_dir && pwd`
968echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
9a837903 969echo "configure:970: checking for working aclocal" >&5
c0734708
ILT
970# Run test in a subshell; some versions of sh will print an error if
971# an executable is not found, even if stderr is redirected.
972# Redirect stdin to placate older versions of autoconf. Sigh.
973if (aclocal --version) < /dev/null > /dev/null 2>&1; then
974 ACLOCAL=aclocal
975 echo "$ac_t""found" 1>&6
976else
977 ACLOCAL="$missing_dir/missing aclocal"
978 echo "$ac_t""missing" 1>&6
979fi
980
981echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
9a837903 982echo "configure:983: checking for working autoconf" >&5
c0734708
ILT
983# Run test in a subshell; some versions of sh will print an error if
984# an executable is not found, even if stderr is redirected.
985# Redirect stdin to placate older versions of autoconf. Sigh.
986if (autoconf --version) < /dev/null > /dev/null 2>&1; then
987 AUTOCONF=autoconf
988 echo "$ac_t""found" 1>&6
989else
990 AUTOCONF="$missing_dir/missing autoconf"
991 echo "$ac_t""missing" 1>&6
992fi
993
994echo $ac_n "checking for working automake""... $ac_c" 1>&6
9a837903 995echo "configure:996: checking for working automake" >&5
c0734708
ILT
996# Run test in a subshell; some versions of sh will print an error if
997# an executable is not found, even if stderr is redirected.
998# Redirect stdin to placate older versions of autoconf. Sigh.
999if (automake --version) < /dev/null > /dev/null 2>&1; then
1000 AUTOMAKE=automake
1001 echo "$ac_t""found" 1>&6
1002else
1003 AUTOMAKE="$missing_dir/missing automake"
1004 echo "$ac_t""missing" 1>&6
1005fi
1006
1007echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
9a837903 1008echo "configure:1009: checking for working autoheader" >&5
c0734708
ILT
1009# Run test in a subshell; some versions of sh will print an error if
1010# an executable is not found, even if stderr is redirected.
1011# Redirect stdin to placate older versions of autoconf. Sigh.
1012if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1013 AUTOHEADER=autoheader
1014 echo "$ac_t""found" 1>&6
1015else
1016 AUTOHEADER="$missing_dir/missing autoheader"
1017 echo "$ac_t""missing" 1>&6
1018fi
1019
1020echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
9a837903 1021echo "configure:1022: checking for working makeinfo" >&5
c0734708
ILT
1022# Run test in a subshell; some versions of sh will print an error if
1023# an executable is not found, even if stderr is redirected.
1024# Redirect stdin to placate older versions of autoconf. Sigh.
1025if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1026 MAKEINFO=makeinfo
1027 echo "$ac_t""found" 1>&6
1028else
1029 MAKEINFO="$missing_dir/missing makeinfo"
1030 echo "$ac_t""missing" 1>&6
1031fi
1032
1033echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
9a837903 1034echo "configure:1035: checking whether ${MAKE-make} sets \${MAKE}" >&5
c0734708
ILT
1035set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1036if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1037 echo $ac_n "(cached) $ac_c" 1>&6
1038else
1039 cat > conftestmake <<\EOF
1040all:
1041 @echo 'ac_maketemp="${MAKE}"'
1042EOF
1043# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1044eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1045if test -n "$ac_maketemp"; then
1046 eval ac_cv_prog_make_${ac_make}_set=yes
1047else
1048 eval ac_cv_prog_make_${ac_make}_set=no
1049fi
1050rm -f conftestmake
1051fi
1052if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1053 echo "$ac_t""yes" 1>&6
1054 SET_MAKE=
1055else
1056 echo "$ac_t""no" 1>&6
1057 SET_MAKE="MAKE=${MAKE-make}"
1058fi
1059
1060
7810074c
ILT
1061if test $host != $build; then
1062 ac_tool_prefix=${host_alias}-
1063else
1064 ac_tool_prefix=
1065fi
1066
1067# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
1068set dummy ${ac_tool_prefix}ar; ac_word=$2
1069echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
9a837903 1070echo "configure:1071: checking for $ac_word" >&5
7810074c
ILT
1071if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
1072 echo $ac_n "(cached) $ac_c" 1>&6
1073else
1074 if test -n "$AR"; then
1075 ac_cv_prog_AR="$AR" # Let the user override the test.
1076else
1077 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1078 for ac_dir in $PATH; do
1079 test -z "$ac_dir" && ac_dir=.
1080 if test -f $ac_dir/$ac_word; then
1081 ac_cv_prog_AR="${ac_tool_prefix}ar"
1082 break
1083 fi
1084 done
1085 IFS="$ac_save_ifs"
1086 test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
1087fi
1088fi
1089AR="$ac_cv_prog_AR"
1090if test -n "$AR"; then
1091 echo "$ac_t""$AR" 1>&6
1092else
1093 echo "$ac_t""no" 1>&6
1094fi
1095
1096
1097
1098# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
1099set dummy ${ac_tool_prefix}ranlib; ac_word=$2
1100echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
9a837903 1101echo "configure:1102: checking for $ac_word" >&5
7810074c
ILT
1102if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1103 echo $ac_n "(cached) $ac_c" 1>&6
1104else
1105 if test -n "$RANLIB"; then
1106 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1107else
1108 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1109 for ac_dir in $PATH; do
1110 test -z "$ac_dir" && ac_dir=.
1111 if test -f $ac_dir/$ac_word; then
1112 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
1113 break
1114 fi
1115 done
1116 IFS="$ac_save_ifs"
1117fi
1118fi
1119RANLIB="$ac_cv_prog_RANLIB"
1120if test -n "$RANLIB"; then
1121 echo "$ac_t""$RANLIB" 1>&6
1122else
1123 echo "$ac_t""no" 1>&6
1124fi
1125
1126
1127if test -z "$ac_cv_prog_RANLIB"; then
1128if test -n "$ac_tool_prefix"; then
1129 # Extract the first word of "ranlib", so it can be a program name with args.
1130set dummy ranlib; ac_word=$2
1131echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
9a837903 1132echo "configure:1133: checking for $ac_word" >&5
7810074c
ILT
1133if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1134 echo $ac_n "(cached) $ac_c" 1>&6
1135else
1136 if test -n "$RANLIB"; then
1137 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1138else
1139 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1140 for ac_dir in $PATH; do
1141 test -z "$ac_dir" && ac_dir=.
1142 if test -f $ac_dir/$ac_word; then
1143 ac_cv_prog_RANLIB="ranlib"
1144 break
1145 fi
1146 done
1147 IFS="$ac_save_ifs"
1148 test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1149fi
1150fi
1151RANLIB="$ac_cv_prog_RANLIB"
1152if test -n "$RANLIB"; then
1153 echo "$ac_t""$RANLIB" 1>&6
1154else
1155 echo "$ac_t""no" 1>&6
1156fi
1157
1158else
1159 RANLIB=":"
1160fi
1161fi
1162
1163
9a837903
ILT
1164libtool_enable_shared=no
1165
c0734708
ILT
1166# Extract the first word of "ranlib", so it can be a program name with args.
1167set dummy ranlib; ac_word=$2
1168echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
372b296c 1169echo "configure:1170: checking for $ac_word" >&5
c0734708
ILT
1170if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1171 echo $ac_n "(cached) $ac_c" 1>&6
1172else
1173 if test -n "$RANLIB"; then
1174 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1175else
1176 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1177 for ac_dir in $PATH; do
1178 test -z "$ac_dir" && ac_dir=.
1179 if test -f $ac_dir/$ac_word; then
1180 ac_cv_prog_RANLIB="ranlib"
1181 break
1182 fi
1183 done
1184 IFS="$ac_save_ifs"
1185 test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1186fi
1187fi
1188RANLIB="$ac_cv_prog_RANLIB"
1189if test -n "$RANLIB"; then
1190 echo "$ac_t""$RANLIB" 1>&6
1191else
1192 echo "$ac_t""no" 1>&6
1193fi
1194
1195# Check whether --with-gnu-ld or --without-gnu-ld was given.
1196if test "${with_gnu_ld+set}" = set; then
1197 withval="$with_gnu_ld"
1198 test "$withval" = no || with_gnu_ld=yes
1199else
1200 with_gnu_ld=no
1201fi
1202
9a837903
ILT
1203
1204ac_prog=ld
1205if test "$ac_cv_prog_gcc" = yes; then
1206 # Check if gcc -print-prog-name=ld gives a path.
1207 echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
1208echo "configure:1209: checking for ld used by GCC" >&5
1209 ac_prog=`($CC -print-prog-name=ld) 2>&5`
1210 case "$ac_prog" in
1211 # Accept absolute paths.
1212 /*)
1213 test -z "$LD" && LD="$ac_prog"
1214 ;;
1215 "")
1216 # If it fails, then pretend we aren't using GCC.
1217 ac_prog=ld
1218 ;;
1219 *)
1220 # If it is relative, then search for the first ld in PATH.
1221 with_gnu_ld=unknown
1222 ;;
1223 esac
1224elif test "$with_gnu_ld" = yes; then
c0734708 1225 echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
9a837903 1226echo "configure:1227: checking for GNU ld" >&5
c0734708
ILT
1227else
1228 echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
9a837903 1229echo "configure:1230: checking for non-GNU ld" >&5
c0734708
ILT
1230fi
1231if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
1232 echo $ac_n "(cached) $ac_c" 1>&6
1233else
9a837903 1234 if test -z "$LD"; then
c0734708
ILT
1235 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1236 for ac_dir in $PATH; do
1237 test -z "$ac_dir" && ac_dir=.
9a837903
ILT
1238 if test -f "$ac_dir/$ac_prog"; then
1239 ac_cv_path_LD="$ac_dir/$ac_prog"
c0734708
ILT
1240 # Check to see if the program is GNU ld. I'd rather use --version,
1241 # but apparently some GNU ld's only accept -v.
1242 # Break only if it was the GNU/non-GNU ld that we prefer.
9a837903
ILT
1243 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1244 test "$with_gnu_ld" != no && break
c0734708
ILT
1245 else
1246 test "$with_gnu_ld" != yes && break
1247 fi
1248 fi
1249 done
1250 IFS="$ac_save_ifs"
9a837903 1251else
7810074c 1252 ac_cv_path_LD="$LD" # Let the user override the test with a path.
9a837903 1253fi
c0734708
ILT
1254fi
1255
1256LD="$ac_cv_path_LD"
1257if test -n "$LD"; then
1258 echo "$ac_t""$LD" 1>&6
1259else
1260 echo "$ac_t""no" 1>&6
1261fi
1262test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
1263
9a837903
ILT
1264echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
1265echo "configure:1266: checking if the linker ($LD) is GNU ld" >&5
c0734708
ILT
1266if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
1267 echo $ac_n "(cached) $ac_c" 1>&6
1268else
1269 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
9a837903 1270if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
c0734708
ILT
1271 ac_cv_prog_gnu_ld=yes
1272else
1273 ac_cv_prog_gnu_ld=no
1274fi
1275fi
1276
1277echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
1278
1279
9a837903
ILT
1280echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
1281echo "configure:1282: checking for BSD-compatible nm" >&5
1282if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
1283 echo $ac_n "(cached) $ac_c" 1>&6
1284else
1285 case "$NM" in
1286/*)
1287 ac_cv_path_NM="$NM" # Let the user override the test with a path.
1288 ;;
1289*)
1290 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1291 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
1292 test -z "$ac_dir" && dir=.
1293 if test -f $ac_dir/nm; then
1294 # Check to see if the nm accepts a BSD-compat flag.
1295 # Adding the `sed 1!d' prevents false positives on HP-UX, which says:
1296 # nm: unknown option "B" ignored
1297 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then
1298 ac_cv_path_NM="$ac_dir/nm -B"
1299 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then
1300 ac_cv_path_NM="$ac_dir/nm -p"
1301 else
1302 ac_cv_path_NM="$ac_dir/nm"
1303 fi
1304 break
1305 fi
1306 done
1307 IFS="$ac_save_ifs"
1308 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1309 ;;
1310esac
1311fi
1312
1313NM="$ac_cv_path_NM"
1314echo "$ac_t""$NM" 1>&6
1315
1316
c0734708 1317echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
9a837903 1318echo "configure:1319: checking whether ln -s works" >&5
c0734708
ILT
1319if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
1320 echo $ac_n "(cached) $ac_c" 1>&6
1321else
1322 rm -f conftestdata
1323if ln -s X conftestdata 2>/dev/null
1324then
1325 rm -f conftestdata
1326 ac_cv_prog_LN_S="ln -s"
1327else
1328 ac_cv_prog_LN_S=ln
1329fi
1330fi
1331LN_S="$ac_cv_prog_LN_S"
1332if test "$ac_cv_prog_LN_S" = "ln -s"; then
1333 echo "$ac_t""yes" 1>&6
1334else
1335 echo "$ac_t""no" 1>&6
1336fi
1337
1338
1339
1340
1341
1342
1343
9a837903 1344
c0734708 1345# Always use our own libtool.
36df40e0 1346LIBTOOL='$(SHELL) $(top_builddir)/libtool'
c0734708
ILT
1347
1348
1349# Check whether --enable-shared or --disable-shared was given.
1350if test "${enable_shared+set}" = set; then
1351 enableval="$enable_shared"
36df40e0
DE
1352 p=${PACKAGE-bogus-package-name}
1353 case "$enableval" in
9a837903
ILT
1354 yes) libtool_enable_shared=yes ;;
1355 no) libtool_enable_shared=no ;;
36df40e0
DE
1356 # The value of $p (aka $PACKAGE) is assumed to come from AM_INIT_AUTOMAKE.
1357 # If it didn't, it'll be `bogus-package-name', thus making this condition
1358 # not be used.
9a837903
ILT
1359 *$p*) libtool_enable_shared=yes ;;
1360 *) libtool_enable_shared=no ;;
3607f666 1361esac
c0734708
ILT
1362fi
1363
9a837903 1364test -n "$libtool_enable_shared" && enable_shared="$libtool_enable_shared"
aa13d30d
ILT
1365libtool_shared=
1366test "$enable_shared" = no && libtool_shared=" --disable-shared"
c0734708
ILT
1367
1368# Check whether --enable-static or --disable-static was given.
1369if test "${enable_static+set}" = set; then
1370 enableval="$enable_static"
aa13d30d 1371 if test "$enableval" = no; then
9a837903 1372 libtool_enable_static=no
c0734708 1373else
9a837903 1374 libtool_enable_static=yes
aa13d30d 1375fi
8c693660
KR
1376fi
1377
9a837903 1378test -n "$libtool_enable_static" && enable_static="$libtool_enable_static"
aa13d30d
ILT
1379libtool_static=
1380test "$enable_static" = no && libtool_static=" --disable-static"
8c693660 1381
c0734708
ILT
1382libtool_flags="$libtool_shared$libtool_static"
1383test "$silent" = yes && libtool_flags="$libtool_flags --silent"
1384test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
1385test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
8c693660 1386
c0734708
ILT
1387# Some flags need to be propagated to the compiler or linker for good
1388# libtool support.
1389case "$host" in
7ee4e307
ILT
1390*-*-irix*)
1391 # Find out which ABI we are using.
1392 echo '#line 1393 "configure"' > conftest.$ac_ext
1393 if { (eval echo configure:1394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1394 case "`/usr/bin/file conftest.o`" in
1395 *32-bit*)
1396 LD="${LD-ld} -32"
9a837903 1397 ;;
7ee4e307
ILT
1398 *N32*)
1399 LD="${LD-ld} -n32"
1400 ;;
1401 *64-bit*)
1402 LD="${LD-ld} -64"
9a837903
ILT
1403 ;;
1404 esac
7ee4e307
ILT
1405 fi
1406 rm -rf conftest*
c0734708 1407 ;;
8c693660 1408
c0734708
ILT
1409*-*-sco3.2v5*)
1410 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1411 CFLAGS="$CFLAGS -belf"
1412 ;;
8c693660
KR
1413esac
1414
c0734708
ILT
1415# Actually configure libtool. ac_aux_dir is where install-sh is found.
1416CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
9a837903 1417LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
c0734708
ILT
1418${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
1419$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
1420|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
8c693660 1421
8c693660 1422
c0734708
ILT
1423# Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given.
1424if test "${enable_64_bit_bfd+set}" = set; then
1425 enableval="$enable_64_bit_bfd"
1426 case "${enableval}" in
1427 yes) want64=true ;;
1428 no) want64=false ;;
1429 *) { echo "configure: error: bad value ${enableval} for 64-bit-bfd option" 1>&2; exit 1; } ;;
1430esac
1431else
1432 want64=false
1433fi
1434# Check whether --enable-targets or --disable-targets was given.
1435if test "${enable_targets+set}" = set; then
1436 enableval="$enable_targets"
1437 case "${enableval}" in
1438 yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
1439 ;;
1440 no) enable_targets= ;;
1441 *) enable_targets=$enableval ;;
1442esac
1443fi
1444# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given.
1445if test "${enable_commonbfdlib+set}" = set; then
1446 enableval="$enable_commonbfdlib"
1447 case "${enableval}" in
1448 yes) commonbfdlib=true ;;
1449 no) commonbfdlib=false ;;
1450 *) { echo "configure: error: bad value ${enableval} for BFD commonbfdlib option" 1>&2; exit 1; } ;;
1451esac
1452fi
1453# Check whether --with-mmap or --without-mmap was given.
1454if test "${with_mmap+set}" = set; then
1455 withval="$with_mmap"
1456 case "${withval}" in
1457 yes) want_mmap=true ;;
1458 no) want_mmap=false ;;
1459 *) { echo "configure: error: bad value ${withval} for BFD with-mmap option" 1>&2; exit 1; } ;;
8c693660 1460esac
c0734708
ILT
1461else
1462 want_mmap=false
1463fi
1464
1465
8c693660 1466
8c693660 1467
8c693660
KR
1468
1469if test -z "$target" ; then
1470 { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
1471fi
1472if test "$program_transform_name" = s,x,x,; then
1473 program_transform_name=
1474else
d19df9b5
ILT
1475 # Double any \ or $. echo might interpret backslashes.
1476 cat <<\EOF_SED > conftestsed
1477s,\\,\\\\,g; s,\$,$$,g
1478EOF_SED
8c693660
KR
1479 program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1480 rm -f conftestsed
1481fi
1482test "$program_prefix" != NONE &&
1483 program_transform_name="s,^,${program_prefix},; $program_transform_name"
1484# Use a double $ so make ignores it.
1485test "$program_suffix" != NONE &&
1486 program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
1487
1488# sed with no file args requires a program.
1489test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1490
1491
c0734708 1492echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
7ee4e307 1493echo "configure:1494: checking whether to enable maintainer-specific portions of Makefiles" >&5
c0734708
ILT
1494 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
1495if test "${enable_maintainer_mode+set}" = set; then
1496 enableval="$enable_maintainer_mode"
1497 USE_MAINTAINER_MODE=$enableval
1498else
1499 USE_MAINTAINER_MODE=no
1500fi
8c693660 1501
c0734708
ILT
1502 echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
1503 if test $USE_MAINTAINER_MODE = yes; then
1504 MAINT=
44f795f7 1505 else
c0734708 1506 MAINT='#M#'
44f795f7 1507 fi
c0734708
ILT
1508
1509
1510echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
7ee4e307 1511echo "configure:1512: checking for Cygwin32 environment" >&5
c0734708
ILT
1512if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
1513 echo $ac_n "(cached) $ac_c" 1>&6
1514else
1515 cat > conftest.$ac_ext <<EOF
7ee4e307 1516#line 1517 "configure"
c0734708
ILT
1517#include "confdefs.h"
1518
1519int main() {
3607f666 1520return __CYGWIN32__;
c0734708
ILT
1521; return 0; }
1522EOF
7ee4e307 1523if { (eval echo configure:1524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c0734708
ILT
1524 rm -rf conftest*
1525 am_cv_cygwin32=yes
1526else
1527 echo "configure: failed program was:" >&5
1528 cat conftest.$ac_ext >&5
1529 rm -rf conftest*
1530 am_cv_cygwin32=no
1531fi
1532rm -f conftest*
1533rm -f conftest*
1534fi
1535
1536echo "$ac_t""$am_cv_cygwin32" 1>&6
1537CYGWIN32=
1538test "$am_cv_cygwin32" = yes && CYGWIN32=yes
3607f666 1539echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
7ee4e307 1540echo "configure:1541: checking for Mingw32 environment" >&5
3607f666
BK
1541if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
1542 echo $ac_n "(cached) $ac_c" 1>&6
1543else
1544 cat > conftest.$ac_ext <<EOF
7ee4e307 1545#line 1546 "configure"
3607f666
BK
1546#include "confdefs.h"
1547
1548int main() {
1549return __MINGW32__;
1550; return 0; }
1551EOF
7ee4e307 1552if { (eval echo configure:1553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3607f666
BK
1553 rm -rf conftest*
1554 am_cv_mingw32=yes
1555else
1556 echo "configure: failed program was:" >&5
1557 cat conftest.$ac_ext >&5
1558 rm -rf conftest*
1559 am_cv_mingw32=no
1560fi
1561rm -f conftest*
1562rm -f conftest*
1563fi
1564
1565echo "$ac_t""$am_cv_mingw32" 1>&6
1566MINGW32=
1567test "$am_cv_mingw32" = yes && MINGW32=yes
1568
70e8e585 1569
c0734708 1570echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
7ee4e307 1571echo "configure:1572: checking for executable suffix" >&5
c0734708
ILT
1572if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
1573 echo $ac_n "(cached) $ac_c" 1>&6
1574else
3607f666
BK
1575
1576if test "$CYGWIN32" = yes -o "$MINGW32" = yes; then
c0734708
ILT
1577am_cv_exeext=.exe
1578else
1579cat > am_c_test.c << 'EOF'
1580int main() {
1581/* Nothing needed here */
1582}
1583EOF
1584${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
70e8e585 1585am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
c0734708
ILT
1586rm -f am_c_test*
1587fi
1588
1589test x"${am_cv_exeext}" = x && am_cv_exeext=no
44f795f7 1590fi
c0734708
ILT
1591EXEEXT=""
1592test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
1593echo "$ac_t""${am_cv_exeext}" 1>&6
1594
1595
1596host64=false
1597target64=false
1598
1599# host stuff:
44f795f7 1600
85e493f0
ILT
1601# Extract the first word of "gcc", so it can be a program name with args.
1602set dummy gcc; ac_word=$2
1603echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7ee4e307 1604echo "configure:1605: checking for $ac_word" >&5
85e493f0
ILT
1605if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1606 echo $ac_n "(cached) $ac_c" 1>&6
1607else
1608 if test -n "$CC"; then
1609 ac_cv_prog_CC="$CC" # Let the user override the test.
1610else
1611 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1612 for ac_dir in $PATH; do
1613 test -z "$ac_dir" && ac_dir=.
1614 if test -f $ac_dir/$ac_word; then
1615 ac_cv_prog_CC="gcc"
1616 break
1617 fi
1618 done
1619 IFS="$ac_save_ifs"
85e493f0
ILT
1620fi
1621fi
1622CC="$ac_cv_prog_CC"
1623if test -n "$CC"; then
1624 echo "$ac_t""$CC" 1>&6
1625else
1626 echo "$ac_t""no" 1>&6
1627fi
1628
986cf3b8
ILT
1629if test -z "$CC"; then
1630 # Extract the first word of "cc", so it can be a program name with args.
1631set dummy cc; ac_word=$2
1632echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7ee4e307 1633echo "configure:1634: checking for $ac_word" >&5
986cf3b8
ILT
1634if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1635 echo $ac_n "(cached) $ac_c" 1>&6
1636else
1637 if test -n "$CC"; then
1638 ac_cv_prog_CC="$CC" # Let the user override the test.
1639else
1640 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1641 ac_prog_rejected=no
1642 for ac_dir in $PATH; do
1643 test -z "$ac_dir" && ac_dir=.
1644 if test -f $ac_dir/$ac_word; then
1645 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1646 ac_prog_rejected=yes
1647 continue
1648 fi
1649 ac_cv_prog_CC="cc"
1650 break
1651 fi
1652 done
1653 IFS="$ac_save_ifs"
1654if test $ac_prog_rejected = yes; then
1655 # We found a bogon in the path, so make sure we never use it.
1656 set dummy $ac_cv_prog_CC
1657 shift
1658 if test $# -gt 0; then
1659 # We chose a different compiler from the bogus one.
1660 # However, it has the same basename, so the bogon will be chosen
1661 # first if we set CC to just the basename; use the full file name.
1662 shift
1663 set dummy "$ac_dir/$ac_word" "$@"
1664 shift
1665 ac_cv_prog_CC="$@"
1666 fi
1667fi
1668fi
1669fi
1670CC="$ac_cv_prog_CC"
1671if test -n "$CC"; then
1672 echo "$ac_t""$CC" 1>&6
1673else
1674 echo "$ac_t""no" 1>&6
1675fi
1676
1677 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1678fi
f515fb2f 1679
ac388f2a 1680echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
7ee4e307 1681echo "configure:1682: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac388f2a
ILT
1682
1683ac_ext=c
1684# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1685ac_cpp='$CPP $CPPFLAGS'
1686ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1687ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1688cross_compiling=$ac_cv_prog_cc_cross
1689
1690cat > conftest.$ac_ext <<EOF
7ee4e307 1691#line 1692 "configure"
ac388f2a
ILT
1692#include "confdefs.h"
1693main(){return(0);}
1694EOF
7ee4e307 1695if { (eval echo configure:1696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac388f2a
ILT
1696 ac_cv_prog_cc_works=yes
1697 # If we can't run a trivial program, we are probably using a cross compiler.
1698 if (./conftest; exit) 2>/dev/null; then
1699 ac_cv_prog_cc_cross=no
1700 else
1701 ac_cv_prog_cc_cross=yes
1702 fi
1703else
1704 echo "configure: failed program was:" >&5
1705 cat conftest.$ac_ext >&5
1706 ac_cv_prog_cc_works=no
1707fi
1708rm -fr conftest*
1709
1710echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1711if test $ac_cv_prog_cc_works = no; then
1712 { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1713fi
1714echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
7ee4e307 1715echo "configure:1716: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
ac388f2a
ILT
1716echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1717cross_compiling=$ac_cv_prog_cc_cross
1718
85e493f0 1719echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
7ee4e307 1720echo "configure:1721: checking whether we are using GNU C" >&5
85e493f0
ILT
1721if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1722 echo $ac_n "(cached) $ac_c" 1>&6
1723else
1724 cat > conftest.c <<EOF
f515fb2f
ILT
1725#ifdef __GNUC__
1726 yes;
1727#endif
1728EOF
7ee4e307 1729if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
85e493f0
ILT
1730 ac_cv_prog_gcc=yes
1731else
1732 ac_cv_prog_gcc=no
1733fi
1734fi
1735
1736echo "$ac_t""$ac_cv_prog_gcc" 1>&6
ac388f2a 1737
85e493f0 1738if test $ac_cv_prog_gcc = yes; then
f515fb2f 1739 GCC=yes
ac388f2a
ILT
1740 ac_test_CFLAGS="${CFLAGS+set}"
1741 ac_save_CFLAGS="$CFLAGS"
1742 CFLAGS=
1743 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
7ee4e307 1744echo "configure:1745: checking whether ${CC-cc} accepts -g" >&5
ac388f2a 1745if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
85e493f0
ILT
1746 echo $ac_n "(cached) $ac_c" 1>&6
1747else
1748 echo 'void f(){}' > conftest.c
1749if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
ac388f2a 1750 ac_cv_prog_cc_g=yes
85e493f0 1751else
ac388f2a 1752 ac_cv_prog_cc_g=no
85e493f0
ILT
1753fi
1754rm -f conftest*
1755
1756fi
1757
ac388f2a
ILT
1758echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1759 if test "$ac_test_CFLAGS" = set; then
1760 CFLAGS="$ac_save_CFLAGS"
1761 elif test $ac_cv_prog_cc_g = yes; then
1762 CFLAGS="-g -O2"
1763 else
1764 CFLAGS="-O2"
f515fb2f
ILT
1765 fi
1766else
1767 GCC=
1768 test "${CFLAGS+set}" = set || CFLAGS="-g"
1769fi
f515fb2f
ILT
1770
1771
55626bf0
ILT
1772# Permit host specific settings.
1773. ${srcdir}/configure.host
1774
f515fb2f 1775
8c693660 1776
5e377ed2 1777test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
8c693660
KR
1778
1779
f4e14cb9
ILT
1780BFD_HOST_64BIT_LONG=0
1781BFD_HOST_64_BIT_DEFINED=0
1782BFD_HOST_64_BIT=
1783BFD_HOST_U_64_BIT=
b7577823 1784if test "x${HOST_64BIT_TYPE}" = "xlong"; then
f4e14cb9
ILT
1785 BFD_HOST_64BIT_LONG=1
1786elif test "x${HOST_64BIT_TYPE}" != "x"; then
1787 BFD_HOST_64_BIT_DEFINED=1
1788 BFD_HOST_64_BIT=${HOST_64BIT_TYPE}
1789 BFD_HOST_U_64_BIT=${HOST_U_64BIT_TYPE}
b7577823
ILT
1790fi
1791
1792
f4e14cb9
ILT
1793
1794
1795
b7577823 1796# Put a plausible default for CC_FOR_BUILD in Makefile.
6a468850
ILT
1797if test -z "$CC_FOR_BUILD"; then
1798 if test "x$cross_compiling" = "xno"; then
1799 CC_FOR_BUILD='$(CC)'
1800 else
1801 CC_FOR_BUILD=gcc
1802 fi
8c693660
KR
1803fi
1804
2c66160c
ILT
1805# Also set EXEEXT_FOR_BUILD.
1806if test "x$cross_compiling" = "xno"; then
1807 EXEEXT_FOR_BUILD='$(EXEEXT)'
1808else
1809 echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
7ee4e307 1810echo "configure:1811: checking for build system executable suffix" >&5
2c66160c
ILT
1811if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then
1812 echo $ac_n "(cached) $ac_c" 1>&6
1813else
1814 cat > ac_c_test.c << 'EOF'
1815int main() {
1816/* Nothing needed here */
1817}
1818EOF
1819 ${CC_FOR_BUILD} -o ac_c_test am_c_test.c 1>&5 2>&5
1820 bfd_cv_build_exeext=`echo ac_c_test.* | grep -v ac_c_test.c | sed -e s/ac_c_test//`
1821 rm -f ac_c_test*
1822 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no
1823fi
1824
1825echo "$ac_t""$bfd_cv_build_exeext" 1>&6
1826 EXEEXT_FOR_BUILD=""
1827 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
1828fi
1829
f515fb2f 1830
b7577823 1831echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
7ee4e307 1832echo "configure:1833: checking how to run the C preprocessor" >&5
b7577823
ILT
1833# On Suns, sometimes $CPP names a directory.
1834if test -n "$CPP" && test -d "$CPP"; then
1835 CPP=
1836fi
1837if test -z "$CPP"; then
1838if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1839 echo $ac_n "(cached) $ac_c" 1>&6
1840else
1841 # This must be in double quotes, not single quotes, because CPP may get
1842 # substituted into the Makefile and "${CC-cc}" will confuse make.
1843 CPP="${CC-cc} -E"
1844 # On the NeXT, cc -E runs the code through the compiler's parser,
1845 # not just through cpp.
1846 cat > conftest.$ac_ext <<EOF
7ee4e307 1847#line 1848 "configure"
b7577823
ILT
1848#include "confdefs.h"
1849#include <assert.h>
1850Syntax Error
1851EOF
986cf3b8 1852ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7ee4e307 1853{ (eval echo configure:1854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
b7577823
ILT
1854ac_err=`grep -v '^ *+' conftest.out`
1855if test -z "$ac_err"; then
1856 :
1857else
1858 echo "$ac_err" >&5
ac388f2a
ILT
1859 echo "configure: failed program was:" >&5
1860 cat conftest.$ac_ext >&5
b7577823
ILT
1861 rm -rf conftest*
1862 CPP="${CC-cc} -E -traditional-cpp"
1863 cat > conftest.$ac_ext <<EOF
7ee4e307 1864#line 1865 "configure"
b7577823
ILT
1865#include "confdefs.h"
1866#include <assert.h>
1867Syntax Error
1868EOF
986cf3b8 1869ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7ee4e307 1870{ (eval echo configure:1871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
b7577823
ILT
1871ac_err=`grep -v '^ *+' conftest.out`
1872if test -z "$ac_err"; then
1873 :
1874else
1875 echo "$ac_err" >&5
ac388f2a
ILT
1876 echo "configure: failed program was:" >&5
1877 cat conftest.$ac_ext >&5
b7577823
ILT
1878 rm -rf conftest*
1879 CPP=/lib/cpp
1880fi
1881rm -f conftest*
1882fi
1883rm -f conftest*
1884 ac_cv_prog_CPP="$CPP"
1885fi
1886 CPP="$ac_cv_prog_CPP"
1887else
1888 ac_cv_prog_CPP="$CPP"
1889fi
1890echo "$ac_t""$CPP" 1>&6
1891
1892for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h
1893do
ac388f2a 1894ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
b7577823 1895echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7ee4e307 1896echo "configure:1897: checking for $ac_hdr" >&5
b7577823
ILT
1897if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1898 echo $ac_n "(cached) $ac_c" 1>&6
1899else
1900 cat > conftest.$ac_ext <<EOF
7ee4e307 1901#line 1902 "configure"
b7577823
ILT
1902#include "confdefs.h"
1903#include <$ac_hdr>
1904EOF
986cf3b8 1905ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7ee4e307 1906{ (eval echo configure:1907: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
b7577823
ILT
1907ac_err=`grep -v '^ *+' conftest.out`
1908if test -z "$ac_err"; then
1909 rm -rf conftest*
1910 eval "ac_cv_header_$ac_safe=yes"
1911else
1912 echo "$ac_err" >&5
ac388f2a
ILT
1913 echo "configure: failed program was:" >&5
1914 cat conftest.$ac_ext >&5
b7577823
ILT
1915 rm -rf conftest*
1916 eval "ac_cv_header_$ac_safe=no"
1917fi
1918rm -f conftest*
1919fi
1920if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1921 echo "$ac_t""yes" 1>&6
ac388f2a 1922 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
b7577823
ILT
1923 cat >> confdefs.h <<EOF
1924#define $ac_tr_hdr 1
1925EOF
1926
1927else
1928 echo "$ac_t""no" 1>&6
1929fi
1930done
1931
ab1aa5cd 1932for ac_hdr in fcntl.h sys/file.h sys/time.h
b7577823 1933do
ac388f2a 1934ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
b7577823 1935echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7ee4e307 1936echo "configure:1937: checking for $ac_hdr" >&5
b7577823
ILT
1937if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1938 echo $ac_n "(cached) $ac_c" 1>&6
1939else
1940 cat > conftest.$ac_ext <<EOF
7ee4e307 1941#line 1942 "configure"
b7577823
ILT
1942#include "confdefs.h"
1943#include <$ac_hdr>
1944EOF
986cf3b8 1945ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7ee4e307 1946{ (eval echo configure:1947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
b7577823
ILT
1947ac_err=`grep -v '^ *+' conftest.out`
1948if test -z "$ac_err"; then
1949 rm -rf conftest*
1950 eval "ac_cv_header_$ac_safe=yes"
1951else
1952 echo "$ac_err" >&5
ac388f2a
ILT
1953 echo "configure: failed program was:" >&5
1954 cat conftest.$ac_ext >&5
b7577823
ILT
1955 rm -rf conftest*
1956 eval "ac_cv_header_$ac_safe=no"
1957fi
1958rm -f conftest*
1959fi
1960if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1961 echo "$ac_t""yes" 1>&6
ac388f2a 1962 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
b7577823
ILT
1963 cat >> confdefs.h <<EOF
1964#define $ac_tr_hdr 1
1965EOF
1966
1967else
1968 echo "$ac_t""no" 1>&6
1969fi
1970done
1971
ab1aa5cd 1972echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
7ee4e307 1973echo "configure:1974: checking whether time.h and sys/time.h may both be included" >&5
ab1aa5cd
FF
1974if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1975 echo $ac_n "(cached) $ac_c" 1>&6
1976else
1977 cat > conftest.$ac_ext <<EOF
7ee4e307 1978#line 1979 "configure"
ab1aa5cd
FF
1979#include "confdefs.h"
1980#include <sys/types.h>
1981#include <sys/time.h>
1982#include <time.h>
ac388f2a 1983int main() {
ab1aa5cd
FF
1984struct tm *tp;
1985; return 0; }
1986EOF
7ee4e307 1987if { (eval echo configure:1988: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ab1aa5cd
FF
1988 rm -rf conftest*
1989 ac_cv_header_time=yes
1990else
ac388f2a
ILT
1991 echo "configure: failed program was:" >&5
1992 cat conftest.$ac_ext >&5
ab1aa5cd
FF
1993 rm -rf conftest*
1994 ac_cv_header_time=no
1995fi
1996rm -f conftest*
ab1aa5cd
FF
1997fi
1998
1999echo "$ac_t""$ac_cv_header_time" 1>&6
2000if test $ac_cv_header_time = yes; then
2001 cat >> confdefs.h <<\EOF
2002#define TIME_WITH_SYS_TIME 1
2003EOF
2004
2005fi
2006
60f1ad85 2007for ac_func in fcntl getpagesize setitimer sysconf fdopen
b7577823
ILT
2008do
2009echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7ee4e307 2010echo "configure:2011: checking for $ac_func" >&5
b7577823
ILT
2011if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2012 echo $ac_n "(cached) $ac_c" 1>&6
2013else
2014 cat > conftest.$ac_ext <<EOF
7ee4e307 2015#line 2016 "configure"
b7577823
ILT
2016#include "confdefs.h"
2017/* System header to define __stub macros and hopefully few prototypes,
2018 which can conflict with char $ac_func(); below. */
2019#include <assert.h>
2020/* Override any gcc2 internal prototype to avoid an error. */
a4322a77
ILT
2021/* We use char because int might match the return type of a gcc2
2022 builtin and then its argument prototype would still apply. */
85e493f0 2023char $ac_func();
b7577823 2024
ac388f2a 2025int main() {
b7577823
ILT
2026
2027/* The GNU C library defines this for functions which it implements
2028 to always fail with ENOSYS. Some functions are actually named
2029 something starting with __ and the normal name is an alias. */
2030#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2031choke me
2032#else
2033$ac_func();
2034#endif
2035
2036; return 0; }
2037EOF
7ee4e307 2038if { (eval echo configure:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
b7577823
ILT
2039 rm -rf conftest*
2040 eval "ac_cv_func_$ac_func=yes"
2041else
ac388f2a
ILT
2042 echo "configure: failed program was:" >&5
2043 cat conftest.$ac_ext >&5
b7577823
ILT
2044 rm -rf conftest*
2045 eval "ac_cv_func_$ac_func=no"
2046fi
2047rm -f conftest*
fd8d7c31 2048fi
ac388f2a 2049
b7577823
ILT
2050if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2051 echo "$ac_t""yes" 1>&6
85e493f0 2052 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
b7577823
ILT
2053 cat >> confdefs.h <<EOF
2054#define $ac_tr_func 1
2055EOF
2056
2057else
2058 echo "$ac_t""no" 1>&6
2059fi
2060done
2061
2062
85e493f0 2063
b7577823 2064case "${host}" in
847b9629 2065i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-mingw32* | *-*-cygwin32* | *-*-windows)
b7577823
ILT
2066 cat >> confdefs.h <<\EOF
2067#define USE_BINARY_FOPEN 1
2068EOF
2069 ;;
2070esac
2071
f7954d86 2072echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
7ee4e307 2073echo "configure:2074: checking whether strstr must be declared" >&5
f7954d86
MM
2074if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
2075 echo $ac_n "(cached) $ac_c" 1>&6
2076else
2077 cat > conftest.$ac_ext <<EOF
7ee4e307 2078#line 2079 "configure"
f7954d86
MM
2079#include "confdefs.h"
2080
2081#include <stdio.h>
2082#ifdef HAVE_STRING_H
2083#include <string.h>
2084#else
2085#ifdef HAVE_STRINGS_H
2086#include <strings.h>
2087#endif
2088#endif
2089#ifdef HAVE_STDLIB_H
2090#include <stdlib.h>
2091#endif
2092#ifdef HAVE_UNISTD_H
2093#include <unistd.h>
2094#endif
ac388f2a 2095int main() {
f7954d86
MM
2096char *(*pfn) = (char *(*)) strstr
2097; return 0; }
2098EOF
7ee4e307 2099if { (eval echo configure:2100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f7954d86
MM
2100 rm -rf conftest*
2101 bfd_cv_decl_needed_strstr=no
2102else
ac388f2a
ILT
2103 echo "configure: failed program was:" >&5
2104 cat conftest.$ac_ext >&5
f7954d86
MM
2105 rm -rf conftest*
2106 bfd_cv_decl_needed_strstr=yes
2107fi
2108rm -f conftest*
f7954d86
MM
2109fi
2110
2111echo "$ac_t""$bfd_cv_decl_needed_strstr" 1>&6
2112if test $bfd_cv_decl_needed_strstr = yes; then
2113 bfd_tr_decl=NEED_DECLARATION_`echo strstr | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2114 cat >> confdefs.h <<EOF
2115#define $bfd_tr_decl 1
2116EOF
2117
2118fi
2119
b7577823 2120echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
7ee4e307 2121echo "configure:2122: checking whether malloc must be declared" >&5
b7577823
ILT
2122if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
2123 echo $ac_n "(cached) $ac_c" 1>&6
2124else
2125 cat > conftest.$ac_ext <<EOF
7ee4e307 2126#line 2127 "configure"
b7577823
ILT
2127#include "confdefs.h"
2128
2129#include <stdio.h>
f7954d86
MM
2130#ifdef HAVE_STRING_H
2131#include <string.h>
2132#else
2133#ifdef HAVE_STRINGS_H
2134#include <strings.h>
2135#endif
2136#endif
b7577823
ILT
2137#ifdef HAVE_STDLIB_H
2138#include <stdlib.h>
2139#endif
2140#ifdef HAVE_UNISTD_H
2141#include <unistd.h>
2142#endif
ac388f2a 2143int main() {
b7577823
ILT
2144char *(*pfn) = (char *(*)) malloc
2145; return 0; }
2146EOF
7ee4e307 2147if { (eval echo configure:2148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
b7577823
ILT
2148 rm -rf conftest*
2149 bfd_cv_decl_needed_malloc=no
2150else
ac388f2a
ILT
2151 echo "configure: failed program was:" >&5
2152 cat conftest.$ac_ext >&5
b7577823
ILT
2153 rm -rf conftest*
2154 bfd_cv_decl_needed_malloc=yes
2155fi
2156rm -f conftest*
b7577823
ILT
2157fi
2158
2159echo "$ac_t""$bfd_cv_decl_needed_malloc" 1>&6
2160if test $bfd_cv_decl_needed_malloc = yes; then
85e493f0
ILT
2161 bfd_tr_decl=NEED_DECLARATION_`echo malloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2162 cat >> confdefs.h <<EOF
2163#define $bfd_tr_decl 1
b7577823 2164EOF
f515fb2f 2165
2b79a104
ILT
2166fi
2167
f7954d86 2168echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
7ee4e307 2169echo "configure:2170: checking whether realloc must be declared" >&5
f7954d86
MM
2170if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
2171 echo $ac_n "(cached) $ac_c" 1>&6
2172else
2173 cat > conftest.$ac_ext <<EOF
7ee4e307 2174#line 2175 "configure"
f7954d86
MM
2175#include "confdefs.h"
2176
2177#include <stdio.h>
2178#ifdef HAVE_STRING_H
2179#include <string.h>
2180#else
2181#ifdef HAVE_STRINGS_H
2182#include <strings.h>
2183#endif
2184#endif
2185#ifdef HAVE_STDLIB_H
2186#include <stdlib.h>
2187#endif
2188#ifdef HAVE_UNISTD_H
2189#include <unistd.h>
2190#endif
ac388f2a 2191int main() {
f7954d86
MM
2192char *(*pfn) = (char *(*)) realloc
2193; return 0; }
2194EOF
7ee4e307 2195if { (eval echo configure:2196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f7954d86
MM
2196 rm -rf conftest*
2197 bfd_cv_decl_needed_realloc=no
2198else
ac388f2a
ILT
2199 echo "configure: failed program was:" >&5
2200 cat conftest.$ac_ext >&5
f7954d86
MM
2201 rm -rf conftest*
2202 bfd_cv_decl_needed_realloc=yes
2203fi
2204rm -f conftest*
f7954d86
MM
2205fi
2206
2207echo "$ac_t""$bfd_cv_decl_needed_realloc" 1>&6
2208if test $bfd_cv_decl_needed_realloc = yes; then
2209 bfd_tr_decl=NEED_DECLARATION_`echo realloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2210 cat >> confdefs.h <<EOF
2211#define $bfd_tr_decl 1
2212EOF
2213
2214fi
2215
b7577823 2216echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
7ee4e307 2217echo "configure:2218: checking whether free must be declared" >&5
b7577823
ILT
2218if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
2219 echo $ac_n "(cached) $ac_c" 1>&6
2220else
2221 cat > conftest.$ac_ext <<EOF
7ee4e307 2222#line 2223 "configure"
b7577823 2223#include "confdefs.h"
8c693660 2224
b7577823 2225#include <stdio.h>
f7954d86
MM
2226#ifdef HAVE_STRING_H
2227#include <string.h>
2228#else
2229#ifdef HAVE_STRINGS_H
2230#include <strings.h>
2231#endif
2232#endif
b7577823
ILT
2233#ifdef HAVE_STDLIB_H
2234#include <stdlib.h>
2235#endif
2236#ifdef HAVE_UNISTD_H
2237#include <unistd.h>
2238#endif
ac388f2a 2239int main() {
85e493f0 2240char *(*pfn) = (char *(*)) free
b7577823
ILT
2241; return 0; }
2242EOF
7ee4e307 2243if { (eval echo configure:2244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
b7577823
ILT
2244 rm -rf conftest*
2245 bfd_cv_decl_needed_free=no
2246else
ac388f2a
ILT
2247 echo "configure: failed program was:" >&5
2248 cat conftest.$ac_ext >&5
b7577823
ILT
2249 rm -rf conftest*
2250 bfd_cv_decl_needed_free=yes
2251fi
2252rm -f conftest*
b7577823
ILT
2253fi
2254
2255echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6
2256if test $bfd_cv_decl_needed_free = yes; then
85e493f0
ILT
2257 bfd_tr_decl=NEED_DECLARATION_`echo free | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2258 cat >> confdefs.h <<EOF
2259#define $bfd_tr_decl 1
b7577823
ILT
2260EOF
2261
2262fi
f515fb2f 2263
dee99794 2264echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
7ee4e307 2265echo "configure:2266: checking whether getenv must be declared" >&5
dee99794
ILT
2266if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
2267 echo $ac_n "(cached) $ac_c" 1>&6
2268else
2269 cat > conftest.$ac_ext <<EOF
7ee4e307 2270#line 2271 "configure"
dee99794
ILT
2271#include "confdefs.h"
2272
2273#include <stdio.h>
2274#ifdef HAVE_STRING_H
2275#include <string.h>
2276#else
2277#ifdef HAVE_STRINGS_H
2278#include <strings.h>
2279#endif
2280#endif
2281#ifdef HAVE_STDLIB_H
2282#include <stdlib.h>
2283#endif
2284#ifdef HAVE_UNISTD_H
2285#include <unistd.h>
2286#endif
ac388f2a 2287int main() {
dee99794
ILT
2288char *(*pfn) = (char *(*)) getenv
2289; return 0; }
2290EOF
7ee4e307 2291if { (eval echo configure:2292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
dee99794
ILT
2292 rm -rf conftest*
2293 bfd_cv_decl_needed_getenv=no
2294else
ac388f2a
ILT
2295 echo "configure: failed program was:" >&5
2296 cat conftest.$ac_ext >&5
dee99794
ILT
2297 rm -rf conftest*
2298 bfd_cv_decl_needed_getenv=yes
2299fi
2300rm -f conftest*
dee99794
ILT
2301fi
2302
2303echo "$ac_t""$bfd_cv_decl_needed_getenv" 1>&6
2304if test $bfd_cv_decl_needed_getenv = yes; then
2305 bfd_tr_decl=NEED_DECLARATION_`echo getenv | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2306 cat >> confdefs.h <<EOF
2307#define $bfd_tr_decl 1
2308EOF
2309
2310fi
2311
85e493f0 2312
a52a3ce8
ILT
2313# If we are configured native, pick a core file support file.
2314COREFILE=
2315COREFLAG=
2316if test "${target}" = "${host}"; then
2317 case "${host}" in
5303c574 2318 alpha*-*-linux-gnu*)
c0734708 2319 COREFILE=trad-core.lo
999cc186
ILT
2320 cat >> confdefs.h <<\EOF
2321#define TRAD_HEADER "hosts/alphalinux.h"
2322EOF
2323
2324 ;;
eee4e8ca 2325 alpha*-*-netbsd*) COREFILE=netbsd-core.lo ;;
c0734708
ILT
2326 alpha*-*-*) COREFILE=osf-core.lo ;;
2327 arm-*-riscix) COREFILE=trad-core.lo ;;
2328 hppa*-*-hpux*) COREFILE=hpux-core.lo ;;
2329 hppa*-*-hiux*) COREFILE=hpux-core.lo ;;
2330 hppa*-*-bsd*) COREFILE="hpux-core.lo hppabsd-core.lo"
a52a3ce8 2331 COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
f7954d86 2332 i[3456]86-sequent-bsd*)
c0734708 2333 COREFILE=trad-core.lo;
b7577823
ILT
2334 cat >> confdefs.h <<\EOF
2335#define TRAD_HEADER "hosts/symmetry.h"
2336EOF
2337
2338 ;;
f7954d86
MM
2339 i[3456]86-sequent-sysv4*) ;;
2340 i[3456]86-sequent-sysv*)
c0734708 2341 COREFILE=trad-core.lo
b7577823
ILT
2342 cat >> confdefs.h <<\EOF
2343#define TRAD_HEADER "hosts/symmetry.h"
2344EOF
2345
2346 ;;
f7954d86 2347 i[3456]86-*-bsd* | i[3456]86-*-freebsd*)
c0734708 2348 COREFILE=trad-core.lo
b7577823
ILT
2349 cat >> confdefs.h <<\EOF
2350#define TRAD_HEADER "hosts/i386bsd.h"
69a374c0
NH
2351EOF
2352
2353 ;;
3b1b0308 2354 i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
c0734708 2355 COREFILE=netbsd-core.lo
b7577823 2356 ;;
f7954d86 2357 i[3456]86-esix-sysv3*)
c0734708 2358 COREFILE=trad-core.lo
b7577823
ILT
2359 cat >> confdefs.h <<\EOF
2360#define TRAD_HEADER "hosts/esix.h"
2361EOF
2362
2363 ;;
f7954d86 2364 i[3456]86-*-sco* | i[3456]86-*-isc*)
c0734708 2365 COREFILE=trad-core.lo
b7577823
ILT
2366 cat >> confdefs.h <<\EOF
2367#define TRAD_HEADER "hosts/i386sco.h"
2368EOF
2369
2370 ;;
f7954d86 2371 i[3456]86-*-mach3*)
c0734708 2372 COREFILE=trad-core.lo
b7577823
ILT
2373 cat >> confdefs.h <<\EOF
2374#define TRAD_HEADER "hosts/i386mach3.h"
2375EOF
2376
2377 ;;
5303c574 2378 i[3456]86-*-linux-gnu*)
c0734708 2379 COREFILE=trad-core.lo
b7577823
ILT
2380 cat >> confdefs.h <<\EOF
2381#define TRAD_HEADER "hosts/i386linux.h"
2382EOF
2383
2384 ;;
c0734708
ILT
2385 i[3456]86-*-isc*) COREFILE=trad-core.lo ;;
2386 i[3456]86-*-aix*) COREFILE=aix386-core.lo ;;
cf587de8 2387 i860-*-mach3* | i860-*-osf1*)
c0734708 2388 COREFILE=trad-core.lo
cf587de8
ILT
2389 cat >> confdefs.h <<\EOF
2390#define TRAD_HEADER "hosts/i860mach3.h"
2391EOF
2392
2393 ;;
b7577823 2394 mips-dec-bsd*)
c0734708 2395 COREFILE=trad-core.lo
b7577823
ILT
2396 cat >> confdefs.h <<\EOF
2397#define TRAD_HEADER "hosts/mipsbsd.h"
2398EOF
2399
2400 ;;
2401 mips-dec-mach3*)
c0734708 2402 COREFILE=trad-core.lo
b7577823
ILT
2403 cat >> confdefs.h <<\EOF
2404#define TRAD_HEADER "hosts/mipsmach3.h"
2405EOF
2406
2407 ;;
3b1b0308 2408 mips-*-netbsd* | mips*-*-openbsd*)
c0734708 2409 COREFILE=netbsd-core.lo
69a374c0 2410 ;;
b7577823 2411 mips-dec-*)
c0734708 2412 COREFILE=trad-core.lo
b7577823
ILT
2413 cat >> confdefs.h <<\EOF
2414#define TRAD_HEADER "hosts/decstation.h"
2415EOF
2416
2417 ;;
c0734708
ILT
2418 mips-sgi-irix4*) COREFILE=irix-core.lo ;;
2419 mips-sgi-irix5*) COREFILE=irix-core.lo ;;
2420 mips-sgi-irix6*) COREFILE=irix-core.lo ;;
b7577823 2421 mips-*-mach3*)
c0734708 2422 COREFILE=trad-core.lo
b7577823
ILT
2423 cat >> confdefs.h <<\EOF
2424#define TRAD_HEADER "hosts/mipsmach3.h"
2425EOF
2426
2427 ;;
a52a3ce8 2428 mips-*-sysv4*) ;;
b7577823 2429 mips-*-sysv* | mips-*-riscos*)
c0734708 2430 COREFILE=trad-core.lo
b7577823
ILT
2431 cat >> confdefs.h <<\EOF
2432#define TRAD_HEADER "hosts/riscos.h"
2433EOF
2434
2435 ;;
2436 mips-sony-bsd*)
c0734708 2437 COREFILE=trad-core.lo
b7577823 2438 cat >> confdefs.h <<\EOF
ab1aa5cd 2439#define TRAD_HEADER "hosts/news-mips.h"
b7577823
ILT
2440EOF
2441
2442 ;;
2443 m68*-bull*-sysv*)
c0734708 2444 COREFILE=trad-core.lo
b7577823
ILT
2445 cat >> confdefs.h <<\EOF
2446#define TRAD_HEADER "hosts/dpx2.h"
2447EOF
2448
2449 ;;
c0734708 2450 m68*-hp-hpux*) COREFILE=hpux-core.lo ;;
b7577823 2451 m68*-hp-bsd*)
c0734708 2452 COREFILE=trad-core.lo
b7577823
ILT
2453 cat >> confdefs.h <<\EOF
2454#define TRAD_HEADER "hosts/hp300bsd.h"
55626bf0
ILT
2455EOF
2456
2457 ;;
5303c574 2458 m68*-*-linux-gnu*)
c0734708 2459 COREFILE=trad-core.lo
55626bf0
ILT
2460 cat >> confdefs.h <<\EOF
2461#define TRAD_HEADER "hosts/m68klinux.h"
7f82c7e1
ILT
2462EOF
2463
2464 ;;
4c8b9746 2465 m68*-motorola-sysv*)
c0734708 2466 COREFILE=trad-core.lo
7f82c7e1
ILT
2467 cat >> confdefs.h <<\EOF
2468#define TRAD_HEADER "hosts/delta68.h"
b7577823
ILT
2469EOF
2470
2471 ;;
b7577823 2472 m68*-sony-*)
c0734708 2473 COREFILE=trad-core.lo
b7577823
ILT
2474 cat >> confdefs.h <<\EOF
2475#define TRAD_HEADER "hosts/news.h"
69a374c0
NH
2476EOF
2477
2478 ;;
3b1b0308 2479 m68*-*-netbsd* | m68*-*-openbsd*)
c0734708 2480 COREFILE=netbsd-core.lo
d19df9b5
ILT
2481 ;;
2482 m68*-apple-aux*)
c0734708 2483 COREFILE=trad-core.lo
d19df9b5
ILT
2484 cat >> confdefs.h <<\EOF
2485#define TRAD_HEADER "hosts/m68kaux.h"
b7577823
ILT
2486EOF
2487
2488 ;;
a52a3ce8 2489 m88*-*-sysv4*) ;;
c0734708 2490 m88*-motorola-sysv*) COREFILE=ptrace-core.lo ;;
b7577823 2491 m88*-*-mach3*)
c0734708 2492 COREFILE=trad-core.lo
b7577823
ILT
2493 cat >> confdefs.h <<\EOF
2494#define TRAD_HEADER "hosts/m88kmach3.h"
2495EOF
2496
2497 ;;
2498 ns32k-pc532-mach)
c0734708 2499 COREFILE=trad-core.lo
b7577823
ILT
2500 cat >> confdefs.h <<\EOF
2501#define TRAD_HEADER "hosts/pc532mach.h"
69a374c0
NH
2502EOF
2503
2504 ;;
3b1b0308 2505 ns32k-*-netbsd* | ns32k-*-openbsd*)
c0734708 2506 COREFILE=netbsd-core.lo
b7577823 2507 ;;
c0734708
ILT
2508 rs6000-*-lynx*) COREFILE=lynx-core.lo ;;
2509 rs6000-*-aix4*) COREFILE=rs6000-core.lo ;;
2510 rs6000-*-*) COREFILE=rs6000-core.lo ;;
2511 powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;;
2512 powerpc-*-aix4*) COREFILE=rs6000-core.lo ;;
2513 powerpc-*-aix*) COREFILE=rs6000-core.lo ;;
ac388f2a 2514 powerpc-*-beos*) ;;
eee4e8ca 2515 powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;;
3b1b0308 2516 sparc-*-netbsd* | sparc-*-openbsd*)
c0734708 2517 COREFILE=netbsd-core.lo
5e0c6aad 2518 ;;
5303c574 2519 sparc*-*-linux-gnu*)
5e0c6aad
RH
2520 COREFILE=trad-core.lo
2521 cat >> confdefs.h <<\EOF
2522#define TRAD_HEADER "hosts/sparclinux.h"
2523EOF
2524
69a374c0 2525 ;;
b7577823 2526 tahoe-*-*)
c0734708 2527 COREFILE=trad-core.lo
b7577823
ILT
2528 cat >> confdefs.h <<\EOF
2529#define TRAD_HEADER "hosts/tahoe.h"
2530EOF
2531
2532 ;;
2533 vax-*-ultrix2*)
c0734708 2534 COREFILE=trad-core.lo
b7577823
ILT
2535 cat >> confdefs.h <<\EOF
2536#define TRAD_HEADER "hosts/vaxult2.h"
2537EOF
2538
2539 ;;
2540 vax-*-ultrix*)
c0734708 2541 COREFILE=trad-core.lo
b7577823
ILT
2542 cat >> confdefs.h <<\EOF
2543#define TRAD_HEADER "hosts/vaxult2.h"
2544EOF
2545
2546 ;;
2547 vax-*-*)
c0734708 2548 COREFILE=trad-core.lo
b7577823
ILT
2549 cat >> confdefs.h <<\EOF
2550#define TRAD_HEADER "hosts/vaxbsd.h"
2551EOF
2552
2553 ;;
a52a3ce8
ILT
2554 esac
2555
2556 case "$COREFILE" in
c0734708
ILT
2557 aix386-core.lo) COREFLAG=-DAIX386_CORE ;;
2558 hppabsd-core.lo) COREFLAG=-DHPPABSD_CORE ;;
2559 hpux-core.lo) COREFLAG=-DHPUX_CORE ;;
2560 irix-core.lo) COREFLAG=-DIRIX_CORE ;;
2561 lynx-core.lo) COREFLAG=-DLYNX_CORE ;;
eee4e8ca 2562 netbsd-core.lo) COREFLAG=-DNETBSD_CORE ;;
c0734708
ILT
2563 osf-core.lo) COREFLAG=-DOSF_CORE ;;
2564 ptrace-core.lo) COREFLAG=-DPTRACE_CORE ;;
2565 rs6000-core.lo) COREFLAG="$COREFLAG -DAIX_CORE" ;;
2566 trad-core.lo) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
a52a3ce8 2567 esac
1dff7902
ILT
2568
2569 # The ELF code uses the native <sys/procfs.h> to handle core files.
2570 # Define HAVE_SYS_PROCFS_H if the file exists and defines
2571 # prstatus_t.
2572 echo $ac_n "checking for sys/procfs.h""... $ac_c" 1>&6
eee4e8ca 2573echo "configure:2574: checking for sys/procfs.h" >&5
1dff7902
ILT
2574 if eval "test \"`echo '$''{'bfd_cv_header_sys_procfs_h'+set}'`\" = set"; then
2575 echo $ac_n "(cached) $ac_c" 1>&6
2576else
2577 cat > conftest.$ac_ext <<EOF
eee4e8ca 2578#line 2579 "configure"
1dff7902
ILT
2579#include "confdefs.h"
2580#include <sys/procfs.h>
ac388f2a 2581int main() {
1dff7902
ILT
2582prstatus_t t;
2583; return 0; }
2584EOF
eee4e8ca 2585if { (eval echo configure:2586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1dff7902
ILT
2586 rm -rf conftest*
2587 bfd_cv_header_sys_procfs_h=yes
2588else
ac388f2a
ILT
2589 echo "configure: failed program was:" >&5
2590 cat conftest.$ac_ext >&5
1dff7902
ILT
2591 rm -rf conftest*
2592 bfd_cv_header_sys_procfs_h=no
2593fi
2594rm -f conftest*
1dff7902
ILT
2595fi
2596
2597 echo "$ac_t""$bfd_cv_header_sys_procfs_h" 1>&6
2598 if test $bfd_cv_header_sys_procfs_h = yes; then
2599 cat >> confdefs.h <<\EOF
2600#define HAVE_SYS_PROCFS_H 1
2601EOF
2602
2603 fi
2604
a52a3ce8
ILT
2605fi
2606
2607
2608
8c693660
KR
2609# target stuff:
2610
2611# Canonicalize the secondary target names.
2612if test -n "$enable_targets" ; then
2613 for targ in `echo $enable_targets | sed 's/,/ /g'`
2614 do
60f1ad85 2615 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
8c693660
KR
2616 if test -n "$result" ; then
2617 canon_targets="$canon_targets $result"
2618 else
2619 # Allow targets that config.sub doesn't recognize, like "all".
2620 canon_targets="$canon_targets $targ"
2621 fi
2622 done
2623fi
2624
2625all_targets=false
2b79a104
ILT
2626defvec=
2627selvecs=
2628selarchs=
2629TDEFINES=
8c693660
KR
2630for targ in $target $canon_targets
2631do
2b79a104 2632 if test "x$targ" = "xall"; then
8c693660
KR
2633 all_targets=true
2634 else
2b79a104
ILT
2635 . $srcdir/config.bfd
2636 if test "x$targ" = "x$target"; then
2637 defvec=$targ_defvec
8c693660 2638 fi
2b79a104
ILT
2639 selvecs="$selvecs $targ_defvec $targ_selvecs"
2640 selarchs="$selarchs $targ_archs"
2641 TDEFINES="$TDEFINES $targ_cflags"
8c693660
KR
2642 fi
2643done
2644
8c693660
KR
2645
2646# This processing still needs to be done if we're to decide properly whether
2647# 64-bit support needs to be compiled in. Currently, it will be included if
2648# the default or any other explicitly requested target requires it; it
2649# will not be included on a 32-bit host if no 64-bit target is requested, and
2650# no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
2651# used.
2652
2b79a104 2653# uniq the default and selected vectors in all the configured targets.
8c693660 2654f=""
2b79a104 2655for i in $selvecs ; do
8c693660
KR
2656 case " $f " in
2657 *" $i "*) ;;
2658 *) f="$f $i" ;;
2659 esac
2660done
2b79a104 2661selvecs="$f"
8c693660 2662
36df40e0
DE
2663# start-sanitize-sky
2664# dvp is really mips, but we need to distinguish it from mips for opcodes
2665selarchs=`echo $selarchs | sed -e s/dvp/mips/g`
2666# end-sanitize-sky
2667
2b79a104 2668# uniq the architectures in all the configured targets.
8c693660 2669f=""
2b79a104 2670for i in $selarchs ; do
8c693660
KR
2671 case " $f " in
2672 *" $i "*) ;;
2673 *) f="$f $i" ;;
2674 esac
2675done
2b79a104 2676selarchs="$f"
8c693660
KR
2677
2678# Target backend .o files.
2679tb=
2680
eae43516 2681elf="elflink.lo dwarf2.lo"
a52a3ce8 2682
2b79a104 2683for vec in $selvecs
8c693660
KR
2684do
2685 case "$vec" in
2686 # This list is alphabetized to make it easy to compare
2687 # with the two vector lists in targets.c.
c0734708
ILT
2688 a29kcoff_big_vec) tb="$tb coff-a29k.lo cofflink.lo" ;;
2689 a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
2690 armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
2691 armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
2692 armpe_little_vec) tb="$tb pe-arm.lo cofflink.lo " ;;
2693 armpe_big_vec) tb="$tb pe-arm.lo cofflink.lo " ;;
2694 armpei_little_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
2695 armpei_big_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
2696 aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;;
2697 aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;;
2698 aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;;
2699 aout_mips_big_vec) tb="$tb mipsbsd.lo aout32.lo" ;;
2700 aout_mips_little_vec) tb="$tb mipsbsd.lo aout32.lo" ;;
2701 apollocoff_vec) tb="$tb coff-apollo.lo" ;;
2702 b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;;
2703 b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;;
2704 bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"
50bd50d4 2705 target64=true ;;
c0734708
ILT
2706 bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
2707 bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
c0734708
ILT
2708 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
2709 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
2710 bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
d1bf45aa 2711 target64=true ;;
c0734708 2712 bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
fd8d7c31 2713# start-sanitize-d30v
c0734708 2714 bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
fd8d7c31 2715# end-sanitize-d30v
c0734708
ILT
2716 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
2717 bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;;
2718 bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
2719 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
2720 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
2721 bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
d1bf45aa 2722 target64=true ;;
c0734708
ILT
2723 bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
2724 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
2725 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
2726 bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;;
2727 bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
2728 bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
2729 bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
2730 bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
2731 bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
2732 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
c0734708 2733 bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;;
c0734708 2734 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"
8c693660 2735 target64=true ;;
c0734708 2736 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"
8c693660 2737 target64=true ;;
c0734708 2738 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf"
8c693660 2739 target64=true ;;
c0734708
ILT
2740 cisco_core_vec) tb="$tb cisco-core.lo" ;;
2741 demo_64_vec) tb="$tb demo64.lo aout64.lo"
8c693660 2742 target64=true ;;
c0734708
ILT
2743 ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
2744 ecoff_little_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
2745 ecoff_biglittle_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
2746 ecoffalpha_little_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"
8c693660 2747 target64=true ;;
c0734708 2748 go32coff_vec) tb="$tb coff-go32.lo cofflink.lo" ;;
70e8e585 2749 go32stubbedcoff_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;;
c0734708 2750 evax_alpha_vec) tb="$tb evax-alpha.lo evax-emh.lo evax-egsd.lo evax-etir.lo evax-misc.lo"
50bd50d4 2751 target64=true ;;
c0734708
ILT
2752 h8300coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;;
2753 h8500coff_vec) tb="$tb coff-h8500.lo reloc16.lo" ;;
2754 host_aout_vec) tb="$tb host-aout.lo aout32.lo" ;;
2755 hp300bsd_vec) tb="$tb hp300bsd.lo aout32.lo" ;;
2756 hp300hpux_vec) tb="$tb hp300hpux.lo aout32.lo" ;;
2757 i386aout_vec) tb="$tb i386aout.lo aout32.lo" ;;
2758 i386bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;;
2759 i386coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;;
2760 i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;;
2761 i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;;
2762 i386msdos_vec) tb="$tb i386msdos.lo" ;;
2763 i386pe_vec) tb="$tb pe-i386.lo cofflink.lo " ;;
2764 i386pei_vec) tb="$tb pei-i386.lo cofflink.lo" ;;
2765 i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;;
2766 i386lynx_aout_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
2767 i386lynx_coff_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
2768 i386mach3_vec) tb="$tb i386mach3.lo aout32.lo" ;;
2769 i386netbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;;
2770 i386os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;;
2771 i860coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;;
2772 icoff_big_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
2773 icoff_little_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
2774 ieee_vec) tb="$tb ieee.lo" ;;
2775 m68kcoff_vec) tb="$tb coff-m68k.lo cofflink.lo" ;;
2776 m68kcoffun_vec) tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;;
2777 m68klinux_vec) tb="$tb m68klinux.lo aout32.lo" ;;
2778 m68klynx_aout_vec) tb="$tb m68klynx.lo lynx-core.lo aout32.lo" ;;
2779 m68klynx_coff_vec) tb="$tb cf-m68klynx.lo coff-m68k.lo cofflink.lo lynx-core.lo" ;;
2780 m68knetbsd_vec) tb="$tb m68knetbsd.lo aout32.lo" ;;
2781 m68k4knetbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;;
2782 m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
2783 m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;;
2784 m88kbcs_vec) tb="$tb coff-m88k.lo" ;;
2785 newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;;
2786 nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
2787 nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
2788 nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"
8c693660 2789 target64=true ;;
c0734708
ILT
2790 riscix_vec) tb="$tb aout32.lo riscix.lo" ;;
2791 nlm32_powerpc_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
2792 pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
2793 pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
2794 pmac_xcoff_vec) tb="$tb coff-pmac.lo xcofflink.lo" ;;
2795 rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
2796 bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo cofflink.lo" ;;
2797 bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo cofflink.lo" ;;
2798 bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo cofflink.lo" ;;
2799 bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo cofflink.lo" ;;
2800 ppcboot_vec) tb="$tb ppcboot.lo" ;;
2801 shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
2802 shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
18ed85fd
ILT
2803 shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
2804 shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
c0734708
ILT
2805 som_vec) tb="$tb som.lo" ;;
2806 sparcle_aout_vec) tb="$tb aout-sparcle.lo aout32.lo" ;;
eee4e8ca 2807 sparclinux_vec) tb="$tb sparclinux.lo aout32.lo" ;;
c0734708
ILT
2808 sparclynx_aout_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
2809 sparclynx_coff_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;;
2810 sparcnetbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;;
2811 sparccoff_vec) tb="$tb coff-sparc.lo" ;;
2812 srec_vec) tb="$tb srec.lo" ;;
2813 sunos_big_vec) tb="$tb sunos.lo aout32.lo" ;;
2814 symbolsrec_vec) tb="$tb srec.lo" ;;
2815 tekhex_vec) tb="$tb tekhex.lo" ;;
229811d1
JM
2816 tic30_aout_vec) tb="$tb aout-tic30.lo" ;;
2817 tic30_coff_vec) tb="$tb coff-tic30.lo" ;;
cd6213ff 2818# start-sanitize-tic80
c0734708 2819 tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;;
cd6213ff 2820# end-sanitize-tic80
c0734708
ILT
2821 we32kcoff_vec) tb="$tb coff-we32k.lo" ;;
2822 z8kcoff_vec) tb="$tb coff-z8k.lo reloc16.lo" ;;
2823 w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;;
2824 versados_vec) tb="$tb versados.lo" ;;
8c693660
KR
2825
2826 "") ;;
2827 *) { echo "configure: error: *** unknown target vector $vec" 1>&2; exit 1; } ;;
2828 esac
2829done
2830
2831# Target architecture .o files.
b872076e
ILT
2832# A couple of CPUs use shorter file names to avoid problems on DOS
2833# filesystems.
c0734708 2834ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.lo/g -e s/mn10200/m10200/ -e s/mn10300/m10300/`
8c693660
KR
2835
2836# Weed out duplicate .o files.
2837f=""
2838for i in $tb ; do
2839 case " $f " in
2840 *" $i "*) ;;
2841 *) f="$f $i" ;;
2842 esac
2843done
2844tb="$f"
2845
2846f=""
2847for i in $ta ; do
2848 case " $f " in
2849 *" $i "*) ;;
2850 *) f="$f $i" ;;
2851 esac
2852done
2853ta="$f"
2854
2855bfd_backends="$tb"
2856bfd_machines="$ta"
2857
2858if test x${all_targets} = xtrue ; then
2859 bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
2860 bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
2b79a104 2861 selvecs=
dee99794 2862 havevecs=
2b79a104 2863 selarchs=
8c693660
KR
2864else # all_targets is true
2865 # Only set these if they will be nonempty, for the clever echo.
dee99794
ILT
2866 havevecs=
2867 test -n "$selvecs" &&
2868 havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'`
2b79a104
ILT
2869 test -n "$selvecs" &&
2870 selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
2871 test -n "$selarchs" &&
2ffbb79a 2872 selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
8c693660
KR
2873fi # all_targets is true
2874
2875case ${host64}-${target64}-${want64} in
2876 *true*)
2877 wordsize=64
2878 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
194141a9 2879 if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then
50bd50d4
MH
2880 echo "configure: warning: You have requested a 64 bit BFD configuration, but" 1>&2
2881 echo "configure: warning: your compiler may not have a 64 bit integral type" 1>&2
2882 fi
8c693660
KR
2883 ;;
2884 false-false-false)
2885 wordsize=32
2886 all_backends='$(BFD32_BACKENDS)'
2887 ;;
2888esac
2889
2890
2891
2892
2893
2894
8c693660
KR
2895tdefaults=""
2896test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
2897test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
2898test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
dee99794 2899test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}"
8c693660
KR
2900
2901
ac388f2a
ILT
2902for ac_hdr in unistd.h
2903do
2904ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2905echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
eee4e8ca 2906echo "configure:2907: checking for $ac_hdr" >&5
ac388f2a 2907if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
dfc7020d
ILT
2908 echo $ac_n "(cached) $ac_c" 1>&6
2909else
ac388f2a 2910 cat > conftest.$ac_ext <<EOF
eee4e8ca 2911#line 2912 "configure"
dfc7020d 2912#include "confdefs.h"
ac388f2a 2913#include <$ac_hdr>
dfc7020d 2914EOF
ac388f2a 2915ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
eee4e8ca 2916{ (eval echo configure:2917: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac388f2a
ILT
2917ac_err=`grep -v '^ *+' conftest.out`
2918if test -z "$ac_err"; then
2919 rm -rf conftest*
2920 eval "ac_cv_header_$ac_safe=yes"
dfc7020d 2921else
ac388f2a
ILT
2922 echo "$ac_err" >&5
2923 echo "configure: failed program was:" >&5
2924 cat conftest.$ac_ext >&5
2925 rm -rf conftest*
2926 eval "ac_cv_header_$ac_safe=no"
dfc7020d 2927fi
ac388f2a 2928rm -f conftest*
dfc7020d 2929fi
ac388f2a
ILT
2930if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2931 echo "$ac_t""yes" 1>&6
2932 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2933 cat >> confdefs.h <<EOF
2934#define $ac_tr_hdr 1
2935EOF
2936
2937else
2938 echo "$ac_t""no" 1>&6
dfc7020d 2939fi
ac388f2a 2940done
dfc7020d 2941
ac388f2a 2942for ac_func in getpagesize
d19df9b5
ILT
2943do
2944echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
eee4e8ca 2945echo "configure:2946: checking for $ac_func" >&5
d19df9b5
ILT
2946if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2947 echo $ac_n "(cached) $ac_c" 1>&6
2948else
2949 cat > conftest.$ac_ext <<EOF
eee4e8ca 2950#line 2951 "configure"
d19df9b5
ILT
2951#include "confdefs.h"
2952/* System header to define __stub macros and hopefully few prototypes,
2953 which can conflict with char $ac_func(); below. */
2954#include <assert.h>
2955/* Override any gcc2 internal prototype to avoid an error. */
a4322a77
ILT
2956/* We use char because int might match the return type of a gcc2
2957 builtin and then its argument prototype would still apply. */
d19df9b5
ILT
2958char $ac_func();
2959
ac388f2a 2960int main() {
d19df9b5
ILT
2961
2962/* The GNU C library defines this for functions which it implements
2963 to always fail with ENOSYS. Some functions are actually named
2964 something starting with __ and the normal name is an alias. */
2965#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2966choke me
2967#else
2968$ac_func();
2969#endif
2970
2971; return 0; }
2972EOF
eee4e8ca 2973if { (eval echo configure:2974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
d19df9b5
ILT
2974 rm -rf conftest*
2975 eval "ac_cv_func_$ac_func=yes"
2976else
ac388f2a
ILT
2977 echo "configure: failed program was:" >&5
2978 cat conftest.$ac_ext >&5
d19df9b5
ILT
2979 rm -rf conftest*
2980 eval "ac_cv_func_$ac_func=no"
2981fi
2982rm -f conftest*
fd8d7c31 2983fi
ac388f2a 2984
d19df9b5
ILT
2985if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2986 echo "$ac_t""yes" 1>&6
2987 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2988 cat >> confdefs.h <<EOF
2989#define $ac_tr_func 1
2990EOF
2991
2992else
2993 echo "$ac_t""no" 1>&6
2994fi
2995done
2996
4fe6d901 2997echo $ac_n "checking for working mmap""... $ac_c" 1>&6
eee4e8ca 2998echo "configure:2999: checking for working mmap" >&5
ac388f2a 2999if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
4fe6d901
KR
3000 echo $ac_n "(cached) $ac_c" 1>&6
3001else
3002 if test "$cross_compiling" = yes; then
ac388f2a 3003 ac_cv_func_mmap_fixed_mapped=no
4fe6d901 3004else
ac388f2a 3005 cat > conftest.$ac_ext <<EOF
eee4e8ca 3006#line 3007 "configure"
4fe6d901
KR
3007#include "confdefs.h"
3008
ac388f2a
ILT
3009/* Thanks to Mike Haertel and Jim Avera for this test.
3010 Here is a matrix of mmap possibilities:
3011 mmap private not fixed
3012 mmap private fixed at somewhere currently unmapped
3013 mmap private fixed at somewhere already mapped
3014 mmap shared not fixed
3015 mmap shared fixed at somewhere currently unmapped
3016 mmap shared fixed at somewhere already mapped
3017 For private mappings, we should verify that changes cannot be read()
3018 back from the file, nor mmap's back from the file at a different
3019 address. (There have been systems where private was not correctly
3020 implemented like the infamous i386 svr4.0, and systems where the
3021 VM page cache was not coherent with the filesystem buffer cache
3022 like early versions of FreeBSD and possibly contemporary NetBSD.)
3023 For shared mappings, we should conversely verify that changes get
3024 propogated back to all the places they're supposed to be.
3025
3026 Grep wants private fixed already mapped.
3027 The main things grep needs to know about mmap are:
3028 * does it exist and is it safe to write into the mmap'd area
3029 * how to use it (BSD variants) */
4fe6d901
KR
3030#include <sys/types.h>
3031#include <fcntl.h>
3032#include <sys/mman.h>
3033
ac388f2a 3034/* This mess was copied from the GNU getpagesize.h. */
4fe6d901 3035#ifndef HAVE_GETPAGESIZE
ac388f2a
ILT
3036# ifdef HAVE_UNISTD_H
3037# include <unistd.h>
dfc7020d
ILT
3038# endif
3039
ac388f2a
ILT
3040/* Assume that all systems that can run configure have sys/param.h. */
3041# ifndef HAVE_SYS_PARAM_H
3042# define HAVE_SYS_PARAM_H 1
3043# endif
3044
3045# ifdef _SC_PAGESIZE
3046# define getpagesize() sysconf(_SC_PAGESIZE)
3047# else /* no _SC_PAGESIZE */
3048# ifdef HAVE_SYS_PARAM_H
3049# include <sys/param.h>
3050# ifdef EXEC_PAGESIZE
3051# define getpagesize() EXEC_PAGESIZE
3052# else /* no EXEC_PAGESIZE */
3053# ifdef NBPG
3054# define getpagesize() NBPG * CLSIZE
3055# ifndef CLSIZE
3056# define CLSIZE 1
3057# endif /* no CLSIZE */
3058# else /* no NBPG */
3059# ifdef NBPC
3060# define getpagesize() NBPC
3061# else /* no NBPC */
3062# ifdef PAGESIZE
3063# define getpagesize() PAGESIZE
3064# endif /* PAGESIZE */
3065# endif /* no NBPC */
3066# endif /* no NBPG */
3067# endif /* no EXEC_PAGESIZE */
3068# else /* no HAVE_SYS_PARAM_H */
3069# define getpagesize() 8192 /* punt totally */
3070# endif /* no HAVE_SYS_PARAM_H */
3071# endif /* no _SC_PAGESIZE */
3072
3073#endif /* no HAVE_GETPAGESIZE */
4fe6d901
KR
3074
3075#ifdef __cplusplus
ac388f2a 3076extern "C" { void *malloc(unsigned); }
4fe6d901 3077#else
ac388f2a 3078char *malloc();
4fe6d901
KR
3079#endif
3080
3081int
3082main()
3083{
ac388f2a
ILT
3084 char *data, *data2, *data3;
3085 int i, pagesize;
3086 int fd;
3087
3088 pagesize = getpagesize();
3089
3090 /*
3091 * First, make a file with some known garbage in it.
3092 */
3093 data = malloc(pagesize);
3094 if (!data)
3095 exit(1);
3096 for (i = 0; i < pagesize; ++i)
3097 *(data + i) = rand();
3098 umask(0);
3099 fd = creat("conftestmmap", 0600);
3100 if (fd < 0)
3101 exit(1);
3102 if (write(fd, data, pagesize) != pagesize)
3103 exit(1);
3104 close(fd);
3105
3106 /*
3107 * Next, try to mmap the file at a fixed address which
3108 * already has something else allocated at it. If we can,
3109 * also make sure that we see the same garbage.
3110 */
3111 fd = open("conftestmmap", O_RDWR);
3112 if (fd < 0)
3113 exit(1);
3114 data2 = malloc(2 * pagesize);
3115 if (!data2)
3116 exit(1);
3117 data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
3118 if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
3119 MAP_PRIVATE | MAP_FIXED, fd, 0L))
3120 exit(1);
3121 for (i = 0; i < pagesize; ++i)
3122 if (*(data + i) != *(data2 + i))
3123 exit(1);
3124
3125 /*
3126 * Finally, make sure that changes to the mapped area
3127 * do not percolate back to the file as seen by read().
3128 * (This is a bug on some variants of i386 svr4.0.)
3129 */
3130 for (i = 0; i < pagesize; ++i)
3131 *(data2 + i) = *(data2 + i) + 1;
3132 data3 = malloc(pagesize);
3133 if (!data3)
3134 exit(1);
3135 if (read(fd, data3, pagesize) != pagesize)
3136 exit(1);
3137 for (i = 0; i < pagesize; ++i)
3138 if (*(data + i) != *(data3 + i))
3139 exit(1);
3140 close(fd);
3141 unlink("conftestmmap");
3142 exit(0);
4fe6d901
KR
3143}
3144
3145EOF
eee4e8ca 3146if { (eval echo configure:3147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
ac388f2a
ILT
3147then
3148 ac_cv_func_mmap_fixed_mapped=yes
4fe6d901 3149else
ac388f2a
ILT
3150 echo "configure: failed program was:" >&5
3151 cat conftest.$ac_ext >&5
3152 rm -fr conftest*
3153 ac_cv_func_mmap_fixed_mapped=no
4fe6d901 3154fi
fd8d7c31 3155rm -fr conftest*
dfc7020d
ILT
3156fi
3157
ac388f2a
ILT
3158fi
3159
3160echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
3161if test $ac_cv_func_mmap_fixed_mapped = yes; then
4fe6d901
KR
3162 cat >> confdefs.h <<\EOF
3163#define HAVE_MMAP 1
3164EOF
3165
3166fi
3167
3168for ac_func in madvise mprotect
3169do
3170echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
eee4e8ca 3171echo "configure:3172: checking for $ac_func" >&5
4fe6d901
KR
3172if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3173 echo $ac_n "(cached) $ac_c" 1>&6
3174else
3175 cat > conftest.$ac_ext <<EOF
eee4e8ca 3176#line 3177 "configure"
4fe6d901
KR
3177#include "confdefs.h"
3178/* System header to define __stub macros and hopefully few prototypes,
3179 which can conflict with char $ac_func(); below. */
3180#include <assert.h>
3181/* Override any gcc2 internal prototype to avoid an error. */
a4322a77
ILT
3182/* We use char because int might match the return type of a gcc2
3183 builtin and then its argument prototype would still apply. */
85e493f0 3184char $ac_func();
4fe6d901 3185
ac388f2a 3186int main() {
4fe6d901
KR
3187
3188/* The GNU C library defines this for functions which it implements
3189 to always fail with ENOSYS. Some functions are actually named
3190 something starting with __ and the normal name is an alias. */
3191#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3192choke me
3193#else
3194$ac_func();
3195#endif
3196
3197; return 0; }
3198EOF
eee4e8ca 3199if { (eval echo configure:3200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4fe6d901
KR
3200 rm -rf conftest*
3201 eval "ac_cv_func_$ac_func=yes"
3202else
ac388f2a
ILT
3203 echo "configure: failed program was:" >&5
3204 cat conftest.$ac_ext >&5
4fe6d901
KR
3205 rm -rf conftest*
3206 eval "ac_cv_func_$ac_func=no"
3207fi
3208rm -f conftest*
fd8d7c31 3209fi
ac388f2a 3210
4fe6d901
KR
3211if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3212 echo "$ac_t""yes" 1>&6
85e493f0 3213 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4fe6d901
KR
3214 cat >> confdefs.h <<EOF
3215#define $ac_tr_func 1
3216EOF
3217
3218else
3219 echo "$ac_t""no" 1>&6
3220fi
3221done
3222
fd8d7c31 3223case ${want_mmap}+${ac_cv_func_mmap_fixed_mapped} in
85e493f0
ILT
3224 true+yes ) cat >> confdefs.h <<\EOF
3225#define USE_MMAP 1
3226EOF
3227 ;;
3228esac
4fe6d901 3229
8c693660
KR
3230rm -f doc/config.status
3231trap '' 1 2 15
3232cat > confcache <<\EOF
3233# This file is a shell script that caches the results of configure
3234# tests run on this system so they can be shared between configure
3235# scripts and configure runs. It is not useful on other systems.
3236# If it contains results you don't want to keep, you may remove or edit it.
3237#
3238# By default, configure uses ./config.cache as the cache file,
3239# creating it if it does not exist already. You can give configure
3240# the --cache-file=FILE option to use a different cache file; that is
3241# what configure does when it calls configure scripts in
3242# subdirectories, so they share the cache.
3243# Giving --cache-file=/dev/null disables caching, for debugging configure.
3244# config.status only pays attention to the cache file if you give it the
3245# --recheck option to rerun configure.
3246#
3247EOF
ac388f2a
ILT
3248# The following way of writing the cache mishandles newlines in values,
3249# but we know of no workaround that is simple, portable, and efficient.
3250# So, don't put newlines in cache variables' values.
8c693660
KR
3251# Ultrix sh set writes to stderr and can't be redirected directly,
3252# and sets the high bit in the cache file unless we assign to the vars.
3253(set) 2>&1 |
372b296c 3254 case `(ac_space=' '; set) 2>&1 | grep ac_space` in
ac388f2a
ILT
3255 *ac_space=\ *)
3256 # `set' does not quote correctly, so add quotes (double-quote substitution
3257 # turns \\\\ into \\, and sed turns \\ into \).
3258 sed -n \
3259 -e "s/'/'\\\\''/g" \
3260 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3261 ;;
3262 *)
3263 # `set' quotes correctly as required by POSIX, so do not add quotes.
3264 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3265 ;;
3266 esac >> confcache
8c693660
KR
3267if cmp -s $cache_file confcache; then
3268 :
3269else
3270 if test -w $cache_file; then
3271 echo "updating cache $cache_file"
3272 cat confcache > $cache_file
3273 else
3274 echo "not updating unwritable cache $cache_file"
3275 fi
3276fi
3277rm -f confcache
3278
3279trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
3280
3281test "x$prefix" = xNONE && prefix=$ac_default_prefix
3282# Let make expand exec_prefix.
3283test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
3284
3285# Any assignment to VPATH causes Sun make to only execute
3286# the first set of double-colon rules, so remove it if not needed.
3287# If there is a colon in the path, we need to keep it.
3288if test "x$srcdir" = x.; then
3289 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
3290fi
3291
3292trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
3293
b7577823 3294DEFS=-DHAVE_CONFIG_H
8c693660
KR
3295
3296# Without the "./", some shells look in PATH for config.status.
3297: ${CONFIG_STATUS=./config.status}
3298
3299echo creating $CONFIG_STATUS
3300rm -f $CONFIG_STATUS
3301cat > $CONFIG_STATUS <<EOF
3302#! /bin/sh
3303# Generated automatically by configure.
3304# Run this file to recreate the current configuration.
3305# This directory was configured as follows,
3306# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3307#
3308# $0 $ac_configure_args
3309#
3310# Compiler output produced by configure, useful for debugging
3311# configure, is in ./config.log if it exists.
3312
3313ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
3314for ac_option
3315do
3316 case "\$ac_option" in
3317 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
3318 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
3319 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
3320 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
372b296c 3321 echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
8c693660
KR
3322 exit 0 ;;
3323 -help | --help | --hel | --he | --h)
3324 echo "\$ac_cs_usage"; exit 0 ;;
3325 *) echo "\$ac_cs_usage"; exit 1 ;;
3326 esac
3327done
3328
3329ac_given_srcdir=$srcdir
f515fb2f 3330ac_given_INSTALL="$INSTALL"
8c693660 3331
f4e14cb9 3332trap '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
3333EOF
3334cat >> $CONFIG_STATUS <<EOF
8c693660 3335
85e493f0 3336# Protect against being on the right side of a sed subst in config.status.
d19df9b5
ILT
3337sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
3338 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
8c693660
KR
3339$ac_vpsub
3340$extrasub
372b296c 3341s%@SHELL@%$SHELL%g
8c693660
KR
3342s%@CFLAGS@%$CFLAGS%g
3343s%@CPPFLAGS@%$CPPFLAGS%g
3344s%@CXXFLAGS@%$CXXFLAGS%g
3345s%@DEFS@%$DEFS%g
3346s%@LDFLAGS@%$LDFLAGS%g
3347s%@LIBS@%$LIBS%g
3348s%@exec_prefix@%$exec_prefix%g
3349s%@prefix@%$prefix%g
3350s%@program_transform_name@%$program_transform_name%g
85e493f0
ILT
3351s%@bindir@%$bindir%g
3352s%@sbindir@%$sbindir%g
3353s%@libexecdir@%$libexecdir%g
3354s%@datadir@%$datadir%g
3355s%@sysconfdir@%$sysconfdir%g
3356s%@sharedstatedir@%$sharedstatedir%g
3357s%@localstatedir@%$localstatedir%g
3358s%@libdir@%$libdir%g
3359s%@includedir@%$includedir%g
3360s%@oldincludedir@%$oldincludedir%g
3361s%@infodir@%$infodir%g
3362s%@mandir@%$mandir%g
8c693660
KR
3363s%@host@%$host%g
3364s%@host_alias@%$host_alias%g
3365s%@host_cpu@%$host_cpu%g
3366s%@host_vendor@%$host_vendor%g
3367s%@host_os@%$host_os%g
3368s%@target@%$target%g
3369s%@target_alias@%$target_alias%g
3370s%@target_cpu@%$target_cpu%g
3371s%@target_vendor@%$target_vendor%g
3372s%@target_os@%$target_os%g
3373s%@build@%$build%g
3374s%@build_alias@%$build_alias%g
3375s%@build_cpu@%$build_cpu%g
3376s%@build_vendor@%$build_vendor%g
3377s%@build_os@%$build_os%g
f515fb2f 3378s%@CC@%$CC%g
f515fb2f
ILT
3379s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
3380s%@INSTALL_DATA@%$INSTALL_DATA%g
c0734708
ILT
3381s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
3382s%@PACKAGE@%$PACKAGE%g
f4e14cb9 3383s%@VERSION@%$VERSION%g
c0734708
ILT
3384s%@ACLOCAL@%$ACLOCAL%g
3385s%@AUTOCONF@%$AUTOCONF%g
3386s%@AUTOMAKE@%$AUTOMAKE%g
3387s%@AUTOHEADER@%$AUTOHEADER%g
3388s%@MAKEINFO@%$MAKEINFO%g
3389s%@SET_MAKE@%$SET_MAKE%g
7810074c 3390s%@AR@%$AR%g
c0734708
ILT
3391s%@RANLIB@%$RANLIB%g
3392s%@LD@%$LD%g
9a837903 3393s%@NM@%$NM%g
c0734708
ILT
3394s%@LN_S@%$LN_S%g
3395s%@LIBTOOL@%$LIBTOOL%g
3396s%@MAINT@%$MAINT%g
3397s%@EXEEXT@%$EXEEXT%g
3398s%@HDEFINES@%$HDEFINES%g
f4e14cb9
ILT
3399s%@BFD_HOST_64BIT_LONG@%$BFD_HOST_64BIT_LONG%g
3400s%@BFD_HOST_64_BIT_DEFINED@%$BFD_HOST_64_BIT_DEFINED%g
3401s%@BFD_HOST_64_BIT@%$BFD_HOST_64_BIT%g
3402s%@BFD_HOST_U_64_BIT@%$BFD_HOST_U_64_BIT%g
f515fb2f 3403s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
2c66160c 3404s%@EXEEXT_FOR_BUILD@%$EXEEXT_FOR_BUILD%g
b7577823 3405s%@CPP@%$CPP%g
a52a3ce8
ILT
3406s%@COREFILE@%$COREFILE%g
3407s%@COREFLAG@%$COREFLAG%g
2b79a104 3408s%@TDEFINES@%$TDEFINES%g
8c693660
KR
3409s%@wordsize@%$wordsize%g
3410s%@all_backends@%$all_backends%g
3411s%@bfd_backends@%$bfd_backends%g
3412s%@bfd_machines@%$bfd_machines%g
3413s%@tdefaults@%$tdefaults%g
3414
3415CEOF
3416EOF
ac388f2a
ILT
3417
3418cat >> $CONFIG_STATUS <<\EOF
3419
3420# Split the substitutions into bite-sized pieces for seds with
3421# small command number limits, like on Digital OSF/1 and HP-UX.
3422ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
3423ac_file=1 # Number of current file.
3424ac_beg=1 # First line for current file.
3425ac_end=$ac_max_sed_cmds # Line after last line for current file.
3426ac_more_lines=:
3427ac_sed_cmds=""
3428while $ac_more_lines; do
3429 if test $ac_beg -gt 1; then
3430 sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
3431 else
3432 sed "${ac_end}q" conftest.subs > conftest.s$ac_file
3433 fi
3434 if test ! -s conftest.s$ac_file; then
3435 ac_more_lines=false
3436 rm -f conftest.s$ac_file
3437 else
3438 if test -z "$ac_sed_cmds"; then
3439 ac_sed_cmds="sed -f conftest.s$ac_file"
3440 else
3441 ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
3442 fi
3443 ac_file=`expr $ac_file + 1`
3444 ac_beg=$ac_end
3445 ac_end=`expr $ac_end + $ac_max_sed_cmds`
3446 fi
3447done
3448if test -z "$ac_sed_cmds"; then
3449 ac_sed_cmds=cat
3450fi
3451EOF
3452
8c693660
KR
3453cat >> $CONFIG_STATUS <<EOF
3454
f4e14cb9 3455CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile bfd-in3.h:bfd-in2.h"}
8c693660
KR
3456EOF
3457cat >> $CONFIG_STATUS <<\EOF
3458for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
ac388f2a 3459 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8c693660 3460 case "$ac_file" in
ac388f2a 3461 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8c693660
KR
3462 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3463 *) ac_file_in="${ac_file}.in" ;;
3464 esac
3465
ac388f2a 3466 # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
8c693660
KR
3467
3468 # Remove last slash and all that follows it. Not all systems have dirname.
3469 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3470 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3471 # The file is in a subdirectory.
3472 test ! -d "$ac_dir" && mkdir "$ac_dir"
3473 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
3474 # A "../" for each directory in $ac_dir_suffix.
3475 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
3476 else
3477 ac_dir_suffix= ac_dots=
3478 fi
3479
3480 case "$ac_given_srcdir" in
3481 .) srcdir=.
3482 if test -z "$ac_dots"; then top_srcdir=.
3483 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
3484 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
3485 *) # Relative path.
3486 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
3487 top_srcdir="$ac_dots$ac_given_srcdir" ;;
3488 esac
3489
f515fb2f
ILT
3490 case "$ac_given_INSTALL" in
3491 [/$]*) INSTALL="$ac_given_INSTALL" ;;
3492 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
3493 esac
ac388f2a 3494
8c693660
KR
3495 echo creating "$ac_file"
3496 rm -f "$ac_file"
3497 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
3498 case "$ac_file" in
3499 *Makefile*) ac_comsub="1i\\
3500# $configure_input" ;;
3501 *) ac_comsub= ;;
3502 esac
ac388f2a 3503
c0734708 3504 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8c693660
KR
3505 sed -e "$ac_comsub
3506s%@configure_input@%$configure_input%g
3507s%@srcdir@%$srcdir%g
3508s%@top_srcdir@%$top_srcdir%g
f515fb2f 3509s%@INSTALL@%$INSTALL%g
ac388f2a 3510" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
8c693660 3511fi; done
ac388f2a 3512rm -f conftest.s*
8c693660 3513
b7577823
ILT
3514# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
3515# NAME is the cpp macro being defined and VALUE is the value it is being given.
3516#
3517# ac_d sets the value in "#define NAME VALUE" lines.
3518ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
3519ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
3520ac_dC='\3'
3521ac_dD='%g'
3522# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
3523ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
3524ac_uB='\([ ]\)%\1#\2define\3'
3525ac_uC=' '
3526ac_uD='\4%g'
3527# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
3528ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
3529ac_eB='$%\1#\2define\3'
3530ac_eC=' '
3531ac_eD='%g'
3532
ac388f2a
ILT
3533if test "${CONFIG_HEADERS+set}" != set; then
3534EOF
3535cat >> $CONFIG_STATUS <<EOF
3536 CONFIG_HEADERS="config.h:config.in"
3537EOF
3538cat >> $CONFIG_STATUS <<\EOF
3539fi
b7577823 3540for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
ac388f2a 3541 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
b7577823 3542 case "$ac_file" in
ac388f2a 3543 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
b7577823
ILT
3544 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3545 *) ac_file_in="${ac_file}.in" ;;
3546 esac
8c693660 3547
b7577823 3548 echo creating $ac_file
8c693660 3549
b7577823 3550 rm -f conftest.frag conftest.in conftest.out
c0734708 3551 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
ac388f2a 3552 cat $ac_file_inputs > conftest.in
8c693660 3553
b7577823 3554EOF
8c693660 3555
b7577823
ILT
3556# Transform confdefs.h into a sed script conftest.vals that substitutes
3557# the proper values into config.h.in to produce config.h. And first:
85e493f0 3558# Protect against being on the right side of a sed subst in config.status.
b7577823
ILT
3559# Protect against being in an unquoted here document in config.status.
3560rm -f conftest.vals
3561cat > conftest.hdr <<\EOF
3562s/[\\&%]/\\&/g
3563s%[\\$`]%\\&%g
a4322a77 3564s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
b7577823
ILT
3565s%ac_d%ac_u%gp
3566s%ac_u%ac_e%gp
3567EOF
3568sed -n -f conftest.hdr confdefs.h > conftest.vals
3569rm -f conftest.hdr
3570
3571# This sed command replaces #undef with comments. This is necessary, for
3572# example, in the case of _POSIX_SOURCE, which is predefined and required
3573# on some systems where configure will not decide to define it.
3574cat >> conftest.vals <<\EOF
3575s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
3576EOF
8c693660 3577
b7577823
ILT
3578# Break up conftest.vals because some shells have a limit on
3579# the size of here documents, and old seds have small limits too.
8c693660 3580
b7577823
ILT
3581rm -f conftest.tail
3582while :
3583do
3584 ac_lines=`grep -c . conftest.vals`
3585 # grep -c gives empty output for an empty file on some AIX systems.
3586 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
3587 # Write a limited-size here document to conftest.frag.
3588 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
3589 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
3590 echo 'CEOF
3591 sed -f conftest.frag conftest.in > conftest.out
3592 rm -f conftest.in
3593 mv conftest.out conftest.in
3594' >> $CONFIG_STATUS
3595 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
3596 rm -f conftest.vals
3597 mv conftest.tail conftest.vals
3598done
3599rm -f conftest.vals
8c693660 3600
b7577823
ILT
3601cat >> $CONFIG_STATUS <<\EOF
3602 rm -f conftest.frag conftest.h
3603 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
3604 cat conftest.in >> conftest.h
3605 rm -f conftest.in
3606 if cmp -s $ac_file conftest.h 2>/dev/null; then
3607 echo "$ac_file is unchanged"
3608 rm -f conftest.h
8c693660 3609 else
a4322a77
ILT
3610 # Remove last slash and all that follows it. Not all systems have dirname.
3611 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3612 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3613 # The file is in a subdirectory.
3614 test ! -d "$ac_dir" && mkdir "$ac_dir"
3615 fi
b7577823
ILT
3616 rm -f $ac_file
3617 mv conftest.h $ac_file
8c693660 3618 fi
b7577823
ILT
3619fi; done
3620
ac388f2a
ILT
3621EOF
3622cat >> $CONFIG_STATUS <<EOF
8c693660 3623
c0734708 3624
ac388f2a
ILT
3625EOF
3626cat >> $CONFIG_STATUS <<\EOF
c0734708
ILT
3627test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
3628
8c693660
KR
3629exit 0
3630EOF
3631chmod +x $CONFIG_STATUS
3632rm -fr confdefs* $ac_clean_files
3633test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
3634
This page took 0.535147 seconds and 4 git commands to generate.