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