Wrap "i[345]86" patterns in changequote lines.
[deliverable/binutils-gdb.git] / bfd / configure.in
CommitLineData
8c693660
KR
1AC_PREREQ(2.3)
2AC_INIT(libbfd.c)
3
4AC_ARG_ENABLE(64-bit-bfd,
e818c22e 5[ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
a52a3ce8 6[case "${enableval}" in
8c693660
KR
7 yes) want64=true ;;
8 no) want64=false ;;
9 *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
10esac],[want64=false])dnl
11AC_ARG_ENABLE(targets,
e818c22e 12[ --enable-targets alternative target configurations],
8c693660
KR
13[case "${enableval}" in
14 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
15 ;;
16 no) enable_targets= ;;
17 *) enable_targets=$enableval ;;
18esac])dnl
19
20AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
21AC_CANONICAL_SYSTEM
22if test -z "$target" ; then
23 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
24fi
25AC_ARG_PROGRAM
26
b32ae8e2
JK
27host64=false
28target64=false
21c9f626 29
8c693660 30# host stuff:
21c9f626 31
5a5fa368 32. ${srcdir}/configure.host
4dfe09da 33
8c693660
KR
34AC_PROG_RANLIB
35
5b2765bf 36# Set up to make a link between the host's include file and "sysdep.h".
8c693660 37files=hosts/${my_host}.h
5b2765bf 38
8c693660 39if test ! -f ${srcdir}/${files} ; then
0e238aa7 40 files=../bfd/hosts/std-host.h
8c693660 41 AC_MSG_WARN(BFD has no specific support for host ${host} -- using std-host)
21c9f626
RP
42fi
43
8c693660
KR
44AC_LINK_FILES($files, sysdep.h)
45
46if test -f ${srcdir}/config/${my_host}.mh ; then
47 host_makefile_frag=$srcdir/config/${my_host}.mh
48else
49 host_makefile_frag=/dev/null
5b2765bf 50fi
8c693660 51AC_SUBST_FILE(host_makefile_frag)
4dfe09da 52
a52a3ce8
ILT
53# If we are configured native, pick a core file support file.
54COREFILE=
55COREFLAG=
56if test "${target}" = "${host}"; then
57 case "${host}" in
58 alpha-*-*) COREFILE=osf-core.o ;;
59 arm-*-riscix) COREFILE=trad-core.o ;;
60 hppa*-*-hpux*) COREFILE=hpux-core.o ;;
61 hppa*-*-hiux*) COREFILE=hpux-core.o ;;
62 hppa*-*-bsd*) COREFILE="hpux-core.o hppabsd-core.o"
63 COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
2cb159a5 64changequote(,)dnl
a52a3ce8
ILT
65 i[345]86-sequent-bsd*) COREFILE=trad-core.o ;;
66 i[345]86-sequent-sysv4*) ;;
67 i[345]86-sequent-sysv*) COREFILE=trad-core.o ;;
68 i[345]86-*-bsd*) COREFILE=trad-core.o ;;
69 i[345]86-*-freebsd*) COREFILE=trad-core.o ;;
70 i[345]86-*-netbsd*) COREFILE=trad-core.o ;;
71 i[345]86-esix-sysv3*) COREFILE=trad-core.o ;;
72 i[345]86-*-sco*) COREFILE=trad-core.o ;;
73 i[345]86-*-mach3*) COREFILE=trad-core.o ;;
74 i[345]86-*-linux*) COREFILE=trad-core.o ;;
75 i[345]86-*-isc*) COREFILE=trad-core.o ;;
76 i[345]86-*-aix*) COREFILE=aix386-core.o ;;
2cb159a5 77changequote([,])dnl
a52a3ce8
ILT
78 mips-dec-bsd*) COREFILE=trad-core.o ;;
79 mips-dec-mach3*) COREFILE=trad-core.o ;;
80 mips-dec-*) COREFILE=trad-core.o ;;
81 mips-sgi-irix4*) COREFILE=irix-core.o ;;
82 mips-sgi-irix5*) COREFILE=irix-core.o ;;
83 mips-*-mach3*) COREFILE=trad-core.o ;;
84 mips-*-sysv4*) ;;
85 mips-*-sysv*) COREFILE=trad-core.o ;;
86 mips-*-riscos*) COREFILE=trad-core.o ;;
87 mips-sony-bsd*) COREFILE=trad-core.o ;;
88 m68*-bull*-sysv*) COREFILE=trad-core.o ;;
89 m68*-hp-hpux*) COREFILE=hpux-core.o ;;
90 m68*-hp-bsd*) COREFILE=trad-core.o ;;
91 m68*-motorola-sysv*) COREFILE=ptrace-core.o ;;
92 m68*-sony-*) COREFILE=trad-core.o ;;
93 m88*-*-sysv4*) ;;
94 m88*-motorola-sysv*) COREFILE=trad-core.o ;;
95 m88*-*-mach3*) COREFILE=trad-core.o ;;
96 ns32k-pc532-mach) COREFILE=trad-core.o ;;
97 rs6000-*-lynx*) COREFILE=lynx-core.o ;;
98 rs6000-*-aix4*) COREFILE=rs6000-core.o
99 COREFLAG=-DALTERNATE_AIX_CORE_FORMAT ;;
100 rs6000-*-*) COREFILE=rs6000-core.o ;;
101 powerpc-*-aix4*) COREFILE=rs6000-core.o
102 COREFLAG=-DALTERNATE_AIX_CORE_FORMAT ;;
103 powerpc-*-aix*) COREFILE=rs6000-core.o ;;
104 tahoe-*-*) COREFILE=trad-core.o ;;
105 vax-*-ultrix2*) COREFILE=trad-core.o ;;
106 vax-*-ultrix*) COREFILE=trad-core.o ;;
107 vax-*-*) COREFILE=trad-core.o ;;
108 esac
109
110 case "$COREFILE" in
111 aix386-core.o) COREFLAG=-DAIX386_CORE ;;
112 hppabsd-core.o) COREFLAG=-DHPPABSD_CORE ;;
113 hpux-core.o) COREFLAG=-DHPUX_CORE ;;
114 irix-core.o) COREFLAG=-DIRIX_CORE ;;
115 lynx-core.o) COREFLAG=-DLYNX_CORE ;;
116 osf-core.o) COREFLAG=-DOSF_CORE ;;
117 ptrace-core.o) COREFLAG=-DPTRACE_CORE ;;
118 rs6000-core.o) COREFLAG="$COREFLAG -DAIX_CORE" ;;
119 trad-core.o) COREFLAG=-DTRAD_CORE ;;
120 esac
121fi
122AC_SUBST(COREFILE)
123AC_SUBST(COREFLAG)
124
8c693660 125# target stuff:
21c9f626 126
180acef5 127# Canonicalize the secondary target names.
8c693660 128if test -n "$enable_targets" ; then
318b02b6 129 for targ in `echo $enable_targets | sed 's/,/ /g'`
180acef5 130 do
9525b61b 131 result=`$ac_config_sub $targ 2>/dev/null`
8c693660 132 if test -n "$result" ; then
180acef5
DM
133 canon_targets="$canon_targets $result"
134 else
135 # Allow targets that config.sub doesn't recognize, like "all".
136 canon_targets="$canon_targets $targ"
137 fi
138 done
139fi
5f9a2245
DM
140
141all_targets=false
180acef5
DM
142
143for targ in $target $canon_targets
5f9a2245 144do
ec35a1c2 145 bfd_target=`${config_shell} $srcdir/config.bfd $targ`
180acef5 146
8c693660 147 if test "x$bfd_target" = "xall" ; then
5f9a2245
DM
148 all_targets=true
149 else
8c693660
KR
150 if test ! -f ${srcdir}/config/${bfd_target}.mt ; then
151 AC_MSG_ERROR(*** No file ${srcdir}/config/${bfd_target}.mt.
152*** BFD does not support target ${bfd_target}.
153*** Look in bfd/config.bfd for supported targets.)
5f9a2245 154 exit 1
5b2765bf 155 fi
4dfe09da 156
8c693660 157 if test "x$targ" = "x$target" ; then
180acef5 158 target_makefile_frag=${srcdir}/config/${bfd_target}.mt
5f9a2245 159 else
180acef5 160 target_extra_frags="$target_extra_frags ${srcdir}/config/${bfd_target}.mt"
5f9a2245
DM
161 fi
162 fi
163done
164
8c693660
KR
165frags=$target_makefile_frag
166if test $host_makefile_frag != /dev/null ; then
167 frags="$frags $host_makefile_frag"
168fi
169AC_SUBST_FILE(target_makefile_frag)
170AC_SUBST(frags)
b32ae8e2 171
ffe26398
KR
172# This processing still needs to be done if we're to decide properly whether
173# 64-bit support needs to be compiled in. Currently, it will be included if
174# the default or any other explicitly requested target requires it; it
175# will not be included on a 32-bit host if no 64-bit target is requested, and
176# no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
177# used.
178
8c693660 179changequote(,)dnl
5f9a2245
DM
180# The default vector in the primary target.
181DEFAULT_VECTOR=`sed -n '
182s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
183' $target_makefile_frag`
184
ffe26398 185allfrags="$target_makefile_frag $target_extra_frags"
5f9a2245 186
ffe26398
KR
187# The default and selected vectors in all the configured targets.
188SELECT_VECS=`sed -n '
189s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
190s/SELECT_VECS[ ]*=[ ]*\([^ ]*\)/\1/p
191' $allfrags`
192# uniq the list.
193f=""
194for i in $SELECT_VECS ; do
195 case " $f " in
196 *" $i "*) ;;
197 *) f="$f $i" ;;
198 esac
199done
200SELECT_VECS="$f"
201
202# The architectures in all the configured targets.
203SELECT_ARCHITECTURES=`sed -n '
204s/SELECT_ARCHITECTURES[ ]*=[ ]*//p
205' $allfrags`
206# uniq the list.
207f=""
208for i in $SELECT_ARCHITECTURES ; do
209 case " $f " in
210 *" $i "*) ;;
211 *) f="$f $i" ;;
212 esac
213done
214SELECT_ARCHITECTURES="$f"
8c693660 215changequote([,])dnl
5f9a2245 216
ffe26398
KR
217# Target backend .o files.
218tb=
219
a52a3ce8
ILT
220elf="elf.o elflink.o"
221
ffe26398
KR
222for vec in $SELECT_VECS
223do
224 case "$vec" in
225 # This list is alphabetized to make it easy to compare
226 # with the two vector lists in targets.c.
69645d10 227 a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;;
ffe26398 228 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o stab-syms.o" ;;
a52a3ce8
ILT
229 armpe_little_vec) tb="$tb pe-arm.o cofflink.o " ;;
230 armpe_big_vec) tb="$tb pe-arm.o cofflink.o " ;;
231 armpei_little_vec) tb="$tb pei-arm.o cofflink.o " ;;
232 armpei_big_vec) tb="$tb pei-arm.o cofflink.o " ;;
4f9617ca 233 aout0_big_vec) tb="$tb aout0.o aout32.o stab-syms.o" ;;
8c693660
KR
234 aout_arm_big_vec) tb="$tb aout-arm.o aout32.o stab-syms.o" ;;
235 aout_arm_little_vec) tb="$tb aout-arm.o aout32.o stab-syms.o" ;;
ffe26398
KR
236 aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
237 aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
2487f88f 238 apollocoff_vec) tb="$tb coff-apollo.o" ;;
ffe26398
KR
239 b_out_vec_big_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
240 b_out_vec_little_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
c7b44b04 241# start-sanitize-arc
a52a3ce8
ILT
242 bfd_elf32_littlearc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
243 bfd_elf32_bigarc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
c7b44b04 244# end-sanitize-arc
a52a3ce8
ILT
245 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
246 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
247 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o $elf" ;;
248 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o $elf" ;;
249 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o $elf" ;;
250 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
251 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
252 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o $elf" ;;
253 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o $elf" ;;
254 bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
255 bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
256 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o $elf" ;;
257 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
7adbe989 258 target64=true ;;
a52a3ce8 259 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
7adbe989 260 target64=true ;;
a52a3ce8 261 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o $elf"
7adbe989 262 target64=true ;;
4f9617ca 263 cisco_core_vec) tb="$tb cisco-core.o" ;;
ffe26398 264 demo_64_vec) tb="$tb demo64.o aout64.o stab-syms.o"
7adbe989 265 target64=true ;;
318b02b6
KR
266 ecoff_big_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
267 ecoff_little_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
268 ecoffalpha_little_vec) tb="$tb coff-alpha.o ecoff.o ecofflink.o"
5dac2dd5 269 target64=true ;;
ffe26398
KR
270 h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
271 h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
272 host_aout_vec) tb="$tb host-aout.o aout32.o stab-syms.o" ;;
273 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o stab-syms.o" ;;
274 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o stab-syms.o" ;;
ffe26398
KR
275 i386aout_vec) tb="$tb i386aout.o aout32.o stab-syms.o" ;;
276 i386bsd_vec) tb="$tb i386bsd.o aout32.o stab-syms.o" ;;
4f9617ca 277 i386dynix_vec) tb="$tb i386dynix.o aout32.o stab-syms.o" ;;
bd23b552 278 i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;;
c7b44b04 279 i386msdos_vec) tb="$tb i386msdos.o" ;;
8c693660
KR
280 i386pe_vec) tb="$tb pe-i386.o cofflink.o " ;;
281 i386pei_vec) tb="$tb pei-i386.o cofflink.o" ;;
ffe26398 282 i386linux_vec) tb="$tb i386linux.o aout32.o stab-syms.o" ;;
48ee0757 283 i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o stab-syms.o" ;;
bd23b552 284 i386lynx_coff_vec) tb="$tb cf-i386lynx.o cofflink.o lynx-core.o stab-syms.o" ;;
5dac2dd5 285 i386mach3_vec) tb="$tb i386mach3.o aout32.o stab-syms.o" ;;
a3f7a777 286 i386netbsd_vec) tb="$tb i386netbsd.o aout32.o stab-syms.o" ;;
85cc33c7 287 i386os9k_vec) tb="$tb i386os9k.o aout32.o stab-syms.o" ;;
ffe26398
KR
288 icoff_big_vec) tb="$tb coff-i960.o" ;;
289 icoff_little_vec) tb="$tb coff-i960.o" ;;
290 ieee_vec) tb="$tb ieee.o" ;;
bd23b552
ILT
291 m68kcoff_vec) tb="$tb coff-m68k.o cofflink.o" ;;
292 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
48ee0757 293 m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o stab-syms.o" ;;
bd23b552 294 m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o stab-syms.o" ;;
ec35a1c2 295 m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o stab-syms.o" ;;
ffe26398
KR
296 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
297 newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;;
ffe26398 298 nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
5dac2dd5 299 nlm32_sparc_vec) tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;;
85cc33c7 300 nlm32_alpha_vec) tb="$tb nlm32-alpha.o nlm32.o nlm.o"
7adbe989 301 target64=true ;;
318b02b6 302 riscix_vec) tb="$tb aout32.o riscix.o stab-syms.o" ;;
4f9617ca 303 nlm32_powerpc_vec) tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;;
7a1d4567 304 pc532netbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o stab-syms.o" ;;
318b02b6 305 pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o stab-syms.o" ;;
ffe26398 306 rs6000coff_vec) tb="$tb coff-rs6000.o" ;;
ec35a1c2 307 shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
03c4ce2f 308# start-sanitize-rce
fb870b50 309 rce_aout_vec) tb="$tb aout-rce.o aout32.o stab-syms.o" ;;
03c4ce2f 310# end-sanitize-rce
7a1d4567 311 shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
318b02b6 312 som_vec) tb="$tb som.o" ;;
c9368a3b
SS
313 sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o stab-syms.o" ;;
314 sparclynx_coff_vec) tb="$tb cf-sparclynx.o lynx-core.o stab-syms.o" ;;
a3f7a777 315 sparcnetbsd_vec) tb="$tb sparcnetbsd.o aout32.o stab-syms.o" ;;
6a6676fb 316 sparccoff_vec) tb="$tb coff-sparc.o" ;;
318b02b6 317 srec_vec) tb="$tb srec.o" ;;
ffe26398 318 sunos_big_vec) tb="$tb sunos.o aout32.o stab-syms.o" ;;
318b02b6 319 symbolsrec_vec) tb="$tb srec.o" ;;
ffe26398
KR
320 tekhex_vec) tb="$tb tekhex.o" ;;
321 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
322 z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;;
c7b44b04 323 w65_vec) tb="$tb coff-w65.o reloc16.o" ;;
8c693660 324 versados_vec) tb="$tb versados.o" ;;
ffe26398 325
ffe26398 326 "") ;;
8c693660 327 *) AC_MSG_ERROR(*** unknown target vector $vec) ;;
ffe26398
KR
328 esac
329done
5f9a2245 330
ffe26398
KR
331# Target architecture .o files.
332ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
5f9a2245 333
ffe26398
KR
334# Weed out duplicate .o files.
335f=""
336for i in $tb ; do
337 case " $f " in
338 *" $i "*) ;;
339 *) f="$f $i" ;;
340 esac
341done
342tb="$f"
343
344f=""
345for i in $ta ; do
346 case " $f " in
347 *" $i "*) ;;
348 *) f="$f $i" ;;
349 esac
350done
351ta="$f"
5f9a2245 352
ffe26398
KR
353bfd_backends="$tb"
354bfd_machines="$ta"
5f9a2245 355
8c693660 356if test x${all_targets} = xtrue ; then
ffe26398
KR
357 bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
358 bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
cede9731
PS
359else # all_targets is true
360 # Only set these if they will be nonempty, for the clever echo.
361 test -n "$SELECT_VECS" &&
362 selvecs=`echo $SELECT_VECS | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
363 test -n "SELECT_ARCHITECTURES" &&
364 selarchs=`echo $SELECT_ARCHITECTURES | sed -e 's/ \(.\)/,\1/g'`
5f9a2245
DM
365fi # all_targets is true
366
7adbe989
KR
367case ${host64}-${target64}-${want64} in
368 *true*)
369 wordsize=64
370 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
371 ;;
372 false-false-false)
373 wordsize=32
374 all_backends='$(BFD32_BACKENDS)'
375 ;;
376esac
377
8c693660
KR
378AC_SUBST(wordsize)
379AC_SUBST(all_backends)
380AC_SUBST(bfd_backends)
381AC_SUBST(bfd_machines)
7adbe989 382
5f9a2245
DM
383test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
384
8c693660 385tdefaults=""
c7b44b04
MM
386test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
387test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
388test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
8c693660 389AC_SUBST(tdefaults)
c812942f 390
8c693660
KR
391rm -f doc/config.status
392AC_OUTPUT(Makefile doc/Makefile)
This page took 0.157391 seconds and 4 git commands to generate.