summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2018-10-22 13:27:46 +0200
committerRalf Habacker <ralf.habacker@freenet.de>2018-10-24 10:03:30 +0200
commitba8a5e509c34aadd0097b29144ba4dd8c65412ed (patch)
tree15d143aa36c879e80bc8f16edb031015fc749704 /cmake
parent6c95c7e39556c3686cff6945035c0586975b111a (diff)
downloaddbus-ba8a5e509c34aadd0097b29144ba4dd8c65412ed.tar.gz
Add cmake check for HAVE_DIRFD
Reviewed-by: Simon McVittie <smcv@collabora.com> Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18
Diffstat (limited to 'cmake')
-rw-r--r--cmake/ConfigureChecks.cmake12
-rw-r--r--cmake/config.h.cmake3
2 files changed, 14 insertions, 1 deletions
diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake
index 39c2ed5b..cee6a927 100644
--- a/cmake/ConfigureChecks.cmake
+++ b/cmake/ConfigureChecks.cmake
@@ -59,7 +59,6 @@ check_symbol_exists(strtoull "stdlib.h" HAVE_STRTOULL) #
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
check_symbol_exists(pipe2 "fcntl.h;unistd.h" HAVE_PIPE2)
check_symbol_exists(accept4 "sys/socket.h" HAVE_ACCEPT4)
-check_symbol_exists(dirfd "dirent.h" HAVE_DIRFD)
check_symbol_exists(inotify_init1 "sys/inotify.h" HAVE_INOTIFY_INIT1)
check_symbol_exists(SCM_RIGHTS "sys/types.h;sys/socket.h;sys/un.h" HAVE_UNIX_FD_PASSING)
check_symbol_exists(prctl "sys/prctl.h" HAVE_PRCTL)
@@ -150,6 +149,17 @@ int main() {
}
" DBUS_USE_SYNC)
+CHECK_C_SOURCE_COMPILES("
+#include <sys/types.h>
+#include <dirent.h>
+int main(
+ DIR *dirp;
+ dirp = opendir(\".\");
+ dirfd(dirp);
+ closedir(dirp);
+)
+" HAVE_DIRFD)
+
# missing:
# DBUS_HAVE_GCC33_GCOV
diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake
index 1235a450..531bc835 100644
--- a/cmake/config.h.cmake
+++ b/cmake/config.h.cmake
@@ -204,7 +204,10 @@
#cmakedefine HAVE_PIPE2 1
#cmakedefine HAVE_ACCEPT4 1
+
+/* Have dirfd function */
#cmakedefine HAVE_DIRFD 1
+
#cmakedefine HAVE_INOTIFY_INIT1 1
#cmakedefine HAVE_GETRLIMIT 1
#cmakedefine HAVE_PRCTL 1