summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/finish-swig-wrapper-classes.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/scripts/finish-swig-wrapper-classes.sh')
-rwxr-xr-xlldb/scripts/finish-swig-wrapper-classes.sh71
1 files changed, 71 insertions, 0 deletions
diff --git a/lldb/scripts/finish-swig-wrapper-classes.sh b/lldb/scripts/finish-swig-wrapper-classes.sh
new file mode 100755
index 00000000000..5d9713d06a2
--- /dev/null
+++ b/lldb/scripts/finish-swig-wrapper-classes.sh
@@ -0,0 +1,71 @@
+#! /bin/sh
+
+# finish-swig-wrapper-classes.sh
+#
+# For each scripting language liblldb supports, we need to create the
+# appropriate Script Bridge wrapper classes for that language so that
+# users can call Script Bridge functions from within the script interpreter.
+#
+# We use SWIG to create a C++ file containing the appropriate wrapper classes
+# and funcitons for each scripting language, before liblldb is built (thus
+# the C++ file can be compiled into liblldb. In some cases, additional work
+# may need to be done after liblldb has been compiled, to make the scripting
+# language stuff fully functional. Any such post-processing is handled through
+# the shell scripts called here.
+
+debug_flag=$1
+
+if [ -n "$debug_flag" -a "$debug_flag" == "-debug" ]
+then
+ Debug=1
+else
+ Debug=0
+fi
+
+
+#
+# For each scripting language, see if a post-processing script for that
+# language exists, and if so, call it.
+#
+# For now the only language we support is Python, but we expect this to
+# change.
+
+languages="Python"
+cwd=${SRCROOT}/scripts
+
+for curlang in $languages
+do
+ if [ $Debug == 1 ]
+ then
+ echo "Current language is $curlang"
+ fi
+
+ if [ ! -d "$cwd/$curlang" ]
+ then
+ echo "error: unable to find $curlang script sub-dirctory" >&2
+ continue
+ else
+
+ if [ $Debug == 1 ]
+ then
+ echo "Found $curlang sub-directory"
+ fi
+
+ cd $cwd/$curlang
+
+ filename="./finish-swig-${curlang}-${TARGET_NAME}.sh"
+
+ if [ -f $filename ]
+ then
+ if [ $Debug == 1 ]
+ then
+ echo "Found $curlang post-processing script for ${TARGET_NAME}"
+ echo "Executing $curlang post-processing script..."
+ fi
+
+ ./finish-swig-${curlang}-${TARGET_NAME}.sh
+ fi
+ fi
+done
+
+exit 0
OpenPOWER on IntegriCloud