From: Kay Sievers Date: Wed, 6 Nov 2013 01:03:05 +0000 (+0100) Subject: bus: test-bus-marshal - make dbus-1 optional X-Git-Tag: v209~1630 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=2270309471213a3c960543e523130627e9cb10e2 bus: test-bus-marshal - make dbus-1 optional --- diff --git a/configure.ac b/configure.ac index 7e41d577b..bb0840777 100644 --- a/configure.ac +++ b/configure.ac @@ -236,8 +236,10 @@ AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include = 1.3.2]) - +# ------------------------------------------------------------------------------ +PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2], have_dbus=yes, have_dbus=no]) +AS_IF([test "$have_dbus" = "yes"], [ AC_DEFINE(HAVE_DBUS, [1], [Define if dbus-1 is available]) ]) +AM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"]) # ------------------------------------------------------------------------------ have_coverage=no diff --git a/src/libsystemd-bus/test-bus-marshal.c b/src/libsystemd-bus/test-bus-marshal.c index 2a27e623f..ae61476d5 100644 --- a/src/libsystemd-bus/test-bus-marshal.c +++ b/src/libsystemd-bus/test-bus-marshal.c @@ -27,7 +27,9 @@ #include #endif +#ifdef HAVE_DBUS #include +#endif #include "log.h" #include "util.h" @@ -126,6 +128,7 @@ int main(int argc, char *argv[]) { } #endif +#ifdef HAVE_DBUS { DBusMessage *w; DBusError error; @@ -138,6 +141,7 @@ int main(int argc, char *argv[]) { } else dbus_message_unref(w); } +#endif m = sd_bus_message_unref(m);