2010-02-03 [colin] 3.7.5cvs4
[claws.git] / m4 / 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        spamassassin_cv_has_shutrd, [
11                 AC_TRY_COMPILE([#include <sys/types.h>
12 #include <sys/socket.h>],
13                         [printf ("%d", SHUT_RD); return 0;],
14                                         [spamassassin_cv_has_shutrd=yes],
15                                         [spamassassin_cv_has_shutrd=no]),
16        ])
17 if test $spamassassin_cv_has_shutrd = yes ; then
18   AC_DEFINE(HAVE_SHUT_RD, 1, HAVE_SHUT_RD)
19 fi
20
21 dnl ----------------------------------------------------------------------
22
23 AC_CHECK_FUNCS(socket strdup strtod strtol snprintf shutdown)
24
25 dnl ----------------------------------------------------------------------
26
27 AC_CACHE_CHECK([for h_errno],
28         spamassassin_cv_has_herrno, [
29                 AC_TRY_COMPILE([#include <netdb.h>],
30                         [printf ("%d", h_errno); return 0;],
31                                         [spamassassin_cv_has_herrno=yes],
32                                         [spamassassin_cv_has_herrno=no]),
33         ])
34 if test $spamassassin_cv_has_herrno = yes ; then
35   AC_DEFINE(HAVE_H_ERRNO, 1, HAVE_H_ERRNO)
36 fi
37
38 dnl ----------------------------------------------------------------------
39
40 dnl ----------------------------------------------------------------------
41
42 AC_CACHE_CHECK([for in_addr_t],
43         spamassassin_cv_has_inaddrt, [
44                 AC_TRY_COMPILE([#include <sys/types.h>
45 #include <netinet/in.h>],
46                         [in_addr_t foo; return 0;],
47                                         [spamassassin_cv_has_inaddrt=yes],
48                                         [spamassassin_cv_has_inaddrt=no]),
49         ])
50 if test $spamassassin_cv_has_inaddrt = no ; then
51   AC_CHECK_TYPE(in_addr_t, unsigned long)
52 fi
53
54 dnl ----------------------------------------------------------------------
55
56 AC_CACHE_CHECK([for INADDR_NONE],
57         spamassassin_cv_has_haveinaddrnone, [
58                 AC_TRY_COMPILE([#include <sys/types.h>
59 #include <netinet/in.h>],
60                         [in_addr_t foo = INADDR_NONE; return 0;],
61                                         [spamassassin_cv_has_haveinaddrnone=yes],
62                                         [spamassassin_cv_has_haveinaddrnone=no]),
63         ])
64 if test $spamassassin_cv_has_haveinaddrnone = yes ; then
65   AC_DEFINE(HAVE_INADDR_NONE, 1, HAVE_INADDR_NONE)
66 fi
67
68 dnl ----------------------------------------------------------------------
69
70 AC_CACHE_CHECK([for EX__MAX],
71         spamassassin_cv_has_haveexmax, [
72                 AC_TRY_COMPILE([#ifdef HAVE_SYSEXITS_H
73 #include <sysexits.h>
74 #endif
75 #include <errno.h>],
76                         [int foo = EX__MAX; return 0;],
77                                         [spamassassin_cv_has_haveexmax=yes],
78                                         [spamassassin_cv_has_haveexmax=no]),
79         ])
80 if test $spamassassin_cv_has_haveexmax = yes ; then
81   AC_DEFINE(HAVE_EX__MAX, 1, HAVE_EX__MAX)
82 fi
83
84 ])