summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2017-09-29 12:27:11 +0100
committerSimon McVittie <smcv@collabora.com>2017-09-29 14:04:57 +0100
commit6a6521746bce81c50d77b560b2ee9948c1a5efd0 (patch)
tree5c5c7aa914d134ef3a4294e88947376e63e76806 /cmake
parent633a208ce72eef3d8322f97c8671ce577aa87775 (diff)
downloaddbus-6a6521746bce81c50d77b560b2ee9948c1a5efd0.tar.gz
unix: Condition Linux-specific abstract sockets on __linux__
This is nicer for cross-compiling, because AC_RUN_IFELSE can't work there. In practice abstract sockets are supported on Linux since 2.2 (so, all relevant versions), and on no other platform; so it seems futile to keep this complexity. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34905 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/CMakeLists.txt1
-rw-r--r--cmake/ConfigureChecks.cmake10
-rw-r--r--cmake/config.h.cmake4
-rw-r--r--cmake/modules/CheckForAbstractSockets.c33
4 files changed, 0 insertions, 48 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index a003f282..a9f53780 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -121,7 +121,6 @@ if (WIN32)
endif (WIN32)
if(NOT WIN32)
- option (DBUS_ENABLE_ABSTRACT_SOCKETS "enable support for abstract sockets" ON)
set (CMAKE_THREAD_PREFER_PTHREAD ON)
include (FindThreads)
endif(NOT WIN32)
diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake
index 6815178b..d83810a7 100644
--- a/cmake/ConfigureChecks.cmake
+++ b/cmake/ConfigureChecks.cmake
@@ -66,7 +66,6 @@ check_symbol_exists(raise "signal.h" HAVE_RAISE)
check_struct_member(cmsgcred cmcred_pid "sys/types.h sys/socket.h" HAVE_CMSGCRED) # dbus-sysdeps.c
# missing:
-# HAVE_ABSTRACT_SOCKETS
# DBUS_HAVE_GCC33_GCOV
check_type_size("short" SIZEOF_SHORT)
@@ -168,12 +167,3 @@ else(DBUS_HAVE_VA_COPY)
endif(DBUS_HAVE___VA_COPY)
endif(DBUS_HAVE_VA_COPY)
endif(MSVC) # _not_ MSVC
-#### Abstract sockets
-
-if (DBUS_ENABLE_ABSTRACT_SOCKETS)
-
- try_compile(HAVE_ABSTRACT_SOCKETS
- ${CMAKE_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}/modules/CheckForAbstractSockets.c)
-
-endif(DBUS_ENABLE_ABSTRACT_SOCKETS)
diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake
index 154353b7..202c0ab0 100644
--- a/cmake/config.h.cmake
+++ b/cmake/config.h.cmake
@@ -49,10 +49,6 @@
/* doxygen */
#cmakedefine DBUS_GCOV_ENABLED 1
-/* abstract-sockets */
-
-#cmakedefine HAVE_ABSTRACT_SOCKETS 1
-
/* selinux */
/* kqueue */
#cmakedefine HAVE_CONSOLE_OWNER_FILE 1
diff --git a/cmake/modules/CheckForAbstractSockets.c b/cmake/modules/CheckForAbstractSockets.c
deleted file mode 100644
index 062b846c..00000000
--- a/cmake/modules/CheckForAbstractSockets.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <errno.h>
-
-int main() {
- int listen_fd;
- struct sockaddr_un addr;
-
- listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
-
- if (listen_fd < 0)
- {
- fprintf (stderr, "socket() failed: %s\n", strerror (errno));
- exit (1);
- }
-
- memset (&addr, '\0', sizeof (addr));
- addr.sun_family = AF_UNIX;
- strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
- addr.sun_path[0] = '\0'; /* this is what makes it abstract */
-
- if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
- {
- fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
- strerror (errno));
- exit (1);
- }
- else
- exit (0);
-} \ No newline at end of file