spamassassin.m4 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. dnl check for libspamc required includes
  2. AC_DEFUN([AC_SPAMASSASSIN],
  3. [dnl
  4. AC_CHECK_HEADERS(sys/time.h syslog.h unistd.h errno.h sys/errno.h)
  5. AC_CHECK_HEADERS(time.h sysexits.h sys/socket.h netdb.h netinet/in.h)
  6. AC_CHECK_HEADERS(openssl/crypto.h)
  7. AC_CACHE_CHECK([for SHUT_RD],
  8. shutrd, [
  9. AC_TRY_COMPILE([#include <sys/types.h>
  10. #include <sys/socket.h>],
  11. [printf ("%d", SHUT_RD); return 0;],
  12. [shutrd=yes],
  13. [shutrd=no]),
  14. ])
  15. if test $shutrd = yes ; then
  16. AC_DEFINE(HAVE_SHUT_RD, 1, HAVE_SHUT_RD)
  17. fi
  18. dnl ----------------------------------------------------------------------
  19. AC_CHECK_FUNCS(socket strdup strtod strtol snprintf shutdown)
  20. dnl ----------------------------------------------------------------------
  21. AC_CACHE_CHECK([for h_errno],
  22. herrno, [
  23. AC_TRY_COMPILE([#include <netdb.h>],
  24. [printf ("%d", h_errno); return 0;],
  25. [herrno=yes],
  26. [herrno=no]),
  27. ])
  28. if test $herrno = yes ; then
  29. AC_DEFINE(HAVE_H_ERRNO, 1, HAVE_H_ERRNO)
  30. fi
  31. dnl ----------------------------------------------------------------------
  32. dnl ----------------------------------------------------------------------
  33. AC_CACHE_CHECK([for in_addr_t],
  34. inaddrt, [
  35. AC_TRY_COMPILE([#include <sys/types.h>
  36. #include <netinet/in.h>],
  37. [in_addr_t foo; return 0;],
  38. [inaddrt=yes],
  39. [inaddrt=no]),
  40. ])
  41. if test $inaddrt = no ; then
  42. AC_CHECK_TYPE(in_addr_t, unsigned long)
  43. fi
  44. dnl ----------------------------------------------------------------------
  45. AC_CACHE_CHECK([for INADDR_NONE],
  46. haveinaddrnone, [
  47. AC_TRY_COMPILE([#include <sys/types.h>
  48. #include <netinet/in.h>],
  49. [in_addr_t foo = INADDR_NONE; return 0;],
  50. [haveinaddrnone=yes],
  51. [haveinaddrnone=no]),
  52. ])
  53. if test $haveinaddrnone = yes ; then
  54. AC_DEFINE(HAVE_INADDR_NONE, 1, HAVE_INADDR_NONE)
  55. fi
  56. dnl ----------------------------------------------------------------------
  57. AC_CACHE_CHECK([for EX__MAX],
  58. haveexmax, [
  59. AC_TRY_COMPILE([#ifdef HAVE_SYSEXITS_H
  60. #include <sysexits.h>
  61. #endif
  62. #include <errno.h>],
  63. [int foo = EX__MAX; return 0;],
  64. [haveexmax=yes],
  65. [haveexmax=no]),
  66. ])
  67. if test $haveexmax = yes ; then
  68. AC_DEFINE(HAVE_EX__MAX, 1, HAVE_EX__MAX)
  69. fi
  70. if test x$ac_cv_enable_openssl = xyes; then
  71. AC_DEFINE(SPAMC_SSL, 1, Compile libspamc with OpenSSL support)
  72. fi
  73. ])