From cde0a892935d408967ea3a3abcb2fc6ab950e414 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 25 Jan 2011 18:29:40 +0000 Subject: [PATCH 2/5] Check for epoll in configure.ac --- configure.in | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index 6dd2a8d..9c28a71 100644 --- a/configure.in +++ b/configure.in @@ -911,6 +911,30 @@ fi AM_CONDITIONAL(DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX, test x$have_dnotify = xyes) +AC_ARG_ENABLE([epoll], + [AS_HELP_STRING([--enable-epoll],[use epoll(4) on Linux])], + [enable_epoll=$enableval], [enable_epoll=auto]) +if test x$enable_epoll = xno; then + have_linux_epoll=no +else + AC_MSG_CHECKING([for Linux epoll(4)]) + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [ + #ifndef __linux__ + #error This is not Linux + #endif + #include + ], + [epoll_create1 (EPOLL_CLOEXEC);])], + [have_linux_epoll=yes], + [have_linux_epoll=no]) + AC_MSG_RESULT([$have_linux_epoll]) +fi +if test x$enable_epoll,$have_linux_epoll = xyes,no; then + AC_MSG_ERROR([epoll support explicitly enabled but not available]) +fi +AM_CONDITIONAL([HAVE_LINUX_EPOLL], [test x$have_linux_epoll = xyes]) + # kqueue checks if test x$enable_kqueue = xno ; then have_kqueue=no -- 1.7.2.3