blob: 293a8b18c66b7ae05e0e55066874255fbdfb129d [file] [log] [blame]
#! /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