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