Blame m4/poll_h.m4

Packit 8f70b4
# poll_h.m4 serial 2
Packit 8f70b4
dnl Copyright (C) 2010-2018 Free Software Foundation, Inc.
Packit 8f70b4
dnl This file is free software; the Free Software Foundation
Packit 8f70b4
dnl gives unlimited permission to copy and/or distribute it,
Packit 8f70b4
dnl with or without modifications, as long as this notice is preserved.
Packit 8f70b4
Packit 8f70b4
dnl Written by Bruno Haible.
Packit 8f70b4
Packit 8f70b4
AC_DEFUN([gl_POLL_H],
Packit 8f70b4
[
Packit 8f70b4
  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
Packit 8f70b4
  dnl once only, before all statements that occur in other macros.
Packit 8f70b4
  AC_REQUIRE([gl_POLL_H_DEFAULTS])
Packit 8f70b4
Packit 8f70b4
  AC_CHECK_HEADERS_ONCE([poll.h])
Packit 8f70b4
  if test $ac_cv_header_poll_h = yes; then
Packit 8f70b4
    HAVE_POLL_H=1
Packit 8f70b4
  else
Packit 8f70b4
    HAVE_POLL_H=0
Packit 8f70b4
  fi
Packit 8f70b4
  AC_SUBST([HAVE_POLL_H])
Packit 8f70b4
Packit 8f70b4
  dnl <poll.h> is always overridden, because of GNULIB_POSIXCHECK.
Packit 8f70b4
  gl_CHECK_NEXT_HEADERS([poll.h])
Packit 8f70b4
Packit 8f70b4
  dnl Check for declarations of anything we want to poison if the
Packit 8f70b4
  dnl corresponding gnulib module is not in use.
Packit 8f70b4
  gl_WARN_ON_USE_PREPARE([[#include <poll.h>]],
Packit 8f70b4
    [poll])
Packit 8f70b4
])
Packit 8f70b4
Packit 8f70b4
AC_DEFUN([gl_POLL_MODULE_INDICATOR],
Packit 8f70b4
[
Packit 8f70b4
  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
Packit 8f70b4
  AC_REQUIRE([gl_POLL_H_DEFAULTS])
Packit 8f70b4
  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
Packit 8f70b4
  dnl Define it also as a C macro, for the benefit of the unit tests.
Packit 8f70b4
  gl_MODULE_INDICATOR_FOR_TESTS([$1])
Packit 8f70b4
])
Packit 8f70b4
Packit 8f70b4
AC_DEFUN([gl_POLL_H_DEFAULTS],
Packit 8f70b4
[
Packit 8f70b4
  GNULIB_POLL=0;        AC_SUBST([GNULIB_POLL])
Packit 8f70b4
  dnl Assume proper GNU behavior unless another module says otherwise.
Packit 8f70b4
  HAVE_POLL=1;          AC_SUBST([HAVE_POLL])
Packit 8f70b4
  REPLACE_POLL=0;       AC_SUBST([REPLACE_POLL])
Packit 8f70b4
])