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 |
833c46e1 | 7 | AC_PREREQ(2.3)dnl We only need 2.0, but pre-2.3 loses on some AIX version. |
28d3e4a3 | 8 | AC_INIT(as.h)dnl |
b11fb939 | 9 | dnl |
318b02b6 | 10 | user_bfd_gas= |
b11fb939 | 11 | AC_ARG_ENABLE(bfd-assembler, |
d7b2038f | 12 | [ --enable-bfd-assembler use BFD back end for writing object files], |
b11fb939 | 13 | [case "${enableval}" in |
318b02b6 KR |
14 | yes) need_bfd=yes user_bfd_gas=yes ;; |
15 | no) user_bfd_gas=no ;; | |
b11fb939 KR |
16 | *) AC_MSG_ERROR(bad value ${enableval} given for bfd-assembler option) ;; |
17 | esac])dnl | |
e7757ad0 KR |
18 | AC_ARG_ENABLE(targets, |
19 | [ targets alternative target configurations besides the primary], | |
20 | [case "${enableval}" in | |
21 | yes | "") AC_ERROR(enable-targets option must specify target names or 'all') | |
22 | ;; | |
23 | no) enable_targets= ;; | |
24 | *) enable_targets=$enableval ;; | |
25 | esac])dnl | |
b11fb939 KR |
26 | |
27 | # Generate a header file -- gets more post-processing by Makefile later. | |
28 | AC_CONFIG_HEADER(conf) | |
29 | ||
30 | dnl For recursion to work right, this must be an absolute pathname. | |
31 | AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..) | |
32 | AC_CANONICAL_SYSTEM | |
bf111c9f | 33 | AC_ARG_PROGRAM |
7cf4d7ff | 34 | |
e7757ad0 | 35 | te_file=generic |
b678740d | 36 | |
b11fb939 | 37 | # assign cpu type |
5f8a3788 | 38 | |
b53ccaac ILT |
39 | # check for architecture variants |
40 | case ${target_cpu} in | |
1cb0d00d | 41 | armeb) cpu_type=arm endian=big ;; |
a1c7c0f3 | 42 | arm*) cpu_type=arm endian=little ;; |
8cac6ca6 | 43 | hppa*) cpu_type=hppa ;; |
b11fb939 | 44 | changequote(,)dnl |
904b6037 | 45 | i[45]86) cpu_type=i386 ;; |
82489ea0 | 46 | m680[012346]0) cpu_type=m68k ;; |
8cac6ca6 KR |
47 | m68008) cpu_type=m68k ;; |
48 | m683??) cpu_type=m68k ;; | |
b11fb939 | 49 | changequote([,])dnl |
8cac6ca6 | 50 | m8*) cpu_type=m88k ;; |
5f8a3788 | 51 | mips*el) cpu_type=mips endian=little;; |
b11fb939 | 52 | mips*) cpu_type=mips endian=big ;; |
e7757ad0 KR |
53 | powerpcle*) cpu_type=ppc endian=little ;; |
54 | powerpc*) cpu_type=ppc endian=big ;; | |
1c11ab0e | 55 | rs6000*) cpu_type=ppc ;; |
6df07e7f DE |
56 | sparc64) cpu_type=sparc |
57 | AC_DEFINE(SPARC_V9) ;; | |
8cac6ca6 | 58 | sparclite*) cpu_type=sparc ;; |
7cf4d7ff | 59 | *) cpu_type=${target_cpu} ;; |
b53ccaac ILT |
60 | esac |
61 | ||
634233a3 KR |
62 | # do we need the opcodes library? |
63 | case ${cpu_type} in | |
64 | alpha | vax) | |
634233a3 KR |
65 | ;; |
66 | *) | |
b11fb939 | 67 | OPCODES_LIB="../opcodes/libopcodes.a" |
634233a3 KR |
68 | ;; |
69 | esac | |
b11fb939 | 70 | AC_SUBST(OPCODES_LIB) |
634233a3 | 71 | |
b53ccaac | 72 | gas_target=${cpu_type} |
e7757ad0 KR |
73 | this_target=${generic_target} |
74 | ||
75 | canon_targets="" | |
76 | if test -n "$enable_targets" ; then | |
77 | for t in `echo $enable_targets | sed 's/,/ /g'`; do | |
78 | result=`$ac_config_sub $t 2>/dev/null` | |
79 | if test -n "$result" ; then | |
80 | canon_targets="$canon_targets $result" | |
81 | # else | |
82 | # # Permit "all", etc. We don't support it yet though. | |
83 | # canon_targets="$canon_targets $t" | |
84 | fi | |
85 | done | |
86 | GAS_UNIQ(canon_targets) | |
87 | fi | |
88 | ||
89 | emulations="" | |
90 | ||
91 | for this_target in $target $canon_targets ; do | |
92 | ||
93 | eval `echo $this_target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/cpu=\1 vendor=\2 os=\3/'` | |
8cac6ca6 | 94 | |
e7757ad0 KR |
95 | # check for architecture variants |
96 | case ${cpu} in | |
97 | hppa*) cpu_type=hppa ;; | |
98 | changequote(,)dnl | |
99 | i[45]86) cpu_type=i386 ;; | |
100 | m680[012346]0) cpu_type=m68k ;; | |
101 | m68008) cpu_type=m68k ;; | |
102 | m683??) cpu_type=m68k ;; | |
103 | changequote([,])dnl | |
104 | m8*) cpu_type=m88k ;; | |
105 | mips*el) cpu_type=mips endian=little;; | |
106 | mips*) cpu_type=mips endian=big ;; | |
107 | powerpcle*) cpu_type=ppc endian=little ;; | |
108 | powerpc*) cpu_type=ppc endian=big ;; | |
109 | rs6000*) cpu_type=ppc ;; | |
6df07e7f | 110 | sparc64) cpu_type=sparc want_sparc_v9=true ;; |
e7757ad0 | 111 | sparclite*) cpu_type=sparc ;; |
a1c7c0f3 | 112 | *) cpu_type=${cpu} ;; |
e7757ad0 KR |
113 | esac |
114 | ||
115 | if test ${this_target} = $target ; then | |
116 | target_cpu_type=${cpu_type} | |
117 | elif test ${target_cpu_type} != ${cpu_type} ; then | |
118 | continue | |
119 | fi | |
120 | ||
121 | targ=${cpu_type} | |
122 | generic_target=${cpu_type}-$vendor-$os | |
123 | dev=no | |
124 | bfd_gas=no | |
125 | em=generic | |
7cf4d7ff | 126 | |
e7757ad0 KR |
127 | # assign object format |
128 | case ${generic_target} in | |
129 | a29k-amd-udi) fmt=coff targ=ebmon29k ;; | |
130 | a29k-amd-ebmon) fmt=coff targ=ebmon29k ;; | |
880b7429 | 131 | a29k-nyu-sym1) fmt=coff targ=ebmon29k ;; |
e7757ad0 KR |
132 | a29k-*-vxworks*) fmt=coff ;; |
133 | ||
134 | alpha-*-netware*) fmt=ecoff ;; | |
135 | alpha-*-osf*) fmt=ecoff ;; | |
d7b2038f | 136 | alpha-*-linux*) fmt=ecoff ;; |
816153a3 | 137 | |
4181c985 | 138 | # start-sanitize-arc |
e7757ad0 | 139 | arc-*-elf*) fmt=elf bfd_gas=yes ;; |
4181c985 KR |
140 | # end-sanitize-arc |
141 | ||
a1c7c0f3 | 142 | arm-*-riscix*) fmt=aout targ=arm-lit ;; |
1cb0d00d KR |
143 | arm-*-aout) fmt=aout |
144 | case "$endian" in | |
145 | big) targ=arm-big ;; | |
146 | *) targ=arm-lit ;; | |
147 | esac | |
148 | ;; | |
d7b2038f | 149 | arm-*-coff) fmt=coff ;; |
e7757ad0 | 150 | arm-*-riscix*) fmt=aout ;; |
1cb0d00d | 151 | arm-*-pe) fmt=coff targ=armcoff em=pe ;; |
e7757ad0 KR |
152 | |
153 | hppa-*-*elf*) fmt=elf em=hppa ;; | |
154 | hppa-*-lites*) fmt=elf em=hppa ;; | |
155 | hppa-*-osf*) fmt=som em=hppa ;; | |
156 | hppa-*-hpux*) fmt=som em=hppa ;; | |
157 | hppa-*-bsd*) fmt=som em=hppa ;; | |
158 | hppa-*-hiux*) fmt=som em=hppa ;; | |
159 | ||
160 | h8300-*-coff) fmt=coff ;; | |
161 | ||
162 | i386-ibm-aix*) fmt=coff targ=i386coff | |
163 | em=i386aix ;; | |
164 | i386-*-bsd*) fmt=aout em=386bsd ;; | |
165 | i386-*-netbsd0.8) fmt=aout em=386bsd ;; | |
166 | i386-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes;; | |
a1c7c0f3 | 167 | i386-*-linux*aout* | i386-*-linuxoldld) fmt=aout em=linux ;; |
e7757ad0 KR |
168 | i386-*-linux*coff*) fmt=coff em=linux |
169 | targ=i386coff ;; | |
170 | i386-*-linux*) fmt=elf em=linux ;; | |
171 | i386-*-lynxos*) fmt=coff targ=i386coff | |
172 | em=lynx ;; | |
173 | i386-*-sysv4* | i386-*-solaris* | i386-*-elf) | |
174 | fmt=elf ;; | |
175 | i386-*-coff | i386-*-sysv* | i386-*-sco* | i386-*-isc*) | |
176 | fmt=coff targ=i386coff ;; | |
177 | i386-*-vsta) fmt=aout ;; | |
178 | i386-*-go32) fmt=coff targ=i386coff ;; | |
6c186c48 SC |
179 | i386-*-gnu*) fmt=elf ;; |
180 | i386-*-mach*) | |
e7757ad0 KR |
181 | fmt=aout em=mach bfd_gas=yes ;; |
182 | i386-*-msdos*) fmt=aout ;; | |
6c186c48 | 183 | i386-*-moss*) fmt=elf ;; |
1cb0d00d | 184 | i386-*-pe) fmt=coff targ=i386coff em=pe ;; |
6c186c48 | 185 | i386-*-win32) fmt=coff targ=i386coff em=pe ;; |
1cb0d00d | 186 | i386-*-*nt) fmt=coff targ=i386coff em=pe ;; |
e7757ad0 KR |
187 | i960-*-bout) fmt=bout ;; |
188 | i960-*-coff) fmt=coff em=ic960 targ=ic960coff ;; | |
189 | i960-*-nindy*) fmt=bout ;; | |
190 | i960-*-vxworks4*) fmt=bout ;; | |
191 | i960-*-vxworks5.0) fmt=bout ;; | |
192 | i960-*-vxworks5.*) fmt=coff em=ic960 targ=ic960coff ;; | |
193 | i960-*-vxworks*) fmt=bout ;; | |
194 | ||
195 | m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*) | |
196 | fmt=aout em=sun3 ;; | |
880b7429 | 197 | m68k-motorola-sysv*) fmt=coff targ=m68kcoff em=delta ;; |
e7757ad0 KR |
198 | m68k-bull-sysv3*) fmt=coff targ=m68kcoff em=dpx2 ;; |
199 | m68k-apollo-*) fmt=coff targ=apollo em=apollo ;; | |
9d5aef80 KR |
200 | m68k-*-sysv4 | m68k-*-elf) # must be before -sysv* |
201 | fmt=elf ;; | |
e7757ad0 KR |
202 | m68k-*-coff | m68k-*-sysv*) |
203 | fmt=coff targ=m68kcoff ;; | |
e7757ad0 KR |
204 | m68k-*-hpux*) fmt=hp300 em=hp300 ;; |
205 | m68k-*-lynxos*) fmt=coff targ=m68kcoff | |
206 | em=lynx ;; | |
207 | m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;; | |
208 | ||
880b7429 | 209 | m88k-motorola-sysv3*) fmt=coff targ=m88kcoff em=delt88 ;; |
e7757ad0 KR |
210 | m88k-*-coff*) fmt=coff targ=m88kcoff ;; |
211 | ||
212 | # don't change em like *-*-bsd does | |
057a4d41 | 213 | mips-dec-netbsd*) fmt=elf targ=mips-lit endian=little ;; |
e7757ad0 KR |
214 | mips-dec-bsd*) fmt=aout targ=mips-lit ;; |
215 | mips-sony-bsd*) fmt=ecoff targ=mips-big ;; | |
216 | mips-*-bsd*) AC_MSG_ERROR(Unknown vendor for mips-bsd configuration.) ;; | |
70f4dbce | 217 | mips-*-ultrix*) fmt=ecoff targ=mips-lit endian=little ;; |
e7757ad0 KR |
218 | mips-*-ecoff*) fmt=ecoff |
219 | case "$endian" in | |
220 | big) targ=mips-big ;; | |
221 | *) targ=mips-lit ;; | |
222 | esac | |
223 | ;; | |
224 | mips-*-ecoff*) fmt=ecoff targ=mips-big ;; | |
225 | mips-*-gnu*) fmt=aout | |
226 | case "$endian" in | |
227 | big) targ=mips-big ;; | |
228 | *) targ=mips-lit ;; | |
229 | esac | |
230 | ;; | |
231 | mips-*-irix5*) fmt=elf targ=mips-big ;; | |
232 | mips-*-irix*) fmt=ecoff targ=mips-big ;; | |
233 | mips-*-riscos*) fmt=ecoff targ=mips-big ;; | |
234 | mips-*-sysv*) fmt=ecoff targ=mips-big ;; | |
235 | mips-*-elf*) fmt=elf | |
236 | case "$endian" in | |
237 | big) targ=mips-big ;; | |
238 | *) targ=mips-lit ;; | |
239 | esac | |
240 | ;; | |
85cc2190 KK |
241 | ppc-*-pe) fmt=coff em=pe |
242 | case "$endian" in | |
243 | big) targ=ppc-big ;; | |
244 | *) targ=ppc-lit ;; | |
245 | esac | |
246 | ;; | |
247 | ppc-*-winnt*) fmt=coff em=pe | |
248 | case "$endian" in | |
249 | big) targ=ppc-big ;; | |
250 | *) targ=ppc-lit ;; | |
251 | esac | |
252 | ;; | |
e7757ad0 KR |
253 | ppc-*-aix*) fmt=coff ;; |
254 | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*) | |
255 | fmt=elf | |
256 | case "$endian" in | |
257 | big) targ=ppc-big ;; | |
258 | *) targ=ppc-lit ;; | |
259 | esac | |
260 | ;; | |
880b7429 KR |
261 | ppc-*-macos* | ppc-*-mpw*) |
262 | fmt=coff em=macos ;; | |
e7757ad0 KR |
263 | ppc-*-netware*) fmt=elf em=ppcnw ;; |
264 | ||
265 | sh-*-coff) fmt=coff ;; | |
816153a3 | 266 | |
03c4ce2f | 267 | # start-sanitize-rce |
e7757ad0 | 268 | rce-*-aout) fmt=aout ;; |
03c4ce2f | 269 | # end-sanitize-rce |
d94aca1a | 270 | |
5f757edc ILT |
271 | ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;; |
272 | ns32k-pc532-netbsd* | ns32k-pc532-lites*) fmt=aout em=nbsd532 ;; | |
e7757ad0 KR |
273 | |
274 | sparc-*-sunos4*) fmt=aout em=sun3 ;; | |
275 | sparc-*-aout | sparc*-*-vxworks) | |
276 | fmt=aout ;; | |
277 | sparc-*-coff) fmt=coff ;; | |
278 | sparc-*-lynxos*) fmt=coff em=lynx ;; | |
279 | sparc-fujitsu-none) fmt=aout ;; | |
280 | sparc-*-elf | sparc*-*-solaris*) | |
281 | fmt=elf ;; | |
282 | sparc-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;; | |
283 | ||
284 | vax-*-bsd* | vax-*-ultrix*) | |
285 | fmt=aout ;; | |
286 | vax-*-vms) fmt=vms ;; | |
287 | ||
288 | z8k-*-coff | z8k-*-sim) | |
289 | fmt=coff ;; | |
290 | ||
291 | w65-*-*) fmt=coff ;; | |
292 | ||
293 | *-*-aout | *-*-scout) | |
294 | fmt=aout ;; | |
295 | *-*-nindy*) | |
296 | fmt=bout ;; | |
297 | *-*-bsd*) | |
298 | fmt=aout em=sun3 ;; | |
299 | *-*-generic) fmt=generic ;; | |
300 | *-*-xray | *-*-hms) fmt=coff ;; | |
301 | *-*-sim) fmt=coff ;; | |
302 | *-*-elf | *-*-sysv4* | *-*-solaris*) | |
6df07e7f | 303 | AC_MSG_WARN(GAS support for ${generic_target} is incomplete.) |
e7757ad0 KR |
304 | fmt=elf dev=yes ;; |
305 | *-*-vxworks) fmt=aout ;; | |
306 | *-*-netware) fmt=elf ;; | |
307 | esac | |
308 | ||
309 | case ${cpu_type}-${fmt} in | |
310 | arm-*) bfd_gas=yes ;; | |
311 | # not yet | |
312 | # i386-aout) bfd_gas=preferred ;; | |
313 | mips-*) bfd_gas=yes ;; | |
314 | ns32k-*) bfd_gas=yes ;; | |
315 | ppc-*) bfd_gas=yes ;; | |
316 | sparc-*) bfd_gas=yes ;; | |
317 | *-elf) bfd_gas=yes ;; | |
318 | *-ecoff) bfd_gas=yes ;; | |
319 | *-som) bfd_gas=yes ;; | |
320 | *) ;; | |
321 | esac | |
322 | ||
5f757edc ILT |
323 | # Other random stuff. |
324 | ||
6df07e7f DE |
325 | test -n "$want_sparc_v9" && AC_DEFINE(SPARC_V9) |
326 | ||
327 | case ${cpu}-${vendor}-${os} in | |
328 | sparc64-*-elf*) AC_DEFINE(SPARC_ARCH64) ;; | |
329 | esac | |
5f757edc ILT |
330 | |
331 | case ${cpu_type} in | |
332 | m68k) extra_objects="$extra_objects m68k-parse.o" ;; | |
333 | esac | |
334 | ||
e7757ad0 KR |
335 | # See if we really can support this configuration with the emulation code. |
336 | ||
337 | if test $this_target = $target ; then | |
338 | primary_bfd_gas=$bfd_gas | |
339 | obj_format=$fmt | |
340 | gas_target=$targ | |
341 | te_file=$em | |
342 | ||
343 | if test $bfd_gas = no ; then | |
344 | # Can't support other configurations this way. | |
345 | break | |
346 | fi | |
347 | elif test $bfd_gas = no ; then | |
348 | # Can't support this configuration. | |
349 | break | |
350 | fi | |
351 | ||
352 | # From target name and format, produce a list of supported emulations. | |
353 | ||
354 | case ${generic_target}-${fmt} in | |
1cb0d00d | 355 | mips-*-irix5*-*) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;; |
e7757ad0 | 356 | mips-*-*-ecoff) case "$endian" in |
1cb0d00d KR |
357 | big) emulation="mipsbecoff mipslecoff mipsecoff" ;; |
358 | *) emulation="mipslecoff mipsbecoff mipsecoff" ;; | |
e7757ad0 KR |
359 | esac ;; |
360 | mips-*-*-elf) case "$endian" in | |
1cb0d00d KR |
361 | big) emulation="mipsbelf mipslelf mipself" ;; |
362 | *) emulation="mipslelf mipsbelf mipself" ;; | |
e7757ad0 KR |
363 | esac ;; |
364 | esac | |
365 | ||
366 | emulations="$emulations $emulation" | |
367 | ||
e7757ad0 | 368 | done |
fecd2382 | 369 | |
8cac6ca6 KR |
370 | # Assign floating point type. Most processors with FP support |
371 | # IEEE FP. On those that don't support FP at all, usually IEEE | |
372 | # is emulated. | |
b678740d | 373 | case ${target_cpu} in |
904b6037 | 374 | vax | tahoe ) atof=${target_cpu} ;; |
e7757ad0 | 375 | *) atof=ieee ;; |
fecd2382 RP |
376 | esac |
377 | ||
8cac6ca6 | 378 | case "${obj_format}" in |
b11fb939 | 379 | "") AC_MSG_ERROR(GAS does not know what format to use for target ${target}) ;; |
8cac6ca6 | 380 | esac |
7cf4d7ff | 381 | |
b11fb939 KR |
382 | dnl |
383 | dnl Make sure the desired support files exist. | |
384 | dnl | |
385 | ||
bf4bd1fc ILT |
386 | if test ! -r ${srcdir}/config/tc-${target_cpu_type}.c; then |
387 | AC_MSG_ERROR(GAS does not support target CPU ${target_cpu_type}) | |
b11fb939 KR |
388 | fi |
389 | ||
fb589130 | 390 | if test ! -r ${srcdir}/config/obj-${obj_format}.c; then |
b11fb939 | 391 | AC_MSG_ERROR(GAS does not have support for object file format ${obj_format}) |
7cf4d7ff KR |
392 | fi |
393 | ||
8a24a37c SC |
394 | # and target makefile frag |
395 | ||
b11fb939 | 396 | target_frag=${srcdir}/config/${gas_target}.mt |
f2889110 KR |
397 | if test ! -r ${target_frag}; then |
398 | target_frag=/dev/null # ick! but subst_file can't be conditionalized | |
399 | fi | |
b11fb939 | 400 | AC_SUBST_FILE(target_frag) |
8a24a37c | 401 | |
e7757ad0 | 402 | case ${user_bfd_gas}-${primary_bfd_gas} in |
a8285504 | 403 | yes-yes | no-no) |
7cf4d7ff KR |
404 | # We didn't override user's choice. |
405 | ;; | |
a8285504 | 406 | no-yes) |
b11fb939 | 407 | AC_MSG_WARN(Use of BFD is required for ${target}; overriding config options.) |
7cf4d7ff | 408 | ;; |
a8285504 | 409 | no-preferred) |
e7757ad0 | 410 | primary_bfd_gas=no |
a8285504 DZ |
411 | ;; |
412 | *-preferred) | |
e7757ad0 | 413 | primary_bfd_gas=yes |
a8285504 | 414 | ;; |
f2889110 | 415 | yes-*) |
e7757ad0 | 416 | primary_bfd_gas=yes |
f2889110 | 417 | ;; |
a8285504 DZ |
418 | -*) |
419 | # User specified nothing. | |
420 | ;; | |
7cf4d7ff KR |
421 | esac |
422 | ||
e7757ad0 KR |
423 | # Some COFF configurations want these random other flags set. |
424 | case ${obj_format} in | |
425 | coff) | |
426 | case ${target_cpu_type} in | |
427 | i386) AC_DEFINE(I386COFF) ;; | |
428 | m68k) AC_DEFINE(M68KCOFF) ;; | |
429 | m88k) AC_DEFINE(M88KCOFF) ;; | |
430 | esac | |
431 | ;; | |
432 | esac | |
433 | ||
434 | # Getting this done right is going to be a bitch. Each configuration specified | |
435 | # with --enable-targets=... should be checked for environment, format, cpu, and | |
436 | # bfd_gas setting. | |
437 | # | |
438 | # For each configuration, the necessary object file support code must be linked | |
439 | # in. This might be only one, it might be up to four. The necessary emulation | |
440 | # code needs to be provided, too. | |
441 | # | |
442 | # And then there's "--enable-targets=all".... | |
443 | # | |
444 | # For now, just always do it for MIPS ELF or ECOFF configurations. Sigh. | |
445 | ||
446 | formats="${obj_format}" | |
447 | emfiles="" | |
448 | EMULATIONS="" | |
449 | GAS_UNIQ(emulations) | |
450 | for em in . $emulations ; do | |
451 | case $em in | |
452 | .) continue ;; | |
453 | mipsbelf | mipslelf) | |
454 | fmt=elf file=mipself ;; | |
455 | mipsbecoff | mipslecoff) | |
456 | fmt=ecoff file=mipsecoff ;; | |
457 | esac | |
458 | formats="$formats $fmt" | |
459 | emfiles="$emfiles e-$file.o" | |
460 | EMULATIONS="$EMULATIONS &$em," | |
461 | done | |
462 | GAS_UNIQ(formats) | |
463 | GAS_UNIQ(emfiles) | |
464 | if test `set . $formats ; shift ; echo $#` -gt 1 ; then | |
465 | for fmt in $formats ; do | |
466 | case $fmt in | |
467 | aout) AC_DEFINE(OBJ_MAYBE_AOUT) ;; | |
468 | bout) AC_DEFINE(OBJ_MAYBE_BOUT) ;; | |
469 | coff) AC_DEFINE(OBJ_MAYBE_COFF) ;; | |
470 | ecoff) AC_DEFINE(OBJ_MAYBE_ECOFF) ;; | |
471 | elf) AC_DEFINE(OBJ_MAYBE_ELF) ;; | |
472 | generic) AC_DEFINE(OBJ_MAYBE_GENERIC) ;; | |
473 | hp300) AC_DEFINE(OBJ_MAYBE_HP300) ;; | |
474 | ieee) AC_DEFINE(OBJ_MAYBE_IEEE) ;; | |
475 | som) AC_DEFINE(OBJ_MAYBE_SOM) ;; | |
476 | vms) AC_DEFINE(OBJ_MAYBE_VMS) ;; | |
477 | esac | |
478 | extra_objects="$extra_objects obj-$fmt.o" | |
479 | done | |
480 | obj_format=multi | |
481 | fi | |
482 | if test `set . $emfiles ; shift ; echo $#` -gt 0 ; then | |
483 | te_file=multi | |
484 | extra_objects="$extra_objects $emfiles" | |
485 | DEFAULT_EMULATION=`set . $emulations ; echo $2` | |
486 | AC_DEFINE(USE_EMULATIONS) | |
487 | fi | |
488 | AC_SUBST(extra_objects) | |
489 | AC_DEFINE_UNQUOTED(EMULATIONS, $EMULATIONS) | |
490 | AC_DEFINE_UNQUOTED(DEFAULT_EMULATION, "$DEFAULT_EMULATION") | |
491 | ||
bf4bd1fc | 492 | files="config/tc-${target_cpu_type}.c config/tc-${target_cpu_type}.h \ |
e7757ad0 KR |
493 | config/obj-${obj_format}.h config/obj-${obj_format}.c \ |
494 | config/te-${te_file}.h config/atof-${atof}.c \ | |
495 | $extra_files" | |
496 | links="targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c \ | |
497 | $extra_links" | |
498 | ||
bf4bd1fc | 499 | case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in |
318b02b6 KR |
500 | yes-*-coff) need_bfd=yes ;; |
501 | no-*-coff) need_bfd=yes | |
502 | AC_DEFINE(MANY_SEGMENTS) ;; | |
503 | esac | |
504 | ||
69ecc03f | 505 | reject_dev_configs=yes |
8cac6ca6 KR |
506 | |
507 | case ${reject_dev_configs}-${dev} in | |
508 | yes-yes) # Oops. | |
b11fb939 | 509 | AC_MSG_ERROR(GAS does not support the ${generic_target} configuration.) |
8cac6ca6 KR |
510 | ;; |
511 | esac | |
512 | ||
bf4bd1fc | 513 | AC_SUBST(target_cpu_type) |
833c46e1 KR |
514 | AC_SUBST(obj_format) |
515 | AC_SUBST(atof) | |
e7757ad0 | 516 | dnl AC_SUBST(emulation) |
833c46e1 | 517 | |
e7757ad0 | 518 | AC_LINK_FILES($files, $links) |
8b228fe9 | 519 | |
e7757ad0 | 520 | case "${primary_bfd_gas}" in |
b11fb939 KR |
521 | yes) AC_DEFINE(BFD_ASSEMBLER) |
522 | need_bfd=yes ;; | |
4f6f4aa8 KR |
523 | esac |
524 | ||
b11fb939 KR |
525 | case "${need_bfd}" in |
526 | yes) BFDLIB=../bfd/libbfd.a | |
527 | ALL_OBJ_DEPS="$ALL_OBJ_DEPS ../bfd/bfd.h" | |
c92d9ee9 | 528 | ;; |
4f6f4aa8 | 529 | esac |
b11fb939 KR |
530 | AC_SUBST(BFDLIB) |
531 | AC_SUBST(ALL_OBJ_DEPS) | |
4f6f4aa8 | 532 | |
b11fb939 KR |
533 | AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}") |
534 | AC_DEFINE_UNQUOTED(TARGET_CANONICAL, "${target}") | |
535 | AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}") | |
536 | AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}") | |
537 | AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}") | |
538 | ||
b11fb939 KR |
539 | AC_PROG_CC |
540 | AC_PROG_INSTALL | |
541 | ||
b11fb939 KR |
542 | AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h) |
543 | ||
bf111c9f KR |
544 | # Put this here so that autoconf's "cross-compiling" message doesn't confuse |
545 | # people who are not cross-compiling but are compiling cross-assemblers. | |
546 | AC_MSG_CHECKING(whether compiling a cross-assembler) | |
547 | if test "${host}" = "${target}"; then | |
f2889110 KR |
548 | cross_gas=no |
549 | else | |
bf111c9f KR |
550 | cross_gas=yes |
551 | AC_DEFINE(CROSS_COMPILE) | |
bf111c9f KR |
552 | fi |
553 | AC_MSG_RESULT($cross_gas) | |
554 | ||
b11fb939 KR |
555 | dnl ansidecl.h will deal with const |
556 | dnl AC_CONST | |
557 | AC_FUNC_ALLOCA | |
558 | AC_C_INLINE | |
559 | ||
f2889110 KR |
560 | # VMS doesn't have unlink. |
561 | AC_CHECK_FUNCS(unlink remove, break) | |
28d3e4a3 | 562 | |
e63c594d FF |
563 | # Some systems don't have sbrk(). |
564 | AC_CHECK_FUNCS(sbrk) | |
565 | ||
b11fb939 KR |
566 | # Some non-ANSI preprocessors botch requoting inside strings. That's bad |
567 | # enough, but on some of those systems, the assert macro relies on requoting | |
568 | # working properly! | |
bf111c9f | 569 | GAS_WORKING_ASSERT |
b11fb939 KR |
570 | |
571 | # On some systems, the system header files may not declare malloc, realloc, | |
572 | # and free. There are places where gas needs these functions to have been | |
573 | # declared -- such as when taking their addresses. | |
bf111c9f | 574 | gas_test_headers=" |
b11fb939 KR |
575 | #ifdef HAVE_MEMORY_H |
576 | #include <memory.h> | |
577 | #endif | |
578 | #ifdef HAVE_STRING_H | |
579 | #include <string.h> | |
580 | #endif | |
581 | #ifdef HAVE_STDLIB_H | |
582 | #include <stdlib.h> | |
583 | #endif | |
584 | #ifdef HAVE_UNISTD_H | |
585 | #include <unistd.h> | |
586 | #endif | |
bf111c9f KR |
587 | " |
588 | GAS_CHECK_DECL_NEEDED(malloc, f, char *(*f)(), $gas_test_headers) | |
5f757edc | 589 | GAS_CHECK_DECL_NEEDED(free, f, void (*f)(), $gas_test_headers) |
b11fb939 KR |
590 | |
591 | # Does errno.h declare errno, or do we have to add a separate declaration | |
592 | # for it? | |
bf111c9f | 593 | GAS_CHECK_DECL_NEEDED(errno, f, int f, [ |
b11fb939 KR |
594 | #ifdef HAVE_ERRNO_H |
595 | #include <errno.h> | |
596 | #endif | |
bf111c9f | 597 | ]) |
b11fb939 | 598 | |
b11fb939 | 599 | dnl This must come last. |
28d3e4a3 | 600 | AC_OUTPUT(Makefile doc/Makefile .gdbinit:gdbinit.in) |