Code

Fix build failure when DBus is not enabled
authorKrzysztof Kosiński <tweenk.pl@gmail.com>
Fri, 16 Jul 2010 22:29:25 +0000 (00:29 +0200)
committerKrzysztof Kosiński <tweenk.pl@gmail.com>
Fri, 16 Jul 2010 22:29:25 +0000 (00:29 +0200)
configure.ac
src/extension/dbus/Makefile_insert
src/file.cpp

index 93c3872a3b99c082e8c9d6c53d21ef936b1c47bf..751e36f47ec686a1df4ff7ffe9ca2653c2c2b98f 100644 (file)
@@ -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 ******************************
index ce733364c398a707ff0c97ec85c317a997ce48c9..a5eb3fdf4537139d3f7c112d6e3564c23ab5d723 100644 (file)
@@ -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
+
index 1186a1f0794924ef5aba92b0f49b4cdca13937da..50fcd3642a0eab67a58da51893cbf6a797f8cba6 100644 (file)
@@ -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"
 # include <libgnomevfs/gnome-vfs.h>
 #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;
 }