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_LIB(socket, socket)
24 AC_CHECK_LIB(inet, connect)
25 AC_CHECK_LIB(nsl, t_accept)
26 AC_CHECK_LIB(dl, dlopen)
28 AC_CHECK_FUNCS(socket strdup strtod strtol snprintf shutdown)
30 dnl ----------------------------------------------------------------------
32 AC_CACHE_CHECK([for h_errno],
34 AC_TRY_COMPILE([#include <netdb.h>],
35 [printf ("%d", h_errno); return 0;],
39 if test $herrno = yes ; then
40 AC_DEFINE(HAVE_H_ERRNO, 1, HAVE_H_ERRNO)
43 dnl ----------------------------------------------------------------------
45 dnl ----------------------------------------------------------------------
47 AC_CACHE_CHECK([for in_addr_t],
49 AC_TRY_COMPILE([#include <sys/types.h>
50 #include <netinet/in.h>],
51 [in_addr_t foo; return 0;],
55 if test $inaddrt = no ; then
56 AC_CHECK_TYPE(in_addr_t, unsigned long)
59 dnl ----------------------------------------------------------------------
61 AC_CACHE_CHECK([for INADDR_NONE],
63 AC_TRY_COMPILE([#include <sys/types.h>
64 #include <netinet/in.h>],
65 [in_addr_t foo = INADDR_NONE; return 0;],
69 if test $haveinaddrnone = yes ; then
70 AC_DEFINE(HAVE_INADDR_NONE, 1, HAVE_INADDR_NONE)
73 dnl ----------------------------------------------------------------------
75 AC_CACHE_CHECK([for EX__MAX],
77 AC_TRY_COMPILE([#ifdef HAVE_SYSEXITS_H
81 [int foo = EX__MAX; return 0;],
85 if test $haveexmax = yes ; then
86 AC_DEFINE(HAVE_EX__MAX, 1, HAVE_EX__MAX)