bf589216ab32b424599f92caae9e4be0134301b7
[deliverable/binutils-gdb.git] / gas / configure.in
1 # This file is configure.in
2 #
3 # Copyright (C) 1987-1992,1993,1994 Free Software Foundation, Inc.
4 #
5 # This file is part of GAS, the GNU Assembler.
6 #
7 # GAS is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11 #
12 # GAS is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with GAS; see the file COPYING. If not, write to
19 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20 #
21
22 # This file was written, and is maintained by K. Richard Pixley
23 # <rich@cygnus.com>.
24
25 # This file is a shell script that supplies the information necessary
26 # to tailor a template configure script into the configure script
27 # appropriate for this directory. For more information, check any
28 # existing configure script.
29
30 srctrigger=as.c
31 srcname="gas"
32 need_bfd=no
33 bfd_gas=no
34 configdirs="doc testsuite"
35
36 # per-host:
37
38 gas_host=generic
39
40 case "${host}" in
41 a29k-*-*) gas_host=a29k ;;
42
43 alpha-*-osf*) gas_host=ansi ;;
44
45 hppa*-hp-hpux*) gas_host=hpux ;;
46 hppa*-hp-bsd*) gas_host=hppabsd ;;
47 hppa*-hp-osf*) gas_host=hppaosf ;;
48
49 i[34]86-ibm-aix*) gas_host=i386aix ;;
50 i[34]86-*-isc*) gas_host=sysv ;;
51 i386-sun-sunos*) gas_host=sun386 ;;
52
53 m68k-sun-sunos*) gas_host=sun3 ;;
54 m68*-*-hpux) gas_host=hpux ;;
55
56 mips*-dec-ultrix*) gas_host=decstatn ;;
57 mips*-*-bsd*) gas_host=mipsbsd ;;
58 mips*-sgi-irix*) gas_host=irix ;;
59
60 rs6000-*-*) gas_host=rs6000 ;;
61
62 sparc-sun-sunos*) gas_host=sun4 ;;
63 sparc-sun-solaris2*) gas_host=sysv ;;
64
65 vax-*-vms*) gas_host=vms ;;
66 vax-*-bsd*) gas_host=vax ;;
67 vax-*-ultrix*) gas_host=vax ;;
68
69 *-*-sysv4* | *-*-unixware) gas_host=sysv ;;
70
71 *-*-ansi | *-*-hpux | *-*-sysv)
72 gas_host=${host_os} ;;
73
74 esac
75
76 if [ ! -r ${srcdir}/config/ho-${gas_host}.h ]; then
77 echo '*** GAS does not support host' ${host} 1>&2
78 exit 1
79 fi
80
81 # per-target:
82
83 case ${with_bfd_assembler} in
84 yes)
85 echo "*** Warning: GAS BFD configuration option not yet fully supported" 1>&2
86 need_bfd=yes
87 bfd_gas=yes
88 ;;
89 no | "")
90 ;;
91 *)
92 echo "*** Bad value \"${with_bfd_assembler}\" for --with-bfd-assembler option" 1>&2
93 exit 1
94 ;;
95 esac
96
97 # assign cpu type
98 emulation=generic
99
100 # default is big
101 endian=big
102
103 # check for architecture variants
104 case ${target_cpu} in
105 # Actually we've only got support for the 1.1, so we shouldn't generalize,
106 # but this is what the support files are named...
107 hppa*) cpu_type=hppa ;;
108 i486) cpu_type=i386 ;;
109 m680[01234]0) cpu_type=m68k ;;
110 m68008) cpu_type=m68k ;;
111 m683??) cpu_type=m68k ;;
112 m8*) cpu_type=m88k ;;
113 mips*el) cpu_type=mips endian=little;;
114 mips*) cpu_type=mips ;;
115 rs6000*) cpu_type=ppc ;;
116 sparc64) cpu_type=sparc64 obj_format=elf ;; # v9
117 sparclite*) cpu_type=sparc ;;
118 *) cpu_type=${target_cpu} ;;
119 esac
120
121 gas_target=${cpu_type}
122 generic_target=${cpu_type}-${target_vendor}-${target_os}
123 dev=no
124
125 # assign object format
126 case ${generic_target} in
127 a29k-amd-udi) obj_format=coffbfd gas_target=ebmon29k ;;
128 a29k-amd-ebmon) obj_format=coffbfd gas_target=ebmon29k ;;
129 a29k-amd-ebmonold) obj_format=coff gas_target=ebmon29k ;;
130
131 alpha-*-osf*) obj_format=ecoff dev=yes ;;
132
133 hppa-*-osf) obj_format=elf emulation=hppa ;;
134 hppa-*-hpux*) obj_format=som emulation=hppa ;;
135 hppa-*-bsd*) obj_format=som emulation=hppa ;;
136
137 h8300-*-coff) obj_format=coffbfd ;;
138
139 i386-ibm-aix*) obj_format=coffbfd gas_target=i386coff
140 emulation=i386aix ;;
141 i386-*-bsd*) obj_format=aout emulation=386bsd ;;
142 i386-*-netbsd0.8) obj_format=aout emulation=netbsd ;;
143 i386-*-netbsd*) obj_format=aout emulation=netbsd ;;
144 i386-*-linux*elf*) obj_format=elf emulation=linux ;;
145 i386-*-linux*coff*) obj_format=coffbfd emulation=linux
146 gas_target=i386coff ;;
147 i386-*-linux*) obj_format=aout emulation=linux ;;
148 i386-*-lynxos*) obj_format=coffbfd gas_target=i386coff
149 emulation=lynx ;;
150 i386-*-sysv4* | i386-*-solaris* | i386-*-elf)
151 obj_format=elf ;;
152 i386-*-coff | i386-*-sysv* | i386-*-sco* | i386-*-isc*)
153 obj_format=coffbfd gas_target=i386coff ;;
154 i386-*-vsta) obj_format=aout ;;
155 i386-*-go32) obj_format=aout ;;
156
157 i960-wrs-vxworks | i960-*-nindy*)
158 obj_format=bout ;;
159 i960-*-coff) obj_format=coff emulation=ic960 ;;
160
161 m68k-wrs-vxworks | m68k-ericsson-ose | m68k-*-sunos*)
162 obj_format=aout emulation=sun3 ;;
163 m68k-*-coff | m68k-*-sysv*)
164 obj_format=coffbfd gas_target=m68kcoff ;;
165 m68k-*-hpux) obj_format=hp300 emulation=hp300 ;;
166 m68k-*-lynxos*) obj_format=coffbfd gas_target=m68kcoff
167 emulation=lynx ;;
168
169 m88k-*-coff*) obj_format=coffbfd gas_target=m88kcoff ;;
170
171 # don't change emulation like *-*-bsd does
172 mips-*-bsd*) bfd_gas=yes obj_format=aout gas_target=mips-lit ;;
173 mips-*-ultrix*) obj_format=ecoff gas_target=mips-lit ;;
174 mips-*-ecoff*) obj_format=ecoff
175 if [ $endian = big ] ; then
176 gas_target=mips-big
177 else
178 gas_target=mips-lit
179 fi
180 ;;
181 mips-*-ecoff*) obj_format=ecoff gas_target=mips-big ;;
182 mips-*-irix5*) obj_format=elf gas_target=mips-big ;;
183 mips-*-irix*) obj_format=ecoff gas_target=mips-big emulation=irix ;;
184 mips-*-riscos*) obj_format=ecoff gas_target=mips-big ;;
185 mips-*-sysv*) obj_format=ecoff gas_target=mips-big ;;
186 mips-*-elf*) obj_format=elf
187 if [ $endian = big ] ; then
188 gas_target=mips-big
189 else
190 gas_target=mips-lit
191 fi
192 ;;
193
194 ppc-*-aix*) obj_format=coff bfd_gas=yes ;;
195
196 sh-*-coff) obj_format=coffbfd ;;
197
198 sparc*-*-sunos4*) obj_format=aout emulation=sun3 bfd_gas=yes ;;
199 sparc*-*-aout | sparc*-*-vxworks)
200 obj_format=aout bfd_gas=yes ;;
201 sparc*-*-coff) obj_format=coff bfd_gas=yes ;;
202 sparc*-*-lynxos) obj_format=coff bfd_gas=yes ;;
203 sparc*-fujitsu-none) obj_format=aout bfd_gas=yes ;;
204 sparc*-*-elf | sparc*-*-solaris*)
205 obj_format=elf ;;
206 sparc64-*-aout*) obj_format=aout bfd_gas=yes ;; # v9
207
208 vax-*-bsd* | vax-*-ultrix*)
209 obj_format=aout ;;
210 vax-*-vms) obj_format=vms ;;
211
212 z8k-*-coff | z8k-*-sim)
213 obj_format=coffbfd ;;
214
215 *-*-aout | *-*-scout)
216 obj_format=aout ;;
217 *-*-nindy*)
218 obj_format=bout ;;
219 *-*-bsd*)
220 obj_format=aout emulation=sun3 ;;
221 *-*-generic) obj_format=generic ;;
222 *-*-xray | *-*-hms) obj_format=coffbfd ;;
223 *-*-sysv32) obj_format=coff emulation=sysv32 ;;
224 *-*-sim) obj_format=coffbfd ;;
225 *-*-elf | *-*-sysv4* | *-*-solaris*)
226 echo '*** Warning: GAS support for ELF format is incomplete' 1>&2
227 obj_format=elf dev=yes ;;
228 *-*-coff* | *-sysv* | *-*-sco*)
229 obj_format=coff
230 case ${target_vendor} in
231 bull) emulation=dpx2 ;;
232 sun) emulation=sun3 ;;
233 esac
234 ;;
235 *-*-vxworks) obj_format=aout ;;
236 *-*-netware) obj_format=elf ;;
237 esac
238
239 # Assign floating point type. Most processors with FP support
240 # IEEE FP. On those that don't support FP at all, usually IEEE
241 # is emulated.
242 case ${target_cpu} in
243 ns32k | vax | tahoe ) atof=${target_cpu} ;;
244 *) atof=ieee ;;
245 esac
246
247 if [ ! -r ${srcdir}/config/tc-${cpu_type}.c ]; then
248 echo '*** GAS does not support target CPU' ${cpu_type} 1>&2
249 exit 1
250 fi
251
252 case "${obj_format}" in
253 "")
254 echo "*** GAS doesn't know what format to use for target" ${target} 1>&2
255 exit 1
256 ;;
257 esac
258
259 if [ ! -r ${srcdir}/config/obj-${obj_format}.c ]; then
260 echo '*** GAS does not have support for object file format' ${obj_format} 1>&2
261 exit 1
262 fi
263
264 # and target makefile frag
265
266 target_makefile_frag=config/${gas_target}.mt
267
268 case ${bfd_gas}-${obj_format} in
269 yes-coffbfd) obj_format=coff ;;
270 no-coffbfd) need_bfd=yes ;;
271 *-elf) bfd_gas=yes ;;
272 *-ecoff) bfd_gas=yes ;;
273 *-som) bfd_gas=yes ;;
274 *) ;;
275 esac
276
277 case ${with_bfd_assembler}-${bfd_gas} in
278 yes-yes | no-no)
279 # We didn't override user's choice.
280 ;;
281 no-yes)
282 echo '*** Use of BFD is required for ${target}; overriding config options'\
283 1>&2
284 ;;
285 no-preferred)
286 bfd_gas=no
287 ;;
288 *-preferred)
289 bfd_gas=yes
290 ;;
291 -*)
292 # User specified nothing.
293 ;;
294 esac
295
296 reject_dev_configs=yes
297
298 case ${reject_dev_configs}-${dev} in
299 yes-yes) # Oops.
300 echo "*** GAS does not support the ${generic_target} configuration" 1>&2
301 exit 1
302 ;;
303 esac
304
305 files="config/ho-${gas_host}.h config/tc-${cpu_type}.c \
306 config/tc-${cpu_type}.h config/te-${emulation}.h \
307 config/obj-${obj_format}.h config/obj-${obj_format}.c \
308 config/atof-${atof}.c"
309
310 links="host.h targ-cpu.c targ-cpu.h targ-env.h obj-format.h obj-format.c atof-targ.c"
311
312 # post-target:
313
314 case ${bfd_gas} in
315 yes) bfddef="BFDDEF=define" need_bfd=yes ;;
316 *) bfddef="BFDDEF=undef" ;;
317 esac
318
319 case ${need_bfd} in
320 yes) bfdlib="BFDLIB=../bfd/libbfd.a" ;;
321 *) bfdlib="" ;;
322 esac
323
324 case "x${host}" in
325 "x${target}") cross="" ;;
326 *) cross="CROSS=-DCROSS_COMPILE" ;;
327 esac
328
329 rm -f Makefile.tem
330 echo $bfddef > Makefile.tem
331 echo $bfdlib >> Makefile.tem
332 echo $cross >> Makefile.tem
333 cat Makefile >> Makefile.tem
334 mv -f Makefile.tem Makefile
335
336 # end of gas/configure.in
This page took 0.048863 seconds and 3 git commands to generate.