[MIPS] Implement O32 FPXX, FP64 and FP64A ABI extensions
[platform/upstream/binutils.git] / bfd / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 dnl   Copyright (C) 2012-2014 Free Software Foundation, Inc.
4 dnl
5 dnl This file is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; either version 3 of the License, or
8 dnl (at your option) any later version.
9 dnl 
10 dnl This program is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 dnl GNU General Public License for more details.
14 dnl 
15 dnl You should have received a copy of the GNU General Public License
16 dnl along with this program; see the file COPYING3.  If not see
17 dnl <http://www.gnu.org/licenses/>.
18 dnl
19
20 AC_PREREQ(2.59)
21 m4_include([version.m4])
22 AC_INIT([bfd], BFD_VERSION)
23 AC_CONFIG_SRCDIR([libbfd.c])
24
25 AC_CANONICAL_TARGET
26 AC_ISC_POSIX
27
28 AM_INIT_AUTOMAKE
29
30 dnl These must be called before LT_INIT, because it may want
31 dnl to call AC_CHECK_PROG.
32 AC_CHECK_TOOL(AR, ar)
33 AC_CHECK_TOOL(RANLIB, ranlib, :)
34
35 dnl Default to a non shared library.  This may be overridden by the
36 dnl configure option --enable-shared.
37 AC_DISABLE_SHARED
38
39 AC_PROG_CC
40 AC_GNU_SOURCE
41 AC_USE_SYSTEM_EXTENSIONS
42
43 LT_INIT([dlopen])
44
45 # AC_PLUGINS setting $plugins is called by ACX_LARGEFILE.
46 ACX_LARGEFILE
47
48 AM_CONDITIONAL(PLUGINS, test "$plugins" = "yes")
49
50 if test "$plugins" = "yes"; then
51   if test "$enable_dlopen" != "yes" ; then
52     AC_MSG_ERROR([
53       Building BFD with plugin support requires a host that supports -ldl.])
54   fi
55   enable_targets="$enable_targets plugin"
56 fi
57
58 AC_ARG_ENABLE(64-bit-bfd,
59 [  --enable-64-bit-bfd     64-bit support (on hosts with narrower word sizes)],
60 [case "${enableval}" in
61   yes)  want64=true  ;;
62   no)   want64=false ;;
63   *)    AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
64 esac],[want64=false])dnl
65
66 AC_ARG_ENABLE(targets,
67 [  --enable-targets        alternative target configurations],
68 [case "${enableval}" in
69   yes | "") AC_MSG_ERROR([enable-targets option must specify target names or 'all'])
70             ;;
71   no)       enable_targets= ;;
72   *)        enable_targets=$enableval ;;
73 esac])dnl
74
75 AC_ARG_WITH(mmap,
76 [  --with-mmap             try using mmap for BFD input files if available],
77 [case "${withval}" in
78   yes)  want_mmap=true ;;
79   no)   want_mmap=false ;;
80   *)    AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;;
81 esac],[want_mmap=false])dnl
82
83 AC_ARG_ENABLE(secureplt,
84 [  --enable-secureplt      Default to creating read-only plt entries],
85 [case "${enableval}" in
86   yes)  use_secureplt=true  ;;
87   no)   use_secureplt=false ;;
88   *)    AC_MSG_ERROR(bad value ${enableval} for secureplt option) ;;
89 esac],[use_secureplt=true])dnl
90 if test $use_secureplt = true; then
91   AC_DEFINE(USE_SECUREPLT, 1,
92     [Define if we should default to creating read-only plt entries])
93 fi
94
95 AC_ARG_ENABLE(leading-mingw64-underscores,
96   AS_HELP_STRING([--enable-leading-mingw64-underscores],
97                  [Enable leading underscores on 64 bit mingw targets]),
98   [],[])
99 AS_IF([ test x"$enable_leading_mingw64_underscores" = xyes ],
100   [AC_DEFINE(USE_MINGW64_LEADING_UNDERSCORES, 1,
101     [Define if we should use leading underscore on 64 bit mingw targets])])
102
103 DEBUGDIR=${libdir}/debug
104 AC_ARG_WITH(separate-debug-dir,
105   AS_HELP_STRING([--with-separate-debug-dir=DIR],
106                  [Look for global separate debug info in DIR [[default=LIBDIR/debug]]]),
107 [DEBUGDIR="${withval}"])
108 AC_SUBST(DEBUGDIR)
109
110 # Check to see if we should allow the generation of
111 # symbols with the ELF standard's STT_COMMON type.
112 AC_ARG_ENABLE(elf-stt-common,
113 [  --enable-elf-stt-common Allow the generation of ELF symbols with the STT_COMMON type],
114 [case "${enableval}" in
115   yes) want_elf_stt_common=true ;;
116   no)  want_elf_stt_common=false ;;
117   *)   AC_MSG_ERROR(bad value ${enableval} for ELF STT_COMMON option) ;;
118  esac],
119 # We have to choose a default behaviour.  For native builds we could
120 # test whether the loader supports the STT_COMMON type, but that would
121 # mean that built binaries could not be exported to older systems where
122 # the loader does not support it. So by default we always choose to
123 # disable this feature.
124   want_elf_stt_common=false)dnl
125 if test $want_elf_stt_common = true; then
126   AC_DEFINE(USE_STT_COMMON, 1,
127     [Define if we may generate symbols with ELF's STT_COMMON type])
128 fi
129
130 ACX_PKGVERSION([GNU Binutils])
131 ACX_BUGURL([http://www.sourceware.org/bugzilla/])
132
133 AM_BINUTILS_WARNINGS
134
135 AC_CONFIG_HEADERS(config.h:config.in)
136
137 # PR 14072
138 AH_VERBATIM([00_CONFIG_H_CHECK],
139 [/* Check that config.h is #included before system headers
140     (this works only for glibc, but that should be enough).  */
141 #if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__)
142 #  error config.h must be #included before system headers
143 #endif
144 #define __CONFIG_H__ 1])
145
146 if test -z "$target" ; then
147     AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
148 fi
149
150 AM_MAINTAINER_MODE
151 AM_CONDITIONAL(GENINSRC_NEVER, false)
152 AM_INSTALL_LIBBFD
153 AC_EXEEXT
154
155 host64=false
156 target64=false
157 bfd_default_target_size=32
158
159 # host stuff:
160
161 ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw vi fi id ru uk"
162 ZW_GNU_GETTEXT_SISTER_DIR
163 AM_PO_SUBDIRS
164
165 # Permit host specific settings.
166 . ${srcdir}/configure.host
167
168 AC_SUBST(HDEFINES)
169 AC_PROG_INSTALL
170
171 BFD_HOST_64BIT_LONG=0
172 BFD_HOST_64BIT_LONG_LONG=0
173 BFD_HOST_64_BIT_DEFINED=0
174 BFD_HOST_64_BIT=
175 BFD_HOST_U_64_BIT=
176 BFD_HOSTPTR_T="unsigned long"
177
178 AC_CHECK_SIZEOF(long long)
179 AC_CHECK_SIZEOF(void *)
180 AC_CHECK_SIZEOF(long)
181
182 if test "x${ac_cv_sizeof_void_p}" = "x8"; then
183   host64=true
184 fi
185
186 if test "x${ac_cv_sizeof_long}" = "x8"; then
187   BFD_HOST_64BIT_LONG=1
188   test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long"
189   test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long"
190 elif test "x${ac_cv_sizeof_long_long}" = "x8"; then
191   BFD_HOST_64BIT_LONG_LONG=1
192   test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long"
193   test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long"
194   if test "x${ac_cv_sizeof_void_p}" = "x8"; then
195     BFD_HOSTPTR_T="unsigned long long"
196   fi
197 fi
198
199 if test -n "${HOST_64BIT_TYPE}" -a -n "${HOST_U_64BIT_TYPE}"; then
200   BFD_HOST_64_BIT_DEFINED=1
201   BFD_HOST_64_BIT="${HOST_64BIT_TYPE}"
202   BFD_HOST_U_64_BIT="${HOST_U_64BIT_TYPE}"
203 fi
204
205 AC_SUBST(BFD_HOST_64BIT_LONG)
206 AC_SUBST(BFD_HOST_64BIT_LONG_LONG)
207 AC_SUBST(BFD_HOST_64_BIT_DEFINED)
208 AC_SUBST(BFD_HOST_64_BIT)
209 AC_SUBST(BFD_HOST_U_64_BIT)
210 AC_SUBST(BFD_HOSTPTR_T)
211
212 BFD_CC_FOR_BUILD
213
214 AC_CHECK_HEADERS(alloca.h stddef.h string.h strings.h stdlib.h time.h unistd.h wchar.h)
215 AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h sys/stat.h sys/resource.h)
216 GCC_HEADER_STDINT(bfd_stdint.h)
217 AC_HEADER_TIME
218 AC_HEADER_DIRENT
219
220 AC_CHECK_HEADERS(windows.h dlfcn.h)
221
222 ACX_HEADER_STRING
223 AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid fileno)
224 AC_CHECK_FUNCS(strtoull getrlimit)
225
226 AC_CHECK_DECLS(basename)
227 AC_CHECK_DECLS(ftello)
228 AC_CHECK_DECLS(ftello64)
229 AC_CHECK_DECLS(fseeko)
230 AC_CHECK_DECLS(fseeko64)
231
232 BFD_BINARY_FOPEN
233
234 AC_CHECK_DECLS(ffs)
235 AC_CHECK_DECLS(free)
236 AC_CHECK_DECLS(getenv)
237 AC_CHECK_DECLS(malloc)
238 AC_CHECK_DECLS(realloc)
239 AC_CHECK_DECLS(stpcpy)
240 AC_CHECK_DECLS(strstr)
241 AC_CHECK_DECLS(snprintf)
242 AC_CHECK_DECLS(vsnprintf)
243 AC_CHECK_DECLS(strnlen)
244
245 # Link in zlib if we can.  This allows us to read compressed debug sections.
246 # This is used only by compress.c.
247 AM_ZLIB
248
249 # If we are configured native, pick a core file support file.
250 COREFILE=
251 COREFLAG=
252 CORE_HEADER=
253 TRAD_HEADER=
254 if test "${target}" = "${host}"; then
255   case "${host}" in
256   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu | alpha*-*-*vms*)
257         COREFILE=''
258         ;;
259   alpha*-*-linux-*)
260         COREFILE=trad-core.lo
261         TRAD_HEADER='"hosts/alphalinux.h"'
262         ;;
263   alpha*-*-netbsd* | alpha*-*-openbsd*)
264         COREFILE=netbsd-core.lo
265         ;;
266   alpha*-*-*)
267         COREFILE=osf-core.lo
268         ;;
269   arm-*-freebsd* | arm-*-kfreebsd*-gnu)
270         COREFILE='' ;;
271   arm-*-netbsd* | arm-*-openbsd*)
272         COREFILE=netbsd-core.lo
273         ;;
274   arm-*-riscix)         COREFILE=trad-core.lo ;;
275   hppa*-*-hpux*)        COREFILE=hpux-core.lo ;;
276   hppa*-*-hiux*)        COREFILE=hpux-core.lo ;;
277   hppa*-*-mpeix*)       COREFILE=hpux-core.lo ;;
278   hppa*-*-bsd*)         COREFILE="hpux-core.lo hppabsd-core.lo"
279                         COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
280   hppa*-*-netbsd* | hppa*-*-openbsd*)
281         COREFILE=netbsd-core.lo
282         ;;
283
284   i370-*-*)
285         COREFILE=trad-core.lo
286         TRAD_HEADER='"hosts/i370linux.h"'
287         ;;
288
289 changequote(,)dnl
290   i[3-7]86-sequent-bsd*)
291 changequote([,])dnl
292         COREFILE=trad-core.lo
293         TRAD_HEADER='"hosts/symmetry.h"'
294         ;;
295 changequote(,)dnl
296   i[3-7]86-sequent-sysv4*) ;;
297   i[3-7]86-sequent-sysv*)
298 changequote([,])dnl
299         COREFILE=trad-core.lo
300         TRAD_HEADER='"hosts/symmetry.h"'
301         ;;
302 changequote(,)dnl
303   i[3-7]86-*-bsdi)
304 changequote([,])dnl
305         COREFILE=
306         ;;
307 changequote(,)dnl
308   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*)
309 changequote([,])dnl
310         COREFILE=trad-core.lo
311         TRAD_HEADER='"hosts/i386bsd.h"'
312         ;;
313 changequote(,)dnl
314   i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu | i[3-7]86-*-dragonfly*)
315 changequote([,])dnl
316         COREFILE=''
317         TRAD_HEADER='"hosts/i386bsd.h"'
318         ;;
319 changequote(,)dnl
320   i[3-7]86-*-netbsd* | i[3-7]86-*-knetbsd*-gnu | i[3-7]86-*-openbsd*)
321 changequote([,])dnl
322         COREFILE=netbsd-core.lo
323         ;;
324 changequote(,)dnl
325   i[3-7]86-esix-sysv3*)
326 changequote([,])dnl
327         COREFILE=trad-core.lo
328         TRAD_HEADER='"hosts/esix.h"'
329         ;;
330 changequote(,)dnl
331   i[3-7]86-*-sco3.2v5*)
332 changequote([,])dnl
333         COREFILE=sco5-core.lo
334         ;;
335 changequote(,)dnl
336   i[3-7]86-*-sco* | i[3-7]86-*-isc*)
337 changequote([,])dnl
338         COREFILE=trad-core.lo
339         TRAD_HEADER='"hosts/i386sco.h"'
340         ;;
341 changequote(,)dnl
342   i[3-7]86-*-mach3*)
343 changequote([,])dnl
344         COREFILE=trad-core.lo
345         TRAD_HEADER='"hosts/i386mach3.h"'
346         ;;
347 changequote(,)dnl
348   i[3-7]86-*-linux-*)
349 changequote([,])dnl
350         COREFILE=trad-core.lo
351         TRAD_HEADER='"hosts/i386linux.h"'
352         case "$enable_targets"-"$want64" in
353         *x86_64-*linux*|*-true)
354           CORE_HEADER='"hosts/x86-64linux.h"'
355         esac
356         ;;
357 changequote(,)dnl
358   i[3-7]86-*-isc*)      COREFILE=trad-core.lo ;;
359   i[3-7]86-*-aix*)      COREFILE=aix386-core.lo ;;
360 changequote([,])dnl
361   i860-*-mach3* | i860-*-osf1*)
362         COREFILE=trad-core.lo
363         TRAD_HEADER='"hosts/i860mach3.h"'
364         ;;
365   mips-*-netbsd* | mips*-*-openbsd*)
366         COREFILE=netbsd-core.lo
367         ;;
368   mips-dec-*)
369         COREFILE=trad-core.lo
370         TRAD_HEADER='"hosts/decstation.h"'
371         ;;
372   mips-sgi-irix4*)      COREFILE=irix-core.lo ;;
373   mips-sgi-irix5*)      COREFILE=irix-core.lo ;;
374   mips-sgi-irix6*)      COREFILE=irix-core.lo ;;
375   mips-*-sysv4*)        ;;
376   mips-*-sysv* | mips-*-riscos*)
377         COREFILE=trad-core.lo
378         TRAD_HEADER='"hosts/riscos.h"'
379         ;;
380   mips-sony-bsd*)
381         COREFILE=trad-core.lo
382         TRAD_HEADER='"hosts/news-mips.h"'
383         ;;
384   m68*-bull*-sysv*)
385         COREFILE=trad-core.lo
386         TRAD_HEADER='"hosts/dpx2.h"'
387         ;;
388   m68*-hp-hpux*)        COREFILE=hpux-core.lo ;;
389   m68*-hp-bsd*)
390         COREFILE=trad-core.lo
391         TRAD_HEADER='"hosts/hp300bsd.h"'
392         ;;
393   m68*-*-linux-*)
394         COREFILE=trad-core.lo
395         TRAD_HEADER='"hosts/m68klinux.h"'
396         ;;
397   m68*-motorola-sysv*)
398         COREFILE=trad-core.lo
399         TRAD_HEADER='"hosts/delta68.h"'
400         ;;
401   m68*-sony-*)
402         COREFILE=trad-core.lo
403         TRAD_HEADER='"hosts/news.h"'
404         ;;
405   m68*-*-netbsd* | m68*-*-openbsd*)
406         COREFILE=netbsd-core.lo
407         ;;
408   m68*-apple-aux*)
409         COREFILE=trad-core.lo
410         TRAD_HEADER='"hosts/m68kaux.h"'
411         ;;
412   m88*-*-sysv4*)
413         ;;
414   m88*-motorola-sysv*)
415         COREFILE=ptrace-core.lo
416         ;;
417   m88*-*-mach3*)
418         COREFILE=trad-core.lo
419         TRAD_HEADER='"hosts/m88kmach3.h"'
420         ;;
421   m88*-*-openbsd*)
422         COREFILE=netbsd-core.lo
423         ;;
424   ns32k-pc532-mach)
425         COREFILE=trad-core.lo
426         TRAD_HEADER='"hosts/pc532mach.h"'
427         ;;
428   ns32k-*-netbsd* | ns32k-*-openbsd*)
429         COREFILE=netbsd-core.lo
430         ;;
431   rs6000-*-lynx*)
432         COREFILE=lynx-core.lo
433         ;;
434 changequote(,)dnl
435   rs6000-*-aix[5-9].* | powerpc-*-aix[5-9].*)
436 changequote([,])dnl
437         COREFILE=rs6000-core.lo
438         COREFLAG="$COREFLAG -DAIX_5_CORE -DAIX_CORE_DUMPX_CORE"
439         ;;
440 changequote(,)dnl
441   rs6000-*-aix4.[3-9]* | powerpc-*-aix4.[3-9]*)
442 changequote([,])dnl
443         COREFILE=rs6000-core.lo
444         COREFLAG="$COREFLAG -DAIX_CORE_DUMPX_CORE"
445         # Not all versions of AIX with -DAIX_CORE_DUMPX_CORE
446         # have c_impl as a member of struct core_dumpx
447         AC_MSG_CHECKING([for c_impl in struct core_dumpx])
448         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <core.h>]], [[struct core_dumpx c; c.c_impl = 0;]])],[AC_DEFINE(HAVE_ST_C_IMPL, 1,
449             [Define if struct core_dumpx has member c_impl])
450           AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
451         ;;
452   rs6000-*-aix4*)       COREFILE=rs6000-core.lo ;;
453   rs6000-*-*)           COREFILE=rs6000-core.lo ;;
454   powerpc-*-aix4*)      COREFILE=rs6000-core.lo ;;
455   powerpc-*-aix*)       COREFILE=rs6000-core.lo ;;
456   powerpc-*-beos*)      ;;
457   powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu)
458                         COREFILE='' ;;
459   powerpc-*-netbsd*)    COREFILE=netbsd-core.lo ;;
460   powerpc-*-*bsd*)      COREFILE=netbsd-core.lo ;;
461   s390*-*-*)            COREFILE=trad-core.lo ;;
462   sh*-*-netbsd* | sh*-*-openbsd*)
463         COREFILE=netbsd-core.lo
464         ;;
465   sparc-*-netbsd* | sparc*-*-openbsd*)
466         COREFILE=netbsd-core.lo
467         ;;
468   tahoe-*-*)
469         COREFILE=trad-core.lo
470         TRAD_HEADER='"hosts/tahoe.h"'
471         ;;
472   vax-*-netbsd* | vax-*-openbsd*)
473         COREFILE=netbsd-core.lo
474         ;;
475   vax-*-ultrix2*)
476         COREFILE=trad-core.lo
477         TRAD_HEADER='"hosts/vaxult2.h"'
478         ;;
479   vax-*-ultrix*)
480         COREFILE=trad-core.lo
481         TRAD_HEADER='"hosts/vaxult2.h"'
482         ;;
483   vax-*-linux-*)
484         COREFILE=trad-core.lo
485         TRAD_HEADER='"hosts/vaxlinux.h"'
486         ;;
487   vax-*-*)
488         COREFILE=trad-core.lo
489         TRAD_HEADER='"hosts/vaxbsd.h"'
490         ;;
491   x86_64-*-linux*)
492         CORE_HEADER='"hosts/x86-64linux.h"'
493         ;;
494   x86_64-*-netbsd* | x86_64-*-openbsd*)
495         COREFILE=netbsd-core.lo
496         ;;
497   esac
498
499   case "$COREFILE" in
500   aix386-core.lo)       COREFLAG=-DAIX386_CORE ;;
501   hppabsd-core.lo)      COREFLAG=-DHPPABSD_CORE ;;
502   hpux-core.lo)         COREFLAG=-DHPUX_CORE ;;
503   irix-core.lo)         COREFLAG=-DIRIX_CORE ;;
504   lynx-core.lo)         COREFLAG=-DLYNX_CORE ;;
505   netbsd-core.lo)       COREFLAG=-DNETBSD_CORE ;;
506   osf-core.lo)          COREFLAG=-DOSF_CORE ;;
507   ptrace-core.lo)       COREFLAG=-DPTRACE_CORE ;;
508   rs6000-core.lo)       COREFLAG="$COREFLAG -DAIX_CORE" ;;
509   sco5-core.lo)         COREFLAG="$COREFLAG -DSCO5_CORE" ;;
510   trad-core.lo)         COREFLAG="$COREFLAG -DTRAD_CORE" ;;
511   esac
512
513   # ELF corefile support has several flavors, but all of
514   # them use something called <sys/procfs.h>
515   AC_CHECK_HEADERS(sys/procfs.h)
516   if test "$ac_cv_header_sys_procfs_h" = yes; then
517     BFD_HAVE_SYS_PROCFS_TYPE(prstatus_t)
518     BFD_HAVE_SYS_PROCFS_TYPE(prstatus32_t)
519     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus_t, pr_who)
520     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus32_t, pr_who)
521     BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t)
522     BFD_HAVE_SYS_PROCFS_TYPE(pxstatus_t)
523     BFD_HAVE_SYS_PROCFS_TYPE(pstatus32_t)
524     BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo_t)
525     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prpsinfo_t, pr_pid)
526     BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo32_t)
527     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prpsinfo32_t, pr_pid)
528     BFD_HAVE_SYS_PROCFS_TYPE(psinfo_t)
529     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(psinfo_t, pr_pid)
530     BFD_HAVE_SYS_PROCFS_TYPE(psinfo32_t)
531     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(psinfo32_t, pr_pid)
532     BFD_HAVE_SYS_PROCFS_TYPE(lwpstatus_t)
533     BFD_HAVE_SYS_PROCFS_TYPE(lwpxstatus_t)
534     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_context)
535     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_reg)
536     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_fpreg)
537     BFD_HAVE_SYS_PROCFS_TYPE(win32_pstatus_t)
538   fi
539 fi
540 AC_SUBST(COREFILE)
541 AC_SUBST(COREFLAG)
542 if test -n "$CORE_HEADER"; then
543   AC_DEFINE_UNQUOTED(CORE_HEADER, $CORE_HEADER,
544     [Name of host specific core header file to include in elf.c.])
545 fi
546 if test -n "$TRAD_HEADER"; then
547   AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER,
548     [Name of host specific header file to include in trad-core.c.])
549 fi
550
551 # Check if linker supports --as-needed and --no-as-needed options
552 AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed,
553         [bfd_cv_ld_as_needed=no
554         if $LD --help 2>/dev/null | grep as-needed > /dev/null; then
555                 bfd_cv_ld_as_needed=yes
556         fi
557         ])
558
559 LT_LIB_M
560
561 # When building a shared libbfd, link against the pic version of libiberty
562 # so that apps that use libbfd won't need libiberty just to satisfy any
563 # libbfd references.
564 # We can't do that if a pic libiberty is unavailable since including non-pic
565 # code would insert text relocations into libbfd.
566 SHARED_LIBADD=
567 SHARED_LDFLAGS=
568 if test "$enable_shared" = "yes"; then
569 changequote(,)dnl
570   x=`sed -n -e 's/^[    ]*PICFLAG[      ]*=[    ]*//p' < ../libiberty/Makefile | sed -n '$p'`
571 changequote([,])dnl
572   if test -n "$x"; then
573     SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
574   fi
575
576 # More hacks to build DLLs on Windows.
577   case "${host}" in
578   *-*-cygwin*)
579     SHARED_LDFLAGS="-no-undefined"
580     SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32"
581   ;;
582
583   # Hack to build or1k-src on OSX
584   or1k*-*-darwin*)
585     SHARED_LIBADD="-L`pwd`/../libiberty/pic -L`pwd`/../intl -liberty -lintl"
586   ;;
587   esac
588
589   if test -n "$SHARED_LIBADD"; then
590     if test -n "$LIBM"; then
591       if test x"$bfd_cv_ld_as_needed" = xyes; then
592         # Link against libm only when needed.  Put -lc, -lm inside -Wl
593         # to stop libtool reordering these options.
594         SHARED_LIBADD="$SHARED_LIBADD -Wl,-lc,--as-needed,`echo $LIBM | sed 's/ /,/g'`,--no-as-needed"
595       else
596         SHARED_LIBADD="$SHARED_LIBADD $LIBM"
597       fi
598     fi
599   fi
600 fi
601 AC_SUBST(SHARED_LDFLAGS)
602 AC_SUBST(SHARED_LIBADD)
603
604 # target stuff:
605
606 # Canonicalize the secondary target names.
607 if test -n "$enable_targets" ; then
608     for targ in `echo $enable_targets | sed 's/,/ /g'`
609     do
610         result=`$ac_config_sub $targ 2>/dev/null`
611         if test -n "$result" ; then
612             canon_targets="$canon_targets $result"
613         else
614             # Allow targets that config.sub doesn't recognize, like "all".
615             canon_targets="$canon_targets $targ"
616         fi
617     done
618 fi
619
620 all_targets=false
621 defvec=
622 selvecs=
623 assocvecs=
624 selarchs=
625 TDEFINES=
626 for targ in $target $canon_targets
627 do
628     if test "x$targ" = "xall"; then
629         all_targets=true
630         assocvecs="$assocvecs $targ_defvec $targ_selvecs"
631     else
632         . $srcdir/config.bfd
633         if test "x$targ" = "x$target"; then
634             defvec=$targ_defvec
635         fi
636         selvecs="$selvecs $targ_defvec $targ_selvecs"
637         selarchs="$selarchs $targ_archs"
638         TDEFINES="$TDEFINES $targ_cflags"
639     fi
640 done
641 AC_SUBST(TDEFINES)
642
643 # This processing still needs to be done if we're to decide properly whether
644 # 64-bit support needs to be compiled in.  Currently, it will be included if
645 # the default or any other explicitly requested target requires it; it
646 # will not be included on a 32-bit host if no 64-bit target is requested, and
647 # no "--with-64-bit-bfd" option is given, even if "--enable-targets=all" is
648 # used.
649
650 # uniq the default and selected vectors in all the configured targets.
651 f=""
652 for i in $selvecs ; do
653     case " $f " in
654     *" $i "*) ;;
655     *) f="$f $i" ;;
656     esac
657 done
658 selvecs="$f"
659
660
661 # uniq the associated vectors in all the configured targets.
662 f=""
663 for i in $assocvecs ; do
664     case " $f " in
665     *" $i "*) ;;
666     *) f="$f $i" ;;
667     esac
668 done
669 assocvecs="$f"
670
671
672 # uniq the architectures in all the configured targets.
673 f=""
674 for i in $selarchs ; do
675     case " $f " in
676     *" $i "*) ;;
677     *) f="$f $i" ;;
678     esac
679 done
680 selarchs="$f"
681
682 # Target backend .o files.
683 tb=
684
685 elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo
686      elf-eh-frame.lo dwarf1.lo"
687
688 for vec in $selvecs
689 do
690     target_size=32
691     case "$vec" in
692     # This list is alphabetized to make it easy to compare
693     # with the two vector lists in targets.c.  For the same reason,
694     # use one entry per line, even though this leads to long lines.
695     aarch64_elf32_be_vec)        tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;;
696     aarch64_elf32_le_vec)        tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;;
697     aarch64_elf64_be_vec)        tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
698     aarch64_elf64_le_vec)        tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
699     alpha_ecoff_le_vec)          tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"; target_size=64 ;;
700     alpha_elf64_vec)             tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
701     alpha_elf64_fbsd_vec)        tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
702     alpha_nlm32_vec)             tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;;
703     alpha_vms_vec)               tb="$tb vms-alpha.lo vms-misc.lo vms-lib.lo"; target_size=64 ;;
704     alpha_vms_lib_txt_vec)       tb="$tb vms-lib.lo vms-misc.lo" ;;
705     am33_elf32_linux_vec)        tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
706     aout0_be_vec)                tb="$tb aout0.lo aout32.lo" ;;
707     aout64_vec)                  tb="$tb demo64.lo aout64.lo"; target_size=64 ;;
708     aout_vec)                    tb="$tb host-aout.lo aout32.lo" ;;
709     aout_adobe_vec)              tb="$tb aout-adobe.lo aout32.lo" ;;
710     arc_elf32_be_vec)            tb="$tb elf32-arc.lo elf32.lo $elf" ;;
711     arc_elf32_le_vec)            tb="$tb elf32-arc.lo elf32.lo $elf" ;;
712     arm_aout_be_vec)             tb="$tb aout-arm.lo aout32.lo" ;;
713     arm_aout_le_vec)             tb="$tb aout-arm.lo aout32.lo" ;;
714     arm_aout_nbsd_vec)           tb="$tb armnetbsd.lo aout32.lo" ;;
715     arm_aout_riscix_vec)         tb="$tb aout32.lo riscix.lo" ;;
716     arm_coff_be_vec)             tb="$tb coff-arm.lo cofflink.lo " ;;
717     arm_coff_le_vec)             tb="$tb coff-arm.lo cofflink.lo " ;;
718     arm_elf32_be_vec)            tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
719     arm_elf32_le_vec)            tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
720     arm_elf32_nacl_be_vec)       tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
721     arm_elf32_nacl_le_vec)       tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
722     arm_elf32_symbian_be_vec)    tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
723     arm_elf32_symbian_le_vec)    tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
724     arm_elf32_vxworks_be_vec)    tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
725     arm_elf32_vxworks_le_vec)    tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
726     arm_pe_be_vec)               tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
727     arm_pe_le_vec)               tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
728     arm_pe_epoc_be_vec)          tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
729     arm_pe_epoc_le_vec)          tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
730     arm_pe_wince_be_vec)         tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;;
731     arm_pe_wince_le_vec)         tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;;
732     arm_pei_be_vec)              tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
733     arm_pei_le_vec)              tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
734     arm_pei_epoc_be_vec)         tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
735     arm_pei_epoc_le_vec)         tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
736     arm_pei_wince_be_vec)        tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;;
737     arm_pei_wince_le_vec)        tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;;
738     avr_elf32_vec)               tb="$tb elf32-avr.lo elf32.lo $elf" ;;
739     bfin_elf32_vec)              tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
740     bfin_elf32_fdpic_vec)        tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
741     bout_be_vec)                 tb="$tb bout.lo aout32.lo" ;;
742     bout_le_vec)                 tb="$tb bout.lo aout32.lo" ;;
743     cr16_elf32_vec)              tb="$tb elf32-cr16.lo elf32.lo $elf" ;;
744     cr16c_elf32_vec)             tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
745     cris_aout_vec)               tb="$tb aout-cris.lo" ;;
746     cris_elf32_vec)              tb="$tb elf32-cris.lo elf32.lo $elf" ;;
747     cris_elf32_us_vec)           tb="$tb elf32-cris.lo elf32.lo $elf" ;;
748     crx_elf32_vec)               tb="$tb elf32-crx.lo elf32.lo $elf" ;;
749     d10v_elf32_vec)              tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
750     d30v_elf32_vec)              tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
751     dlx_elf32_be_vec)            tb="$tb elf32-dlx.lo elf32.lo $elf" ;;
752     elf32_be_vec)                tb="$tb elf32-gen.lo elf32.lo $elf" ;;
753     elf32_le_vec)                tb="$tb elf32-gen.lo elf32.lo $elf" ;;
754     elf64_be_vec)                tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
755     elf64_le_vec)                tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
756     epiphany_elf32_vec)          tb="$tb elf32-epiphany.lo elf32.lo $elf" ;;
757     fr30_elf32_vec)              tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
758     frv_elf32_vec)               tb="$tb elf32-frv.lo elf32.lo $elf" ;;
759     frv_elf32_fdpic_vec)         tb="$tb elf32-frv.lo elf32.lo $elf" ;;
760     h8300_coff_vec)              tb="$tb coff-h8300.lo reloc16.lo" ;;
761     h8300_elf32_vec)             tb="$tb elf32-h8300.lo elf32.lo $elf" ;;
762     h8500_coff_vec)              tb="$tb coff-h8500.lo reloc16.lo" ;;
763     hppa_elf32_vec)              tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
764     hppa_elf32_linux_vec)        tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
765     hppa_elf32_nbsd_vec)         tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
766     hppa_elf64_vec)              tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
767     hppa_elf64_linux_vec)        tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
768     hppa_som_vec)                tb="$tb som.lo" ;;
769     i370_elf32_vec)              tb="$tb elf32-i370.lo elf32.lo $elf" ;;
770     i386_aout_vec)               tb="$tb i386aout.lo aout32.lo" ;;
771     i386_aout_bsd_vec)           tb="$tb i386bsd.lo aout32.lo" ;;
772     i386_aout_dynix_vec)         tb="$tb i386dynix.lo aout32.lo" ;;
773     i386_aout_fbsd_vec)          tb="$tb i386freebsd.lo aout32.lo" ;;
774     i386_aout_linux_vec)         tb="$tb i386linux.lo aout32.lo" ;;
775     i386_aout_lynx_vec)          tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
776     i386_aout_mach3_vec)         tb="$tb i386mach3.lo aout32.lo" ;;
777     i386_aout_nbsd_vec)          tb="$tb i386netbsd.lo aout32.lo" ;;
778     i386_aout_os9k_vec)          tb="$tb i386os9k.lo aout32.lo" ;;
779     i386_coff_vec)               tb="$tb coff-i386.lo cofflink.lo" ;;
780     i386_coff_go32_vec)          tb="$tb coff-go32.lo cofflink.lo" ;;
781     i386_coff_go32stubbed_vec)   tb="$tb coff-stgo32.lo cofflink.lo" ;;
782     i386_coff_lynx_vec)          tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
783     i386_elf32_vec)              tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
784     i386_elf32_fbsd_vec)         tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
785     i386_elf32_nacl_vec)         tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
786     i386_elf32_sol2_vec)         tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
787     i386_elf32_vxworks_vec)      tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
788     i386_mach_o_vec)             tb="$tb mach-o-i386.lo" ;;
789     i386_msdos_vec)              tb="$tb i386msdos.lo" ;;
790     i386_nlm32_vec)              tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
791     i386_pe_vec)                 tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
792     i386_pei_vec)                tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
793     i860_coff_vec)               tb="$tb coff-i860.lo cofflink.lo" ;;
794     i860_elf32_vec)              tb="$tb elf32-i860.lo elf32.lo $elf" ;;
795     i860_elf32_le_vec)           tb="$tb elf32-i860.lo elf32.lo $elf" ;;
796     i960_elf32_vec)              tb="$tb elf32-i960.lo elf32.lo $elf" ;;
797     ia64_elf32_be_vec)           tb="$tb elf32-ia64.lo elfxx-ia64.lo elf32.lo $elf" ;;
798     ia64_elf32_hpux_be_vec)      tb="$tb elf32-ia64.lo elfxx-ia64.lo elf32.lo $elf" ;;
799     ia64_elf64_be_vec)           tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
800     ia64_elf64_le_vec)           tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
801     ia64_elf64_hpux_be_vec)      tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
802     ia64_elf64_vms_vec)          tb="$tb elf64-ia64-vms.lo elf64-ia64.lo elfxx-ia64.lo elf64.lo vms-lib.lo vms-misc.lo $elf"; target_size=64 ;;
803     ia64_pei_vec)                tb="$tb pei-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
804     icoff_be_vec)                tb="$tb coff-i960.lo cofflink.lo" ;;
805     icoff_le_vec)                tb="$tb coff-i960.lo cofflink.lo" ;;
806     ieee_vec)                    tb="$tb ieee.lo" ;;
807     ip2k_elf32_vec)              tb="$tb elf32-ip2k.lo elf32.lo $elf" ;;
808     iq2000_elf32_vec)            tb="$tb elf32-iq2000.lo elf32.lo $elf" ;;
809     k1om_elf64_vec)              tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
810     k1om_elf64_fbsd_vec)         tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
811     l1om_elf64_vec)              tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
812     l1om_elf64_fbsd_vec)         tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
813     lm32_elf32_vec)              tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
814     lm32_elf32_fdpic_vec)        tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
815     m32c_elf32_vec)              tb="$tb elf32-m32c.lo elf32.lo $elf" ;;
816     m32r_elf32_vec)              tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
817     m32r_elf32_le_vec)           tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
818     m32r_elf32_linux_vec)        tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
819     m32r_elf32_linux_le_vec)     tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
820     m68hc11_elf32_vec)           tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
821     m68hc12_elf32_vec)           tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
822     m68k_aout_4knbsd_vec)        tb="$tb m68k4knetbsd.lo aout32.lo" ;;
823     m68k_aout_hp300bsd_vec)      tb="$tb hp300bsd.lo aout32.lo" ;;
824     m68k_aout_hp300hpux_vec)     tb="$tb hp300hpux.lo aout32.lo" ;;
825     m68k_aout_linux_vec)         tb="$tb m68klinux.lo aout32.lo" ;;
826     m68k_aout_nbsd_vec)          tb="$tb m68knetbsd.lo aout32.lo" ;;
827     m68k_aout_newsos3_vec)       tb="$tb newsos3.lo aout32.lo" ;;
828     m68k_coff_vec)               tb="$tb coff-m68k.lo cofflink.lo" ;;
829     m68k_coff_apollo_vec)        tb="$tb coff-apollo.lo" ;;
830     m68k_coff_aux_vec)           tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
831     m68k_coff_sysv_vec)          tb="$tb coff-svm68k.lo cofflink.lo" ;;
832     m68k_coff_un_vec)            tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;;
833     m68k_elf32_vec)              tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
834     m68k_versados_vec)           tb="$tb versados.lo" ;;
835     m88k_aout_mach3_vec)         tb="$tb m88kmach3.lo aout32.lo" ;;
836     m88k_aout_obsd_vec)          tb="$tb m88kopenbsd.lo aout32.lo" ;;
837     m88k_coff_bcs_vec)           tb="$tb coff-m88k.lo" ;;
838     m88k_elf32_vec)              tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
839     mach_o_be_vec)               tb="$tb mach-o.lo" ;;
840     mach_o_le_vec)               tb="$tb mach-o.lo" ;;
841     mach_o_fat_vec)              tb="$tb mach-o.lo" ;;
842     mcore_elf32_be_vec)          tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
843     mcore_elf32_le_vec)          tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
844     mcore_pe_be_vec)             tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
845     mcore_pe_le_vec)             tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
846     mcore_pei_be_vec)            tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
847     mcore_pei_le_vec)            tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
848     mep_elf32_vec)               tb="$tb elf32-mep.lo elf32.lo $elf" ;;
849     mep_elf32_le_vec)            tb="$tb elf32-mep.lo elf32.lo $elf" ;;
850     metag_elf32_vec)             tb="$tb elf32-metag.lo elf32.lo $elf" ;;
851     microblaze_elf32_vec)        tb="$tb elf32-microblaze.lo elf32.lo $elf" ;;
852     microblaze_elf32_le_vec)     tb="$tb elf32-microblaze.lo elf32.lo $elf" ;;
853     mips_ecoff_be_vec)           tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
854     mips_ecoff_le_vec)           tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
855     mips_ecoff_bele_vec)         tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
856     mips_elf32_be_vec)           tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
857     mips_elf32_le_vec)           tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
858     mips_elf32_n_be_vec)         tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
859     mips_elf32_n_le_vec)         tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
860     mips_elf32_ntrad_be_vec)     tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
861     mips_elf32_ntrad_le_vec)     tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
862     mips_elf32_ntradfbsd_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
863     mips_elf32_ntradfbsd_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
864     mips_elf32_trad_be_vec)      tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
865     mips_elf32_trad_le_vec)      tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
866     mips_elf32_tradfbsd_be_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
867     mips_elf32_tradfbsd_le_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
868     mips_elf32_vxworks_be_vec)   tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
869     mips_elf32_vxworks_le_vec)   tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
870     mips_elf64_be_vec)           tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
871     mips_elf64_le_vec)           tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
872     mips_elf64_trad_be_vec)      tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
873     mips_elf64_trad_le_vec)      tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
874     mips_elf64_tradfbsd_be_vec)  tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
875     mips_elf64_tradfbsd_le_vec)  tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
876     mips_pe_le_vec)              tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;;
877     mips_pei_le_vec)             tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;;
878     mmix_elf64_vec)              tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
879     mmix_mmo_vec)                        tb="$tb mmo.lo" target_size=64 ;;
880     mn10200_elf32_vec)           tb="$tb elf-m10200.lo elf32.lo $elf" ;;
881     mn10300_elf32_vec)           tb="$tb elf-m10300.lo elf32.lo $elf" ;;
882     moxie_elf32_be_vec)          tb="$tb elf32-moxie.lo elf32.lo $elf" ;;
883     moxie_elf32_le_vec)          tb="$tb elf32-moxie.lo elf32.lo $elf" ;;
884     msp430_elf32_vec)            tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
885     msp430_elf32_ti_vec)         tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
886     mt_elf32_vec)                tb="$tb elf32-mt.lo elf32.lo $elf" ;;
887     nds32_elf32_be_vec)          tb="$tb elf32-nds32.lo elf32.lo $elf" ;;
888     nds32_elf32_le_vec)          tb="$tb elf32-nds32.lo elf32.lo $elf" ;;
889     nds32_elf32_linux_be_vec)    tb="$tb elf32-nds32.lo elf32.lo $elf" ;;
890     nds32_elf32_linux_le_vec)    tb="$tb elf32-nds32.lo elf32.lo $elf" ;;
891     nios2_elf32_be_vec)          tb="$tb elf32-nios2.lo elf32.lo $elf" ;;
892     nios2_elf32_le_vec)          tb="$tb elf32-nios2.lo elf32.lo $elf" ;;
893     ns32k_aout_pc532mach_vec)    tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
894     ns32k_aout_pc532nbsd_vec)    tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
895     or1k_elf32_vec)              tb="$tb elf32-or1k.lo elf32.lo $elf" ;;
896     pdp11_aout_vec)              tb="$tb pdp11.lo" ;;
897     pef_vec)                     tb="$tb pef.lo" ;;
898     pef_xlib_vec)                tb="$tb pef.lo" ;;
899     pj_elf32_vec)                tb="$tb elf32-pj.lo elf32.lo $elf" ;;
900     pj_elf32_le_vec)             tb="$tb elf32-pj.lo elf32.lo $elf" ;;
901     plugin_vec)                  tb="$tb plugin.lo" ;;
902     powerpc_boot_vec)            tb="$tb ppcboot.lo" ;;
903     powerpc_elf32_vec)           tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
904     powerpc_elf32_le_vec)        tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
905     powerpc_elf32_fbsd_vec)      tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
906     powerpc_elf32_vxworks_vec)   tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
907     powerpc_elf64_vec)           tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
908     powerpc_elf64_le_vec)        tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
909     powerpc_elf64_fbsd_vec)      tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
910     powerpc_nlm32_vec)           tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
911     powerpc_pe_vec)              tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
912     powerpc_pe_le_vec)           tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
913     powerpc_pei_vec)             tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
914     powerpc_pei_le_vec)          tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
915     powerpc_xcoff_vec)           tb="$tb coff-rs6000.lo xcofflink.lo" ;;
916     rl78_elf32_vec)              tb="$tb elf32-rl78.lo elf32.lo $elf" ;;
917     rs6000_xcoff64_vec)          tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
918     rs6000_xcoff64_aix_vec)      tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
919     rs6000_xcoff_vec)            tb="$tb coff-rs6000.lo xcofflink.lo" ;;
920     rx_elf32_be_vec)             tb="$tb elf32-rx.lo elf32.lo $elf" ;;
921     rx_elf32_be_ns_vec)          tb="$tb elf32-rx.lo elf32.lo $elf" ;;
922     rx_elf32_le_vec)             tb="$tb elf32-rx.lo elf32.lo $elf" ;;
923     s390_elf32_vec)              tb="$tb elf32-s390.lo elf32.lo $elf" ;;
924     s390_elf64_vec)              tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
925     score_elf32_be_vec)          tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64 ;;
926     score_elf32_le_vec)          tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64 ;;
927     # FIXME: We include cofflink.lo not because it's needed for
928     # sh64_elf32[_le]_vec, but because we include sh_elf32[_le]_vec
929     # which needs it but does not list it.  Should be fixed in right place.
930     sh64_elf32_vec)              tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
931     sh64_elf32_le_vec)           tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
932     sh64_elf32_linux_vec)        tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
933     sh64_elf32_linux_be_vec)     tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
934     sh64_elf32_nbsd_vec)         tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
935     sh64_elf32_nbsd_le_vec)      tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
936     sh64_elf64_vec)              tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
937     sh64_elf64_le_vec)           tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
938     sh64_elf64_linux_vec)        tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
939     sh64_elf64_linux_be_vec)     tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
940     sh64_elf64_nbsd_vec)         tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
941     sh64_elf64_nbsd_le_vec)      tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
942     sh_coff_vec)                 tb="$tb coff-sh.lo cofflink.lo" ;;
943     sh_coff_le_vec)              tb="$tb coff-sh.lo cofflink.lo" ;;
944     sh_coff_small_vec)           tb="$tb coff-sh.lo cofflink.lo" ;;
945     sh_coff_small_le_vec)        tb="$tb coff-sh.lo cofflink.lo" ;;
946     sh_elf32_vec)                tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
947     sh_elf32_le_vec)             tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
948     sh_elf32_fdpic_be_vec)       tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
949     sh_elf32_fdpic_le_vec)       tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
950     sh_elf32_linux_vec)          tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
951     sh_elf32_linux_be_vec)       tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
952     sh_elf32_nbsd_vec)           tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
953     sh_elf32_nbsd_le_vec)        tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
954     sh_elf32_symbian_le_vec)     tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
955     sh_elf32_vxworks_vec)        tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
956     sh_elf32_vxworks_le_vec)     tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
957     sh_pe_le_vec)                tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
958     sh_pei_le_vec)               tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
959     sparc_aout_le_vec)           tb="$tb aout-sparcle.lo aout32.lo" ;;
960     sparc_aout_linux_vec)        tb="$tb sparclinux.lo aout32.lo" ;;
961     sparc_aout_lynx_vec)         tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
962     sparc_aout_nbsd_vec)         tb="$tb sparcnetbsd.lo aout32.lo" ;;
963     sparc_aout_sunos_be_vec)     tb="$tb sunos.lo aout32.lo" ;;
964     sparc_coff_vec)              tb="$tb coff-sparc.lo" ;;
965     sparc_coff_lynx_vec)         tb="$tb cf-sparclynx.lo lynx-core.lo" ;;
966     sparc_elf32_vec)             tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
967     sparc_elf32_sol2_vec)        tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
968     sparc_elf32_vxworks_vec)     tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
969     sparc_elf64_vec)             tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
970     sparc_elf64_fbsd_vec)        tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
971     sparc_elf64_sol2_vec)        tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
972     sparc_nlm32_vec)             tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
973     spu_elf32_vec)               tb="$tb elf32-spu.lo elf32.lo $elf" ;;
974     sym_vec)                     tb="$tb xsym.lo" ;;
975     tic30_aout_vec)              tb="$tb aout-tic30.lo" ;;
976     tic30_coff_vec)              tb="$tb coff-tic30.lo" ;;
977     tic4x_coff0_vec)             tb="$tb coff-tic4x.lo" ;;
978     tic4x_coff0_beh_vec)         tb="$tb coff-tic4x.lo" ;;
979     tic4x_coff1_vec)             tb="$tb coff-tic4x.lo" ;;
980     tic4x_coff1_beh_vec)         tb="$tb coff-tic4x.lo" ;;
981     tic4x_coff2_vec)             tb="$tb coff-tic4x.lo" ;;
982     tic4x_coff2_beh_vec)         tb="$tb coff-tic4x.lo" ;;
983     tic54x_coff0_vec)            tb="$tb coff-tic54x.lo" ;;
984     tic54x_coff0_beh_vec)        tb="$tb coff-tic54x.lo" ;;
985     tic54x_coff1_vec)            tb="$tb coff-tic54x.lo" ;;
986     tic54x_coff1_beh_vec)        tb="$tb coff-tic54x.lo" ;;
987     tic54x_coff2_vec)            tb="$tb coff-tic54x.lo" ;;
988     tic54x_coff2_beh_vec)        tb="$tb coff-tic54x.lo" ;;
989     tic6x_elf32_be_vec)          tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
990     tic6x_elf32_le_vec)          tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
991     tic6x_elf32_c6000_be_vec)    tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
992     tic6x_elf32_c6000_le_vec)    tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
993     tic6x_elf32_linux_be_vec)    tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
994     tic6x_elf32_linux_le_vec)    tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
995     tic80_coff_vec)              tb="$tb coff-tic80.lo cofflink.lo" ;;
996     tilegx_elf32_be_vec)         tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;;
997     tilegx_elf32_le_vec)         tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;;
998     tilegx_elf64_be_vec)         tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;;
999     tilegx_elf64_le_vec)         tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;;
1000     tilepro_elf32_vec)           tb="$tb elf32-tilepro.lo elf32.lo $elf" ;;
1001     v800_elf32_vec)              tb="$tb elf32-v850.lo elf32.lo $elf" ;;
1002     v850_elf32_vec)              tb="$tb elf32-v850.lo elf32.lo $elf" ;;
1003     vax_aout_1knbsd_vec)         tb="$tb vax1knetbsd.lo aout32.lo" ;;
1004     vax_aout_bsd_vec)            tb="$tb vaxbsd.lo aout32.lo" ;;
1005     vax_aout_nbsd_vec)           tb="$tb vaxnetbsd.lo aout32.lo" ;;
1006     vax_elf32_vec)               tb="$tb elf32-vax.lo elf32.lo $elf" ;;
1007     w65_coff_vec)                tb="$tb coff-w65.lo reloc16.lo" ;;
1008     we32k_coff_vec)              tb="$tb coff-we32k.lo" ;;
1009     x86_64_coff_vec)             tb="$tb coff-x86_64.lo cofflink.lo"; target_size=64 ;;
1010     x86_64_elf32_vec)            tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
1011     x86_64_elf32_nacl_vec)       tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
1012     x86_64_elf64_vec)            tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
1013     x86_64_elf64_fbsd_vec)       tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
1014     x86_64_elf64_nacl_vec)       tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
1015     x86_64_elf64_sol2_vec)       tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
1016     x86_64_mach_o_vec)           tb="$tb mach-o-x86-64.lo" ;;
1017     x86_64_pe_vec)               tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
1018     x86_64_pe_be_vec)            tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
1019     x86_64_pei_vec)              tb="$tb pei-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
1020     xc16x_elf32_vec)             tb="$tb elf32-xc16x.lo elf32.lo $elf" ;;
1021     xgate_elf32_vec)             tb="$tb elf32-xgate.lo elf32.lo $elf" ;;
1022     xstormy16_elf32_vec)         tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;;
1023     xtensa_elf32_be_vec)         tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
1024     xtensa_elf32_le_vec)         tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
1025     z80_coff_vec)                tb="$tb coff-z80.lo reloc16.lo" ;;
1026     z8k_coff_vec)                tb="$tb coff-z8k.lo reloc16.lo cofflink.lo" ;;
1027
1028     # These appear out of order in targets.c
1029     srec_vec)                    tb="$tb srec.lo" ;;
1030     symbolsrec_vec)              tb="$tb srec.lo" ;;
1031     tekhex_vec)                  tb="$tb tekhex.lo" ;;
1032     core_cisco_be_vec)           tb="$tb cisco-core.lo" ;;
1033     core_cisco_le_vec)           tb="$tb cisco-core.lo" ;;
1034
1035     "")                          ;;
1036     *) AC_MSG_ERROR(*** unknown target vector $vec) ;;
1037     esac
1038
1039     if test ${target_size} = 64; then
1040         target64=true
1041     fi
1042     if test x"${vec}" = x"${defvec}"; then
1043         bfd_default_target_size=${target_size}
1044     fi
1045 done
1046
1047 # Target architecture .o files.
1048 # A couple of CPUs use shorter file names to avoid problems on DOS
1049 # filesystems.
1050 ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.lo/g -e s/mn10200/m10200/ -e s/mn10300/m10300/`
1051
1052 # Weed out duplicate .o files.
1053 f=""
1054 for i in $tb ; do
1055     case " $f " in
1056     *" $i "*) ;;
1057     *) f="$f $i" ;;
1058     esac
1059 done
1060 tb="$f"
1061
1062 f=""
1063 for i in $ta ; do
1064     case " $f " in
1065     *" $i "*) ;;
1066     *) f="$f $i" ;;
1067     esac
1068 done
1069 ta="$f"
1070
1071 bfd_backends="$tb"
1072 bfd_machines="$ta"
1073
1074 if test x${all_targets} = xtrue ; then
1075   bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
1076   bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
1077   selvecs=
1078   havevecs=-DHAVE_all_vecs
1079   selarchs=
1080   test -n "$assocvecs" &&
1081     assocvecs=`echo $assocvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
1082 else    # all_targets is true
1083   # Only set these if they will be nonempty, for the clever echo.
1084   havevecs=
1085   assocvecs=
1086   test -n "$selvecs" &&
1087     havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'`
1088   test -n "$selvecs" &&
1089     selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
1090   test -n "$selarchs" &&
1091     selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
1092 fi      # all_targets is true
1093
1094 case ${host64}-${target64}-${want64} in
1095   *true*)
1096     wordsize=64
1097     bfd64_libs='$(BFD64_LIBS)'
1098     all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
1099     if test $BFD_HOST_64_BIT_DEFINED = 0; then
1100       AC_MSG_WARN([You have requested a 64 bit BFD configuration, but])
1101       AC_MSG_WARN([your compiler may not have a 64 bit integral type])
1102     fi
1103     if test -n "$GCC" ; then
1104        bad_64bit_gcc=no;
1105        AC_MSG_CHECKING([for gcc version with buggy 64-bit support])
1106        # Add more tests for gcc versions with non-working 64-bit support here.
1107        AC_EGREP_CPP([: 2 : 91 : 1 :],[:__GNUC__:__GNUC_MINOR__:__i386__:],
1108                     bad_64bit_gcc=yes;
1109                     AC_MSG_RESULT([yes: egcs-1.1.2 on ix86 spotted]),
1110                     AC_MSG_RESULT(no))
1111        if test $bad_64bit_gcc = yes ; then
1112          AC_MSG_ERROR([A newer version of gcc is needed for the requested 64-bit BFD configuration])
1113        fi
1114     fi
1115     ;;
1116   false-false-false)
1117     wordsize=32
1118     all_backends='$(BFD32_BACKENDS)'
1119     ;;
1120 esac
1121
1122 AC_SUBST(wordsize)
1123 AC_SUBST(bfd64_libs)
1124 AC_SUBST(all_backends)
1125 AC_SUBST(bfd_backends)
1126 AC_SUBST(bfd_machines)
1127 AC_SUBST(bfd_default_target_size)
1128
1129 if test "$plugins" = "yes"; then
1130   supports_plugins=1
1131 else
1132   supports_plugins=0
1133 fi
1134 AC_SUBST(supports_plugins)
1135 AC_SUBST(lt_cv_dlopen_libs)
1136
1137 # Determine the host dependant file_ptr a.k.a. off_t type.  In order
1138 # prefer: off64_t - if ftello64 and fseeko64, off_t - if ftello and
1139 # fseeko, long.  This assumes that sizeof off_t is .ge. sizeof long.
1140 # Hopefully a reasonable assumption since fseeko et.al. should be
1141 # upward compatible.
1142 AC_CHECK_FUNCS(ftello ftello64 fseeko fseeko64 fopen64)
1143 if test x"$ac_cv_func_ftello" = xyes -a x"$ac_cv_func_fseeko" = xyes; then
1144     AC_CHECK_SIZEOF(off_t)
1145 fi
1146 AC_MSG_CHECKING([file_ptr type])
1147 bfd_file_ptr="long"
1148 bfd_ufile_ptr="unsigned long"
1149 if test x"$ac_cv_func_ftello64" = xyes -a x"$ac_cv_func_fseeko64" = xyes \
1150         -o x"${ac_cv_sizeof_off_t}" = x8; then
1151     bfd_file_ptr=BFD_HOST_64_BIT
1152     bfd_ufile_ptr=BFD_HOST_U_64_BIT
1153 fi
1154 AC_MSG_RESULT($bfd_file_ptr)
1155 AC_SUBST(bfd_file_ptr)
1156 AC_SUBST(bfd_ufile_ptr)
1157
1158
1159 tdefaults=""
1160 test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
1161 test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
1162 test -n "${assocvecs}" && tdefaults="${tdefaults} -DASSOCIATED_VECS='${assocvecs}'"
1163 test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
1164 AC_SUBST(tdefaults)
1165 AC_SUBST(havevecs)
1166
1167 dnl AC_CHECK_HEADERS(sys/mman.h)
1168 AC_FUNC_MMAP
1169 AC_CHECK_FUNCS(madvise mprotect)
1170 case ${want_mmap}+${ac_cv_func_mmap_fixed_mapped} in
1171   true+yes )  AC_DEFINE(USE_MMAP, 1, [Use mmap if it's available?]) ;;
1172 esac
1173
1174 rm -f doc/config.status
1175 AC_CONFIG_FILES([Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in])
1176
1177 dnl We need this duplication, even though we use AM_PO_SUBDIRS, because of
1178 dnl our two separate POTFILES.  Yuck.
1179 AC_CONFIG_COMMANDS([default],
1180 [[
1181 case "$srcdir" in
1182   .) srcdirpre= ;;
1183   *) srcdirpre='$(srcdir)/' ;;
1184 esac
1185 POFILES=
1186 GMOFILES=
1187 for lang in dummy $OBSOLETE_ALL_LINGUAS; do
1188   if test $lang != dummy; then
1189     POFILES="$POFILES $srcdirpre$lang.po"
1190     GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1191   fi
1192 done
1193 sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' \
1194     -e '/BLD-POTFILES =/r po/BLD-POTFILES' \
1195     -e "s,@POFILES@,$POFILES," \
1196     -e "s,@GMOFILES@,$GMOFILES," \
1197     po/Makefile.in > po/Makefile]],[[]])
1198
1199 dnl Required by html, pdf, install-pdf and install-html
1200 AC_SUBST(datarootdir)
1201 AC_SUBST(docdir)
1202 AC_SUBST(htmldir)
1203 AC_SUBST(pdfdir)
1204
1205 AC_OUTPUT