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

[Cluster-devel] conga/ricci configure make/defines.mk.in ricci ...



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	kupcevic sourceware org	2006-07-25 19:10:19

Modified files:
	ricci          : configure 
	ricci/make     : defines.mk.in 
	ricci/ricci    : DBusController.cpp Makefile 

Log message:
	ricci: D-BUS API changed. DBusController.cpp uses different APIs based on detected d-bus version.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/configure.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/make/defines.mk.in.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/DBusController.cpp.diff?cvsroot=cluster&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/Makefile.diff?cvsroot=cluster&r1=1.12&r2=1.13

--- conga/ricci/configure	2006/06/16 20:44:15	1.4
+++ conga/ricci/configure	2006/07/25 19:10:18	1.5
@@ -44,9 +44,25 @@
 fi
 
 
+# D-BUS version
+DBUS_VERSION=`dbus-launch --version | grep D-BUS | sed -e s,^D-BUS\ Message\ Bus\ Launcher\ \\\\\([012]\.[0123456789]*\\\\\),\\\1,`
+if [ -z "$DBUS_VERSION" ] ; then 
+    echo "missing d-bus"
+    rm -f $MAKE_DEFINES
+    exit 1
+else
+    echo "detected dbus version: $DBUS_VERSION"
+    DBUS_MAJOR_VERSION=`echo $DBUS_VERSION | sed -e s,^\\\\\([012]\\\\\)\.[0123456789]*,\\\1,`
+    DBUS_MINOR_VERSION=`echo $DBUS_VERSION | sed -e s,^[012]\.\\\\\([0123456789]*\\\\\),\\\1,`
+fi
+
+
 cat $MAKE_DEFINES.in \
     | sed -e s,@@LIBDIR@@,$LIBDIR_SED,g \
     | sed -e s,@@ARCH@@,$ARCH,g \
+    | sed -e s,@@DBUS_VERSION@@,$DBUS_VERSION,g \
+    | sed -e s,@@DBUS_MAJOR_VERSION@@,$DBUS_MAJOR_VERSION,g \
+    | sed -e s,@@DBUS_MINOR_VERSION@@,$DBUS_MINOR_VERSION,g \
     | sed -e s,@@PEGASUS_PLATFORM@@,$PEGASUS_PLATFORM,g \
     >> $MAKE_DEFINES
 
--- conga/ricci/make/defines.mk.in	2006/06/30 22:26:12	1.4
+++ conga/ricci/make/defines.mk.in	2006/07/25 19:10:18	1.5
@@ -17,6 +17,9 @@
 docdir         ?= ${datadir}/doc
 arch           ?= @@ARCH@@
 pegasus_providers_dir ?= ${libdir}/Pegasus/providers
+dbus_version          ?= @@DBUS_VERSION@@
+dbus_major_version    ?= @@DBUS_MAJOR_VERSION@@
+dbus_minor_version    ?= @@DBUS_MINOR_VERSION@@
 
 
 #--build=i686-redhat-linux-gnu
--- conga/ricci/ricci/DBusController.cpp	2006/06/15 03:08:37	1.11
+++ conga/ricci/ricci/DBusController.cpp	2006/07/25 19:10:18	1.12
@@ -106,8 +106,13 @@
   MutexLocker lock(_dbus_mutex);
   
   if (--_object_counter == 0) {
-    //  dbus_connection_close(_dbus_conn);
-    dbus_connection_disconnect(_dbus_conn);  // old version
+#if (DBUS_MAJOR_VERSION == 1) || (DBUS_MAJOR_VERSION == 0 && DBUS_MINOR_VERSION >= 90)
+    dbus_connection_close(_dbus_conn);
+#elif DBUS_MAJOR_VERSION == 0 && DBUS_MINOR_VERSION < 90
+    dbus_connection_disconnect(_dbus_conn);
+#else
+#error "unrecognized major DBUS number"
+#endif
     dbus_connection_unref(_dbus_conn);
     _dbus_conn = 0;
   }
--- conga/ricci/ricci/Makefile	2006/06/30 22:26:13	1.12
+++ conga/ricci/ricci/Makefile	2006/07/25 19:10:18	1.13
@@ -40,7 +40,7 @@
 
 INCLUDE     += -I ${includedir}/dbus-1.0 -I ${libdir}/dbus-1.0/include
 CFLAGS      += 
-CXXFLAGS    += 
+CXXFLAGS    += -DDBUS_MAJOR_VERSION="${dbus_major_version}" -DDBUS_MINOR_VERSION="${dbus_minor_version}"
 LDFLAGS     += -l dbus-1 
 
 


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