aboutsummaryrefslogtreecommitdiff
path: root/bfd/configure.in
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-09-06 22:53:43 +0000
committerIan Lance Taylor <ian@airs.com>1995-09-06 22:53:43 +0000
commitb7577823b60110d3b33ac7753e68a0291f0b132a (patch)
tree2889e39d803567e04add5e03ef7fcf6302651c52 /bfd/configure.in
parentdd6ed5ab2ddcf5b307b5b847ff336ff51e9d3974 (diff)
downloadgdb-b7577823b60110d3b33ac7753e68a0291f0b132a.zip
gdb-b7577823b60110d3b33ac7753e68a0291f0b132a.tar.gz
gdb-b7577823b60110d3b33ac7753e68a0291f0b132a.tar.bz2
* configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG. Check that various header files exist. Check that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc and/or free need to be declared. Don't make a link to sysdep.h. Define TRAD_HEADER for various hosts. * configure: Rebuild. * configure.host: Don't set my_host. Add definitions taken from host header files for various entries. Remove entries which now do nothing. * acconfig.h: New file. * config.h.in: New file, built by autoheader. * sysdep.h: New file. * Makefile.in (do_distclean): Don't remove sysdep.h. (RECONFIG): Remove. (LOCAL_H_DEPS): New variable. ($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and $(RECONFIG). ($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise. ($(OPTIONAL_BACKENDS)): Likewise. (stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than looking through sysdep.h. * bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile. (BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG. (fprintf_vma, sprintf_vma): Likewise. (int64_type, uint64_type): Don't define. * bfd-in2.h: Rebuild. * archures.c, bfd.c, srec.c: Include <ctype.h>. * elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS. * lynx-core.c: Include stuff from old hosts/lynx.h. * opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL), rather than NO_FCNTL. * targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__ rather than NATIVE_HPPAHPUX_COMPILER. * trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it is defined. * hosts/*.h: Remove all header files which merely include, declare, and define things. Leave header files which define information needed by trad-core.c.
Diffstat (limited to 'bfd/configure.in')
-rw-r--r--bfd/configure.in192
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)