tweaks
[external/binutils.git] / bfd / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 AC_PREREQ(2.5)
4 AC_INIT(libbfd.c)
5
6 AC_CANONICAL_SYSTEM
7 AC_ISC_POSIX
8
9 AM_INIT_AUTOMAKE(bfd, 2.8.2)
10
11 AM_PROG_LIBTOOL
12
13 AC_ARG_ENABLE(64-bit-bfd,
14 [  --enable-64-bit-bfd     64-bit support (on hosts with narrower word sizes)],
15 [case "${enableval}" in
16   yes)  want64=true  ;;
17   no)   want64=false ;;
18   *)    AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
19 esac],[want64=false])dnl
20 AC_ARG_ENABLE(targets,
21 [  --enable-targets        alternative target configurations],
22 [case "${enableval}" in
23   yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
24             ;;
25   no)       enable_targets= ;;
26   *)        enable_targets=$enableval ;;
27 esac])dnl
28 AC_ARG_ENABLE(commonbfdlib,
29 [  --enable-commonbfdlib   build shared BFD/opcodes/libiberty library],
30 [case "${enableval}" in
31   yes) commonbfdlib=true ;;
32   no)  commonbfdlib=false ;;
33   *)   AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
34 esac])dnl
35 AC_ARG_WITH(mmap,
36 [  --with-mmap             try using mmap for BFD input files if available],
37 [case "${withval}" in
38   yes)  want_mmap=true ;;
39   no)   want_mmap=false ;;
40   *)    AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;;
41 esac],[want_mmap=false])dnl
42
43 AM_CONFIG_HEADER(config.h:config.in)
44
45 if test -z "$target" ; then
46     AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
47 fi
48 AC_ARG_PROGRAM
49
50 AM_MAINTAINER_MODE
51 AM_CYGWIN32
52 AM_EXEEXT
53
54 host64=false
55 target64=false
56
57 # host stuff:
58
59 AC_PROG_CC
60
61 # Permit host specific settings.
62 . ${srcdir}/configure.host
63
64 AC_SUBST(HDEFINES)
65 AC_CHECK_TOOL(AR, ar)
66 AC_CHECK_TOOL(RANLIB, ranlib, :)
67 AM_PROG_INSTALL
68
69 BFD_HOST_64BIT_LONG=0
70 BFD_HOST_64_BIT_DEFINED=0
71 BFD_HOST_64_BIT=
72 BFD_HOST_U_64_BIT=
73 if test "x${HOST_64BIT_TYPE}" = "xlong"; then
74   BFD_HOST_64BIT_LONG=1
75 elif test "x${HOST_64BIT_TYPE}" != "x"; then
76   BFD_HOST_64_BIT_DEFINED=1
77   BFD_HOST_64_BIT=${HOST_64BIT_TYPE}
78   BFD_HOST_U_64_BIT=${HOST_U_64BIT_TYPE}
79 fi
80 AC_SUBST(BFD_HOST_64BIT_LONG)
81 AC_SUBST(BFD_HOST_64_BIT_DEFINED)
82 AC_SUBST(BFD_HOST_64_BIT)
83 AC_SUBST(BFD_HOST_U_64_BIT)
84
85 BFD_CC_FOR_BUILD
86
87 AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
88 AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
89 AC_HEADER_TIME
90 AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen)
91
92 BFD_BINARY_FOPEN
93
94 BFD_NEED_DECLARATION(strstr)
95 BFD_NEED_DECLARATION(malloc)
96 BFD_NEED_DECLARATION(realloc)
97 BFD_NEED_DECLARATION(free)
98 BFD_NEED_DECLARATION(getenv)
99
100 # If we are configured native, pick a core file support file.
101 COREFILE=
102 COREFLAG=
103 if test "${target}" = "${host}"; then
104   case "${host}" in
105   alpha*-*-linux*)
106         COREFILE=trad-core.lo
107         AC_DEFINE(TRAD_HEADER,"hosts/alphalinux.h")
108         ;;
109   alpha*-*-*)           COREFILE=osf-core.lo ;;
110   arm-*-riscix)         COREFILE=trad-core.lo ;;
111   hppa*-*-hpux*)        COREFILE=hpux-core.lo ;;
112   hppa*-*-hiux*)        COREFILE=hpux-core.lo ;;
113   hppa*-*-bsd*)         COREFILE="hpux-core.lo hppabsd-core.lo"
114                         COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
115 changequote(,)dnl
116   i[3456]86-sequent-bsd*)
117 changequote([,])dnl
118         COREFILE=trad-core.lo;
119         AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h")
120         ;;
121 changequote(,)dnl
122   i[3456]86-sequent-sysv4*) ;;
123   i[3456]86-sequent-sysv*)
124 changequote([,])dnl
125         COREFILE=trad-core.lo
126         AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h")
127         ;;
128 changequote(,)dnl
129   i[3456]86-*-bsd* | i[3456]86-*-freebsd*)
130 changequote([,])dnl
131         COREFILE=trad-core.lo
132         AC_DEFINE(TRAD_HEADER,"hosts/i386bsd.h")
133         ;;
134 changequote(,)dnl
135   i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
136 changequote([,])dnl
137         COREFILE=netbsd-core.lo
138         ;;
139 changequote(,)dnl
140   i[3456]86-esix-sysv3*)
141 changequote([,])dnl
142         COREFILE=trad-core.lo
143         AC_DEFINE(TRAD_HEADER,"hosts/esix.h")
144         ;;
145 changequote(,)dnl
146   i[3456]86-*-sco* | i[3456]86-*-isc*)
147 changequote([,])dnl
148         COREFILE=trad-core.lo
149         AC_DEFINE(TRAD_HEADER,"hosts/i386sco.h")
150         ;;
151 changequote(,)dnl
152   i[3456]86-*-mach3*)
153 changequote([,])dnl
154         COREFILE=trad-core.lo
155         AC_DEFINE(TRAD_HEADER,"hosts/i386mach3.h")
156         ;;
157 changequote(,)dnl
158   i[3456]86-*-linux*)
159 changequote([,])dnl
160         COREFILE=trad-core.lo
161         AC_DEFINE(TRAD_HEADER,"hosts/i386linux.h")
162         ;;
163 changequote(,)dnl
164   i[3456]86-*-isc*)     COREFILE=trad-core.lo ;;
165   i[3456]86-*-aix*)     COREFILE=aix386-core.lo ;;
166 changequote([,])dnl
167   i860-*-mach3* | i860-*-osf1*)
168         COREFILE=trad-core.lo
169         AC_DEFINE(TRAD_HEADER,"hosts/i860mach3.h")
170         ;;
171   mips-dec-bsd*)
172         COREFILE=trad-core.lo
173         AC_DEFINE(TRAD_HEADER,"hosts/mipsbsd.h")
174         ;;
175   mips-dec-mach3*)
176         COREFILE=trad-core.lo
177         AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
178         ;;
179   mips-*-netbsd* | mips*-*-openbsd*)
180         COREFILE=netbsd-core.lo
181         ;;
182   mips-dec-*)
183         COREFILE=trad-core.lo
184         AC_DEFINE(TRAD_HEADER,"hosts/decstation.h")
185         ;;
186   mips-sgi-irix4*)      COREFILE=irix-core.lo ;;
187   mips-sgi-irix5*)      COREFILE=irix-core.lo ;;
188   mips-sgi-irix6*)      COREFILE=irix-core.lo ;;
189   mips-*-mach3*)
190         COREFILE=trad-core.lo
191         AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
192         ;;
193   mips-*-sysv4*)        ;;
194   mips-*-sysv* | mips-*-riscos*)
195         COREFILE=trad-core.lo
196         AC_DEFINE(TRAD_HEADER,"hosts/riscos.h")
197         ;;
198   mips-sony-bsd*)
199         COREFILE=trad-core.lo
200         AC_DEFINE(TRAD_HEADER,"hosts/news-mips.h")
201         ;;
202   m68*-bull*-sysv*)
203         COREFILE=trad-core.lo
204         AC_DEFINE(TRAD_HEADER,"hosts/dpx2.h")
205         ;;
206   m68*-hp-hpux*)        COREFILE=hpux-core.lo ;;
207   m68*-hp-bsd*)
208         COREFILE=trad-core.lo
209         AC_DEFINE(TRAD_HEADER,"hosts/hp300bsd.h")
210         ;;
211   m68*-*-linux*)
212         COREFILE=trad-core.lo
213         AC_DEFINE(TRAD_HEADER,"hosts/m68klinux.h")
214         ;;
215   m68*-motorola-sysv*)
216         COREFILE=trad-core.lo
217         AC_DEFINE(TRAD_HEADER, "hosts/delta68.h")
218         ;;
219   m68*-sony-*)
220         COREFILE=trad-core.lo
221         AC_DEFINE(TRAD_HEADER,"hosts/news.h")
222         ;;
223   m68*-*-netbsd* | m68*-*-openbsd*)
224         COREFILE=netbsd-core.lo
225         ;;
226   m68*-apple-aux*)
227         COREFILE=trad-core.lo
228         AC_DEFINE(TRAD_HEADER,"hosts/m68kaux.h")
229         ;;
230   m88*-*-sysv4*)        ;;
231   m88*-motorola-sysv*)  COREFILE=ptrace-core.lo ;;
232   m88*-*-mach3*)
233         COREFILE=trad-core.lo
234         AC_DEFINE(TRAD_HEADER,"hosts/m88kmach3.h")
235         ;;
236   ns32k-pc532-mach)
237         COREFILE=trad-core.lo
238         AC_DEFINE(TRAD_HEADER,"hosts/pc532mach.h")
239         ;;
240   ns32k-*-netbsd* | ns32k-*-openbsd*)
241         COREFILE=netbsd-core.lo
242         ;;
243   rs6000-*-lynx*)       COREFILE=lynx-core.lo ;;
244   rs6000-*-aix4*)       COREFILE=rs6000-core.lo ;;
245   rs6000-*-*)           COREFILE=rs6000-core.lo ;;
246   powerpc-*-*bsd*)      COREFILE=netbsd-core.lo ;;
247   powerpc-*-aix4*)      COREFILE=rs6000-core.lo ;;
248   powerpc-*-aix*)       COREFILE=rs6000-core.lo ;;
249   powerpc-*-beos*)      ;;
250   sparc-*-netbsd* | sparc-*-openbsd*)
251         COREFILE=netbsd-core.lo
252         ;;
253   tahoe-*-*)
254         COREFILE=trad-core.lo
255         AC_DEFINE(TRAD_HEADER,"hosts/tahoe.h")
256         ;;
257   vax-*-ultrix2*)
258         COREFILE=trad-core.lo
259         AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h")
260         ;;
261   vax-*-ultrix*)
262         COREFILE=trad-core.lo
263         AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h")
264         ;;
265   vax-*-*)
266         COREFILE=trad-core.lo
267         AC_DEFINE(TRAD_HEADER,"hosts/vaxbsd.h")
268         ;;
269   esac
270
271   case "$COREFILE" in
272   aix386-core.lo)       COREFLAG=-DAIX386_CORE ;;
273   hppabsd-core.lo)      COREFLAG=-DHPPABSD_CORE ;;
274   hpux-core.lo)         COREFLAG=-DHPUX_CORE ;;
275   irix-core.lo)         COREFLAG=-DIRIX_CORE ;;
276   lynx-core.lo)         COREFLAG=-DLYNX_CORE ;;
277   osf-core.lo)          COREFLAG=-DOSF_CORE ;;
278   ptrace-core.lo)       COREFLAG=-DPTRACE_CORE ;;
279   rs6000-core.lo)       COREFLAG="$COREFLAG -DAIX_CORE" ;;
280   trad-core.lo)         COREFLAG="$COREFLAG -DTRAD_CORE" ;;
281   esac
282
283   # The ELF code uses the native <sys/procfs.h> to handle core files.
284   # Define HAVE_SYS_PROCFS_H if the file exists and defines
285   # prstatus_t.
286   AC_MSG_CHECKING([for sys/procfs.h])
287   AC_CACHE_VAL(bfd_cv_header_sys_procfs_h,
288   [AC_TRY_COMPILE([#include <sys/procfs.h>],
289   [prstatus_t t;],
290   bfd_cv_header_sys_procfs_h=yes, bfd_cv_header_sys_procfs_h=no)])
291   AC_MSG_RESULT($bfd_cv_header_sys_procfs_h)
292   if test $bfd_cv_header_sys_procfs_h = yes; then
293     AC_DEFINE(HAVE_SYS_PROCFS_H)
294   fi
295
296 fi
297 AC_SUBST(COREFILE)
298 AC_SUBST(COREFLAG)
299
300 # target stuff:
301
302 # Canonicalize the secondary target names.
303 if test -n "$enable_targets" ; then
304     for targ in `echo $enable_targets | sed 's/,/ /g'`
305     do
306         result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
307         if test -n "$result" ; then
308             canon_targets="$canon_targets $result"
309         else
310             # Allow targets that config.sub doesn't recognize, like "all".
311             canon_targets="$canon_targets $targ"
312         fi
313     done
314 fi
315
316 all_targets=false
317 defvec=
318 selvecs=
319 selarchs=
320 TDEFINES=
321 for targ in $target $canon_targets
322 do
323     if test "x$targ" = "xall"; then
324         all_targets=true
325     else
326         . $srcdir/config.bfd
327         if test "x$targ" = "x$target"; then
328             defvec=$targ_defvec
329         fi
330         selvecs="$selvecs $targ_defvec $targ_selvecs"
331         selarchs="$selarchs $targ_archs"
332         TDEFINES="$TDEFINES $targ_cflags"
333     fi
334 done
335 AC_SUBST(TDEFINES)
336
337 # This processing still needs to be done if we're to decide properly whether
338 # 64-bit support needs to be compiled in.  Currently, it will be included if
339 # the default or any other explicitly requested target requires it; it
340 # will not be included on a 32-bit host if no 64-bit target is requested, and
341 # no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
342 # used.
343
344 # uniq the default and selected vectors in all the configured targets.
345 f=""
346 for i in $selvecs ; do
347     case " $f " in
348     *" $i "*) ;;
349     *) f="$f $i" ;;
350     esac
351 done
352 selvecs="$f"
353
354 # uniq the architectures in all the configured targets.
355 f=""
356 for i in $selarchs ; do
357     case " $f " in
358     *" $i "*) ;;
359     *) f="$f $i" ;;
360     esac
361 done
362 selarchs="$f"
363
364 # Target backend .o files.
365 tb=
366
367 elf="elf.lo elflink.lo"
368
369 for vec in $selvecs
370 do
371     case "$vec" in
372     # This list is alphabetized to make it easy to compare
373     # with the two vector lists in targets.c.
374     a29kcoff_big_vec)           tb="$tb coff-a29k.lo cofflink.lo" ;;
375     a_out_adobe_vec)            tb="$tb aout-adobe.lo aout32.lo" ;;
376     armcoff_little_vec)         tb="$tb coff-arm.lo cofflink.lo " ;;
377     armcoff_big_vec)            tb="$tb coff-arm.lo cofflink.lo " ;;
378     armpe_little_vec)           tb="$tb pe-arm.lo cofflink.lo " ;;
379     armpe_big_vec)              tb="$tb pe-arm.lo cofflink.lo " ;;
380     armpei_little_vec)          tb="$tb pei-arm.lo cofflink.lo " ;;
381     armpei_big_vec)             tb="$tb pei-arm.lo cofflink.lo " ;;
382     aout0_big_vec)              tb="$tb aout0.lo aout32.lo" ;;
383     aout_arm_big_vec)           tb="$tb aout-arm.lo aout32.lo" ;;
384     aout_arm_little_vec)        tb="$tb aout-arm.lo aout32.lo" ;;
385     aout_mips_big_vec)          tb="$tb mipsbsd.lo aout32.lo" ;;
386     aout_mips_little_vec)       tb="$tb mipsbsd.lo aout32.lo" ;;
387     apollocoff_vec)             tb="$tb coff-apollo.lo" ;;
388     b_out_vec_big_host)         tb="$tb bout.lo aout32.lo" ;;
389     b_out_vec_little_host)      tb="$tb bout.lo aout32.lo" ;;
390     bfd_elf64_alpha_vec)        tb="$tb elf64-alpha.lo elf64.lo $elf"
391                                 target64=true ;;
392 # start-sanitize-arc
393     bfd_elf32_littlearc_vec)    tb="$tb elf32-arc.lo elf32.lo $elf" ;;
394     bfd_elf32_bigarc_vec)       tb="$tb elf32-arc.lo elf32.lo $elf" ;;
395 # end-sanitize-arc
396     bfd_elf32_big_generic_vec)  tb="$tb elf32-gen.lo elf32.lo $elf" ;;
397     bfd_elf32_bigmips_vec)      tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
398     bfd_elf64_bigmips_vec)      tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
399                                 target64=true ;;
400     bfd_elf32_d10v_vec)         tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
401 # start-sanitize-d30v
402     bfd_elf32_d30v_vec)         tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
403 # end-sanitize-d30v
404     bfd_elf32_hppa_vec)         tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
405     bfd_elf32_i386_vec)         tb="$tb elf32-i386.lo elf32.lo $elf" ;;
406     bfd_elf32_i860_vec)         tb="$tb elf32-i860.lo elf32.lo $elf" ;;
407     bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
408     bfd_elf32_littlemips_vec)   tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
409     bfd_elf64_littlemips_vec)   tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
410                                 target64=true ;;
411     bfd_elf32_m32r_vec)         tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
412     bfd_elf32_m68k_vec)         tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
413     bfd_elf32_m88k_vec)         tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
414     bfd_elf32_mn10200_vec)      tb="$tb elf-m10200.lo elf32.lo $elf" ;;
415     bfd_elf32_mn10300_vec)      tb="$tb elf-m10300.lo elf32.lo $elf" ;;
416     bfd_elf32_powerpc_vec)      tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
417     bfd_elf32_powerpcle_vec)    tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
418     bfd_elf32_sh_vec)           tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
419     bfd_elf32_shl_vec)          tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
420     bfd_elf32_sparc_vec)        tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
421 # start-sanitize-v850
422     bfd_elf32_v850_vec)         tb="$tb elf32-v850.lo elf32.lo $elf" ;;
423 # end-sanitize-v850
424     bfd_elf64_big_generic_vec)  tb="$tb elf64-gen.lo elf64.lo $elf"
425                                 target64=true ;;
426     bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"
427                                 target64=true ;;
428     bfd_elf64_sparc_vec)        tb="$tb elf64-sparc.lo elf64.lo $elf"
429                                 target64=true ;;
430     cisco_core_vec)             tb="$tb cisco-core.lo" ;;
431     demo_64_vec)                tb="$tb demo64.lo aout64.lo"
432                                 target64=true ;;
433     ecoff_big_vec)              tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
434     ecoff_little_vec)           tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
435     ecoff_biglittle_vec)        tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
436     ecoffalpha_little_vec)      tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"
437                                 target64=true ;;
438     go32coff_vec)               tb="$tb coff-go32.lo cofflink.lo" ;;
439     go32stubbedcoff_vec)        tb="$tb coff-stubgo32.lo cofflink.lo" ;;
440     evax_alpha_vec)             tb="$tb evax-alpha.lo evax-emh.lo evax-egsd.lo evax-etir.lo evax-misc.lo"
441                                 target64=true ;;
442     h8300coff_vec)              tb="$tb coff-h8300.lo reloc16.lo" ;;
443     h8500coff_vec)              tb="$tb coff-h8500.lo reloc16.lo" ;;
444     host_aout_vec)              tb="$tb host-aout.lo aout32.lo" ;;
445     hp300bsd_vec)               tb="$tb hp300bsd.lo aout32.lo" ;;
446     hp300hpux_vec)              tb="$tb hp300hpux.lo aout32.lo" ;;
447     i386aout_vec)               tb="$tb i386aout.lo aout32.lo" ;;
448     i386bsd_vec)                tb="$tb i386bsd.lo aout32.lo" ;;
449     i386coff_vec)               tb="$tb coff-i386.lo cofflink.lo" ;;
450     i386dynix_vec)              tb="$tb i386dynix.lo aout32.lo" ;;
451     i386freebsd_vec)            tb="$tb i386freebsd.lo aout32.lo" ;;
452     i386msdos_vec)              tb="$tb i386msdos.lo" ;;
453     i386pe_vec)                 tb="$tb pe-i386.lo cofflink.lo " ;;
454     i386pei_vec)                tb="$tb pei-i386.lo cofflink.lo" ;;
455     i386linux_vec)              tb="$tb i386linux.lo aout32.lo" ;;
456     i386lynx_aout_vec)          tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
457     i386lynx_coff_vec)          tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
458     i386mach3_vec)              tb="$tb i386mach3.lo aout32.lo" ;;
459     i386netbsd_vec)             tb="$tb i386netbsd.lo aout32.lo" ;;
460     i386os9k_vec)               tb="$tb i386os9k.lo aout32.lo" ;;
461     i860coff_vec)               tb="$tb coff-i860.lo cofflink.lo" ;;
462     icoff_big_vec)              tb="$tb coff-i960.lo cofflink.lo" ;;
463     icoff_little_vec)           tb="$tb coff-i960.lo cofflink.lo" ;;
464     ieee_vec)                   tb="$tb ieee.lo" ;;
465     m68kcoff_vec)               tb="$tb coff-m68k.lo cofflink.lo" ;;
466     m68kcoffun_vec)             tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;;
467     m68klinux_vec)              tb="$tb m68klinux.lo aout32.lo" ;;
468     m68klynx_aout_vec)          tb="$tb m68klynx.lo lynx-core.lo aout32.lo" ;;
469     m68klynx_coff_vec)          tb="$tb cf-m68klynx.lo coff-m68k.lo cofflink.lo lynx-core.lo" ;;
470     m68knetbsd_vec)             tb="$tb m68knetbsd.lo aout32.lo" ;;
471     m68k4knetbsd_vec)           tb="$tb m68k4knetbsd.lo aout32.lo" ;;
472     m68kaux_coff_vec)           tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
473     m68ksysvcoff_vec)           tb="$tb coff-svm68k.lo cofflink.lo" ;;
474     m88kbcs_vec)                tb="$tb coff-m88k.lo" ;;
475     newsos3_vec)                tb="$tb newsos3.lo aout32.lo" ;;
476     nlm32_i386_vec)             tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
477     nlm32_sparc_vec)            tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
478     nlm32_alpha_vec)            tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"
479                                 target64=true ;;
480     riscix_vec)                 tb="$tb aout32.lo riscix.lo" ;;
481     nlm32_powerpc_vec)          tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
482     pc532netbsd_vec)            tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
483     pc532machaout_vec)          tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
484     pmac_xcoff_vec)             tb="$tb coff-pmac.lo xcofflink.lo" ;;
485     rs6000coff_vec)             tb="$tb coff-rs6000.lo xcofflink.lo" ;;
486     bfd_powerpc_pe_vec)         tb="$tb pe-ppc.lo cofflink.lo" ;;  
487     bfd_powerpcle_pe_vec)       tb="$tb pe-ppc.lo cofflink.lo" ;;  
488     bfd_powerpc_pei_vec)        tb="$tb pei-ppc.lo cofflink.lo" ;;
489     bfd_powerpcle_pei_vec)      tb="$tb pei-ppc.lo cofflink.lo" ;;
490     ppcboot_vec)                tb="$tb ppcboot.lo" ;;
491     shcoff_vec)                 tb="$tb coff-sh.lo cofflink.lo" ;;
492     shlcoff_vec)                tb="$tb coff-sh.lo cofflink.lo" ;;
493     som_vec)                    tb="$tb som.lo" ;;
494     sparcle_aout_vec)           tb="$tb aout-sparcle.lo aout32.lo" ;;
495     sparclinux_vec)             tb="$tb sparclinux.lo aout32.lo stab-syms.lo" ;;
496     sparclynx_aout_vec)         tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
497     sparclynx_coff_vec)         tb="$tb cf-sparclynx.lo lynx-core.lo" ;;
498     sparcnetbsd_vec)            tb="$tb sparcnetbsd.lo aout32.lo" ;;
499     sparccoff_vec)              tb="$tb coff-sparc.lo" ;;
500     srec_vec)                   tb="$tb srec.lo" ;;
501     sunos_big_vec)              tb="$tb sunos.lo aout32.lo" ;;
502     symbolsrec_vec)             tb="$tb srec.lo" ;;
503     tekhex_vec)                 tb="$tb tekhex.lo" ;;
504 # start-sanitize-tic80
505     tic80coff_vec)              tb="$tb coff-tic80.lo cofflink.lo" ;;
506 # end-sanitize-tic80
507     we32kcoff_vec)              tb="$tb coff-we32k.lo" ;;
508     z8kcoff_vec)                tb="$tb coff-z8k.lo reloc16.lo" ;;
509     w65_vec)                    tb="$tb coff-w65.lo reloc16.lo" ;;
510     versados_vec)               tb="$tb versados.lo" ;;
511
512     "")                 ;;
513     *) AC_MSG_ERROR(*** unknown target vector $vec) ;;
514     esac
515 done
516
517 # Target architecture .o files.
518 # A couple of CPUs use shorter file names to avoid problems on DOS
519 # filesystems.
520 ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.lo/g -e s/mn10200/m10200/ -e s/mn10300/m10300/`
521
522 # Weed out duplicate .o files.
523 f=""
524 for i in $tb ; do
525     case " $f " in
526     *" $i "*) ;;
527     *) f="$f $i" ;;
528     esac
529 done
530 tb="$f"
531
532 f=""
533 for i in $ta ; do
534     case " $f " in
535     *" $i "*) ;;
536     *) f="$f $i" ;;
537     esac
538 done
539 ta="$f"
540
541 bfd_backends="$tb"
542 bfd_machines="$ta"
543
544 if test x${all_targets} = xtrue ; then
545   bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
546   bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
547   selvecs=
548   havevecs=
549   selarchs=
550 else    # all_targets is true
551   # Only set these if they will be nonempty, for the clever echo.
552   havevecs=
553   test -n "$selvecs" &&
554     havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'`
555   test -n "$selvecs" &&
556     selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
557   test -n "$selarchs" &&
558     selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
559 fi      # all_targets is true
560
561 case ${host64}-${target64}-${want64} in
562   *true*)
563     wordsize=64
564     all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
565     if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then
566       AC_MSG_WARN([You have requested a 64 bit BFD configuration, but])
567       AC_MSG_WARN([your compiler may not have a 64 bit integral type])
568     fi
569     ;;
570   false-false-false)
571     wordsize=32
572     all_backends='$(BFD32_BACKENDS)'
573     ;;
574 esac
575
576 AC_SUBST(wordsize)
577 AC_SUBST(all_backends)
578 AC_SUBST(bfd_backends)
579 AC_SUBST(bfd_machines)
580
581 tdefaults=""
582 test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
583 test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
584 test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
585 test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}"
586 AC_SUBST(tdefaults)
587
588 dnl AC_CHECK_HEADERS(sys/mman.h)
589 AC_FUNC_MMAP
590 AC_CHECK_FUNCS(madvise mprotect)
591 case ${want_mmap}+${ac_cv_func_mmap_fixed_mapped} in
592   true+yes )  AC_DEFINE(USE_MMAP) ;;
593 esac
594
595 rm -f doc/config.status
596 AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h)