1 dnl Process this file with autoconf to produce a configure script.
3 dnl And be careful when changing it! If you must add tests with square
4 dnl brackets, be sure changequote invocations surround it.
7 AC_PREREQ(2.5)dnl v2.5 needed for --bindir et al
11 AC_ARG_ENABLE(bfd-assembler,
12 [ --enable-bfd-assembler use BFD back end for writing object files],
13 [case "${enableval}" in
14 yes) need_bfd=yes user_bfd_gas=yes ;;
15 no) user_bfd_gas=no ;;
16 *) AC_MSG_ERROR(bad value ${enableval} given for bfd-assembler option) ;;
18 AC_ARG_ENABLE(targets,
19 [ targets alternative target configurations besides the primary],
20 [case "${enableval}" in
21 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
23 no) enable_targets= ;;
24 *) enable_targets=$enableval ;;
27 [ --enable-shared build shared BFD library],
28 [case "${enableval}" in
29 yes) shared=true shared_bfd=true shared_opcodes=true ;;
31 *bfd*opcodes*) shared=true shared_bfd=true shared_opcodes=true ;;
32 *opcodes*bfd*) shared=true shared_bfd=true shared_opcodes=true ;;
33 *bfd*) shared=true shared_bfd=true ;;
34 *opcodes*) shared=true shared_opcodes=true ;;
37 AC_ARG_ENABLE(commonbfdlib,
38 [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
39 [case "${enableval}" in
40 yes) commonbfdlib=true ;;
41 no) commonbfdlib=false ;;
42 *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
45 # Generate a header file -- gets more post-processing by Makefile later.
46 AC_CONFIG_HEADER(conf)
48 dnl For recursion to work right, this must be an absolute pathname.
49 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
56 if test -n "$enable_targets" ; then
57 for t in `echo $enable_targets | sed 's/,/ /g'`; do
58 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $t 2>/dev/null`
59 if test -n "$result" ; then
60 canon_targets="$canon_targets $result"
62 # # Permit "all", etc. We don't support it yet though.
63 # canon_targets="$canon_targets $t"
66 GAS_UNIQ(canon_targets)
71 for this_target in $target $canon_targets ; do
74 eval `echo $this_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/cpu=\1 vendor=\2 os=\3/'`
77 # check for architecture variants
79 armeb) cpu_type=arm endian=big ;;
80 arm*) cpu_type=arm endian=little ;;
81 thumb*) cpu_type=arm endian=little ;;
82 hppa*) cpu_type=hppa ;;
84 i[456]86) cpu_type=i386 ;;
85 m680[012346]0) cpu_type=m68k ;;
86 m68008) cpu_type=m68k ;;
87 m683??) cpu_type=m68k ;;
90 mips*el) cpu_type=mips endian=little ;;
91 mips*5900*) cpu_type=mips endian=little ;;
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 sparc64) cpu_type=sparc want_sparc_v9=true ;;
97 sparc*) cpu_type=sparc ;;
101 if test ${this_target} = $target ; then
102 target_cpu_type=${cpu_type}
103 elif test ${target_cpu_type} != ${cpu_type} ; then
108 generic_target=${cpu_type}-$vendor-$os
113 # assign object format
114 case ${generic_target} in
115 a29k-*-coff) fmt=coff targ=ebmon29k ;;
116 a29k-amd-udi) fmt=coff targ=ebmon29k ;;
117 a29k-amd-ebmon) fmt=coff targ=ebmon29k ;;
118 a29k-nyu-sym1) fmt=coff targ=ebmon29k ;;
119 a29k-*-vxworks*) fmt=coff ;;
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 ;;
129 arc-*-elf*) fmt=elf bfd_gas=yes ;;
132 arm-*-riscix*) fmt=aout targ=arm-lit em=riscix ;;
139 arm-*-coff | thumb-*-coff) fmt=coff ;;
140 arm-*-riscix*) fmt=aout ;;
141 arm-*-pe) fmt=coff targ=armcoff em=pe ;;
143 d10v-*-*) fmt=elf bfd_gas=yes ;;
144 # start-sanitize-d30v
145 d30v-*-*) fmt=elf bfd_gas=yes ;;
148 hppa-*-*elf*) fmt=elf em=hppa ;;
149 hppa-*-lites*) fmt=elf em=hppa ;;
150 hppa-*-osf*) fmt=som em=hppa ;;
151 hppa-*-rtems*) fmt=elf em=hppa ;;
152 hppa-*-hpux*) fmt=som em=hppa ;;
153 hppa-*-bsd*) fmt=som em=hppa ;;
154 hppa-*-hiux*) fmt=som em=hppa ;;
156 h8300-*-coff) fmt=coff ;;
158 i386-ibm-aix*) fmt=coff targ=i386coff
160 i386-sequent-bsd*) fmt=aout em=dynix bfd_gas=yes ;;
161 i386-*-bsd*) fmt=aout em=386bsd ;;
162 i386-*-netbsd0.8) fmt=aout em=386bsd ;;
163 i386-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes;;
164 i386-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes;;
165 i386-*-linux*aout* | i386-*-linuxoldld) fmt=aout em=linux ;;
166 i386-*-linux*coff*) fmt=coff em=linux
168 i386-*-linux*) fmt=elf em=linux ;;
169 i386-*-lynxos*) fmt=coff targ=i386coff
171 i386-*-sysv4* | i386-*-solaris* | i386-*-elf | i386-*-freebsdelf*)
173 i386-*-sco*elf*) fmt=elf targ=sco5 ;;
174 i386-*-coff | i386-*-sysv* | i386-*-sco* | i386-*-isc*)
175 fmt=coff targ=i386coff ;;
176 i386-*-vsta) fmt=aout ;;
177 i386-*-msdosdjgpp* | i386-*-go32*)
178 fmt=coff targ=coffgo32 em=go32;;
179 i386-*-rtems*) fmt=coff targ=i386coff ;;
180 i386-*-gnu*) fmt=elf ;;
182 fmt=aout em=mach bfd_gas=yes ;;
183 i386-*-msdos*) fmt=aout ;;
184 i386-*-moss*) fmt=elf ;;
185 i386-*-pe) fmt=coff targ=i386coff em=pe ;;
186 i386-*-cygwin32) fmt=coff targ=i386coff em=pe bfd_gas=yes ;;
187 i386-*-*nt) fmt=coff targ=i386coff em=pe ;;
188 i960-*-bout) fmt=bout ;;
189 i960-*-coff) fmt=coff em=ic960 targ=ic960coff ;;
190 i960-*-rtems*) fmt=coff em=ic960 targ=ic960coff ;;
191 i960-*-nindy*) fmt=bout ;;
192 i960-*-vxworks4*) fmt=bout ;;
193 i960-*-vxworks5.0) fmt=bout ;;
194 i960-*-vxworks5.*) fmt=coff em=ic960 targ=ic960coff ;;
195 i960-*-vxworks*) fmt=bout ;;
197 m32r-*-*) fmt=elf bfd_gas=yes ;;
199 m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
201 m68k-motorola-sysv*) fmt=coff targ=m68kcoff em=delta ;;
202 m68k-bull-sysv3*) fmt=coff targ=m68kcoff em=dpx2 ;;
203 m68k-apollo-*) fmt=coff targ=apollo em=apollo ;;
204 m68k-*-sysv4*) # must be before -sysv*
206 m68k-*-elf*) fmt=elf ;;
207 m68k-*-coff | m68k-*-sysv* | m68k-*-rtems*)
208 fmt=coff targ=m68kcoff ;;
209 m68k-*-hpux*) fmt=hp300 em=hp300 ;;
210 m68k-*-linux*aout*) fmt=aout em=linux ;;
211 m68k-*-linux*) fmt=elf em=linux ;;
212 m68k-*-lynxos*) fmt=coff targ=m68kcoff
214 m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
215 m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
216 m68k-apple-aux*) fmt=coff targ=m68kcoff em=aux ;;
217 m68k-*-psos*) fmt=elf em=psos;;
219 m88k-motorola-sysv3*) fmt=coff targ=m88kcoff em=delt88 ;;
220 m88k-*-coff*) fmt=coff targ=m88kcoff ;;
222 # don't change em like *-*-bsd does
223 mips-dec-netbsd*) fmt=elf targ=mips-lit endian=little ;;
224 mips-dec-openbsd*) fmt=elf targ=mips-lit endian=little ;;
225 mips-dec-bsd*) fmt=aout targ=mips-lit ;;
226 mips-sony-bsd*) fmt=ecoff targ=mips-big ;;
227 mips-*-bsd*) AC_MSG_ERROR(Unknown vendor for mips-bsd configuration.) ;;
228 mips-*-ultrix*) fmt=ecoff targ=mips-lit endian=little ;;
229 mips-*-osf*) fmt=ecoff targ=mips-lit endian=little ;;
230 mips-*-ecoff*) fmt=ecoff
232 big) targ=mips-big ;;
236 mips-*-ecoff*) fmt=ecoff targ=mips-big ;;
237 mips-*-irix6*) fmt=elf targ=mips-big ;;
238 mips-*-irix5*) fmt=elf targ=mips-big ;;
239 mips-*-irix*) fmt=ecoff targ=mips-big ;;
240 mips-*-lnews*) fmt=ecoff targ=mips-lit em=lnews ;;
241 mips-*-riscos*) fmt=ecoff targ=mips-big ;;
242 mips-*-sysv*) fmt=ecoff targ=mips-big ;;
243 mips-*-elf* | mips-*-rtems* | mips-*-linux* | mips-*-gnu* | mips-*-openbsd*)
246 big) targ=mips-big ;;
250 mn10200-*-*) fmt=elf bfd_gas=yes ;;
251 mn10300-*-*) fmt=elf bfd_gas=yes ;;
252 ppc-*-pe | ppc-*-cygwin32 | ppc-*-winnt*)
259 ppc-*-aix*) fmt=coff ;;
260 ppc-*-beos*) fmt=coff ;;
261 ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*)
268 ppc-*-linux*) fmt=elf
271 *) AC_MSG_ERROR(Linux must be configured big endian) ;;
274 ppc-*-solaris*) fmt=elf
276 big) AC_MSG_ERROR(Solaris must be configured little endian) ;;
287 ppc-*-macos* | ppc-*-mpw*)
289 ppc-*-netware*) fmt=elf em=ppcnw ;;
291 sh-*-elf*) fmt=elf ;;
292 sh-*-coff*) fmt=coff ;;
294 ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;;
295 ns32k-pc532-netbsd* | ns32k-pc532-lites*) fmt=aout em=nbsd532 ;;
296 ns32k-pc532-openbsd*) fmt=aout em=nbsd532 ;;
298 sparc-*-rtems*) fmt=aout ;;
299 sparc-*-sunos4*) fmt=aout em=sun3 ;;
300 sparc-*-aout | sparc*-*-vxworks*)
301 fmt=aout em=sparcaout ;;
302 sparc-*-coff) fmt=coff ;;
303 sparc-*-linux*aout*) fmt=aout em=linux ;;
304 sparc-*-linux*) fmt=elf em=linux ;;
305 sparc-*-lynxos*) fmt=coff em=lynx ;;
306 sparc-fujitsu-none) fmt=aout ;;
307 sparc-*-elf | sparc-*-sysv4* | sparc-*-solaris*)
309 sparc-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
310 sparc-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
312 # start-sanitize-tic80
313 tic80-*-*) fmt=coff targ=tic80coff;;
315 # start-sanitize-v850
316 v850-*-*) fmt=elf bfd_gas=yes ;;
319 vax-*-bsd* | vax-*-ultrix*)
321 vax-*-vms) fmt=vms ;;
323 z8k-*-coff | z8k-*-sim)
328 *-*-aout | *-*-scout)
334 *-*-generic) fmt=generic ;;
335 *-*-xray | *-*-hms) fmt=coff ;;
337 *-*-elf | *-*-sysv4* | *-*-solaris*)
338 AC_MSG_WARN(GAS support for ${generic_target} is incomplete.)
340 *-*-vxworks) fmt=aout ;;
341 *-*-netware) fmt=elf ;;
344 case ${cpu_type}-${fmt} in
345 alpha-*) bfd_gas=yes ;;
346 arm-*) bfd_gas=yes ;;
348 # i386-aout) bfd_gas=preferred ;;
349 mips-*) bfd_gas=yes ;;
350 ns32k-*) bfd_gas=yes ;;
351 ppc-*) bfd_gas=yes ;;
352 sparc-*) bfd_gas=yes ;;
353 *-elf) bfd_gas=yes ;;
354 *-ecoff) bfd_gas=yes ;;
355 *-som) bfd_gas=yes ;;
359 # Other random stuff.
361 # do we need the opcodes library?
367 if test "${shared_opcodes}" = "true"; then
368 # A shared libopcodes must be linked against libbfd.
374 test -n "$want_sparc_v9" && AC_DEFINE(SPARC_V9)
376 case ${cpu}-${vendor}-${os} in
377 sparc64-*-elf*) AC_DEFINE(SPARC_ARCH64) ;;
382 case ${extra_objects} in
384 *) extra_objects="$extra_objects cgen.o"
385 AC_DEFINE(USING_CGEN)
391 case ${extra_objects} in
393 *) extra_objects="$extra_objects m68k-parse.o" ;;
398 echo ${extra_objects} | grep -s "itbl-parse.o"
399 if test $? -ne 0 ; then
400 extra_objects="$extra_objects itbl-parse.o"
403 echo ${extra_objects} | grep -s "itbl-lex.o"
404 if test $? -ne 0 ; then
405 extra_objects="$extra_objects itbl-lex.o"
408 echo ${extra_objects} | grep -s "itbl-ops.o"
409 if test $? -ne 0 ; then
410 extra_objects="$extra_objects itbl-ops.o"
418 # See if we really can support this configuration with the emulation code.
420 if test $this_target = $target ; then
421 primary_bfd_gas=$bfd_gas
426 if test $bfd_gas = no ; then
427 # Can't support other configurations this way.
430 elif test $bfd_gas = no ; then
431 # Can't support this configuration.
435 # From target name and format, produce a list of supported emulations.
437 case ${generic_target}-${fmt} in
438 mips-*-irix5*-*) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
439 mips-*-linux*-*) case "$endian" in
440 big) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
441 *) emulation="mipslelf mipsbelf mipself mipslecoff mipsbecoff mipsecoff" ;;
443 mips-*-lnews*-ecoff) ;;
444 mips-*-*-ecoff) case "$endian" in
445 big) emulation="mipsbecoff mipslecoff mipsecoff" ;;
446 *) emulation="mipslecoff mipsbecoff mipsecoff" ;;
448 mips-*-*-elf) case "$endian" in
449 big) emulation="mipsbelf mipslelf mipself" ;;
450 *) emulation="mipslelf mipsbelf mipself" ;;
451 # Uncommenting the next line will turn on support for i386 COFF
452 # in any i386 ELF configuration. This probably doesn't work
454 # i386-*-*-elf) emulation="i386coff i386elf" ;;
458 emulations="$emulations $emulation"
462 # Assign floating point type. Most processors with FP support
463 # IEEE FP. On those that don't support FP at all, usually IEEE
465 case ${target_cpu} in
466 vax | tahoe ) atof=${target_cpu} ;;
470 case "${obj_format}" in
471 "") AC_MSG_ERROR(GAS does not know what format to use for target ${target}) ;;
475 dnl Make sure the desired support files exist.
478 if test ! -r ${srcdir}/config/tc-${target_cpu_type}.c; then
479 AC_MSG_ERROR(GAS does not support target CPU ${target_cpu_type})
482 if test ! -r ${srcdir}/config/obj-${obj_format}.c; then
483 AC_MSG_ERROR(GAS does not have support for object file format ${obj_format})
486 # and target makefile frag
488 target_frag=${srcdir}/config/${gas_target}.mt
489 if test ! -r ${target_frag}; then
490 target_frag=/dev/null # ick! but subst_file can't be conditionalized
492 AC_SUBST_FILE(target_frag)
494 case ${user_bfd_gas}-${primary_bfd_gas} in
496 # We didn't override user's choice.
499 AC_MSG_WARN(Use of BFD is required for ${target}; overriding config options.)
511 # User specified nothing.
515 # Some COFF configurations want these random other flags set.
516 case ${obj_format} in
518 case ${target_cpu_type} in
519 i386) AC_DEFINE(I386COFF) ;;
520 m68k) AC_DEFINE(M68KCOFF) ;;
521 m88k) AC_DEFINE(M88KCOFF) ;;
526 # Getting this done right is going to be a bitch. Each configuration specified
527 # with --enable-targets=... should be checked for environment, format, cpu, and
530 # For each configuration, the necessary object file support code must be linked
531 # in. This might be only one, it might be up to four. The necessary emulation
532 # code needs to be provided, too.
534 # And then there's "--enable-targets=all"....
536 # For now, just always do it for MIPS ELF or ECOFF configurations. Sigh.
538 formats="${obj_format}"
542 for em in . $emulations ; do
546 fmt=elf file=mipself ;;
547 mipsbecoff | mipslecoff)
548 fmt=ecoff file=mipsecoff ;;
550 fmt=coff file=i386coff ;;
552 fmt=elf file=i386elf ;;
554 formats="$formats $fmt"
555 emfiles="$emfiles e-$file.o"
556 EMULATIONS="$EMULATIONS &$em,"
560 if test `set . $formats ; shift ; echo $#` -gt 1 ; then
561 for fmt in $formats ; do
563 aout) AC_DEFINE(OBJ_MAYBE_AOUT) ;;
564 bout) AC_DEFINE(OBJ_MAYBE_BOUT) ;;
565 coff) AC_DEFINE(OBJ_MAYBE_COFF) ;;
566 ecoff) AC_DEFINE(OBJ_MAYBE_ECOFF) ;;
567 elf) AC_DEFINE(OBJ_MAYBE_ELF) ;;
568 generic) AC_DEFINE(OBJ_MAYBE_GENERIC) ;;
569 hp300) AC_DEFINE(OBJ_MAYBE_HP300) ;;
570 ieee) AC_DEFINE(OBJ_MAYBE_IEEE) ;;
571 som) AC_DEFINE(OBJ_MAYBE_SOM) ;;
572 vms) AC_DEFINE(OBJ_MAYBE_VMS) ;;
574 extra_objects="$extra_objects obj-$fmt.o"
578 if test `set . $emfiles ; shift ; echo $#` -gt 0 ; then
580 extra_objects="$extra_objects $emfiles"
581 DEFAULT_EMULATION=`set . $emulations ; echo $2`
582 AC_DEFINE(USE_EMULATIONS)
584 AC_SUBST(extra_objects)
585 AC_DEFINE_UNQUOTED(EMULATIONS, $EMULATIONS)
586 AC_DEFINE_UNQUOTED(DEFAULT_EMULATION, "$DEFAULT_EMULATION")
588 case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in
589 yes-*-coff) need_bfd=yes ;;
590 no-*-coff) need_bfd=yes
591 AC_DEFINE(MANY_SEGMENTS) ;;
594 reject_dev_configs=yes
596 case ${reject_dev_configs}-${dev} in
598 AC_MSG_ERROR(GAS does not support the ${generic_target} configuration.)
602 AC_SUBST(target_cpu_type)
606 dnl AC_SUBST(emulation)
608 case "${primary_bfd_gas}" in
609 yes) AC_DEFINE(BFD_ASSEMBLER)
613 # do we need the opcodes library?
614 case "${need_opcodes}" in
616 OPCODES_DEP=../opcodes/libopcodes.a
617 OPCODES_LIB='-L../opcodes -lopcodes'
619 # We need to handle some special cases for shared libraries.
622 # On SunOS, we must link against the name we are going to install,
623 # not -lbfd, since SunOS does not support SONAME.
624 if test "${shared_opcodes}" = "true"; then
625 OPCODES_LIB='-L../opcodes -l`echo opcodes | sed '"'"'$(program_transform_name)'"'"'`'
629 # On Alpha OSF/1, the native linker searches all the -L
630 # directories for any LIB.so files, and only then searches for any
631 # LIB.a files. That means that if there is an installed
632 # libbfd.so, but this build is not done with --enable-shared, the
633 # link will wind up being against the install libbfd.so rather
634 # than the newly built libbfd. To avoid this, we must explicitly
635 # link against libbfd.a when --enable-shared is not used.
636 if test "${shared_opcodes}" != "true"; then
637 OPCODES_LIB='../opcodes/libopcodes.a'
644 case "${need_bfd}" in
646 BFDDEP=../bfd/libbfd.a
647 BFDLIB='-L../bfd -lbfd'
648 ALL_OBJ_DEPS="$ALL_OBJ_DEPS ../bfd/bfd.h"
650 # We need to handle some special cases for shared libraries
653 # On SunOS, we must link against the name we are going to install,
654 # not -lbfd, since SunOS does not support SONAME.
655 if test "${shared_bfd}" = "true"; then
656 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
660 # On Alpha OSF/1, the native linker searches all the -L
661 # directories for any LIB.so files, and only then searches for any
662 # LIB.a files. That means that if there is an installed
663 # libbfd.so, but this build is not done with --enable-shared, the
664 # link will wind up being against the install libbfd.so rather
665 # than the newly built libbfd. To avoid this, we must explicitly
666 # link against libbfd.a when --enable-shared is not used.
667 if test "${shared_bfd}" != "true"; then
668 BFDLIB='../bfd/libbfd.a'
673 if test "${commonbfdlib}" = "true"; then
674 # when a shared libbfd is built with --enable-commonbfdlib,
675 # all of libopcodes is available in libbfd.so
683 AC_SUBST(OPCODES_DEP)
684 AC_SUBST(OPCODES_LIB)
686 AC_SUBST(ALL_OBJ_DEPS)
688 AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}")
689 AC_DEFINE_UNQUOTED(TARGET_CANONICAL, "${target}")
690 AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}")
691 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}")
692 AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}")
697 AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h)
699 # Put this here so that autoconf's "cross-compiling" message doesn't confuse
700 # people who are not cross-compiling but are compiling cross-assemblers.
701 AC_MSG_CHECKING(whether compiling a cross-assembler)
702 if test "${host}" = "${target}"; then
706 AC_DEFINE(CROSS_COMPILE)
708 AC_MSG_RESULT($cross_gas)
710 # Look for win32 specific settings.
714 dnl ansidecl.h will deal with const
719 # VMS doesn't have unlink.
720 AC_CHECK_FUNCS(unlink remove, break)
722 # Some systems don't have sbrk().
725 # Some non-ANSI preprocessors botch requoting inside strings. That's bad
726 # enough, but on some of those systems, the assert macro relies on requoting
730 # On some systems, the system header files may not declare malloc, realloc,
731 # and free. There are places where gas needs these functions to have been
732 # declared -- such as when taking their addresses.
740 #ifdef HAVE_STRINGS_H
751 GAS_CHECK_DECL_NEEDED(strstr, f, char *(*f)(), $gas_test_headers)
752 GAS_CHECK_DECL_NEEDED(malloc, f, char *(*f)(), $gas_test_headers)
753 GAS_CHECK_DECL_NEEDED(free, f, void (*f)(), $gas_test_headers)
754 GAS_CHECK_DECL_NEEDED(sbrk, f, char *(*f)(), $gas_test_headers)
756 # Does errno.h declare errno, or do we have to add a separate declaration
758 GAS_CHECK_DECL_NEEDED(errno, f, int f, [
766 RPATH_ENVVAR=LD_LIBRARY_PATH
767 # If we have shared libraries, try to set rpath reasonably.
768 if test "${shared}" = "true"; then
771 HLDFLAGS='-Wl,+s,+b,$(libdir)'
772 RPATH_ENVVAR=SHLIB_PATH
774 *-*-irix5* | *-*-irix6*)
775 HLDFLAGS='-Wl,-rpath,$(libdir)'
780 HLDFLAGS='-Wl,-rpath,$(libdir)'
783 HLDFLAGS='-R $(libdir)'
786 HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
791 # On SunOS, if the linker supports the -rpath option, use it to
792 # prevent ../bfd and ../opcodes from being included in the run time
796 echo 'main () { }' > conftest.c
797 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
798 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
800 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
802 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
804 elif test "${shared}" = "true"; then
805 HLDFLAGS='-Wl,-rpath=$(libdir)'
807 HLDFLAGS='-Wl,-rpath='
809 rm -f conftest.t conftest.c conftest
814 AC_SUBST(RPATH_ENVVAR)
816 dnl This must come last.
818 dnl We used to make symlinks to files in the source directory, but now
819 dnl we just use the right name for .c files, and create .h files in
820 dnl the build directory which include the right .h file. Make sure
821 dnl the old symlinks don't exist, so that a reconfigure in an existing
822 dnl directory behaves reasonably.
824 AC_OUTPUT(Makefile doc/Makefile .gdbinit:gdbinit.in,
825 [rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h
826 echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h
827 echo '#include "obj-'"${obj_format}"'.h"' > obj-format.h
828 echo '#include "te-'"${te_file}"'.h"' > targ-env.h
829 echo '#include "itbl-'"${target_cpu_type}"'.h"' > itbl-cpu.h
830 case ${target_cpu_type} in
831 m32r) echo '#include "opcodes/'"${target_cpu_type}"'-opc.h"' > cgen-opc.h ;;
833 [target_cpu_type=${target_cpu_type}
834 obj_format=${obj_format}