2010-12-18 [mones] 3.7.8cvs9
[claws.git] / m4 / spamassassin.m4
blob04007371537613e8a28eba6f82d5e0119020536b
1 dnl check for libspamc required includes
3 AC_DEFUN([AC_SPAMASSASSIN],
4 [dnl
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],
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)
21 dnl ----------------------------------------------------------------------
23 AC_CHECK_FUNCS(socket strdup strtod strtol snprintf shutdown)
25 dnl ----------------------------------------------------------------------
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)
38 dnl ----------------------------------------------------------------------
40 dnl ----------------------------------------------------------------------
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)
54 dnl ----------------------------------------------------------------------
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)
68 dnl ----------------------------------------------------------------------
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)