summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/build-swig-Python.sh
diff options
context:
space:
mode:
authorEd Maste <emaste@freebsd.org>2014-05-07 12:52:08 +0000
committerEd Maste <emaste@freebsd.org>2014-05-07 12:52:08 +0000
commitd010f9a8a510c3562b72890e80d8490d8db69126 (patch)
treeba12b83f1eb15024f580c5ea9bd25521017ee26b /lldb/scripts/Python/build-swig-Python.sh
parentda706022220b5cc8c90f7f5a4621cdd01f21c459 (diff)
downloadbcm5719-llvm-d010f9a8a510c3562b72890e80d8490d8db69126.tar.gz
bcm5719-llvm-d010f9a8a510c3562b72890e80d8490d8db69126.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. This is a missing part of LLDB commit r207122. Patch by Brooks Davis in FreeBSD ports commit r353052 llvm-svn: 208204
Diffstat (limited to 'lldb/scripts/Python/build-swig-Python.sh')
-rwxr-xr-xlldb/scripts/Python/build-swig-Python.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/lldb/scripts/Python/build-swig-Python.sh b/lldb/scripts/Python/build-swig-Python.sh
index 402d0852006..5f9b574e241 100755
--- a/lldb/scripts/Python/build-swig-Python.sh
+++ b/lldb/scripts/Python/build-swig-Python.sh
@@ -20,6 +20,8 @@ SWIG=$6
makefile_flag=$7
dependency_flag=$8
+PYTHON=${PYTHON_EXECUTABLE:-/usr/bin/env python}
+
if [ -n "$makefile_flag" -a "$makefile_flag" = "-m" ]
then
MakefileCalled=1
@@ -292,7 +294,7 @@ then
fi
fi
-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_version=`${PYTHON} --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'`
if [ $MakefileCalled -eq 0 ]
then
@@ -300,9 +302,9 @@ then
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
@@ -353,7 +355,7 @@ fi
current_dir=`pwd`
if [ -f "${current_dir}/modify-python-lldb.py" ]
then
- /usr/bin/env python ${current_dir}/modify-python-lldb.py ${CONFIG_BUILD_DIR}
+ ${PYTHON} ${current_dir}/modify-python-lldb.py ${CONFIG_BUILD_DIR}
fi
OpenPOWER on IntegriCloud