Blame m4/poll_h.m4

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