]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Add cmake check for HAVE_DIRFD
authorRalf Habacker <ralf.habacker@freenet.de>
Mon, 22 Oct 2018 11:27:46 +0000 (13:27 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Wed, 24 Oct 2018 08:03:30 +0000 (10:03 +0200)
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18

cmake/ConfigureChecks.cmake
cmake/config.h.cmake

index 39c2ed5b35415efbdeb64e8d2a6a5e0655696da2..cee6a9270ad608e233a1a0f81a106e2f79b1bca1 100644 (file)
@@ -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
 
index 1235a4504a2ff6691c338af5eead76c370377709..531bc8355bdfb06f00317010002404c77dbede94 100644 (file)
 #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