spamassassin.m4 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. AC_DEFUN([AC_SPAMASSASSIN],
  7. [dnl
  8. AC_CHECK_HEADERS(sys/time.h syslog.h unistd.h errno.h sys/errno.h)
  9. AC_CHECK_HEADERS(time.h sysexits.h sys/socket.h netdb.h netinet/in.h)
  10. AC_CACHE_CHECK([for SHUT_RD],
  11. spamassassin_cv_has_shutrd, [
  12. AC_TRY_COMPILE([#include <sys/types.h>
  13. #include <sys/socket.h>],
  14. [printf ("%d", SHUT_RD); return 0;],
  15. [spamassassin_cv_has_shutrd=yes],
  16. [spamassassin_cv_has_shutrd=no]),
  17. ])
  18. if test $spamassassin_cv_has_shutrd = yes ; then
  19. AC_DEFINE(HAVE_SHUT_RD, 1, HAVE_SHUT_RD)
  20. fi
  21. dnl ----------------------------------------------------------------------
  22. AC_CHECK_FUNCS(socket strdup strtod strtol snprintf shutdown)
  23. dnl ----------------------------------------------------------------------
  24. AC_CACHE_CHECK([for h_errno],
  25. spamassassin_cv_has_herrno, [
  26. AC_TRY_COMPILE([#include <netdb.h>],
  27. [printf ("%d", h_errno); return 0;],
  28. [spamassassin_cv_has_herrno=yes],
  29. [spamassassin_cv_has_herrno=no]),
  30. ])
  31. if test $spamassassin_cv_has_herrno = yes ; then
  32. AC_DEFINE(HAVE_H_ERRNO, 1, HAVE_H_ERRNO)
  33. fi
  34. dnl ----------------------------------------------------------------------
  35. dnl ----------------------------------------------------------------------
  36. AC_CACHE_CHECK([for in_addr_t],
  37. spamassassin_cv_has_inaddrt, [
  38. AC_TRY_COMPILE([#include <sys/types.h>
  39. #include <netinet/in.h>],
  40. [in_addr_t foo; return 0;],
  41. [spamassassin_cv_has_inaddrt=yes],
  42. [spamassassin_cv_has_inaddrt=no]),
  43. ])
  44. if test $spamassassin_cv_has_inaddrt = no ; then
  45. AC_CHECK_TYPE(in_addr_t, unsigned long)
  46. fi
  47. dnl ----------------------------------------------------------------------
  48. AC_CACHE_CHECK([for INADDR_NONE],
  49. spamassassin_cv_has_haveinaddrnone, [
  50. AC_TRY_COMPILE([#include <sys/types.h>
  51. #include <netinet/in.h>],
  52. [in_addr_t foo = INADDR_NONE; return 0;],
  53. [spamassassin_cv_has_haveinaddrnone=yes],
  54. [spamassassin_cv_has_haveinaddrnone=no]),
  55. ])
  56. if test $spamassassin_cv_has_haveinaddrnone = yes ; then
  57. AC_DEFINE(HAVE_INADDR_NONE, 1, HAVE_INADDR_NONE)
  58. fi
  59. dnl ----------------------------------------------------------------------
  60. AC_CACHE_CHECK([for EX__MAX],
  61. spamassassin_cv_has_haveexmax, [
  62. AC_TRY_COMPILE([#ifdef HAVE_SYSEXITS_H
  63. #include <sysexits.h>
  64. #endif
  65. #include <errno.h>],
  66. [int foo = EX__MAX; return 0;],
  67. [spamassassin_cv_has_haveexmax=yes],
  68. [spamassassin_cv_has_haveexmax=no]),
  69. ])
  70. if test $spamassassin_cv_has_haveexmax = yes ; then
  71. AC_DEFINE(HAVE_EX__MAX, 1, HAVE_EX__MAX)
  72. fi
  73. ])