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