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