1 dnl check for libspamc required includes
3 AC_DEFUN([AC_SPAMASSASSIN],
6 AC_CHECK_HEADERS(sys/time.h syslog.h unistd.h errno.h sys/errno.h)
7 AC_CHECK_HEADERS(time.h sysexits.h sys/socket.h netdb.h netinet/in.h)
9 AC_CACHE_CHECK([for SHUT_RD],
11 AC_TRY_COMPILE([#include <sys/types.h>
12 #include <sys/socket.h>],
13 [printf ("%d", SHUT_RD); return 0;],
17 if test $shutrd = yes ; then
18 AC_DEFINE(HAVE_SHUT_RD, 1, HAVE_SHUT_RD)
21 dnl ----------------------------------------------------------------------
23 AC_CHECK_FUNCS(socket strdup strtod strtol snprintf shutdown)
25 dnl ----------------------------------------------------------------------
27 AC_CACHE_CHECK([for h_errno],
29 AC_TRY_COMPILE([#include <netdb.h>],
30 [printf ("%d", h_errno); return 0;],
34 if test $herrno = yes ; then
35 AC_DEFINE(HAVE_H_ERRNO, 1, HAVE_H_ERRNO)
38 dnl ----------------------------------------------------------------------
40 dnl ----------------------------------------------------------------------
42 AC_CACHE_CHECK([for in_addr_t],
44 AC_TRY_COMPILE([#include <sys/types.h>
45 #include <netinet/in.h>],
46 [in_addr_t foo; return 0;],
50 if test $inaddrt = no ; then
51 AC_CHECK_TYPE(in_addr_t, unsigned long)
54 dnl ----------------------------------------------------------------------
56 AC_CACHE_CHECK([for INADDR_NONE],
58 AC_TRY_COMPILE([#include <sys/types.h>
59 #include <netinet/in.h>],
60 [in_addr_t foo = INADDR_NONE; return 0;],
64 if test $haveinaddrnone = yes ; then
65 AC_DEFINE(HAVE_INADDR_NONE, 1, HAVE_INADDR_NONE)
68 dnl ----------------------------------------------------------------------
70 AC_CACHE_CHECK([for EX__MAX],
72 AC_TRY_COMPILE([#ifdef HAVE_SYSEXITS_H
76 [int foo = EX__MAX; return 0;],
80 if test $haveexmax = yes ; then
81 AC_DEFINE(HAVE_EX__MAX, 1, HAVE_EX__MAX)