summaryrefslogtreecommitdiff
path: root/libiberty/configure.ac
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-04-22 17:35:44 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-04-22 17:35:44 +0000
commit6c13736f64158617d1ddfc3d7103b3566aa513cf (patch)
tree733f68fca344b1fa54470ad459e7919a521e2cfb /libiberty/configure.ac
parent73f2fb9f9b0f8166d3af601a49452e152a68f6c6 (diff)
downloadgcc-6c13736f64158617d1ddfc3d7103b3566aa513cf.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81029 138bc75d-0d04-0410-961f-82ee72b054a4
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.