more cleanups
[deliverable/binutils-gdb.git] / bfd / configure.in
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
6 configdirs="doc"
7 srctrigger=libbfd.c
8 srcname="BFD"
9 target_dependent=true
10 host64=false
11 target64=false
12 want64=false
13
14 # per-host:
15
16 . ${srcdir}/configure.host
17
18 # Set up to make a link between the host's include file and "sysdep.h".
19 files="hosts/${my_host}.h"
20 links="sysdep.h"
21
22 if [ ! -f ${srcdir}/${files} ] ; then
23 files=../bfd/hosts/std-host.h
24 echo "[${srcname} has no specific support for host ${host} -- using std-host]"
25 fi
26
27 host_makefile_frag=
28 if [ -f ${srcdir}/config/${my_host}.mh ] ; then
29 host_makefile_frag=config/${my_host}.mh
30 fi
31
32 # per-target:
33
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
39 case "${target}" in
40 alpha-*-*) bfd_target=alphaosf ;;
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 ;;
46 h8300*-*-*) bfd_target=h8300-coff ;;
47 h8500-*-*) bfd_target=h8500-coff ;;
48 sh-*-*) bfd_target=sh-coff ;;
49 hppa*-*-bsd*) bfd_target=hppabsd ;;
50 hppa*-*-hpux*) bfd_target=hppahpux ;;
51 hppa*-*-osf) bfd_target=hppa-elf ;;
52 i[34]86-*-sysv4*) bfd_target=i386-elf ;;
53 i[34]86-*-sysv*) bfd_target=i386-coff ;;
54 i[34]86-*-isc*) bfd_target=i386-sco ;; # gets core dump reading right
55 i[34]86-*-sco*) bfd_target=i386-sco ;;
56 i[34]86-*-bsd*) bfd_target=i386-bsd ;;
57 i[34]86-*-lynxos*) bfd_target=i386-lynx ;;
58 i[34]86-*-coff) bfd_target=i386-coff ;;
59 i[34]86-*-aix*) bfd_target=i386-coff ;;
60 i[34]86-*-elf) bfd_target=i386-elf ;;
61 i[34]86-*-netware*) bfd_target=i386-nlm ;;
62 i[34]86-*-linux*) bfd_target=i386-linux ;;
63 i[34]86-*-lynx*) bfd_target=i386-lynx ;;
64 i[34]86-none-*) bfd_target=i386-coff ;;
65 i960-*-vxworks) bfd_target=i960-bout ;;
66 i960-*-aout) bfd_target=i960-bout ;;
67 i960-*-bout) bfd_target=i960-bout ;;
68 m68*-bull-sysv*) bfd_target=u68k-coff ;;
69 m68*-hp-bsd*) bfd_target=hp300bsd ;;
70 m68*-*-aout) bfd_target=m68k-aout ;;
71 m68*-*-coff) bfd_target=m68k-coff ;;
72 m68*-*-hpux*) bfd_target=hp300hpux ;;
73 m68*-*-os68k) bfd_target=m68k-aout ;;
74 m68*-*-sunos*) bfd_target=m68k-aout ;;
75 m68*-*-sysv*) bfd_target=m68k-coff ;;
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 ;;
80 mips-big-*) bfd_target=bigmips ;;
81 mips-dec-bsd*) bfd_target=mipsdecbsd ;;
82 mips-dec-*) bfd_target=decstation ;;
83 mips-*-ecoffl*) bfd_target=decstation ;;
84 mips-*-ecoff*) bfd_target=bigmips ;;
85 mips-sgi-*) bfd_target=bigmips ;;
86 mips-*-sysv*) bfd_target=riscos ;;
87 mips-*-riscos*) bfd_target=riscos ;;
88 mips-*-bsd*) bfd_target=noop ;;
89 rs6000-*-*) bfd_target=rs6000 ;;
90 sparc-*-solaris2*) bfd_target=sparc-elf ;;
91 sparc-*-sysv4*) bfd_target=sparc-elf ;;
92 # start-sanitize-v9
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 ;;
97 sparc64-*-elf*) bfd_target=sparc64-elf ; target64=true ;;
98 # end-sanitize-v9
99 sparc*-*-*) bfd_target=sparc-aout ;;
100 tahoe-*-*) bfd_target=tahoe ;;
101 vax-*-vms) bfd_target=vax-vms ;;
102 vax-*-*) bfd_target=vax ;;
103 we32k-*-*) bfd_target=we32k ;;
104 z8k*-*-*) bfd_target=z8k-coff ;;
105
106 *-*-aout) bfd_target=${target_cpu}-aout ;;
107 *-*-bsd*) bfd_target=${target_cpu}-aout ;;
108 *-*-netware*) bfd_target=${target_cpu}-nlm ;;
109 *-*-sysv4*) bfd_target=${target_cpu}-elf ;;
110 *-*-solaris2*) bfd_target=${target_cpu}-elf ;;
111 *-*-go32) bfd_target=${target_cpu}-aout ;;
112 *-*-sysv*) bfd_target=${target_cpu}-coff ;;
113
114 *-*-aout64) bfd_target=${target_cpu}-aout64 ; target64=true ;;
115 *-*-elf64) bfd_target=${target_cpu}-elf64 ; target64=true ;;
116
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 ;;
124 esac
125
126 [ -z "$bfd_target" ] && bfd_target="$target" # For error message.
127
128 all_targets=false
129 for targ in $bfd_target `echo $with_bfd_targets | sed 's/,/ /g'`
130 do
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
141 fi
142
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
149 done
150
151 # We don't do any links based on the target system, just makefile config.
152
153 # post-target:
154
155 rm -f Makefile.tmp Makefile.2
156 mv Makefile Makefile.tmp
157
158 case ${with_64_bit_bfd} in
159 yes) want64=true ;;
160 no | "") want64=false ;;
161 *)
162 echo "*** bad value \"${with_64_bit_bfd}\" for 64-bit-bfd flag; ignored" 1>&2
163 ;;
164 esac
165
166 case ${host64}-${target64}-${want64} in
167 *true*)
168 echo WORDSIZE=64 >> Makefile.2
169 echo 'ALL_BACKENDS = $(BFD64_BACKENDS) $(BFD32_BACKENDS)' >> Makefile.2
170 ;;
171 false-false-false)
172 echo WORDSIZE=32 >> Makefile.2
173 echo 'ALL_BACKENDS = $(BFD32_BACKENDS)' >> Makefile.2
174 ;;
175 esac
176
177 # The default vector in the primary target.
178 DEFAULT_VECTOR=`sed -n '
179 s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
180 ' $target_makefile_frag`
181
182 if [ x${all_targets} = xfalse ]; then
183
184 allfrags="$target_makefile_frag $target_extra_frags"
185
186 # The default and selected vectors in all the configured targets.
187 SELECT_VECS=`sed -n '
188 s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
189 s/SELECT_VECS[ ]*=[ ]*\([^ ]*\)/\1/p
190 ' $allfrags`
191 # uniq the list.
192 f=""
193 for i in $SELECT_VECS ; do
194 case " $f " in
195 *" $i "*) ;;
196 *) f="$f $i" ;;
197 esac
198 done
199 SELECT_VECS="$f"
200
201 # The architectures in all the configured targets.
202 SELECT_ARCHITECTURES=`sed -n '
203 s/SELECT_ARCHITECTURES[ ]*=[ ]*//p
204 ' $allfrags`
205 # uniq the list.
206 f=""
207 for i in $SELECT_ARCHITECTURES ; do
208 case " $f " in
209 *" $i "*) ;;
210 *) f="$f $i" ;;
211 esac
212 done
213 SELECT_ARCHITECTURES="$f"
214
215 # Target backend .o files.
216 tb=
217
218 for vec in $SELECT_VECS
219 do
220 case "$vec" in
221 a29kcoff_big_vec) tb="$tb coff-a29k.o" ;;
222 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o stab-syms.o" ;;
223 aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
224 b_out_vec_big_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
225 b_out_vec_little_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
226 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o elf.o" ;;
227 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o elf.o" ;;
228 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o elf.o" ;;
229 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o elf.o" ;;
230 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o elf.o" ;;
231 # start-sanitize-v9
232 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o elf.o" ;;
233 # end-sanitize-v9
234 bfd_nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
235 ecoff_big_vec) tb="$tb coff-mips.o" ;;
236 ecoff_little_vec) tb="$tb coff-mips.o" ;;
237 ecoffalpha_little_vec) tb="$tb coff-alpha.o" ;;
238 h8300coff_vec) tb="$tb coff-h8300.o" ;;
239 h8500coff_vec) tb="$tb coff-h8500.o" ;;
240 host_aout_vec) tb="$tb host-aout.o aout32.o stab-syms.o" ;;
241 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o stab-syms.o" ;;
242 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o stab-syms.o" ;;
243 hppa_vec) tb="$tb hppa.o" ;;
244 i386aout_vec) tb="$tb i386aout.o aout32.o stab-syms.o" ;;
245 i386bsd_vec) tb="$tb i386bsd.o aout32.o stab-syms.o" ;;
246 i386coff_vec) tb="$tb coff-i386.o" ;;
247 i386linux_vec) tb="$tb i386linux.o aout32.o stab-syms.o" ;;
248 i386lynx_vec) tb="$tb i386lynx.o aout32.o stab-syms.o" ;;
249 icoff_big_vec) tb="$tb coff-i960.o" ;;
250 icoff_little_vec) tb="$tb coff-i960.o" ;;
251 ieee_vec) tb="$tb ieee.o" ;;
252 m68kcoff_vec) tb="$tb coff-m68k.o" ;;
253 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o" ;;
254 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
255 newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;;
256 rs6000coff_vec) tb="$tb coff-rs6000.o" ;;
257 shcoff_vec) tb="$tb coff-sh.o" ;;
258 srec_vec) tb="$tb srec.o" ;;
259 sunos_big_vec) tb="$tb sunos.o aout32.o stab-syms.o" ;;
260 symbolsrec_vec) tb="$tb srec.o" ;;
261 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
262 z8kcoff_vec) tb="$tb coff-z8k.o" ;;
263
264 "") ;;
265 *) echo "*** unknown target vector $vec" 1>&2; exit 1 ;;
266 esac
267 done
268
269 # Target architecture .o files.
270 ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
271
272 # Weed out duplicate .o files.
273 f=""
274 for i in $tb ; do
275 case " $f " in
276 *" $i "*) ;;
277 *) f="$f $i" ;;
278 esac
279 done
280 tb="$f"
281
282 f=""
283 for i in $ta ; do
284 case " $f " in
285 *" $i "*) ;;
286 *) f="$f $i" ;;
287 esac
288 done
289 ta="$f"
290
291 echo "BFD_BACKENDS = $tb" >> Makefile.2
292 echo "BFD_MACHINES = $ta" >> Makefile.2
293
294 # Only set these if they will be nonempty, for the clever echo.
295 test -n "$SELECT_VECS" &&
296 selvecs=`echo $SELECT_VECS | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
297 test -n "SELECT_ARCHITECTURES" &&
298 selarchs=`echo $SELECT_ARCHITECTURES | sed -e 's/ \(.\)/,\1/g'`
299
300 else # all_targets is true
301 echo 'BFD_BACKENDS = $(ALL_BACKENDS)' >> Makefile.2
302 echo 'BFD_MACHINES = $(ALL_MACHINES)' >> Makefile.2
303 fi # all_targets is true
304
305 test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
306
307 echo "TDEFAULTS = \
308 ${defvec+-DDEFAULT_VECTOR=$defvec} \
309 ${selvecs+-DSELECT_VECS='$selvecs'} \
310 ${selarchs+-DSELECT_ARCHITECTURES='$selarchs'}" \
311 >> Makefile.2
312
313 cat Makefile.tmp >> Makefile.2
314 rm -f Makefile.tmp
315 mv Makefile.2 Makefile
This page took 0.054798 seconds and 5 git commands to generate.