From 01db00ef935f12ee1eece810a1ee86c2c42d5105 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Krzysztof=20Kosi=C5=84ski?= Date: Sat, 17 Jul 2010 00:29:25 +0200 Subject: [PATCH] Fix build failure when DBus is not enabled --- configure.ac | 8 +++----- src/extension/dbus/Makefile_insert | 20 ++++++++++++++++++++ src/file.cpp | 9 ++++++++- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 93c3872a3..751e36f47 100644 --- a/configure.ac +++ b/configure.ac @@ -702,7 +702,6 @@ dnl ****************************** AC_ARG_ENABLE(dbusapi, [ --enable-dbusapi compile with support for DBus interface], enable_dbusapi=$enableval,enable_dbusapi=yes) -AC_DEFINE(WITH_DBUS,1,[Build in dbus]) with_dbus="no" if test "x$dbusapi" = "xyes"; then @@ -714,12 +713,11 @@ if test "x$dbusapi" = "xyes"; then DBUSSERVICEDIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1` fi AC_SUBST(DBUSSERVICEDIR) + AC_DEFINE(WITH_DBUS,1,[Build in dbus]) fi - - AC_SUBST(DBUS_LIBS) - AC_SUBST(DBUS_CFLAGS) fi - +AC_SUBST(DBUS_LIBS) +AC_SUBST(DBUS_CFLAGS) AM_CONDITIONAL(WITH_DBUS, test "x$with_dbus" = "xyes") dnl ****************************** diff --git a/src/extension/dbus/Makefile_insert b/src/extension/dbus/Makefile_insert index ce733364c..a5eb3fdf4 100644 --- a/src/extension/dbus/Makefile_insert +++ b/src/extension/dbus/Makefile_insert @@ -1,5 +1,7 @@ ## Makefile.am fragment sourced by src/Makefile.am. +if WITH_DBUS + ############################# # Sources for DBus interface ############################# @@ -88,3 +90,21 @@ libinkdbus_la_LIBADD = \ pkgconfig_DATA = extension/dbus/wrapper/inkdbus.pc pkgconfigdir = $(libdir)/pkgconfig +else # WITH_DBUS + +EXTRA_DIST += \ + extension/dbus/dbus-init.cpp \ + extension/dbus/dbus-init.h \ + extension/dbus/application-interface.cpp \ + extension/dbus/application-interface.h \ + extension/dbus/document-interface.cpp \ + extension/dbus/document-interface.h \ + extension/dbus/wrapper/inkscape-dbus-wrapper.h \ + extension/dbus/wrapper/inkscape-dbus-wrapper.c \ + extension/dbus/wrapper/inkdbus.pc \ + extension/dbus/org.inkscape.service.in \ + extension/dbus/application-interface.xml \ + extension/dbus/document-interface.xml + +endif + diff --git a/src/file.cpp b/src/file.cpp index 1186a1f07..50fcd3642 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -42,7 +42,6 @@ #include "extension/input.h" #include "extension/output.h" #include "extension/system.h" -#include "extension/dbus/dbus-init.h" #include "file.h" #include "helper/png-write.h" #include "id-clash.h" @@ -69,6 +68,10 @@ # include #endif +#ifdef WITH_DBUS +#include "extension/dbus/dbus-init.h" +#endif + //#ifdef WITH_INKBOARD //#include "jabber_whiteboard/session-manager.h" //#endif @@ -136,7 +139,11 @@ sp_file_new(const Glib::ustring &templ) sp_namedview_window_from_document(dt); sp_namedview_update_layers_from_document(dt); } + +#ifdef WITH_DBUS Inkscape::Extension::Dbus::dbus_init_desktop_interface(dt); +#endif + return dt; } -- 2.30.2