find_package(LibExpat)
find_package(X11)
+
+OPTION(DBUS_ENABLE_ABSTRACT_SOCKETS "enable support for abstract sockets" ON)
+
# do config checks
INCLUDE(ConfigureChecks.cmake)
SET(DBUS_VA_COPY_AS_ARRAY "1" CACHE STRING "'va_lists' cannot be copies as values")
endif(DBUS_HAVE___VA_COPY)
endif(DBUS_HAVE_VA_COPY)
+
+#### 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)
+
+if(HAVE_ABSTRACT_SOCKETS)
+ set(DBUS_PATH_OR_ABSTRACT_VALUE abstract)
+else(HAVE_ABSTRACT_SOCKETS)
+ set(DBUS_PATH_OR_ABSTRACT_VALUE path)
+endif(HAVE_ABSTRACT_SOCKETS)
+
/* xmldocs */
/* doxygen */
#cmakedefine DBUS_GCOV_ENABLED 1
+
/* abstract-sockets */
+
+#cmakedefine HAVE_ABSTRACT_SOCKETS 1
+
+#cmakedefine DBUS_PATH_OR_ABSTRACT_VALUE 1
+
+#if (defined DBUS_PATH_OR_ABSTRACT_VALUE)
+#define DBUS_PATH_OR_ABSTRACT @DBUS_PATH_OR_ABSTRACT_VALUE@
+#endif
+
+#ifdef DBUS_PATH_OR_ABSTRACT_VALUE
+#undef DBUS_PATH_OR_ABSTRACT_VALUE
+#endif
+
/* selinux */
#cmakedefine DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX 1
/* kqueue */
# define DBUS_VA_COPY @DBUS_VA_COPY_FUNC@
#endif
+#ifdef DBUS_VA_COPY_FUNC
+#undef DBUS_VA_COPY_FUNC
+#endif
+
#cmakedefine DBUS_VA_COPY_AS_ARRAY 1
// headers
--- /dev/null
+#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