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)
8 AC_CHECK_HEADERS(openssl/crypto.h)
10 AC_CACHE_CHECK([for SHUT_RD],
12 AC_TRY_COMPILE([#include <sys/types.h>
13 #include <sys/socket.h>],
14 [printf ("%d", SHUT_RD); return 0;],
18 if test $shutrd = yes ; then
19 AC_DEFINE(HAVE_SHUT_RD, 1, HAVE_SHUT_RD)
22 dnl ----------------------------------------------------------------------
24 AC_CHECK_FUNCS(socket strdup strtod strtol snprintf shutdown)
26 dnl ----------------------------------------------------------------------
28 AC_CACHE_CHECK([for h_errno],
30 AC_TRY_COMPILE([#include <netdb.h>],
31 [printf ("%d", h_errno); return 0;],
35 if test $herrno = yes ; then
36 AC_DEFINE(HAVE_H_ERRNO, 1, HAVE_H_ERRNO)
39 dnl ----------------------------------------------------------------------
41 dnl ----------------------------------------------------------------------
43 AC_CACHE_CHECK([for in_addr_t],
45 AC_TRY_COMPILE([#include <sys/types.h>
46 #include <netinet/in.h>],
47 [in_addr_t foo; return 0;],
51 if test $inaddrt = no ; then
52 AC_CHECK_TYPE(in_addr_t, unsigned long)
55 dnl ----------------------------------------------------------------------
57 AC_CACHE_CHECK([for INADDR_NONE],
59 AC_TRY_COMPILE([#include <sys/types.h>
60 #include <netinet/in.h>],
61 [in_addr_t foo = INADDR_NONE; return 0;],
65 if test $haveinaddrnone = yes ; then
66 AC_DEFINE(HAVE_INADDR_NONE, 1, HAVE_INADDR_NONE)
69 dnl ----------------------------------------------------------------------
71 AC_CACHE_CHECK([for EX__MAX],
73 AC_TRY_COMPILE([#ifdef HAVE_SYSEXITS_H
77 [int foo = EX__MAX; return 0;],
81 if test $haveexmax = yes ; then
82 AC_DEFINE(HAVE_EX__MAX, 1, HAVE_EX__MAX)
85 if test x$ac_cv_enable_openssl = xyes; then
86 AC_DEFINE(SPAMC_SSL, 1, Compile libspamc with OpenSSL support)