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