* config/tc-mips.c (mips_ip, case 'i' and 'j'): Mask off high bits
[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 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 changequote([,])dnl
81 m68008) cpu_type=m68k ;;
82 m683??) cpu_type=m68k ;;
83 m5200) cpu_type=m68k ;;
84 m8*) cpu_type=m88k ;;
85 mips*el) cpu_type=mips endian=little ;;
86 # start-sanitize-r5900
87 mips*5900*) cpu_type=mips endian=little ;;
88 # end-sanitize-r5900
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 ;;
93 sparclite*) cpu_type=sparc arch=sparclite ;;
94 sparclet*) cpu_type=sparc arch=sparclet ;;
95 sparc64*) cpu_type=sparc arch=v9-64 ;;
96 sparc86x*) cpu_type=sparc arch=sparc86x ;;
97 sparc*) cpu_type=sparc arch=sparclite ;; # ??? See tc-sparc.c.
98 v850*) cpu_type=v850 ;;
99 *) cpu_type=${cpu} ;;
100 esac
101
102 if test ${this_target} = $target ; then
103 target_cpu_type=${cpu_type}
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
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-*-riscix*) fmt=aout ;;
140 arm-*-pe | thumb-*-pe) fmt=coff em=pe ;;
141
142 d10v-*-*) fmt=elf bfd_gas=yes ;;
143 # start-sanitize-d30v
144 d30v-*-*) fmt=elf bfd_gas=yes ;;
145 # end-sanitize-d30v
146
147 hppa-*-*elf*) fmt=elf em=hppa ;;
148 hppa-*-lites*) fmt=elf em=hppa ;;
149 hppa-*-osf*) fmt=som em=hppa ;;
150 hppa-*-rtems*) fmt=elf em=hppa ;;
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
157 i386-ibm-aix*) fmt=coff em=i386aix ;;
158 i386-sequent-bsd*) fmt=aout em=dynix bfd_gas=yes ;;
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;;
162 i386-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes;;
163 i386-*-linux*aout* | i386-*-linuxoldld) fmt=aout em=linux ;;
164 i386-*-linux*coff*) fmt=coff em=linux ;;
165 i386-*-linux-gnu*) fmt=elf em=linux ;;
166 i386-*-lynxos*) fmt=coff em=lynx ;;
167 i386-*-sysv4* | i386-*-solaris* | i386-*-elf)
168 fmt=elf ;;
169 i386-*-freebsdelf*) fmt=elf ;;
170 i386-*-freebsd*) fmt=aout em=386bsd ;;
171 i386-*-coff | i386-*-sysv* | i386-*-sco3.2v5*coff | i386-*-isc*)
172 fmt=coff ;;
173 i386-*-sco3.2v5*) fmt=elf
174 if test ${this_target} = $target; then
175 AC_DEFINE(SCO_ELF)
176 fi
177 ;;
178 i386-*-sco3.2*) fmt=coff ;;
179 i386-*-vsta) fmt=aout ;;
180 i386-*-msdosdjgpp* | i386-*-go32* | i386-go32-rtems*)
181 fmt=coff em=go32;;
182 i386-*-rtems*) fmt=coff ;;
183 i386-*-gnu*) fmt=elf ;;
184 i386-*-mach*)
185 fmt=aout em=mach bfd_gas=yes ;;
186 i386-*-msdos*) fmt=aout ;;
187 i386-*-moss*) fmt=elf ;;
188 i386-*-pe) fmt=coff em=pe ;;
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 ;;
192 i960-*-bout) fmt=bout ;;
193 i960-*-coff) fmt=coff em=ic960 ;;
194 i960-*-rtems*) fmt=coff em=ic960 ;;
195 i960-*-nindy*) fmt=bout ;;
196 i960-*-vxworks4*) fmt=bout ;;
197 i960-*-vxworks5.0) fmt=bout ;;
198 i960-*-vxworks5.*) fmt=coff em=ic960 ;;
199 i960-*-vxworks*) fmt=bout ;;
200
201 m32r-*-*) fmt=elf bfd_gas=yes ;;
202
203 m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
204 fmt=aout em=sun3 ;;
205 m68k-motorola-sysv*) fmt=coff em=delta ;;
206 m68k-bull-sysv3*) fmt=coff em=dpx2 ;;
207 m68k-apollo-*) fmt=coff em=apollo ;;
208 m68k-*-sysv4*) # must be before -sysv*
209 fmt=elf em=svr4 ;;
210 m68k-*-elf*) fmt=elf ;;
211 m68k-*-coff | m68k-*-sysv* | m68k-*-rtems*)
212 fmt=coff ;;
213 m68k-*-hpux*) fmt=hp300 em=hp300 ;;
214 m68k-*-linux*aout*) fmt=aout em=linux ;;
215 m68k-*-linux-gnu*) fmt=elf em=linux ;;
216 m68k-*-lynxos*) fmt=coff em=lynx ;;
217 m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
218 m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
219 m68k-apple-aux*) fmt=coff em=aux ;;
220 m68k-*-psos*) fmt=elf em=psos;;
221
222 m88k-motorola-sysv3*) fmt=coff em=delt88 ;;
223 m88k-*-coff*) fmt=coff ;;
224
225 # don't change em like *-*-bsd does
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 ;;
230 mips-*-bsd*) AC_MSG_ERROR(Unknown vendor for mips-bsd configuration.) ;;
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 ;;
241 mips-*-elf* | mips-*-rtems* | mips-*-linux-gnu* | mips-*-gnu* | mips-*-openbsd*)
242 fmt=elf ;;
243 mn10200-*-*) fmt=elf bfd_gas=yes ;;
244 mn10300-*-*) fmt=elf bfd_gas=yes ;;
245 ppc-*-pe | ppc-*-cygwin32 | ppc-*-winnt*)
246 fmt=coff em=pe ;;
247 ppc-*-aix*) fmt=coff ;;
248 ppc-*-beos*) fmt=coff ;;
249 ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*)
250 fmt=elf ;;
251 ppc-*-linux-gnu*) fmt=elf
252 case "$endian" in
253 big) ;;
254 *) AC_MSG_ERROR(GNU/Linux must be configured big endian) ;;
255 esac
256 ;;
257 ppc-*-solaris*) fmt=elf
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
264 ;;
265 ppc-*-rtems*) fmt=elf ;;
266 ppc-*-macos* | ppc-*-mpw*)
267 fmt=coff em=macos ;;
268 ppc-*-netware*) fmt=elf em=ppcnw ;;
269
270 sh-*-elf*) fmt=elf ;;
271 sh-*-coff*) fmt=coff ;;
272 sh-*-rtems*) fmt=coff ;;
273
274 ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;;
275 ns32k-pc532-netbsd* | ns32k-pc532-lites*) fmt=aout em=nbsd532 ;;
276 ns32k-pc532-openbsd*) fmt=aout em=nbsd532 ;;
277
278 sparc-*-rtems*) fmt=aout ;;
279 sparc-*-sunos4*) fmt=aout em=sun3 ;;
280 sparc-*-aout | sparc*-*-vxworks*)
281 fmt=aout em=sparcaout ;;
282 sparc-*-coff) fmt=coff ;;
283 sparc-*-linux*aout*) fmt=aout em=linux ;;
284 sparc-*-linux-gnu*) fmt=elf em=linux ;;
285 sparc-*-lynxos*) fmt=coff em=lynx ;;
286 sparc-fujitsu-none) fmt=aout ;;
287 sparc-*-elf | sparc-*-sysv4* | sparc-*-solaris*)
288 fmt=elf ;;
289 sparc-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
290 sparc-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
291
292 tic30-*-*aout*) fmt=aout bfd_gas=yes ;;
293 tic30-*-*coff*) fmt=coff bfd_gas=yes ;;
294 # start-sanitize-tic80
295 tic80-*-*) fmt=coff ;;
296 # end-sanitize-tic80
297
298 # start-sanitize-sky
299 dvp-*-*) fmt=elf bfd_gas=yes ;;
300 # end-sanitize-sky
301
302 v850-*-*) fmt=elf bfd_gas=yes ;;
303
304 # start-sanitize-v850e
305 v850e-*-*) fmt=elf bfd_gas=yes ;;
306 v850ea-*-*) fmt=elf bfd_gas=yes ;;
307 # end-sanitize-v850e
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*)
327 AC_MSG_WARN(GAS support for ${generic_target} is incomplete.)
328 fmt=elf dev=yes ;;
329 *-*-vxworks) fmt=aout ;;
330 *-*-netware) fmt=elf ;;
331 esac
332
333 case ${cpu_type}-${fmt} in
334 alpha*-*) bfd_gas=yes ;;
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
348 # Other random stuff.
349
350 # do we need the opcodes library?
351 case ${cpu_type} in
352 vax | i386 | tic30)
353 ;;
354 *)
355 need_opcodes=yes
356
357 case "${enable_shared}" in
358 yes) shared_opcodes=true ;;
359 *opcodes*) shared_opcodes=true ;;
360 *) shared_opcodes=false ;;
361 esac
362 if test "${shared_opcodes}" = "true"; then
363 # A shared libopcodes must be linked against libbfd.
364 need_bfd=yes
365 fi
366 ;;
367 esac
368
369 case ${cpu_type} in
370 m32r)
371 case "x${extra_objects}" in
372 *cgen.o*) ;;
373 *) extra_objects="$extra_objects cgen.o"
374 AC_DEFINE(USING_CGEN)
375 ;;
376 esac
377 ;;
378
379 m68k)
380 case ${extra_objects} in
381 *m68k-parse.o*) ;;
382 *) extra_objects="$extra_objects m68k-parse.o" ;;
383 esac
384 ;;
385
386 mips)
387 echo ${extra_objects} | grep -s "itbl-parse.o"
388 if test $? -ne 0 ; then
389 extra_objects="$extra_objects itbl-parse.o"
390 fi
391
392 echo ${extra_objects} | grep -s "itbl-lex.o"
393 if test $? -ne 0 ; then
394 extra_objects="$extra_objects itbl-lex.o"
395 fi
396
397 echo ${extra_objects} | grep -s "itbl-ops.o"
398 if test $? -ne 0 ; then
399 extra_objects="$extra_objects itbl-ops.o"
400 fi
401 ;;
402
403 sparc)
404 if test $this_target = $target ; then
405 AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}")
406 fi
407 ;;
408
409 *)
410 ;;
411 esac
412
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
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
432 mips-*-irix5*-*) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
433 mips-*-linux-gnu*-*) case "$endian" in
434 big) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
435 *) emulation="mipslelf mipsbelf mipself mipslecoff mipsbecoff mipsecoff" ;;
436 esac ;;
437 mips-*-lnews*-ecoff) ;;
438 mips-*-*-ecoff) case "$endian" in
439 big) emulation="mipsbecoff mipslecoff mipsecoff" ;;
440 *) emulation="mipslecoff mipsbecoff mipsecoff" ;;
441 esac ;;
442 mips-*-*-elf) case "$endian" in
443 big) emulation="mipsbelf mipslelf mipself" ;;
444 *) emulation="mipslelf mipsbelf mipself" ;;
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" ;;
449 esac ;;
450 esac
451
452 emulations="$emulations $emulation"
453
454 done
455
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.
459 case ${target_cpu} in
460 vax | tahoe ) atof=${target_cpu} ;;
461 *) atof=ieee ;;
462 esac
463
464 case "${obj_format}" in
465 "") AC_MSG_ERROR(GAS does not know what format to use for target ${target}) ;;
466 esac
467
468 # Unfortunately the cpu in cpu-opc.h file isn't always $(TARGET_CPU).
469 cgen_cpu_prefix=""
470 case "x${extra_objects}" in
471 *cgen.o*)
472 case ${target_cpu} in
473 *) cgen_cpu_prefix=${target_cpu} ;;
474 esac
475 ;;
476 esac
477 AC_SUBST(cgen_cpu_prefix)
478
479 dnl
480 dnl Make sure the desired support files exist.
481 dnl
482
483 if test ! -r ${srcdir}/config/tc-${target_cpu_type}.c; then
484 AC_MSG_ERROR(GAS does not support target CPU ${target_cpu_type})
485 fi
486
487 if test ! -r ${srcdir}/config/obj-${obj_format}.c; then
488 AC_MSG_ERROR(GAS does not have support for object file format ${obj_format})
489 fi
490
491 case ${user_bfd_gas}-${primary_bfd_gas} in
492 yes-yes | no-no)
493 # We didn't override user's choice.
494 ;;
495 no-yes)
496 AC_MSG_WARN(Use of BFD is required for ${target}; overriding config options.)
497 ;;
498 no-preferred)
499 primary_bfd_gas=no
500 ;;
501 *-preferred)
502 primary_bfd_gas=yes
503 ;;
504 yes-*)
505 primary_bfd_gas=yes
506 ;;
507 -*)
508 # User specified nothing.
509 ;;
510 esac
511
512 # Some COFF configurations want these random other flags set.
513 case ${obj_format} in
514 coff)
515 case ${target_cpu_type} in
516 i386) AC_DEFINE(I386COFF) ;;
517 m68k) AC_DEFINE(M68KCOFF) ;;
518 m88k) AC_DEFINE(M88KCOFF) ;;
519 esac
520 ;;
521 esac
522
523 # Getting this done right is going to be a bitch. Each configuration specified
524 # with --enable-targets=... should be checked for environment, format, cpu, and
525 # bfd_gas setting.
526 #
527 # For each configuration, the necessary object file support code must be linked
528 # in. This might be only one, it might be up to four. The necessary emulation
529 # code needs to be provided, too.
530 #
531 # And then there's "--enable-targets=all"....
532 #
533 # For now, just always do it for MIPS ELF or ECOFF configurations. Sigh.
534
535 formats="${obj_format}"
536 emfiles=""
537 EMULATIONS=""
538 GAS_UNIQ(emulations)
539 for em in . $emulations ; do
540 case $em in
541 .) continue ;;
542 mipsbelf | mipslelf)
543 fmt=elf file=mipself ;;
544 mipsbecoff | mipslecoff)
545 fmt=ecoff file=mipsecoff ;;
546 i386coff)
547 fmt=coff file=i386coff ;;
548 i386elf)
549 fmt=elf file=i386elf ;;
550 esac
551 formats="$formats $fmt"
552 emfiles="$emfiles e-$file.o"
553 EMULATIONS="$EMULATIONS &$em,"
554 done
555 GAS_UNIQ(formats)
556 GAS_UNIQ(emfiles)
557 if test `set . $formats ; shift ; echo $#` -gt 1 ; then
558 for fmt in $formats ; do
559 case $fmt in
560 aout) AC_DEFINE(OBJ_MAYBE_AOUT) ;;
561 bout) AC_DEFINE(OBJ_MAYBE_BOUT) ;;
562 coff) AC_DEFINE(OBJ_MAYBE_COFF) ;;
563 ecoff) AC_DEFINE(OBJ_MAYBE_ECOFF) ;;
564 elf) AC_DEFINE(OBJ_MAYBE_ELF) ;;
565 generic) AC_DEFINE(OBJ_MAYBE_GENERIC) ;;
566 hp300) AC_DEFINE(OBJ_MAYBE_HP300) ;;
567 ieee) AC_DEFINE(OBJ_MAYBE_IEEE) ;;
568 som) AC_DEFINE(OBJ_MAYBE_SOM) ;;
569 vms) AC_DEFINE(OBJ_MAYBE_VMS) ;;
570 esac
571 extra_objects="$extra_objects obj-$fmt.o"
572 done
573 obj_format=multi
574 fi
575 if test `set . $emfiles ; shift ; echo $#` -gt 0 ; then
576 te_file=multi
577 extra_objects="$extra_objects $emfiles"
578 DEFAULT_EMULATION=`set . $emulations ; echo $2`
579 AC_DEFINE(USE_EMULATIONS)
580 fi
581 AC_SUBST(extra_objects)
582 AC_DEFINE_UNQUOTED(EMULATIONS, $EMULATIONS)
583 AC_DEFINE_UNQUOTED(DEFAULT_EMULATION, "$DEFAULT_EMULATION")
584
585 case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in
586 yes-*-coff) need_bfd=yes ;;
587 no-*-coff) need_bfd=yes
588 AC_DEFINE(MANY_SEGMENTS) ;;
589 esac
590
591 reject_dev_configs=yes
592
593 case ${reject_dev_configs}-${dev} in
594 yes-yes) # Oops.
595 AC_MSG_ERROR(GAS does not support the ${generic_target} configuration.)
596 ;;
597 esac
598
599 AC_SUBST(target_cpu_type)
600 AC_SUBST(obj_format)
601 AC_SUBST(te_file)
602 AC_SUBST(atof)
603 dnl AC_SUBST(emulation)
604
605 case "${primary_bfd_gas}" in
606 yes) AC_DEFINE(BFD_ASSEMBLER)
607 need_bfd=yes ;;
608 esac
609
610 # do we need the opcodes library?
611 case "${need_opcodes}" in
612 yes)
613 OPCODES_LIB=../opcodes/libopcodes.la
614 ;;
615 esac
616
617 case "${need_bfd}" in
618 yes)
619 BFDLIB=../bfd/libbfd.la
620 ALL_OBJ_DEPS="$ALL_OBJ_DEPS ../bfd/bfd.h"
621 ;;
622 esac
623
624 AC_SUBST(BFDLIB)
625 AC_SUBST(OPCODES_LIB)
626
627 AC_SUBST(ALL_OBJ_DEPS)
628
629 AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}")
630 AC_DEFINE_UNQUOTED(TARGET_CANONICAL, "${target}")
631 AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}")
632 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}")
633 AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}")
634
635 AC_PROG_CC
636
637 AC_PROG_YACC
638 AM_PROG_LEX
639
640 ALL_LINGUAS=
641 CY_GNU_GETTEXT
642
643 AM_MAINTAINER_MODE
644 AM_CYGWIN32
645 AM_EXEEXT
646
647 AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h)
648
649 # Put this here so that autoconf's "cross-compiling" message doesn't confuse
650 # people who are not cross-compiling but are compiling cross-assemblers.
651 AC_MSG_CHECKING(whether compiling a cross-assembler)
652 if test "${host}" = "${target}"; then
653 cross_gas=no
654 else
655 cross_gas=yes
656 AC_DEFINE(CROSS_COMPILE)
657 fi
658 AC_MSG_RESULT($cross_gas)
659
660 dnl ansidecl.h will deal with const
661 dnl AC_CONST
662 AC_FUNC_ALLOCA
663 AC_C_INLINE
664
665 # VMS doesn't have unlink.
666 AC_CHECK_FUNCS(unlink remove, break)
667
668 # Some systems don't have sbrk().
669 AC_CHECK_FUNCS(sbrk)
670
671 # Some non-ANSI preprocessors botch requoting inside strings. That's bad
672 # enough, but on some of those systems, the assert macro relies on requoting
673 # working properly!
674 GAS_WORKING_ASSERT
675
676 # On some systems, the system header files may not declare malloc, realloc,
677 # and free. There are places where gas needs these functions to have been
678 # declared -- such as when taking their addresses.
679 gas_test_headers="
680 #ifdef HAVE_MEMORY_H
681 #include <memory.h>
682 #endif
683 #ifdef HAVE_STRING_H
684 #include <string.h>
685 #else
686 #ifdef HAVE_STRINGS_H
687 #include <strings.h>
688 #endif
689 #endif
690 #ifdef HAVE_STDLIB_H
691 #include <stdlib.h>
692 #endif
693 #ifdef HAVE_UNISTD_H
694 #include <unistd.h>
695 #endif
696 "
697 GAS_CHECK_DECL_NEEDED(strstr, f, char *(*f)(), $gas_test_headers)
698 GAS_CHECK_DECL_NEEDED(malloc, f, char *(*f)(), $gas_test_headers)
699 GAS_CHECK_DECL_NEEDED(free, f, void (*f)(), $gas_test_headers)
700 GAS_CHECK_DECL_NEEDED(sbrk, f, char *(*f)(), $gas_test_headers)
701
702 # Does errno.h declare errno, or do we have to add a separate declaration
703 # for it?
704 GAS_CHECK_DECL_NEEDED(errno, f, int f, [
705 #ifdef HAVE_ERRNO_H
706 #include <errno.h>
707 #endif
708 ])
709
710 dnl This must come last.
711
712 dnl We used to make symlinks to files in the source directory, but now
713 dnl we just use the right name for .c files, and create .h files in
714 dnl the build directory which include the right .h file. Make sure
715 dnl the old symlinks don't exist, so that a reconfigure in an existing
716 dnl directory behaves reasonably.
717
718 AC_OUTPUT(Makefile doc/Makefile .gdbinit:gdbinit.in po/Makefile.in:po/Make-in,
719 [rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h
720 echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h
721 echo '#include "obj-'"${obj_format}"'.h"' > obj-format.h
722 echo '#include "te-'"${te_file}"'.h"' > targ-env.h
723 echo '#include "itbl-'"${target_cpu_type}"'.h"' > itbl-cpu.h
724 case ${target_cpu_type} in
725 m32r) echo '#include "opcodes/'"${target_cpu_type}"'-opc.h"' > cgen-opc.h ;;
726 esac
727
728 sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile],
729 [target_cpu_type=${target_cpu_type}
730 obj_format=${obj_format}
731 te_file=${te_file}])
This page took 0.044802 seconds and 4 git commands to generate.