aboutsummaryrefslogtreecommitdiff
path: root/bfd/configure.in
blob: 137ab7fa212928fff2e010f304e6d59b73ade0d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
dnl Process this file with autoconf to produce a configure script.
dnl

AC_PREREQ(2.13)
AC_INIT(libbfd.c)

AC_CANONICAL_SYSTEM
AC_ISC_POSIX

AM_INIT_AUTOMAKE(bfd, 2.9.5)

dnl These must be called before AM_PROG_LIBTOOL, because it may want
dnl to call AC_CHECK_PROG.
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)

dnl Default to a non shared library.  This may be overridden by the
dnl configure option --enable-shared.
AM_DISABLE_SHARED

AM_PROG_LIBTOOL

AC_ARG_ENABLE(64-bit-bfd,
[  --enable-64-bit-bfd     64-bit support (on hosts with narrower word sizes)],
[case "${enableval}" in
  yes)  want64=true  ;;
  no)   want64=false ;;
  *)    AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
esac],[want64=false])dnl
AC_ARG_ENABLE(targets,
[  --enable-targets        alternative target configurations],
[case "${enableval}" in
  yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
            ;;
  no)       enable_targets= ;;
  *)        enable_targets=$enableval ;;
esac])dnl
AC_ARG_ENABLE(commonbfdlib,
[  --enable-commonbfdlib   build shared BFD/opcodes/libiberty library],
[case "${enableval}" in
  yes) commonbfdlib=true ;;
  no)  commonbfdlib=false ;;
  *)   AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
esac])dnl
AC_ARG_WITH(mmap,
[  --with-mmap             try using mmap for BFD input files if available],
[case "${withval}" in
  yes)  want_mmap=true ;;
  no)   want_mmap=false ;;
  *)    AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;;
esac],[want_mmap=false])dnl

AM_CONFIG_HEADER(config.h:config.in)

if test -z "$target" ; then
    AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
fi
AC_ARG_PROGRAM

AM_MAINTAINER_MODE
AC_EXEEXT

host64=false
target64=false

# host stuff:

AC_PROG_CC

ALL_LINGUAS=
CY_GNU_GETTEXT

# Permit host specific settings.
. ${srcdir}/configure.host

AC_SUBST(HDEFINES)
AC_PROG_INSTALL

BFD_HOST_64BIT_LONG=0
BFD_HOST_64_BIT_DEFINED=0
BFD_HOST_64_BIT=
BFD_HOST_U_64_BIT=
if test "x${HOST_64BIT_TYPE}" = "xlong"; then
  BFD_HOST_64BIT_LONG=1
elif test "x${HOST_64BIT_TYPE}" != "x"; then
  BFD_HOST_64_BIT_DEFINED=1
  BFD_HOST_64_BIT=${HOST_64BIT_TYPE}
  BFD_HOST_U_64_BIT=${HOST_U_64BIT_TYPE}
fi
AC_SUBST(BFD_HOST_64BIT_LONG)
AC_SUBST(BFD_HOST_64_BIT_DEFINED)
AC_SUBST(BFD_HOST_64_BIT)
AC_SUBST(BFD_HOST_U_64_BIT)

BFD_CC_FOR_BUILD

AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
AC_HEADER_TIME
AC_HEADER_DIRENT
AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid)

BFD_BINARY_FOPEN

BFD_NEED_DECLARATION(strstr)
BFD_NEED_DECLARATION(malloc)
BFD_NEED_DECLARATION(realloc)
BFD_NEED_DECLARATION(free)
BFD_NEED_DECLARATION(getenv)

# If we are configured native, pick a core file support file.
COREFILE=
COREFLAG=
TRAD_HEADER=
if test "${target}" = "${host}"; then
  case "${host}" in
  alpha*-*-linux-gnu*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/alphalinux.h"'
	;;
  alpha*-*-netbsd*)	COREFILE=netbsd-core.lo ;;
  alpha*-*-*)		COREFILE=osf-core.lo ;;
  arm-*-riscix)		COREFILE=trad-core.lo ;;
  hppa*-*-hpux*)	COREFILE=hpux-core.lo ;;
  hppa*-*-hiux*)	COREFILE=hpux-core.lo ;;
  hppa*-*-mpeix*)	COREFILE=hpux-core.lo ;;
  hppa*-*-bsd*)		COREFILE="hpux-core.lo hppabsd-core.lo"
			COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
  i370-*-*)		
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/i370linux.h"'
	;;

