Update so that it uses the `-V' command line option and supports Python 3.x.
[oota-llvm.git] / configure
index 6d061d482378955cfab0b6e928413102cd1263a3..2263bb4f49322524fdfd8676276a3557c5f7c659 100755 (executable)
--- a/configure
+++ b/configure
 
 { echo "$as_me:$LINENO: checking for python >= 2.5" >&5
 echo $ECHO_N "checking for python >= 2.5... $ECHO_C" >&6; }
-ac_python_version=`$PYTHON -c 'import sys; print sys.version.split()[0]'`
+ac_python_version=`$PYTHON -V 2>&1 | cut -d' ' -f2`
 ac_python_version_major=`echo $ac_python_version | cut -d'.' -f1`
 ac_python_version_minor=`echo $ac_python_version | cut -d'.' -f2`
 ac_python_version_patch=`echo $ac_python_version | cut -d'.' -f3`
-if   test "$ac_python_version_major" -eq "2" \
-   && test "$ac_python_version_minor" -ge "5" ; then
+if test "$ac_python_version_major" -gt "2" || \
+   (test "$ac_python_version_major" -eq "2" && \
+    test "$ac_python_version_minor" -ge "5") ; then
   { echo "$as_me:$LINENO: result: $PYTHON ($ac_python_version)" >&5
 echo "${ECHO_T}$PYTHON ($ac_python_version)" >&6; }
 else