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