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