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