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