[pulseaudio-commits] r1772 - in /branches/lennart: configure.ac src/modules/dbus-util.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu Sep 6 13:06:03 PDT 2007


Author: lennart
Date: Thu Sep  6 22:06:02 2007
New Revision: 1772

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1772&root=pulseaudio&view=rev
Log:
explicitly test for the availability of dbus_watch_get_unix_fd() before using it. The previous version-based check didn't work anyway since the constants checked for weren't set.

Modified:
    branches/lennart/configure.ac
    branches/lennart/src/modules/dbus-util.c

Modified: branches/lennart/configure.ac
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/configure.ac?rev=1772&root=pulseaudio&r1=1771&r2=1772&view=diff
==============================================================================
--- branches/lennart/configure.ac (original)
+++ branches/lennart/configure.ac Thu Sep  6 22:06:02 2007
@@ -713,7 +713,6 @@
             esac
         ],
         [hal=auto])
-
 if test "x${hal}" != xno -a \( "x$HAVE_OSS" = "x1" -o "x$HAVE_ALSA" = "x1" \) ; then
     PKG_CHECK_MODULES(HAL, [ hal >= 0.5.7 ],
         HAVE_HAL=1,
@@ -731,6 +730,49 @@
 AC_SUBST(HAL_LIBS)
 AC_SUBST(HAVE_HAL)
 AM_CONDITIONAL([HAVE_HAL], [test "x$HAVE_HAL" = x1])
+
+#### D-Bus support (optional) ####
+
+AC_ARG_ENABLE([dbus], 
+    AC_HELP_STRING([--disable-dbus], [Disable optional D-Bus support]), 
+        [
+            case "${enableval}" in
+                yes) dbus=yes ;;
+                no) dbus=no ;;
+                *) AC_MSG_ERROR(bad value ${enableval} for --disable-dbus) ;;
+            esac
+        ],
+        [dbus=auto])
+
+if test "x$HAVE_HAL" = x1 ; then 
+   dbus=yes
+fi
+
+if test "x${dbus}" != xno ; then
+
+    PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 1.0.0 ],
+        [
+            HAVE_DBUS=1
+            saved_LIBS="$LIBS"
+            LIBS="$LIBS $DBUS_LIBS"
+            AC_CHECK_FUNCS(dbus_watch_get_unix_fd)
+            LIBS="$saved_LIBS"
+        
+        ],
+        [
+            HAVE_DBUS=0
+            if test "x$dbus" = xyes ; then
+                AC_MSG_ERROR([*** D-Bus support not found])
+            fi
+        ])
+else
+    HAVE_DBUS=0
+fi
+
+AC_SUBST(DBUS_CFLAGS)
+AC_SUBST(DBUS_LIBS)
+AC_SUBST(HAVE_DBUS)
+AM_CONDITIONAL([HAVE_DBUS], [test "x$HAVE_DBUS" = x1])
 
 #### PulseAudio system group & user  #####
 

Modified: branches/lennart/src/modules/dbus-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/modules/dbus-util.c?rev=1772&root=pulseaudio&r1=1771&r2=1772&view=diff
==============================================================================
--- branches/lennart/src/modules/dbus-util.c (original)
+++ branches/lennart/src/modules/dbus-util.c Thu Sep  6 22:06:02 2007
@@ -96,7 +96,7 @@
     unsigned int flags = 0;
     DBusWatch *watch = userdata;
 
-#if (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR == 1 && DBUS_VERSION_MICRO >= 1) || (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR > 1) || (DBUS_VERSION_MAJOR > 1) 
+#if HAVE_DBUS_WATCH_GET_UNIX_FD
     pa_assert(fd == dbus_watch_get_unix_fd(watch));
 #else
     pa_assert(fd == dbus_watch_get_fd(watch));
@@ -141,14 +141,15 @@
     pa_assert(watch);
     pa_assert(c);
 
-    ev = c->mainloop->io_new(c->mainloop, 
-#if (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR == 1 && DBUS_VERSION_MICRO >= 1) || (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MAJOR > 1) || (DBUS_VERSION_MAJOR > 1) 
-			     dbus_watch_get_unix_fd(watch), 
+    ev = c->mainloop->io_new(
+            c->mainloop, 
+#if HAVE_DBUS_WATCH_GET_UNIX_FD
+            dbus_watch_get_unix_fd(watch), 
 #else
-			     dbus_watch_get_fd(watch), 
+            dbus_watch_get_fd(watch), 
 #endif
-			     get_watch_flags(watch), handle_io_event, watch);
-
+            get_watch_flags(watch), handle_io_event, watch);
+    
     dbus_watch_set_data(watch, ev, NULL);
 
     return TRUE;




More information about the pulseaudio-commits mailing list