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