// enable kqueue as dir watch backend
DBUS_BUS_ENABLE_KQUEUE:BOOL=ON
-not available on windows:
-// enable abstract socket transport
-DBUS_ENABLE_ABSTRACT_SOCKETS:BOOL=ON
-
x11 only:
// Build with X11 auto launch support
DBUS_BUILD_X11:BOOL=ON
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)
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)
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)
/* doxygen */
#cmakedefine DBUS_GCOV_ENABLED 1
-/* abstract-sockets */
-
-#cmakedefine HAVE_ABSTRACT_SOCKETS 1
-
/* selinux */
/* kqueue */
#cmakedefine HAVE_CONSOLE_OWNER_FILE 1
+++ /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
AS_HELP_STRING([--enable-ducktype-docs],
[build Ducktype documentation (requires Ducktype)]),
[enable_ducktype_docs=$enableval], [enable_ducktype_docs=auto])
-AC_ARG_ENABLE(abstract-sockets, AS_HELP_STRING([--enable-abstract-sockets],[use abstract socket namespace (linux only)]),enable_abstract_sockets=$enableval,enable_abstract_sockets=auto)
AC_ARG_ENABLE(selinux, AS_HELP_STRING([--enable-selinux],[build with SELinux support]),enable_selinux=$enableval,enable_selinux=auto)
AC_ARG_ENABLE([apparmor],
[AS_HELP_STRING([--enable-apparmor], [build with AppArmor support])],
AC_CHECK_FUNCS(pipe2 accept4)
-#### Abstract sockets
-
-if test x$enable_abstract_sockets = xauto; then
-AC_LANG_PUSH(C)
-warn_on_xcompile=no
-AC_CACHE_CHECK([abstract socket namespace],
- ac_cv_have_abstract_sockets,
- [AC_RUN_IFELSE([AC_LANG_PROGRAM(
-[[
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <errno.h>
-]],
-[[
- size_t slen;
- 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");
- /* SUN_LEN uses strlen() so need to calculate it before adding \0 at the
- * beginning.
- */
- slen = SUN_LEN(&addr);
- addr.sun_path[0] = '\0'; /* this is what makes it abstract */
-
- if (bind (listen_fd, (struct sockaddr*) &addr, slen) < 0)
- {
- fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
- strerror (errno));
- exit (1);
- }
- else
- exit (0);
-]])],
- [ac_cv_have_abstract_sockets=yes],
- [ac_cv_have_abstract_sockets=no],
- [
- ac_cv_have_abstract_sockets=no
- warn_on_xcompile=yes
- ]
-)])
-if test x$warn_on_xcompile = xyes ; then
- AC_MSG_WARN([Cannot check for abstract sockets when cross-compiling, please use --enable-abstract-sockets])
-fi
-AC_LANG_POP(C)
-fi
-
-if test x$enable_abstract_sockets = xyes; then
- if test x$ac_cv_have_abstract_sockets = xno; then
- AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
- fi
-fi
-
-if test x$enable_abstract_sockets = xno; then
- ac_cv_have_abstract_sockets=no;
-fi
-
PKG_CHECK_MODULES([EXPAT], [expat])
save_cflags="$CFLAGS"
Building Ducktype docs: ${enable_ducktype_docs}
Building XML docs: ${enable_xml_docs}
Building launchd support: ${have_launchd}
- Abstract socket names: ${ac_cv_have_abstract_sockets}
System bus socket: ${DBUS_SYSTEM_SOCKET}
System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
System bus PID file: ${DBUS_SYSTEM_PID_FILE}
{
dir = tmpdir;
-#ifdef HAVE_ABSTRACT_SOCKETS
+#ifdef __linux__
/* Use abstract sockets for tmpdir if supported, so that it
* never needs to be cleaned up. Use dir instead if you want a
* path-based socket. */
if (abstract)
{
-#ifdef HAVE_ABSTRACT_SOCKETS
+#ifdef __linux__
addr.sun_path[0] = '\0'; /* this is what says "use abstract" */
path_len++; /* Account for the extra nul byte added to the start of sun_path */
strncpy (&addr.sun_path[1], path, path_len);
/* _dbus_verbose_bytes (addr.sun_path, sizeof (addr.sun_path)); */
-#else /* HAVE_ABSTRACT_SOCKETS */
+#else /* !__linux__ */
dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED,
"Operating system does not support abstract socket namespace\n");
_dbus_close (fd, NULL);
return -1;
-#endif /* ! HAVE_ABSTRACT_SOCKETS */
+#endif /* !__linux__ */
}
else
{
if (abstract)
{
-#ifdef HAVE_ABSTRACT_SOCKETS
+#ifdef __linux__
/* remember that abstract names aren't nul-terminated so we rely
* on sun_path being filled in with zeroes above.
*/
strncpy (&addr.sun_path[1], path, path_len);
/* _dbus_verbose_bytes (addr.sun_path, sizeof (addr.sun_path)); */
-#else /* HAVE_ABSTRACT_SOCKETS */
+#else /* !__linux__ */
dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED,
"Operating system does not support abstract socket namespace\n");
_dbus_close (listen_fd, NULL);
return -1;
-#endif /* ! HAVE_ABSTRACT_SOCKETS */
+#endif /* !__linux__ */
}
else
{