summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in30
1 files changed, 29 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index 1caf7d92..24e2431a 100644
--- a/configure.in
+++ b/configure.in
@@ -590,7 +590,35 @@ AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT_COND, [$have_atomic_inc_cond],
AC_CHECK_LIB(socket,socket)
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
-AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv clearenv unsetenv socketpair getgrouplist fpathconf setrlimit)
+AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep setenv clearenv unsetenv socketpair getgrouplist fpathconf setrlimit poll)
+
+#### Check for broken poll; taken from Glib's configure
+
+AC_MSG_CHECKING([for broken poll])
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ #include <stdlib.h>
+ #include <fcntl.h>
+ #include <poll.h>
+ #ifdef HAVE_SYS_POLL_H
+ #include <sys/poll.h>
+ #endif
+ int main(void) {
+ struct pollfd fds[1];
+ int fd;
+ fd = open("/dev/null", 1);
+ fds[0].fd = fd;
+ fds[0].events = POLLIN;
+ fds[0].revents = 0;
+ if (poll(fds, 1, 0) < 0 || (fds[0].revents & POLLNVAL) != 0) {
+ exit(1); /* Does not work for devices -- fail */
+ }
+ exit(0);
+ }]])],
+ [broken_poll=no],
+ [broken_poll=yes
+ AC_DEFINE(BROKEN_POLL,1,[poll doesn't work on devices])],
+ [broken_poll="no (cross compiling)"])
+AC_MSG_RESULT($broken_poll)
AC_MSG_CHECKING(for dirfd)
AC_TRY_LINK([