Merge commit 'b86069c1308a6ca36f3a3bc56134b3f8fd693592'
[bpt/guile.git] / m4 / poll_h.m4
CommitLineData
428f9e95 1# poll_h.m4 serial 2
5e69ceb7 2dnl Copyright (C) 2010-2014 Free Software Foundation, Inc.
428f9e95
JE
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl Written by Bruno Haible.
8
9AC_DEFUN([gl_POLL_H],
10[
11 dnl Use AC_REQUIRE here, so that the default behavior below is expanded
12 dnl once only, before all statements that occur in other macros.
13 AC_REQUIRE([gl_POLL_H_DEFAULTS])
14
15 AC_CHECK_HEADERS_ONCE([poll.h])
16 if test $ac_cv_header_poll_h = yes; then
17 HAVE_POLL_H=1
18 else
19 HAVE_POLL_H=0
20 fi
21 AC_SUBST([HAVE_POLL_H])
22
23 dnl <poll.h> is always overridden, because of GNULIB_POSIXCHECK.
24 gl_CHECK_NEXT_HEADERS([poll.h])
25
26 dnl Check for declarations of anything we want to poison if the
27 dnl corresponding gnulib module is not in use.
28 gl_WARN_ON_USE_PREPARE([[#include <poll.h>]],
29 [poll])
30])
31
32AC_DEFUN([gl_POLL_MODULE_INDICATOR],
33[
34 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
35 AC_REQUIRE([gl_POLL_H_DEFAULTS])
36 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
37 dnl Define it also as a C macro, for the benefit of the unit tests.
38 gl_MODULE_INDICATOR_FOR_TESTS([$1])
39])
40
41AC_DEFUN([gl_POLL_H_DEFAULTS],
42[
43 GNULIB_POLL=0; AC_SUBST([GNULIB_POLL])
44 dnl Assume proper GNU behavior unless another module says otherwise.
45 HAVE_POLL=1; AC_SUBST([HAVE_POLL])
46 REPLACE_POLL=0; AC_SUBST([REPLACE_POLL])
47])