summaryrefslogtreecommitdiff
path: root/libiberty/configure.ac
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-04-22 10:35:44 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-04-22 10:35:44 -0700
commit9bf3c9cc6d3867523706ac78dc43c299eac2fba1 (patch)
tree733f68fca344b1fa54470ad459e7919a521e2cfb /libiberty/configure.ac
parenta95cd5a0d46e37922e5a0c5eb4cd4d22bc21da29 (diff)
downloadgcc-9bf3c9cc6d3867523706ac78dc43c299eac2fba1.tar.gz
hashtab.c: Include limits.h, stdint.h, ansidecl.h.
* hashtab.c: Include limits.h, stdint.h, ansidecl.h. (CHAR_BIT): Provide default. (struct prime_ent, prime_tab): New. (higher_prime_index): Rename from higher_prime_number, return index. (htab_mod_1): New. (htab_mod, htab_mod_m2): Use it. (htab_create_alloc, htab_create_alloc_ex): Store prime index. (htab_expand): Likewise. * configure.ac: Check for stdint.h. (UNSIGNED_64BIT_TYPE): New define and checks to fill it in. * config.in, configure: Rebuild. From-SVN: r81029
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 39bfb51e416..124558a20a5 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.