blob: 3d1cf74344fb9e061edc43001871a1a55bc19974 [file] [log] [blame]
Chris Lattner30fdc8d2010-06-08 16:52:24 +00001#!/bin/sh
2
3# build-swig-wrapper-classes.sh
4#
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.
8#
9# We use SWIG to help create the appropriate wrapper classes/functions for
10# the scripting language. In some cases the file generated by SWIG may
11# need some tweaking before it is completely ready to use.
12
13debug_flag=$1
14
15if [ -n "$debug_flag" -a "$debug_flag" == "-debug" ]
16then
17 Debug=1
18else
19 Debug=0
20fi
21
22#
23# Verify that 'lldb.swig' exists.
24#
25
26if [ ! -f ${SRCROOT}/scripts/lldb.swig ]
27then
28 echo Error: unable to find file 'lldb.swig' >&2
29 exit 1
30fi
31
32if [ $Debug == 1 ]
33then
34 echo "Found lldb.swig file"
35fi
36
37#
38# For each scripting language, make sure the build script for that language
39# exists, and if so, call it.
40#
41# For now the only language we support is Python, but we expect this to
42# change.
43
44languages="Python"
45cwd=${SRCROOT}/scripts
46
47for curlang in $languages
48do
49 if [ $Debug == 1 ]
50 then
51 echo "Current language is $curlang"
52 fi
53
54 if [ ! -d "$cwd/$curlang" ]
55 then
56 echo "Error: unable to find $curlang script sub-dirctory" >&2
57 continue
58 else
59
60 if [ $Debug == 1 ]
61 then
62 echo "Found $curlang sub-directory"
63 fi
64
65 cd $cwd/$curlang
66
67 filename="./build-swig-${curlang}.sh"
68
69 if [ ! -f $filename ]
70 then
71 echo "Error: unable to find swig build script for $curlang: $filename" >&2
72 continue
73 else
74
75 if [ $Debug == 1 ]
76 then
77 echo "Found $curlang build script."
78 echo "Executing $curlang build script..."
79 fi
80
81 ./build-swig-${curlang}.sh
82 fi
83 fi
84done
85