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_LIB(socket, socket)
25 AC_CHECK_LIB(ssl, SSL_CTX_free)
26 AC_CHECK_LIB(crypto, CRYPTO_lock)
27 AC_CHECK_LIB(inet, connect)
28 AC_CHECK_LIB(nsl, t_accept)
29 AC_CHECK_LIB(dl, dlopen)
31 AC_CHECK_FUNCS(socket strdup strtod strtol snprintf shutdown)
33 dnl ----------------------------------------------------------------------
35 AC_CACHE_CHECK([for h_errno],
37 AC_TRY_COMPILE([#include <netdb.h>],
38 [printf ("%d", h_errno); return 0;],
42 if test $herrno = yes ; then
43 AC_DEFINE(HAVE_H_ERRNO, 1, HAVE_H_ERRNO)
46 dnl ----------------------------------------------------------------------
48 dnl ----------------------------------------------------------------------
50 AC_CACHE_CHECK([for in_addr_t],
52 AC_TRY_COMPILE([#include <sys/types.h>
53 #include <netinet/in.h>],
54 [in_addr_t foo; return 0;],
58 if test $inaddrt = no ; then
59 AC_CHECK_TYPE(in_addr_t, unsigned long)
62 dnl ----------------------------------------------------------------------
64 AC_CACHE_CHECK([for INADDR_NONE],
66 AC_TRY_COMPILE([#include <sys/types.h>
67 #include <netinet/in.h>],
68 [in_addr_t foo = INADDR_NONE; return 0;],
72 if test $haveinaddrnone = yes ; then
73 AC_DEFINE(HAVE_INADDR_NONE, 1, HAVE_INADDR_NONE)
76 dnl ----------------------------------------------------------------------
78 AC_CACHE_CHECK([for EX__MAX],
80 AC_TRY_COMPILE([#ifdef HAVE_SYSEXITS_H
84 [int foo = EX__MAX; return 0;],
88 if test $haveexmax = yes ; then
89 AC_DEFINE(HAVE_EX__MAX, 1, HAVE_EX__MAX)
92 if test "$USE_OPENSSL" -ne 0; then
93 AC_DEFINE(SPAMC_SSL, 1, Compile libspamc with OpenSSL support)