[banshee] [build] support --enable-tests, disable by default



commit fe1624137f67ccae955db25ed348b7b34963be95
Author: Aaron Bockover <abockover novell com>
Date:   Wed Oct 14 16:09:45 2009 -0400

    [build] support --enable-tests, disable by default

 build/m4/shamrock/nunit.m4 |   35 +++++++++++++++++++++--------------
 1 files changed, 21 insertions(+), 14 deletions(-)
---
diff --git a/build/m4/shamrock/nunit.m4 b/build/m4/shamrock/nunit.m4
index d2bec4f..4d57d00 100644
--- a/build/m4/shamrock/nunit.m4
+++ b/build/m4/shamrock/nunit.m4
@@ -2,21 +2,28 @@ AC_DEFUN([SHAMROCK_CHECK_NUNIT],
 [
 	NUNIT_REQUIRED=2.4.7
 
-	PKG_CHECK_MODULES(NUNIT, nunit >= $NUNIT_REQUIRED, 
-		do_tests="yes", do_tests="no")
-	
-	AC_SUBST(NUNIT_LIBS)
-	AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")
+	AC_ARG_ENABLE(tests, AC_HELP_STRING([--enable-tests], [Enable NUnit tests]),
+		enable_tests=$enableval, enable_tests="no")
 
-	if test "x$do_tests" = "xno"; then
-        PKG_CHECK_MODULES(NUNIT, mono-nunit >= 2.4, 
-            do_tests="yes", do_tests="no")
-        
-        AC_SUBST(NUNIT_LIBS)
-        AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")
+	if test "x$enable_tests" = "xno"; then
+		do_tests=no
+		AM_CONDITIONAL(ENABLE_TESTS, false)
+	else
+		PKG_CHECK_MODULES(NUNIT, nunit >= $NUNIT_REQUIRED,
+			do_tests="yes", do_tests="no")
 
-        if test "x$do_tests" = "xno"; then
-            AC_MSG_WARN([Could not find nunit: tests will not be available.])
-        fi
+		AC_SUBST(NUNIT_LIBS)
+		AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")
+
+		if test "x$do_tests" = "xno"; then
+			PKG_CHECK_MODULES(NUNIT, mono-nunit >= 2.4,
+				do_tests="yes", do_tests="no")
+
+			AC_SUBST(NUNIT_LIBS)
+			AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")
+
+			if test "x$do_tests" = "xno"; then
+				AC_MSG_WARN([Could not find nunit: tests will not be available])			fi
+		fi
 	fi
 ])



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