minor doc tweaks
[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
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
5f9a2245
DM
60 echo '***' Look in bfd/configure.in for supported targets 1>&2
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
70done
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
76rm -f Makefile.tmp Makefile.2
77mv Makefile Makefile.tmp
78
b32ae8e2 79case ${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 ;;
85esac
86
87case ${host64}-${target64}-${want64} in
88 *true*)
89 echo WORDSIZE=64 >> Makefile.2
c812942f 90 echo 'ALL_BACKENDS = $(BFD64_BACKENDS) $(BFD32_BACKENDS)' >> Makefile.2
b32ae8e2
JK
91 ;;
92 false-false-false)
93 echo WORDSIZE=32 >> Makefile.2
c812942f 94 echo 'ALL_BACKENDS = $(BFD32_BACKENDS)' >> Makefile.2
b32ae8e2
JK
95 ;;
96esac
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
103if [ x${all_targets} = xfalse ]; then
104
105 allfrags="$target_makefile_frag $target_extra_frags"
c812942f 106
5f9a2245
DM
107 # The default and selected vectors in all the configured targets.
108 SELECT_VECS=`sed -n '
109 s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
110 s/SELECT_VECS[ ]*=[ ]*\([^ ]*\)/\1/p
c4726c0f
DM
111 ' $allfrags`
112 # uniq the list.
113 f=""
114 for i in $SELECT_VECS ; do
115 case " $f " in
116 *" $i "*) ;;
117 *) f="$f $i" ;;
118 esac
119 done
120 SELECT_VECS="$f"
5f9a2245
DM
121
122 # The architectures in all the configured targets.
123 SELECT_ARCHITECTURES=`sed -n '
124 s/SELECT_ARCHITECTURES[ ]*=[ ]*//p
c4726c0f
DM
125 ' $allfrags`
126 # uniq the list.
127 f=""
128 for i in $SELECT_ARCHITECTURES ; do
129 case " $f " in
130 *" $i "*) ;;
131 *) f="$f $i" ;;
132 esac
133 done
134 SELECT_ARCHITECTURES="$f"
5f9a2245
DM
135
136 # Target backend .o files.
137 tb=
138
139 for vec in $SELECT_VECS
140 do
141 case "$vec" in
cf39664e
DM
142 # This list is alphabetized to make it easy to compare
143 # with the two vector lists in targets.c.
5f9a2245 144 a29kcoff_big_vec) tb="$tb coff-a29k.o" ;;
c4726c0f 145 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o stab-syms.o" ;;
315b021f 146 aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
c4726c0f
DM
147 aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
148 b_out_vec_big_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
149 b_out_vec_little_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
315b021f
DM
150 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;;
151 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o elf.o" ;;
5f9a2245
DM
152 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o elf.o" ;;
153 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o elf.o" ;;
154 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o elf.o" ;;
315b021f
DM
155 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;;
156 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o elf.o" ;;
5f9a2245 157 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o elf.o" ;;
315b021f 158 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o elf.o" ;;
5f9a2245 159 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o elf.o" ;;
315b021f
DM
160 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o" ;;
161 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o" ;;
5f9a2245
DM
162# start-sanitize-v9
163 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o elf.o" ;;
164# end-sanitize-v9
315b021f 165 demo_64_vec) tb="$tb demo64.o aout64.o stab-syms.o" ;;
5f9a2245
DM
166 ecoff_big_vec) tb="$tb coff-mips.o" ;;
167 ecoff_little_vec) tb="$tb coff-mips.o" ;;
168 ecoffalpha_little_vec) tb="$tb coff-alpha.o" ;;
cf39664e
DM
169 h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
170 h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
c4726c0f
DM
171 host_aout_vec) tb="$tb host-aout.o aout32.o stab-syms.o" ;;
172 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o stab-syms.o" ;;
173 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o stab-syms.o" ;;
5f9a2245 174 hppa_vec) tb="$tb hppa.o" ;;
c4726c0f
DM
175 i386aout_vec) tb="$tb i386aout.o aout32.o stab-syms.o" ;;
176 i386bsd_vec) tb="$tb i386bsd.o aout32.o stab-syms.o" ;;
5f9a2245 177 i386coff_vec) tb="$tb coff-i386.o" ;;
c4726c0f
DM
178 i386linux_vec) tb="$tb i386linux.o aout32.o stab-syms.o" ;;
179 i386lynx_vec) tb="$tb i386lynx.o aout32.o stab-syms.o" ;;
5f9a2245
DM
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" ;;
161bb408 184 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o" ;;
5f9a2245 185 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
c4726c0f 186 newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;;
315b021f 187 nlm32_big_generic_vec) tb="$tb nlm32-gen.o nlm32.o nlm.o" ;;
cf39664e 188 nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
315b021f
DM
189 nlm32_little_generic_vec) tb="$tb nlm32-gen.o nlm32.o nlm.o" ;;
190 nlm64_big_generic_vec) tb="$tb nlm64-gen.o nlm64.o nlm.o" ;;
191 nlm64_little_generic_vec) tb="$tb nlm64-gen.o nlm64.o nlm.o" ;;
5f9a2245 192 rs6000coff_vec) tb="$tb coff-rs6000.o" ;;
cf39664e 193 shcoff_vec) tb="$tb coff-sh.o reloc16.o" ;;
5f9a2245 194 sunos_big_vec) tb="$tb sunos.o aout32.o stab-syms.o" ;;
315b021f 195 tekhex_vec) tb="$tb tekhex.o" ;;
5f9a2245 196 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
cf39664e
DM
197 z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;;
198
199 srec_vec) tb="$tb srec.o" ;;
200 symbolsrec_vec) tb="$tb srec.o" ;;
5f9a2245
DM
201
202 "") ;;
a339de27 203 *) echo "*** unknown target vector $vec" 1>&2; exit 1 ;;
5f9a2245
DM
204 esac
205 done
206
207 # Target architecture .o files.
208 ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
209
210 # Weed out duplicate .o files.
c4726c0f
DM
211 f=""
212 for i in $tb ; do
213 case " $f " in
214 *" $i "*) ;;
215 *) f="$f $i" ;;
216 esac
217 done
218 tb="$f"
219
220 f=""
221 for i in $ta ; do
222 case " $f " in
223 *" $i "*) ;;
224 *) f="$f $i" ;;
225 esac
226 done
227 ta="$f"
5f9a2245
DM
228
229 echo "BFD_BACKENDS = $tb" >> Makefile.2
230 echo "BFD_MACHINES = $ta" >> Makefile.2
231
232 # Only set these if they will be nonempty, for the clever echo.
233 test -n "$SELECT_VECS" &&
234 selvecs=`echo $SELECT_VECS | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
235 test -n "SELECT_ARCHITECTURES" &&
236 selarchs=`echo $SELECT_ARCHITECTURES | sed -e 's/ \(.\)/,\1/g'`
237
238else # all_targets is true
239 echo 'BFD_BACKENDS = $(ALL_BACKENDS)' >> Makefile.2
c812942f 240 echo 'BFD_MACHINES = $(ALL_MACHINES)' >> Makefile.2
5f9a2245
DM
241fi # all_targets is true
242
243test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
244
245echo "TDEFAULTS = \
246${defvec+-DDEFAULT_VECTOR=$defvec} \
247${selvecs+-DSELECT_VECS='$selvecs'} \
248${selarchs+-DSELECT_ARCHITECTURES='$selarchs'}" \
249 >> Makefile.2
c812942f 250
b32ae8e2
JK
251cat Makefile.tmp >> Makefile.2
252rm -f Makefile.tmp
253mv Makefile.2 Makefile
This page took 0.086467 seconds and 4 git commands to generate.