grc check python version
[debian/gnuradio] / config / grc_grc.m4
index f82c555851cb55d67f6e9e0f4ee173a9022bc73a..140068c1b239fa77dc5784dda749fd2d438f485c 100644 (file)
@@ -22,22 +22,27 @@ AC_DEFUN([GRC_GRC],[
 
     GRC_CHECK_DEPENDENCY(grc, gr-wxgui)
 
+    AC_CHECK_PROG(XDG_UTILS, xdg-mime, true, false)
+    AM_CONDITIONAL(XDG_UTILS, $XDG_UTILS)
+
+    dnl ########################################
+    dnl # test python version
+    dnl ########################################
+    AC_MSG_CHECKING([for Python version 2.5])
+    if test `${PYTHON} -c "import sys; print sys.version.split()[[0]] >= '2.5'"` = 'True'; then
+        AC_MSG_RESULT([yes])
+    else
+        AC_MSG_RESULT([no])
+        passed=no
+    fi
+
     dnl ########################################
     dnl # test python dependencies
     dnl ########################################
     if test $passed = yes; then
-        if ! ${PYTHON} -c 'import Cheetah'; then
-            AC_MSG_RESULT([grc requires the Python Cheetah templates installed, not found.])
-            passed=no
-        fi
-        if ! ${PYTHON} -c 'import pygtk'; then
-            AC_MSG_RESULT([grc requires Python GTK wrappers installed, not found.])
-            passed=no
-        fi
-        if ! ${PYTHON} -c 'import lxml'; then
-            AC_MSG_RESULT([grc requires libxml2 and libxslt wrappers (lxml), not found.])
-            passed=no
-        fi
+        PYTHON_CHECK_MODULE([Cheetah],[Python Cheetah templates],[],[passed=no])
+        PYTHON_CHECK_MODULE([pygtk],[Python GTK wrappers],[],[passed=no])
+        PYTHON_CHECK_MODULE([lxml],[Python XML wrappers],[],[passed=no])
     fi
 
     dnl ########################################