summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/finish-swig-Python-LLDB.sh
diff options
context:
space:
mode:
authorEd Maste <emaste@freebsd.org>2014-04-24 16:18:21 +0000
committerEd Maste <emaste@freebsd.org>2014-04-24 16:18:21 +0000
commit97b9dfaa3d8194b16c944e2cdb203d868faab3c4 (patch)
tree3fbb7b6a77f8e2803f883d22ef7454361b451aa7 /lldb/scripts/Python/finish-swig-Python-LLDB.sh
parent81ea601b54a45f7eb636d34465fa8ea19582c6ed (diff)
downloadbcm5719-llvm-97b9dfaa3d8194b16c944e2cdb203d868faab3c4.tar.gz
bcm5719-llvm-97b9dfaa3d8194b16c944e2cdb203d868faab3c4.zip
If CMake finds a python interpreter, use it
The FreeBSD package building cluster installs e.g. 'python2.7', but no plain 'python' to avoid version-related issues. CMake's FindPythonInterp locates an interpreter with such a name and provides it in the PYTHON_EXECUTABLE variable. Use that if it's set, falling back to the original '/usr/bin/env python' otherwise. Patch by Brooks Davis in FreeBSD ports commit r352012 llvm-svn: 207122
Diffstat (limited to 'lldb/scripts/Python/finish-swig-Python-LLDB.sh')
-rwxr-xr-xlldb/scripts/Python/finish-swig-Python-LLDB.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/scripts/Python/finish-swig-Python-LLDB.sh b/lldb/scripts/Python/finish-swig-Python-LLDB.sh
index 6f0bc387afd..1a5b96285c9 100755
--- a/lldb/scripts/Python/finish-swig-Python-LLDB.sh
+++ b/lldb/scripts/Python/finish-swig-Python-LLDB.sh
@@ -55,7 +55,8 @@ else
fi
OS_NAME=`uname -s`
-PYTHON_VERSION=`/usr/bin/env python --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'`
+PYTHON=${PYTHON_EXECUTABLE:-/usr/bin/env python}
+PYTHON_VERSION=`${PYTHON} --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'`
if [ $Debug -eq 1 ]
@@ -100,9 +101,9 @@ else
if [ -n "${PYTHON_INSTALL_DIR}" ]
then
- framework_python_dir=`/usr/bin/env python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True, False, \"${PYTHON_INSTALL_DIR}\");"`/lldb
+ framework_python_dir=`${PYTHON} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True, False, \"${PYTHON_INSTALL_DIR}\");"`/lldb
else
- framework_python_dir=`/usr/bin/env python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True, False);"`/lldb
+ framework_python_dir=`${PYTHON} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True, False);"`/lldb
fi
fi
OpenPOWER on IntegriCloud