* testsuite/Makefile.am: Add -ffunction-sections to compile
[external/binutils.git] / bfd / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3
4 AC_PREREQ(2.59)
5 AC_INIT
6 AC_CONFIG_SRCDIR([libbfd.c])
7
8 AC_CANONICAL_TARGET
9 AC_ISC_POSIX
10
11 AM_INIT_AUTOMAKE(bfd, 2.19.51)
12
13 dnl These must be called before LT_INIT, because it may want
14 dnl to call AC_CHECK_PROG.
15 AC_CHECK_TOOL(AR, ar)
16 AC_CHECK_TOOL(RANLIB, ranlib, :)
17
18 dnl Default to a non shared library.  This may be overridden by the
19 dnl configure option --enable-shared.
20 AC_DISABLE_SHARED
21
22 AC_PROG_CC
23 AC_GNU_SOURCE
24 AC_USE_SYSTEM_EXTENSIONS
25
26 case "${target}" in
27 changequote(,)dnl
28   sparc-*-solaris*|i[3-7]86-*-solaris*)
29 changequote([,])dnl
30     # On native 32bit sparc and ia32 solaris, large-file and procfs support
31     # are mutually exclusive; and without procfs support, the elf module
32     # cannot provide certain routines such as elfcore_write_prpsinfo
33     # or elfcore_write_prstatus.  So unless the user explicitly requested
34     # large-file support through the --enable-largefile switch, disable
35     # large-file support in favor of procfs support.
36     if test "${target}" = "${host}" -a "$enable_largefile" != 'yes'; then
37       enable_largefile="no"
38     fi
39     ;;
40 esac
41
42 AC_SYS_LARGEFILE
43
44 LT_INIT
45
46 AC_ARG_ENABLE(64-bit-bfd,
47 [  --enable-64-bit-bfd     64-bit support (on hosts with narrower word sizes)],
48 [case "${enableval}" in
49   yes)  want64=true  ;;
50   no)   want64=false ;;
51   *)    AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
52 esac],[want64=false])dnl
53
54 AC_ARG_ENABLE(targets,
55 [  --enable-targets        alternative target configurations],
56 [case "${enableval}" in
57   yes | "") AC_MSG_ERROR([enable-targets option must specify target names or 'all'])
58             ;;
59   no)       enable_targets= ;;
60   *)        enable_targets=$enableval ;;
61 esac])dnl
62
63 AC_ARG_WITH(mmap,
64 [  --with-mmap             try using mmap for BFD input files if available],
65 [case "${withval}" in
66   yes)  want_mmap=true ;;
67   no)   want_mmap=false ;;
68   *)    AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;;
69 esac],[want_mmap=false])dnl
70
71 AC_ARG_ENABLE(secureplt,
72 [  --enable-secureplt      Default to creating read-only plt entries],
73 [case "${enableval}" in
74   yes)  use_secureplt=true  ;;
75   no)   use_secureplt=false ;;
76   *)    AC_MSG_ERROR(bad value ${enableval} for secureplt option) ;;
77 esac],[use_secureplt=false])dnl
78 if test $use_secureplt = true; then
79   AC_DEFINE(USE_SECUREPLT, 1,
80     [Define if we should default to creating read-only plt entries])
81 fi
82
83 DEBUGDIR=${libdir}/debug
84 AC_ARG_WITH(separate-debug-dir,
85   AS_HELP_STRING([--with-separate-debug-dir=DIR],
86                  [Look for global separate debug info in DIR [[default=LIBDIR/debug]]]),
87 [DEBUGDIR="${withval}"])
88 AC_SUBST(DEBUGDIR)
89
90 # Check to see if we should allow the generation of
91 # symbols with the ELF standard's STT_COMMON type.
92 AC_ARG_ENABLE(elf-stt-common,
93 [  --enable-elf-stt-common Allow the generation of ELF symbols with the STT_COMMON type],
94 [case "${enableval}" in
95   yes) want_elf_stt_common=true ;;
96   no)  want_elf_stt_common=false ;;
97   *)   AC_MSG_ERROR(bad value ${enableval} for ELF STT_COMMON option) ;;
98  esac],
99 # We have to choose a default behaviour.  For native builds we could
100 # test whether the loader supports the STT_COMMON type, but that would
101 # mean that built binaries could not be exported to older systems where
102 # the loader does not support it. So by default we always choose to
103 # disable this feature.
104   want_elf_stt_common=false)dnl
105 if test $want_elf_stt_common = true; then
106   AC_DEFINE(USE_STT_COMMON, 1,
107     [Define if we may generate symbols with ELF's STT_COMMON type])
108 fi
109          
110 ACX_PKGVERSION([GNU Binutils])
111 ACX_BUGURL([http://www.sourceware.org/bugzilla/])
112
113 AM_BINUTILS_WARNINGS
114
115 AC_CONFIG_HEADERS(config.h:config.in)
116
117 if test -z "$target" ; then
118     AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
119 fi
120
121 AM_MAINTAINER_MODE
122 AM_CONDITIONAL(GENINSRC_NEVER, false)
123 AM_INSTALL_LIBBFD
124 AC_EXEEXT
125
126 host64=false
127 target64=false
128 bfd_default_target_size=32
129
130 # host stuff:
131
132 ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw vi fi id"
133 ZW_GNU_GETTEXT_SISTER_DIR
134 AM_PO_SUBDIRS
135
136 # Permit host specific settings.
137 . ${srcdir}/configure.host
138
139 AC_SUBST(HDEFINES)
140 AC_PROG_INSTALL
141
142 BFD_HOST_64BIT_LONG=0
143 BFD_HOST_64BIT_LONG_LONG=0
144 BFD_HOST_64_BIT_DEFINED=0
145 BFD_HOST_64_BIT=
146 BFD_HOST_U_64_BIT=
147 BFD_HOSTPTR_T="unsigned long"
148
149 AC_CHECK_SIZEOF(long long)
150 AC_CHECK_SIZEOF(void *)
151 AC_CHECK_SIZEOF(long)
152
153 if test "x${ac_cv_sizeof_void_p}" = "x8"; then
154   host64=true
155 fi
156
157 if test "x${ac_cv_sizeof_long}" = "x8"; then
158   BFD_HOST_64BIT_LONG=1
159   test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long"
160   test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long"
161 elif test "x${ac_cv_sizeof_long_long}" = "x8"; then
162   BFD_HOST_64BIT_LONG_LONG=1
163   test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long"
164   test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long"
165   if test "x${ac_cv_sizeof_void_p}" = "x8"; then
166     BFD_HOSTPTR_T="unsigned long long"
167   fi
168 fi
169
170 if test -n "${HOST_64BIT_TYPE}" -a -n "${HOST_U_64BIT_TYPE}"; then
171   BFD_HOST_64_BIT_DEFINED=1
172   BFD_HOST_64_BIT="${HOST_64BIT_TYPE}"
173   BFD_HOST_U_64_BIT="${HOST_U_64BIT_TYPE}"
174 fi
175
176 AC_SUBST(BFD_HOST_64BIT_LONG)
177 AC_SUBST(BFD_HOST_64BIT_LONG_LONG)
178 AC_SUBST(BFD_HOST_64_BIT_DEFINED)
179 AC_SUBST(BFD_HOST_64_BIT)
180 AC_SUBST(BFD_HOST_U_64_BIT)
181 AC_SUBST(BFD_HOSTPTR_T)
182
183 BFD_CC_FOR_BUILD
184
185 AC_CHECK_HEADERS(alloca.h stddef.h string.h strings.h stdlib.h time.h unistd.h)
186 AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
187 GCC_HEADER_STDINT(bfd_stdint.h)
188 AC_HEADER_TIME
189 AC_HEADER_DIRENT
190 ACX_HEADER_STRING
191 AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid fileno)
192 AC_CHECK_FUNCS(strtoull)
193
194 AC_CHECK_DECLS(basename)
195 AC_CHECK_DECLS(ftello)
196 AC_CHECK_DECLS(ftello64)
197 AC_CHECK_DECLS(fseeko)
198 AC_CHECK_DECLS(fseeko64)
199
200 BFD_BINARY_FOPEN
201
202 AC_CHECK_DECLS(ffs)
203 AC_CHECK_DECLS(free)
204 AC_CHECK_DECLS(getenv)
205 AC_CHECK_DECLS(malloc)
206 AC_CHECK_DECLS(realloc)
207 AC_CHECK_DECLS(stpcpy)
208 AC_CHECK_DECLS(strstr)
209 AC_CHECK_DECLS(snprintf)
210 AC_CHECK_DECLS(vsnprintf)
211
212 # Link in zlib if we can.  This allows us to read compressed debug sections.
213 # This is used only by compress.c.
214 AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
215
216 # If we are configured native, pick a core file support file.
217 COREFILE=
218 COREFLAG=
219 TRAD_HEADER=
220 if test "${target}" = "${host}"; then
221   case "${host}" in
222   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
223         COREFILE=''
224         ;;
225   alpha*-*-linux-*)
226         COREFILE=trad-core.lo
227         TRAD_HEADER='"hosts/alphalinux.h"'
228         ;;
229   alpha*-*-netbsd* | alpha*-*-openbsd*)
230         COREFILE=netbsd-core.lo
231         ;;
232   alpha*-*-*)           COREFILE=osf-core.lo ;;
233   arm-*-freebsd* | arm-*-kfreebsd*-gnu)
234                         COREFILE='' ;;
235   arm-*-netbsd* | arm-*-openbsd*)
236         COREFILE=netbsd-core.lo
237         ;;
238   arm-*-riscix)         COREFILE=trad-core.lo ;;
239   hppa*-*-hpux*)        COREFILE=hpux-core.lo ;;
240   hppa*-*-hiux*)        COREFILE=hpux-core.lo ;;
241   hppa*-*-mpeix*)       COREFILE=hpux-core.lo ;;
242   hppa*-*-bsd*)         COREFILE="hpux-core.lo hppabsd-core.lo"
243                         COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
244   hppa*-*-netbsd* | hppa*-*-openbsd*)
245         COREFILE=netbsd-core.lo
246         ;;
247
248   i370-*-*)
249         COREFILE=trad-core.lo
250         TRAD_HEADER='"hosts/i370linux.h"'
251         ;;
252
253 changequote(,)dnl
254   i[3-7]86-sequent-bsd*)
255 changequote([,])dnl
256         COREFILE=trad-core.lo
257         TRAD_HEADER='"hosts/symmetry.h"'
258         ;;
259 changequote(,)dnl
260   i[3-7]86-sequent-sysv4*) ;;
261   i[3-7]86-sequent-sysv*)
262 changequote([,])dnl
263         COREFILE=trad-core.lo
264         TRAD_HEADER='"hosts/symmetry.h"'
265         ;;
266 changequote(,)dnl
267   i[3-7]86-*-bsdi)
268 changequote([,])dnl
269         COREFILE=
270         ;;
271 changequote(,)dnl
272   i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[123] | i[3-7]86-*-freebsd[123]\.* | i[3-7]86-*-freebsd4\.[01234] | i[3-7]86-*-freebsd4\.[01234]\.* | i[3-7]86-*-freebsd*aout*)
273 changequote([,])dnl
274         COREFILE=trad-core.lo
275         TRAD_HEADER='"hosts/i386bsd.h"'
276         ;;
277 changequote(,)dnl
278   i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu | i[3-7]86-*-dragonfly*)
279 changequote([,])dnl
280         COREFILE=''
281         TRAD_HEADER='"hosts/i386bsd.h"'
282         ;;
283 changequote(,)dnl
284   i[3-7]86-*-netbsd* | i[3-7]86-*-knetbsd*-gnu | i[3-7]86-*-openbsd*)
285 changequote([,])dnl
286         COREFILE=netbsd-core.lo
287         ;;
288 changequote(,)dnl
289   i[3-7]86-esix-sysv3*)
290 changequote([,])dnl
291         COREFILE=trad-core.lo
292         TRAD_HEADER='"hosts/esix.h"'
293         ;;
294 changequote(,)dnl
295   i[3-7]86-*-sco3.2v5*)
296 changequote([,])dnl
297         COREFILE=sco5-core.lo
298         ;;
299 changequote(,)dnl
300   i[3-7]86-*-sco* | i[3-7]86-*-isc*)
301 changequote([,])dnl
302         COREFILE=trad-core.lo
303         TRAD_HEADER='"hosts/i386sco.h"'
304         ;;
305 changequote(,)dnl
306   i[3-7]86-*-mach3*)
307 changequote([,])dnl
308         COREFILE=trad-core.lo
309         TRAD_HEADER='"hosts/i386mach3.h"'
310         ;;
311 changequote(,)dnl
312   i[3-7]86-*-linux-*)
313 changequote([,])dnl
314         COREFILE=trad-core.lo
315         TRAD_HEADER='"hosts/i386linux.h"'
316         ;;
317 changequote(,)dnl
318   i[3-7]86-*-isc*)      COREFILE=trad-core.lo ;;
319   i[3-7]86-*-aix*)      COREFILE=aix386-core.lo ;;
320 changequote([,])dnl
321   i860-*-mach3* | i860-*-osf1*)
322         COREFILE=trad-core.lo
323         TRAD_HEADER='"hosts/i860mach3.h"'
324         ;;
325   mips-*-netbsd* | mips*-*-openbsd*)
326         COREFILE=netbsd-core.lo
327         ;;
328   mips-dec-*)
329         COREFILE=trad-core.lo
330         TRAD_HEADER='"hosts/decstation.h"'
331         ;;
332   mips-sgi-irix4*)      COREFILE=irix-core.lo ;;
333   mips-sgi-irix5*)      COREFILE=irix-core.lo ;;
334   mips-sgi-irix6*)      COREFILE=irix-core.lo ;;
335   mips-*-sysv4*)        ;;
336   mips-*-sysv* | mips-*-riscos*)
337         COREFILE=trad-core.lo
338         TRAD_HEADER='"hosts/riscos.h"'
339         ;;
340   mips-sony-bsd*)
341         COREFILE=trad-core.lo
342         TRAD_HEADER='"hosts/news-mips.h"'
343         ;;
344   m68*-bull*-sysv*)
345         COREFILE=trad-core.lo
346         TRAD_HEADER='"hosts/dpx2.h"'
347         ;;
348   m68*-hp-hpux*)        COREFILE=hpux-core.lo ;;
349   m68*-hp-bsd*)
350         COREFILE=trad-core.lo
351         TRAD_HEADER='"hosts/hp300bsd.h"'
352         ;;
353   m68*-*-linux-*)
354         COREFILE=trad-core.lo
355         TRAD_HEADER='"hosts/m68klinux.h"'
356         ;;
357   m68*-motorola-sysv*)
358         COREFILE=trad-core.lo
359         TRAD_HEADER='"hosts/delta68.h"'
360         ;;
361   m68*-sony-*)
362         COREFILE=trad-core.lo
363         TRAD_HEADER='"hosts/news.h"'
364         ;;
365   m68*-*-netbsd* | m68*-*-openbsd*)
366         COREFILE=netbsd-core.lo
367         ;;
368   m68*-apple-aux*)
369         COREFILE=trad-core.lo
370         TRAD_HEADER='"hosts/m68kaux.h"'
371         ;;
372   m88*-*-sysv4*)
373         ;;
374   m88*-motorola-sysv*)
375         COREFILE=ptrace-core.lo
376         ;;
377   m88*-*-mach3*)
378         COREFILE=trad-core.lo
379         TRAD_HEADER='"hosts/m88kmach3.h"'
380         ;;
381   m88*-*-openbsd*)
382         COREFILE=netbsd-core.lo
383         ;;
384   ns32k-pc532-mach)
385         COREFILE=trad-core.lo
386         TRAD_HEADER='"hosts/pc532mach.h"'
387         ;;
388   ns32k-*-netbsd* | ns32k-*-openbsd*)
389         COREFILE=netbsd-core.lo
390         ;;
391   rs6000-*-lynx*)
392         COREFILE=lynx-core.lo
393         ;;
394 changequote(,)dnl
395   rs6000-*-aix[5-9].* | powerpc-*-aix[5-9].*)
396 changequote([,])dnl
397         COREFILE=rs6000-core.lo
398         COREFLAG="$COREFLAG -DAIX_5_CORE -DAIX_CORE_DUMPX_CORE"
399         ;;
400 changequote(,)dnl
401   rs6000-*-aix4.[3-9]* | powerpc-*-aix4.[3-9]*)
402 changequote([,])dnl
403         COREFILE=rs6000-core.lo
404         COREFLAG="$COREFLAG -DAIX_CORE_DUMPX_CORE"
405         # Not all versions of AIX with -DAIX_CORE_DUMPX_CORE
406         # have c_impl as a member of struct core_dumpx
407         AC_MSG_CHECKING([for c_impl in struct core_dumpx])
408         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <core.h>]], [[struct core_dumpx c; c.c_impl = 0;]])],[AC_DEFINE(HAVE_ST_C_IMPL, 1,
409             [Define if struct core_dumpx has member c_impl])
410           AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
411         ;;
412   rs6000-*-aix4*)       COREFILE=rs6000-core.lo ;;
413   rs6000-*-*)           COREFILE=rs6000-core.lo ;;
414   powerpc-*-aix4*)      COREFILE=rs6000-core.lo ;;
415   powerpc-*-aix*)       COREFILE=rs6000-core.lo ;;
416   powerpc-*-beos*)      ;;
417   powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu)
418                         COREFILE='' ;;
419   powerpc-*-netbsd*)    COREFILE=netbsd-core.lo ;;
420   powerpc-*-*bsd*)      COREFILE=netbsd-core.lo ;;
421   s390*-*-*)            COREFILE=trad-core.lo ;;
422   sh*-*-netbsd* | sh*-*-openbsd*)
423         COREFILE=netbsd-core.lo
424         ;;
425   sparc-*-netbsd* | sparc*-*-openbsd*)
426         COREFILE=netbsd-core.lo
427         ;;
428   tahoe-*-*)
429         COREFILE=trad-core.lo
430         TRAD_HEADER='"hosts/tahoe.h"'
431         ;;
432   vax-*-netbsd* | vax-*-openbsd*)
433         COREFILE=netbsd-core.lo
434         ;;
435   vax-*-ultrix2*)
436         COREFILE=trad-core.lo
437         TRAD_HEADER='"hosts/vaxult2.h"'
438         ;;
439   vax-*-ultrix*)
440         COREFILE=trad-core.lo
441         TRAD_HEADER='"hosts/vaxult2.h"'
442         ;;
443   vax-*-linux-*)
444         COREFILE=trad-core.lo
445         TRAD_HEADER='"hosts/vaxlinux.h"'
446         ;;
447   vax-*-*)
448         COREFILE=trad-core.lo
449         TRAD_HEADER='"hosts/vaxbsd.h"'
450         ;;
451   x86_64-*-netbsd* | x86_64-*-openbsd*)
452         COREFILE=netbsd-core.lo
453         ;;
454   esac
455
456   case "$COREFILE" in
457   aix386-core.lo)       COREFLAG=-DAIX386_CORE ;;
458   hppabsd-core.lo)      COREFLAG=-DHPPABSD_CORE ;;
459   hpux-core.lo)         COREFLAG=-DHPUX_CORE ;;
460   irix-core.lo)         COREFLAG=-DIRIX_CORE ;;
461   lynx-core.lo)         COREFLAG=-DLYNX_CORE ;;
462   netbsd-core.lo)       COREFLAG=-DNETBSD_CORE ;;
463   osf-core.lo)          COREFLAG=-DOSF_CORE ;;
464   ptrace-core.lo)       COREFLAG=-DPTRACE_CORE ;;
465   rs6000-core.lo)       COREFLAG="$COREFLAG -DAIX_CORE" ;;
466   sco5-core.lo)         COREFLAG="$COREFLAG -DSCO5_CORE" ;;
467   trad-core.lo)         COREFLAG="$COREFLAG -DTRAD_CORE" ;;
468   esac
469
470   # ELF corefile support has several flavors, but all of
471   # them use something called <sys/procfs.h>
472   AC_CHECK_HEADERS(sys/procfs.h)
473   if test "$ac_cv_header_sys_procfs_h" = yes; then
474     BFD_HAVE_SYS_PROCFS_TYPE(prstatus_t)
475     BFD_HAVE_SYS_PROCFS_TYPE(prstatus32_t)
476     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus_t, pr_who)
477     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus32_t, pr_who)
478     BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t)
479     BFD_HAVE_SYS_PROCFS_TYPE(pxstatus_t)
480     BFD_HAVE_SYS_PROCFS_TYPE(pstatus32_t)
481     BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo_t)
482     BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo32_t)
483     BFD_HAVE_SYS_PROCFS_TYPE(psinfo_t)
484     BFD_HAVE_SYS_PROCFS_TYPE(psinfo32_t)
485     BFD_HAVE_SYS_PROCFS_TYPE(lwpstatus_t)
486     BFD_HAVE_SYS_PROCFS_TYPE(lwpxstatus_t)
487     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_context)
488     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_reg)
489     BFD_HAVE_SYS_PROCFS_TYPE(win32_pstatus_t)
490   fi
491 fi
492 AC_SUBST(COREFILE)
493 AC_SUBST(COREFLAG)
494 if test -n "$TRAD_HEADER"; then
495   AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER,
496     [Name of host specific header file to include in trad-core.c.])
497 fi
498
499 # Check if linker supports --as-needed and --no-as-needed options
500 AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed,
501         [bfd_cv_ld_as_needed=no
502         if $LD --help 2>/dev/null | grep as-needed > /dev/null; then
503                 bfd_cv_ld_as_needed=yes
504         fi
505         ])
506
507 LT_LIB_M
508
509 # When building a shared libbfd, link against the pic version of libiberty
510 # so that apps that use libbfd won't need libiberty just to satisfy any
511 # libbfd references.
512 # We can't do that if a pic libiberty is unavailable since including non-pic
513 # code would insert text relocations into libbfd.
514 SHARED_LIBADD=
515 SHARED_LDFLAGS=
516 if test "$enable_shared" = "yes"; then
517 changequote(,)dnl
518   x=`sed -n -e 's/^[    ]*PICFLAG[      ]*=[    ]*//p' < ../libiberty/Makefile | sed -n '$p'`
519 changequote([,])dnl
520   if test -n "$x"; then
521     SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
522   fi
523
524 # More hacks to build DLLs on Windows.
525   case "${host}" in
526   *-*-cygwin*)
527     SHARED_LDFLAGS="-no-undefined"
528     SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32"
529   ;;
530   esac
531
532   if test -n "$SHARED_LIBADD"; then
533     if test -n "$LIBM"; then
534       if test x"$bfd_cv_ld_as_needed" = xyes; then
535         # Link against libm only when needed.  Put -lc, -lm inside -Wl
536         # to stop libtool reordering these options.
537         SHARED_LIBADD="$SHARED_LIBADD -Wl,-lc,--as-needed,`echo $LIBM | sed 's/ /,/g'`,--no-as-needed"
538       else
539         SHARED_LIBADD="$SHARED_LIBADD $LIBM"
540       fi
541     fi
542   fi
543 fi
544 AC_SUBST(SHARED_LDFLAGS)
545 AC_SUBST(SHARED_LIBADD)
546
547 # target stuff:
548
549 # Canonicalize the secondary target names.
550 if test -n "$enable_targets" ; then
551     for targ in `echo $enable_targets | sed 's/,/ /g'`
552     do
553         result=`$ac_config_sub $targ 2>/dev/null`
554         if test -n "$result" ; then
555             canon_targets="$canon_targets $result"
556         else
557             # Allow targets that config.sub doesn't recognize, like "all".
558             canon_targets="$canon_targets $targ"
559         fi
560     done
561 fi
562
563 all_targets=false
564 defvec=
565 selvecs=
566 assocvecs=
567 selarchs=
568 TDEFINES=
569 for targ in $target $canon_targets
570 do
571     if test "x$targ" = "xall"; then
572         all_targets=true
573         assocvecs="$assocvecs $targ_defvec $targ_selvecs"
574     else
575         . $srcdir/config.bfd
576         if test "x$targ" = "x$target"; then
577             defvec=$targ_defvec
578         fi
579         selvecs="$selvecs $targ_defvec $targ_selvecs"
580         selarchs="$selarchs $targ_archs"
581         TDEFINES="$TDEFINES $targ_cflags"
582     fi
583 done
584 AC_SUBST(TDEFINES)
585
586 # This processing still needs to be done if we're to decide properly whether
587 # 64-bit support needs to be compiled in.  Currently, it will be included if
588 # the default or any other explicitly requested target requires it; it
589 # will not be included on a 32-bit host if no 64-bit target is requested, and
590 # no "--with-64-bit-bfd" option is given, even if "--enable-targets=all" is
591 # used.
592
593 # uniq the default and selected vectors in all the configured targets.
594 f=""
595 for i in $selvecs ; do
596     case " $f " in
597     *" $i "*) ;;
598     *) f="$f $i" ;;
599     esac
600 done
601 selvecs="$f"
602
603
604 # uniq the associated vectors in all the configured targets.
605 f=""
606 for i in $assocvecs ; do
607     case " $f " in
608     *" $i "*) ;;
609     *) f="$f $i" ;;
610     esac
611 done
612 assocvecs="$f"
613
614
615 # uniq the architectures in all the configured targets.
616 f=""
617 for i in $selarchs ; do
618     case " $f " in
619     *" $i "*) ;;
620     *) f="$f $i" ;;
621     esac
622 done
623 selarchs="$f"
624
625 # Target backend .o files.
626 tb=
627
628 elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo"
629
630 for vec in $selvecs
631 do
632     target_size=32
633     case "$vec" in
634     # This list is alphabetized to make it easy to compare
635     # with the two vector lists in targets.c.  For the same reason,
636     # use one entry per line, even though this leads to long lines.
637     a_out_adobe_vec)            tb="$tb aout-adobe.lo aout32.lo" ;;
638     aix5coff64_vec)             tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
639     aout0_big_vec)              tb="$tb aout0.lo aout32.lo" ;;
640     aout_arm_big_vec)           tb="$tb aout-arm.lo aout32.lo" ;;
641     aout_arm_little_vec)        tb="$tb aout-arm.lo aout32.lo" ;;
642     apollocoff_vec)             tb="$tb coff-apollo.lo" ;;
643     arm_epoc_pe_big_vec)        tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
644     arm_epoc_pe_little_vec)     tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
645     arm_epoc_pei_big_vec)       tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
646     arm_epoc_pei_little_vec)    tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
647     arm_wince_pe_big_vec)       tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;;
648     arm_wince_pe_little_vec)    tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;;
649     arm_wince_pei_big_vec)      tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;;
650     arm_wince_pei_little_vec)   tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;;
651     armcoff_big_vec)            tb="$tb coff-arm.lo cofflink.lo " ;;
652     armcoff_little_vec)         tb="$tb coff-arm.lo cofflink.lo " ;;
653     armnetbsd_vec)              tb="$tb armnetbsd.lo aout32.lo" ;;
654     armpe_big_vec)              tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
655     armpe_little_vec)           tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
656     armpei_big_vec)             tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
657     armpei_little_vec)          tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
658     b_out_vec_big_host)         tb="$tb bout.lo aout32.lo" ;;
659     b_out_vec_little_host)      tb="$tb bout.lo aout32.lo" ;;
660     bfd_pei_ia64_vec)           tb="$tb pei-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
661     bfd_elf32_am33lin_vec)      tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
662     bfd_elf32_avr_vec)          tb="$tb elf32-avr.lo elf32.lo $elf" ;;
663     bfd_elf32_bfin_vec)         tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
664     bfd_elf32_bfinfdpic_vec)    tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
665     bfd_elf32_big_generic_vec)  tb="$tb elf32-gen.lo elf32.lo $elf" ;;
666     bfd_elf32_bigarc_vec)       tb="$tb elf32-arc.lo elf32.lo $elf" ;;
667     bfd_elf32_bigarm_vec)       tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
668     bfd_elf32_bigarm_symbian_vec)       
669                                 tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
670     bfd_elf32_bigarm_vxworks_vec)       
671                                 tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
672     bfd_elf32_bigmips_vec)      tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
673     bfd_elf32_bigmips_vxworks_vec)
674                                 tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
675     bfd_elf32_cr16_vec)         tb="$tb elf32-cr16.lo elf32.lo $elf" ;;
676     bfd_elf32_cr16c_vec)        tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
677     bfd_elf32_cris_vec)         tb="$tb elf32-cris.lo elf32.lo $elf" ;;
678     bfd_elf32_crx_vec)          tb="$tb elf32-crx.lo elf32.lo $elf" ;;    
679     bfd_elf32_d10v_vec)         tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
680     bfd_elf32_d30v_vec)         tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
681     bfd_elf32_dlx_big_vec)      tb="$tb elf32-dlx.lo elf32.lo $elf" ;;
682     bfd_elf32_fr30_vec)         tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
683     bfd_elf32_frv_vec)          tb="$tb elf32-frv.lo elf32.lo $elf" ;;
684     bfd_elf32_frvfdpic_vec)     tb="$tb elf32-frv.lo elf32.lo $elf" ;;
685     bfd_elf32_moxie_vec)        tb="$tb elf32-moxie.lo elf32.lo $elf" ;;
686     bfd_elf32_h8300_vec)        tb="$tb elf32-h8300.lo elf32.lo $elf" ;;
687     bfd_elf32_hppa_linux_vec)   tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
688     bfd_elf32_hppa_nbsd_vec)    tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
689     bfd_elf32_hppa_vec)         tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
690     bfd_elf32_i370_vec)         tb="$tb elf32-i370.lo elf32.lo $elf" ;;
691     bfd_elf32_i386_dragonfly_vec)
692                                 tb="$tb elf32-i386.lo elf-vxworks.lo elf32.lo $elf" ;;
693     bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf-vxworks.lo elf32.lo $elf" ;;
694     bfd_elf32_i386_vxworks_vec) tb="$tb elf32-i386.lo elf-vxworks.lo elf32.lo $elf" ;;
695     bfd_elf32_i386_vec)         tb="$tb elf32-i386.lo elf-vxworks.lo elf32.lo $elf" ;;
696     bfd_elf32_i860_little_vec)  tb="$tb elf32-i860.lo elf32.lo $elf" ;;
697     bfd_elf32_i860_vec)         tb="$tb elf32-i860.lo elf32.lo $elf" ;;
698     bfd_elf32_i960_vec)         tb="$tb elf32-i960.lo elf32.lo $elf" ;;
699     bfd_elf32_ia64_big_vec)     tb="$tb elf32-ia64.lo elf32.lo $elf" ;;
700     bfd_elf32_ia64_hpux_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf";;
701     bfd_elf32_ip2k_vec)         tb="$tb elf32-ip2k.lo elf32.lo $elf" ;;
702     bfd_elf32_iq2000_vec)       tb="$tb elf32-iq2000.lo elf32.lo $elf" ;;
703     bfd_elf32_lm32_vec)         tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
704     bfd_elf32_lm32fdpic_vec)         tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
705     bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
706     bfd_elf32_littlearc_vec)    tb="$tb elf32-arc.lo elf32.lo $elf" ;;
707     bfd_elf32_littlearm_symbian_vec)
708                                 tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
709     bfd_elf32_littlearm_vxworks_vec)
710                                 tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
711     bfd_elf32_littlearm_vec)    tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
712     bfd_elf32_littlemips_vec)   tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
713     bfd_elf32_littlemips_vxworks_vec)
714                                 tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
715     bfd_elf32_m32c_vec)         tb="$tb elf32-m32c.lo elf32.lo $elf" ;;
716     bfd_elf32_m32r_vec)         tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
717     bfd_elf32_m32rle_vec)       tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
718     bfd_elf32_m32rlin_vec)      tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
719     bfd_elf32_m32rlelin_vec)    tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
720     bfd_elf32_m68hc11_vec)      tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
721     bfd_elf32_m68hc12_vec)      tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
722     bfd_elf32_m68k_vec)         tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
723     bfd_elf32_m88k_vec)         tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
724     bfd_elf32_mcore_big_vec)    tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
725     bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
726     bfd_elf32_mep_vec)          tb="$tb elf32-mep.lo elf32.lo $elf" ;;
727     bfd_elf32_mep_little_vec)   tb="$tb elf32-mep.lo elf32.lo $elf" ;;
728     bfd_elf32_mn10200_vec)      tb="$tb elf-m10200.lo elf32.lo $elf" ;;
729     bfd_elf32_mn10300_vec)      tb="$tb elf-m10300.lo elf32.lo $elf" ;;
730     bfd_elf32_mt_vec)           tb="$tb elf32-mt.lo elf32.lo $elf" ;;
731     bfd_elf32_msp430_vec)       tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
732     bfd_elf32_nbigmips_vec)     tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
733     bfd_elf32_nlittlemips_vec)  tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
734     bfd_elf32_ntradbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
735     bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
736     bfd_elf32_openrisc_vec)     tb="$tb elf32-openrisc.lo elf32.lo $elf" ;;
737     bfd_elf32_or32_big_vec)     tb="$tb elf32-or32.lo elf32.lo $elf" ;;
738     bfd_elf32_pj_vec)           tb="$tb elf32-pj.lo elf32.lo $elf";;
739     bfd_elf32_pjl_vec)          tb="$tb elf32-pj.lo elf32.lo $elf";;
740     bfd_elf32_powerpc_vec)      tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
741     bfd_elf32_powerpcle_vec)    tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
742     bfd_elf32_powerpc_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
743     bfd_elf32_s390_vec)         tb="$tb elf32-s390.lo elf32.lo $elf" ;;
744     bfd_elf32_bigscore_vec)     tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64;;
745     bfd_elf32_littlescore_vec)  tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64;;
746     # FIXME: We include cofflink.lo not because it's needed for
747     # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
748     # which needs it but does not list it.  Should be fixed in right place.
749     bfd_elf32_sh64_vec)         tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
750     bfd_elf32_sh64l_vec)        tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
751     bfd_elf32_sh64lin_vec)      tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
752     bfd_elf32_sh64blin_vec)     tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
753     bfd_elf32_sh64lnbsd_vec)    tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
754     bfd_elf32_sh64nbsd_vec)     tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
755     bfd_elf32_sh_vec)           tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
756     bfd_elf32_shblin_vec)       tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
757     bfd_elf32_shl_vec)          tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
758     bfd_elf32_shl_symbian_vec)  tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
759     bfd_elf32_shlin_vec)        tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
760     bfd_elf32_shlnbsd_vec)      tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
761     bfd_elf32_shlvxworks_vec)   tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
762     bfd_elf32_shnbsd_vec)       tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
763     bfd_elf32_shvxworks_vec)    tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
764     bfd_elf32_sparc_vec)        tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
765     bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
766     bfd_elf32_spu_vec)          tb="$tb elf32-spu.lo elf32.lo $elf" ;;
767     bfd_elf32_tradbigmips_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
768     bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
769     bfd_elf32_us_cris_vec)      tb="$tb elf32-cris.lo elf32.lo $elf" ;;
770     bfd_elf32_v850_vec)         tb="$tb elf32-v850.lo elf32.lo $elf" ;;
771     bfd_elf32_vax_vec)          tb="$tb elf32-vax.lo elf32.lo $elf" ;;
772     bfd_elf32_xstormy16_vec)    tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;;
773     bfd_elf32_xc16x_vec)                tb="$tb elf32-xc16x.lo elf32.lo $elf" ;;
774     bfd_elf32_xtensa_le_vec)    tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
775     bfd_elf32_xtensa_be_vec)    tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
776     bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
777     bfd_elf64_alpha_vec)        tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
778     bfd_elf64_big_generic_vec)  tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
779     bfd_elf64_bigmips_vec)      tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
780     bfd_elf64_hppa_linux_vec)   tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
781     bfd_elf64_hppa_vec)         tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
782     bfd_elf64_ia64_big_vec)     tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
783     bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
784     bfd_elf64_ia64_little_vec)  tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
785     bfd_elf64_ia64_vms_vec)     tb="$tb elf64-ia64.lo elf64.lo $elf vmsutil.lo"; target_size=64 ;;
786     bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
787     bfd_elf64_littlemips_vec)   tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
788     bfd_elf64_mmix_vec)         tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
789     bfd_elf64_powerpc_vec)      tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
790     bfd_elf64_powerpcle_vec)    tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
791     bfd_elf64_s390_vec)         tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
792     bfd_elf64_sh64_vec)         tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
793     bfd_elf64_sh64l_vec)        tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
794     bfd_elf64_sh64lin_vec)      tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
795     bfd_elf64_sh64blin_vec)     tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
796     bfd_elf64_sh64lnbsd_vec)    tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
797     bfd_elf64_sh64nbsd_vec)     tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
798     bfd_elf64_sparc_vec)        tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
799     bfd_elf64_sparc_freebsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
800     bfd_elf64_tradbigmips_vec)  tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
801     bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
802     bfd_elf64_x86_64_freebsd_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
803     bfd_elf64_x86_64_vec)       tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
804     bfd_mmo_vec)                tb="$tb mmo.lo" target_size=64 ;;
805     bfd_powerpc_pe_vec)         tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
806     bfd_powerpc_pei_vec)        tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
807     bfd_powerpcle_pe_vec)       tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
808     bfd_powerpcle_pei_vec)      tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
809     cris_aout_vec)              tb="$tb aout-cris.lo" ;;
810     demo_64_vec)                tb="$tb demo64.lo aout64.lo"; target_size=64 ;;
811     ecoff_big_vec)              tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
812     ecoff_biglittle_vec)        tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
813     ecoff_little_vec)           tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
814     ecoffalpha_little_vec)      tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"; target_size=64 ;;
815     go32coff_vec)               tb="$tb coff-go32.lo cofflink.lo" ;;
816     go32stubbedcoff_vec)        tb="$tb coff-stgo32.lo cofflink.lo" ;;
817     h8300coff_vec)              tb="$tb coff-h8300.lo reloc16.lo" ;;
818     h8500coff_vec)              tb="$tb coff-h8500.lo reloc16.lo" ;;
819     host_aout_vec)              tb="$tb host-aout.lo aout32.lo" ;;
820     hp300bsd_vec)               tb="$tb hp300bsd.lo aout32.lo" ;;
821     hp300hpux_vec)              tb="$tb hp300hpux.lo aout32.lo" ;;
822     i386aout_vec)               tb="$tb i386aout.lo aout32.lo" ;;
823     i386bsd_vec)                tb="$tb i386bsd.lo aout32.lo" ;;
824     i386coff_vec)               tb="$tb coff-i386.lo cofflink.lo" ;;
825     x86_64coff_vec)             tb="$tb coff-x86_64.lo cofflink.lo"; target_size=64 ;;
826     i386dynix_vec)              tb="$tb i386dynix.lo aout32.lo" ;;
827     i386freebsd_vec)            tb="$tb i386freebsd.lo aout32.lo" ;;
828     i386linux_vec)              tb="$tb i386linux.lo aout32.lo" ;;
829     i386lynx_aout_vec)          tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
830     i386lynx_coff_vec)          tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
831     i386mach3_vec)              tb="$tb i386mach3.lo aout32.lo" ;;
832     i386msdos_vec)              tb="$tb i386msdos.lo" ;;
833     i386netbsd_vec)             tb="$tb i386netbsd.lo aout32.lo" ;;
834     i386os9k_vec)               tb="$tb i386os9k.lo aout32.lo" ;;
835     i386pe_vec)                 tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
836     i386pei_vec)                tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
837     x86_64pe_vec)               tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
838     x86_64pei_vec)              tb="$tb pei-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
839     i860coff_vec)               tb="$tb coff-i860.lo cofflink.lo" ;;
840     icoff_big_vec)              tb="$tb coff-i960.lo cofflink.lo" ;;
841     icoff_little_vec)           tb="$tb coff-i960.lo cofflink.lo" ;;
842     ieee_vec)                   tb="$tb ieee.lo" ;;
843     m68k4knetbsd_vec)           tb="$tb m68k4knetbsd.lo aout32.lo" ;;
844     m68kaux_coff_vec)           tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
845     m68kcoff_vec)               tb="$tb coff-m68k.lo cofflink.lo" ;;
846     m68kcoffun_vec)             tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;;
847     m68klinux_vec)              tb="$tb m68klinux.lo aout32.lo" ;;
848     m68knetbsd_vec)             tb="$tb m68knetbsd.lo aout32.lo" ;;
849     m68ksysvcoff_vec)           tb="$tb coff-svm68k.lo cofflink.lo" ;;
850     m88kbcs_vec)                tb="$tb coff-m88k.lo" ;;
851     m88kmach3_vec)              tb="$tb m88kmach3.lo aout32.lo" ;;
852     m88kopenbsd_vec)            tb="$tb m88kopenbsd.lo aout32.lo" ;;
853     maxqcoff_vec)               tb="$tb coff-maxq.lo" ;;
854     mach_o_be_vec)              tb="$tb mach-o.lo" ;;
855     mach_o_le_vec)              tb="$tb mach-o.lo" ;;
856     mach_o_fat_vec)             tb="$tb mach-o.lo" ;;
857     mcore_pe_big_vec)           tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
858     mcore_pe_little_vec)        tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
859     mcore_pei_big_vec)          tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
860     mcore_pei_little_vec)       tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
861     mipslpe_vec)                tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;;
862     mipslpei_vec)               tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;;
863     newsos3_vec)                tb="$tb newsos3.lo aout32.lo" ;;
864     nlm32_alpha_vec)            tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;;
865     nlm32_i386_vec)             tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
866     nlm32_powerpc_vec)          tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
867     nlm32_sparc_vec)            tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
868     or32coff_big_vec)           tb="$tb coff-or32.lo cofflink.lo" ;;
869     pc532machaout_vec)          tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
870     pc532netbsd_vec)            tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
871     pef_vec)                    tb="$tb pef.lo" ;;
872     pef_xlib_vec)               tb="$tb pef.lo" ;;
873     pdp11_aout_vec)             tb="$tb pdp11.lo" ;;
874     pmac_xcoff_vec)             tb="$tb coff-rs6000.lo xcofflink.lo" ;;
875     ppcboot_vec)                tb="$tb ppcboot.lo" ;;
876     riscix_vec)                 tb="$tb aout32.lo riscix.lo" ;;
877     rs6000coff64_vec)           tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
878     rs6000coff_vec)             tb="$tb coff-rs6000.lo xcofflink.lo" ;;
879     shcoff_small_vec)           tb="$tb coff-sh.lo cofflink.lo" ;;
880     shcoff_vec)                 tb="$tb coff-sh.lo cofflink.lo" ;;
881     shlcoff_small_vec)          tb="$tb coff-sh.lo cofflink.lo" ;;
882     shlcoff_vec)                tb="$tb coff-sh.lo cofflink.lo" ;;
883     shlpe_vec)                  tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
884     shlpei_vec)                 tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
885     som_vec)                    tb="$tb som.lo" ;;
886     sparccoff_vec)              tb="$tb coff-sparc.lo" ;;
887     sparcle_aout_vec)           tb="$tb aout-sparcle.lo aout32.lo" ;;
888     sparclinux_vec)             tb="$tb sparclinux.lo aout32.lo" ;;
889     sparclynx_aout_vec)         tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
890     sparclynx_coff_vec)         tb="$tb cf-sparclynx.lo lynx-core.lo" ;;
891     sparcnetbsd_vec)            tb="$tb sparcnetbsd.lo aout32.lo" ;;
892     sunos_big_vec)              tb="$tb sunos.lo aout32.lo" ;;
893     sym_vec)                    tb="$tb xsym.lo" ;;
894     tic30_aout_vec)             tb="$tb aout-tic30.lo" ;;
895     tic30_coff_vec)             tb="$tb coff-tic30.lo" ;;
896     tic4x_coff0_vec)            tb="$tb coff-tic4x.lo" ;;
897     tic4x_coff0_beh_vec)        tb="$tb coff-tic4x.lo" ;;
898     tic4x_coff1_vec)            tb="$tb coff-tic4x.lo" ;;
899     tic4x_coff1_beh_vec)        tb="$tb coff-tic4x.lo" ;;
900     tic4x_coff2_vec)            tb="$tb coff-tic4x.lo" ;;
901     tic4x_coff2_beh_vec)        tb="$tb coff-tic4x.lo" ;;
902     tic54x_coff0_beh_vec)       tb="$tb coff-tic54x.lo" ;;
903     tic54x_coff0_vec)           tb="$tb coff-tic54x.lo" ;;
904     tic54x_coff1_beh_vec)       tb="$tb coff-tic54x.lo" ;;
905     tic54x_coff1_vec)           tb="$tb coff-tic54x.lo" ;;
906     tic54x_coff2_beh_vec)       tb="$tb coff-tic54x.lo" ;;
907     tic54x_coff2_vec)           tb="$tb coff-tic54x.lo" ;;
908     tic80coff_vec)              tb="$tb coff-tic80.lo cofflink.lo" ;;
909     vaxnetbsd_vec)              tb="$tb vaxnetbsd.lo aout32.lo" ;;
910     vax1knetbsd_vec)            tb="$tb vax1knetbsd.lo aout32.lo" ;;
911     vaxbsd_vec)                 tb="$tb vaxbsd.lo aout32.lo" ;;
912     versados_vec)               tb="$tb versados.lo" ;;
913     vms_alpha_vec)              tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"; target_size=64 ;;
914     vms_vax_vec)                tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;;
915     w65_vec)                    tb="$tb coff-w65.lo reloc16.lo" ;;
916     we32kcoff_vec)              tb="$tb coff-we32k.lo" ;;
917     z80coff_vec)                tb="$tb coff-z80.lo reloc16.lo" ;;
918     z8kcoff_vec)                tb="$tb coff-z8k.lo reloc16.lo cofflink.lo" ;;
919
920     # These appear out of order in targets.c
921     srec_vec)                   tb="$tb srec.lo" ;;
922     symbolsrec_vec)             tb="$tb srec.lo" ;;
923     tekhex_vec)                 tb="$tb tekhex.lo" ;;
924     cisco_core_big_vec)         tb="$tb cisco-core.lo" ;;
925     cisco_core_little_vec)      tb="$tb cisco-core.lo" ;;
926
927     "")                 ;;
928     *) AC_MSG_ERROR(*** unknown target vector $vec) ;;
929     esac
930
931     if test ${target_size} = 64; then
932         target64=true
933     fi
934     if test x"${vec}" = x"${defvec}"; then
935         bfd_default_target_size=${target_size}
936     fi
937 done
938
939 # Target architecture .o files.
940 # A couple of CPUs use shorter file names to avoid problems on DOS
941 # filesystems.
942 ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.lo/g -e s/mn10200/m10200/ -e s/mn10300/m10300/`
943
944 # Weed out duplicate .o files.
945 f=""
946 for i in $tb ; do
947     case " $f " in
948     *" $i "*) ;;
949     *) f="$f $i" ;;
950     esac
951 done
952 tb="$f"
953
954 f=""
955 for i in $ta ; do
956     case " $f " in
957     *" $i "*) ;;
958     *) f="$f $i" ;;
959     esac
960 done
961 ta="$f"
962
963 bfd_backends="$tb"
964 bfd_machines="$ta"
965
966 if test x${all_targets} = xtrue ; then
967   bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
968   bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
969   selvecs=
970   havevecs=
971   selarchs=
972   test -n "$assocvecs" &&
973     assocvecs=`echo $assocvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
974 else    # all_targets is true
975   # Only set these if they will be nonempty, for the clever echo.
976   havevecs=
977   assocvecs=
978   test -n "$selvecs" &&
979     havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'`
980   test -n "$selvecs" &&
981     selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
982   test -n "$selarchs" &&
983     selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
984 fi      # all_targets is true
985
986 case ${host64}-${target64}-${want64} in
987   *true*)
988     wordsize=64
989     bfd64_libs='$(BFD64_LIBS)'
990     all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
991     if test $BFD_HOST_64_BIT_DEFINED = 0; then
992       AC_MSG_WARN([You have requested a 64 bit BFD configuration, but])
993       AC_MSG_WARN([your compiler may not have a 64 bit integral type])
994     fi
995     if test -n "$GCC" ; then
996        bad_64bit_gcc=no;
997        AC_MSG_CHECKING([for gcc version with buggy 64-bit support])
998        # Add more tests for gcc versions with non-working 64-bit support here.
999        AC_EGREP_CPP([: 2 : 91 : 1 :],[:__GNUC__:__GNUC_MINOR__:__i386__:],
1000                     bad_64bit_gcc=yes;
1001                     AC_MSG_RESULT([yes: egcs-1.1.2 on ix86 spotted]),
1002                     AC_MSG_RESULT(no))
1003        if test $bad_64bit_gcc = yes ; then
1004          AC_MSG_ERROR([A newer version of gcc is needed for the requested 64-bit BFD configuration])
1005        fi
1006     fi
1007     ;;
1008   false-false-false)
1009     wordsize=32
1010     all_backends='$(BFD32_BACKENDS)'
1011     ;;
1012 esac
1013
1014 AC_SUBST(wordsize)
1015 AC_SUBST(bfd64_libs)
1016 AC_SUBST(all_backends)
1017 AC_SUBST(bfd_backends)
1018 AC_SUBST(bfd_machines)
1019 AC_SUBST(bfd_default_target_size)
1020
1021 # Determine the host dependant file_ptr a.k.a. off_t type.  In order
1022 # prefer: off64_t - if ftello64 and fseeko64, off_t - if ftello and
1023 # fseeko, long.  This assumes that sizeof off_t is .ge. sizeof long.
1024 # Hopefully a reasonable assumption since fseeko et.al. should be
1025 # upward compatible.
1026 AC_CHECK_FUNCS(ftello ftello64 fseeko fseeko64 fopen64)
1027 if test x"$ac_cv_func_ftello" = xyes -a x"$ac_cv_func_fseeko" = xyes; then
1028     AC_CHECK_SIZEOF(off_t)
1029 fi
1030 AC_MSG_CHECKING([file_ptr type])
1031 bfd_file_ptr="long"
1032 bfd_ufile_ptr="unsigned long"
1033 if test x"$ac_cv_func_ftello64" = xyes -a x"$ac_cv_func_fseeko64" = xyes \
1034         -o x"${ac_cv_sizeof_off_t}" = x8; then
1035     bfd_file_ptr=BFD_HOST_64_BIT
1036     bfd_ufile_ptr=BFD_HOST_U_64_BIT
1037 fi
1038 AC_MSG_RESULT($bfd_file_ptr)
1039 AC_SUBST(bfd_file_ptr)
1040 AC_SUBST(bfd_ufile_ptr)
1041
1042
1043 tdefaults=""
1044 test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
1045 test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
1046 test -n "${assocvecs}" && tdefaults="${tdefaults} -DASSOCIATED_VECS='${assocvecs}'"
1047 test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
1048 test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}"
1049 AC_SUBST(tdefaults)
1050
1051 dnl AC_CHECK_HEADERS(sys/mman.h)
1052 AC_FUNC_MMAP
1053 AC_CHECK_FUNCS(madvise mprotect)
1054 case ${want_mmap}+${ac_cv_func_mmap_fixed_mapped} in
1055   true+yes )  AC_DEFINE(USE_MMAP, 1, [Use mmap if it's available?]) ;;
1056 esac
1057
1058 rm -f doc/config.status
1059 AC_CONFIG_FILES([Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in])
1060
1061 dnl We need this duplication, even though we use AM_PO_SUBDIRS, because of
1062 dnl our two separate POTFILES.  Yuck.
1063 AC_CONFIG_COMMANDS([default],
1064 [[
1065 case "$srcdir" in
1066   .) srcdirpre= ;;
1067   *) srcdirpre='$(srcdir)/' ;;
1068 esac
1069 POFILES=
1070 GMOFILES=
1071 for lang in dummy $OBSOLETE_ALL_LINGUAS; do
1072   if test $lang != dummy; then
1073     POFILES="$POFILES $srcdirpre$lang.po"
1074     GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1075   fi
1076 done
1077 sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' \
1078     -e '/BLD-POTFILES =/r po/BLD-POTFILES' \
1079     -e "s,@POFILES@,$POFILES," \
1080     -e "s,@GMOFILES@,$GMOFILES," \
1081     po/Makefile.in > po/Makefile]],[[]])
1082
1083 dnl Required by html, pdf, install-pdf and install-html
1084 AC_SUBST(datarootdir)
1085 AC_SUBST(docdir)
1086 AC_SUBST(htmldir)
1087 AC_SUBST(pdfdir)
1088
1089 AC_OUTPUT
1090