changequote(,)dnl
  i[3456]86-sequent-bsd*)
changequote([,])dnl
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/symmetry.h"'
	;;
changequote(,)dnl
  i[3456]86-sequent-sysv4*) ;;
  i[3456]86-sequent-sysv*)
changequote([,])dnl
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/symmetry.h"'
	;;
changequote(,)dnl
  i[3456]86-*-bsd* | i[3456]86-*-freebsd*)
changequote([,])dnl
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/i386bsd.h"'
	;;
changequote(,)dnl
  i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
changequote([,])dnl
	COREFILE=netbsd-core.lo
	;;
changequote(,)dnl
  i[3456]86-esix-sysv3*)
changequote([,])dnl
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/esix.h"'
	;;
changequote(,)dnl
  i[3456]86-*-sco3.2v5*)
changequote([,])dnl
	COREFILE=sco5-core.lo
	;;
changequote(,)dnl
  i[3456]86-*-sco* | i[3456]86-*-isc*)
changequote([,])dnl
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/i386sco.h"'
	;;
changequote(,)dnl
  i[3456]86-*-mach3*)
changequote([,])dnl
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/i386mach3.h"'
	;;
changequote(,)dnl
  i[3456]86-*-linux-gnu*)
changequote([,])dnl
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/i386linux.h"'
	;;
changequote(,)dnl
  i[3456]86-*-isc*)	COREFILE=trad-core.lo ;;
  i[3456]86-*-aix*)	COREFILE=aix386-core.lo ;;
changequote([,])dnl
  i860-*-mach3* | i860-*-osf1*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/i860mach3.h"'
	;;
  mips-dec-bsd*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/mipsbsd.h"'
	;;
  mips-dec-mach3*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/mipsmach3.h"'
	;;
  mips-*-netbsd* | mips*-*-openbsd*)
	COREFILE=netbsd-core.lo
	;;
  mips-dec-*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/decstation.h"'
	;;
  mips-sgi-irix4*)	COREFILE=irix-core.lo ;;
  mips-sgi-irix5*)	COREFILE=irix-core.lo ;;
  mips-sgi-irix6*)	COREFILE=irix-core.lo ;;
  mips-*-mach3*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/mipsmach3.h"'
	;;
  mips-*-sysv4*)	;;
  mips-*-sysv* | mips-*-riscos*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/riscos.h"'
	;;
  mips-sony-bsd*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/news-mips.h"'
	;;
  m68*-bull*-sysv*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/dpx2.h"'
	;;
  m68*-hp-hpux*)	COREFILE=hpux-core.lo ;;
  m68*-hp-bsd*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/hp300bsd.h"'
	;;
  m68*-*-linux-gnu*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/m68klinux.h"'
	;;
  m68*-motorola-sysv*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/delta68.h"'
	;;
  m68*-sony-*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/news.h"'
	;;
  m68*-*-netbsd* | m68*-*-openbsd*)
	COREFILE=netbsd-core.lo
	;;
  m68*-apple-aux*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/m68kaux.h"'
	;;
  m88*-*-sysv4*)	;;
  m88*-motorola-sysv*)	COREFILE=ptrace-core.lo ;;
  m88*-*-mach3*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/m88kmach3.h"'
	;;
  ns32k-pc532-mach)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/pc532mach.h"'
	;;
  ns32k-*-netbsd* | ns32k-*-openbsd*)
	COREFILE=netbsd-core.lo
	;;
  rs6000-*-lynx*)	COREFILE=lynx-core.lo ;;
  rs6000-*-aix4*)	COREFILE=rs6000-core.lo ;;
  rs6000-*-*)		COREFILE=rs6000-core.lo ;;
  powerpc-*-*bsd*)	COREFILE=netbsd-core.lo ;;
  powerpc-*-aix4*)	COREFILE=rs6000-core.lo ;;
  powerpc-*-aix*)	COREFILE=rs6000-core.lo ;;
  powerpc-*-beos*)	;;
  powerpc-*-netbsd*)	COREFILE=netbsd-core.lo ;;
  sparc-*-netbsd* | sparc-*-openbsd*)
	COREFILE=netbsd-core.lo
	;;
  tahoe-*-*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/tahoe.h"'
	;;
  vax-*-ultrix2*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/vaxult2.h"'
	;;
  vax-*-ultrix*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/vaxult2.h"'
	;;
  vax-*-*)
	COREFILE=trad-core.lo
	TRAD_HEADER='"hosts/vaxbsd.h"'
	;;
  esac

  case "$COREFILE" in
  aix386-core.lo)	COREFLAG=-DAIX386_CORE ;;
  hppabsd-core.lo)	COREFLAG=-DHPPABSD_CORE ;;
  hpux-core.lo)		COREFLAG=-DHPUX_CORE ;;
  irix-core.lo)		COREFLAG=-DIRIX_CORE ;;
  lynx-core.lo)		COREFLAG=-DLYNX_CORE ;;
  netbsd-core.lo)	COREFLAG=-DNETBSD_CORE ;;
  osf-core.lo)		COREFLAG=-DOSF_CORE ;;
  ptrace-core.lo)	COREFLAG=-DPTRACE_CORE ;;
  rs6000-core.lo)	COREFLAG="$COREFLAG -DAIX_CORE" ;;
  sco5-core.lo)		COREFLAG="$COREFLAG -DSCO5_CORE" ;;
  trad-core.lo)		COREFLAG="$COREFLAG -DTRAD_CORE" ;;
  esac

  # ELF corefile support has several flavors, but all of
  # them use something called <sys/procfs.h>
  AC_CHECK_HEADERS(sys/procfs.h)
  if test "$ac_cv_header_sys_procfs_h" = yes; then
    BFD_HAVE_SYS_PROCFS_TYPE(prstatus_t)
    BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus_t, pr_who)
    BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t)
    BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo_t)
    BFD_HAVE_SYS_PROCFS_TYPE(psinfo_t)
    BFD_HAVE_SYS_PROCFS_TYPE(lwpstatus_t)
    BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_context)
    BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_reg)
    BFD_HAVE_SYS_PROCFS_TYPE(win32_pstatus_t)
  fi
