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