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