Commit | Line | Data |
---|---|---|
b11fb939 KR |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | dnl | |
3 | dnl And be careful when changing it! If you must add tests with square | |
4 | dnl brackets, be sure changequote invocations surround it. | |
5 | dnl | |
b11fb939 | 6 | dnl |
e2b4bd2a ILT |
7 | dnl v2.5 needed for --bindir et al |
8 | AC_PREREQ(2.5) | |
9 | AC_INIT(as.h) | |
10 | ||
11 | AC_CANONICAL_SYSTEM | |
12 | ||
921d7728 | 13 | AM_INIT_AUTOMAKE(gas, 2.9.4) |
e2b4bd2a ILT |
14 | |
15 | AM_PROG_LIBTOOL | |
16 | ||
318b02b6 | 17 | user_bfd_gas= |
b11fb939 | 18 | AC_ARG_ENABLE(bfd-assembler, |
d7b2038f | 19 | [ --enable-bfd-assembler use BFD back end for writing object files], |
b11fb939 | 20 | [case "${enableval}" in |
318b02b6 KR |
21 | yes) need_bfd=yes user_bfd_gas=yes ;; |
22 | no) user_bfd_gas=no ;; | |
b11fb939 KR |
23 | *) AC_MSG_ERROR(bad value ${enableval} given for bfd-assembler option) ;; |
24 | esac])dnl | |
e7757ad0 KR |
25 | AC_ARG_ENABLE(targets, |
26 | [ targets alternative target configurations besides the primary], | |
27 | [case "${enableval}" in | |
28 | yes | "") AC_ERROR(enable-targets option must specify target names or 'all') | |
29 | ;; | |
30 | no) enable_targets= ;; | |
31 | *) enable_targets=$enableval ;; | |
32 | esac])dnl | |
2e013bb7 ILT |
33 | AC_ARG_ENABLE(commonbfdlib, |
34 | [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library], | |
35 | [case "${enableval}" in | |
36 | yes) commonbfdlib=true ;; | |
37 | no) commonbfdlib=false ;; | |
38 | *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;; | |
39 | esac])dnl | |
b11fb939 | 40 | |
e2b4bd2a ILT |
41 | # Generate a header file |
42 | AM_CONFIG_HEADER(config.h:config.in) | |
7cf4d7ff | 43 | |
e7757ad0 | 44 | te_file=generic |
b678740d | 45 | |
603e9cf1 CM |
46 | # Makefile target for installing gas in $(tooldir)/bin. |
47 | install_tooldir=install-exec-tooldir | |
48 | ||
e7757ad0 KR |
49 | canon_targets="" |
50 | if test -n "$enable_targets" ; then | |
51 | for t in `echo $enable_targets | sed 's/,/ /g'`; do | |
ec2f730d | 52 | result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $t 2>/dev/null` |
e7757ad0 KR |
53 | if test -n "$result" ; then |
54 | canon_targets="$canon_targets $result" | |
55 | # else | |
56 | # # Permit "all", etc. We don't support it yet though. | |
57 | # canon_targets="$canon_targets $t" | |
58 | fi | |
59 | done | |
60 | GAS_UNIQ(canon_targets) | |
61 | fi | |
62 | ||
63 | emulations="" | |
64 | ||
65 | for this_target in $target $canon_targets ; do | |
66 | ||
64556643 FF |
67 | changequote(,)dnl |
68 | eval `echo $this_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/cpu=\1 vendor=\2 os=\3/'` | |
69 | changequote([,])dnl | |
8cac6ca6 | 70 | |
e7757ad0 | 71 | # check for architecture variants |
2b09622a | 72 | arch= |
6ff87ead | 73 | endian= |
e7757ad0 | 74 | case ${cpu} in |
0170f1c3 | 75 | alpha*) cpu_type=alpha ;; |
ae09d880 ILT |
76 | armeb) cpu_type=arm endian=big ;; |
77 | arm*) cpu_type=arm endian=little ;; | |
76fb6d2f | 78 | thumb*) cpu_type=arm endian=little ;; |
e7757ad0 KR |
79 | hppa*) cpu_type=hppa ;; |
80 | changequote(,)dnl | |
7c2fadd1 | 81 | i[456]86) cpu_type=i386 ;; |
e7757ad0 | 82 | m680[012346]0) cpu_type=m68k ;; |
921d7728 | 83 | changequote([,])dnl |
e7757ad0 KR |
84 | m68008) cpu_type=m68k ;; |
85 | m683??) cpu_type=m68k ;; | |
921d7728 | 86 | m5200) cpu_type=m68k ;; |
e7757ad0 | 87 | m8*) cpu_type=m88k ;; |
e16b9537 | 88 | mips*el) cpu_type=mips endian=little ;; |
01c655cc | 89 | # start-sanitize-r5900 |
9587640a | 90 | mips*5900*) cpu_type=mips endian=little ;; |
01c655cc | 91 | # end-sanitize-r5900 |
e7757ad0 KR |
92 | mips*) cpu_type=mips endian=big ;; |
93 | powerpcle*) cpu_type=ppc endian=little ;; | |
94 | powerpc*) cpu_type=ppc endian=big ;; | |
95 | rs6000*) cpu_type=ppc ;; | |
2b09622a DE |
96 | sparclite*) cpu_type=sparc arch=sparclite ;; |
97 | sparclet*) cpu_type=sparc arch=sparclet ;; | |
70ee7782 | 98 | sparc64*) cpu_type=sparc arch=v9-64 ;; |
307edcc0 | 99 | sparc86x*) cpu_type=sparc arch=sparc86x ;; |
2b09622a | 100 | sparc*) cpu_type=sparc arch=sparclite ;; # ??? See tc-sparc.c. |
756adc97 | 101 | v850*) cpu_type=v850 ;; |
a1c7c0f3 | 102 | *) cpu_type=${cpu} ;; |
e7757ad0 KR |
103 | esac |
104 | ||
105 | if test ${this_target} = $target ; then | |
106 | target_cpu_type=${cpu_type} | |
6ff87ead NC |
107 | if test x${endian} = xbig; then |
108 | AC_DEFINE(TARGET_BYTES_BIG_ENDIAN, 1) | |
109 | elif test x${endian} = xlittle; then | |
110 | AC_DEFINE(TARGET_BYTES_BIG_ENDIAN, 0) | |
111 | fi | |
e7757ad0 KR |
112 | elif test ${target_cpu_type} != ${cpu_type} ; then |
113 | continue | |
114 | fi | |
115 | ||
e7757ad0 KR |
116 | generic_target=${cpu_type}-$vendor-$os |
117 | dev=no | |
118 | bfd_gas=no | |
119 | em=generic | |
7cf4d7ff | 120 | |
e7757ad0 KR |
121 | # assign object format |
122 | case ${generic_target} in | |
6ff87ead NC |
123 | a29k-*-coff) fmt=coff ;; |
124 | a29k-amd-udi) fmt=coff ;; | |
125 | a29k-amd-ebmon) fmt=coff ;; | |
126 | a29k-nyu-sym1) fmt=coff ;; | |
e7757ad0 KR |
127 | a29k-*-vxworks*) fmt=coff ;; |
128 | ||
0170f1c3 RH |
129 | alpha*-*-*vms*) fmt=evax ;; |
130 | alpha*-*-netware*) fmt=ecoff ;; | |
131 | alpha*-*-openbsd*) fmt=ecoff ;; | |
132 | alpha*-*-osf*) fmt=ecoff ;; | |
133 | alpha*-*-linuxecoff*) fmt=ecoff ;; | |
22d3fbd6 NC |
134 | alpha*-*-linux-gnu*) fmt=elf em=linux ;; |
135 | alpha*-*-netbsd*) fmt=elf em=nbsd ;; | |
816153a3 | 136 | |
e7757ad0 | 137 | arc-*-elf*) fmt=elf bfd_gas=yes ;; |
4181c985 | 138 | |
6ff87ead NC |
139 | arm-*-riscix*) fmt=aout em=riscix ;; |
140 | arm-*-aout) fmt=aout ;; | |
76fb6d2f | 141 | arm-*-coff | thumb-*-coff) fmt=coff ;; |
603e9cf1 | 142 | arm-*-elf | thumb-*-elf) fmt=elf ;; |
e7757ad0 | 143 | arm-*-riscix*) fmt=aout ;; |
22d3fbd6 | 144 | arm-*-pe | thumb-*-pe) fmt=coff em=pe ;; |
e7757ad0 | 145 | |
05a8bf33 | 146 | d10v-*-*) fmt=elf bfd_gas=yes ;; |
7d0f8249 | 147 | d30v-*-*) fmt=elf bfd_gas=yes ;; |
7be9a312 | 148 | |
603e9cf1 CM |
149 | # start-sanitize-sky |
150 | dvp-*-*) fmt=elf bfd_gas=yes install_tooldir= ;; | |
151 | # end-sanitize-sky | |
152 | ||
352b0f4d DB |
153 | fr30-*-*) fmt=elf bfd_gas=yes ;; |
154 | ||
e7757ad0 KR |
155 | hppa-*-*elf*) fmt=elf em=hppa ;; |
156 | hppa-*-lites*) fmt=elf em=hppa ;; | |
157 | hppa-*-osf*) fmt=som em=hppa ;; | |
332d5c49 | 158 | hppa-*-rtems*) fmt=elf em=hppa ;; |
e7757ad0 KR |
159 | hppa-*-hpux*) fmt=som em=hppa ;; |
160 | hppa-*-bsd*) fmt=som em=hppa ;; | |
161 | hppa-*-hiux*) fmt=som em=hppa ;; | |
162 | ||
163 | h8300-*-coff) fmt=coff ;; | |
164 | ||
6ff87ead | 165 | i386-ibm-aix*) fmt=coff em=i386aix ;; |
7d0f8249 | 166 | i386-sequent-bsd*) fmt=aout em=dynix bfd_gas=yes ;; |
cc88a106 ILT |
167 | dnl start-sanitize-beos |
168 | i386-*-beospe*) fmt=coff em=pe bfd_gas=yes ;; | |
a1624e3f | 169 | i386-*-beoself* | i386-*-beos*) fmt=elf bfd_gas=yes ;; |
cc88a106 | 170 | dnl end-sanitize-beos |
e7757ad0 KR |
171 | i386-*-bsd*) fmt=aout em=386bsd ;; |
172 | i386-*-netbsd0.8) fmt=aout em=386bsd ;; | |
173 | i386-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes;; | |
76fb6d2f | 174 | i386-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes;; |
a1c7c0f3 | 175 | i386-*-linux*aout* | i386-*-linuxoldld) fmt=aout em=linux ;; |
6ff87ead | 176 | i386-*-linux*coff*) fmt=coff em=linux ;; |
a1624e3f | 177 | i386-*-linux-gnu*) fmt=elf em=linux bfd_gas=yes ;; |
6ff87ead | 178 | i386-*-lynxos*) fmt=coff em=lynx ;; |
15ddb4c9 | 179 | i386-*-sysv4* | i386-*-solaris* | i386-*-elf) |
a1624e3f RH |
180 | fmt=elf bfd_gas=yes ;; |
181 | i386-*-freebsdelf*) fmt=elf bfd_gas=yes ;; | |
15ddb4c9 | 182 | i386-*-freebsd*) fmt=aout em=386bsd ;; |
6cc7a938 ILT |
183 | i386-*-coff | i386-*-sysv* | i386-*-sco3.2v5*coff | i386-*-isc*) |
184 | fmt=coff ;; | |
185 | i386-*-sco3.2v5*) fmt=elf | |
6ff87ead NC |
186 | if test ${this_target} = $target; then |
187 | AC_DEFINE(SCO_ELF) | |
188 | fi | |
189 | ;; | |
6cc7a938 | 190 | i386-*-sco3.2*) fmt=coff ;; |
e7757ad0 | 191 | i386-*-vsta) fmt=aout ;; |
60dc9fb2 | 192 | i386-*-msdosdjgpp* | i386-*-go32* | i386-go32-rtems*) |
6ff87ead NC |
193 | fmt=coff em=go32;; |
194 | i386-*-rtems*) fmt=coff ;; | |
6c186c48 SC |
195 | i386-*-gnu*) fmt=elf ;; |
196 | i386-*-mach*) | |
e7757ad0 KR |
197 | fmt=aout em=mach bfd_gas=yes ;; |
198 | i386-*-msdos*) fmt=aout ;; | |
6c186c48 | 199 | i386-*-moss*) fmt=elf ;; |
6ff87ead | 200 | i386-*-pe) fmt=coff em=pe ;; |
c296a052 | 201 | i386-*-cygwin*) fmt=coff em=pe bfd_gas=yes ;; |
0040c1e9 ILT |
202 | i386-*-mingw32*) fmt=coff em=pe bfd_gas=yes ;; |
203 | i386-*-*nt*) fmt=coff em=pe ;; | |
e7757ad0 | 204 | i960-*-bout) fmt=bout ;; |
6ff87ead NC |
205 | i960-*-coff) fmt=coff em=ic960 ;; |
206 | i960-*-rtems*) fmt=coff em=ic960 ;; | |
e7757ad0 KR |
207 | i960-*-nindy*) fmt=bout ;; |
208 | i960-*-vxworks4*) fmt=bout ;; | |
209 | i960-*-vxworks5.0) fmt=bout ;; | |
6ff87ead | 210 | i960-*-vxworks5.*) fmt=coff em=ic960 ;; |
e7757ad0 KR |
211 | i960-*-vxworks*) fmt=bout ;; |
212 | ||
374bdac7 DE |
213 | m32r-*-*) fmt=elf bfd_gas=yes ;; |
214 | ||
e7757ad0 KR |
215 | m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*) |
216 | fmt=aout em=sun3 ;; | |
6ff87ead NC |
217 | m68k-motorola-sysv*) fmt=coff em=delta ;; |
218 | m68k-bull-sysv3*) fmt=coff em=dpx2 ;; | |
219 | m68k-apollo-*) fmt=coff em=apollo ;; | |
fee3e248 ILT |
220 | m68k-*-sysv4*) # must be before -sysv* |
221 | fmt=elf em=svr4 ;; | |
222 | m68k-*-elf*) fmt=elf ;; | |
1c94de4d | 223 | m68k-*-coff | m68k-*-sysv* | m68k-*-rtems*) |
6ff87ead | 224 | fmt=coff ;; |
e7757ad0 | 225 | m68k-*-hpux*) fmt=hp300 em=hp300 ;; |
535cfd0f | 226 | m68k-*-linux*aout*) fmt=aout em=linux ;; |
22d3fbd6 | 227 | m68k-*-linux-gnu*) fmt=elf em=linux ;; |
6ff87ead | 228 | m68k-*-lynxos*) fmt=coff em=lynx ;; |
e7757ad0 | 229 | m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;; |
76fb6d2f | 230 | m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;; |
6ff87ead | 231 | m68k-apple-aux*) fmt=coff em=aux ;; |
8a6f53e9 | 232 | m68k-*-psos*) fmt=elf em=psos;; |
e7757ad0 | 233 | |
6ff87ead NC |
234 | m88k-motorola-sysv3*) fmt=coff em=delt88 ;; |
235 | m88k-*-coff*) fmt=coff ;; | |
e7757ad0 KR |
236 | |
237 | # don't change em like *-*-bsd does | |
6ff87ead NC |
238 | mips-dec-netbsd*) fmt=elf endian=little ;; |
239 | mips-dec-openbsd*) fmt=elf endian=little ;; | |
240 | mips-dec-bsd*) fmt=aout ;; | |
241 | mips-sony-bsd*) fmt=ecoff ;; | |
e7757ad0 | 242 | mips-*-bsd*) AC_MSG_ERROR(Unknown vendor for mips-bsd configuration.) ;; |
6ff87ead NC |
243 | mips-*-ultrix*) fmt=ecoff endian=little ;; |
244 | mips-*-osf*) fmt=ecoff endian=little ;; | |
245 | mips-*-ecoff*) fmt=ecoff ;; | |
246 | mips-*-ecoff*) fmt=ecoff ;; | |
247 | mips-*-irix6*) fmt=elf ;; | |
248 | mips-*-irix5*) fmt=elf ;; | |
249 | mips-*-irix*) fmt=ecoff ;; | |
250 | mips-*-lnews*) fmt=ecoff em=lnews ;; | |
251 | mips-*-riscos*) fmt=ecoff ;; | |
252 | mips-*-sysv*) fmt=ecoff ;; | |
22d3fbd6 | 253 | mips-*-elf* | mips-*-rtems* | mips-*-linux-gnu* | mips-*-gnu* | mips-*-openbsd*) |
6ff87ead | 254 | fmt=elf ;; |
ae1b99e4 JL |
255 | mn10200-*-*) fmt=elf bfd_gas=yes ;; |
256 | mn10300-*-*) fmt=elf bfd_gas=yes ;; | |
c296a052 | 257 | ppc-*-pe | ppc-*-cygwin* | ppc-*-winnt*) |
6ff87ead | 258 | fmt=coff em=pe ;; |
e7757ad0 | 259 | ppc-*-aix*) fmt=coff ;; |
515c7142 | 260 | ppc-*-beos*) fmt=coff ;; |
76fb6d2f | 261 | ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*) |
6ff87ead | 262 | fmt=elf ;; |
22d3fbd6 | 263 | ppc-*-linux-gnu*) fmt=elf |
159e6ef8 | 264 | case "$endian" in |
6ff87ead | 265 | big) ;; |
22d3fbd6 | 266 | *) AC_MSG_ERROR(GNU/Linux must be configured big endian) ;; |
159e6ef8 MM |
267 | esac |
268 | ;; | |
269 | ppc-*-solaris*) fmt=elf | |
6ff87ead NC |
270 | if test ${this_target} = $target; then |
271 | AC_DEFINE(TARGET_SOLARIS_COMMENT) | |
272 | fi | |
273 | if test x${endian} = xbig; then | |
274 | AC_MSG_ERROR(Solaris must be configured little endian) | |
275 | fi | |
1c94de4d | 276 | ;; |
6ff87ead | 277 | ppc-*-rtems*) fmt=elf ;; |
880b7429 KR |
278 | ppc-*-macos* | ppc-*-mpw*) |
279 | fmt=coff em=macos ;; | |
e7757ad0 KR |
280 | ppc-*-netware*) fmt=elf em=ppcnw ;; |
281 | ||
fed13a5e ILT |
282 | sh-*-elf*) fmt=elf ;; |
283 | sh-*-coff*) fmt=coff ;; | |
f3aa01e2 | 284 | sh-*-rtems*) fmt=coff ;; |
816153a3 | 285 | |
5f757edc ILT |
286 | ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;; |
287 | ns32k-pc532-netbsd* | ns32k-pc532-lites*) fmt=aout em=nbsd532 ;; | |
76fb6d2f | 288 | ns32k-pc532-openbsd*) fmt=aout em=nbsd532 ;; |
e7757ad0 | 289 | |
1c94de4d | 290 | sparc-*-rtems*) fmt=aout ;; |
e7757ad0 | 291 | sparc-*-sunos4*) fmt=aout em=sun3 ;; |
df586de2 | 292 | sparc-*-aout | sparc*-*-vxworks*) |
fed13a5e | 293 | fmt=aout em=sparcaout ;; |
e7757ad0 | 294 | sparc-*-coff) fmt=coff ;; |
2e013bb7 | 295 | sparc-*-linux*aout*) fmt=aout em=linux ;; |
22d3fbd6 | 296 | sparc-*-linux-gnu*) fmt=elf em=linux ;; |
e7757ad0 KR |
297 | sparc-*-lynxos*) fmt=coff em=lynx ;; |
298 | sparc-fujitsu-none) fmt=aout ;; | |
0b27ea39 | 299 | sparc-*-elf | sparc-*-sysv4* | sparc-*-solaris*) |
e7757ad0 | 300 | fmt=elf ;; |
a1624e3f RH |
301 | sparc-*-netbsd*) fmt=aout em=nbsd ;; |
302 | sparc-*-openbsd*) fmt=aout em=nbsd ;; | |
c6aa56bc | 303 | |
0e034c77 ILT |
304 | tic30-*-*aout*) fmt=aout bfd_gas=yes ;; |
305 | tic30-*-*coff*) fmt=coff bfd_gas=yes ;; | |
64556643 | 306 | # start-sanitize-tic80 |
6ff87ead | 307 | tic80-*-*) fmt=coff ;; |
64556643 | 308 | # end-sanitize-tic80 |
103dd764 | 309 | |
c6aa56bc | 310 | v850-*-*) fmt=elf bfd_gas=yes ;; |
e7757ad0 | 311 | |
6ff87ead NC |
312 | # start-sanitize-v850e |
313 | v850e-*-*) fmt=elf bfd_gas=yes ;; | |
60dc9fb2 | 314 | v850ea-*-*) fmt=elf bfd_gas=yes ;; |
5e4e4739 | 315 | # end-sanitize-v850e |
e7757ad0 KR |
316 | vax-*-bsd* | vax-*-ultrix*) |
317 | fmt=aout ;; | |
318 | vax-*-vms) fmt=vms ;; | |
319 | ||
320 | z8k-*-coff | z8k-*-sim) | |
321 | fmt=coff ;; | |
322 | ||
323 | w65-*-*) fmt=coff ;; | |
324 | ||
325 | *-*-aout | *-*-scout) | |
326 | fmt=aout ;; | |
327 | *-*-nindy*) | |
328 | fmt=bout ;; | |
329 | *-*-bsd*) | |
330 | fmt=aout em=sun3 ;; | |
331 | *-*-generic) fmt=generic ;; | |
332 | *-*-xray | *-*-hms) fmt=coff ;; | |
333 | *-*-sim) fmt=coff ;; | |
334 | *-*-elf | *-*-sysv4* | *-*-solaris*) | |
6df07e7f | 335 | AC_MSG_WARN(GAS support for ${generic_target} is incomplete.) |
e7757ad0 KR |
336 | fmt=elf dev=yes ;; |
337 | *-*-vxworks) fmt=aout ;; | |
338 | *-*-netware) fmt=elf ;; | |
339 | esac | |
340 | ||
341 | case ${cpu_type}-${fmt} in | |
0170f1c3 | 342 | alpha*-*) bfd_gas=yes ;; |
e7757ad0 KR |
343 | arm-*) bfd_gas=yes ;; |
344 | # not yet | |
345 | # i386-aout) bfd_gas=preferred ;; | |
346 | mips-*) bfd_gas=yes ;; | |
347 | ns32k-*) bfd_gas=yes ;; | |
348 | ppc-*) bfd_gas=yes ;; | |
349 | sparc-*) bfd_gas=yes ;; | |
350 | *-elf) bfd_gas=yes ;; | |
351 | *-ecoff) bfd_gas=yes ;; | |
352 | *-som) bfd_gas=yes ;; | |
353 | *) ;; | |
354 | esac | |
355 | ||
5f757edc ILT |
356 | # Other random stuff. |
357 | ||
ae09d880 ILT |
358 | # do we need the opcodes library? |
359 | case ${cpu_type} in | |
0e034c77 | 360 | vax | i386 | tic30) |
7c2fadd1 ILT |
361 | ;; |
362 | *) | |
363 | need_opcodes=yes | |
f2e272e0 ILT |
364 | |
365 | case "${enable_shared}" in | |
366 | yes) shared_opcodes=true ;; | |
367 | *opcodes*) shared_opcodes=true ;; | |
368 | *) shared_opcodes=false ;; | |
369 | esac | |
159e6ef8 | 370 | if test "${shared_opcodes}" = "true"; then |
7c2fadd1 ILT |
371 | # A shared libopcodes must be linked against libbfd. |
372 | need_bfd=yes | |
373 | fi | |
374 | ;; | |
ae09d880 ILT |
375 | esac |
376 | ||
5f757edc | 377 | case ${cpu_type} in |
352b0f4d | 378 | m32r | fr30) |
7c269afb | 379 | case "x${extra_objects}" in |
374bdac7 DE |
380 | *cgen.o*) ;; |
381 | *) extra_objects="$extra_objects cgen.o" | |
374bdac7 DE |
382 | AC_DEFINE(USING_CGEN) |
383 | ;; | |
384 | esac | |
385 | ;; | |
386 | ||
1c9dbb83 ILT |
387 | m68k) |
388 | case ${extra_objects} in | |
389 | *m68k-parse.o*) ;; | |
390 | *) extra_objects="$extra_objects m68k-parse.o" ;; | |
391 | esac | |
392 | ;; | |
efec4a28 DP |
393 | |
394 | mips) | |
515c7142 | 395 | echo ${extra_objects} | grep -s "itbl-parse.o" |
efec4a28 | 396 | if test $? -ne 0 ; then |
515c7142 | 397 | extra_objects="$extra_objects itbl-parse.o" |
efec4a28 DP |
398 | fi |
399 | ||
515c7142 | 400 | echo ${extra_objects} | grep -s "itbl-lex.o" |
efec4a28 | 401 | if test $? -ne 0 ; then |
515c7142 | 402 | extra_objects="$extra_objects itbl-lex.o" |
efec4a28 DP |
403 | fi |
404 | ||
515c7142 | 405 | echo ${extra_objects} | grep -s "itbl-ops.o" |
efec4a28 | 406 | if test $? -ne 0 ; then |
515c7142 | 407 | extra_objects="$extra_objects itbl-ops.o" |
efec4a28 DP |
408 | fi |
409 | ;; | |
410 | ||
2b09622a | 411 | sparc) |
e01e18a8 DE |
412 | if test $this_target = $target ; then |
413 | AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}") | |
414 | fi | |
2b09622a DE |
415 | ;; |
416 | ||
efec4a28 DP |
417 | *) |
418 | ;; | |
5f757edc ILT |
419 | esac |
420 | ||
e7757ad0 KR |
421 | # See if we really can support this configuration with the emulation code. |
422 | ||
423 | if test $this_target = $target ; then | |
424 | primary_bfd_gas=$bfd_gas | |
425 | obj_format=$fmt | |
e7757ad0 KR |
426 | te_file=$em |
427 | ||
428 | if test $bfd_gas = no ; then | |
429 | # Can't support other configurations this way. | |
430 | break | |
431 | fi | |
432 | elif test $bfd_gas = no ; then | |
433 | # Can't support this configuration. | |
434 | break | |
435 | fi | |
436 | ||
437 | # From target name and format, produce a list of supported emulations. | |
438 | ||
439 | case ${generic_target}-${fmt} in | |
1cb0d00d | 440 | mips-*-irix5*-*) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;; |
22d3fbd6 | 441 | mips-*-linux-gnu*-*) case "$endian" in |
515c7142 ILT |
442 | big) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;; |
443 | *) emulation="mipslelf mipsbelf mipself mipslecoff mipsbecoff mipsecoff" ;; | |
444 | esac ;; | |
445 | mips-*-lnews*-ecoff) ;; | |
e7757ad0 | 446 | mips-*-*-ecoff) case "$endian" in |
1cb0d00d KR |
447 | big) emulation="mipsbecoff mipslecoff mipsecoff" ;; |
448 | *) emulation="mipslecoff mipsbecoff mipsecoff" ;; | |
e7757ad0 KR |
449 | esac ;; |
450 | mips-*-*-elf) case "$endian" in | |
1cb0d00d KR |
451 | big) emulation="mipsbelf mipslelf mipself" ;; |
452 | *) emulation="mipslelf mipsbelf mipself" ;; | |
515c7142 ILT |
453 | # Uncommenting the next line will turn on support for i386 COFF |
454 | # in any i386 ELF configuration. This probably doesn't work | |
455 | # correctly. | |
456 | # i386-*-*-elf) emulation="i386coff i386elf" ;; | |
e7757ad0 KR |
457 | esac ;; |
458 | esac | |
459 | ||
460 | emulations="$emulations $emulation" | |
461 | ||
e7757ad0 | 462 | done |
fecd2382 | 463 | |
8cac6ca6 KR |
464 | # Assign floating point type. Most processors with FP support |
465 | # IEEE FP. On those that don't support FP at all, usually IEEE | |
466 | # is emulated. | |
b678740d | 467 | case ${target_cpu} in |
904b6037 | 468 | vax | tahoe ) atof=${target_cpu} ;; |
e7757ad0 | 469 | *) atof=ieee ;; |
fecd2382 RP |
470 | esac |
471 | ||
8cac6ca6 | 472 | case "${obj_format}" in |
b11fb939 | 473 | "") AC_MSG_ERROR(GAS does not know what format to use for target ${target}) ;; |
8cac6ca6 | 474 | esac |
7cf4d7ff | 475 | |
7c269afb DE |
476 | # Unfortunately the cpu in cpu-opc.h file isn't always $(TARGET_CPU). |
477 | cgen_cpu_prefix="" | |
478 | case "x${extra_objects}" in | |
479 | *cgen.o*) | |
480 | case ${target_cpu} in | |
481 | *) cgen_cpu_prefix=${target_cpu} ;; | |
482 | esac | |
483 | ;; | |
484 | esac | |
485 | AC_SUBST(cgen_cpu_prefix) | |
486 | ||
b11fb939 KR |
487 | dnl |
488 | dnl Make sure the desired support files exist. | |
489 | dnl | |
490 | ||
bf4bd1fc ILT |
491 | if test ! -r ${srcdir}/config/tc-${target_cpu_type}.c; then |
492 | AC_MSG_ERROR(GAS does not support target CPU ${target_cpu_type}) | |
b11fb939 KR |
493 | fi |
494 | ||
fb589130 | 495 | if test ! -r ${srcdir}/config/obj-${obj_format}.c; then |
b11fb939 | 496 | AC_MSG_ERROR(GAS does not have support for object file format ${obj_format}) |
7cf4d7ff KR |
497 | fi |
498 | ||
e7757ad0 | 499 | case ${user_bfd_gas}-${primary_bfd_gas} in |
a8285504 | 500 | yes-yes | no-no) |
7cf4d7ff KR |
501 | # We didn't override user's choice. |
502 | ;; | |
a8285504 | 503 | no-yes) |
b11fb939 | 504 | AC_MSG_WARN(Use of BFD is required for ${target}; overriding config options.) |
7cf4d7ff | 505 | ;; |
a8285504 | 506 | no-preferred) |
e7757ad0 | 507 | primary_bfd_gas=no |
a8285504 DZ |
508 | ;; |
509 | *-preferred) | |
e7757ad0 | 510 | primary_bfd_gas=yes |
a8285504 | 511 | ;; |
f2889110 | 512 | yes-*) |
e7757ad0 | 513 | primary_bfd_gas=yes |
f2889110 | 514 | ;; |
a8285504 DZ |
515 | -*) |
516 | # User specified nothing. | |
517 | ;; | |
7cf4d7ff KR |
518 | esac |
519 | ||
e7757ad0 KR |
520 | # Some COFF configurations want these random other flags set. |
521 | case ${obj_format} in | |
522 | coff) | |
523 | case ${target_cpu_type} in | |
524 | i386) AC_DEFINE(I386COFF) ;; | |
525 | m68k) AC_DEFINE(M68KCOFF) ;; | |
526 | m88k) AC_DEFINE(M88KCOFF) ;; | |
527 | esac | |
528 | ;; | |
529 | esac | |
530 | ||
531 | # Getting this done right is going to be a bitch. Each configuration specified | |
532 | # with --enable-targets=... should be checked for environment, format, cpu, and | |
533 | # bfd_gas setting. | |
534 | # | |
535 | # For each configuration, the necessary object file support code must be linked | |
536 | # in. This might be only one, it might be up to four. The necessary emulation | |
537 | # code needs to be provided, too. | |
538 | # | |
539 | # And then there's "--enable-targets=all".... | |
540 | # | |
541 | # For now, just always do it for MIPS ELF or ECOFF configurations. Sigh. | |
542 | ||
543 | formats="${obj_format}" | |
544 | emfiles="" | |
545 | EMULATIONS="" | |
546 | GAS_UNIQ(emulations) | |
547 | for em in . $emulations ; do | |
548 | case $em in | |
549 | .) continue ;; | |
550 | mipsbelf | mipslelf) | |
551 | fmt=elf file=mipself ;; | |
552 | mipsbecoff | mipslecoff) | |
553 | fmt=ecoff file=mipsecoff ;; | |
515c7142 ILT |
554 | i386coff) |
555 | fmt=coff file=i386coff ;; | |
556 | i386elf) | |
557 | fmt=elf file=i386elf ;; | |
e7757ad0 KR |
558 | esac |
559 | formats="$formats $fmt" | |
560 | emfiles="$emfiles e-$file.o" | |
561 | EMULATIONS="$EMULATIONS &$em," | |
562 | done | |
563 | GAS_UNIQ(formats) | |
564 | GAS_UNIQ(emfiles) | |
565 | if test `set . $formats ; shift ; echo $#` -gt 1 ; then | |
566 | for fmt in $formats ; do | |
567 | case $fmt in | |
568 | aout) AC_DEFINE(OBJ_MAYBE_AOUT) ;; | |
569 | bout) AC_DEFINE(OBJ_MAYBE_BOUT) ;; | |
570 | coff) AC_DEFINE(OBJ_MAYBE_COFF) ;; | |
571 | ecoff) AC_DEFINE(OBJ_MAYBE_ECOFF) ;; | |
572 | elf) AC_DEFINE(OBJ_MAYBE_ELF) ;; | |
573 | generic) AC_DEFINE(OBJ_MAYBE_GENERIC) ;; | |
574 | hp300) AC_DEFINE(OBJ_MAYBE_HP300) ;; | |
575 | ieee) AC_DEFINE(OBJ_MAYBE_IEEE) ;; | |
576 | som) AC_DEFINE(OBJ_MAYBE_SOM) ;; | |
577 | vms) AC_DEFINE(OBJ_MAYBE_VMS) ;; | |
578 | esac | |
579 | extra_objects="$extra_objects obj-$fmt.o" | |
580 | done | |
581 | obj_format=multi | |
582 | fi | |
583 | if test `set . $emfiles ; shift ; echo $#` -gt 0 ; then | |
584 | te_file=multi | |
585 | extra_objects="$extra_objects $emfiles" | |
586 | DEFAULT_EMULATION=`set . $emulations ; echo $2` | |
587 | AC_DEFINE(USE_EMULATIONS) | |
588 | fi | |
589 | AC_SUBST(extra_objects) | |
590 | AC_DEFINE_UNQUOTED(EMULATIONS, $EMULATIONS) | |
591 | AC_DEFINE_UNQUOTED(DEFAULT_EMULATION, "$DEFAULT_EMULATION") | |
592 | ||
bf4bd1fc | 593 | case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in |
318b02b6 KR |
594 | yes-*-coff) need_bfd=yes ;; |
595 | no-*-coff) need_bfd=yes | |
596 | AC_DEFINE(MANY_SEGMENTS) ;; | |
597 | esac | |
598 | ||
69ecc03f | 599 | reject_dev_configs=yes |
8cac6ca6 KR |
600 | |
601 | case ${reject_dev_configs}-${dev} in | |
602 | yes-yes) # Oops. | |
b11fb939 | 603 | AC_MSG_ERROR(GAS does not support the ${generic_target} configuration.) |
8cac6ca6 KR |
604 | ;; |
605 | esac | |
606 | ||
bf4bd1fc | 607 | AC_SUBST(target_cpu_type) |
833c46e1 | 608 | AC_SUBST(obj_format) |
515c7142 | 609 | AC_SUBST(te_file) |
603e9cf1 | 610 | AC_SUBST(install_tooldir) |
833c46e1 | 611 | AC_SUBST(atof) |
e7757ad0 | 612 | dnl AC_SUBST(emulation) |
833c46e1 | 613 | |
e7757ad0 | 614 | case "${primary_bfd_gas}" in |
b11fb939 KR |
615 | yes) AC_DEFINE(BFD_ASSEMBLER) |
616 | need_bfd=yes ;; | |
4f6f4aa8 KR |
617 | esac |
618 | ||
ae09d880 ILT |
619 | # do we need the opcodes library? |
620 | case "${need_opcodes}" in | |
1c94de4d | 621 | yes) |
e2b4bd2a | 622 | OPCODES_LIB=../opcodes/libopcodes.la |
1c94de4d | 623 | ;; |
ae09d880 | 624 | esac |
ae09d880 | 625 | |
b11fb939 | 626 | case "${need_bfd}" in |
1c94de4d | 627 | yes) |
e2b4bd2a | 628 | BFDLIB=../bfd/libbfd.la |
1c94de4d | 629 | ALL_OBJ_DEPS="$ALL_OBJ_DEPS ../bfd/bfd.h" |
1c94de4d | 630 | ;; |
4f6f4aa8 | 631 | esac |
2e013bb7 | 632 | |
b11fb939 | 633 | AC_SUBST(BFDLIB) |
2e013bb7 ILT |
634 | AC_SUBST(OPCODES_LIB) |
635 | ||
b11fb939 | 636 | AC_SUBST(ALL_OBJ_DEPS) |
4f6f4aa8 | 637 | |
b11fb939 KR |
638 | AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}") |
639 | AC_DEFINE_UNQUOTED(TARGET_CANONICAL, "${target}") | |
640 | AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}") | |
641 | AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}") | |
642 | AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}") | |
643 | ||
b11fb939 | 644 | AC_PROG_CC |
b11fb939 | 645 | |
e2b4bd2a | 646 | AC_PROG_YACC |
b2bb41f6 | 647 | AM_PROG_LEX |
e2b4bd2a | 648 | |
48401fcf TT |
649 | ALL_LINGUAS= |
650 | CY_GNU_GETTEXT | |
651 | ||
e2b4bd2a ILT |
652 | AM_MAINTAINER_MODE |
653 | AM_CYGWIN32 | |
654 | AM_EXEEXT | |
655 | ||
b11fb939 KR |
656 | AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h) |
657 | ||
bf111c9f KR |
658 | # Put this here so that autoconf's "cross-compiling" message doesn't confuse |
659 | # people who are not cross-compiling but are compiling cross-assemblers. | |
660 | AC_MSG_CHECKING(whether compiling a cross-assembler) | |
661 | if test "${host}" = "${target}"; then | |
f2889110 KR |
662 | cross_gas=no |
663 | else | |
bf111c9f KR |
664 | cross_gas=yes |
665 | AC_DEFINE(CROSS_COMPILE) | |
bf111c9f KR |
666 | fi |
667 | AC_MSG_RESULT($cross_gas) | |
668 | ||
b11fb939 KR |
669 | dnl ansidecl.h will deal with const |
670 | dnl AC_CONST | |
671 | AC_FUNC_ALLOCA | |
672 | AC_C_INLINE | |
673 | ||
f2889110 KR |
674 | # VMS doesn't have unlink. |
675 | AC_CHECK_FUNCS(unlink remove, break) | |
28d3e4a3 | 676 | |
e63c594d FF |
677 | # Some systems don't have sbrk(). |
678 | AC_CHECK_FUNCS(sbrk) | |
679 | ||
b11fb939 KR |
680 | # Some non-ANSI preprocessors botch requoting inside strings. That's bad |
681 | # enough, but on some of those systems, the assert macro relies on requoting | |
682 | # working properly! | |
bf111c9f | 683 | GAS_WORKING_ASSERT |
b11fb939 KR |
684 | |
685 | # On some systems, the system header files may not declare malloc, realloc, | |
686 | # and free. There are places where gas needs these functions to have been | |
687 | # declared -- such as when taking their addresses. | |
bf111c9f | 688 | gas_test_headers=" |
b11fb939 KR |
689 | #ifdef HAVE_MEMORY_H |
690 | #include <memory.h> | |
691 | #endif | |
692 | #ifdef HAVE_STRING_H | |
693 | #include <string.h> | |
5cece526 ILT |
694 | #else |
695 | #ifdef HAVE_STRINGS_H | |
696 | #include <strings.h> | |
697 | #endif | |
b11fb939 KR |
698 | #endif |
699 | #ifdef HAVE_STDLIB_H | |
700 | #include <stdlib.h> | |
701 | #endif | |
702 | #ifdef HAVE_UNISTD_H | |
703 | #include <unistd.h> | |
704 | #endif | |
bf111c9f | 705 | " |
5cece526 | 706 | GAS_CHECK_DECL_NEEDED(strstr, f, char *(*f)(), $gas_test_headers) |
bf111c9f | 707 | GAS_CHECK_DECL_NEEDED(malloc, f, char *(*f)(), $gas_test_headers) |
5f757edc | 708 | GAS_CHECK_DECL_NEEDED(free, f, void (*f)(), $gas_test_headers) |
5cece526 | 709 | GAS_CHECK_DECL_NEEDED(sbrk, f, char *(*f)(), $gas_test_headers) |
b11fb939 KR |
710 | |
711 | # Does errno.h declare errno, or do we have to add a separate declaration | |
712 | # for it? | |
bf111c9f | 713 | GAS_CHECK_DECL_NEEDED(errno, f, int f, [ |
b11fb939 KR |
714 | #ifdef HAVE_ERRNO_H |
715 | #include <errno.h> | |
716 | #endif | |
bf111c9f | 717 | ]) |
b11fb939 | 718 | |
b11fb939 | 719 | dnl This must come last. |
515c7142 ILT |
720 | |
721 | dnl We used to make symlinks to files in the source directory, but now | |
722 | dnl we just use the right name for .c files, and create .h files in | |
723 | dnl the build directory which include the right .h file. Make sure | |
724 | dnl the old symlinks don't exist, so that a reconfigure in an existing | |
725 | dnl directory behaves reasonably. | |
726 | ||
48401fcf | 727 | AC_OUTPUT(Makefile doc/Makefile .gdbinit:gdbinit.in po/Makefile.in:po/Make-in, |
515c7142 ILT |
728 | [rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h |
729 | echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h | |
730 | echo '#include "obj-'"${obj_format}"'.h"' > obj-format.h | |
731 | echo '#include "te-'"${te_file}"'.h"' > targ-env.h | |
39ffbb4d DE |
732 | echo '#include "itbl-'"${target_cpu_type}"'.h"' > itbl-cpu.h |
733 | case ${target_cpu_type} in | |
352b0f4d | 734 | m32r | fr30) echo '#include "opcodes/'"${target_cpu_type}"'-opc.h"' > cgen-opc.h ;; |
48401fcf TT |
735 | esac |
736 | ||
737 | sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile], | |
515c7142 ILT |
738 | [target_cpu_type=${target_cpu_type} |
739 | obj_format=${obj_format} | |
740 | te_file=${te_file}]) |