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.
16 . ${srcdir}/configure.host
18 # Set up to make a link between the host's include file and "sysdep.h".
19 files="hosts/${my_host}.h"
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]"
28 if [ -f ${srcdir}/config/${my_host}.mh ] ; then
29 host_makefile_frag=config/${my_host}.mh
34 # Canonicalize the secondary target names.
35 if [ -n "$with_targets" ]; then
36 for targ in `echo $with_targets | sed 's/,/ /g'`
38 result=`$configsub $targ 2>/dev/null`
39 if [ -n "$result" ]; then
40 canon_targets="$canon_targets $result"
42 # Allow targets that config.sub doesn't recognize, like "all".
43 canon_targets="$canon_targets $targ"
50 for targ in $target $canon_targets
52 bfd_target=`$srcdir/config.bfd $targ`
55 netbsd386) bfd_target=i386-netbsd ;;
58 if [ "x$bfd_target" = "xall" ]; then
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
64 echo '***' Look in bfd/config.bfd for supported targets 1>&2
68 if [ "x$targ" = "x$target" ]; then
69 target_makefile_frag=${srcdir}/config/${bfd_target}.mt
71 target_extra_frags="$target_extra_frags ${srcdir}/config/${bfd_target}.mt"
76 # We don't do any links based on the target system, just makefile config.
80 rm -f Makefile.tmp Makefile.2
81 mv Makefile Makefile.tmp
83 case ${with_64_bit_bfd} in
85 no | "") want64=false ;;
87 echo "*** bad value \"${with_64_bit_bfd}\" for 64-bit-bfd flag; ignored" 1>&2
91 case ${host64}-${target64}-${want64} in
93 echo WORDSIZE=64 >> Makefile.2
94 echo 'ALL_BACKENDS = $(BFD64_BACKENDS) $(BFD32_BACKENDS)' >> Makefile.2
97 echo WORDSIZE=32 >> Makefile.2
98 echo 'ALL_BACKENDS = $(BFD32_BACKENDS)' >> Makefile.2
102 # The default vector in the primary target.
103 DEFAULT_VECTOR=`sed -n '
104 s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
105 ' $target_makefile_frag`
107 if [ x${all_targets} = xfalse ]; then
109 allfrags="$target_makefile_frag $target_extra_frags"
111 # The default and selected vectors in all the configured targets.
112 SELECT_VECS=`sed -n '
113 s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
114 s/SELECT_VECS[ ]*=[ ]*\([^ ]*\)/\1/p
118 for i in $SELECT_VECS ; do
126 # The architectures in all the configured targets.
127 SELECT_ARCHITECTURES=`sed -n '
128 s/SELECT_ARCHITECTURES[ ]*=[ ]*//p
132 for i in $SELECT_ARCHITECTURES ; do
138 SELECT_ARCHITECTURES="$f"
140 # Target backend .o files.
143 for vec in $SELECT_VECS
146 # This list is alphabetized to make it easy to compare
147 # with the two vector lists in targets.c.
148 a29kcoff_big_vec) tb="$tb coff-a29k.o" ;;
149 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o stab-syms.o" ;;
150 aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
151 aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
152 b_out_vec_big_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
153 b_out_vec_little_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
154 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;;
155 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o elf.o" ;;
156 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o elf.o" ;;
157 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o elf.o" ;;
158 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o elf.o" ;;
159 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;;
160 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o elf.o" ;;
161 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o elf.o" ;;
162 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o elf.o" ;;
163 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o elf.o" ;;
164 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o" ;;
165 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o" ;;
167 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o elf.o" ;;
169 demo_64_vec) tb="$tb demo64.o aout64.o stab-syms.o" ;;
170 ecoff_big_vec) tb="$tb coff-mips.o" ;;
171 ecoff_little_vec) tb="$tb coff-mips.o" ;;
172 ecoffalpha_little_vec) tb="$tb coff-alpha.o" ;;
173 h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
174 h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
175 host_aout_vec) tb="$tb host-aout.o aout32.o stab-syms.o" ;;
176 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o stab-syms.o" ;;
177 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o stab-syms.o" ;;
178 hppa_vec) tb="$tb som.o" ;;
179 i386aout_vec) tb="$tb i386aout.o aout32.o stab-syms.o" ;;
180 i386bsd_vec) tb="$tb i386bsd.o aout32.o stab-syms.o" ;;
181 netbsd386_vec) tb="$tb netbsd386.o aout32.o stab-syms.o" ;;
182 i386coff_vec) tb="$tb coff-i386.o" ;;
183 i386linux_vec) tb="$tb i386linux.o aout32.o stab-syms.o" ;;
184 i386lynx_vec) tb="$tb i386lynx.o aout32.o stab-syms.o" ;;
185 icoff_big_vec) tb="$tb coff-i960.o" ;;
186 icoff_little_vec) tb="$tb coff-i960.o" ;;
187 ieee_vec) tb="$tb ieee.o" ;;
188 m68kcoff_vec) tb="$tb coff-m68k.o" ;;
189 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o" ;;
190 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
191 newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;;
192 nlm32_big_generic_vec) tb="$tb nlm32-gen.o nlm32.o nlm.o" ;;
193 nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
194 nlm32_little_generic_vec) tb="$tb nlm32-gen.o nlm32.o nlm.o" ;;
195 nlm64_big_generic_vec) tb="$tb nlm64-gen.o nlm64.o nlm.o" ;;
196 nlm64_little_generic_vec) tb="$tb nlm64-gen.o nlm64.o nlm.o" ;;
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" ;;
204 srec_vec) tb="$tb srec.o" ;;
205 symbolsrec_vec) tb="$tb srec.o" ;;
208 *) echo "*** unknown target vector $vec" 1>&2; exit 1 ;;
212 # Target architecture .o files.
213 ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
215 # Weed out duplicate .o files.
234 echo "BFD_BACKENDS = $tb" >> Makefile.2
235 echo "BFD_MACHINES = $ta" >> Makefile.2
237 # Only set these if they will be nonempty, for the clever echo.
238 test -n "$SELECT_VECS" &&
239 selvecs=`echo $SELECT_VECS | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
240 test -n "SELECT_ARCHITECTURES" &&
241 selarchs=`echo $SELECT_ARCHITECTURES | sed -e 's/ \(.\)/,\1/g'`
243 else # all_targets is true
244 echo 'BFD_BACKENDS = $(ALL_BACKENDS)' >> Makefile.2
245 echo 'BFD_MACHINES = $(ALL_MACHINES)' >> Makefile.2
246 fi # all_targets is true
248 test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
251 ${defvec+-DDEFAULT_VECTOR=$defvec} \
252 ${selvecs+-DSELECT_VECS='$selvecs'} \
253 ${selarchs+-DSELECT_ARCHITECTURES='$selarchs'}" \
256 cat Makefile.tmp >> Makefile.2
258 mv Makefile.2 Makefile