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`
79 # Permit host specific settings.
80 . ${srcdir}/configure.host
84 AC_CHECK_TOOL(RANLIB, ranlib, :)
87 if test "${shared}" = "true"; then
88 if test "${GCC}" != "yes" && test "${shared_non_gcc}" != "yes"; then
89 AC_MSG_WARN([BFD --enable-shared only supported when using gcc])
91 ALLLIBS='$(TARGETLIB)'
101 AC_SUBST(SHLIB_CFLAGS)
102 if test "${commonbfdlib}" = "true"; then
109 AC_SUBST(COMMON_SHLIB)
112 AC_SUBST(INSTALL_SHLIB)
114 VERSION=`cat ${srcdir}/VERSION`
117 BFD_HOST_64BIT_LONG=0
118 BFD_HOST_64_BIT_DEFINED=0
121 if test "x${HOST_64BIT_TYPE}" = "xlong"; then
122 BFD_HOST_64BIT_LONG=1
123 elif test "x${HOST_64BIT_TYPE}" != "x"; then
124 BFD_HOST_64_BIT_DEFINED=1
125 BFD_HOST_64_BIT=${HOST_64BIT_TYPE}
126 BFD_HOST_U_64_BIT=${HOST_U_64BIT_TYPE}
128 AC_SUBST(BFD_HOST_64BIT_LONG)
129 AC_SUBST(BFD_HOST_64_BIT_DEFINED)
130 AC_SUBST(BFD_HOST_64_BIT)
131 AC_SUBST(BFD_HOST_U_64_BIT)
135 AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
136 AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
138 AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf)
142 BFD_NEED_DECLARATION(strstr)
143 BFD_NEED_DECLARATION(malloc)
144 BFD_NEED_DECLARATION(realloc)
145 BFD_NEED_DECLARATION(free)
146 BFD_NEED_DECLARATION(getenv)
148 # If we are configured native, pick a core file support file.
151 if test "${target}" = "${host}"; then
155 AC_DEFINE(TRAD_HEADER,"hosts/alphalinux.h")
157 alpha*-*-*) COREFILE=osf-core.o ;;
158 arm-*-riscix) COREFILE=trad-core.o ;;
159 hppa*-*-hpux*) COREFILE=hpux-core.o ;;
160 hppa*-*-hiux*) COREFILE=hpux-core.o ;;
161 hppa*-*-bsd*) COREFILE="hpux-core.o hppabsd-core.o"
162 COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
164 i[3456]86-sequent-bsd*)
166 COREFILE=trad-core.o;
167 AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h")
170 i[3456]86-sequent-sysv4*) ;;
171 i[3456]86-sequent-sysv*)
174 AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h")
177 i[3456]86-*-bsd* | i[3456]86-*-freebsd*)
180 AC_DEFINE(TRAD_HEADER,"hosts/i386bsd.h")
185 COREFILE=netbsd-core.o
188 i[3456]86-esix-sysv3*)
191 AC_DEFINE(TRAD_HEADER,"hosts/esix.h")
194 i[3456]86-*-sco* | i[3456]86-*-isc*)
197 AC_DEFINE(TRAD_HEADER,"hosts/i386sco.h")
203 AC_DEFINE(TRAD_HEADER,"hosts/i386mach3.h")
209 AC_DEFINE(TRAD_HEADER,"hosts/i386linux.h")
212 i[3456]86-*-isc*) COREFILE=trad-core.o ;;
213 i[3456]86-*-aix*) COREFILE=aix386-core.o ;;
215 i860-*-mach3* | i860-*-osf1*)
217 AC_DEFINE(TRAD_HEADER,"hosts/i860mach3.h")
221 AC_DEFINE(TRAD_HEADER,"hosts/mipsbsd.h")
225 AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
228 COREFILE=netbsd-core.o
232 AC_DEFINE(TRAD_HEADER,"hosts/decstation.h")
234 mips-sgi-irix4*) COREFILE=irix-core.o ;;
235 mips-sgi-irix5*) COREFILE=irix-core.o ;;
236 mips-sgi-irix6*) COREFILE=irix-core.o ;;
239 AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
242 mips-*-sysv* | mips-*-riscos*)
244 AC_DEFINE(TRAD_HEADER,"hosts/riscos.h")
248 AC_DEFINE(TRAD_HEADER,"hosts/news-mips.h")
252 AC_DEFINE(TRAD_HEADER,"hosts/dpx2.h")
254 m68*-hp-hpux*) COREFILE=hpux-core.o ;;
257 AC_DEFINE(TRAD_HEADER,"hosts/hp300bsd.h")
261 AC_DEFINE(TRAD_HEADER,"hosts/m68klinux.h")
265 AC_DEFINE(TRAD_HEADER, "hosts/delta68.h")
269 AC_DEFINE(TRAD_HEADER,"hosts/news.h")
272 COREFILE=netbsd-core.o
276 AC_DEFINE(TRAD_HEADER,"hosts/m68kaux.h")
279 m88*-motorola-sysv*) COREFILE=ptrace-core.o ;;
282 AC_DEFINE(TRAD_HEADER,"hosts/m88kmach3.h")
286 AC_DEFINE(TRAD_HEADER,"hosts/pc532mach.h")
289 COREFILE=netbsd-core.o
291 rs6000-*-lynx*) COREFILE=lynx-core.o ;;
292 rs6000-*-aix4*) COREFILE=rs6000-core.o ;;
293 rs6000-*-*) COREFILE=rs6000-core.o ;;
294 powerpc-*-aix4*) COREFILE=rs6000-core.o ;;
295 powerpc-*-aix*) COREFILE=rs6000-core.o ;;
297 COREFILE=netbsd-core.o
301 AC_DEFINE(TRAD_HEADER,"hosts/tahoe.h")
305 AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h")
309 AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h")
313 AC_DEFINE(TRAD_HEADER,"hosts/vaxbsd.h")
318 aix386-core.o) COREFLAG=-DAIX386_CORE ;;
319 hppabsd-core.o) COREFLAG=-DHPPABSD_CORE ;;
320 hpux-core.o) COREFLAG=-DHPUX_CORE ;;
321 irix-core.o) COREFLAG=-DIRIX_CORE ;;
322 lynx-core.o) COREFLAG=-DLYNX_CORE ;;
323 osf-core.o) COREFLAG=-DOSF_CORE ;;
324 ptrace-core.o) COREFLAG=-DPTRACE_CORE ;;
325 rs6000-core.o) COREFLAG="$COREFLAG -DAIX_CORE" ;;
326 trad-core.o) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
329 # The ELF code uses the native <sys/procfs.h> to handle core files.
330 # Define HAVE_SYS_PROCFS_H if the file exists and defines
332 AC_MSG_CHECKING([for sys/procfs.h])
333 AC_CACHE_VAL(bfd_cv_header_sys_procfs_h,
334 [AC_TRY_COMPILE([#include <sys/procfs.h>],
336 bfd_cv_header_sys_procfs_h=yes, bfd_cv_header_sys_procfs_h=no)])
337 AC_MSG_RESULT($bfd_cv_header_sys_procfs_h)
338 if test $bfd_cv_header_sys_procfs_h = yes; then
339 AC_DEFINE(HAVE_SYS_PROCFS_H)
348 # Canonicalize the secondary target names.
349 if test -n "$enable_targets" ; then
350 for targ in `echo $enable_targets | sed 's/,/ /g'`
352 result=`$ac_config_sub $targ 2>/dev/null`
353 if test -n "$result" ; then
354 canon_targets="$canon_targets $result"
356 # Allow targets that config.sub doesn't recognize, like "all".
357 canon_targets="$canon_targets $targ"
367 for targ in $target $canon_targets
369 if test "x$targ" = "xall"; then
373 if test "x$targ" = "x$target"; then
376 selvecs="$selvecs $targ_defvec $targ_selvecs"
377 selarchs="$selarchs $targ_archs"
378 TDEFINES="$TDEFINES $targ_cflags"
383 # This processing still needs to be done if we're to decide properly whether
384 # 64-bit support needs to be compiled in. Currently, it will be included if
385 # the default or any other explicitly requested target requires it; it
386 # will not be included on a 32-bit host if no 64-bit target is requested, and
387 # no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
390 # uniq the default and selected vectors in all the configured targets.
392 for i in $selvecs ; do
400 # uniq the architectures in all the configured targets.
402 for i in $selarchs ; do
410 # Target backend .o files.
413 elf="elf.o elflink.o"
418 # This list is alphabetized to make it easy to compare
419 # with the two vector lists in targets.c.
420 a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;;
421 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o" ;;
422 armcoff_little_vec) tb="$tb coff-arm.o cofflink.o " ;;
423 armcoff_big_vec) tb="$tb coff-arm.o cofflink.o " ;;
424 armpe_little_vec) tb="$tb pe-arm.o cofflink.o " ;;
425 armpe_big_vec) tb="$tb pe-arm.o cofflink.o " ;;
426 armpei_little_vec) tb="$tb pei-arm.o cofflink.o " ;;
427 armpei_big_vec) tb="$tb pei-arm.o cofflink.o " ;;
428 aout0_big_vec) tb="$tb aout0.o aout32.o" ;;
429 aout_arm_big_vec) tb="$tb aout-arm.o aout32.o" ;;
430 aout_arm_little_vec) tb="$tb aout-arm.o aout32.o" ;;
431 aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o" ;;
432 aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o" ;;
433 apollocoff_vec) tb="$tb coff-apollo.o" ;;
434 b_out_vec_big_host) tb="$tb bout.o aout32.o" ;;
435 b_out_vec_little_host) tb="$tb bout.o aout32.o" ;;
436 bfd_elf64_alpha_vec) tb="$tb elf64-alpha.o elf64.o $elf"
439 bfd_elf32_littlearc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
440 bfd_elf32_bigarc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
442 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
443 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
444 bfd_elf64_bigmips_vec) tb="$tb elf64-mips.o elf64.o elf32-mips.o elf32.o $elf ecofflink.o"
446 # start-sanitize-d10v
447 bfd_elf32_d10v_vec) tb="$tb elf32-d10v.o elf32.o $elf" ;;
449 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o $elf" ;;
450 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o $elf" ;;
451 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o $elf" ;;
452 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
453 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
454 bfd_elf64_littlemips_vec) tb="$tb elf64-mips.o elf64.o elf32-mips.o elf32.o $elf ecofflink.o"
456 # start-sanitize-m32r
457 bfd_elf32_m32r_vec) tb="$tb elf32-m32r.o elf32.o $elf" ;;
459 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o $elf" ;;
460 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o $elf" ;;
461 bfd_elf32_mn10200_vec) tb="$tb elf32-mn10200.o elf32.o $elf" ;;
462 bfd_elf32_mn10300_vec) tb="$tb elf32-mn10300.o elf32.o $elf" ;;
463 bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
464 bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
465 bfd_elf32_sh_vec) tb="$tb elf32-sh.o elf32.o $elf coff-sh.o" ;;
466 bfd_elf32_shl_vec) tb="$tb elf32-sh.o elf32.o $elf coff-sh.o" ;;
467 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o $elf" ;;
468 # start-sanitize-v850
469 bfd_elf32_v850_vec) tb="$tb elf32-v850.o elf32.o $elf" ;;
471 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
473 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
475 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o $elf"
477 cisco_core_vec) tb="$tb cisco-core.o" ;;
478 demo_64_vec) tb="$tb demo64.o aout64.o"
480 ecoff_big_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
481 ecoff_little_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
482 ecoffalpha_little_vec) tb="$tb coff-alpha.o ecoff.o ecofflink.o"
484 evax_alpha_vec) tb="$tb evax-alpha.o evax-emh.o evax-egsd.o evax-etir.o evax-misc.o"
486 h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
487 h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
488 host_aout_vec) tb="$tb host-aout.o aout32.o" ;;
489 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o" ;;
490 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o" ;;
491 i386aout_vec) tb="$tb i386aout.o aout32.o" ;;
492 i386bsd_vec) tb="$tb i386bsd.o aout32.o" ;;
493 i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;;
494 i386dynix_vec) tb="$tb i386dynix.o aout32.o" ;;
495 i386freebsd_vec) tb="$tb i386freebsd.o aout32.o" ;;
496 i386msdos_vec) tb="$tb i386msdos.o" ;;
497 i386pe_vec) tb="$tb pe-i386.o cofflink.o " ;;
498 i386pei_vec) tb="$tb pei-i386.o cofflink.o" ;;
499 i386linux_vec) tb="$tb i386linux.o aout32.o" ;;
500 i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o" ;;
501 i386lynx_coff_vec) tb="$tb cf-i386lynx.o cofflink.o lynx-core.o" ;;
502 i386mach3_vec) tb="$tb i386mach3.o aout32.o" ;;
503 i386netbsd_vec) tb="$tb i386netbsd.o aout32.o" ;;
504 i386os9k_vec) tb="$tb i386os9k.o aout32.o" ;;
505 i860coff_vec) tb="$tb coff-i860.o cofflink.o" ;;
506 icoff_big_vec) tb="$tb coff-i960.o cofflink.o" ;;
507 icoff_little_vec) tb="$tb coff-i960.o cofflink.o" ;;
508 ieee_vec) tb="$tb ieee.o" ;;
509 m68kcoff_vec) tb="$tb coff-m68k.o cofflink.o" ;;
510 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
511 m68klinux_vec) tb="$tb m68klinux.o aout32.o" ;;
512 m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o" ;;
513 m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o" ;;
514 m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o" ;;
515 m68k4knetbsd_vec) tb="$tb m68k4knetbsd.o aout32.o" ;;
516 m68kaux_coff_vec) tb="$tb coff-aux.o coff-m68k.o cofflink.o" ;;
517 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
518 newsos3_vec) tb="$tb newsos3.o aout32.o" ;;
519 nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
520 nlm32_sparc_vec) tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;;
521 nlm32_alpha_vec) tb="$tb nlm32-alpha.o nlm32.o nlm.o"
523 riscix_vec) tb="$tb aout32.o riscix.o" ;;
524 nlm32_powerpc_vec) tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;;
525 pc532netbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o" ;;
526 pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o" ;;
527 pmac_xcoff_vec) tb="$tb coff-pmac.o xcofflink.o" ;;
528 rs6000coff_vec) tb="$tb coff-rs6000.o xcofflink.o" ;;
529 bfd_powerpc_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
530 bfd_powerpcle_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
531 bfd_powerpc_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
532 bfd_powerpcle_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
533 ppcboot_vec) tb="$tb ppcboot.o" ;;
534 shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
535 shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
536 som_vec) tb="$tb som.o" ;;
537 sparcle_aout_vec) tb="$tb aout-sparcle.o aout32.o" ;;
538 sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o" ;;
539 sparclynx_coff_vec) tb="$tb cf-sparclynx.o lynx-core.o" ;;
540 sparcnetbsd_vec) tb="$tb sparcnetbsd.o aout32.o" ;;
541 sparccoff_vec) tb="$tb coff-sparc.o" ;;
542 srec_vec) tb="$tb srec.o" ;;
543 sunos_big_vec) tb="$tb sunos.o aout32.o" ;;
544 symbolsrec_vec) tb="$tb srec.o" ;;
545 tekhex_vec) tb="$tb tekhex.o" ;;
546 # start-sanitize-tic80
547 tic80coff_vec) tb="$tb coff-tic80.o cofflink.o" ;;
549 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
550 z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;;
551 w65_vec) tb="$tb coff-w65.o reloc16.o" ;;
552 versados_vec) tb="$tb versados.o" ;;
555 *) AC_MSG_ERROR(*** unknown target vector $vec) ;;
559 # Target architecture .o files.
560 ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
562 # Weed out duplicate .o files.
584 if test x${all_targets} = xtrue ; then
585 bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
586 bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
590 else # all_targets is true
591 # Only set these if they will be nonempty, for the clever echo.
593 test -n "$selvecs" &&
594 havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'`
595 test -n "$selvecs" &&
596 selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
597 test -n "$selarchs" &&
598 selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
599 fi # all_targets is true
601 case ${host64}-${target64}-${want64} in
604 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
605 if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then
606 AC_MSG_WARN([You have requested a 64 bit BFD configuration, but])
607 AC_MSG_WARN([your compiler may not have a 64 bit integral type])
612 all_backends='$(BFD32_BACKENDS)'
617 AC_SUBST(all_backends)
618 AC_SUBST(bfd_backends)
619 AC_SUBST(bfd_machines)
622 test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
623 test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
624 test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
625 test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}"
628 dnl AC_CHECK_HEADERS(sys/mman.h)
630 AC_CHECK_FUNCS(madvise mprotect)
631 case ${want_mmap}+${ac_cv_func_mmap} in
632 true+yes ) AC_DEFINE(USE_MMAP) ;;
635 rm -f doc/config.status
636 AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h,
637 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])