]> git.meshlink.io Git - catta/commitdiff
improve compatiblity wth avahi 0.60 (original patch from slomo)
authorLennart Poettering <lennart@poettering.net>
Wed, 21 Dec 2005 20:25:39 +0000 (20:25 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 21 Dec 2005 20:25:39 +0000 (20:25 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1043 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

configure.ac

index dc1c9720ba07ef58c8209cd81ff8b9e49315bf51..3151f86ce17c56ad7a4ded593531933d7d8490ea 100644 (file)
@@ -356,10 +356,40 @@ DBUS_VERSION="Disabled"
 DBUS_SYS_DIR="Disabled"
 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="Disabled"
 if test "x$HAVE_DBUS" = "xyes" ; then
+    PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.34 ])
+
     AC_DEFINE(HAVE_DBUS, 1, [Whether we have D-BUS or not])
 
     DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
-    PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.34 ])
+    DBUS_VERSION_MAJOR=`echo $DBUS_VERSION | awk -F. '{print $1}'`
+    DBUS_VERSION_MINOR=`echo $DBUS_VERSION | awk -F. '{print $2}'`
+    DBUS_VERSION_MICRO=`echo $DBUS_VERSION | awk -F. '{print $3}'`
+    if test "z$DBUS_VERSION_MAJOR" = "z"; then
+        DBUS_VERSION_MAJOR="0"
+    fi
+    if test "z$DBUS_VERSION_MINOR" = "z"; then
+        DBUS_VERSION_MINOR="0"
+    fi
+    if test "z$DBUS_VERSION_MICRO" = "z"; then
+        DBUS_VERSION_MICRO="0"
+    fi
+
+    if test "z$DBUS_VERSION_MAJOR" = "z0" -a "z$DBUS_VERSION_MINOR" = "z0" -a "z$DBUS_VERSION_MICRO" = "z0"; then
+        echo "Error: Couldn't determine the version of your DBUS package."
+        echo "  This is probably an error in this script, please report it"
+        echo "  along with the following information:"
+        echo "      Base DBUS version ='$DBUS_VERSION'"
+        echo "      DBUS_VERSION_MAJOR='$DBUS_VERSION_MAJOR'"
+        echo "      DBUS_VERSION_MINOR='$DBUS_VERSION_MINOR'"
+        echo "      DBUS_VERSION_MICRO='$DBUS_VERSION_MICRO'"
+        exit 1
+    else
+        echo "Your dbus version is $DBUS_VERSION_MAJOR,$DBUS_VERSION_MINOR,$DBUS_VERSION_MICRO."
+        DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
+        DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
+        DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
+    fi
+
     DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
     AC_SUBST(DBUS_CFLAGS)
     AC_SUBST(DBUS_LIBS)