From 97b9dfaa3d8194b16c944e2cdb203d868faab3c4 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Thu, 24 Apr 2014 16:18:21 +0000 Subject: 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 --- lldb/scripts/Python/finish-swig-Python-LLDB.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lldb/scripts/Python/finish-swig-Python-LLDB.sh') 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 -- cgit v1.2.3