aboutsummaryrefslogtreecommitdiff
path: root/libiberty/configure.ac
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2004-04-22 18:39:03 +0000
committerDJ Delorie <dj@redhat.com>2004-04-22 18:39:03 +0000
commitbb6a587dd383a443ab1b78669870f33cfbc117a2 (patch)
tree035e4dc50ffb72fa044558d6791ac2e5bc836e5b /libiberty/configure.ac
parentfcf29e5f0e126c69ecb6ddd54613cc3c56a4a1b2 (diff)
downloadfsf-binutils-gdb-bb6a587dd383a443ab1b78669870f33cfbc117a2.zip
fsf-binutils-gdb-bb6a587dd383a443ab1b78669870f33cfbc117a2.tar.gz
fsf-binutils-gdb-bb6a587dd383a443ab1b78669870f33cfbc117a2.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/configure.ac')
-rw-r--r--libiberty/configure.ac36
1 files changed, 35 insertions, 1 deletions
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index 39bfb51..124558a 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -159,13 +159,47 @@ AC_SUBST_FILE(host_makefile_frag)
# It's OK to check for header files. Although the compiler may not be
# able to link anything, it had better be able to at least compile
# something.
-AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h)
+AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h stdint.h)
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
libiberty_AC_DECLARE_ERRNO
AC_CHECK_TYPE(uintptr_t, unsigned long)
+
+# Look for a 64-bit type.
+AC_MSG_CHECKING([for a 64-bit type])
+AC_CACHE_VAL(liberty_cv_uint64,
+[AC_TRY_COMPILE(
+[#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif],
+[extern uint64_t foo;],
+liberty_cv_uint64=uint64_t,
+[AC_TRY_COMPILE(
+[#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
+#endif],
+[extern char foo[sizeof(long) * CHAR_BIT >= 64 ? 1 : -1];],
+liberty_cv_uint64="unsigned long",
+[AC_TRY_COMPILE(
+[#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
+#endif],
+[extern char foo[sizeof(long long) * CHAR_BIT >= 64 ? 1 : -1];],
+liberty_cv_uint64="unsigned long long", liberty_cv_uint64=none)])])])
+AC_MSG_RESULT($liberty_cv_uint64)
+if test "$liberty_cv_uint64" != none; then
+ AC_DEFINE(UNSIGNED_64BIT_TYPE, $liberty_cv_uint64,
+ [Define to an unsigned 64-bit type available in the compiler.])
+fi
+
# Given the above check, we always have uintptr_t or a fallback
# definition. So define HAVE_UINTPTR_T in case any imported code
# relies on it.