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