AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
dnl Various standard types.
-AC_CHECK_TYPE([pid_t], [int])
+AC_CHECK_TYPE([pid_t], [],
+ [AC_DEFINE([pid_t], [int],
+ [Define to `int' if <sys/types.h> does not define])])
AC_TYPE_UID_T
-AC_CHECK_TYPE([ssize_t], [int])
-AC_CHECK_TYPE([socklen_t], [int])
+AC_CHECK_TYPE([ssize_t], [],
+ [AC_DEFINE([ssize_t], [int],
+ [Define to `int' if <sys/types.h> does not define])])
+AC_CHECK_TYPE([socklen_t], [],
+ [AC_DEFINE([socklen_t], [int],
+ [Define to `int' if <sys/socket.h> does not define])],
+ [AC_INCLUDES_DEFAULT
+#include <sys/socket.h>
+])
dnl The maths library.
mdw_ORIG_LIBS=$LIBS LIBS=
dnl Find out whether very long integer types are available.
AC_CHECK_HEADERS([stdint.h])
AC_SUBST([have_stdint_h])
-AC_C_LONG_LONG
+AX_C_LONG_LONG
dnl Some equipment wanted for checking CPU features at runtime.
AC_CHECK_HEADERS([asm/hwcap.h])
catacomb_LIMIT([SIZET], [=0], [~(size_t)0])
AC_SUBST([limits])
+dnl Figure out other aspects of the implementation's arithmetic.
+AC_CACHE_CHECK([whether negative numbers use two's complement],
+ [catacomb_cv_neg_twoc],
+[AC_TRY_COMPILE(
+[#include <limits.h>],
+[int check[2*!!(-INT_MAX == INT_MIN + 1) - 1];],
+[catacomb_cv_neg_twoc=yes],
+[catacomb_cv_neg_twoc=no])])
+case $catacomb_cv_neg_twoc in
+ yes)
+ AC_DEFINE([NEG_TWOC], [1],
+ [Define if signed numbers are represented in two's complement.])
+ ;;
+esac
+
dnl Functions used for noise-gathering.
AC_CHECK_FUNCS([setgroups])
AC_CHECK_HEADERS([linux/random.h])