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