fi
AC_SUBST(COREFILE)
AC_SUBST(COREFLAG)
AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER,
  [Name of host specific header file to include in trad-core.c.])

# Horrible hacks to build DLLs on Windows.
WIN32LDFLAGS=
WIN32LIBADD=
case "${host}" in
*-*-cygwin*)
  if test "$enable_shared" = "yes"; then
    WIN32LDFLAGS="-no-undefined"
    WIN32LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32"
  fi
  ;;
esac
AC_SUBST(WIN32LDFLAGS)
AC_SUBST(WIN32LIBADD)

# target stuff:

# Canonicalize the secondary target names.
if test -n "$enable_targets" ; then
    for targ in `echo $enable_targets | sed 's/,/ /g'`
    do
	result=`$ac_config_sub $targ 2>/dev/null`
	if test -n "$result" ; then
	    canon_targets="$canon_targets $result"
	else
	    # Allow targets that config.sub doesn't recognize, like "all".
	    canon_targets="$canon_targets $targ"
	fi
    done
fi

all_targets=false
defvec=
selvecs=
selarchs=
TDEFINES=
for targ in $target $canon_targets
do
    if test "x$targ" = "xall"; then
        all_targets=true
    else
	. $srcdir/config.bfd
	if test "x$targ" = "x$target"; then
	    defvec=$targ_defvec
	fi
	selvecs="$selvecs $targ_defvec $targ_selvecs"
	selarchs="$selarchs $targ_archs"
	TDEFINES="$TDEFINES $targ_cflags"
    fi
done
AC_SUBST(TDEFINES)

# This processing still needs to be done if we're to decide properly whether
# 64-bit support needs to be compiled in.  Currently, it will be included if
# the default or any other explicitly requested target requires it; it
# will not be included on a 32-bit host if no 64-bit target is requested, and
# no "--with-64-bit-bfd" option is given, even if "--enable-targets=all" is
# used.

# uniq the default and selected vectors in all the configured targets.
f=""
for i in $selvecs ; do
    case " $f " in
    *" $i "*) ;;
    *) f="$f $i" ;;
    esac
done
selvecs="$f"


# uniq the architectures in all the configured targets.
f=""
for i in $selarchs ; do
    case " $f " in
    *" $i "*) ;;
    *) f="$f $i" ;;
    esac
done
selarchs="$f"

# Target backend .o files.
tb=

elf="elf.lo elflink.lo dwarf2.lo dwarf1.lo"

