summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/scripts/Python')
-rwxr-xr-xlldb/scripts/Python/build-swig-Python.sh13
-rwxr-xr-xlldb/scripts/Python/finish-swig-Python-LLDB.sh11
2 files changed, 13 insertions, 11 deletions
diff --git a/lldb/scripts/Python/build-swig-Python.sh b/lldb/scripts/Python/build-swig-Python.sh
index 25a940694b3..2a1a34bdd5a 100755
--- a/lldb/scripts/Python/build-swig-Python.sh
+++ b/lldb/scripts/Python/build-swig-Python.sh
@@ -18,13 +18,19 @@ PYTHON_INSTALL_DIR=$4
debug_flag=$5
SWIG=$6
-swig_output_file=${SRC_ROOT}/source/LLDBWrapPython.cpp
+os_name=`uname -s`
+if [ "$os_name" == "Darwin" ]
+then
+ swig_output_file=${SRC_ROOT}/source/LLDBWrapPython.cpp
+else
+ swig_output_file=${TARGET_DIR}/LLDBWrapPython.cpp
+fi
swig_input_file=${SRC_ROOT}/scripts/lldb.swig
swig_python_extensions=${SRC_ROOT}/scripts/Python/python-extensions.swig
swig_python_wrapper=${SRC_ROOT}/scripts/Python/python-wrapper.swig
swig_python_typemaps=${SRC_ROOT}/scripts/Python/python-typemaps.swig
-if [ $LLDB_DISABLE_PYTHON = "1" ] ; then
+if [ "$LLDB_DISABLE_PYTHON" = "1" ] ; then
# We don't want Python for this build, but touch the output file so we don't have to
# conditionalize the build on this as well.
# Note, at present iOS doesn't have Python, so if you're building for iOS be sure to
@@ -252,8 +258,7 @@ then
fi
fi
-os_name=`uname -s`
-python_version=`/usr/bin/python --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'`
+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],,'`
if [ "$os_name" == "Darwin" ]
then
diff --git a/lldb/scripts/Python/finish-swig-Python-LLDB.sh b/lldb/scripts/Python/finish-swig-Python-LLDB.sh
index 2e24091a2db..c6c394c28a8 100755
--- a/lldb/scripts/Python/finish-swig-Python-LLDB.sh
+++ b/lldb/scripts/Python/finish-swig-Python-LLDB.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/sh
# finish-swig-Python.sh
#
@@ -37,7 +37,7 @@ debug_flag=$5
# Note, at present iOS doesn't have Python, so if you're building for iOS be sure to
# set LLDB_DISABLE_PYTHON to 1.
-if [ ! $LLDB_DISABLE_PYTHON = "1" ] ; then
+if [ ! "$LLDB_DISABLE_PYTHON" = "1" ] ; then
if [ -n "$debug_flag" -a "$debug_flag" == "-debug" ]
then
@@ -47,7 +47,7 @@ else
fi
OS_NAME=`uname -s`
-PYTHON_VERSION=`/usr/bin/python --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'`
+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],,'`
if [ $Debug == 1 ]
@@ -134,9 +134,6 @@ then
then
cd "${framework_python_dir}"
ln -s "../../../LLDB" _lldb.so
- else
- cd "${TARGET_DIR}"
- ln -s "../LLDB" _lldb.so
fi
else
if [ $Debug == 1 ]
@@ -146,7 +143,7 @@ else
fi
-function create_python_package {
+create_python_package () {
package_dir="${framework_python_dir}$1"
package_files="$2"
package_name=`echo $1 | tr '/' '.'`
OpenPOWER on IntegriCloud