Debian Codegraph @

m4/poll_h.m4

raw
1 # poll_h.m4
2 # serial 6
3 dnl Copyright (C) 2010-2026 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7 dnl This file is offered as-is, without any warranty.
8
9 dnl Written by Bruno Haible.
10
11 AC_DEFUN_ONCE([gl_POLL_H],
12 [
13 dnl Ensure to expand the default settings once only, before all statements
14 dnl that occur in other macros.
15 AC_REQUIRE([gl_POLL_H_DEFAULTS])
16
17 AC_CHECK_HEADERS_ONCE([poll.h])
18 if test $ac_cv_header_poll_h = yes; then
19 HAVE_POLL_H=1
20 else
21 HAVE_POLL_H=0
22 fi
23 AC_SUBST([HAVE_POLL_H])
24
25 dnl <poll.h> is always overridden, because of GNULIB_POSIXCHECK.
26 gl_CHECK_NEXT_HEADERS([poll.h])
27
28 gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_H
29
30 dnl Check for declarations of anything we want to poison if the
31 dnl corresponding gnulib module is not in use.
32 gl_WARN_ON_USE_PREPARE([[#include <poll.h>]],
33 [poll])
34 ])
35
36 # gl_POLL_MODULE_INDICATOR([modulename])
37 # sets the shell variable that indicates the presence of the given module
38 # to a C preprocessor expression that will evaluate to 1.
39 # This macro invocation must not occur in macros that are AC_REQUIREd.
40 AC_DEFUN([gl_POLL_MODULE_INDICATOR],
41 [
42 dnl Ensure to expand the default settings once only.
43 gl_POLL_H_REQUIRE_DEFAULTS
44 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
45 dnl Define it also as a C macro, for the benefit of the unit tests.
46 gl_MODULE_INDICATOR_FOR_TESTS([$1])
47 ])
48
49 # Initializes the default values for AC_SUBSTed shell variables.
50 # This macro must not be AC_REQUIREd. It must only be invoked, and only
51 # outside of macros or in macros that are not AC_REQUIREd.
52 AC_DEFUN([gl_POLL_H_REQUIRE_DEFAULTS],
53 [
54 m4_defun(GL_MODULE_INDICATOR_PREFIX[_POLL_H_MODULE_INDICATOR_DEFAULTS], [
55 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POLL])
56 ])
57 m4_require(GL_MODULE_INDICATOR_PREFIX[_POLL_H_MODULE_INDICATOR_DEFAULTS])
58 AC_REQUIRE([gl_POLL_H_DEFAULTS])
59 ])
60
61 AC_DEFUN([gl_POLL_H_DEFAULTS],
62 [
63 dnl Assume proper GNU behavior unless another module says otherwise.
64 HAVE_POLL=1; AC_SUBST([HAVE_POLL])
65 REPLACE_POLL=0; AC_SUBST([REPLACE_POLL])
66 ])