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