2001-03-22 Philip Blundell <philb@gnu.org>
[binutils.git] / bfd / configure.in
blobeeb3eb711b06c43aee2fa65a8e1517708b6666fa
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
4 AC_PREREQ(2.13)
5 AC_INIT(libbfd.c)
7 AC_CANONICAL_SYSTEM
8 AC_ISC_POSIX
10 AM_INIT_AUTOMAKE(bfd, 2.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, :)
17 dnl Default to a non shared library.  This may be overridden by the
18 dnl configure option --enable-shared.
19 AM_DISABLE_SHARED
21 AM_PROG_LIBTOOL
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
53 build_warnings="-W -Wall"
54 AC_ARG_ENABLE(build-warnings,
55 [  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
56 [case "${enableval}" in
57   yes)  ;;
58   no)   build_warnings="-w";;
59   ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
60         build_warnings="${build_warnings} ${t}";;
61   *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
62         build_warnings="${t} ${build_warnings}";;
63   *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
64 esac
65 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
66   echo "Setting warning flags = $build_warnings" 6>&1
67 fi])dnl
68 WARN_CFLAGS=""
69 if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
70     WARN_CFLAGS="${build_warnings}"
72 AC_SUBST(WARN_CFLAGS)
74 AM_CONFIG_HEADER(config.h:config.in)
76 if test -z "$target" ; then
77     AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
79 AC_ARG_PROGRAM
81 AM_MAINTAINER_MODE
82 AC_EXEEXT
84 host64=false
85 target64=false
87 # host stuff:
89 AC_PROG_CC
91 ALL_LINGUAS=
92 CY_GNU_GETTEXT
94 # Permit host specific settings.
95 . ${srcdir}/configure.host
97 AC_SUBST(HDEFINES)
98 AC_PROG_INSTALL
100 BFD_HOST_64BIT_LONG=0
101 BFD_HOST_64_BIT_DEFINED=0
102 BFD_HOST_64_BIT=
103 BFD_HOST_U_64_BIT=
104 if test "x${HOST_64BIT_TYPE}" = "xlong"; then
105   BFD_HOST_64BIT_LONG=1
106 elif test "x${HOST_64BIT_TYPE}" != "x"; then
107   BFD_HOST_64_BIT_DEFINED=1
108   BFD_HOST_64_BIT=${HOST_64BIT_TYPE}
109   BFD_HOST_U_64_BIT=${HOST_U_64BIT_TYPE}
111 AC_SUBST(BFD_HOST_64BIT_LONG)
112 AC_SUBST(BFD_HOST_64_BIT_DEFINED)
113 AC_SUBST(BFD_HOST_64_BIT)
114 AC_SUBST(BFD_HOST_U_64_BIT)
116 BFD_CC_FOR_BUILD
118 AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
119 AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
120 AC_HEADER_TIME
121 AC_HEADER_DIRENT
122 AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid)
124 BFD_BINARY_FOPEN
126 BFD_NEED_DECLARATION(strstr)
127 BFD_NEED_DECLARATION(malloc)
128 BFD_NEED_DECLARATION(realloc)
129 BFD_NEED_DECLARATION(free)
130 BFD_NEED_DECLARATION(getenv)
132 # If we are configured native, pick a core file support file.
133 COREFILE=
134 COREFLAG=
135 TRAD_HEADER=
136 if test "${target}" = "${host}"; then
137   case "${host}" in
138   alpha*-*-freebsd*)
139         COREFILE=''
140         ;;
141   alpha*-*-linux-gnu*)
142         COREFILE=trad-core.lo
143         TRAD_HEADER='"hosts/alphalinux.h"'
144         ;;
145   alpha*-*-netbsd*)     COREFILE=netbsd-core.lo ;;
146   alpha*-*-*)           COREFILE=osf-core.lo ;;
147   arm-*-freebsd*)       COREFILE='' ;;
148   arm-*-riscix)         COREFILE=trad-core.lo ;;
149   hppa*-*-hpux*)        COREFILE=hpux-core.lo ;;
150   hppa*-*-hiux*)        COREFILE=hpux-core.lo ;;
151   hppa*-*-mpeix*)       COREFILE=hpux-core.lo ;;
152   hppa*-*-bsd*)         COREFILE="hpux-core.lo hppabsd-core.lo"
153                         COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
154   i370-*-*)             
155         COREFILE=trad-core.lo
156         TRAD_HEADER='"hosts/i370linux.h"'
157         ;;
159 changequote(,)dnl
160   i[3456]86-sequent-bsd*)
161 changequote([,])dnl
162         COREFILE=trad-core.lo
163         TRAD_HEADER='"hosts/symmetry.h"'
164         ;;
165 changequote(,)dnl
166   i[3456]86-sequent-sysv4*) ;;
167   i[3456]86-sequent-sysv*)
168 changequote([,])dnl
169         COREFILE=trad-core.lo
170         TRAD_HEADER='"hosts/symmetry.h"'
171         ;;
172 changequote(,)dnl
173   i[3456]86-*-bsd* | i[34567]86-*-freebsd[1234] | i[34567]86-*-freebsd[1234]\.* | i[34567]86-*-freebsd*aout*)
174 changequote([,])dnl
175         COREFILE=trad-core.lo
176         TRAD_HEADER='"hosts/i386bsd.h"'
177         ;;
178 changequote(,)dnl
179   i[3456]86-*-freebsd*)
180 changequote([,])dnl
181         COREFILE=''
182         TRAD_HEADER='"hosts/i386bsd.h"'
183         ;;
184 changequote(,)dnl
185   i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
186 changequote([,])dnl
187         COREFILE=netbsd-core.lo
188         ;;
189 changequote(,)dnl
190   i[3456]86-esix-sysv3*)
191 changequote([,])dnl
192         COREFILE=trad-core.lo
193         TRAD_HEADER='"hosts/esix.h"'
194         ;;
195 changequote(,)dnl
196   i[3456]86-*-sco3.2v5*)
197 changequote([,])dnl
198         COREFILE=sco5-core.lo
199         ;;
200 changequote(,)dnl
201   i[3456]86-*-sco* | i[3456]86-*-isc*)
202 changequote([,])dnl
203         COREFILE=trad-core.lo
204         TRAD_HEADER='"hosts/i386sco.h"'
205         ;;
206 changequote(,)dnl
207   i[3456]86-*-mach3*)
208 changequote([,])dnl
209         COREFILE=trad-core.lo
210         TRAD_HEADER='"hosts/i386mach3.h"'
211         ;;
212 changequote(,)dnl
213   i[3456]86-*-linux-gnu*)
214 changequote([,])dnl
215         COREFILE=trad-core.lo
216         TRAD_HEADER='"hosts/i386linux.h"'
217         ;;
218 changequote(,)dnl
219   i[3456]86-*-isc*)     COREFILE=trad-core.lo ;;
220   i[3456]86-*-aix*)     COREFILE=aix386-core.lo ;;
221 changequote([,])dnl
222   i860-*-mach3* | i860-*-osf1*)
223         COREFILE=trad-core.lo
224         TRAD_HEADER='"hosts/i860mach3.h"'
225         ;;
226   mips-dec-bsd*)
227         COREFILE=trad-core.lo
228         TRAD_HEADER='"hosts/mipsbsd.h"'
229         ;;
230   mips-dec-mach3*)
231         COREFILE=trad-core.lo
232         TRAD_HEADER='"hosts/mipsmach3.h"'
233         ;;
234   mips-*-netbsd* | mips*-*-openbsd*)
235         COREFILE=netbsd-core.lo
236         ;;
237   mips-dec-*)
238         COREFILE=trad-core.lo
239         TRAD_HEADER='"hosts/decstation.h"'
240         ;;
241   mips-sgi-irix4*)      COREFILE=irix-core.lo ;;
242   mips-sgi-irix5*)      COREFILE=irix-core.lo ;;
243   mips-sgi-irix6*)      COREFILE=irix-core.lo ;;
244   mips-*-mach3*)
245         COREFILE=trad-core.lo
246         TRAD_HEADER='"hosts/mipsmach3.h"'
247         ;;
248   mips-*-sysv4*)        ;;
249   mips-*-sysv* | mips-*-riscos*)
250         COREFILE=trad-core.lo
251         TRAD_HEADER='"hosts/riscos.h"'
252         ;;
253   mips-sony-bsd*)
254         COREFILE=trad-core.lo
255         TRAD_HEADER='"hosts/news-mips.h"'
256         ;;
257   m68*-bull*-sysv*)
258         COREFILE=trad-core.lo
259         TRAD_HEADER='"hosts/dpx2.h"'
260         ;;
261   m68*-hp-hpux*)        COREFILE=hpux-core.lo ;;
262   m68*-hp-bsd*)
263         COREFILE=trad-core.lo
264         TRAD_HEADER='"hosts/hp300bsd.h"'
265         ;;
266   m68*-*-linux-gnu*)
267         COREFILE=trad-core.lo
268         TRAD_HEADER='"hosts/m68klinux.h"'
269         ;;
270   m68*-motorola-sysv*)
271         COREFILE=trad-core.lo
272         TRAD_HEADER='"hosts/delta68.h"'
273         ;;
274   m68*-sony-*)
275         COREFILE=trad-core.lo
276         TRAD_HEADER='"hosts/news.h"'
277         ;;
278   m68*-*-netbsd* | m68*-*-openbsd*)
279         COREFILE=netbsd-core.lo
280         ;;
281   m68*-apple-aux*)
282         COREFILE=trad-core.lo
283         TRAD_HEADER='"hosts/m68kaux.h"'
284         ;;
285   m88*-*-sysv4*)        ;;
286   m88*-motorola-sysv*)  COREFILE=ptrace-core.lo ;;
287   m88*-*-mach3*)
288         COREFILE=trad-core.lo
289         TRAD_HEADER='"hosts/m88kmach3.h"'
290         ;;
291   ns32k-pc532-mach)
292         COREFILE=trad-core.lo
293         TRAD_HEADER='"hosts/pc532mach.h"'
294         ;;
295   ns32k-*-netbsd* | ns32k-*-openbsd*)
296         COREFILE=netbsd-core.lo
297         ;;
298   rs6000-*-lynx*)       COREFILE=lynx-core.lo ;;
299 changequote(,)dnl
300   rs6000-*-aix4.[3-9]* | powerpc-*-aix4.[3-9]*)
301 changequote([,])dnl
302         COREFILE=rs6000-core.lo
303         COREFLAG="$COREFLAG -DAIX_CORE_DUMPX_CORE"
304         ;;
305   rs6000-*-aix4*)       COREFILE=rs6000-core.lo ;;
306   rs6000-*-*)           COREFILE=rs6000-core.lo ;;
307   powerpc-*-*bsd*)      COREFILE=netbsd-core.lo ;;
308   powerpc-*-aix4*)      COREFILE=rs6000-core.lo ;;
309   powerpc-*-aix*)       COREFILE=rs6000-core.lo ;;
310   powerpc-*-beos*)      ;;
311   powerpc-*-freebsd*)   COREFILE='' ;;
312   powerpc-*-netbsd*)    COREFILE=netbsd-core.lo ;;
313   sparc-*-netbsd* | sparc-*-openbsd*)
314         COREFILE=netbsd-core.lo
315         ;;
316   tahoe-*-*)
317         COREFILE=trad-core.lo
318         TRAD_HEADER='"hosts/tahoe.h"'
319         ;;
320   vax-*-ultrix2*)
321         COREFILE=trad-core.lo
322         TRAD_HEADER='"hosts/vaxult2.h"'
323         ;;
324   vax-*-ultrix*)
325         COREFILE=trad-core.lo
326         TRAD_HEADER='"hosts/vaxult2.h"'
327         ;;
328   vax-*-*)
329         COREFILE=trad-core.lo
330         TRAD_HEADER='"hosts/vaxbsd.h"'
331         ;;
332   esac
334   case "$COREFILE" in
335   aix386-core.lo)       COREFLAG=-DAIX386_CORE ;;
336   hppabsd-core.lo)      COREFLAG=-DHPPABSD_CORE ;;
337   hpux-core.lo)         COREFLAG=-DHPUX_CORE ;;
338   irix-core.lo)         COREFLAG=-DIRIX_CORE ;;
339   lynx-core.lo)         COREFLAG=-DLYNX_CORE ;;
340   netbsd-core.lo)       COREFLAG=-DNETBSD_CORE ;;
341   osf-core.lo)          COREFLAG=-DOSF_CORE ;;
342   ptrace-core.lo)       COREFLAG=-DPTRACE_CORE ;;
343   rs6000-core.lo)       COREFLAG="$COREFLAG -DAIX_CORE" ;;
344   sco5-core.lo)         COREFLAG="$COREFLAG -DSCO5_CORE" ;;
345   trad-core.lo)         COREFLAG="$COREFLAG -DTRAD_CORE" ;;
346   esac
348   # ELF corefile support has several flavors, but all of
349   # them use something called <sys/procfs.h>
350   AC_CHECK_HEADERS(sys/procfs.h)
351   if test "$ac_cv_header_sys_procfs_h" = yes; then
352     BFD_HAVE_SYS_PROCFS_TYPE(prstatus_t)
353     BFD_HAVE_SYS_PROCFS_TYPE(prstatus32_t)
354     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus_t, pr_who)
355     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus32_t, pr_who)
356     BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t)
357     BFD_HAVE_SYS_PROCFS_TYPE(pxstatus_t)
358     BFD_HAVE_SYS_PROCFS_TYPE(pstatus32_t)
359     BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo_t)
360     BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo32_t)
361     BFD_HAVE_SYS_PROCFS_TYPE(psinfo_t)
362     BFD_HAVE_SYS_PROCFS_TYPE(psinfo32_t)
363     BFD_HAVE_SYS_PROCFS_TYPE(lwpstatus_t)
364     BFD_HAVE_SYS_PROCFS_TYPE(lwpxstatus_t)
365     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_context)
366     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_reg)
367     BFD_HAVE_SYS_PROCFS_TYPE(win32_pstatus_t)
368   fi
370 AC_SUBST(COREFILE)
371 AC_SUBST(COREFLAG)
372 if test -n "$TRAD_HEADER"; then
373   AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER,
374     [Name of host specific header file to include in trad-core.c.])
377 # Horrible hacks to build DLLs on Windows.
378 WIN32LDFLAGS=
379 WIN32LIBADD=
380 case "${host}" in
381 *-*-cygwin*)
382   if test "$enable_shared" = "yes"; then
383     WIN32LDFLAGS="-no-undefined"
384     WIN32LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32"
385   fi
386   ;;
387 esac
388 AC_SUBST(WIN32LDFLAGS)
389 AC_SUBST(WIN32LIBADD)
391 # target stuff:
393 # Canonicalize the secondary target names.
394 if test -n "$enable_targets" ; then
395     for targ in `echo $enable_targets | sed 's/,/ /g'`
396     do
397         result=`$ac_config_sub $targ 2>/dev/null`
398         if test -n "$result" ; then
399             canon_targets="$canon_targets $result"
400         else
401             # Allow targets that config.sub doesn't recognize, like "all".
402             canon_targets="$canon_targets $targ"
403         fi
404     done
407 all_targets=false
408 defvec=
409 selvecs=
410 selarchs=
411 TDEFINES=
412 for targ in $target $canon_targets
414     if test "x$targ" = "xall"; then
415         all_targets=true
416     else
417         . $srcdir/config.bfd
418         if test "x$targ" = "x$target"; then
419             defvec=$targ_defvec
420         fi
421         selvecs="$selvecs $targ_defvec $targ_selvecs"
422         selarchs="$selarchs $targ_archs"
423         TDEFINES="$TDEFINES $targ_cflags"
424     fi
425 done
426 AC_SUBST(TDEFINES)
428 # This processing still needs to be done if we're to decide properly whether
429 # 64-bit support needs to be compiled in.  Currently, it will be included if
430 # the default or any other explicitly requested target requires it; it
431 # will not be included on a 32-bit host if no 64-bit target is requested, and
432 # no "--with-64-bit-bfd" option is given, even if "--enable-targets=all" is
433 # used.
435 # uniq the default and selected vectors in all the configured targets.
436 f=""
437 for i in $selvecs ; do
438     case " $f " in
439     *" $i "*) ;;
440     *) f="$f $i" ;;
441     esac
442 done
443 selvecs="$f"
446 # uniq the architectures in all the configured targets.
447 f=""
448 for i in $selarchs ; do
449     case " $f " in
450     *" $i "*) ;;
451     *) f="$f $i" ;;
452     esac
453 done
454 selarchs="$f"
456 # Target backend .o files.
459 elf="elf.lo elflink.lo dwarf1.lo"
461 for vec in $selvecs
463     case "$vec" in
464     # This list is alphabetized to make it easy to compare
465     # with the two vector lists in targets.c.
466     a29kcoff_big_vec)           tb="$tb coff-a29k.lo cofflink.lo" ;;
467     a_out_adobe_vec)            tb="$tb aout-adobe.lo aout32.lo" ;;
468     armcoff_little_vec)         tb="$tb coff-arm.lo cofflink.lo " ;;
469     armcoff_big_vec)            tb="$tb coff-arm.lo cofflink.lo " ;;
470     armnetbsd_vec)              tb="$tb armnetbsd.lo aout32.lo" ;;
471     armpe_little_vec)           tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
472     armpe_big_vec)              tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
473     armpei_little_vec)          tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
474     armpei_big_vec)             tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
475     arm_epoc_pe_little_vec)     tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
476     arm_epoc_pe_big_vec)        tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
477     arm_epoc_pei_little_vec)    tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
478     arm_epoc_pei_big_vec)       tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
479     aout0_big_vec)              tb="$tb aout0.lo aout32.lo" ;;
480     aout_arm_big_vec)           tb="$tb aout-arm.lo aout32.lo" ;;
481     aout_arm_little_vec)        tb="$tb aout-arm.lo aout32.lo" ;;
482     aout_mips_big_vec)          tb="$tb mipsbsd.lo aout32.lo" ;;
483     aout_mips_little_vec)       tb="$tb mipsbsd.lo aout32.lo" ;;
484     apollocoff_vec)             tb="$tb coff-apollo.lo" ;;
485     b_out_vec_big_host)         tb="$tb bout.lo aout32.lo" ;;
486     b_out_vec_little_host)      tb="$tb bout.lo aout32.lo" ;;
487     bfd_efi_app_ia32_vec)       tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;;
488     bfd_efi_app_ia64_vec)       tb="$tb efi-app-ia64.lo peigen.lo cofflink.lo"
489                                 target64=true ;;
490     bfd_elf64_alpha_vec)        tb="$tb elf64-alpha.lo elf64.lo $elf"
491                                 target64=true ;;
492     bfd_elf64_hppa_vec | bfd_elf64_hppa_linux_vec)
493                                 tb="$tb elf64-hppa.lo elf64.lo $elf"
494                                 target64=true ;;
495     bfd_elf64_ia64_little_vec)  tb="$tb elf64-ia64.lo elf64.lo $elf"
496                                 target64=true ;;
497     bfd_elf64_ia64_big_vec)     tb="$tb elf64-ia64.lo elf64.lo $elf"
498                                 target64=true ;;
499     bfd_elf32_ia64_big_vec)     tb="$tb elf32-ia64.lo elf32.lo $elf" ;;
500     bfd_elf32_avr_vec)          tb="$tb elf32-avr.lo elf32.lo $elf" ;;
501     bfd_elf32_littlearc_vec)    tb="$tb elf32-arc.lo elf32.lo $elf" ;;
502     bfd_elf32_littlearm_vec)    tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
503     bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
504     bfd_elf32_bigarc_vec)       tb="$tb elf32-arc.lo elf32.lo $elf" ;;
505     bfd_elf32_bigarm_vec)       tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
506     bfd_elf32_bigarm_oabi_vec)  tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
507     bfd_elf32_big_generic_vec)  tb="$tb elf32-gen.lo elf32.lo $elf" ;;
508     bfd_elf32_bigmips_vec)      tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
509     bfd_elf64_bigmips_vec)      tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
510                                 target64=true ;;
511     bfd_elf32_cris_vec)         tb="$tb elf32-cris.lo elf32.lo $elf" ;;
512     bfd_elf32_us_cris_vec)      tb="$tb elf32-cris.lo elf32.lo $elf" ;;
513     bfd_elf32_d10v_vec)         tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
514     bfd_elf32_d30v_vec)         tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
515     bfd_elf32_fr30_vec)         tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
516     bfd_elf32_hppa_vec | bfd_elf32_hppa_linux_vec)
517                                 tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
518     bfd_elf32_i370_vec)         tb="$tb elf32-i370.lo elf32.lo $elf" ;;
519     bfd_elf32_i386_vec)         tb="$tb elf32-i386.lo elf32.lo $elf" ;;
520     bfd_elf64_x86_64_vec)       tb="$tb elf64-x86-64.lo elf64.lo $elf"
521                                 target64=true ;;
522     bfd_elf32_i860_vec)         tb="$tb elf32-i860.lo elf32.lo $elf" ;;
523     bfd_elf32_i860_little_vec)  tb="$tb elf32-i860.lo elf32.lo $elf" ;;
524     bfd_elf32_i960_vec)         tb="$tb elf32-i960.lo elf32.lo $elf" ;;
525     bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
526     bfd_elf32_littlemips_vec)   tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
527     bfd_elf64_littlemips_vec)   tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
528                                 target64=true ;;
529     bfd_elf32_m32r_vec)         tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
530     bfd_elf32_m68hc11_vec)      tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;;
531     bfd_elf32_m68hc12_vec)      tb="$tb elf32-m68hc12.lo elf32.lo $elf" ;;
532     bfd_elf32_m68k_vec)         tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
533     bfd_elf32_m88k_vec)         tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
534     bfd_elf32_mcore_big_vec)    tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
535     bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
536     bfd_elf32_mn10200_vec)      tb="$tb elf-m10200.lo elf32.lo $elf" ;;
537     bfd_elf32_mn10300_vec)      tb="$tb elf-m10300.lo elf32.lo $elf" ;;
538     bfd_elf32_pj_vec)           tb="$tb elf32-pj.lo elf32.lo $elf";;
539     bfd_elf32_pjl_vec)          tb="$tb elf32-pj.lo elf32.lo $elf";;
540     bfd_elf32_powerpc_vec)      tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
541     bfd_elf32_powerpcle_vec)    tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
542     bfd_elf32_sh_vec)           tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
543     bfd_elf32_shl_vec)          tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
544     bfd_elf32_shlin_vec)        tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
545     bfd_elf32_shblin_vec)       tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
546     bfd_elf32_sparc_vec)        tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
547     bfd_elf32_tradbigmips_vec)  tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
548     bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
549     bfd_elf32_v850_vec)         tb="$tb elf32-v850.lo elf32.lo $elf" ;;
550     bfd_elf64_big_generic_vec)  tb="$tb elf64-gen.lo elf64.lo $elf"
551                                 target64=true ;;
552     bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"
553                                 target64=true ;;
554     bfd_elf64_sparc_vec)        tb="$tb elf64-sparc.lo elf64.lo $elf"
555                                 target64=true ;;
556     cisco_core_big_vec)         tb="$tb cisco-core.lo" ;;
557     cisco_core_little_vec)      tb="$tb cisco-core.lo" ;;
558     cris_aout_vec)              tb="$tb aout-cris.lo" ;;
559     demo_64_vec)                tb="$tb demo64.lo aout64.lo"
560                                 target64=true ;;
561     ecoff_big_vec)              tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
562     ecoff_little_vec)           tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
563     ecoff_biglittle_vec)        tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
564     ecoffalpha_little_vec)      tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"
565                                 target64=true ;;
566     go32coff_vec)               tb="$tb coff-go32.lo cofflink.lo" ;;
567     go32stubbedcoff_vec)        tb="$tb coff-stgo32.lo cofflink.lo" ;;
568     h8300coff_vec)              tb="$tb coff-h8300.lo reloc16.lo" ;;
569     h8500coff_vec)              tb="$tb coff-h8500.lo reloc16.lo" ;;
570     host_aout_vec)              tb="$tb host-aout.lo aout32.lo" ;;
571     hp300bsd_vec)               tb="$tb hp300bsd.lo aout32.lo" ;;
572     hp300hpux_vec)              tb="$tb hp300hpux.lo aout32.lo" ;;
573     i386aout_vec)               tb="$tb i386aout.lo aout32.lo" ;;
574     i386bsd_vec)                tb="$tb i386bsd.lo aout32.lo" ;;
575     i386coff_vec)               tb="$tb coff-i386.lo cofflink.lo" ;;
576     i386dynix_vec)              tb="$tb i386dynix.lo aout32.lo" ;;
577     i386freebsd_vec)            tb="$tb i386freebsd.lo aout32.lo" ;;
578     i386msdos_vec)              tb="$tb i386msdos.lo" ;;
579     i386pe_vec)                 tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
580     i386pei_vec)                tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
581     i386linux_vec)              tb="$tb i386linux.lo aout32.lo" ;;
582     i386lynx_aout_vec)          tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
583     i386lynx_coff_vec)          tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
584     i386mach3_vec)              tb="$tb i386mach3.lo aout32.lo" ;;
585     i386netbsd_vec)             tb="$tb i386netbsd.lo aout32.lo" ;;
586     i386os9k_vec)               tb="$tb i386os9k.lo aout32.lo" ;;
587     i860coff_vec)               tb="$tb coff-i860.lo cofflink.lo" ;;
588     icoff_big_vec)              tb="$tb coff-i960.lo cofflink.lo" ;;
589     icoff_little_vec)           tb="$tb coff-i960.lo cofflink.lo" ;;
590     ieee_vec)                   tb="$tb ieee.lo" ;;
591     m68kcoff_vec)               tb="$tb coff-m68k.lo cofflink.lo" ;;
592     m68kcoffun_vec)             tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;;
593     m68klinux_vec)              tb="$tb m68klinux.lo aout32.lo" ;;
594     m68klynx_aout_vec)          tb="$tb m68klynx.lo lynx-core.lo aout32.lo" ;;
595     m68klynx_coff_vec)          tb="$tb cf-m68klynx.lo coff-m68k.lo cofflink.lo lynx-core.lo" ;;
596     m68knetbsd_vec)             tb="$tb m68knetbsd.lo aout32.lo" ;;
597     m68k4knetbsd_vec)           tb="$tb m68k4knetbsd.lo aout32.lo" ;;
598     m68kaux_coff_vec)           tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
599     m68ksysvcoff_vec)           tb="$tb coff-svm68k.lo cofflink.lo" ;;
600     m88kbcs_vec)                tb="$tb coff-m88k.lo" ;;
601     mipslpe_vec)                tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;;
602     mipslpei_vec)               tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;;
603     mcore_pe_big_vec)           tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
604     mcore_pe_little_vec)        tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
605     mcore_pei_big_vec)          tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
606     mcore_pei_little_vec)       tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
607     newsos3_vec)                tb="$tb newsos3.lo aout32.lo" ;;
608     nlm32_i386_vec)             tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
609     rs6000coff64_vec)           tb="$tb coff64-rs6000.lo xcofflink.lo"
610                                 target64=true ;;
611     nlm32_sparc_vec)            tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
612     nlm32_alpha_vec)            tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"
613                                 target64=true ;;
614     riscix_vec)                 tb="$tb aout32.lo riscix.lo" ;;
615     nlm32_powerpc_vec)          tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
616     pc532netbsd_vec)            tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
617     pc532machaout_vec)          tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
618     pmac_xcoff_vec)             tb="$tb coff-pmac.lo xcofflink.lo" ;;
619     rs6000coff_vec)             tb="$tb coff-rs6000.lo xcofflink.lo" ;;
620     bfd_powerpc_pe_vec)         tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;  
621     bfd_powerpcle_pe_vec)       tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;  
622     bfd_powerpc_pei_vec)        tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
623     bfd_powerpcle_pei_vec)      tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
624     ppcboot_vec)                tb="$tb ppcboot.lo" ;;
625     shcoff_vec)                 tb="$tb coff-sh.lo cofflink.lo" ;;
626     shlcoff_vec)                tb="$tb coff-sh.lo cofflink.lo" ;;
627     shcoff_small_vec)           tb="$tb coff-sh.lo cofflink.lo" ;;
628     shlcoff_small_vec)          tb="$tb coff-sh.lo cofflink.lo" ;;
629     shlpe_vec)                  tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
630     shlpei_vec)                 tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
631     som_vec)                    tb="$tb som.lo" ;;
632     sparcle_aout_vec)           tb="$tb aout-sparcle.lo aout32.lo" ;;
633     sparclinux_vec)             tb="$tb sparclinux.lo aout32.lo" ;;
634     sparclynx_aout_vec)         tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
635     sparclynx_coff_vec)         tb="$tb cf-sparclynx.lo lynx-core.lo" ;;
636     sparcnetbsd_vec)            tb="$tb sparcnetbsd.lo aout32.lo" ;;
637     sparccoff_vec)              tb="$tb coff-sparc.lo" ;;
638     srec_vec)                   tb="$tb srec.lo" ;;
639     sunos_big_vec)              tb="$tb sunos.lo aout32.lo" ;;
640     symbolsrec_vec)             tb="$tb srec.lo" ;;
641     tekhex_vec)                 tb="$tb tekhex.lo" ;;
642     tic30_aout_vec)             tb="$tb aout-tic30.lo" ;;
643     tic30_coff_vec)             tb="$tb coff-tic30.lo" ;;
644     tic54x_coff0_vec)           tb="$tb coff-tic54x.lo" ;;
645     tic54x_coff0_beh_vec)       tb="$tb coff-tic54x.lo" ;;
646     tic54x_coff1_vec)           tb="$tb coff-tic54x.lo" ;;
647     tic54x_coff1_beh_vec)       tb="$tb coff-tic54x.lo" ;;
648     tic54x_coff2_vec)           tb="$tb coff-tic54x.lo" ;;
649     tic54x_coff2_beh_vec)       tb="$tb coff-tic54x.lo" ;;
650     tic80coff_vec)              tb="$tb coff-tic80.lo cofflink.lo" ;;
651     versados_vec)               tb="$tb versados.lo" ;;
652     vms_alpha_vec)              tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"
653                                 target64=true ;;
654     vms_vax_vec)                tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;;
655     w65_vec)                    tb="$tb coff-w65.lo reloc16.lo" ;;
656     we32kcoff_vec)              tb="$tb coff-we32k.lo" ;;
657     z8kcoff_vec)                tb="$tb coff-z8k.lo reloc16.lo" ;;
659     "")                 ;;
660     *) AC_MSG_ERROR(*** unknown target vector $vec) ;;
661     esac
662 done
664 # Target architecture .o files.
665 # A couple of CPUs use shorter file names to avoid problems on DOS
666 # filesystems.
667 ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.lo/g -e s/mn10200/m10200/ -e s/mn10300/m10300/`
669 # Weed out duplicate .o files.
670 f=""
671 for i in $tb ; do
672     case " $f " in
673     *" $i "*) ;;
674     *) f="$f $i" ;;
675     esac
676 done
677 tb="$f"
679 f=""
680 for i in $ta ; do
681     case " $f " in
682     *" $i "*) ;;
683     *) f="$f $i" ;;
684     esac
685 done
686 ta="$f"
688 bfd_backends="$tb"
689 bfd_machines="$ta"
691 if test x${all_targets} = xtrue ; then
692   bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
693   bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
694   selvecs=
695   havevecs=
696   selarchs=
697 else    # all_targets is true
698   # Only set these if they will be nonempty, for the clever echo.
699   havevecs=
700   test -n "$selvecs" &&
701     havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'`
702   test -n "$selvecs" &&
703     selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
704   test -n "$selarchs" &&
705     selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
706 fi      # all_targets is true
708 case ${host64}-${target64}-${want64} in
709   *true*)
710     wordsize=64
711     all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
712     if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then
713       AC_MSG_WARN([You have requested a 64 bit BFD configuration, but])
714       AC_MSG_WARN([your compiler may not have a 64 bit integral type])
715     fi
716     ;;
717   false-false-false)
718     wordsize=32
719     all_backends='$(BFD32_BACKENDS)'
720     ;;
721 esac
723 AC_SUBST(wordsize)
724 AC_SUBST(all_backends)
725 AC_SUBST(bfd_backends)
726 AC_SUBST(bfd_machines)
728 tdefaults=""
729 test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
730 test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
731 test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
732 test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}"
733 AC_SUBST(tdefaults)
735 dnl AC_CHECK_HEADERS(sys/mman.h)
736 AC_FUNC_MMAP
737 AC_CHECK_FUNCS(madvise mprotect)
738 case ${want_mmap}+${ac_cv_func_mmap_fixed_mapped} in
739   true+yes )  AC_DEFINE(USE_MMAP, 1, [Use mmap if it's available?]) ;;
740 esac
742 rm -f doc/config.status
743 AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in,
744 [sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile])