blob: 293a8b18c66b7ae05e0e55066874255fbdfb129d [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001#! /bin/sh
2
3# finish-swig-Python.sh
4#
5# For the Python script interpreter (external to liblldb) to be able to import
6# and use the lldb module, there must be a "_lldb.so" in the framework
7# resources directory. Here we make a symlink called "_lldb.so" that just
8# points to the executable in the LLDB.framework and copy over the needed
9# .py files.
10
11if [ ! -d "${TARGET_BUILD_DIR}/LLDB.framework" ]
12then
13 echo "Error: Unable to find LLDB.framework" >&2
14 exit 1
15fi
16
17# Make the Python directory down in the framework if it doesn't already exist
18framework_python_dir="${TARGET_BUILD_DIR}/LLDB.framework/Versions/A/Resources/Python"
19if [ ! -d "${framework_python_dir}" ]
20then
21 mkdir -p "${framework_python_dir}"
22fi
23
24# Make the symlink that the script bridge for Python will need in the Python
25# framework directory
26if [ ! -L "${framework_python_dir}/_lldb.so" ]
27then
28 cd "${framework_python_dir}"
29 ln -s "../../LLDB" _lldb.so
30fi
31
32# Copy the python module (lldb.py) that was generated by SWIG
33# over to the framework Python directory
34if [ -f "${CONFIGURATION_BUILD_DIR}/lldb.py" ]
35then
36 cp "${CONFIGURATION_BUILD_DIR}/lldb.py" "${framework_python_dir}"
37fi
38
39# Copy the embedded interpreter script over to the framework Python directory
40if [ -f "${SRCROOT}/source/Interpreter/embedded_interpreter.py" ]
41then
42 cp "${SRCROOT}/source/Interpreter/embedded_interpreter.py" "${framework_python_dir}"
43fi
44
45exit 0