diff options
Diffstat (limited to 'bfd/configure.in')
-rw-r--r-- | bfd/configure.in | 192 |
1 files changed, 149 insertions, 43 deletions
diff --git a/bfd/configure.in b/bfd/configure.in index d22a3ef..7bfe2a1 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -19,6 +19,8 @@ AC_ARG_ENABLE(targets, *) enable_targets=$enableval ;; esac])dnl +AC_CONFIG_HEADER(config.h) + AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`) AC_CANONICAL_SYSTEM if test -z "$target" ; then @@ -31,8 +33,6 @@ target64=false # host stuff: -HDEFINES= - # Permit host specific settings. . ${srcdir}/configure.host @@ -44,24 +44,53 @@ AC_SUBST(AR) AC_PROG_RANLIB AC_PROG_INSTALL -# Put a plausible default for CC_FOR_BUILD in Makefile. -AC_C_CROSS -if test "x$cross_compiling" = "xno"; then - CC_FOR_BUILD='$(CC)' -else - CC_FOR_BUILD=gcc +HOST_64BIT_LONG=0 +if test "x${HOST_64BIT_TYPE}" = "xlong"; then + HOST_64BIT_LONG=1 fi -AC_SUBST(CC_FOR_BUILD) - -# Set up to make a link between the host's include file and "sysdep.h". -files=hosts/${my_host}.h - -if test ! -f ${srcdir}/${files} ; then - files=../bfd/hosts/std-host.h - AC_MSG_WARN(BFD has no specific support for host ${host} -- using std-host) +AC_SUBST(HOST_64BIT_LONG) + +BFD_CC_FOR_BUILD + +AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h) +AC_CHECK_HEADERS(fcntl.h sys/file.h sys/procfs.h) +AC_CHECK_FUNCS(fcntl) + +BFD_BINARY_FOPEN + +AC_MSG_CHECKING([whether malloc must be declared]) +AC_CACHE_VAL(bfd_cv_decl_needed_malloc, +[AC_TRY_COMPILE([ +#include <stdio.h> +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif], +[char *(*pfn) = (char *(*)) malloc], +bfd_cv_decl_needed_malloc=no, bfd_cv_decl_needed_malloc=yes)]) +AC_MSG_RESULT($bfd_cv_decl_needed_malloc) +if test $bfd_cv_decl_needed_malloc = yes; then + AC_DEFINE(NEED_DECLARATION_MALLOC) fi -AC_LINK_FILES($files, sysdep.h) +AC_MSG_CHECKING([whether free must be declared]) +AC_CACHE_VAL(bfd_cv_decl_needed_free, +[AC_TRY_COMPILE([ +#include <stdio.h> +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif], +[int (*pfn) = (int (*)) free], +bfd_cv_decl_needed_free=no, bfd_cv_decl_needed_free=yes)]) +AC_MSG_RESULT($bfd_cv_decl_needed_free) +if test $bfd_cv_decl_needed_free = yes; then + AC_DEFINE(NEED_DECLARATION_FREE) +fi # If we are configured native, pick a core file support file. COREFILE= @@ -75,38 +104,103 @@ if test "${target}" = "${host}"; then hppa*-*-bsd*) COREFILE="hpux-core.o hppabsd-core.o" COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;; changequote(,)dnl - i[345]86-sequent-bsd*) COREFILE=trad-core.o ;; + i[345]86-sequent-bsd*) +changequote([,])dnl + COREFILE=trad-core.o; + AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h") + ;; +changequote(,)dnl i[345]86-sequent-sysv4*) ;; - i[345]86-sequent-sysv*) COREFILE=trad-core.o ;; - i[345]86-*-bsd*) COREFILE=trad-core.o ;; - i[345]86-*-freebsd*) COREFILE=trad-core.o ;; - i[345]86-*-netbsd*) COREFILE=trad-core.o ;; - i[345]86-esix-sysv3*) COREFILE=trad-core.o ;; - i[345]86-*-sco*) COREFILE=trad-core.o ;; - i[345]86-*-mach3*) COREFILE=trad-core.o ;; - i[345]86-*-linux*) COREFILE=trad-core.o ;; + i[345]86-sequent-sysv*) +changequote([,])dnl + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h") + ;; +changequote(,)dnl + i[345]86-*-bsd* | i[345]86-*-freebsd* | i[345]86-*-netbsd*) +changequote([,])dnl + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/i386bsd.h") + ;; +changequote(,)dnl + i[345]86-esix-sysv3*) +changequote([,])dnl + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/esix.h") + ;; +changequote(,)dnl + i[345]86-*-sco* | i[345]86-*-isc*) +changequote([,])dnl + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/i386sco.h") + ;; +changequote(,)dnl + i[345]86-*-mach3*) +changequote([,])dnl + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/i386mach3.h") + ;; +changequote(,)dnl + i[345]86-*-linux*) +changequote([,])dnl + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/i386linux.h") + ;; +changequote(,)dnl i[345]86-*-isc*) COREFILE=trad-core.o ;; i[345]86-*-aix*) COREFILE=aix386-core.o ;; changequote([,])dnl - mips-dec-bsd*) COREFILE=trad-core.o ;; - mips-dec-mach3*) COREFILE=trad-core.o ;; - mips-dec-*) COREFILE=trad-core.o ;; + mips-dec-bsd*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/mipsbsd.h") + ;; + mips-dec-mach3*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h") + ;; + mips-dec-*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/decstation.h") + ;; mips-sgi-irix4*) COREFILE=irix-core.o ;; mips-sgi-irix5*) COREFILE=irix-core.o ;; - mips-*-mach3*) COREFILE=trad-core.o ;; + mips-*-mach3*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h") + ;; mips-*-sysv4*) ;; - mips-*-sysv*) COREFILE=trad-core.o ;; - mips-*-riscos*) COREFILE=trad-core.o ;; - mips-sony-bsd*) COREFILE=trad-core.o ;; - m68*-bull*-sysv*) COREFILE=trad-core.o ;; + mips-*-sysv* | mips-*-riscos*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/riscos.h") + ;; + mips-sony-bsd*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/news-mips".h) + ;; + m68*-bull*-sysv*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/dpx2.h") + ;; m68*-hp-hpux*) COREFILE=hpux-core.o ;; - m68*-hp-bsd*) COREFILE=trad-core.o ;; + m68*-hp-bsd*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/hp300bsd.h") + ;; m68*-motorola-sysv*) COREFILE=ptrace-core.o ;; - m68*-sony-*) COREFILE=trad-core.o ;; + m68*-sony-*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/news.h") + ;; m88*-*-sysv4*) ;; m88*-motorola-sysv*) COREFILE=trad-core.o ;; - m88*-*-mach3*) COREFILE=trad-core.o ;; - ns32k-pc532-mach) COREFILE=trad-core.o ;; + m88*-*-mach3*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/m88kmach3.h") + ;; + ns32k-pc532-mach) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/pc532mach.h") + ;; rs6000-*-lynx*) COREFILE=lynx-core.o ;; rs6000-*-aix4*) COREFILE=rs6000-core.o COREFLAG=-DALTERNATE_AIX_CORE_FORMAT ;; @@ -114,10 +208,22 @@ changequote([,])dnl powerpc-*-aix4*) COREFILE=rs6000-core.o COREFLAG=-DALTERNATE_AIX_CORE_FORMAT ;; powerpc-*-aix*) COREFILE=rs6000-core.o ;; - tahoe-*-*) COREFILE=trad-core.o ;; - vax-*-ultrix2*) COREFILE=trad-core.o ;; - vax-*-ultrix*) COREFILE=trad-core.o ;; - vax-*-*) COREFILE=trad-core.o ;; + tahoe-*-*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/tahoe.h") + ;; + vax-*-ultrix2*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h") + ;; + vax-*-ultrix*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h") + ;; + vax-*-*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/vaxbsd.h") + ;; esac case "$COREFILE" in @@ -129,7 +235,7 @@ changequote([,])dnl osf-core.o) COREFLAG=-DOSF_CORE ;; ptrace-core.o) COREFLAG=-DPTRACE_CORE ;; rs6000-core.o) COREFLAG="$COREFLAG -DAIX_CORE" ;; - trad-core.o) COREFLAG=-DTRAD_CORE ;; + trad-core.o) COREFLAG="$COREFLAG -DTRAD_CORE" ;; esac fi AC_SUBST(COREFILE) |