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