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