Commit | Line | Data |
---|---|---|
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 | 6 | configdirs="doc" |
21c9f626 | 7 | srctrigger=libbfd.c |
5b2765bf | 8 | srcname="BFD" |
d89b9f99 | 9 | target_dependent=true |
b32ae8e2 JK |
10 | host64=false |
11 | target64=false | |
12 | want64=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 | 19 | files="hosts/${my_host}.h" |
5b2765bf JG |
20 | links="sysdep.h" |
21 | ||
d89b9f99 | 22 | if [ ! -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 |
25 | fi |
26 | ||
5b2765bf | 27 | host_makefile_frag= |
5868184b FF |
28 | if [ -f ${srcdir}/config/${my_host}.mh ] ; then |
29 | host_makefile_frag=config/${my_host}.mh | |
5b2765bf | 30 | fi |
4dfe09da | 31 | |
21c9f626 RP |
32 | # per-target: |
33 | ||
180acef5 DM |
34 | # Canonicalize the secondary target names. |
35 | if [ -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 | |
46 | fi | |
5f9a2245 DM |
47 | |
48 | all_targets=false | |
180acef5 DM |
49 | |
50 | for targ in $target $canon_targets | |
5f9a2245 | 51 | do |
cf39664e | 52 | bfd_target=`$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 | |
70 | done | |
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 |
76 | rm -f Makefile.tmp Makefile.2 |
77 | mv Makefile Makefile.tmp | |
78 | ||
b32ae8e2 | 79 | case ${with_64_bit_bfd} in |
c812942f KR |
80 | yes) want64=true ;; |
81 | no | "") want64=false ;; | |
b32ae8e2 JK |
82 | *) |
83 | echo "*** bad value \"${with_64_bit_bfd}\" for 64-bit-bfd flag; ignored" 1>&2 | |
84 | ;; | |
85 | esac | |
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. |
95 | DEFAULT_VECTOR=`sed -n ' | |
96 | s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p | |
97 | ' $target_makefile_frag` | |
98 | ||
ffe26398 | 99 | allfrags="$target_makefile_frag $target_extra_frags" |
5f9a2245 | 100 | |
ffe26398 KR |
101 | # The default and selected vectors in all the configured targets. |
102 | SELECT_VECS=`sed -n ' | |
103 | s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p | |
104 | s/SELECT_VECS[ ]*=[ ]*\([^ ]*\)/\1/p | |
105 | ' $allfrags` | |
106 | # uniq the list. | |
107 | f="" | |
108 | for i in $SELECT_VECS ; do | |
109 | case " $f " in | |
110 | *" $i "*) ;; | |
111 | *) f="$f $i" ;; | |
112 | esac | |
113 | done | |
114 | SELECT_VECS="$f" | |
115 | ||
116 | # The architectures in all the configured targets. | |
117 | SELECT_ARCHITECTURES=`sed -n ' | |
118 | s/SELECT_ARCHITECTURES[ ]*=[ ]*//p | |
119 | ' $allfrags` | |
120 | # uniq the list. | |
121 | f="" | |
122 | for i in $SELECT_ARCHITECTURES ; do | |
123 | case " $f " in | |
124 | *" $i "*) ;; | |
125 | *) f="$f $i" ;; | |
126 | esac | |
127 | done | |
128 | SELECT_ARCHITECTURES="$f" | |
5f9a2245 | 129 | |
ffe26398 KR |
130 | # Target backend .o files. |
131 | tb= | |
132 | ||
133 | for vec in $SELECT_VECS | |
134 | do | |
135 | case "$vec" in | |
136 | # This list is alphabetized to make it easy to compare | |
137 | # with the two vector lists in targets.c. | |
138 | a29kcoff_big_vec) tb="$tb coff-a29k.o" ;; | |
139 | a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o stab-syms.o" ;; | |
140 | aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;; | |
141 | aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;; | |
142 | b_out_vec_big_host) tb="$tb bout.o aout32.o stab-syms.o" ;; | |
143 | b_out_vec_little_host) tb="$tb bout.o aout32.o stab-syms.o" ;; | |
144 | bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;; | |
145 | bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o elf.o" ;; | |
146 | bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o elf.o" ;; | |
147 | bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o elf.o" ;; | |
148 | bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o elf.o" ;; | |
149 | bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;; | |
150 | bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o elf.o" ;; | |
151 | bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o elf.o" ;; | |
152 | bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o elf.o" ;; | |
153 | bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o elf.o" ;; | |
154 | bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o" | |
7adbe989 | 155 | target64=true ;; |
ffe26398 | 156 | bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o" |
7adbe989 | 157 | target64=true ;; |
ffe26398 KR |
158 | # start-sanitize-v9 |
159 | bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o elf.o" | |
7adbe989 | 160 | target64=true ;; |
ffe26398 KR |
161 | # end-sanitize-v9 |
162 | demo_64_vec) tb="$tb demo64.o aout64.o stab-syms.o" | |
7adbe989 | 163 | target64=true ;; |
ffe26398 KR |
164 | ecoff_big_vec) tb="$tb coff-mips.o" ;; |
165 | ecoff_little_vec) tb="$tb coff-mips.o" ;; | |
166 | ecoffalpha_little_vec) tb="$tb coff-alpha.o" ;; | |
167 | h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;; | |
168 | h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;; | |
169 | host_aout_vec) tb="$tb host-aout.o aout32.o stab-syms.o" ;; | |
170 | hp300bsd_vec) tb="$tb hp300bsd.o aout32.o stab-syms.o" ;; | |
171 | hp300hpux_vec) tb="$tb hp300hpux.o aout32.o stab-syms.o" ;; | |
172 | hppa_vec) tb="$tb som.o" ;; | |
173 | i386aout_vec) tb="$tb i386aout.o aout32.o stab-syms.o" ;; | |
174 | i386bsd_vec) tb="$tb i386bsd.o aout32.o stab-syms.o" ;; | |
175 | netbsd386_vec) tb="$tb netbsd386.o aout32.o stab-syms.o" ;; | |
176 | i386coff_vec) tb="$tb coff-i386.o" ;; | |
177 | i386linux_vec) tb="$tb i386linux.o aout32.o stab-syms.o" ;; | |
48ee0757 SS |
178 | i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o stab-syms.o" ;; |
179 | i386lynx_coff_vec) tb="$tb coff-i386lynx.o lynx-core.o stab-syms.o" ;; | |
ffe26398 KR |
180 | icoff_big_vec) tb="$tb coff-i960.o" ;; |
181 | icoff_little_vec) tb="$tb coff-i960.o" ;; | |
182 | ieee_vec) tb="$tb ieee.o" ;; | |
183 | m68kcoff_vec) tb="$tb coff-m68k.o" ;; | |
184 | m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o" ;; | |
48ee0757 SS |
185 | m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o stab-syms.o" ;; |
186 | m68klynx_coff_vec) tb="$tb m68klynx.o lynx-core.o aout32.o stab-syms.o" ;; | |
ffe26398 KR |
187 | m88kbcs_vec) tb="$tb coff-m88k.o" ;; |
188 | newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;; | |
189 | nlm32_big_generic_vec) tb="$tb nlm32-gen.o nlm32.o nlm.o" ;; | |
190 | nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;; | |
191 | nlm32_little_generic_vec) tb="$tb nlm32-gen.o nlm32.o nlm.o" ;; | |
192 | nlm64_big_generic_vec) tb="$tb nlm64-gen.o nlm64.o nlm.o" | |
7adbe989 | 193 | target64=true ;; |
ffe26398 | 194 | nlm64_little_generic_vec) tb="$tb nlm64-gen.o nlm64.o nlm.o" |
7adbe989 | 195 | target64=true ;; |
ffe26398 KR |
196 | rs6000coff_vec) tb="$tb coff-rs6000.o" ;; |
197 | shcoff_vec) tb="$tb coff-sh.o reloc16.o" ;; | |
198 | sunos_big_vec) tb="$tb sunos.o aout32.o stab-syms.o" ;; | |
199 | tekhex_vec) tb="$tb tekhex.o" ;; | |
200 | we32kcoff_vec) tb="$tb coff-we32k.o" ;; | |
201 | z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;; | |
202 | ||
203 | srec_vec) tb="$tb srec.o" ;; | |
204 | symbolsrec_vec) tb="$tb srec.o" ;; | |
205 | ||
206 | "") ;; | |
207 | *) echo "*** unknown target vector $vec" 1>&2; exit 1 ;; | |
208 | esac | |
209 | done | |
5f9a2245 | 210 | |
ffe26398 KR |
211 | # Target architecture .o files. |
212 | ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g` | |
5f9a2245 | 213 | |
ffe26398 KR |
214 | # Weed out duplicate .o files. |
215 | f="" | |
216 | for i in $tb ; do | |
217 | case " $f " in | |
218 | *" $i "*) ;; | |
219 | *) f="$f $i" ;; | |
220 | esac | |
221 | done | |
222 | tb="$f" | |
223 | ||
224 | f="" | |
225 | for i in $ta ; do | |
226 | case " $f " in | |
227 | *" $i "*) ;; | |
228 | *) f="$f $i" ;; | |
229 | esac | |
230 | done | |
231 | ta="$f" | |
5f9a2245 | 232 | |
ffe26398 KR |
233 | bfd_backends="$tb" |
234 | bfd_machines="$ta" | |
5f9a2245 | 235 | |
ffe26398 KR |
236 | # Only set these if they will be nonempty, for the clever echo. |
237 | test -n "$SELECT_VECS" && | |
238 | selvecs=`echo $SELECT_VECS | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'` | |
239 | test -n "SELECT_ARCHITECTURES" && | |
240 | selarchs=`echo $SELECT_ARCHITECTURES | sed -e 's/ \(.\)/,\1/g'` | |
5f9a2245 | 241 | |
ffe26398 KR |
242 | if [ x${all_targets} = xtrue ]; then |
243 | bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)' | |
244 | bfd_machines="${bfd_machines}"' $(ALL_MACHINES)' | |
5f9a2245 DM |
245 | fi # all_targets is true |
246 | ||
7adbe989 KR |
247 | case ${host64}-${target64}-${want64} in |
248 | *true*) | |
249 | wordsize=64 | |
250 | all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' | |
251 | ;; | |
252 | false-false-false) | |
253 | wordsize=32 | |
254 | all_backends='$(BFD32_BACKENDS)' | |
255 | ;; | |
256 | esac | |
257 | ||
258 | echo WORDSIZE=${wordsize} >> Makefile.2 | |
259 | echo ALL_BACKENDS=${all_backends} >> Makefile.2 | |
260 | echo BFD_BACKENDS=${bfd_backends} >> Makefile.2 | |
261 | echo BFD_MACHINES=${bfd_machines} >> Makefile.2 | |
262 | ||
5f9a2245 DM |
263 | test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR" |
264 | ||
265 | echo "TDEFAULTS = \ | |
266 | ${defvec+-DDEFAULT_VECTOR=$defvec} \ | |
267 | ${selvecs+-DSELECT_VECS='$selvecs'} \ | |
268 | ${selarchs+-DSELECT_ARCHITECTURES='$selarchs'}" \ | |
269 | >> Makefile.2 | |
c812942f | 270 | |
b32ae8e2 JK |
271 | cat Makefile.tmp >> Makefile.2 |
272 | rm -f Makefile.tmp | |
273 | mv Makefile.2 Makefile |