Add optional dbus helpers
This adds optional libdbus integration for weston. If libdbus is available
and not disabled via --disable-dbus during weston build, we now provide
basic DBusConnection main-loop integration for weston.
The dbus.c file provides a new helper to integrate any DBusConnection
object into a wl_event_loop object. This avoids any glib/qt/..
dependencies but instead only uses the low-level libdbus library.
Note that we do not provide dummy fallbacks for dbus helpers in case
dbus-support is disabled. The reason for that is that you need dbus/dbus.h
for nearly any operation you want to do via dbus. Therefore, only the most
basic helpers which can be used independently provide a "static inline"
dummy fallback to avoid #ifdef all over the code.
diff --git a/configure.ac b/configure.ac
index 950086d..2661aad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -379,6 +379,28 @@
fi
AM_CONDITIONAL(ENABLE_COLORD, test "x$enable_colord" = "xyes")
+# dbus support
+AC_ARG_ENABLE(dbus,
+ AS_HELP_STRING([--disable-dbus],
+ [do not build with dbus support]),,
+ enable_dbus=auto)
+if test "x$enable_dbus" != "xno"; then
+ PKG_CHECK_MODULES(DBUS,
+ dbus-1 >= 1.6,
+ have_dbus=yes,
+ have_dbus=no)
+ if test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"; then
+ AC_MSG_ERROR([dbus support explicitly requested, but libdbus couldn't be found])
+ fi
+ if test "x$have_dbus" = "xyes"; then
+ enable_dbus=yes
+ AC_DEFINE([HAVE_DBUS], [1], [Build with dbus support])
+ else
+ enable_dbus=no
+ fi
+fi
+AM_CONDITIONAL(ENABLE_DBUS, test "x$enable_dbus" = "xyes")
+
AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes)
AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes)
if test x$enable_wcap_tools = xyes; then
@@ -467,6 +489,7 @@
EGL ${enable_egl}
libxkbcommon ${enable_xkbcommon}
XWayland ${enable_xwayland}
+ dbus ${enable_dbus}
Build wcap utility ${enable_wcap_tools}
Build Tablet Shell ${enable_tablet_shell}