[banshee] build: Better handling of UPnP configure options



commit f541c373c5410750a97829158b690a9c5559a20b
Author: Alexander Kojevnikov <alexk gnome org>
Date:   Tue Feb 14 11:45:11 2012 +0800

    build: Better handling of UPnP configure options

 build/m4/banshee/mono-upnp.m4 |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/build/m4/banshee/mono-upnp.m4 b/build/m4/banshee/mono-upnp.m4
index 8e1e033..d1cac27 100644
--- a/build/m4/banshee/mono-upnp.m4
+++ b/build/m4/banshee/mono-upnp.m4
@@ -2,15 +2,29 @@ AC_DEFUN([BANSHEE_CHECK_MONO_UPNP],
 [
 	MONOUPNP_REQUIRED=0.1
 
-	AC_ARG_ENABLE(upnp, AC_HELP_STRING([--disable-upnp], [Disable UPnP support]), , enable_upnp="yes")
+	AC_ARG_ENABLE([upnp],
+		AC_HELP_STRING([--enable-upnp], [Enable UPnP support]),
+		enable_upnp=$enableval, enable_upnp="try"
+	)
 
-	if test "x$enable_upnp" = "xyes"; then
+	has_mono_upnp=no
+	if test "x$enable_upnp" != "xno"; then
 		PKG_CHECK_MODULES(MONO_UPNP,
 			mono.ssdp >= $MONOUPNP_REQUIRED
 			mono.upnp >= $MONOUPNP_REQUIRED
 			mono.upnp.dcp.mediaserver1 >= $MONOUPNP_REQUIRED,
-			enable_upnp=yes, enable_upnp=no)
+			has_mono_upnp=yes, has_mono_upnp=no)
+	fi
+
+	if test "x$enable_upnp" = "xyes" -a "x$has_mono_upnp" = "xno"; then
+		AC_MSG_ERROR([mono-upnp was not found or is not up to date. Please install mono-upnp of at least version $MONOUPNP_REQUIRED, or disable UPnP support by passing --disable-upnp])
+	fi
 
+	if test "x$enable_upnp" = "xtry" -a "x$has_mono_upnp" = "xyes"; then
+		enable_upnp=yes
+	fi
+
+	if test "x$enable_upnp" = "xyes"; then
 		AC_SUBST(MONO_UPNP_LIBS)
 
 		asms="`$PKG_CONFIG --variable=Libraries mono.ssdp` `$PKG_CONFIG --variable=Libraries mono.upnp` `$PKG_CONFIG --variable=Libraries mono.upnp.dcp.mediaserver1`"
@@ -25,8 +39,9 @@ AC_DEFUN([BANSHEE_CHECK_MONO_UPNP],
 		done
 		AC_SUBST(MONOUPNP_ASSEMBLIES)
 
-		AM_CONDITIONAL(UPNP_ENABLED, test "x$enable_upnp" = "xyes")
+		AM_CONDITIONAL(UPNP_ENABLED, true)
 	else
+		enable_upnp=no
 		AM_CONDITIONAL(UPNP_ENABLED, false)
 	fi
 



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