Commit | Line | Data |
---|---|---|
6d5460ab | 1 | # This file is configure.in |
79a54a5b | 2 | # |
1c11ab0e | 3 | # Copyright (C) 1987-1992,1993,1994 Free Software Foundation, Inc. |
8cac6ca6 | 4 | # |
79a54a5b | 5 | # This file is part of GAS, the GNU Assembler. |
8cac6ca6 | 6 | # |
79a54a5b RP |
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. | |
8cac6ca6 | 11 | # |
79a54a5b RP |
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. | |
8cac6ca6 | 16 | # |
79a54a5b RP |
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 | ||
8c1b25e4 RP |
22 | # This file was written, and is maintained by K. Richard Pixley |
23 | # <rich@cygnus.com>. | |
24 | ||
fecd2382 RP |
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" | |
4f6f4aa8 | 32 | need_bfd=no |
7cf4d7ff | 33 | bfd_gas=no |
f70a4714 | 34 | configdirs="doc testsuite" |
1058238c | 35 | |
353deb84 RP |
36 | # per-host: |
37 | ||
b678740d | 38 | gas_host=generic |
fecd2382 | 39 | |
984cf2d7 | 40 | case "${host}" in |
7cf4d7ff KR |
41 | a29k-*-*) gas_host=a29k ;; |
42 | ||
cb0b800b SC |
43 | alpha-*-osf*) gas_host=ansi ;; |
44 | ||
f39a73b1 JL |
45 | hppa*-*-hpux*) gas_host=hpux ;; |
46 | hppa*-*-bsd*) gas_host=hppabsd ;; | |
47 | hppa*-*-osf*) gas_host=hppaosf ;; | |
f8693e71 | 48 | hppa*-*-hiux*) gas_host=hpux ;; |
7cf4d7ff KR |
49 | |
50 | i[34]86-ibm-aix*) gas_host=i386aix ;; | |
51 | i[34]86-*-isc*) gas_host=sysv ;; | |
52 | i386-sun-sunos*) gas_host=sun386 ;; | |
c535f6bc | 53 | i386-*-mach*) gas_host=mach3 ;; |
b418bc52 | 54 | i386-*-go32) target_makefile_frag=config/go32.mh ;; |
7cf4d7ff KR |
55 | |
56 | m68k-sun-sunos*) gas_host=sun3 ;; | |
57 | m68*-*-hpux) gas_host=hpux ;; | |
58 | ||
5f8a3788 DHW |
59 | mips*-dec-ultrix*) gas_host=decstatn ;; |
60 | mips*-*-bsd*) gas_host=mipsbsd ;; | |
61 | mips*-sgi-irix*) gas_host=irix ;; | |
7cf4d7ff KR |
62 | |
63 | rs6000-*-*) gas_host=rs6000 ;; | |
64 | ||
65 | sparc-sun-sunos*) gas_host=sun4 ;; | |
66 | sparc-sun-solaris2*) gas_host=sysv ;; | |
67 | ||
68 | vax-*-vms*) gas_host=vms ;; | |
69 | vax-*-bsd*) gas_host=vax ;; | |
5677c028 | 70 | vax-*-ultrix*) gas_host=vax ;; |
7cf4d7ff | 71 | |
5f8a3788 | 72 | *-*-sysv4* | *-*-unixware) gas_host=sysv ;; |
8cac6ca6 | 73 | |
5677c028 | 74 | *-*-ansi | *-*-hpux | *-*-sysv) |
7cf4d7ff KR |
75 | gas_host=${host_os} ;; |
76 | ||
74cc5508 RP |
77 | esac |
78 | ||
7cf4d7ff KR |
79 | if [ ! -r ${srcdir}/config/ho-${gas_host}.h ]; then |
80 | echo '*** GAS does not support host' ${host} 1>&2 | |
81 | exit 1 | |
82 | fi | |
83 | ||
b678740d RP |
84 | # per-target: |
85 | ||
4f6f4aa8 KR |
86 | case ${with_bfd_assembler} in |
87 | yes) | |
7cf4d7ff | 88 | echo "*** Warning: GAS BFD configuration option not yet fully supported" 1>&2 |
4f6f4aa8 KR |
89 | need_bfd=yes |
90 | bfd_gas=yes | |
91 | ;; | |
92 | no | "") | |
93 | ;; | |
94 | *) | |
7cf4d7ff | 95 | echo "*** Bad value \"${with_bfd_assembler}\" for --with-bfd-assembler option" 1>&2 |
4f6f4aa8 KR |
96 | exit 1 |
97 | ;; | |
98 | esac | |
99 | ||
b678740d RP |
100 | # assign cpu type |
101 | emulation=generic | |
102 | ||
5f8a3788 DHW |
103 | # default is big |
104 | endian=big | |
105 | ||
b53ccaac ILT |
106 | # check for architecture variants |
107 | case ${target_cpu} in | |
7cf4d7ff KR |
108 | # Actually we've only got support for the 1.1, so we shouldn't generalize, |
109 | # but this is what the support files are named... | |
8cac6ca6 KR |
110 | hppa*) cpu_type=hppa ;; |
111 | i486) cpu_type=i386 ;; | |
82489ea0 | 112 | m680[012346]0) cpu_type=m68k ;; |
8cac6ca6 KR |
113 | m68008) cpu_type=m68k ;; |
114 | m683??) cpu_type=m68k ;; | |
115 | m8*) cpu_type=m88k ;; | |
5f8a3788 | 116 | mips*el) cpu_type=mips endian=little;; |
8cac6ca6 | 117 | mips*) cpu_type=mips ;; |
5e65fbc8 | 118 | powerpc*) cpu_type=ppc ;; |
1c11ab0e | 119 | rs6000*) cpu_type=ppc ;; |
54eacbe6 | 120 | sparc64) cpu_type=sparc obj_format=elf extra_def=sparcv9 ;; |
8cac6ca6 | 121 | sparclite*) cpu_type=sparc ;; |
7cf4d7ff | 122 | *) cpu_type=${target_cpu} ;; |
b53ccaac ILT |
123 | esac |
124 | ||
634233a3 KR |
125 | # do we need the opcodes library? |
126 | case ${cpu_type} in | |
127 | alpha | vax) | |
128 | opcodes= | |
129 | ;; | |
130 | *) | |
131 | opcodes="../opcodes/libopcodes.a" | |
132 | ;; | |
133 | esac | |
134 | ||
b53ccaac | 135 | gas_target=${cpu_type} |
f70a4714 | 136 | generic_target=${cpu_type}-${target_vendor}-${target_os} |
8cac6ca6 KR |
137 | dev=no |
138 | ||
74cc5508 | 139 | # assign object format |
f70a4714 | 140 | case ${generic_target} in |
b418bc52 KR |
141 | a29k-amd-udi) obj_format=coff gas_target=ebmon29k ;; |
142 | a29k-amd-ebmon) obj_format=coff gas_target=ebmon29k ;; | |
7cf4d7ff | 143 | |
c25be7f4 | 144 | alpha-*-netware*) obj_format=ecoff ;; |
34de45f9 | 145 | alpha-*-osf*) obj_format=ecoff ;; |
816153a3 | 146 | |
c25be7f4 KR |
147 | hppa-*-*elf*) obj_format=elf emulation=hppa ;; |
148 | hppa-*-osf*) obj_format=som emulation=hppa ;; | |
7cf4d7ff | 149 | hppa-*-hpux*) obj_format=som emulation=hppa ;; |
5f8a3788 | 150 | hppa-*-bsd*) obj_format=som emulation=hppa ;; |
f8693e71 | 151 | hppa-*-hiux*) obj_format=som emulation=hppa ;; |
7cf4d7ff | 152 | |
b418bc52 | 153 | h8300-*-coff) obj_format=coff ;; |
8f4b9142 | 154 | |
b418bc52 | 155 | i386-ibm-aix*) obj_format=coff gas_target=i386coff |
7cf4d7ff KR |
156 | emulation=i386aix ;; |
157 | i386-*-bsd*) obj_format=aout emulation=386bsd ;; | |
b418bc52 | 158 | i386-*-netbsd0.8) obj_format=aout emulation=386bsd ;; |
420065a5 | 159 | i386-*-netbsd*) obj_format=aout emulation=netbsd ;; |
8cac6ca6 | 160 | i386-*-linux*elf*) obj_format=elf emulation=linux ;; |
b418bc52 | 161 | i386-*-linux*coff*) obj_format=coff emulation=linux |
8cac6ca6 | 162 | gas_target=i386coff ;; |
7cf4d7ff | 163 | i386-*-linux*) obj_format=aout emulation=linux ;; |
b418bc52 | 164 | i386-*-lynxos*) obj_format=coff gas_target=i386coff |
8cac6ca6 KR |
165 | emulation=lynx ;; |
166 | i386-*-sysv4* | i386-*-solaris* | i386-*-elf) | |
167 | obj_format=elf ;; | |
168 | i386-*-coff | i386-*-sysv* | i386-*-sco* | i386-*-isc*) | |
b418bc52 | 169 | obj_format=coff gas_target=i386coff ;; |
420065a5 | 170 | i386-*-vsta) obj_format=aout ;; |
b418bc52 | 171 | i386-*-go32) obj_format=coff gas_target=i386coff ;; |
de66fe1f KR |
172 | i386-*-mach* | i386-*-gnu*) |
173 | obj_format=aout emulation=mach bfd_gas=yes ;; | |
7cf4d7ff | 174 | |
c25be7f4 | 175 | i960-*-bout) obj_format=bout ;; |
b418bc52 | 176 | i960-*-coff) obj_format=coff emulation=ic960 gas_target=ic960coff ;; |
c25be7f4 KR |
177 | i960-*-nindy*) obj_format=bout ;; |
178 | i960-*-vxworks4*) obj_format=bout ;; | |
179 | i960-*-vxworks5.0) obj_format=bout ;; | |
b418bc52 | 180 | i960-*-vxworks5.*) obj_format=coff emulation=ic960 gas_target=ic960coff ;; |
c25be7f4 | 181 | i960-*-vxworks*) obj_format=bout ;; |
7cf4d7ff | 182 | |
8cac6ca6 | 183 | m68k-wrs-vxworks | m68k-ericsson-ose | m68k-*-sunos*) |
7cf4d7ff | 184 | obj_format=aout emulation=sun3 ;; |
b418bc52 KR |
185 | m68k-motorola-sysv) obj_format=coff gas_target=m68kcoff emulation=delta ;; |
186 | m68k-bull-sysv3*) obj_format=coff gas_target=m68kcoff emulation=dpx2 ;; | |
187 | m68k-apollo-*) obj_format=coff gas_target=apollo emulation=apollo ;; | |
8cac6ca6 | 188 | m68k-*-coff | m68k-*-sysv*) |
b418bc52 | 189 | obj_format=coff gas_target=m68kcoff ;; |
7cf4d7ff | 190 | m68k-*-hpux) obj_format=hp300 emulation=hp300 ;; |
b418bc52 | 191 | m68k-*-lynxos*) obj_format=coff gas_target=m68kcoff |
8cac6ca6 | 192 | emulation=lynx ;; |
7cf4d7ff | 193 | |
b418bc52 | 194 | m88k-*-coff*) obj_format=coff gas_target=m88kcoff ;; |
c978e704 | 195 | |
7cf4d7ff KR |
196 | # don't change emulation like *-*-bsd does |
197 | mips-*-bsd*) bfd_gas=yes obj_format=aout gas_target=mips-lit ;; | |
198 | mips-*-ultrix*) obj_format=ecoff gas_target=mips-lit ;; | |
5f8a3788 DHW |
199 | mips-*-ecoff*) obj_format=ecoff |
200 | if [ $endian = big ] ; then | |
201 | gas_target=mips-big | |
202 | else | |
203 | gas_target=mips-lit | |
204 | fi | |
205 | ;; | |
47fcc4f5 | 206 | mips-*-ecoff*) obj_format=ecoff gas_target=mips-big ;; |
00f4e659 | 207 | mips-*-irix5*) obj_format=elf gas_target=mips-big ;; |
7cf4d7ff | 208 | mips-*-irix*) obj_format=ecoff gas_target=mips-big emulation=irix ;; |
8cac6ca6 KR |
209 | mips-*-riscos*) obj_format=ecoff gas_target=mips-big ;; |
210 | mips-*-sysv*) obj_format=ecoff gas_target=mips-big ;; | |
5f8a3788 DHW |
211 | mips-*-elf*) obj_format=elf |
212 | if [ $endian = big ] ; then | |
213 | gas_target=mips-big | |
214 | else | |
215 | gas_target=mips-lit | |
216 | fi | |
217 | ;; | |
8cac6ca6 | 218 | |
1c11ab0e | 219 | ppc-*-aix*) obj_format=coff bfd_gas=yes ;; |
5e65fbc8 | 220 | ppc-*-sysv4*) obj_format=elf bfd_gas=yes ;; |
1c11ab0e | 221 | |
b418bc52 | 222 | sh-*-coff) obj_format=coff ;; |
816153a3 | 223 | |
8cac6ca6 KR |
224 | sparc*-*-sunos4*) obj_format=aout emulation=sun3 bfd_gas=yes ;; |
225 | sparc*-*-aout | sparc*-*-vxworks) | |
226 | obj_format=aout bfd_gas=yes ;; | |
227 | sparc*-*-coff) obj_format=coff bfd_gas=yes ;; | |
634233a3 | 228 | sparc*-*-lynxos*) obj_format=coff bfd_gas=yes emulation=lynx ;; |
8cac6ca6 KR |
229 | sparc*-fujitsu-none) obj_format=aout bfd_gas=yes ;; |
230 | sparc*-*-elf | sparc*-*-solaris*) | |
231 | obj_format=elf ;; | |
7cf4d7ff | 232 | |
5677c028 KR |
233 | vax-*-bsd* | vax-*-ultrix*) |
234 | obj_format=aout ;; | |
8cac6ca6 | 235 | vax-*-vms) obj_format=vms ;; |
a8285504 | 236 | |
8cac6ca6 | 237 | z8k-*-coff | z8k-*-sim) |
b418bc52 | 238 | obj_format=coff ;; |
07ef2075 | 239 | |
8cac6ca6 | 240 | *-*-aout | *-*-scout) |
7cf4d7ff | 241 | obj_format=aout ;; |
8cac6ca6 | 242 | *-*-nindy*) |
7cf4d7ff | 243 | obj_format=bout ;; |
8cac6ca6 | 244 | *-*-bsd*) |
7cf4d7ff KR |
245 | obj_format=aout emulation=sun3 ;; |
246 | *-*-generic) obj_format=generic ;; | |
b418bc52 KR |
247 | *-*-xray | *-*-hms) obj_format=coff ;; |
248 | *-*-sim) obj_format=coff ;; | |
8cac6ca6 KR |
249 | *-*-elf | *-*-sysv4* | *-*-solaris*) |
250 | echo '*** Warning: GAS support for ELF format is incomplete' 1>&2 | |
251 | obj_format=elf dev=yes ;; | |
7cf4d7ff | 252 | *-*-vxworks) obj_format=aout ;; |
5f8a3788 | 253 | *-*-netware) obj_format=elf ;; |
fecd2382 RP |
254 | esac |
255 | ||
8cac6ca6 KR |
256 | # Assign floating point type. Most processors with FP support |
257 | # IEEE FP. On those that don't support FP at all, usually IEEE | |
258 | # is emulated. | |
b678740d | 259 | case ${target_cpu} in |
7cf4d7ff KR |
260 | ns32k | vax | tahoe ) atof=${target_cpu} ;; |
261 | *) atof=ieee ;; | |
fecd2382 RP |
262 | esac |
263 | ||
7cf4d7ff KR |
264 | if [ ! -r ${srcdir}/config/tc-${cpu_type}.c ]; then |
265 | echo '*** GAS does not support target CPU' ${cpu_type} 1>&2 | |
266 | exit 1 | |
267 | fi | |
268 | ||
8cac6ca6 KR |
269 | case "${obj_format}" in |
270 | "") | |
271 | echo "*** GAS doesn't know what format to use for target" ${target} 1>&2 | |
272 | exit 1 | |
273 | ;; | |
274 | esac | |
7cf4d7ff KR |
275 | |
276 | if [ ! -r ${srcdir}/config/obj-${obj_format}.c ]; then | |
277 | echo '*** GAS does not have support for object file format' ${obj_format} 1>&2 | |
278 | exit 1 | |
279 | fi | |
280 | ||
8a24a37c SC |
281 | # and target makefile frag |
282 | ||
b53ccaac | 283 | target_makefile_frag=config/${gas_target}.mt |
8a24a37c | 284 | |
7cf4d7ff | 285 | case ${bfd_gas}-${obj_format} in |
b418bc52 KR |
286 | yes-coff) need_bfd=yes ;; |
287 | no-coff) need_bfd=yes extra_def="MANY_SEGMENTS" ;; | |
7cf4d7ff KR |
288 | *-elf) bfd_gas=yes ;; |
289 | *-ecoff) bfd_gas=yes ;; | |
5f8a3788 | 290 | *-som) bfd_gas=yes ;; |
7cf4d7ff KR |
291 | *) ;; |
292 | esac | |
293 | ||
a8285504 DZ |
294 | case ${with_bfd_assembler}-${bfd_gas} in |
295 | yes-yes | no-no) | |
7cf4d7ff KR |
296 | # We didn't override user's choice. |
297 | ;; | |
a8285504 | 298 | no-yes) |
7cf4d7ff KR |
299 | echo '*** Use of BFD is required for ${target}; overriding config options'\ |
300 | 1>&2 | |
301 | ;; | |
a8285504 DZ |
302 | no-preferred) |
303 | bfd_gas=no | |
304 | ;; | |
305 | *-preferred) | |
306 | bfd_gas=yes | |
307 | ;; | |
308 | -*) | |
309 | # User specified nothing. | |
310 | ;; | |
7cf4d7ff KR |
311 | esac |
312 | ||
69ecc03f | 313 | reject_dev_configs=yes |
8cac6ca6 KR |
314 | |
315 | case ${reject_dev_configs}-${dev} in | |
316 | yes-yes) # Oops. | |
317 | echo "*** GAS does not support the ${generic_target} configuration" 1>&2 | |
318 | exit 1 | |
319 | ;; | |
320 | esac | |
321 | ||
b678740d | 322 | files="config/ho-${gas_host}.h config/tc-${cpu_type}.c \ |
353deb84 | 323 | config/tc-${cpu_type}.h config/te-${emulation}.h \ |
74cc5508 RP |
324 | config/obj-${obj_format}.h config/obj-${obj_format}.c \ |
325 | config/atof-${atof}.c" | |
326 | ||
fecd2382 | 327 | links="host.h targ-cpu.c targ-cpu.h targ-env.h obj-format.h obj-format.c atof-targ.c" |
8b228fe9 | 328 | |
4f6f4aa8 KR |
329 | # post-target: |
330 | ||
331 | case ${bfd_gas} in | |
54eacbe6 | 332 | yes) extra_def="$extra_def BFD_ASSEMBLER" need_bfd=yes ;; |
4f6f4aa8 KR |
333 | esac |
334 | ||
335 | case ${need_bfd} in | |
c92d9ee9 KR |
336 | yes) bfdlib="BFDLIB=../bfd/libbfd.a" |
337 | all_obj_deps="$all_obj_deps ../bfd/bfd.h" | |
338 | ;; | |
339 | *) bfdlib="" | |
340 | ;; | |
4f6f4aa8 KR |
341 | esac |
342 | ||
8cac6ca6 KR |
343 | case "x${host}" in |
344 | "x${target}") cross="" ;; | |
345 | *) cross="CROSS=-DCROSS_COMPILE" ;; | |
346 | esac | |
347 | ||
348 | rm -f Makefile.tem | |
f39a73b1 | 349 | echo $cross > Makefile.tem |
c92d9ee9 KR |
350 | echo ALL_OBJ_DEPS=$all_obj_deps >> Makefile.tem |
351 | echo defs=$extra_def >> Makefile.tem | |
634233a3 | 352 | echo $bfdlib >> Makefile.tem |
634233a3 KR |
353 | echo "OPCODES_LIB=$opcodes" >> Makefile.tem |
354 | cat Makefile >> Makefile.tem | |
8cac6ca6 | 355 | mv -f Makefile.tem Makefile |
8f4b9142 | 356 | |
8b228fe9 | 357 | # end of gas/configure.in |