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 AC_CONFIG_HEADER(config.h:config.in)
24 AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
26 if test -z "$target" ; then
27 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
36 # Permit host specific settings.
37 . ${srcdir}/configure.host
42 AC_CHECK_PROG(AR, ar, ar, :)
47 if test "x${HOST_64BIT_TYPE}" = "xlong"; then
50 AC_SUBST(HOST_64BIT_LONG)
54 AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
55 AC_CHECK_HEADERS(fcntl.h sys/file.h)
56 AC_CHECK_FUNCS(fcntl getpagesize)
60 AC_MSG_CHECKING([whether malloc must be declared])
61 AC_CACHE_VAL(bfd_cv_decl_needed_malloc,
70 [char *(*pfn) = (char *(*)) malloc],
71 bfd_cv_decl_needed_malloc=no, bfd_cv_decl_needed_malloc=yes)])
72 AC_MSG_RESULT($bfd_cv_decl_needed_malloc)
73 if test $bfd_cv_decl_needed_malloc = yes; then
74 AC_DEFINE(NEED_DECLARATION_MALLOC)
77 AC_MSG_CHECKING([whether free must be declared])
78 AC_CACHE_VAL(bfd_cv_decl_needed_free,
87 [int (*pfn) = (int (*)) free],
88 bfd_cv_decl_needed_free=no, bfd_cv_decl_needed_free=yes)])
89 AC_MSG_RESULT($bfd_cv_decl_needed_free)
90 if test $bfd_cv_decl_needed_free = yes; then
91 AC_DEFINE(NEED_DECLARATION_FREE)
94 # If we are configured native, pick a core file support file.
97 if test "${target}" = "${host}"; then
101 AC_DEFINE(TRAD_HEADER,"hosts/alphalinux.h")
103 alpha*-*-*) COREFILE=osf-core.o ;;
104 arm-*-riscix) COREFILE=trad-core.o ;;
105 hppa*-*-hpux*) COREFILE=hpux-core.o ;;
106 hppa*-*-hiux*) COREFILE=hpux-core.o ;;
107 hppa*-*-bsd*) COREFILE="hpux-core.o hppabsd-core.o"
108 COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
110 i[345]86-sequent-bsd*)
112 COREFILE=trad-core.o;
113 AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h")
116 i[345]86-sequent-sysv4*) ;;
117 i[345]86-sequent-sysv*)
120 AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h")
123 i[345]86-*-bsd* | i[345]86-*-freebsd*)
126 AC_DEFINE(TRAD_HEADER,"hosts/i386bsd.h")
132 AC_DEFINE(TRAD_HEADER,"hosts/i386nbsd.h")
135 i[345]86-esix-sysv3*)
138 AC_DEFINE(TRAD_HEADER,"hosts/esix.h")
141 i[345]86-*-sco* | i[345]86-*-isc*)
144 AC_DEFINE(TRAD_HEADER,"hosts/i386sco.h")
150 AC_DEFINE(TRAD_HEADER,"hosts/i386mach3.h")
156 AC_DEFINE(TRAD_HEADER,"hosts/i386linux.h")
159 i[345]86-*-isc*) COREFILE=trad-core.o ;;
160 i[345]86-*-aix*) COREFILE=aix386-core.o ;;
162 i860-*-mach3* | i860-*-osf1*)
164 AC_DEFINE(TRAD_HEADER,"hosts/i860mach3.h")
168 AC_DEFINE(TRAD_HEADER,"hosts/mipsbsd.h")
172 AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
176 AC_DEFINE(TRAD_HEADER,"hosts/mipsnbsd.h")
180 AC_DEFINE(TRAD_HEADER,"hosts/decstation.h")
182 mips-sgi-irix4*) COREFILE=irix-core.o ;;
183 mips-sgi-irix5*) COREFILE=irix-core.o ;;
186 AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
189 mips-*-sysv* | mips-*-riscos*)
191 AC_DEFINE(TRAD_HEADER,"hosts/riscos.h")
195 AC_DEFINE(TRAD_HEADER,"hosts/news-mips".h)
199 AC_DEFINE(TRAD_HEADER,"hosts/dpx2.h")
201 m68*-hp-hpux*) COREFILE=hpux-core.o ;;
204 AC_DEFINE(TRAD_HEADER,"hosts/hp300bsd.h")
208 AC_DEFINE(TRAD_HEADER, "hosts/delta68.h")
212 AC_DEFINE(TRAD_HEADER,"hosts/news.h")
216 AC_DEFINE(TRAD_HEADER,"hosts/m68knbsd.h")
219 m88*-motorola-sysv*) COREFILE=ptrace-core.o ;;
222 AC_DEFINE(TRAD_HEADER,"hosts/m88kmach3.h")
226 AC_DEFINE(TRAD_HEADER,"hosts/pc532mach.h")
230 AC_DEFINE(TRAD_HEADER,"hosts/ns32knbsd.h")
232 rs6000-*-lynx*) COREFILE=lynx-core.o ;;
233 rs6000-*-aix4*) COREFILE=rs6000-core.o ;;
234 rs6000-*-*) COREFILE=rs6000-core.o ;;
235 powerpc-*-aix4*) COREFILE=rs6000-core.o ;;
236 powerpc-*-aix*) COREFILE=rs6000-core.o ;;
239 AC_DEFINE(TRAD_HEADER,"hosts/sparcnbsd.h")
243 AC_DEFINE(TRAD_HEADER,"hosts/tahoe.h")
247 AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h")
251 AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h")
255 AC_DEFINE(TRAD_HEADER,"hosts/vaxbsd.h")
260 aix386-core.o) COREFLAG=-DAIX386_CORE ;;
261 hppabsd-core.o) COREFLAG=-DHPPABSD_CORE ;;
262 hpux-core.o) COREFLAG=-DHPUX_CORE ;;
263 irix-core.o) COREFLAG=-DIRIX_CORE ;;
264 lynx-core.o) COREFLAG=-DLYNX_CORE ;;
265 osf-core.o) COREFLAG=-DOSF_CORE ;;
266 ptrace-core.o) COREFLAG=-DPTRACE_CORE ;;
267 rs6000-core.o) COREFLAG="$COREFLAG -DAIX_CORE" ;;
268 trad-core.o) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
271 # The ELF code uses the native <sys/procfs.h> to handle core files.
272 # Define HAVE_SYS_PROCFS_H if the file exists and defines
274 AC_MSG_CHECKING([for sys/procfs.h])
275 AC_CACHE_VAL(bfd_cv_header_sys_procfs_h,
276 [AC_TRY_COMPILE([#include <sys/procfs.h>],
278 bfd_cv_header_sys_procfs_h=yes, bfd_cv_header_sys_procfs_h=no)])
279 AC_MSG_RESULT($bfd_cv_header_sys_procfs_h)
280 if test $bfd_cv_header_sys_procfs_h = yes; then
281 AC_DEFINE(HAVE_SYS_PROCFS_H)
290 # Canonicalize the secondary target names.
291 if test -n "$enable_targets" ; then
292 for targ in `echo $enable_targets | sed 's/,/ /g'`
294 result=`$ac_config_sub $targ 2>/dev/null`
295 if test -n "$result" ; then
296 canon_targets="$canon_targets $result"
298 # Allow targets that config.sub doesn't recognize, like "all".
299 canon_targets="$canon_targets $targ"
309 for targ in $target $canon_targets
311 if test "x$targ" = "xall"; then
315 if test "x$targ" = "x$target"; then
318 selvecs="$selvecs $targ_defvec $targ_selvecs"
319 selarchs="$selarchs $targ_archs"
320 TDEFINES="$TDEFINES $targ_cflags"
325 # This processing still needs to be done if we're to decide properly whether
326 # 64-bit support needs to be compiled in. Currently, it will be included if
327 # the default or any other explicitly requested target requires it; it
328 # will not be included on a 32-bit host if no 64-bit target is requested, and
329 # no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
332 # uniq the default and selected vectors in all the configured targets.
334 for i in $selvecs ; do
342 # uniq the architectures in all the configured targets.
344 for i in $selarchs ; do
352 # Target backend .o files.
355 elf="elf.o elflink.o"
360 # This list is alphabetized to make it easy to compare
361 # with the two vector lists in targets.c.
362 a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;;
363 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o stab-syms.o" ;;
364 armcoff_little_vec) tb="$tb coff-arm.o cofflink.o " ;;
365 armcoff_big_vec) tb="$tb coff-arm.o cofflink.o " ;;
366 armpe_little_vec) tb="$tb pe-arm.o cofflink.o " ;;
367 armpe_big_vec) tb="$tb pe-arm.o cofflink.o " ;;
368 armpei_little_vec) tb="$tb pei-arm.o cofflink.o " ;;
369 armpei_big_vec) tb="$tb pei-arm.o cofflink.o " ;;
370 aout0_big_vec) tb="$tb aout0.o aout32.o stab-syms.o" ;;
371 aout_arm_big_vec) tb="$tb aout-arm.o aout32.o stab-syms.o" ;;
372 aout_arm_little_vec) tb="$tb aout-arm.o aout32.o stab-syms.o" ;;
373 aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
374 aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
375 apollocoff_vec) tb="$tb coff-apollo.o" ;;
376 b_out_vec_big_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
377 b_out_vec_little_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
379 bfd_elf32_littlearc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
380 bfd_elf32_bigarc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
382 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
383 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
384 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o $elf" ;;
385 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o $elf" ;;
386 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o $elf" ;;
387 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
388 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
389 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o $elf" ;;
390 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o $elf" ;;
391 bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
392 bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
393 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o $elf" ;;
394 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
396 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
398 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o $elf"
400 cisco_core_vec) tb="$tb cisco-core.o" ;;
401 demo_64_vec) tb="$tb demo64.o aout64.o stab-syms.o"
403 ecoff_big_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
404 ecoff_little_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
405 ecoffalpha_little_vec) tb="$tb coff-alpha.o ecoff.o ecofflink.o"
407 h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
408 h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
409 host_aout_vec) tb="$tb host-aout.o aout32.o stab-syms.o" ;;
410 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o stab-syms.o" ;;
411 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o stab-syms.o" ;;
412 i386aout_vec) tb="$tb i386aout.o aout32.o stab-syms.o" ;;
413 i386bsd_vec) tb="$tb i386bsd.o aout32.o stab-syms.o" ;;
414 i386dynix_vec) tb="$tb i386dynix.o aout32.o stab-syms.o" ;;
415 i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;;
416 i386msdos_vec) tb="$tb i386msdos.o" ;;
417 i386pe_vec) tb="$tb pe-i386.o cofflink.o " ;;
418 i386pei_vec) tb="$tb pei-i386.o cofflink.o" ;;
419 i386linux_vec) tb="$tb i386linux.o aout32.o stab-syms.o" ;;
420 i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o stab-syms.o" ;;
421 i386lynx_coff_vec) tb="$tb cf-i386lynx.o cofflink.o lynx-core.o stab-syms.o" ;;
422 i386mach3_vec) tb="$tb i386mach3.o aout32.o stab-syms.o" ;;
423 i386netbsd_vec) tb="$tb i386netbsd.o aout32.o stab-syms.o" ;;
424 i386os9k_vec) tb="$tb i386os9k.o aout32.o stab-syms.o" ;;
425 i860coff_vec) tb="$tb coff-i860.o cofflink.o" ;;
426 icoff_big_vec) tb="$tb coff-i960.o cofflink.o" ;;
427 icoff_little_vec) tb="$tb coff-i960.o cofflink.o" ;;
428 ieee_vec) tb="$tb ieee.o" ;;
429 m68kcoff_vec) tb="$tb coff-m68k.o cofflink.o" ;;
430 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
431 m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o stab-syms.o" ;;
432 m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o stab-syms.o" ;;
433 m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o stab-syms.o" ;;
434 m68k4knetbsd_vec) tb="$tb m68k4knetbsd.o aout32.o stab-syms.o" ;;
435 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
436 newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;;
437 nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
438 nlm32_sparc_vec) tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;;
439 nlm32_alpha_vec) tb="$tb nlm32-alpha.o nlm32.o nlm.o"
441 riscix_vec) tb="$tb aout32.o riscix.o stab-syms.o" ;;
442 nlm32_powerpc_vec) tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;;
443 pc532netbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o stab-syms.o" ;;
444 pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o stab-syms.o" ;;
445 pmac_xcoff_vec) tb="$tb coff-pmac.o xcofflink.o" ;;
446 rs6000coff_vec) tb="$tb coff-rs6000.o xcofflink.o" ;;
447 bfd_powerpc_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
448 bfd_powerpcle_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
449 bfd_powerpc_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
450 bfd_powerpcle_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
451 shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
453 rce_aout_vec) tb="$tb aout-rce.o aout32.o stab-syms.o" ;;
455 shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
456 som_vec) tb="$tb som.o" ;;
457 sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o stab-syms.o" ;;
458 sparclynx_coff_vec) tb="$tb cf-sparclynx.o lynx-core.o stab-syms.o" ;;
459 sparcnetbsd_vec) tb="$tb sparcnetbsd.o aout32.o stab-syms.o" ;;
460 sparccoff_vec) tb="$tb coff-sparc.o" ;;
461 srec_vec) tb="$tb srec.o" ;;
462 sunos_big_vec) tb="$tb sunos.o aout32.o stab-syms.o" ;;
463 symbolsrec_vec) tb="$tb srec.o" ;;
464 tekhex_vec) tb="$tb tekhex.o" ;;
465 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
466 z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;;
467 w65_vec) tb="$tb coff-w65.o reloc16.o" ;;
468 versados_vec) tb="$tb versados.o" ;;
471 *) AC_MSG_ERROR(*** unknown target vector $vec) ;;
475 # Target architecture .o files.
476 ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
478 # Weed out duplicate .o files.
500 if test x${all_targets} = xtrue ; then
501 bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
502 bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
505 else # all_targets is true
506 # Only set these if they will be nonempty, for the clever echo.
507 test -n "$selvecs" &&
508 selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
509 test -n "$selarchs" &&
510 selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
511 fi # all_targets is true
513 case ${host64}-${target64}-${want64} in
516 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
520 all_backends='$(BFD32_BACKENDS)'
525 AC_SUBST(all_backends)
526 AC_SUBST(bfd_backends)
527 AC_SUBST(bfd_machines)
530 test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
531 test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
532 test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
535 dnl AC_CHECK_HEADERS(sys/mman.h)
537 AC_CHECK_FUNCS(madvise mprotect)
539 rm -f doc/config.status
540 AC_OUTPUT(Makefile doc/Makefile,
541 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])