poll_h.m4 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # poll_h.m4 serial 2
  2. dnl Copyright (C) 2010-2017 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. dnl Written by Bruno Haible.
  7. AC_DEFUN([gl_POLL_H],
  8. [
  9. dnl Use AC_REQUIRE here, so that the default behavior below is expanded
  10. dnl once only, before all statements that occur in other macros.
  11. AC_REQUIRE([gl_POLL_H_DEFAULTS])
  12. AC_CHECK_HEADERS_ONCE([poll.h])
  13. if test $ac_cv_header_poll_h = yes; then
  14. HAVE_POLL_H=1
  15. else
  16. HAVE_POLL_H=0
  17. fi
  18. AC_SUBST([HAVE_POLL_H])
  19. dnl <poll.h> is always overridden, because of GNULIB_POSIXCHECK.
  20. gl_CHECK_NEXT_HEADERS([poll.h])
  21. dnl Check for declarations of anything we want to poison if the
  22. dnl corresponding gnulib module is not in use.
  23. gl_WARN_ON_USE_PREPARE([[#include <poll.h>]],
  24. [poll])
  25. ])
  26. AC_DEFUN([gl_POLL_MODULE_INDICATOR],
  27. [
  28. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
  29. AC_REQUIRE([gl_POLL_H_DEFAULTS])
  30. gl_MODULE_INDICATOR_SET_VARIABLE([$1])
  31. dnl Define it also as a C macro, for the benefit of the unit tests.
  32. gl_MODULE_INDICATOR_FOR_TESTS([$1])
  33. ])
  34. AC_DEFUN([gl_POLL_H_DEFAULTS],
  35. [
  36. GNULIB_POLL=0; AC_SUBST([GNULIB_POLL])
  37. dnl Assume proper GNU behavior unless another module says otherwise.
  38. HAVE_POLL=1; AC_SUBST([HAVE_POLL])
  39. REPLACE_POLL=0; AC_SUBST([REPLACE_POLL])
  40. ])