3 # finish-swig-wrapper-classes.sh
5 # For each scripting language liblldb supports, we need to create the
6 # appropriate Script Bridge wrapper classes for that language so that
7 # users can call Script Bridge functions from within the script interpreter.
9 # We use SWIG to create a C++ file containing the appropriate wrapper classes
10 # and funcitons for each scripting language, before liblldb is built (thus
11 # the C++ file can be compiled into liblldb. In some cases, additional work
12 # may need to be done after liblldb has been compiled, to make the scripting
13 # language stuff fully functional. Any such post-processing is handled through
14 # the shell scripts called here.
16 # SRC_ROOT is the root of the lldb source tree.
17 # TARGET_DIR is where the lldb framework/shared library gets put.
18 # CONFIG_BUILD_DIR is where the build-swig-Python-LLDB.sh shell script
19 # put the lldb.py file it generated from running SWIG.
20 # PREFIX is the root directory used to determine where third-party modules
21 # for scripting languages should be installed.
22 # debug_flag (optional) determines whether or not this script outputs
23 # additional information when running.
32 if [ -n "$1" -a "$1" = "-debug" ]
42 if [ -n "$1" -a "$1" = "-m" ]
51 # For each scripting language, see if a post-processing script for that
52 # language exists, and if so, call it.
54 # For now the only language we support is Python, but we expect this to
58 cwd=${SRC_ROOT}/scripts
60 for curlang in $languages
64 echo "Current language is $curlang"
67 if [ ! -d "$cwd/$curlang" ]
69 echo "error: unable to find $curlang script sub-dirctory" >&2
75 echo "Found $curlang sub-directory"
80 filename="./finish-swig-${curlang}-LLDB.sh"
86 echo "Found $curlang post-processing script for LLDB"
87 echo "Executing $curlang post-processing script..."
91 ./finish-swig-${curlang}-LLDB.sh $SRC_ROOT $TARGET_DIR $CONFIG_BUILD_DIR "${PREFIX}" "${debug_flag}" "${makefile_flag}"
93 if [ $retval -ne 0 ]; then
94 echo "$(pwd)/finish-swig-${curlang}-LLDB.sh failed with exit code $retval"