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