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