make target selection fully configurable
[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
5f9a2245
DM
34if [ "x$target" = "xall" ]; then
35 echo "*** 'all' can not be the default target" 1>&2
36 exit 1
37fi
38
218ce930
JG
39# WHEN ADDING ENTRIES TO THIS MATRIX:
40# Make sure that the left side always has two dashes. Otherwise you
41# can get spurious matches. Even for unambiguous cases, do this as a
42# convention, else the table becomes a real mess to understand and maintain.
43
1e730c4b 44case "${target}" in
9faacb92 45 alpha-*-*) bfd_target=alphaosf ;;
439a4936
JG
46 a29k-*-ebmon) bfd_target=a29k-coff ;;
47 a29k-*-udi) bfd_target=a29k-coff ;;
48 a29k-*-aout) bfd_target=a29k-aout ;;
49 a29k-*-coff) bfd_target=a29k-coff ;;
50 a29k-*-sym1) bfd_target=a29k-coff ;;
7024033b 51 h8300*-*-*) bfd_target=h8300-coff ;;
9faacb92
SC
52 h8500-*-*) bfd_target=h8500-coff ;;
53 sh-*-*) bfd_target=sh-coff ;;
b32ae8e2
JK
54 hppa*-*-bsd*) bfd_target=hppabsd ;;
55 hppa*-*-hpux*) bfd_target=hppahpux ;;
18f81c05 56 hppa*-*-osf) bfd_target=hppa-elf ;;
439a4936
JG
57 i[34]86-*-sysv4*) bfd_target=i386-elf ;;
58 i[34]86-*-sysv*) bfd_target=i386-coff ;;
b32ae8e2 59 i[34]86-*-isc*) bfd_target=i386-sco ;; # gets core dump reading right
60ac749c 60 i[34]86-*-sco*) bfd_target=i386-sco ;;
5a5fa368 61 i[34]86-*-bsd*) bfd_target=i386-bsd ;;
84d3f422 62 i[34]86-*-lynxos*) bfd_target=i386-lynx ;;
c812942f 63 i[34]86-*-coff) bfd_target=i386-coff ;;
60ac749c 64 i[34]86-*-aix*) bfd_target=i386-coff ;;
7a35367c 65 i[34]86-*-elf) bfd_target=i386-elf ;;
c3e964b9 66 i[34]86-*-netware*) bfd_target=i386-nlm ;;
772b5e9b 67 i[34]86-*-linux*) bfd_target=i386-linux ;;
5f9a2245 68 i[34]86-*-lynx*) bfd_target=i386-lynx ;;
439a4936
JG
69 i[34]86-none-*) bfd_target=i386-coff ;;
70 i960-*-vxworks) bfd_target=i960-bout ;;
6ac05343
JG
71 i960-*-aout) bfd_target=i960-bout ;;
72 i960-*-bout) bfd_target=i960-bout ;;
df61743d 73 m68*-bull-sysv*) bfd_target=u68k-coff ;;
b32ae8e2 74 m68*-hp-bsd*) bfd_target=hp300bsd ;;
439a4936
JG
75 m68*-*-aout) bfd_target=m68k-aout ;;
76 m68*-*-coff) bfd_target=m68k-coff ;;
b32ae8e2 77 m68*-*-hpux*) bfd_target=hp300hpux ;;
439a4936
JG
78 m68*-*-os68k) bfd_target=m68k-aout ;;
79 m68*-*-sunos*) bfd_target=m68k-aout ;;
b32ae8e2 80 m68*-*-sysv*) bfd_target=m68k-coff ;;
439a4936
JG
81 m68*-*-vxworks*) bfd_target=m68k-aout ;;
82 m68*-ericsson-*) bfd_target=m68k-aout ;;
83 m68*-netx-*) bfd_target=m68k-aout ;;
84 m88k-*-*) bfd_target=m88k-coff ;;
9faacb92 85 mips-big-*) bfd_target=bigmips ;;
7a35367c 86 mips-dec-bsd*) bfd_target=mipsdecbsd ;;
439a4936 87 mips-dec-*) bfd_target=decstation ;;
b32ae8e2
JK
88 mips-*-ecoffl*) bfd_target=decstation ;;
89 mips-*-ecoff*) bfd_target=bigmips ;;
9faacb92 90 mips-sgi-*) bfd_target=bigmips ;;
b32ae8e2 91 mips-*-sysv*) bfd_target=riscos ;;
c812942f 92 mips-*-riscos*) bfd_target=riscos ;;
9b4be067 93 mips-*-bsd*) bfd_target=noop ;;
439a4936
JG
94 rs6000-*-*) bfd_target=rs6000 ;;
95 sparc-*-solaris2*) bfd_target=sparc-elf ;;
96 sparc-*-sysv4*) bfd_target=sparc-elf ;;
6ed3ddef 97# start-sanitize-v9
5f9a2245
DM
98# Don't set target64=true for sparc64-*-aout*. Keep it using the 32bit stuff
99# so we continue to have something that works (until the 64 bit support is
100# rock solid).
101 sparc64-*-aout*) bfd_target=sparc-aout ;;
6ed3ddef
KR
102 sparc64-*-elf*) bfd_target=sparc64-elf ; target64=true ;;
103# end-sanitize-v9
60ac749c 104 sparc*-*-*) bfd_target=sparc-aout ;;
439a4936 105 tahoe-*-*) bfd_target=tahoe ;;
7a35367c 106 vax-*-vms) bfd_target=vax-vms ;;
439a4936
JG
107 vax-*-*) bfd_target=vax ;;
108 we32k-*-*) bfd_target=we32k ;;
109 z8k*-*-*) bfd_target=z8k-coff ;;
110
111 *-*-aout) bfd_target=${target_cpu}-aout ;;
b32ae8e2 112 *-*-bsd*) bfd_target=${target_cpu}-aout ;;
c3e964b9 113 *-*-netware*) bfd_target=${target_cpu}-nlm ;;
439a4936
JG
114 *-*-sysv4*) bfd_target=${target_cpu}-elf ;;
115 *-*-solaris2*) bfd_target=${target_cpu}-elf ;;
116 *-*-go32) bfd_target=${target_cpu}-aout ;;
439a4936 117 *-*-sysv*) bfd_target=${target_cpu}-coff ;;
439a4936 118
b32ae8e2
JK
119 *-*-aout64) bfd_target=${target_cpu}-aout64 ; target64=true ;;
120 *-*-elf64) bfd_target=${target_cpu}-elf64 ; target64=true ;;
121
439a4936
JG
122 *-adobe-*) bfd_target=adobe ;;
123 *-sony-*) bfd_target=news ;;
124 *-intel-*) bfd_target=${target_cpu}-coff ;;
125 *-stratus-*) bfd_target=${target_cpu}-elf ;;
126 *-cbm-*) bfd_target=${target_cpu}-elf ;;
127 *-ncr-*) bfd_target=${target_cpu}-elf ;;
128 *-tandem-*) bfd_target=st2000 ;;
4dfe09da
RP
129esac
130
5f9a2245
DM
131[ -z "$bfd_target" ] && bfd_target="$target" # For error message.
132
133all_targets=false
134for targ in $bfd_target `echo $with_bfd_targets | sed 's/,/ /g'`
135do
136 if [ "x$targ" = "xall" ]; then
137 all_targets=true
138 else
139 if [ ! -f ${srcdir}/config/${targ}.mt ] ; then
140 if [ -n "${targ}" ] ; then
141 echo '***' No file ${srcdir}/config/${targ}.mt 1>&2
142 fi
143 echo '***' BFD does not support target ${targ} 1>&2
144 echo '***' Look in bfd/configure.in for supported targets 1>&2
145 exit 1
5b2765bf 146 fi
4dfe09da 147
5f9a2245
DM
148 if [ "x$bfd_target" = "x$targ" ]; then
149 target_makefile_frag=${srcdir}/config/${targ}.mt
150 else
151 target_extra_frags="$target_extra_frags ${srcdir}/config/${targ}.mt"
152 fi
153 fi
154done
155
156# We don't do any links based on the target system, just minor makefile
5b2765bf 157# config.
7a35367c
KR
158
159# post-target:
160
b32ae8e2
JK
161rm -f Makefile.tmp Makefile.2
162mv Makefile Makefile.tmp
163
b32ae8e2 164case ${with_64_bit_bfd} in
c812942f
KR
165 yes) want64=true ;;
166 no | "") want64=false ;;
b32ae8e2
JK
167 *)
168 echo "*** bad value \"${with_64_bit_bfd}\" for 64-bit-bfd flag; ignored" 1>&2
169 ;;
170esac
171
172case ${host64}-${target64}-${want64} in
173 *true*)
174 echo WORDSIZE=64 >> Makefile.2
c812942f 175 echo 'ALL_BACKENDS = $(BFD64_BACKENDS) $(BFD32_BACKENDS)' >> Makefile.2
b32ae8e2
JK
176 ;;
177 false-false-false)
178 echo WORDSIZE=32 >> Makefile.2
c812942f 179 echo 'ALL_BACKENDS = $(BFD32_BACKENDS)' >> Makefile.2
b32ae8e2
JK
180 ;;
181esac
182
5f9a2245
DM
183# The default vector in the primary target.
184DEFAULT_VECTOR=`sed -n '
185s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
186' $target_makefile_frag`
187
188if [ x${all_targets} = xfalse ]; then
189
190 allfrags="$target_makefile_frag $target_extra_frags"
c812942f 191
5f9a2245
DM
192 # The default and selected vectors in all the configured targets.
193 SELECT_VECS=`sed -n '
194 s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
195 s/SELECT_VECS[ ]*=[ ]*\([^ ]*\)/\1/p
196 ' $allfrags | sort -u`
197
198 # The architectures in all the configured targets.
199 SELECT_ARCHITECTURES=`sed -n '
200 s/SELECT_ARCHITECTURES[ ]*=[ ]*//p
201 ' $allfrags | sort -u`
202
203 # Target backend .o files.
204 tb=
205
206 for vec in $SELECT_VECS
207 do
208 case "$vec" in
209 a29kcoff_big_vec) tb="$tb coff-a29k.o" ;;
210 a_out_adobe_vec) tb="$tb aout-adobe.o" ;;
211 aout_mips_little_vec) tb="$tb mipsbsd.o" ;;
212 b_out_vec_big_host) tb="$tb bout.o" ;;
213 b_out_vec_little_host) tb="$tb bout.o" ;;
214 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o elf.o" ;;
215 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o elf.o" ;;
216 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o elf.o" ;;
217 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o elf.o" ;;
218 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o elf.o" ;;
219# start-sanitize-v9
220 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o elf.o" ;;
221# end-sanitize-v9
222 bfd_nlm32_i386_vec) tb="$tb nlm32-i386.o" ;;
223 ecoff_big_vec) tb="$tb coff-mips.o" ;;
224 ecoff_little_vec) tb="$tb coff-mips.o" ;;
225 ecoffalpha_little_vec) tb="$tb coff-alpha.o" ;;
226 h8300coff_vec) tb="$tb coff-h8300.o" ;;
227 h8500coff_vec) tb="$tb coff-h8500.o" ;;
228 host_aout_vec) tb="$tb host-aout.o" ;;
229 hp300bsd_vec) tb="$tb hp300bsd.o" ;;
230 hp300hpux_vec) tb="$tb hp300hpux.o" ;;
231 hppa_vec) tb="$tb hppa.o" ;;
232 i386aout_vec) tb="$tb i386aout.o" ;;
233 i386bsd_vec) tb="$tb i386bsd.o" ;;
234 i386coff_vec) tb="$tb coff-i386.o" ;;
235 i386linux_vec) tb="$tb i386linux.o" ;;
236 i386lynx_vec) tb="$tb i386lynx.o" ;;
237 icoff_big_vec) tb="$tb coff-i960.o" ;;
238 icoff_little_vec) tb="$tb coff-i960.o" ;;
239 ieee_vec) tb="$tb ieee.o" ;;
240 m68kcoff_vec) tb="$tb coff-m68k.o" ;;
241 m68kcoffun_vec) tb="$tb coff-u68k.o" ;;
242 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
243 newsos3_vec) tb="$tb newsos3.o" ;;
244 rs6000coff_vec) tb="$tb coff-rs6000.o" ;;
245 shcoff_vec) tb="$tb coff-sh.o" ;;
246 srec_vec) tb="$tb srec.o" ;;
247 sunos_big_vec) tb="$tb sunos.o aout32.o stab-syms.o" ;;
248 symbolsrec_vec) tb="$tb srec.o" ;;
249 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
250 z8kcoff_vec) tb="$tb coff-z8k.o" ;;
251
252 "") ;;
253 *) echo "*** unknown target vector $vec in $f" 1>&2; exit 1 ;;
254 esac
255 done
256
257 # Target architecture .o files.
258 ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
259
260 # Weed out duplicate .o files.
261 tb=`echo $tb | tr -s ' ' '\012' | sort -u | tr '\012' ' '`
262 ta=`echo $ta | tr -s ' ' '\012' | sort -u | tr '\012' ' '`
263
264 echo "BFD_BACKENDS = $tb" >> Makefile.2
265 echo "BFD_MACHINES = $ta" >> Makefile.2
266
267 # Only set these if they will be nonempty, for the clever echo.
268 test -n "$SELECT_VECS" &&
269 selvecs=`echo $SELECT_VECS | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
270 test -n "SELECT_ARCHITECTURES" &&
271 selarchs=`echo $SELECT_ARCHITECTURES | sed -e 's/ \(.\)/,\1/g'`
272
273else # all_targets is true
274 echo 'BFD_BACKENDS = $(ALL_BACKENDS)' >> Makefile.2
c812942f 275 echo 'BFD_MACHINES = $(ALL_MACHINES)' >> Makefile.2
5f9a2245
DM
276fi # all_targets is true
277
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.087558 seconds and 4 git commands to generate.