summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-10-12 08:42:59 +0000
committerBill Wendling <isanbard@gmail.com>2013-10-12 08:42:59 +0000
commit58463e4e83100423a3c2b72fb095908cf4d5e700 (patch)
tree910ee90a84097a64878d26e3474eff81b2f4f137
parent88adf2a49cda279520b9b2ff82afecec5ef666d8 (diff)
downloadbcm5719-llvm-58463e4e83100423a3c2b72fb095908cf4d5e700.tar.gz
bcm5719-llvm-58463e4e83100423a3c2b72fb095908cf4d5e700.zip
Update so that it uses the `-V' command line option and supports Python 3.x.
llvm-svn: 192527
-rw-r--r--llvm/autoconf/configure.ac7
-rwxr-xr-xllvm/configure7
2 files changed, 8 insertions, 6 deletions
diff --git a/llvm/autoconf/configure.ac b/llvm/autoconf/configure.ac
index 85eee54bf39..d5f95cd0eb0 100644
--- a/llvm/autoconf/configure.ac
+++ b/llvm/autoconf/configure.ac
@@ -1377,12 +1377,13 @@ else
fi
AC_MSG_CHECKING([for python >= 2.5])
-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
AC_MSG_RESULT([$PYTHON ($ac_python_version)])
else
AC_MSG_RESULT([not found])
diff --git a/llvm/configure b/llvm/configure
index 6d061d48237..2263bb4f493 100755
--- a/llvm/configure
+++ b/llvm/configure
@@ -11815,12 +11815,13 @@ fi
{ 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
OpenPOWER on IntegriCloud