Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18
include(CheckSymbolExists)
include(CheckStructMember)
include(CheckTypeSize)
+include(CheckCSourceCompiles)
check_include_file(alloca.h HAVE_ALLOCA_H)
check_include_file(byteswap.h HAVE_BYTESWAP_H)
check_struct_member(cmsgcred cmcred_pid "sys/types.h;sys/socket.h" HAVE_CMSGCRED) # dbus-sysdeps.c
+CHECK_C_SOURCE_COMPILES("
+#ifndef __linux__
+#error This is not Linux
+#endif
+#include <sys/epoll.h>
+int main() {
+epoll_create1 (EPOLL_CLOEXEC);
+}" DBUS_HAVE_LINUX_EPOLL)
+
# missing:
# DBUS_HAVE_GCC33_GCOV
#cmakedefine HAVE_SETRLIMIT 1
#cmakedefine HAVE_UNIX_FD_PASSING 1
+/* Define to use epoll(4) on Linux */
+#cmakedefine DBUS_HAVE_LINUX_EPOLL 1
+
// structs
/* Define to 1 if you have struct cmsgred */
#cmakedefine HAVE_CMSGCRED 1
)
endif (WIN32)
+if(DBUS_HAVE_LINUX_EPOLL)
+ set(DBUS_UTIL_SOURCES
+ ${DBUS_UTIL_SOURCES}
+ ${DBUS_DIR}/dbus-socket-set-epoll.c
+ )
+endif()
+
set(libdbus_SOURCES
${DBUS_LIB_SOURCES}
${DBUS_SHARED_SOURCES}