fi
-python="python python3 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2 python2.7 python2.6 python2.5 python2.4"
+python="python python3 python3.5 python3.4 python3.3 python3.2 python2 python2.7"
testargparse='try: import argparse
except: exit(1)'
testply='try: from ply import *
except: exit(1)'
+testminvers='import sys
+if (sys.version_info < (2,7)) or (sys.version_info < (3,2) and sys.version_info >= (3,0)):
+ exit(1)'
+
case "$use_python" in
no)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for python support" >&5
if test "X$PYTHON" = "X"; then
continue;
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking python2 version >= 2.7 or python3 version >= 3.2" >&5
+$as_echo_n "checking python2 version >= 2.7 or python3 version >= 3.2... " >&6; }
+ if ${PYTHON:-false} -c "$testminvers"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+ unset ac_cv_path_PYTHON
+ unset PYTHON
+ continue
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking python module 'argparse'" >&5
$as_echo_n "checking python module 'argparse'... " >&6; }
if ${PYTHON:-false} -c "$testargparse"; then
;;
esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking python2 version >= 2.7 or python3 version >= 3.2" >&5
+$as_echo_n "checking python2 version >= 2.7 or python3 version >= 3.2... " >&6; }
+ if ${PYTHON:-false} -c "$testminvers"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+ else
+ as_fn_error $? "not found" "$LINENO" 5
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking python module 'argparse'" >&5
$as_echo_n "checking python module 'argparse'... " >&6; }
if ${PYTHON:-false} -c "$testargparse"; then
[ --with-python=PATH specify path to python interpreter],
use_python="$withval", use_python="unspec")
-python="python python3 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2 python2.7 python2.6 python2.5 python2.4"
+python="python python3 python3.5 python3.4 python3.3 python3.2 python2 python2.7"
testargparse='try: import argparse
except: exit(1)'
testply='try: from ply import *
except: exit(1)'
+testminvers='import sys
+if (sys.version_info < (2,7)) or (sys.version_info < (3,2) and sys.version_info >= (3,0)):
+ exit(1)'
+
case "$use_python" in
no)
AC_MSG_CHECKING([for python support])
if test "X$PYTHON" = "X"; then
continue;
fi
+ AC_MSG_CHECKING([python2 version >= 2.7 or python3 version >= 3.2])
+ if ${PYTHON:-false} -c "$testminvers"; then
+ AC_MSG_RESULT([found])
+ else
+ AC_MSG_RESULT([not found])
+ unset ac_cv_path_PYTHON
+ unset PYTHON
+ continue
+ fi
AC_MSG_CHECKING([python module 'argparse'])
if ${PYTHON:-false} -c "$testargparse"; then
AC_MSG_RESULT([found])
AC_PATH_PROGS(PYTHON, $use_python)
;;
esac
+ AC_MSG_CHECKING([python2 version >= 2.7 or python3 version >= 3.2])
+ if ${PYTHON:-false} -c "$testminvers"; then
+ AC_MSG_RESULT([found])
+ else
+ AC_MSG_ERROR([not found])
+ fi
AC_MSG_CHECKING([python module 'argparse'])
if ${PYTHON:-false} -c "$testargparse"; then
AC_MSG_RESULT([found, using $PYTHON])