Commit 7fb57c75 authored by Simon McVittie's avatar Simon McVittie

Only support systemd: transport if we have systemd libraries

This means we can drop our convenience copy of sd-daemon.[ch]. We're
checking for libsd-daemon anyway, to support journald and logind
integration.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71818Reviewed-by: Lennart Poettering's avatarLennart Poettering <lennart@poettering.net>
parent ea1884e3
......@@ -214,14 +214,12 @@ else (WIN32)
${DBUS_DIR}/dbus-sysdeps-unix.c
${DBUS_DIR}/dbus-sysdeps-pthread.c
${DBUS_DIR}/dbus-userdb.c
${DBUS_DIR}/sd-daemon.c
)
set (DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS}
${DBUS_DIR}/dbus-server-unix.h
${DBUS_DIR}/dbus-transport-unix.h
${DBUS_DIR}/dbus-sysdeps-unix.h
${DBUS_DIR}/dbus-userdb.h
${DBUS_DIR}/sd-daemon.h
)
set (DBUS_UTIL_SOURCES ${DBUS_UTIL_SOURCES}
${DBUS_DIR}/dbus-spawn.c
......
......@@ -1247,7 +1247,7 @@ AC_DEFINE_UNQUOTED([DBUS_DEFAULT_MESSAGE_UNIX_FDS],
AC_SUBST([DEFAULT_MESSAGE_UNIX_FDS])
#### Set up final flags
LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs"
LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs $SYSTEMD_LIBS"
AC_SUBST([LIBDBUS_LIBS])
### X11 detection
......
......@@ -12,10 +12,6 @@ AM_CPPFLAGS = \
-DDBUS_SESSION_CONFIG_FILE=\""$(configdir)/session.conf"\" \
$(NULL)
# On Linux with glibc 2.17, sd-daemon.c support for POSIX message queues
# results in an otherwise unnecessary dependency on librt. Disable it.
AM_CPPFLAGS += -DSD_DAEMON_DISABLE_MQ
# if assertions are enabled, improve backtraces
AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
......@@ -108,8 +104,7 @@ DBUS_SHARED_arch_sources = \
dbus-transport-unix.h \
dbus-userdb.c \
dbus-userdb.h \
sd-daemon.c \
sd-daemon.h
$(NULL)
DBUS_UTIL_arch_sources = \
dbus-sysdeps-util-unix.c \
......@@ -295,7 +290,7 @@ libdbus_internal_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DDBUS_STATIC_BUILD \
$(NULL)
libdbus_internal_la_LIBADD=$(LIBDBUS_LIBS) $(SYSTEMD_LIBS)
libdbus_internal_la_LIBADD=$(LIBDBUS_LIBS)
if DBUS_WIN
# This must be a separate convenience library, otherwise libtool notices
......@@ -323,7 +318,3 @@ test_dbus_LDADD = libdbus-internal.la
## mop up the gcov files
clean-local:
/bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true
update-systemd:
curl http://cgit.freedesktop.org/systemd/systemd/plain/src/libsystemd-daemon/sd-daemon.c > $(srcdir)/sd-daemon.c
curl http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h > $(srcdir)/sd-daemon.h
......@@ -80,7 +80,9 @@
#include <bsm/adt.h>
#endif
#include "sd-daemon.h"
#ifdef HAVE_SYSTEMD
#include <systemd/sd-daemon.h>
#endif
#if !DBUS_USE_SYNC
#include <pthread.h>
......@@ -1122,6 +1124,7 @@ int
_dbus_listen_systemd_sockets (int **fds,
DBusError *error)
{
#ifdef HAVE_SYSTEMD
int r, n;
unsigned fd;
int *new_fds;
......@@ -1197,6 +1200,11 @@ _dbus_listen_systemd_sockets (int **fds,
dbus_free (new_fds);
return -1;
#else
dbus_set_error_const (error, DBUS_ERROR_NOT_SUPPORTED,
"dbus was compiled without systemd support");
return -1;
#endif
}
/**
......
......@@ -58,7 +58,9 @@
#include <sys/syslimits.h>
#endif
#include "sd-daemon.h"
#ifdef HAVE_SYSTEMD
#include <systemd/sd-daemon.h>
#endif
#ifndef O_BINARY
#define O_BINARY 0
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment