Initial checkin of lldb code from internal Apple repo.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105619 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/scripts/Python/finish-swig-Python-LLDB.sh b/scripts/Python/finish-swig-Python-LLDB.sh
new file mode 100755
index 0000000..293a8b1
--- /dev/null
+++ b/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