for vec in $selvecs
do
    case "$vec" in
    # This list is alphabetized to make it easy to compare
    # with the two vector lists in targets.c.
    a29kcoff_big_vec)		tb="$tb coff-a29k.lo cofflink.lo" ;;
    a_out_adobe_vec)		tb="$tb aout-adobe.lo aout32.lo" ;;
    armcoff_little_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
    armcoff_big_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
    armnetbsd_vec)		tb="$tb armnetbsd.lo aout32.lo" ;;
    armpe_little_vec)		tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
    armpe_big_vec)		tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
    armpei_little_vec)		tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
    armpei_big_vec)		tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
    arm_epoc_pe_little_vec)	tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
    arm_epoc_pe_big_vec)	tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
    arm_epoc_pei_little_vec)	tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
    arm_epoc_pei_big_vec)	tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
    aout0_big_vec)		tb="$tb aout0.lo aout32.lo" ;;
    aout_arm_big_vec)		tb="$tb aout-arm.lo aout32.lo" ;;
    aout_arm_little_vec)	tb="$tb aout-arm.lo aout32.lo" ;;
    aout_mips_big_vec)		tb="$tb mipsbsd.lo aout32.lo" ;;
    aout_mips_little_vec)	tb="$tb mipsbsd.lo aout32.lo" ;;
    apollocoff_vec)		tb="$tb coff-apollo.lo" ;;
    b_out_vec_big_host)		tb="$tb bout.lo aout32.lo" ;;
    b_out_vec_little_host)	tb="$tb bout.lo aout32.lo" ;;
    bfd_elf64_alpha_vec)	tb="$tb elf64-alpha.lo elf64.lo $elf"
				target64=true ;;
    bfd_elf32_littlearc_vec)	tb="$tb elf32-arc.lo elf32.lo $elf" ;;
    bfd_elf32_littlearm_vec)	tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
    bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
    bfd_elf32_bigarc_vec)	tb="$tb elf32-arc.lo elf32.lo $elf" ;;
    bfd_elf32_bigarm_vec)	tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
    bfd_elf32_bigarm_oabi_vec)	tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
    bfd_elf32_big_generic_vec) 	tb="$tb elf32-gen.lo elf32.lo $elf" ;;
    bfd_elf32_bigmips_vec) 	tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
    bfd_elf64_bigmips_vec) 	tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
				target64=true ;;
    bfd_elf32_d10v_vec)		tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
    bfd_elf32_d30v_vec)		tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
    bfd_elf32_fr30_vec)		tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
    bfd_elf32_hppa_vec)		tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
    bfd_elf32_i370_vec)		tb="$tb elf32-i370.lo elf32.lo $elf" ;;
    bfd_elf32_i386_vec)		tb="$tb elf32-i386.lo elf32.lo $elf" ;;
    bfd_elf32_i860_vec)		tb="$tb elf32-i860.lo elf32.lo $elf" ;;
    bfd_elf32_i960_vec)		tb="$tb elf32-i960.lo elf32.lo $elf" ;;
    bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
    bfd_elf32_littlemips_vec) 	tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
    bfd_elf64_littlemips_vec) 	tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
				target64=true ;;
    bfd_elf32_m32r_vec)		tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
    bfd_elf32_m68k_vec)		tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
    bfd_elf32_m88k_vec)		tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
    bfd_elf32_mcore_big_vec)	tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
    bfd_elf32_mcore_little_vec)	tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
    bfd_elf32_mn10200_vec)	tb="$tb elf-m10200.lo elf32.lo $elf" ;;
    bfd_elf32_mn10300_vec)	tb="$tb elf-m10300.lo elf32.lo $elf" ;;
    bfd_elf32_pj_vec)           tb="$tb elf32-pj.lo elf32.lo $elf";;
    bfd_elf32_pjl_vec)          tb="$tb elf32-pj.lo elf32.lo $elf";;
    bfd_elf32_powerpc_vec)	tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
    bfd_elf32_powerpcle_vec)	tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
    bfd_elf32_sh_vec)		tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
    bfd_elf32_shl_vec)		tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
    bfd_elf32_sparc_vec)	tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
    bfd_elf32_v850_vec)		tb="$tb elf32-v850.lo elf32.lo $elf" ;;
    bfd_elf64_big_generic_vec) 	tb="$tb elf64-gen.lo elf64.lo $elf"
				target64=true ;;
    bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"
				target64=true ;;
    bfd_elf64_sparc_vec)	tb="$tb elf64-sparc.lo elf64.lo $elf"
				target64=true ;;
    cisco_core_big_vec)		tb="$tb cisco-core.lo" ;;
    cisco_core_little_vec)	tb="$tb cisco-core.lo" ;;
    demo_64_vec)		tb="$tb demo64.lo aout64.lo"
				target64=true ;;
    ecoff_big_vec)		tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
    ecoff_little_vec)		tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
    ecoff_biglittle_vec)	tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
    ecoffalpha_little_vec)	tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"
				target64=true ;;
    go32coff_vec)		tb="$tb coff-go32.lo cofflink.lo" ;;
    go32stubbedcoff_vec)	tb="$tb coff-stgo32.lo cofflink.lo" ;;
    h8300coff_vec)		tb="$tb coff-h8300.lo reloc16.lo" ;;
    h8500coff_vec)		tb="$tb coff-h8500.lo reloc16.lo" ;;
    host_aout_vec)		tb="$tb host-aout.lo aout32.lo" ;;
    hp300bsd_vec)		tb="$tb hp300bsd.lo aout32.lo" ;;
    hp300hpux_vec)		tb="$tb hp300hpux.lo aout32.lo" ;;
    i386aout_vec)		tb="$tb i386aout.lo aout32.lo" ;;
    i386bsd_vec)		tb="$tb i386bsd.lo aout32.lo" ;;
    i386coff_vec)		tb="$tb coff-i386.lo cofflink.lo" ;;
    i386dynix_vec)		tb="$tb i386dynix.lo aout32.lo" ;;
    i386freebsd_vec)		tb="$tb i386freebsd.lo aout32.lo" ;;
    i386msdos_vec)		tb="$tb i386msdos.lo" ;;
    i386pe_vec)			tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
    i386pei_vec)		tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
    i386linux_vec)		tb="$tb i386linux.lo aout32.lo" ;;
    i386lynx_aout_vec)		tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
    i386lynx_coff_vec)		tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
    i386mach3_vec)		tb="$tb i386mach3.lo aout32.lo" ;;
    i386netbsd_vec)		tb="$tb i386netbsd.lo aout32.lo" ;;
    i386os9k_vec)		tb="$tb i386os9k.lo aout32.lo" ;;
    i860coff_vec)		tb="$tb coff-i860.lo cofflink.lo" ;;
    icoff_big_vec)		tb="$tb coff-i960.lo cofflink.lo" ;;
    icoff_little_vec)		tb="$tb coff-i960.lo cofflink.lo" ;;
    ieee_vec)			tb="$tb ieee.lo" ;;
    m68kcoff_vec)		tb="$tb coff-m68k.lo cofflink.lo" ;;
    m68kcoffun_vec)		tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;;
    m68klinux_vec)		tb="$tb m68klinux.lo aout32.lo" ;;
    m68klynx_aout_vec)		tb="$tb m68klynx.lo lynx-core.lo aout32.lo" ;;
    m68klynx_coff_vec)		tb="$tb cf-m68klynx.lo coff-m68k.lo cofflink.lo lynx-core.lo" ;;
    m68knetbsd_vec)		tb="$tb m68knetbsd.lo aout32.lo" ;;
    m68k4knetbsd_vec)		tb="$tb m68k4knetbsd.lo aout32.lo" ;;
    m68kaux_coff_vec)		tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
    m68ksysvcoff_vec)		tb="$tb coff-svm68k.lo cofflink.lo" ;;
    m88kbcs_vec)		tb="$tb coff-m88k.lo" ;;
    mipslpe_vec)		tb="$tb pe-mips.lo cofflink.lo" ;;
    mipslpei_vec)		tb="$tb pei-mips.lo cofflink.lo" ;;
    mcore_pe_big_vec)		tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
    mcore_pe_little_vec)	tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
    mcore_pei_big_vec)		tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
    mcore_pei_little_vec)	tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
    newsos3_vec)		tb="$tb newsos3.lo aout32.lo" ;;
    nlm32_i386_vec)		tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
    nlm32_sparc_vec)		tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
    nlm32_alpha_vec)		tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"
				target64=true ;;
    riscix_vec)			tb="$tb aout32.lo riscix.lo" ;;
    nlm32_powerpc_vec)		tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
    pc532netbsd_vec)		tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
    pc532machaout_vec)		tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
    pmac_xcoff_vec)		tb="$tb coff-pmac.lo xcofflink.lo" ;;
    rs6000coff_vec)		tb="$tb coff-rs6000.lo xcofflink.lo" ;;
    bfd_powerpc_pe_vec)         tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;  
    bfd_powerpcle_pe_vec)       tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;  
    bfd_powerpc_pei_vec)        tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
    bfd_powerpcle_pei_vec)      tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
    ppcboot_vec)		tb="$tb ppcboot.lo" ;;
    shcoff_vec)			tb="$tb coff-sh.lo cofflink.lo" ;;
    shlcoff_vec)		tb="$tb coff-sh.lo cofflink.lo" ;;
    shcoff_small_vec)		tb="$tb coff-sh.lo cofflink.lo" ;;
    shlcoff_small_vec)		tb="$tb coff-sh.lo cofflink.lo" ;;
    shlpe_vec)			tb="$tb pe-sh.lo coff-sh.lo cofflink.lo" ;;
    shlpei_vec)			tb="$tb pei-sh.lo coff-sh.lo cofflink.lo" ;;
    som_vec)			tb="$tb som.lo" ;;
    sparcle_aout_vec)		tb="$tb aout-sparcle.lo aout32.lo" ;;
    sparclinux_vec)		tb="$tb sparclinux.lo aout32.lo" ;;
    sparclynx_aout_vec)		tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
    sparclynx_coff_vec)		tb="$tb cf-sparclynx.lo lynx-core.lo" ;;
    sparcnetbsd_vec)		tb="$tb sparcnetbsd.lo aout32.lo" ;;
    sparccoff_vec)		tb="$tb coff-sparc.lo" ;;
    srec_vec)			tb="$tb srec.lo" ;;
    sunos_big_vec)		tb="$tb sunos.lo aout32.lo" ;;
    symbolsrec_vec)		tb="$tb srec.lo" ;;
    tekhex_vec)			tb="$tb tekhex.lo" ;;
    tic30_aout_vec)		tb="$tb aout-tic30.lo" ;;
    tic30_coff_vec)		tb="$tb coff-tic30.lo" ;;
    tic80coff_vec)		tb="$tb coff-tic80.lo cofflink.lo" ;;
    versados_vec)		tb="$tb versados.lo" ;;
    vms_alpha_vec)		tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"
 				target64=true ;;
    vms_vax_vec)		tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;;
    w65_vec)			tb="$tb coff-w65.lo reloc16.lo" ;;
    we32kcoff_vec)		tb="$tb coff-we32k.lo" ;;
    z8kcoff_vec)		tb="$tb coff-z8k.lo reloc16.lo" ;;

    "")			;;
    *) AC_MSG_ERROR(*** unknown target vector $vec) ;;
    esac
