poll_h.m4 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # poll_h.m4 serial 3
  2. dnl Copyright (C) 2010-2021 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. gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_H
  22. dnl Check for declarations of anything we want to poison if the
  23. dnl corresponding gnulib module is not in use.
  24. gl_WARN_ON_USE_PREPARE([[#include <poll.h>]],
  25. [poll])
  26. ])
  27. AC_DEFUN([gl_POLL_MODULE_INDICATOR],
  28. [
  29. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
  30. AC_REQUIRE([gl_POLL_H_DEFAULTS])
  31. gl_MODULE_INDICATOR_SET_VARIABLE([$1])
  32. dnl Define it also as a C macro, for the benefit of the unit tests.
  33. gl_MODULE_INDICATOR_FOR_TESTS([$1])
  34. ])
  35. AC_DEFUN([gl_POLL_H_DEFAULTS],
  36. [
  37. GNULIB_POLL=0; AC_SUBST([GNULIB_POLL])
  38. dnl Assume proper GNU behavior unless another module says otherwise.
  39. HAVE_POLL=1; AC_SUBST([HAVE_POLL])
  40. REPLACE_POLL=0; AC_SUBST([REPLACE_POLL])
  41. ])