[tracker] functional-tests: Require Python >= 2.6 with --enable-functional-test



commit a2fe8711d0a0b348b016d9f7cdfeb9f696680d67
Author: Martyn Russell <martyn lanedo com>
Date:   Mon Dec 6 10:23:09 2010 +0000

    functional-tests: Require Python >= 2.6 with --enable-functional-test

 configure.ac |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 89ff13f..49f9b7e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -162,6 +162,9 @@ if test "x$tracker_cv_have_ioprio" = "xyes" ; then
    AC_DEFINE(HAVE_IOPRIO, 1, [Define if we have ioprio])
 fi
 
+# Binary required versions
+PYTHON_REQUIRED=2.6
+
 # Library required versions
 DBUS_REQUIRED=1.3.1
 DBUS_GLIB_REQUIRED=0.82
@@ -548,7 +551,16 @@ AC_ARG_ENABLE([functional-tests],
               [enable_functional_tests=yes])
 
 if test x$enable_functional_tests != "xno"; then
-  AC_DEFINE(DIST_FUNCTIONAL_TESTS, 1, [Include functional tests in the installation])
+   # Python check, require >= 2.6
+   AC_PATH_PROG([PYTHON],[python],[:])
+   AS_IF([test "$PYTHON" != ":"],
+         [AM_PYTHON_CHECK_VERSION([$PYTHON],[$PYTHON_REQUIRED],[:],[PYTHON=":"])])
+
+   if test "$PYTHON" = ":"; then
+      AC_MSG_ERROR([Couldn't find Python >= $PYTHON_REQUIRED (for functional-tests, try --disable-functional-tests).])
+   fi
+
+   AC_DEFINE(DIST_FUNCTIONAL_TESTS, 1, [Include functional tests in the installation])
 fi
 
 AM_CONDITIONAL(DIST_FUNCTIONAL_TESTS, test "x$enable_functional_tests" != "xno")



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