done

# Target architecture .o files.
# A couple of CPUs use shorter file names to avoid problems on DOS
# filesystems.
ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.lo/g -e s/mn10200/m10200/ -e s/mn10300/m10300/`

# Weed out duplicate .o files.
f=""
for i in $tb ; do
    case " $f " in
    *" $i "*) ;;
    *) f="$f $i" ;;
    esac
done
tb="$f"

f=""
for i in $ta ; do
    case " $f " in
    *" $i "*) ;;
    *) f="$f $i" ;;
    esac
done
ta="$f"

bfd_backends="$tb"
bfd_machines="$ta"

if test x${all_targets} = xtrue ; then
  bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
  bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
  selvecs=
  havevecs=
  selarchs=
else	# all_targets is true
  # Only set these if they will be nonempty, for the clever echo.
  havevecs=
  test -n "$selvecs" &&
    havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'`
  test -n "$selvecs" &&
    selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
  test -n "$selarchs" &&
    selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
fi	# all_targets is true

case ${host64}-${target64}-${want64} in
  *true*)
    wordsize=64
    all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
    if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then
      AC_MSG_WARN([You have requested a 64 bit BFD configuration, but])
      AC_MSG_WARN([your compiler may not have a 64 bit integral type])
    fi
    ;;
  false-false-false)
    wordsize=32
    all_backends='$(BFD32_BACKENDS)'
    ;;
esac

AC_SUBST(wordsize)
AC_SUBST(all_backends)
AC_SUBST(bfd_backends)
AC_SUBST(bfd_machines)

tdefaults=""
test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}"
AC_SUBST(tdefaults)

dnl AC_CHECK_HEADERS(sys/mman.h)
AC_FUNC_MMAP
AC_CHECK_FUNCS(madvise mprotect)
case ${want_mmap}+${ac_cv_func_mmap_fixed_mapped} in
  true+yes )  AC_DEFINE(USE_MMAP, 1, [Use mmap if it's available?]) ;;
esac

rm -f doc/config.status
AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in,
[sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile])