]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Fix compilation bug if dbus or mpris not selected
authorMike Brady <mikebrady@eircom.net>
Mon, 27 Nov 2017 11:26:23 +0000 (11:26 +0000)
committerMike Brady <mikebrady@eircom.net>
Mon, 27 Nov 2017 11:26:23 +0000 (11:26 +0000)
configure.ac
mdns_avahi.c

index 065ffedb3bfd5dba9ab3e77ac3bf76f6f6c58a1d..e7cc07feb5b4a7b63ed765f8392911e128b074f1 100644 (file)
@@ -279,6 +279,7 @@ AC_ARG_WITH(dbus-test-client, [  --with-dbus-test-client = compile dbus test cli
   AC_MSG_RESULT(>>Including dbus test client)
   HAS_DBUS_CLIENT=1
   AC_DEFINE([HAVE_DBUS_CLIENT], 1, [Needed by the compiler.])
+  AC_DEFINE([CONFIG_DACP], 1, [Needed by the compiler.])
   PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${GIO_UNIX_CFLAGS} ${CFLAGS}" LIBS="${GIO_UNIX_LIBS} ${LIBS}"],[AC_MSG_ERROR(dbus client support requires the glib 2.0 library -- libglib2.0-dev suggested!)])
   ], )
 AM_CONDITIONAL([USE_DBUS_CLIENT], [test "x$HAS_DBUS_CLIENT" = "x1"])
@@ -288,6 +289,7 @@ AC_ARG_WITH(mpris, [  --with-mpris = choose mpris support], [
   AC_MSG_RESULT(>>Including mpris support)
   HAS_MPRIS=1
   AC_DEFINE([HAVE_MPRIS], 1, [Needed by the compiler.])
+  AC_DEFINE([CONFIG_DACP], 1, [Needed by the compiler.])
   PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${GIO_UNIX_CFLAGS} ${CFLAGS}" LIBS="${GIO_UNIX_LIBS} ${LIBS}"],[AC_MSG_ERROR(dbus messaging support for mpris requires the glib 2.0 library -- libglib2.0-dev suggested!)])
   ], )
 AM_CONDITIONAL([USE_MPRIS], [test "x$HAS_MPRIS" = "x1"])
index e632a86046b5050f6e4bf2b16f5e33e6c52fc434..296ff10d9198e804f00651532196f99eacd6cdce 100644 (file)
@@ -33,7 +33,9 @@
 #include "common.h"
 #include "mdns.h"
 #include "rtsp.h"
+#ifdef CONFIG_DACP
 #include "dacp.h"
+#endif
 #include <string.h>
 
 #include <avahi-client/client.h>
@@ -89,7 +91,9 @@ static void resolve_callback(AvahiServiceResolver *r, AVAHI_GCC_UNUSED AvahiIfIn
         if (*p != port) {
           debug(1, "Client's DACP port: %u.", port);
           *p = port;
+#ifdef CONFIG_DACP
           set_dacp_port(port);
+#endif
 #ifdef CONFIG_METADATA
           char portstring[20];
           memset(portstring, 0, sizeof(portstring));
@@ -139,7 +143,9 @@ static void browse_callback(AvahiServiceBrowser *b, AvahiIfIndex interface, Avah
         if (*p != 0) {
           debug(1, "Client's DACP status withdrawn.");
           *p = 0;
+#ifdef CONFIG_DACP
           unset_dacp_port();
+#endif
         }
       }
     } else {