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