summaryrefslogtreecommitdiff
path: root/build_posix
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-10-02 15:15:19 -0400
committerKeith Bostic <keith@wiredtiger.com>2014-10-02 15:15:19 -0400
commit02b2ba85d3166655abba75c49fbd7ca9fe6fed51 (patch)
tree51cbd5924b8c7d401f0c07a2eab84d58c742e727 /build_posix
parentf91eda0933de561518185941dff11e7591454f57 (diff)
downloadmongo-02b2ba85d3166655abba75c49fbd7ca9fe6fed51.tar.gz
Simplify testing for basic types during configuration: we're running on
C99 machines as far as we know, and doing the tests creates problems.
Diffstat (limited to 'build_posix')
-rw-r--r--build_posix/aclocal/types.m4107
1 files changed, 4 insertions, 103 deletions
diff --git a/build_posix/aclocal/types.m4 b/build_posix/aclocal/types.m4
index 844c8eadc73..4e01965ef9b 100644
--- a/build_posix/aclocal/types.m4
+++ b/build_posix/aclocal/types.m4
@@ -1,118 +1,19 @@
-# AM_SIGNED_TYPES, AM_UNSIGNED_TYPES --
-# Search standard type names for something of the same size and
-# signed-ness as the type we want to declare.
-#
-# $1 AC_SUBST variable
-# $2 typedef name
-# $3 number of bytes
-AC_DEFUN([AM_SIGNED_TYPES], [
- case "$3" in
- "$ac_cv_sizeof_int")
- $1="typedef int $2;";;
- "$ac_cv_sizeof_char")
- $1="typedef char $2;";;
- "$ac_cv_sizeof_short")
- $1="typedef short $2;";;
- "$ac_cv_sizeof_long")
- $1="typedef long $2;";;
- "$ac_cv_sizeof_long_long")
- $1="typedef long long $2;";;
- *)
- AC_MSG_ERROR([No signed $3-byte type found]);;
- esac])
-])
-AC_DEFUN([AM_UNSIGNED_TYPES], [
- case "$3" in
- "$ac_cv_sizeof_unsigned_int")
- $1="typedef unsigned int $2;";;
- "$ac_cv_sizeof_unsigned_char")
- $1="typedef unsigned char $2;";;
- "$ac_cv_sizeof_unsigned_short")
- $1="typedef unsigned short $2;";;
- "$ac_cv_sizeof_unsigned_long")
- $1="typedef unsigned long $2;";;
- "$ac_cv_sizeof_unsigned_long_long")
- $1="typedef unsigned long long $2;";;
- *)
- AC_MSG_ERROR([No unsigned $3-byte type found]);;
- esac])
-])
# AM_TYPES --
-# Create any missing types.
+# Check for missing types, create substitutes where we can.
AC_DEFUN([AM_TYPES], [
# Basic list of include files that might have types. We also use
# as the list of includes directly included by wiredtiger.h.
std_includes="
#include <sys/types.h>
+#include <inttypes.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>"
AC_SUBST(wiredtiger_includes_decl)
wiredtiger_includes_decl="$std_includes"
- # Look for variable-sized type names, and if we don't find them,
- # create our own.
- AC_SUBST(u_char_decl)
- AC_CHECK_TYPE(u_char,,
- [u_char_decl="typedef unsigned char u_char;"], $std_includes)
- AC_SUBST(u_short_decl)
- AC_CHECK_TYPE(u_short,,
- [u_short_decl="typedef unsigned short u_short;"], $std_includes)
- AC_SUBST(u_int_decl)
- AC_CHECK_TYPE(u_int,,
- [u_int_decl="typedef unsigned int u_int;"], $std_includes)
- AC_SUBST(u_long_decl)
- AC_CHECK_TYPE(u_long,,
- [u_long_decl="typedef unsigned long u_long;"], $std_includes)
- AC_SUBST(u_quad_decl)
- AC_CHECK_TYPE(u_quad,,
- [u_quad_decl="typedef unsigned long long u_quad;"], $std_includes)
-
- # Look for fixed-size type names, and if we don't find them, create
- # our own.
- #
- # First, figure out the sizes of the standard types.
- AC_CHECK_SIZEOF(char,, $std_includes)
- AC_CHECK_SIZEOF(unsigned char,, $std_includes)
- AC_CHECK_SIZEOF(short,, $std_includes)
- AC_CHECK_SIZEOF(unsigned short,, $std_includes)
- AC_CHECK_SIZEOF(int,, $std_includes)
- AC_CHECK_SIZEOF(unsigned int,, $std_includes)
- AC_CHECK_SIZEOF(long,, $std_includes)
- AC_CHECK_SIZEOF(unsigned long,, $std_includes)
- AC_CHECK_SIZEOF(long long,, $std_includes)
- AC_CHECK_SIZEOF(unsigned long long,, $std_includes)
- AC_CHECK_SIZEOF(char *,, $std_includes)
-
- # Second, check for the types we really want, and if we don't find
- # them, search for something of the same size and signed-ness.
- AC_SUBST(u_int8_decl)
- AC_CHECK_TYPE(u_int8_t,, [
- AM_UNSIGNED_TYPES(u_int8_decl, u_int8_t, 1)], $std_includes)
- AC_SUBST(int8_decl)
- AC_CHECK_TYPE(int8_t,, [
- AM_SIGNED_TYPES(int8_decl, int8_t, 1)], $std_includes)
- AC_SUBST(u_int16_decl)
- AC_CHECK_TYPE(u_int16_t,, [
- AM_UNSIGNED_TYPES(u_int16_decl, u_int16_t, 2)], $std_includes)
- AC_SUBST(int16_decl)
- AC_CHECK_TYPE(int16_t,, [
- AM_SIGNED_TYPES(int16_decl, int16_t, 2)], $std_includes)
- AC_SUBST(u_int32_decl)
- AC_CHECK_TYPE(u_int32_t,, [
- AM_UNSIGNED_TYPES(u_int32_decl, u_int32_t, 4)], $std_includes)
- AC_SUBST(int32_decl)
- AC_CHECK_TYPE(int32_t,, [
- AM_SIGNED_TYPES(int32_decl, int32_t, 4)], $std_includes)
- AC_SUBST(u_int64_decl)
- AC_CHECK_TYPE(u_int64_t,, [
- AM_UNSIGNED_TYPES(u_int64_decl, u_int64_t, 8)], $std_includes)
- AC_SUBST(int64_decl)
- AC_CHECK_TYPE(int64_t,, [
- AM_SIGNED_TYPES(int64_decl, int64_t, 8)], $std_includes)
-
- # We additionally require FILE, off_t, pid_t, size_t, ssize_t,
- # time_t, uintmax_t and uintptr_t.
+ # We require FILE, off_t, pid_t, size_t, ssize_t, time_t, uintmax_t
+ # and uintptr_t.
AC_SUBST(FILE_t_decl)
AC_CHECK_TYPE(FILE *,, AC_MSG_ERROR([No FILE type.]), $std_includes)
AC_SUBST(off_t_decl)