diff options
Diffstat (limited to 'lldb/scripts/Python/finish-swig-Python-LLDB.sh')
-rwxr-xr-x | lldb/scripts/Python/finish-swig-Python-LLDB.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lldb/scripts/Python/finish-swig-Python-LLDB.sh b/lldb/scripts/Python/finish-swig-Python-LLDB.sh new file mode 100755 index 00000000000..293a8b18c66 --- /dev/null +++ b/lldb/scripts/Python/finish-swig-Python-LLDB.sh @@ -0,0 +1,45 @@ +#! /bin/sh + +# finish-swig-Python.sh +# +# For the Python script interpreter (external to liblldb) to be able to import +# and use the lldb module, there must be a "_lldb.so" in the framework +# resources directory. Here we make a symlink called "_lldb.so" that just +# points to the executable in the LLDB.framework and copy over the needed +# .py files. + +if [ ! -d "${TARGET_BUILD_DIR}/LLDB.framework" ] +then + echo "Error: Unable to find LLDB.framework" >&2 + exit 1 +fi + +# Make the Python directory down in the framework if it doesn't already exist +framework_python_dir="${TARGET_BUILD_DIR}/LLDB.framework/Versions/A/Resources/Python" +if [ ! -d "${framework_python_dir}" ] +then + mkdir -p "${framework_python_dir}" +fi + +# Make the symlink that the script bridge for Python will need in the Python +# framework directory +if [ ! -L "${framework_python_dir}/_lldb.so" ] +then + cd "${framework_python_dir}" + ln -s "../../LLDB" _lldb.so +fi + +# Copy the python module (lldb.py) that was generated by SWIG +# over to the framework Python directory +if [ -f "${CONFIGURATION_BUILD_DIR}/lldb.py" ] +then + cp "${CONFIGURATION_BUILD_DIR}/lldb.py" "${framework_python_dir}" +fi + +# Copy the embedded interpreter script over to the framework Python directory +if [ -f "${SRCROOT}/source/Interpreter/embedded_interpreter.py" ] +then + cp "${SRCROOT}/source/Interpreter/embedded_interpreter.py" "${framework_python_dir}" +fi + +exit 0 |