1 dnl Process this file with autoconf to produce a configure script.
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
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')
18 no) enable_targets= ;;
19 *) enable_targets=$enableval ;;
22 [ --enable-shared build shared BFD library],
23 [case "${enableval}" in
29 AC_ARG_ENABLE(commonbfdlib,
30 [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
31 [case "${enableval}" in
32 yes) commonbfdlib=true ;;
33 no) commonbfdlib=false ;;
34 *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
37 [ --with-mmap try using mmap for BFD input files if available],
39 yes) want_mmap=true ;;
40 no) want_mmap=false ;;
41 *) AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;;
42 esac],[want_mmap=false])dnl
44 AC_CONFIG_HEADER(config.h:config.in)
46 AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
48 if test -z "$target" ; then
49 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
58 ALLLIBS='$(TARGETLIB)'
62 if test "${shared}" = "true"; then
64 if test "${commonbfdlib}" = "true"; then
65 ALLLIBS='$(TARGETLIB)'
67 ALLLIBS='$(TARGETLIB) $(SHLIB) $(SHLINK)'
69 SHLIB=libbfd.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/VERSION`
77 # Permit host specific settings.
78 . ${srcdir}/configure.host
82 AC_CHECK_TOOL(RANLIB, ranlib, :)
85 if test "${shared}" = "true"; then
86 if test "${GCC}" != "yes" && test "${shared_non_gcc}" != "yes"; then
87 AC_MSG_WARN([BFD --enable-shared only supported when using gcc])
89 ALLLIBS='$(TARGETLIB)'
99 AC_SUBST(SHLIB_CFLAGS)
100 if test "${commonbfdlib}" = "true"; then
107 AC_SUBST(COMMON_SHLIB)
112 if test "x${HOST_64BIT_TYPE}" = "xlong"; then
115 AC_SUBST(HOST_64BIT_LONG)
119 AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
120 AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
122 AC_CHECK_FUNCS(fcntl getpagesize)
126 BFD_NEED_DECLARATION(malloc)
127 BFD_NEED_DECLARATION(free)
129 # If we are configured native, pick a core file support file.
132 if test "${target}" = "${host}"; then
136 AC_DEFINE(TRAD_HEADER,"hosts/alphalinux.h")
138 alpha*-*-*) COREFILE=osf-core.o ;;
139 arm-*-riscix) COREFILE=trad-core.o ;;
140 hppa*-*-hpux*) COREFILE=hpux-core.o ;;
141 hppa*-*-hiux*) COREFILE=hpux-core.o ;;
142 hppa*-*-bsd*) COREFILE="hpux-core.o hppabsd-core.o"
143 COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
145 i[345]86-sequent-bsd*)
147 COREFILE=trad-core.o;
148 AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h")
151 i[345]86-sequent-sysv4*) ;;
152 i[345]86-sequent-sysv*)
155 AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h")
158 i[345]86-*-bsd* | i[345]86-*-freebsd*)
161 AC_DEFINE(TRAD_HEADER,"hosts/i386bsd.h")
166 COREFILE=netbsd-core.o
169 i[345]86-esix-sysv3*)
172 AC_DEFINE(TRAD_HEADER,"hosts/esix.h")
175 i[345]86-*-sco* | i[345]86-*-isc*)
178 AC_DEFINE(TRAD_HEADER,"hosts/i386sco.h")
184 AC_DEFINE(TRAD_HEADER,"hosts/i386mach3.h")
190 AC_DEFINE(TRAD_HEADER,"hosts/i386linux.h")
193 i[345]86-*-isc*) COREFILE=trad-core.o ;;
194 i[345]86-*-aix*) COREFILE=aix386-core.o ;;
196 i860-*-mach3* | i860-*-osf1*)
198 AC_DEFINE(TRAD_HEADER,"hosts/i860mach3.h")
202 AC_DEFINE(TRAD_HEADER,"hosts/mipsbsd.h")
206 AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
209 COREFILE=netbsd-core.o
213 AC_DEFINE(TRAD_HEADER,"hosts/decstation.h")
215 mips-sgi-irix4*) COREFILE=irix-core.o ;;
216 mips-sgi-irix5*) COREFILE=irix-core.o ;;
219 AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
222 mips-*-sysv* | mips-*-riscos*)
224 AC_DEFINE(TRAD_HEADER,"hosts/riscos.h")
228 AC_DEFINE(TRAD_HEADER,"hosts/news-mips.h")
232 AC_DEFINE(TRAD_HEADER,"hosts/dpx2.h")
234 m68*-hp-hpux*) COREFILE=hpux-core.o ;;
237 AC_DEFINE(TRAD_HEADER,"hosts/hp300bsd.h")
241 AC_DEFINE(TRAD_HEADER,"hosts/m68klinux.h")
245 AC_DEFINE(TRAD_HEADER, "hosts/delta68.h")
249 AC_DEFINE(TRAD_HEADER,"hosts/news.h")
252 COREFILE=netbsd-core.o
256 AC_DEFINE(TRAD_HEADER,"hosts/m68kaux.h")
259 m88*-motorola-sysv*) COREFILE=ptrace-core.o ;;
262 AC_DEFINE(TRAD_HEADER,"hosts/m88kmach3.h")
266 AC_DEFINE(TRAD_HEADER,"hosts/pc532mach.h")
269 COREFILE=netbsd-core.o
271 rs6000-*-lynx*) COREFILE=lynx-core.o ;;
272 rs6000-*-aix4*) COREFILE=rs6000-core.o ;;
273 rs6000-*-*) COREFILE=rs6000-core.o ;;
274 powerpc-*-aix4*) COREFILE=rs6000-core.o ;;
275 powerpc-*-aix*) COREFILE=rs6000-core.o ;;
277 COREFILE=netbsd-core.o
281 AC_DEFINE(TRAD_HEADER,"hosts/tahoe.h")
285 AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h")
289 AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h")
293 AC_DEFINE(TRAD_HEADER,"hosts/vaxbsd.h")
298 aix386-core.o) COREFLAG=-DAIX386_CORE ;;
299 hppabsd-core.o) COREFLAG=-DHPPABSD_CORE ;;
300 hpux-core.o) COREFLAG=-DHPUX_CORE ;;
301 irix-core.o) COREFLAG=-DIRIX_CORE ;;
302 lynx-core.o) COREFLAG=-DLYNX_CORE ;;
303 osf-core.o) COREFLAG=-DOSF_CORE ;;
304 ptrace-core.o) COREFLAG=-DPTRACE_CORE ;;
305 rs6000-core.o) COREFLAG="$COREFLAG -DAIX_CORE" ;;
306 trad-core.o) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
309 # The ELF code uses the native <sys/procfs.h> to handle core files.
310 # Define HAVE_SYS_PROCFS_H if the file exists and defines
312 AC_MSG_CHECKING([for sys/procfs.h])
313 AC_CACHE_VAL(bfd_cv_header_sys_procfs_h,
314 [AC_TRY_COMPILE([#include <sys/procfs.h>],
316 bfd_cv_header_sys_procfs_h=yes, bfd_cv_header_sys_procfs_h=no)])
317 AC_MSG_RESULT($bfd_cv_header_sys_procfs_h)
318 if test $bfd_cv_header_sys_procfs_h = yes; then
319 AC_DEFINE(HAVE_SYS_PROCFS_H)
328 # Canonicalize the secondary target names.
329 if test -n "$enable_targets" ; then
330 for targ in `echo $enable_targets | sed 's/,/ /g'`
332 result=`$ac_config_sub $targ 2>/dev/null`
333 if test -n "$result" ; then
334 canon_targets="$canon_targets $result"
336 # Allow targets that config.sub doesn't recognize, like "all".
337 canon_targets="$canon_targets $targ"
347 for targ in $target $canon_targets
349 if test "x$targ" = "xall"; then
353 if test "x$targ" = "x$target"; then
356 selvecs="$selvecs $targ_defvec $targ_selvecs"
357 selarchs="$selarchs $targ_archs"
358 TDEFINES="$TDEFINES $targ_cflags"
363 # This processing still needs to be done if we're to decide properly whether
364 # 64-bit support needs to be compiled in. Currently, it will be included if
365 # the default or any other explicitly requested target requires it; it
366 # will not be included on a 32-bit host if no 64-bit target is requested, and
367 # no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
370 # uniq the default and selected vectors in all the configured targets.
372 for i in $selvecs ; do
380 # uniq the architectures in all the configured targets.
382 for i in $selarchs ; do
390 # Target backend .o files.
393 elf="elf.o elflink.o"
398 # This list is alphabetized to make it easy to compare
399 # with the two vector lists in targets.c.
400 a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;;
401 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o" ;;
402 armcoff_little_vec) tb="$tb coff-arm.o cofflink.o " ;;
403 armcoff_big_vec) tb="$tb coff-arm.o cofflink.o " ;;
404 armpe_little_vec) tb="$tb pe-arm.o cofflink.o " ;;
405 armpe_big_vec) tb="$tb pe-arm.o cofflink.o " ;;
406 armpei_little_vec) tb="$tb pei-arm.o cofflink.o " ;;
407 armpei_big_vec) tb="$tb pei-arm.o cofflink.o " ;;
408 aout0_big_vec) tb="$tb aout0.o aout32.o" ;;
409 aout_arm_big_vec) tb="$tb aout-arm.o aout32.o" ;;
410 aout_arm_little_vec) tb="$tb aout-arm.o aout32.o" ;;
411 aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o" ;;
412 aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o" ;;
413 apollocoff_vec) tb="$tb coff-apollo.o" ;;
414 b_out_vec_big_host) tb="$tb bout.o aout32.o" ;;
415 b_out_vec_little_host) tb="$tb bout.o aout32.o" ;;
417 bfd_elf32_littlearc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
418 bfd_elf32_bigarc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
420 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
421 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
422 bfd_elf64_bigmips_vec) tb="$tb elf64-mips.o elf64.o elf32-mips.o elf32.o $elf ecofflink.o"
424 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o $elf" ;;
425 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o $elf" ;;
426 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o $elf" ;;
427 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
428 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
429 bfd_elf64_littlemips_vec) tb="$tb elf64-mips.o elf64.o elf32-mips.o elf32.o $elf ecofflink.o"
431 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o $elf" ;;
432 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o $elf" ;;
433 bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
434 bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
435 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o $elf" ;;
436 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
438 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
440 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o $elf"
442 cisco_core_vec) tb="$tb cisco-core.o" ;;
443 demo_64_vec) tb="$tb demo64.o aout64.o"
445 ecoff_big_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
446 ecoff_little_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
447 ecoffalpha_little_vec) tb="$tb coff-alpha.o ecoff.o ecofflink.o"
449 h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
450 h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
451 host_aout_vec) tb="$tb host-aout.o aout32.o" ;;
452 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o" ;;
453 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o" ;;
454 i386aout_vec) tb="$tb i386aout.o aout32.o" ;;
455 i386bsd_vec) tb="$tb i386bsd.o aout32.o" ;;
456 i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;;
457 i386dynix_vec) tb="$tb i386dynix.o aout32.o" ;;
458 i386freebsd_vec) tb="$tb i386freebsd.o aout32.o" ;;
459 i386msdos_vec) tb="$tb i386msdos.o" ;;
460 i386pe_vec) tb="$tb pe-i386.o cofflink.o " ;;
461 i386pei_vec) tb="$tb pei-i386.o cofflink.o" ;;
462 i386linux_vec) tb="$tb i386linux.o aout32.o" ;;
463 i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o" ;;
464 i386lynx_coff_vec) tb="$tb cf-i386lynx.o cofflink.o lynx-core.o" ;;
465 i386mach3_vec) tb="$tb i386mach3.o aout32.o" ;;
466 i386netbsd_vec) tb="$tb i386netbsd.o aout32.o" ;;
467 i386os9k_vec) tb="$tb i386os9k.o aout32.o" ;;
468 i860coff_vec) tb="$tb coff-i860.o cofflink.o" ;;
469 icoff_big_vec) tb="$tb coff-i960.o cofflink.o" ;;
470 icoff_little_vec) tb="$tb coff-i960.o cofflink.o" ;;
471 ieee_vec) tb="$tb ieee.o" ;;
472 m68kcoff_vec) tb="$tb coff-m68k.o cofflink.o" ;;
473 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
474 m68klinux_vec) tb="$tb m68klinux.o aout32.o" ;;
475 m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o" ;;
476 m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o" ;;
477 m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o" ;;
478 m68k4knetbsd_vec) tb="$tb m68k4knetbsd.o aout32.o" ;;
479 m68kaux_coff_vec) tb="$tb coff-aux.o coff-m68k.o cofflink.o" ;;
480 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
481 newsos3_vec) tb="$tb newsos3.o aout32.o" ;;
482 nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
483 nlm32_sparc_vec) tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;;
484 nlm32_alpha_vec) tb="$tb nlm32-alpha.o nlm32.o nlm.o"
486 riscix_vec) tb="$tb aout32.o riscix.o" ;;
487 nlm32_powerpc_vec) tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;;
488 pc532netbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o" ;;
489 pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o" ;;
490 pmac_xcoff_vec) tb="$tb coff-pmac.o xcofflink.o" ;;
491 rs6000coff_vec) tb="$tb coff-rs6000.o xcofflink.o" ;;
492 bfd_powerpc_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
493 bfd_powerpcle_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
494 bfd_powerpc_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
495 bfd_powerpcle_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
496 ppcboot_vec) tb="$tb ppcboot.o" ;;
497 shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
499 rce_aout_vec) tb="$tb aout-rce.o aout32.o" ;;
501 shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
502 som_vec) tb="$tb som.o" ;;
503 sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o" ;;
504 sparclynx_coff_vec) tb="$tb cf-sparclynx.o lynx-core.o" ;;
505 sparcnetbsd_vec) tb="$tb sparcnetbsd.o aout32.o" ;;
506 sparccoff_vec) tb="$tb coff-sparc.o" ;;
507 srec_vec) tb="$tb srec.o" ;;
508 sunos_big_vec) tb="$tb sunos.o aout32.o" ;;
509 symbolsrec_vec) tb="$tb srec.o" ;;
510 tekhex_vec) tb="$tb tekhex.o" ;;
511 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
512 z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;;
513 w65_vec) tb="$tb coff-w65.o reloc16.o" ;;
514 versados_vec) tb="$tb versados.o" ;;
517 *) AC_MSG_ERROR(*** unknown target vector $vec) ;;
521 # Target architecture .o files.
522 ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
524 # Weed out duplicate .o files.
546 if test x${all_targets} = xtrue ; then
547 bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
548 bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
551 else # all_targets is true
552 # Only set these if they will be nonempty, for the clever echo.
553 test -n "$selvecs" &&
554 selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
555 test -n "$selarchs" &&
556 selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
557 fi # all_targets is true
559 case ${host64}-${target64}-${want64} in
562 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
566 all_backends='$(BFD32_BACKENDS)'
571 AC_SUBST(all_backends)
572 AC_SUBST(bfd_backends)
573 AC_SUBST(bfd_machines)
576 test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
577 test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
578 test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
581 dnl AC_CHECK_HEADERS(sys/mman.h)
583 AC_CHECK_FUNCS(madvise mprotect)
584 case ${want_mmap}+${ac_cv_func_mmap} in
585 true+yes ) AC_DEFINE(USE_MMAP) ;;
588 rm -f doc/config.status
589 AC_OUTPUT(Makefile doc/Makefile,
590 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])