libbonobo r3471 - in trunk: . activation-server bonobo-activation



Author: tml
Date: Fri Jun  6 00:08:41 2008
New Revision: 3471
URL: http://svn.gnome.org/viewvc/libbonobo?rev=3471&view=rev

Log:
2008-06-06  Tor Lillqvist  <tml novell com>

	* configure.in: Look for dbus only on Unix and define HAVE_DBUS in
	config.h in that case.

	* activation-server/activation-server-main.c
	* bonobo-activation/bonobo-activation-base-service.c
	(get_session_guid): Bypass dbus code unless HAVE_DBUS.



Modified:
   trunk/ChangeLog
   trunk/activation-server/activation-server-main.c
   trunk/bonobo-activation/bonobo-activation-base-service.c
   trunk/configure.in

Modified: trunk/activation-server/activation-server-main.c
==============================================================================
--- trunk/activation-server/activation-server-main.c	(original)
+++ trunk/activation-server/activation-server-main.c	Fri Jun  6 00:08:41 2008
@@ -54,7 +54,9 @@
 
 #include <glib/gstdio.h>
 
+#ifdef HAVE_DBUS
 #include <dbus/dbus-glib-lowlevel.h>
+#endif
 
 static gboolean        server_threaded = FALSE;
 static glong           server_guard_depth = 0;
@@ -390,6 +392,8 @@
     g_free (fname);
 }
 
+#ifdef HAVE_DBUS
+
 static DBusHandlerResult
 bus_message_handler (DBusConnection *connection,
                      DBusMessage    *message,
@@ -405,6 +409,8 @@
         return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
 
+#endif
+
 int
 main (int argc, char *argv[])
 {
@@ -428,8 +434,10 @@
 	const gchar                  *debug_output_env;
 #endif
 	GError                       *error = NULL;
+#ifdef HAVE_DBUS
         DBusConnection               *connection;
         DBusError                     bus_error;
+#endif
 
 #ifdef HAVE_SETSID
         /*
@@ -567,6 +575,7 @@
 
 	od_finished_internal_registration (); 
 
+#ifdef HAVE_DBUS
         dbus_error_init (&bus_error);
         connection = dbus_bus_get (DBUS_BUS_SESSION, &bus_error);
 
@@ -587,7 +596,7 @@
                         dbus_connection_set_exit_on_disconnect (connection, FALSE);
                 }
         }
-
+#endif
         if (getenv ("BONOBO_ACTIVATION_DEBUG") == NULL)
                 chdir ("/");
 

Modified: trunk/bonobo-activation/bonobo-activation-base-service.c
==============================================================================
--- trunk/bonobo-activation/bonobo-activation-base-service.c	(original)
+++ trunk/bonobo-activation/bonobo-activation-base-service.c	Fri Jun  6 00:08:41 2008
@@ -501,6 +501,7 @@
 static const char *
 get_session_guid (void)
 {
+#ifdef HAVE_DBUS
         const char *session_bus_address;
         const char *guid;
 
@@ -520,6 +521,9 @@
                 return NULL;
 
         return guid + strlen ("guid=");
+#else
+        return NULL;
+#endif
 }
 
 char *

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Fri Jun  6 00:08:41 2008
@@ -44,6 +44,8 @@
     os_win32=no
     SOPREFIX=lib
     SEARCHPATHSEP=":"
+    AC_DEFINE(HAVE_DBUS, 1, [whether we have dbus])
+    dbus_requirement="dbus-1 >= 1.0.0 dbus-glib-1 >= 0.74"
     ;;
 esac
 
@@ -121,8 +123,7 @@
 	gmodule-2.0 >= 2.0.1 \
 	ORBit-2.0 >= 2.4.0 \
 	ORBit-CosNaming-2.0 >= 2.4.0 \
-	dbus-1 >= 1.0.0 \
-	dbus-glib-1 >= 0.74 \
+	$dbus_requirement \
 	libxml-2.0 >= 2.4.20)
 AC_SUBST(SERVER_LIBS)
 AC_SUBST(SERVER_CFLAGS)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]