Safely check in r16 targets for binutils.
[deliverable/binutils-gdb.git] / bfd / configure.in
CommitLineData
21c9f626
RP
1# This file is a shell script that supplies the information necessary
2# to tailor a template configure script into the configure script
3# appropriate for this directory. For more information, check any
4# existing configure script.
5
3b4f1a5d 6configdirs="doc"
21c9f626 7srctrigger=libbfd.c
5b2765bf 8srcname="BFD"
d89b9f99 9target_dependent=true
b32ae8e2
JK
10host64=false
11target64=false
12want64=false
21c9f626
RP
13
14# per-host:
15
5a5fa368 16. ${srcdir}/configure.host
4dfe09da 17
5b2765bf 18# Set up to make a link between the host's include file and "sysdep.h".
5868184b 19files="hosts/${my_host}.h"
5b2765bf
JG
20links="sysdep.h"
21
d89b9f99 22if [ ! -f ${srcdir}/${files} ] ; then
0e238aa7
PB
23 files=../bfd/hosts/std-host.h
24 echo "[${srcname} has no specific support for host ${host} -- using std-host]"
21c9f626
RP
25fi
26
5b2765bf 27host_makefile_frag=
5868184b
FF
28if [ -f ${srcdir}/config/${my_host}.mh ] ; then
29 host_makefile_frag=config/${my_host}.mh
5b2765bf 30fi
4dfe09da 31
21c9f626
RP
32# per-target:
33
180acef5 34# Canonicalize the secondary target names.
318b02b6
KR
35if [ -n "$enable_targets" ]; then
36 for targ in `echo $enable_targets | sed 's/,/ /g'`
180acef5
DM
37 do
38 result=`$configsub $targ 2>/dev/null`
39 if [ -n "$result" ]; then
40 canon_targets="$canon_targets $result"
41 else
42 # Allow targets that config.sub doesn't recognize, like "all".
43 canon_targets="$canon_targets $targ"
44 fi
45 done
46fi
5f9a2245
DM
47
48all_targets=false
180acef5
DM
49
50for targ in $target $canon_targets
5f9a2245 51do
ec35a1c2 52 bfd_target=`${config_shell} $srcdir/config.bfd $targ`
180acef5
DM
53
54 if [ "x$bfd_target" = "xall" ]; then
5f9a2245
DM
55 all_targets=true
56 else
180acef5
DM
57 if [ ! -f ${srcdir}/config/${bfd_target}.mt ] ; then
58 echo '***' No file ${srcdir}/config/${bfd_target}.mt 1>&2
59 echo '***' BFD does not support target ${bfd_target} 1>&2
03f4cf99 60 echo '***' Look in bfd/config.bfd for supported targets 1>&2
5f9a2245 61 exit 1
5b2765bf 62 fi
4dfe09da 63
180acef5
DM
64 if [ "x$targ" = "x$target" ]; then
65 target_makefile_frag=${srcdir}/config/${bfd_target}.mt
5f9a2245 66 else
180acef5 67 target_extra_frags="$target_extra_frags ${srcdir}/config/${bfd_target}.mt"
5f9a2245
DM
68 fi
69 fi
70done
71
a339de27 72# We don't do any links based on the target system, just makefile config.
7a35367c
KR
73
74# post-target:
75
b32ae8e2
JK
76rm -f Makefile.tmp Makefile.2
77mv Makefile Makefile.tmp
78
318b02b6 79case ${enable_64_bit_bfd} in
c812942f
KR
80 yes) want64=true ;;
81 no | "") want64=false ;;
b32ae8e2 82 *)
318b02b6 83 echo "*** bad value \"${enable_64_bit_bfd}\" for 64-bit-bfd flag; ignored" 1>&2
b32ae8e2
JK
84 ;;
85esac
86
ffe26398
KR
87# This processing still needs to be done if we're to decide properly whether
88# 64-bit support needs to be compiled in. Currently, it will be included if
89# the default or any other explicitly requested target requires it; it
90# will not be included on a 32-bit host if no 64-bit target is requested, and
91# no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
92# used.
93
5f9a2245
DM
94# The default vector in the primary target.
95DEFAULT_VECTOR=`sed -n '
96s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
97' $target_makefile_frag`
98
ffe26398 99allfrags="$target_makefile_frag $target_extra_frags"
5f9a2245 100
ffe26398
KR
101# The default and selected vectors in all the configured targets.
102SELECT_VECS=`sed -n '
103s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
104s/SELECT_VECS[ ]*=[ ]*\([^ ]*\)/\1/p
105' $allfrags`
106# uniq the list.
107f=""
108for i in $SELECT_VECS ; do
109 case " $f " in
110 *" $i "*) ;;
111 *) f="$f $i" ;;
112 esac
113done
114SELECT_VECS="$f"
115
116# The architectures in all the configured targets.
117SELECT_ARCHITECTURES=`sed -n '
118s/SELECT_ARCHITECTURES[ ]*=[ ]*//p
119' $allfrags`
120# uniq the list.
121f=""
122for i in $SELECT_ARCHITECTURES ; do
123 case " $f " in
124 *" $i "*) ;;
125 *) f="$f $i" ;;
126 esac
127done
128SELECT_ARCHITECTURES="$f"
5f9a2245 129
ffe26398
KR
130# Target backend .o files.
131tb=
132
133for vec in $SELECT_VECS
134do
135 case "$vec" in
136 # This list is alphabetized to make it easy to compare
137 # with the two vector lists in targets.c.
69645d10 138 a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;;
ffe26398 139 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o stab-syms.o" ;;
4f9617ca 140 aout0_big_vec) tb="$tb aout0.o aout32.o stab-syms.o" ;;
ffe26398
KR
141 aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
142 aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
2487f88f 143 apollocoff_vec) tb="$tb coff-apollo.o" ;;
ffe26398
KR
144 b_out_vec_big_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
145 b_out_vec_little_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
146 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;;
318b02b6 147 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o elf.o ecoff.o ecofflink.o" ;;
ffe26398
KR
148 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o elf.o" ;;
149 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o elf.o" ;;
150 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o elf.o" ;;
151 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;;
318b02b6 152 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o elf.o ecoff.o ecofflink.o" ;;
ffe26398
KR
153 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o elf.o" ;;
154 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o elf.o" ;;
4f9617ca 155 bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.o elf32.o elf.o" ;;
ffe26398
KR
156 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o elf.o" ;;
157 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o"
7adbe989 158 target64=true ;;
ffe26398 159 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o"
7adbe989 160 target64=true ;;
ffe26398 161 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o elf.o"
7adbe989 162 target64=true ;;
4f9617ca 163 cisco_core_vec) tb="$tb cisco-core.o" ;;
ffe26398 164 demo_64_vec) tb="$tb demo64.o aout64.o stab-syms.o"
7adbe989 165 target64=true ;;
318b02b6
KR
166 ecoff_big_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
167 ecoff_little_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
168 ecoffalpha_little_vec) tb="$tb coff-alpha.o ecoff.o ecofflink.o"
5dac2dd5 169 target64=true ;;
ffe26398
KR
170 h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
171 h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
172 host_aout_vec) tb="$tb host-aout.o aout32.o stab-syms.o" ;;
173 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o stab-syms.o" ;;
174 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o stab-syms.o" ;;
ffe26398
KR
175 i386aout_vec) tb="$tb i386aout.o aout32.o stab-syms.o" ;;
176 i386bsd_vec) tb="$tb i386bsd.o aout32.o stab-syms.o" ;;
4f9617ca 177 i386dynix_vec) tb="$tb i386dynix.o aout32.o stab-syms.o" ;;
bd23b552 178 i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;;
ffe26398 179 i386linux_vec) tb="$tb i386linux.o aout32.o stab-syms.o" ;;
48ee0757 180 i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o stab-syms.o" ;;
bd23b552 181 i386lynx_coff_vec) tb="$tb cf-i386lynx.o cofflink.o lynx-core.o stab-syms.o" ;;
5dac2dd5 182 i386mach3_vec) tb="$tb i386mach3.o aout32.o stab-syms.o" ;;
a3f7a777 183 i386netbsd_vec) tb="$tb i386netbsd.o aout32.o stab-syms.o" ;;
85cc33c7 184 i386os9k_vec) tb="$tb i386os9k.o aout32.o stab-syms.o" ;;
ffe26398
KR
185 icoff_big_vec) tb="$tb coff-i960.o" ;;
186 icoff_little_vec) tb="$tb coff-i960.o" ;;
187 ieee_vec) tb="$tb ieee.o" ;;
bd23b552
ILT
188 m68kcoff_vec) tb="$tb coff-m68k.o cofflink.o" ;;
189 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
48ee0757 190 m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o stab-syms.o" ;;
bd23b552 191 m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o stab-syms.o" ;;
ec35a1c2 192 m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o stab-syms.o" ;;
ffe26398
KR
193 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
194 newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;;
ffe26398 195 nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
5dac2dd5 196 nlm32_sparc_vec) tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;;
85cc33c7 197 nlm32_alpha_vec) tb="$tb nlm32-alpha.o nlm32.o nlm.o"
7adbe989 198 target64=true ;;
318b02b6 199 riscix_vec) tb="$tb aout32.o riscix.o stab-syms.o" ;;
4f9617ca 200 nlm32_powerpc_vec) tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;;
7a1d4567 201 pc532netbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o stab-syms.o" ;;
318b02b6 202 pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o stab-syms.o" ;;
ffe26398 203 rs6000coff_vec) tb="$tb coff-rs6000.o" ;;
ec35a1c2 204 shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
d94aca1a
MT
205# start-sanitize-r16
206 r16_aout_vec) tb="$tb aout32.o reloc16.o" ;;
207# end-sanitize-r16
7a1d4567 208 shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
318b02b6 209 som_vec) tb="$tb som.o" ;;
c9368a3b
SS
210 sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o stab-syms.o" ;;
211 sparclynx_coff_vec) tb="$tb cf-sparclynx.o lynx-core.o stab-syms.o" ;;
a3f7a777 212 sparcnetbsd_vec) tb="$tb sparcnetbsd.o aout32.o stab-syms.o" ;;
6a6676fb 213 sparccoff_vec) tb="$tb coff-sparc.o" ;;
318b02b6 214 srec_vec) tb="$tb srec.o" ;;
ffe26398 215 sunos_big_vec) tb="$tb sunos.o aout32.o stab-syms.o" ;;
318b02b6 216 symbolsrec_vec) tb="$tb srec.o" ;;
ffe26398
KR
217 tekhex_vec) tb="$tb tekhex.o" ;;
218 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
219 z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;;
220
ffe26398
KR
221 "") ;;
222 *) echo "*** unknown target vector $vec" 1>&2; exit 1 ;;
223 esac
224done
5f9a2245 225
ffe26398
KR
226# Target architecture .o files.
227ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
5f9a2245 228
ffe26398
KR
229# Weed out duplicate .o files.
230f=""
231for i in $tb ; do
232 case " $f " in
233 *" $i "*) ;;
234 *) f="$f $i" ;;
235 esac
236done
237tb="$f"
238
239f=""
240for i in $ta ; do
241 case " $f " in
242 *" $i "*) ;;
243 *) f="$f $i" ;;
244 esac
245done
246ta="$f"
5f9a2245 247
ffe26398
KR
248bfd_backends="$tb"
249bfd_machines="$ta"
5f9a2245 250
ffe26398
KR
251if [ x${all_targets} = xtrue ]; then
252 bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
253 bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
cede9731
PS
254else # all_targets is true
255 # Only set these if they will be nonempty, for the clever echo.
256 test -n "$SELECT_VECS" &&
257 selvecs=`echo $SELECT_VECS | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
258 test -n "SELECT_ARCHITECTURES" &&
259 selarchs=`echo $SELECT_ARCHITECTURES | sed -e 's/ \(.\)/,\1/g'`
5f9a2245
DM
260fi # all_targets is true
261
7adbe989
KR
262case ${host64}-${target64}-${want64} in
263 *true*)
264 wordsize=64
265 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
266 ;;
267 false-false-false)
268 wordsize=32
269 all_backends='$(BFD32_BACKENDS)'
270 ;;
271esac
272
273echo WORDSIZE=${wordsize} >> Makefile.2
274echo ALL_BACKENDS=${all_backends} >> Makefile.2
275echo BFD_BACKENDS=${bfd_backends} >> Makefile.2
276echo BFD_MACHINES=${bfd_machines} >> Makefile.2
277
5f9a2245
DM
278test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
279
280echo "TDEFAULTS = \
281${defvec+-DDEFAULT_VECTOR=$defvec} \
282${selvecs+-DSELECT_VECS='$selvecs'} \
283${selarchs+-DSELECT_ARCHITECTURES='$selarchs'}" \
284 >> Makefile.2
c812942f 285
b32ae8e2
JK
286cat Makefile.tmp >> Makefile.2
287rm -f Makefile.tmp
288mv Makefile.2 Makefile
This page took 0.145966 seconds and 4 git commands to generate.