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