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