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