2c196fccff9ed5a93e2b3e07affc964c6e17ba95
[claws.git] / ac / spamassassin.m4
1 dnl check for libspamc required includes
2
3 AC_DEFUN(AC_SPAMASSASSIN,
4 [dnl
5
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
9 AC_CACHE_CHECK([for SHUT_RD],
10        shutrd, [
11                 AC_TRY_COMPILE([#include <sys/types.h>
12 #include <sys/socket.h>],
13                         [printf ("%d", SHUT_RD); return 0;],
14                                         [shutrd=yes],
15                                         [shutrd=no]),
16        ])
17 if test $shutrd = yes ; then
18   AC_DEFINE(HAVE_SHUT_RD, 1, HAVE_SHUT_RD)
19 fi
20
21 dnl ----------------------------------------------------------------------
22
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)
27
28 AC_CHECK_FUNCS(socket strdup strtod strtol snprintf shutdown)
29
30 dnl ----------------------------------------------------------------------
31
32 AC_CACHE_CHECK([for h_errno],
33         herrno, [
34                 AC_TRY_COMPILE([#include <netdb.h>],
35                         [printf ("%d", h_errno); return 0;],
36                                         [herrno=yes],
37                                         [herrno=no]),
38         ])
39 if test $herrno = yes ; then
40   AC_DEFINE(HAVE_H_ERRNO, 1, HAVE_H_ERRNO)
41 fi
42
43 dnl ----------------------------------------------------------------------
44
45 dnl ----------------------------------------------------------------------
46
47 AC_CACHE_CHECK([for in_addr_t],
48         inaddrt, [
49                 AC_TRY_COMPILE([#include <sys/types.h>
50 #include <netinet/in.h>],
51                         [in_addr_t foo; return 0;],
52                                         [inaddrt=yes],
53                                         [inaddrt=no]),
54         ])
55 if test $inaddrt = no ; then
56   AC_CHECK_TYPE(in_addr_t, unsigned long)
57 fi
58
59 dnl ----------------------------------------------------------------------
60
61 AC_CACHE_CHECK([for INADDR_NONE],
62         haveinaddrnone, [
63                 AC_TRY_COMPILE([#include <sys/types.h>
64 #include <netinet/in.h>],
65                         [in_addr_t foo = INADDR_NONE; return 0;],
66                                         [haveinaddrnone=yes],
67                                         [haveinaddrnone=no]),
68         ])
69 if test $haveinaddrnone = yes ; then
70   AC_DEFINE(HAVE_INADDR_NONE, 1, HAVE_INADDR_NONE)
71 fi
72
73 dnl ----------------------------------------------------------------------
74
75 AC_CACHE_CHECK([for EX__MAX],
76         haveexmax, [
77                 AC_TRY_COMPILE([#ifdef HAVE_SYSEXITS_H
78 #include <sysexits.h>
79 #endif
80 #include <errno.h>],
81                         [int foo = EX__MAX; return 0;],
82                                         [haveexmax=yes],
83                                         [haveexmax=no]),
84         ])
85 if test $haveexmax = yes ; then
86   AC_DEFINE(HAVE_EX__MAX, 1, HAVE_EX__MAX)
87 fi
88
89 ])