Keep m68klynx.c
[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
DM
34# Canonicalize the secondary target names.
35if [ -n "$with_targets" ]; then
36 for targ in `echo $with_targets | sed 's/,/ /g'`
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
cf39664e 52 bfd_target=`$srcdir/config.bfd $targ`
180acef5 53
d9ad93bc
KR
54 case "$targ" in
55 netbsd386) bfd_target=i386-netbsd ;;
56 esac
57
180acef5 58 if [ "x$bfd_target" = "xall" ]; then
5f9a2245
DM
59 all_targets=true
60 else
180acef5
DM
61 if [ ! -f ${srcdir}/config/${bfd_target}.mt ] ; then
62 echo '***' No file ${srcdir}/config/${bfd_target}.mt 1>&2
63 echo '***' BFD does not support target ${bfd_target} 1>&2
03f4cf99 64 echo '***' Look in bfd/config.bfd for supported targets 1>&2
5f9a2245 65 exit 1
5b2765bf 66 fi
4dfe09da 67
180acef5
DM
68 if [ "x$targ" = "x$target" ]; then
69 target_makefile_frag=${srcdir}/config/${bfd_target}.mt
5f9a2245 70 else
180acef5 71 target_extra_frags="$target_extra_frags ${srcdir}/config/${bfd_target}.mt"
5f9a2245
DM
72 fi
73 fi
74done
75
a339de27 76# We don't do any links based on the target system, just makefile config.
7a35367c
KR
77
78# post-target:
79
b32ae8e2
JK
80rm -f Makefile.tmp Makefile.2
81mv Makefile Makefile.tmp
82
b32ae8e2 83case ${with_64_bit_bfd} in
c812942f
KR
84 yes) want64=true ;;
85 no | "") want64=false ;;
b32ae8e2
JK
86 *)
87 echo "*** bad value \"${with_64_bit_bfd}\" for 64-bit-bfd flag; ignored" 1>&2
88 ;;
89esac
90
ffe26398
KR
91# This processing still needs to be done if we're to decide properly whether
92# 64-bit support needs to be compiled in. Currently, it will be included if
93# the default or any other explicitly requested target requires it; it
94# will not be included on a 32-bit host if no 64-bit target is requested, and
95# no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
96# used.
97
5f9a2245
DM
98# The default vector in the primary target.
99DEFAULT_VECTOR=`sed -n '
100s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
101' $target_makefile_frag`
102
ffe26398 103allfrags="$target_makefile_frag $target_extra_frags"
5f9a2245 104
ffe26398
KR
105# The default and selected vectors in all the configured targets.
106SELECT_VECS=`sed -n '
107s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
108s/SELECT_VECS[ ]*=[ ]*\([^ ]*\)/\1/p
109' $allfrags`
110# uniq the list.
111f=""
112for i in $SELECT_VECS ; do
113 case " $f " in
114 *" $i "*) ;;
115 *) f="$f $i" ;;
116 esac
117done
118SELECT_VECS="$f"
119
120# The architectures in all the configured targets.
121SELECT_ARCHITECTURES=`sed -n '
122s/SELECT_ARCHITECTURES[ ]*=[ ]*//p
123' $allfrags`
124# uniq the list.
125f=""
126for i in $SELECT_ARCHITECTURES ; do
127 case " $f " in
128 *" $i "*) ;;
129 *) f="$f $i" ;;
130 esac
131done
132SELECT_ARCHITECTURES="$f"
5f9a2245 133
ffe26398
KR
134# Target backend .o files.
135tb=
136
137for vec in $SELECT_VECS
138do
139 case "$vec" in
140 # This list is alphabetized to make it easy to compare
141 # with the two vector lists in targets.c.
142 a29kcoff_big_vec) tb="$tb coff-a29k.o" ;;
143 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o stab-syms.o" ;;
144 aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
145 aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
146 b_out_vec_big_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
147 b_out_vec_little_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
148 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;;
149 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o elf.o" ;;
150 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o elf.o" ;;
151 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o elf.o" ;;
152 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o elf.o" ;;
153 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;;
154 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o elf.o" ;;
155 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o elf.o" ;;
156 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o elf.o" ;;
157 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o elf.o" ;;
158 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o"
7adbe989 159 target64=true ;;
ffe26398 160 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o"
7adbe989 161 target64=true ;;
ffe26398
KR
162# start-sanitize-v9
163 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o elf.o"
7adbe989 164 target64=true ;;
ffe26398
KR
165# end-sanitize-v9
166 demo_64_vec) tb="$tb demo64.o aout64.o stab-syms.o"
7adbe989 167 target64=true ;;
ffe26398
KR
168 ecoff_big_vec) tb="$tb coff-mips.o" ;;
169 ecoff_little_vec) tb="$tb coff-mips.o" ;;
170 ecoffalpha_little_vec) tb="$tb coff-alpha.o" ;;
171 h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
172 h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
173 host_aout_vec) tb="$tb host-aout.o aout32.o stab-syms.o" ;;
174 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o stab-syms.o" ;;
175 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o stab-syms.o" ;;
176 hppa_vec) tb="$tb som.o" ;;
177 i386aout_vec) tb="$tb i386aout.o aout32.o stab-syms.o" ;;
178 i386bsd_vec) tb="$tb i386bsd.o aout32.o stab-syms.o" ;;
179 netbsd386_vec) tb="$tb netbsd386.o aout32.o stab-syms.o" ;;
180 i386coff_vec) tb="$tb coff-i386.o" ;;
181 i386linux_vec) tb="$tb i386linux.o aout32.o stab-syms.o" ;;
182 i386lynx_vec) tb="$tb i386lynx.o aout32.o stab-syms.o" ;;
183 icoff_big_vec) tb="$tb coff-i960.o" ;;
184 icoff_little_vec) tb="$tb coff-i960.o" ;;
185 ieee_vec) tb="$tb ieee.o" ;;
186 m68kcoff_vec) tb="$tb coff-m68k.o" ;;
187 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o" ;;
188 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
189 newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;;
190 nlm32_big_generic_vec) tb="$tb nlm32-gen.o nlm32.o nlm.o" ;;
191 nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
192 nlm32_little_generic_vec) tb="$tb nlm32-gen.o nlm32.o nlm.o" ;;
193 nlm64_big_generic_vec) tb="$tb nlm64-gen.o nlm64.o nlm.o"
7adbe989 194 target64=true ;;
ffe26398 195 nlm64_little_generic_vec) tb="$tb nlm64-gen.o nlm64.o nlm.o"
7adbe989 196 target64=true ;;
ffe26398
KR
197 rs6000coff_vec) tb="$tb coff-rs6000.o" ;;
198 shcoff_vec) tb="$tb coff-sh.o reloc16.o" ;;
199 sunos_big_vec) tb="$tb sunos.o aout32.o stab-syms.o" ;;
200 tekhex_vec) tb="$tb tekhex.o" ;;
201 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
202 z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;;
203
204 srec_vec) tb="$tb srec.o" ;;
205 symbolsrec_vec) tb="$tb srec.o" ;;
206
207 "") ;;
208 *) echo "*** unknown target vector $vec" 1>&2; exit 1 ;;
209 esac
210done
5f9a2245 211
ffe26398
KR
212# Target architecture .o files.
213ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
5f9a2245 214
ffe26398
KR
215# Weed out duplicate .o files.
216f=""
217for i in $tb ; do
218 case " $f " in
219 *" $i "*) ;;
220 *) f="$f $i" ;;
221 esac
222done
223tb="$f"
224
225f=""
226for i in $ta ; do
227 case " $f " in
228 *" $i "*) ;;
229 *) f="$f $i" ;;
230 esac
231done
232ta="$f"
5f9a2245 233
ffe26398
KR
234bfd_backends="$tb"
235bfd_machines="$ta"
5f9a2245 236
ffe26398
KR
237# Only set these if they will be nonempty, for the clever echo.
238test -n "$SELECT_VECS" &&
239 selvecs=`echo $SELECT_VECS | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
240test -n "SELECT_ARCHITECTURES" &&
241 selarchs=`echo $SELECT_ARCHITECTURES | sed -e 's/ \(.\)/,\1/g'`
5f9a2245 242
ffe26398
KR
243if [ x${all_targets} = xtrue ]; then
244 bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
245 bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
5f9a2245
DM
246fi # all_targets is true
247
7adbe989
KR
248case ${host64}-${target64}-${want64} in
249 *true*)
250 wordsize=64
251 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
252 ;;
253 false-false-false)
254 wordsize=32
255 all_backends='$(BFD32_BACKENDS)'
256 ;;
257esac
258
259echo WORDSIZE=${wordsize} >> Makefile.2
260echo ALL_BACKENDS=${all_backends} >> Makefile.2
261echo BFD_BACKENDS=${bfd_backends} >> Makefile.2
262echo BFD_MACHINES=${bfd_machines} >> Makefile.2
263
5f9a2245
DM
264test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
265
266echo "TDEFAULTS = \
267${defvec+-DDEFAULT_VECTOR=$defvec} \
268${selvecs+-DSELECT_VECS='$selvecs'} \
269${selarchs+-DSELECT_ARCHITECTURES='$selarchs'}" \
270 >> Makefile.2
c812942f 271
b32ae8e2
JK
272cat Makefile.tmp >> Makefile.2
273rm -f Makefile.tmp
274mv Makefile.2 Makefile
This page took 0.090233 seconds and 4 git commands to generate.