spamassassin.m4 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
  13. #include <stdio.h>
  14. #include <sys/socket.h>]], [[printf ("%d", SHUT_RD); return 0;]])],[spamassassin_cv_has_shutrd=yes],[spamassassin_cv_has_shutrd=no]),
  15. ])
  16. if test $spamassassin_cv_has_shutrd = yes ; then
  17. AC_DEFINE(HAVE_SHUT_RD, 1, HAVE_SHUT_RD)
  18. fi
  19. dnl ----------------------------------------------------------------------
  20. AC_CHECK_FUNCS(socket strdup strtod strtol snprintf shutdown)
  21. dnl ----------------------------------------------------------------------
  22. AC_CACHE_CHECK([for h_errno],
  23. spamassassin_cv_has_herrno, [
  24. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>
  25. #include <stdio.h>
  26. ]], [[printf ("%d", h_errno); return 0;]])],[spamassassin_cv_has_herrno=yes],[spamassassin_cv_has_herrno=no]),
  27. ])
  28. if test $spamassassin_cv_has_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. spamassassin_cv_has_inaddrt, [
  35. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
  36. #include <netinet/in.h>]], [[in_addr_t foo; return 0;]])],[spamassassin_cv_has_inaddrt=yes],[spamassassin_cv_has_inaddrt=no]),
  37. ])
  38. if test $spamassassin_cv_has_inaddrt = no ; then
  39. AC_CHECK_TYPE(in_addr_t, unsigned long)
  40. fi
  41. dnl ----------------------------------------------------------------------
  42. AC_CACHE_CHECK([for INADDR_NONE],
  43. spamassassin_cv_has_haveinaddrnone, [
  44. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
  45. #include <netinet/in.h>]], [[in_addr_t foo = INADDR_NONE; return 0;]])],[spamassassin_cv_has_haveinaddrnone=yes],[spamassassin_cv_has_haveinaddrnone=no]),
  46. ])
  47. if test $spamassassin_cv_has_haveinaddrnone = yes ; then
  48. AC_DEFINE(HAVE_INADDR_NONE, 1, HAVE_INADDR_NONE)
  49. fi
  50. dnl ----------------------------------------------------------------------
  51. AC_CACHE_CHECK([for EX__MAX],
  52. spamassassin_cv_has_haveexmax, [
  53. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_SYSEXITS_H
  54. #include <sysexits.h>
  55. #endif
  56. #include <errno.h>]], [[int foo = EX__MAX; return 0;]])],[spamassassin_cv_has_haveexmax=yes],[spamassassin_cv_has_haveexmax=no]),
  57. ])
  58. if test $spamassassin_cv_has_haveexmax = yes ; then
  59. AC_DEFINE(HAVE_EX__MAX, 1, HAVE_EX__MAX)
  60. fi
  61. ])