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