blob: efbc7485a6cbc7e9866c731a9bc74bb9571f02f7 [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001#!/bin/sh
2
3# build-swig-Python.sh
4
Caroline Tice9dbe7172010-06-16 19:26:52 +00005# SRC_ROOT is the root of the lldb source tree.
6# TARGET_DIR is where the lldb framework/shared library gets put.
Filipe Cabecinhasf2b0fef2012-11-01 18:55:16 +00007# CONFIG_BUILD_DIR is where the build-swig-Python-LLDB.sh shell script
Caroline Tice9dbe7172010-06-16 19:26:52 +00008# put the lldb.py file it was generated from running SWIG.
9# PREFIX is the root directory used to determine where third-party modules
10# for scripting languages should be installed.
Filipe Cabecinhasf2b0fef2012-11-01 18:55:16 +000011# debug_flag (optional) determines whether or not this script outputs
Caroline Tice9dbe7172010-06-16 19:26:52 +000012# additional information when running.
Chris Lattner24943d22010-06-08 16:52:24 +000013
Caroline Tice9dbe7172010-06-16 19:26:52 +000014SRC_ROOT=$1
15TARGET_DIR=$2
16CONFIG_BUILD_DIR=$3
17PYTHON_INSTALL_DIR=$4
Filipe Cabecinhasf2b0fef2012-11-01 18:55:16 +000018debug_flag=$5
Jim Ingham2396b9f2011-03-01 01:39:04 +000019SWIG=$6
Filipe Cabecinhasf2b0fef2012-11-01 18:55:16 +000020makefile_flag=$7
21dependency_flag=$8
Caroline Tice9dbe7172010-06-16 19:26:52 +000022
Filipe Cabecinhasf2b0fef2012-11-01 18:55:16 +000023if [ -n "$makefile_flag" -a "$makefile_flag" = "-m" ]
24then
25 MakefileCalled=1
26 if [ -n "$dependency_flag" -a "$dependency_flag" = "-M" ]
27 then
28 GenerateDependencies=1
29 swig_depend_file="${TARGET_DIR}/LLDBWrapPython.cpp.d"
30 SWIG_DEPEND_OPTIONS="-MMD -MF \"${swig_depend_file}.tmp\""
31 else
32 GenerateDependencies=0
33 fi
34else
35 MakefileCalled=0
36 GenerateDependencies=0
37fi
38
39if [ $MakefileCalled -eq 0 ]
Filipe Cabecinhas4bb4f302012-09-14 17:09:15 +000040then
41 swig_output_file=${SRC_ROOT}/source/LLDBWrapPython.cpp
42else
43 swig_output_file=${TARGET_DIR}/LLDBWrapPython.cpp
44fi
Caroline Tice9dbe7172010-06-16 19:26:52 +000045swig_input_file=${SRC_ROOT}/scripts/lldb.swig
Johnny Chenf530bfe2011-08-22 22:10:57 +000046swig_python_extensions=${SRC_ROOT}/scripts/Python/python-extensions.swig
47swig_python_wrapper=${SRC_ROOT}/scripts/Python/python-wrapper.swig
Enrico Granatab62d4c62012-02-02 17:26:00 +000048swig_python_typemaps=${SRC_ROOT}/scripts/Python/python-typemaps.swig
Chris Lattner24943d22010-06-08 16:52:24 +000049
Filipe Cabecinhas4bb4f302012-09-14 17:09:15 +000050if [ "$LLDB_DISABLE_PYTHON" = "1" ] ; then
Jim Inghamf4ec2ea2012-05-26 00:23:52 +000051 # We don't want Python for this build, but touch the output file so we don't have to
52 # conditionalize the build on this as well.
53 # Note, at present iOS doesn't have Python, so if you're building for iOS be sure to
54 # set LLDB_DISABLE_PYTHON to 1.
Jim Inghamb7e62f82012-05-24 01:16:09 +000055 rm -rf ${swig_output_file}
56 touch ${swig_output_file}
57
58else
Greg Clayton3e4238d2011-11-04 03:34:56 +000059
Jason Molendae2801e12012-09-27 21:26:57 +000060if [ -n "$debug_flag" -a "$debug_flag" = "-debug" ]
Chris Lattner24943d22010-06-08 16:52:24 +000061then
62 Debug=1
63else
64 Debug=0
65fi
66
Jason Molendac48ca822012-02-21 05:33:55 +000067# If this project is being built with LLDB_DISABLE_PYTHON defined,
68# don't bother generating Python swig bindings -- we don't have
69# Python available.
70
71if echo $GCC_PREPROCESSOR_DEFINITIONS | grep LLDB_DISABLE_PYTHON
72then
73 echo "" > "${swig_output_file}"
74 exit 0
75fi
Chris Lattner24943d22010-06-08 16:52:24 +000076
Greg Claytonb3448432011-03-24 21:19:54 +000077HEADER_FILES="${SRC_ROOT}/include/lldb/lldb.h"\
Caroline Ticec8b0e902010-10-18 23:00:51 +000078" ${SRC_ROOT}/include/lldb/lldb-defines.h"\
79" ${SRC_ROOT}/include/lldb/lldb-enumerations.h"\
80" ${SRC_ROOT}/include/lldb/lldb-forward.h"\
81" ${SRC_ROOT}/include/lldb/lldb-forward-rtti.h"\
82" ${SRC_ROOT}/include/lldb/lldb-types.h"\
Caroline Tice9dbe7172010-06-16 19:26:52 +000083" ${SRC_ROOT}/include/lldb/API/SBAddress.h"\
84" ${SRC_ROOT}/include/lldb/API/SBBlock.h"\
85" ${SRC_ROOT}/include/lldb/API/SBBreakpoint.h"\
86" ${SRC_ROOT}/include/lldb/API/SBBreakpointLocation.h"\
87" ${SRC_ROOT}/include/lldb/API/SBBroadcaster.h"\
Caroline Tice9dbe7172010-06-16 19:26:52 +000088" ${SRC_ROOT}/include/lldb/API/SBCommandInterpreter.h"\
89" ${SRC_ROOT}/include/lldb/API/SBCommandReturnObject.h"\
Greg Claytond8c62532010-10-07 04:19:01 +000090" ${SRC_ROOT}/include/lldb/API/SBCommunication.h"\
Caroline Tice9dbe7172010-06-16 19:26:52 +000091" ${SRC_ROOT}/include/lldb/API/SBCompileUnit.h"\
Enrico Granata91544802011-09-06 19:20:51 +000092" ${SRC_ROOT}/include/lldb/API/SBData.h"\
Caroline Tice9dbe7172010-06-16 19:26:52 +000093" ${SRC_ROOT}/include/lldb/API/SBDebugger.h"\
94" ${SRC_ROOT}/include/lldb/API/SBError.h"\
95" ${SRC_ROOT}/include/lldb/API/SBEvent.h"\
Jim Ingham47beabb2012-10-16 21:41:58 +000096" ${SRC_ROOT}/include/lldb/API/SBExpressionOptions.h"\
Johnny Chen4ead2e92010-08-27 22:35:26 +000097" ${SRC_ROOT}/include/lldb/API/SBFileSpec.h"\
Caroline Tice9dbe7172010-06-16 19:26:52 +000098" ${SRC_ROOT}/include/lldb/API/SBFrame.h"\
99" ${SRC_ROOT}/include/lldb/API/SBFunction.h"\
Greg Claytond8c62532010-10-07 04:19:01 +0000100" ${SRC_ROOT}/include/lldb/API/SBHostOS.h"\
101" ${SRC_ROOT}/include/lldb/API/SBInputReader.h"\
Greg Clayton5c4c7462010-10-06 03:09:58 +0000102" ${SRC_ROOT}/include/lldb/API/SBInstruction.h"\
103" ${SRC_ROOT}/include/lldb/API/SBInstructionList.h"\
Caroline Tice9dbe7172010-06-16 19:26:52 +0000104" ${SRC_ROOT}/include/lldb/API/SBLineEntry.h"\
105" ${SRC_ROOT}/include/lldb/API/SBListener.h"\
106" ${SRC_ROOT}/include/lldb/API/SBModule.h"\
107" ${SRC_ROOT}/include/lldb/API/SBProcess.h"\
108" ${SRC_ROOT}/include/lldb/API/SBSourceManager.h"\
Caroline Tice1ca48b02010-09-22 16:41:52 +0000109" ${SRC_ROOT}/include/lldb/API/SBStream.h"\
Caroline Tice9dbe7172010-06-16 19:26:52 +0000110" ${SRC_ROOT}/include/lldb/API/SBStringList.h"\
111" ${SRC_ROOT}/include/lldb/API/SBSymbol.h"\
112" ${SRC_ROOT}/include/lldb/API/SBSymbolContext.h"\
Greg Claytond8c62532010-10-07 04:19:01 +0000113" ${SRC_ROOT}/include/lldb/API/SBSymbolContextList.h"\
Caroline Tice9dbe7172010-06-16 19:26:52 +0000114" ${SRC_ROOT}/include/lldb/API/SBTarget.h"\
115" ${SRC_ROOT}/include/lldb/API/SBThread.h"\
116" ${SRC_ROOT}/include/lldb/API/SBType.h"\
Enrico Granata16376ed2012-02-15 02:34:21 +0000117" ${SRC_ROOT}/include/lldb/API/SBTypeCategory.h"\
118" ${SRC_ROOT}/include/lldb/API/SBTypeFilter.h"\
119" ${SRC_ROOT}/include/lldb/API/SBTypeFormat.h"\
120" ${SRC_ROOT}/include/lldb/API/SBTypeNameSpecifier.h"\
121" ${SRC_ROOT}/include/lldb/API/SBTypeSummary.h"\
122" ${SRC_ROOT}/include/lldb/API/SBTypeSynthetic.h"\
Caroline Tice1ca48b02010-09-22 16:41:52 +0000123" ${SRC_ROOT}/include/lldb/API/SBValue.h"\
Johnny Chen092bd152011-09-27 01:19:20 +0000124" ${SRC_ROOT}/include/lldb/API/SBValueList.h"\
Enrico Granata6d101882012-09-28 23:57:51 +0000125" ${SRC_ROOT}/include/lldb/API/SBWatchpoint.h"
Chris Lattner24943d22010-06-08 16:52:24 +0000126
Johnny Chenc39793d2011-09-09 17:37:06 +0000127INTERFACE_FILES="${SRC_ROOT}/scripts/Python/interface/SBAddress.i"\
128" ${SRC_ROOT}/scripts/Python/interface/SBBlock.i"\
129" ${SRC_ROOT}/scripts/Python/interface/SBBreakpoint.i"\
130" ${SRC_ROOT}/scripts/Python/interface/SBBreakpointLocation.i"\
131" ${SRC_ROOT}/scripts/Python/interface/SBBroadcaster.i"\
132" ${SRC_ROOT}/scripts/Python/interface/SBCommandInterpreter.i"\
133" ${SRC_ROOT}/scripts/Python/interface/SBCommandReturnObject.i"\
134" ${SRC_ROOT}/scripts/Python/interface/SBCommunication.i"\
135" ${SRC_ROOT}/scripts/Python/interface/SBCompileUnit.i"\
136" ${SRC_ROOT}/scripts/Python/interface/SBData.i"\
137" ${SRC_ROOT}/scripts/Python/interface/SBDebugger.i"\
Enrico Granata49306142012-10-10 22:54:17 +0000138" ${SRC_ROOT}/scripts/Python/interface/SBDeclaration.i"\
Johnny Chenc39793d2011-09-09 17:37:06 +0000139" ${SRC_ROOT}/scripts/Python/interface/SBError.i"\
140" ${SRC_ROOT}/scripts/Python/interface/SBEvent.i"\
Jim Ingham47beabb2012-10-16 21:41:58 +0000141" ${SRC_ROOT}/scripts/Python/interface/SBExpressionOptions.i"\
Johnny Chenc39793d2011-09-09 17:37:06 +0000142" ${SRC_ROOT}/scripts/Python/interface/SBFileSpec.i"\
143" ${SRC_ROOT}/scripts/Python/interface/SBFrame.i"\
144" ${SRC_ROOT}/scripts/Python/interface/SBFunction.i"\
145" ${SRC_ROOT}/scripts/Python/interface/SBHostOS.i"\
146" ${SRC_ROOT}/scripts/Python/interface/SBInputReader.i"\
147" ${SRC_ROOT}/scripts/Python/interface/SBInstruction.i"\
148" ${SRC_ROOT}/scripts/Python/interface/SBInstructionList.i"\
149" ${SRC_ROOT}/scripts/Python/interface/SBLineEntry.i"\
150" ${SRC_ROOT}/scripts/Python/interface/SBListener.i"\
151" ${SRC_ROOT}/scripts/Python/interface/SBModule.i"\
152" ${SRC_ROOT}/scripts/Python/interface/SBProcess.i"\
153" ${SRC_ROOT}/scripts/Python/interface/SBSourceManager.i"\
154" ${SRC_ROOT}/scripts/Python/interface/SBStream.i"\
155" ${SRC_ROOT}/scripts/Python/interface/SBStringList.i"\
156" ${SRC_ROOT}/scripts/Python/interface/SBSymbol.i"\
157" ${SRC_ROOT}/scripts/Python/interface/SBSymbolContext.i"\
158" ${SRC_ROOT}/scripts/Python/interface/SBTarget.i"\
159" ${SRC_ROOT}/scripts/Python/interface/SBThread.i"\
160" ${SRC_ROOT}/scripts/Python/interface/SBType.i"\
Enrico Granata16376ed2012-02-15 02:34:21 +0000161" ${SRC_ROOT}/scripts/Python/interface/SBTypeCategory.i"\
162" ${SRC_ROOT}/scripts/Python/interface/SBTypeFilter.i"\
163" ${SRC_ROOT}/scripts/Python/interface/SBTypeFormat.i"\
164" ${SRC_ROOT}/scripts/Python/interface/SBTypeNameSpecifier.i"\
165" ${SRC_ROOT}/scripts/Python/interface/SBTypeSummary.i"\
166" ${SRC_ROOT}/scripts/Python/interface/SBTypeSynthetic.i"\
Johnny Chenc39793d2011-09-09 17:37:06 +0000167" ${SRC_ROOT}/scripts/Python/interface/SBValue.i"\
Johnny Chen092bd152011-09-27 01:19:20 +0000168" ${SRC_ROOT}/scripts/Python/interface/SBValueList.i"\
Greg Clayton1fa6b3d2011-10-13 18:08:26 +0000169" ${SRC_ROOT}/scripts/Python/interface/SBWatchpoint.i"
Chris Lattner24943d22010-06-08 16:52:24 +0000170
Jason Molendae2801e12012-09-27 21:26:57 +0000171if [ $Debug -eq 1 ]
Chris Lattner24943d22010-06-08 16:52:24 +0000172then
173 echo "Header files are:"
174 echo ${HEADER_FILES}
175fi
176
Jason Molendae2801e12012-09-27 21:26:57 +0000177if [ $Debug -eq 1 ]
Enrico Granata91544802011-09-06 19:20:51 +0000178then
179 echo "SWIG interface files are:"
180 echo ${INTERFACE_FILES}
181fi
182
Chris Lattner24943d22010-06-08 16:52:24 +0000183NeedToUpdate=0
184
Chris Lattner24943d22010-06-08 16:52:24 +0000185
Johnny Chenb4d1fff2010-08-26 20:04:17 +0000186if [ ! -f ${swig_output_file} ]
Chris Lattner24943d22010-06-08 16:52:24 +0000187then
188 NeedToUpdate=1
Jason Molendae2801e12012-09-27 21:26:57 +0000189 if [ $Debug -eq 1 ]
Chris Lattner24943d22010-06-08 16:52:24 +0000190 then
191 echo "Failed to find LLDBWrapPython.cpp"
192 fi
193fi
194
Jason Molendae2801e12012-09-27 21:26:57 +0000195if [ $NeedToUpdate -eq 0 ]
Chris Lattner24943d22010-06-08 16:52:24 +0000196then
197 for hdrfile in ${HEADER_FILES}
198 do
Johnny Chenb4d1fff2010-08-26 20:04:17 +0000199 if [ $hdrfile -nt ${swig_output_file} ]
Chris Lattner24943d22010-06-08 16:52:24 +0000200 then
201 NeedToUpdate=1
Jason Molendae2801e12012-09-27 21:26:57 +0000202 if [ $Debug -eq 1 ]
Chris Lattner24943d22010-06-08 16:52:24 +0000203 then
204 echo "${hdrfile} is newer than ${swig_output_file}"
205 echo "swig file will need to be re-built."
206 fi
Johnny Chenb4d1fff2010-08-26 20:04:17 +0000207 break
Chris Lattner24943d22010-06-08 16:52:24 +0000208 fi
209 done
210fi
211
Jason Molendae2801e12012-09-27 21:26:57 +0000212if [ $NeedToUpdate -eq 0 ]
Johnny Chenb4d1fff2010-08-26 20:04:17 +0000213then
Enrico Granata91544802011-09-06 19:20:51 +0000214 for intffile in ${INTERFACE_FILES}
215 do
216 if [ $intffile -nt ${swig_output_file} ]
217 then
218 NeedToUpdate=1
Jason Molendae2801e12012-09-27 21:26:57 +0000219 if [ $Debug -eq 1 ]
Enrico Granata91544802011-09-06 19:20:51 +0000220 then
221 echo "${intffile} is newer than ${swig_output_file}"
222 echo "swig file will need to be re-built."
223 fi
224 break
225 fi
226 done
227fi
228
Jason Molendae2801e12012-09-27 21:26:57 +0000229if [ $NeedToUpdate -eq 0 ]
Enrico Granata91544802011-09-06 19:20:51 +0000230then
Johnny Chenb4d1fff2010-08-26 20:04:17 +0000231 if [ ${swig_input_file} -nt ${swig_output_file} ]
232 then
233 NeedToUpdate=1
Jason Molendae2801e12012-09-27 21:26:57 +0000234 if [ $Debug -eq 1 ]
Johnny Chenb4d1fff2010-08-26 20:04:17 +0000235 then
236 echo "${swig_input_file} is newer than ${swig_output_file}"
237 echo "swig file will need to be re-built."
238 fi
239 fi
240fi
241
Jason Molendae2801e12012-09-27 21:26:57 +0000242if [ $NeedToUpdate -eq 0 ]
Caroline Tice7826c882010-10-26 03:11:13 +0000243then
Johnny Chenf530bfe2011-08-22 22:10:57 +0000244 if [ ${swig_python_extensions} -nt ${swig_output_file} ]
Caroline Tice7826c882010-10-26 03:11:13 +0000245 then
246 NeedToUpdate=1
Jason Molendae2801e12012-09-27 21:26:57 +0000247 if [ $Debug -eq 1 ]
Caroline Tice7826c882010-10-26 03:11:13 +0000248 then
Johnny Chenf530bfe2011-08-22 22:10:57 +0000249 echo "${swig_python_extensions} is newer than ${swig_output_file}"
250 echo "swig file will need to be re-built."
251 fi
252 fi
253fi
254
Jason Molendae2801e12012-09-27 21:26:57 +0000255if [ $NeedToUpdate -eq 0 ]
Johnny Chenf530bfe2011-08-22 22:10:57 +0000256then
257 if [ ${swig_python_wrapper} -nt ${swig_output_file} ]
258 then
259 NeedToUpdate=1
Jason Molendae2801e12012-09-27 21:26:57 +0000260 if [ $Debug -eq 1 ]
Johnny Chenf530bfe2011-08-22 22:10:57 +0000261 then
262 echo "${swig_python_wrapper} is newer than ${swig_output_file}"
Caroline Tice7826c882010-10-26 03:11:13 +0000263 echo "swig file will need to be re-built."
264 fi
265 fi
266fi
267
Jason Molendae2801e12012-09-27 21:26:57 +0000268if [ $NeedToUpdate -eq 0 ]
Enrico Granatab62d4c62012-02-02 17:26:00 +0000269then
270 if [ ${swig_python_typemaps} -nt ${swig_output_file} ]
271 then
272 NeedToUpdate=1
Jason Molendae2801e12012-09-27 21:26:57 +0000273 if [ $Debug -eq 1 ]
Enrico Granatab62d4c62012-02-02 17:26:00 +0000274 then
275 echo "${swig_python_typemaps} is newer than ${swig_output_file}"
276 echo "swig file will need to be re-built."
277 fi
278 fi
279fi
280
Filipe Cabecinhas4bb4f302012-09-14 17:09:15 +0000281python_version=`/usr/bin/env python --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'`
Caroline Tice9dbe7172010-06-16 19:26:52 +0000282
Filipe Cabecinhasf2b0fef2012-11-01 18:55:16 +0000283if [ $MakefileCalled -eq 0 ]
Caroline Tice9dbe7172010-06-16 19:26:52 +0000284then
Filipe Cabecinhasf2b0fef2012-11-01 18:55:16 +0000285 framework_python_dir="${TARGET_DIR}/LLDB.framework/Resources/Python/lldb"
Caroline Tice9dbe7172010-06-16 19:26:52 +0000286else
Filipe Cabecinhasf2b0fef2012-11-01 18:55:16 +0000287 if [ -n "${PYTHON_INSTALL_DIR}" ]
288 then
289 framework_python_dir=`/usr/bin/env python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True, False, \"${PYTHON_INSTALL_DIR}\");"`/lldb
290 else
291 framework_python_dir=`/usr/bin/env python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True, False);"`/lldb
292 fi
Caroline Tice9dbe7172010-06-16 19:26:52 +0000293fi
294
Filipe Cabecinhasf2b0fef2012-11-01 18:55:16 +0000295[ -n "${CONFIG_BUILD_DIR}" ] || CONFIG_BUILD_DIR=${framework_python_dir}
Chris Lattner24943d22010-06-08 16:52:24 +0000296
297if [ ! -L "${framework_python_dir}/_lldb.so" ]
298then
299 NeedToUpdate=1
300fi
301
Filipe Cabecinhasf2b0fef2012-11-01 18:55:16 +0000302if [ ! -f "${framework_python_dir}/__init__.py" ]
Chris Lattner24943d22010-06-08 16:52:24 +0000303then
304 NeedToUpdate=1
305fi
306
307
Jason Molendae2801e12012-09-27 21:26:57 +0000308if [ $NeedToUpdate -eq 0 ]
Chris Lattner24943d22010-06-08 16:52:24 +0000309then
310 echo "Everything is up-to-date."
311 exit 0
312else
313 echo "SWIG needs to be re-run."
Caroline Tice7826c882010-10-26 03:11:13 +0000314 if [ -f ${swig_output_file} ]
315 then
316 rm ${swig_output_file}
317 fi
Chris Lattner24943d22010-06-08 16:52:24 +0000318fi
319
320
321# Build the SWIG C++ wrapper file for Python.
322
Filipe Cabecinhasf2b0fef2012-11-01 18:55:16 +0000323if [ $GenerateDependencies -eq 1 ]
324then
325 if $SWIG -c++ -shadow -python -threads -I"${SRC_ROOT}/include" -I./. -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -MMD -MF "${swig_depend_file}.tmp" -outdir "${CONFIG_BUILD_DIR}" -o "${swig_output_file}" "${swig_input_file}"
326 then
327 mv -f "${swig_depend_file}.tmp" "${swig_depend_file}"
328 else
329 rm -f "${swig_depend_file}.tmp"
330 exit 1
331 fi
332else
333 $SWIG -c++ -shadow -python -threads -I"${SRC_ROOT}/include" -I./. -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -outdir "${CONFIG_BUILD_DIR}" -o "${swig_output_file}" "${swig_input_file}" || exit $?
334fi
Chris Lattner24943d22010-06-08 16:52:24 +0000335
Johnny Chen22e418a2011-04-29 19:22:24 +0000336# Implement the iterator protocol and/or eq/ne operators for some lldb objects.
Caroline Tice558be582010-06-30 16:22:25 +0000337# Append global variable to lldb Python module.
Johnny Chen14097802011-04-28 21:31:18 +0000338# And initialize the lldb debugger subsystem.
Caroline Tice558be582010-06-30 16:22:25 +0000339current_dir=`pwd`
Johnny Chen14097802011-04-28 21:31:18 +0000340if [ -f "${current_dir}/modify-python-lldb.py" ]
Caroline Tice558be582010-06-30 16:22:25 +0000341then
Johnny Chen14097802011-04-28 21:31:18 +0000342 python ${current_dir}/modify-python-lldb.py ${CONFIG_BUILD_DIR}
Caroline Tice558be582010-06-30 16:22:25 +0000343fi
Caroline Tice5790e062010-10-28 21:51:20 +0000344
345# Fix the "#include" statement in the swig output file
346
347if [ -f "${current_dir}/edit-swig-python-wrapper-file.py" ]
348then
Filipe Cabecinhasf2b0fef2012-11-01 18:55:16 +0000349 if [ $MakefileCalled -eq 1 ]
350 then
351 python ${current_dir}/edit-swig-python-wrapper-file.py "${TARGET_DIR}"
352 else
353 python ${current_dir}/edit-swig-python-wrapper-file.py
354 fi
Caroline Tice5790e062010-10-28 21:51:20 +0000355 if [ -f "${swig_output_file}.edited" ]
356 then
357 mv "${swig_output_file}.edited" ${swig_output_file}
358 fi
359fi
Greg Clayton3e4238d2011-11-04 03:34:56 +0000360
Greg Clayton3e4238d2011-11-04 03:34:56 +0000361fi