summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhasufell <julian.ospald@googlemail.com>2013-03-31 16:57:26 +0200
committerhasufell <julian.ospald@googlemail.com>2013-03-31 16:57:26 +0200
commitae5d7e29e3dd3fe60007c718c5336875eec81081 (patch)
tree7373a9a090fa013f5db2cfbb068caff0a0058a91
parent477bbbb340544548a4d33a8f207a247f52660e45 (diff)
CONFIGURE: allow to pass specific python version
This is useful if distros support installing multiple python versions
in parallel such as: 2.5, 2.6, 2.7.
For python3.* we will get syntax error during the imports, so the checks
will successfully disable it.
It defaults to python2.
-rw-r--r--configure.ac18
1 files changed, 11 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 74c4394e..9b1a912d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -114,8 +114,8 @@ AC_ARG_ENABLE(xlib,
         xlib=$enableval, xlib=yes)
 
 AC_ARG_ENABLE(python,
-	[AS_HELP_STRING([--disable-python],[don't build the python plugin])],
-        python=$enableval, python=yes)
+	[AS_HELP_STRING([--enable-python=pythonversion],[build the python plugin (default on, python2)])],
+        python=$enableval, python=python2)
 
 AC_ARG_ENABLE(perl,
 	[AS_HELP_STRING([--disable-perl],[don't build the perl plugin])],
@@ -333,9 +333,13 @@ dnl *********************************************************************
 dnl ** PYTHON ***********************************************************
 dnl *********************************************************************
 
-if test "$python" = yes; then
-        AC_PATH_PROG(pythonpath, python2)
-        if test "_$pythonpath" = _ ; then
+if test "x$python" != xno ; then
+	if test "$python" = yes ; then
+		# default
+		python="python2"
+	fi
+	AC_PATH_PROG(pythonpath, $python)
+	if test "_$pythonpath" = _ ; then
                 AC_PATH_PROG(pythonpath, python)
         fi
         if test "_$pythonpath" = _ ; then
@@ -363,7 +367,7 @@ if test "$python" = yes; then
                                 AC_MSG_RESULT([Can't find Python.h])
                         fi
                 else
-                        echo "Python too old. Only 2.2 or above is supported."
+                        echo "Python is too old or too new. Only 2.2-2.7 are supported."
                         python=no
                 fi
         fi
@@ -696,7 +700,7 @@ AM_CONDITIONAL(USE_LIBNOTIFY, test "x$libnotify" = "xyes")
 AM_CONDITIONAL(DO_TEXT, test "x$textfe" = "xyes")
 AM_CONDITIONAL(DO_GTK, test "x$gtkfe" = "xyes")
 AM_CONDITIONAL(DO_PERL, test "x$perl" = "xyes")
-AM_CONDITIONAL(DO_PYTHON, test "x$python" = "xyes")
+AM_CONDITIONAL(DO_PYTHON, test "x$python" != "xno")
 dnl AM_CONDITIONAL(DO_TCL, test "x$tcl" = "xyes")
 AM_CONDITIONAL(DO_PLUGIN, test "x$plugin" = "xyes")
 AM_CONDITIONAL(DO_CHECKSUM, test "x$checksum" = "xyes")