Fix bug 4628: typos in the README file, patch by Andreas Rönnquist.
[claws.git] / m4 / spamassassin.m4
1 dnl check for libspamc required includes
2 dnl Copyright (C) 2003 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 AC_DEFUN([AC_SPAMASSASSIN],
8 [dnl
9
10 AC_CHECK_HEADERS(sys/time.h syslog.h unistd.h errno.h sys/errno.h)
11 AC_CHECK_HEADERS(time.h sysexits.h sys/socket.h netdb.h netinet/in.h)
12
13 AC_CACHE_CHECK([for SHUT_RD],
14        spamassassin_cv_has_shutrd, [
15                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
16 #include <stdio.h>
17 #include <sys/socket.h>]], [[printf ("%d", SHUT_RD); return 0;]])],[spamassassin_cv_has_shutrd=yes],[spamassassin_cv_has_shutrd=no]),
18        ])
19 if test $spamassassin_cv_has_shutrd = yes ; then
20   AC_DEFINE(HAVE_SHUT_RD, 1, HAVE_SHUT_RD)
21 fi
22
23 dnl ----------------------------------------------------------------------
24
25 AC_CHECK_FUNCS(socket strdup strtod strtol snprintf shutdown)
26
27 dnl ----------------------------------------------------------------------
28
29 AC_CACHE_CHECK([for h_errno],
30         spamassassin_cv_has_herrno, [
31                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>
32 #include <stdio.h>
33 ]], [[printf ("%d", h_errno); return 0;]])],[spamassassin_cv_has_herrno=yes],[spamassassin_cv_has_herrno=no]),
34         ])
35 if test $spamassassin_cv_has_herrno = yes ; then
36   AC_DEFINE(HAVE_H_ERRNO, 1, HAVE_H_ERRNO)
37 fi
38
39 dnl ----------------------------------------------------------------------
40
41 dnl ----------------------------------------------------------------------
42
43 AC_CACHE_CHECK([for in_addr_t],
44         spamassassin_cv_has_inaddrt, [
45                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
46 #include <netinet/in.h>]], [[in_addr_t foo; return 0;]])],[spamassassin_cv_has_inaddrt=yes],[spamassassin_cv_has_inaddrt=no]),
47         ])
48 if test $spamassassin_cv_has_inaddrt = no ; then
49   AC_CHECK_TYPE(in_addr_t, unsigned long)
50 fi
51
52 dnl ----------------------------------------------------------------------
53
54 AC_CACHE_CHECK([for INADDR_NONE],
55         spamassassin_cv_has_haveinaddrnone, [
56                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
57 #include <netinet/in.h>]], [[in_addr_t foo = INADDR_NONE; return 0;]])],[spamassassin_cv_has_haveinaddrnone=yes],[spamassassin_cv_has_haveinaddrnone=no]),
58         ])
59 if test $spamassassin_cv_has_haveinaddrnone = yes ; then
60   AC_DEFINE(HAVE_INADDR_NONE, 1, HAVE_INADDR_NONE)
61 fi
62
63 dnl ----------------------------------------------------------------------
64
65 AC_CACHE_CHECK([for EX__MAX],
66         spamassassin_cv_has_haveexmax, [
67                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_SYSEXITS_H
68 #include <sysexits.h>
69 #endif
70 #include <errno.h>]], [[int foo = EX__MAX; return 0;]])],[spamassassin_cv_has_haveexmax=yes],[spamassassin_cv_has_haveexmax=no]),
71         ])
72 if test $spamassassin_cv_has_haveexmax = yes ; then
73   AC_DEFINE(HAVE_EX__MAX, 1, HAVE_EX__MAX)
74 fi
75
76 ])