summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-07-08 16:33:32 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-08-08 12:45:12 +0200
commit02addb3618f026acd72ece76fc726b9473cc5940 (patch)
treed504a9c4f88f902ae5d75113fe48c2ed1935d095
parent2c00f5c896bee61033b93ddb9f32d959b0b01e94 (diff)
tdf#112343 Change dependency from dbus-glib to dbus
Add check for GLib support for modules which depends on dbus and glib separately. Also fix copy-paste typo. Change-Id: Ibd33573b2f8dff9e0a7f2e0fc983d93878bb5357 Reviewed-on: https://gerrit.libreoffice.org/57157 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--RepositoryExternal.mk2
-rw-r--r--config_host.mk.in3
-rw-r--r--config_host/config_dbus.h.in1
-rw-r--r--configure.ac20
-rw-r--r--sd/Library_sd.mk11
-rw-r--r--sd/source/ui/remotecontrol/BluetoothServer.hxx2
6 files changed, 34 insertions, 5 deletions
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index d70b1f051968..54a71fb38ef4 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -2676,7 +2676,7 @@ define gb_LinkTarget__use_cups
endef
-endif # ENABLE_DBUS
+endif # ENABLE_CUPS
ifeq ($(ENABLE_DBUS),TRUE)
diff --git a/config_host.mk.in b/config_host.mk.in
index 00aed9521bf5..b5eef155d524 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -92,6 +92,9 @@ export CXXFLAGS_CXX11=@CXXFLAGS_CXX11@
export DATADIR=@DATADIR@
export DBUS_CFLAGS=$(gb_SPACE)@DBUS_CFLAGS@
export DBUS_LIBS=$(gb_SPACE)@DBUS_LIBS@
+export DBUS_GLIB_CFLAGS=$(gb_SPACE)@DBUS_GLIB_CFLAGS@
+export DBUS_GLIB_LIBS=$(gb_SPACE)@DBUS_GLIB_LIBS@
+export DBUS_HAVE_GLIB=@DBUS_HAVE_GLIB@
export DCONF_CFLAGS=@DCONF_CFLAGS@
export DCONF_LIBS=@DCONF_LIBS@
export DEFAULT_BRAND_IMAGES=@DEFAULT_BRAND_IMAGES@
diff --git a/config_host/config_dbus.h.in b/config_host/config_dbus.h.in
index 44cbf8a63919..4ac5c32faf56 100644
--- a/config_host/config_dbus.h.in
+++ b/config_host/config_dbus.h.in
@@ -11,6 +11,7 @@
#define INCLUDED_CONFIG_DBUS_H
#define ENABLE_DBUS 0
+#define DBUS_HAVE_GLIB 0
#endif
diff --git a/configure.ac b/configure.ac
index 9a0c2c3083e3..abbd9b8975b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10041,6 +10041,9 @@ dnl ===================================================================
ENABLE_DBUS=""
DBUS_CFLAGS=""
DBUS_LIBS=""
+DBUS_GLIB_CFLAGS=""
+DBUS_GLIB_LIBS=""
+DBUS_HAVE_GLIB=""
if test "$enable_dbus" = "no"; then
test_dbus=no
@@ -10050,11 +10053,21 @@ AC_MSG_CHECKING([whether to enable DBUS support])
if test "$test_dbus" = "yes"; then
ENABLE_DBUS="TRUE"
AC_MSG_RESULT([yes])
- PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.70)
+ PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.60)
AC_DEFINE(ENABLE_DBUS)
DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
FilterLibs "${DBUS_LIBS}"
DBUS_LIBS="${filteredlibs}"
+
+ # Glib is needed for BluetoothServer
+ # Sets also DBUS_GLIB_CFLAGS/DBUS_GLIB_LIBS if successful.
+ PKG_CHECK_MODULES(DBUS_GLIB,[glib-2.0 >= 2.4],
+ [
+ DBUS_HAVE_GLIB="TRUE"
+ AC_DEFINE(DBUS_HAVE_GLIB,1)
+ ],
+ AC_MSG_WARN([[No Glib found, Bluetooth support will be disabled]])
+ )
else
AC_MSG_RESULT([no])
fi
@@ -10062,6 +10075,9 @@ fi
AC_SUBST(ENABLE_DBUS)
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
+AC_SUBST(DBUS_GLIB_CFLAGS)
+AC_SUBST(DBUS_GLIB_LIBS)
+AC_SUBST(DBUS_HAVE_GLIB)
AC_MSG_CHECKING([whether to enable Impress remote control])
if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
@@ -10086,7 +10102,7 @@ if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
if test "$enable_sdremote_bluetooth" != "no"; then
if test "$OS" = "LINUX"; then
- if test "$ENABLE_DBUS" = "TRUE"; then
+ if test "$ENABLE_DBUS" = "TRUE" -a "$DBUS_HAVE_GLIB" = "TRUE"; then
AC_MSG_RESULT([yes])
ENABLE_SDREMOTE_BLUETOOTH=TRUE
dnl ===================================================================
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 563f0d833ee8..67109b97c960 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -108,6 +108,15 @@ $(eval $(call gb_Library_use_externals,sd,\
icu_headers \
))
+ifneq ($(DBUS_HAVE_GLIB),)
+$(eval $(call gb_Library_add_defs,sd,\
+ $(DBUS_GLIB_CFLAGS) \
+))
+$(eval $(call gb_Library_add_libs,sd,\
+ $(DBUS_GLIB_LIBS) \
+))
+endif
+
ifeq ($(OS),WNT)
$(eval $(call gb_Library_use_system_win32_libs,sd,\
uuid \
@@ -172,7 +181,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
sd/source/ui/accessibility/AccessibleSlideSorterView \
sd/source/ui/accessibility/AccessibleViewForwarder \
sd/source/ui/accessibility/SdShapeTypes \
- sd/source/ui/animations/CategoryListBox \
+ sd/source/ui/animations/CategoryListBox \
sd/source/ui/animations/CustomAnimationBox \
sd/source/ui/animations/CustomAnimationDialog \
sd/source/ui/animations/CustomAnimationList \
diff --git a/sd/source/ui/remotecontrol/BluetoothServer.hxx b/sd/source/ui/remotecontrol/BluetoothServer.hxx
index b5d6f78aa2b8..987e5c611786 100644
--- a/sd/source/ui/remotecontrol/BluetoothServer.hxx
+++ b/sd/source/ui/remotecontrol/BluetoothServer.hxx
@@ -15,7 +15,7 @@
#include <config_dbus.h>
-#if (defined(LINUX) && !defined(__FreeBSD_kernel__)) && ENABLE_DBUS
+#if (defined(LINUX) && !defined(__FreeBSD_kernel__)) && ENABLE_DBUS && DBUS_HAVE_GLIB
# define LINUX_BLUETOOTH
#endif