+dnl Do a series of bizarre compilation tests
+save_CFLAGS=$CFLAGS
+
+dnl Check for ntohl, etc.
+CFLAGS="${CFLAGS} -Wall -Werror"
+AC_MSG_CHECKING([for ntohl in sys/param.h])
+AC_TRY_COMPILE([#include <sys/param.h>
+void foo() { int meuh; ntohl(meuh); }],,
+ AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if ntohl is in <sys/param.h>.)
+ AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
+
+dnl Check for -rdynamic flag
+CFLAGS="${CFLAGS} -rdynamic"
+AC_MSG_CHECKING([if \$CC accepts -rdynamic])
+AC_TRY_COMPILE([],,
+ DYNAMIC_FLAG="-rdynamic"
+ AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
+
+dnl End of the bizarre compilation tests
+CFLAGS=$save_CFLAGS
+
+dnl Check for boolean_t in sys/types.h
+AC_MSG_CHECKING([for boolean_t in sys/types.h])
+AC_TRY_COMPILE([#include <sys/types.h>
+void quux() { boolean_t foo; }],,
+ AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
+ AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
+