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.
7 AC_DEFUN([AC_SPAMASSASSIN],
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)
13 AC_CACHE_CHECK([for SHUT_RD],
14 spamassassin_cv_has_shutrd, [
15 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
17 #include <sys/socket.h>]], [[printf ("%d", SHUT_RD); return 0;]])],[spamassassin_cv_has_shutrd=yes],[spamassassin_cv_has_shutrd=no]),
19 if test $spamassassin_cv_has_shutrd = yes ; then
20 AC_DEFINE(HAVE_SHUT_RD, 1, HAVE_SHUT_RD)
23 dnl ----------------------------------------------------------------------
25 AC_CHECK_FUNCS(socket strdup strtod strtol snprintf shutdown)
27 dnl ----------------------------------------------------------------------
29 AC_CACHE_CHECK([for h_errno],
30 spamassassin_cv_has_herrno, [
31 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>
33 ]], [[printf ("%d", h_errno); return 0;]])],[spamassassin_cv_has_herrno=yes],[spamassassin_cv_has_herrno=no]),
35 if test $spamassassin_cv_has_herrno = yes ; then
36 AC_DEFINE(HAVE_H_ERRNO, 1, HAVE_H_ERRNO)
39 dnl ----------------------------------------------------------------------
41 dnl ----------------------------------------------------------------------
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]),
48 if test $spamassassin_cv_has_inaddrt = no ; then
49 AC_CHECK_TYPE(in_addr_t, unsigned long)
52 dnl ----------------------------------------------------------------------
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]),
59 if test $spamassassin_cv_has_haveinaddrnone = yes ; then
60 AC_DEFINE(HAVE_INADDR_NONE, 1, HAVE_INADDR_NONE)
63 dnl ----------------------------------------------------------------------
65 AC_CACHE_CHECK([for EX__MAX],
66 spamassassin_cv_has_haveexmax, [
67 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_SYSEXITS_H
70 #include <errno.h>]], [[int foo = EX__MAX; return 0;]])],[spamassassin_cv_has_haveexmax=yes],[spamassassin_cv_has_haveexmax=no]),
72 if test $spamassassin_cv_has_haveexmax = yes ; then
73 AC_DEFINE(HAVE_EX__MAX, 1, HAVE_EX__MAX)