Thu Aug 12 10:32:47 1993 David J. Mackenzie (djm@thepub.cygnus.com)
[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 # 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
47
48 all_targets=false
49
50 for targ in $target $canon_targets
51 do
52 bfd_target=`$srcdir/config.bfd $targ $target_cpu`
53
54 if [ "x$bfd_target" = "xall" ]; then
55 all_targets=true
56 else
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
60 echo '***' Look in bfd/configure.in for supported targets 1>&2
61 exit 1
62 fi
63
64 if [ "x$targ" = "x$target" ]; then
65 target_makefile_frag=${srcdir}/config/${bfd_target}.mt
66 else
67 target_extra_frags="$target_extra_frags ${srcdir}/config/${bfd_target}.mt"
68 fi
69 fi
70 done
71
72 # We don't do any links based on the target system, just makefile config.
73
74 # post-target:
75
76 rm -f Makefile.tmp Makefile.2
77 mv Makefile Makefile.tmp
78
79 case ${with_64_bit_bfd} in
80 yes) want64=true ;;
81 no | "") want64=false ;;
82 *)
83 echo "*** bad value \"${with_64_bit_bfd}\" for 64-bit-bfd flag; ignored" 1>&2
84 ;;
85 esac
86
87 case ${host64}-${target64}-${want64} in
88 *true*)
89 echo WORDSIZE=64 >> Makefile.2
90 echo 'ALL_BACKENDS = $(BFD64_BACKENDS) $(BFD32_BACKENDS)' >> Makefile.2
91 ;;
92 false-false-false)
93 echo WORDSIZE=32 >> Makefile.2
94 echo 'ALL_BACKENDS = $(BFD32_BACKENDS)' >> Makefile.2
95 ;;
96 esac
97
98 # The default vector in the primary target.
99 DEFAULT_VECTOR=`sed -n '
100 s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
101 ' $target_makefile_frag`
102
103 if [ x${all_targets} = xfalse ]; then
104
105 allfrags="$target_makefile_frag $target_extra_frags"
106
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
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"
121
122 # The architectures in all the configured targets.
123 SELECT_ARCHITECTURES=`sed -n '
124 s/SELECT_ARCHITECTURES[ ]*=[ ]*//p
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"
135
136 # Target backend .o files.
137 tb=
138
139 for vec in $SELECT_VECS
140 do
141 case "$vec" in
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_little_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
145 b_out_vec_big_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
146 b_out_vec_little_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
147 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o elf.o" ;;
148 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o elf.o" ;;
149 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o elf.o" ;;
150 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o elf.o" ;;
151 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o elf.o" ;;
152 # start-sanitize-v9
153 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o elf.o" ;;
154 # end-sanitize-v9
155 bfd_nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
156 ecoff_big_vec) tb="$tb coff-mips.o" ;;
157 ecoff_little_vec) tb="$tb coff-mips.o" ;;
158 ecoffalpha_little_vec) tb="$tb coff-alpha.o" ;;
159 h8300coff_vec) tb="$tb coff-h8300.o" ;;
160 h8500coff_vec) tb="$tb coff-h8500.o" ;;
161 host_aout_vec) tb="$tb host-aout.o aout32.o stab-syms.o" ;;
162 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o stab-syms.o" ;;
163 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o stab-syms.o" ;;
164 hppa_vec) tb="$tb hppa.o" ;;
165 i386aout_vec) tb="$tb i386aout.o aout32.o stab-syms.o" ;;
166 i386bsd_vec) tb="$tb i386bsd.o aout32.o stab-syms.o" ;;
167 i386coff_vec) tb="$tb coff-i386.o" ;;
168 i386linux_vec) tb="$tb i386linux.o aout32.o stab-syms.o" ;;
169 i386lynx_vec) tb="$tb i386lynx.o aout32.o stab-syms.o" ;;
170 icoff_big_vec) tb="$tb coff-i960.o" ;;
171 icoff_little_vec) tb="$tb coff-i960.o" ;;
172 ieee_vec) tb="$tb ieee.o" ;;
173 m68kcoff_vec) tb="$tb coff-m68k.o" ;;
174 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o" ;;
175 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
176 newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;;
177 rs6000coff_vec) tb="$tb coff-rs6000.o" ;;
178 shcoff_vec) tb="$tb coff-sh.o" ;;
179 srec_vec) tb="$tb srec.o" ;;
180 sunos_big_vec) tb="$tb sunos.o aout32.o stab-syms.o" ;;
181 symbolsrec_vec) tb="$tb srec.o" ;;
182 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
183 z8kcoff_vec) tb="$tb coff-z8k.o" ;;
184
185 "") ;;
186 *) echo "*** unknown target vector $vec" 1>&2; exit 1 ;;
187 esac
188 done
189
190 # Target architecture .o files.
191 ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
192
193 # Weed out duplicate .o files.
194 f=""
195 for i in $tb ; do
196 case " $f " in
197 *" $i "*) ;;
198 *) f="$f $i" ;;
199 esac
200 done
201 tb="$f"
202
203 f=""
204 for i in $ta ; do
205 case " $f " in
206 *" $i "*) ;;
207 *) f="$f $i" ;;
208 esac
209 done
210 ta="$f"
211
212 echo "BFD_BACKENDS = $tb" >> Makefile.2
213 echo "BFD_MACHINES = $ta" >> Makefile.2
214
215 # Only set these if they will be nonempty, for the clever echo.
216 test -n "$SELECT_VECS" &&
217 selvecs=`echo $SELECT_VECS | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
218 test -n "SELECT_ARCHITECTURES" &&
219 selarchs=`echo $SELECT_ARCHITECTURES | sed -e 's/ \(.\)/,\1/g'`
220
221 else # all_targets is true
222 echo 'BFD_BACKENDS = $(ALL_BACKENDS)' >> Makefile.2
223 echo 'BFD_MACHINES = $(ALL_MACHINES)' >> Makefile.2
224 fi # all_targets is true
225
226 test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
227
228 echo "TDEFAULTS = \
229 ${defvec+-DDEFAULT_VECTOR=$defvec} \
230 ${selvecs+-DSELECT_VECS='$selvecs'} \
231 ${selarchs+-DSELECT_ARCHITECTURES='$selarchs'}" \
232 >> Makefile.2
233
234 cat Makefile.tmp >> Makefile.2
235 rm -f Makefile.tmp
236 mv Makefile.2 Makefile
This page took 0.036815 seconds and 5 git commands to generate.