summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/build-swig-Python.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/scripts/Python/build-swig-Python.sh')
-rwxr-xr-xlldb/scripts/Python/build-swig-Python.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/lldb/scripts/Python/build-swig-Python.sh b/lldb/scripts/Python/build-swig-Python.sh
index 17b880ae03f..56a54ce94c3 100755
--- a/lldb/scripts/Python/build-swig-Python.sh
+++ b/lldb/scripts/Python/build-swig-Python.sh
@@ -19,6 +19,7 @@ debug_flag=$5
swig_output_file=${SRC_ROOT}/source/LLDBWrapPython.cpp
swig_input_file=${SRC_ROOT}/scripts/lldb.swig
+swig_input_file2=${SRC_ROOT}/scripts/Python/python-extensions.swig
if [ -n "$debug_flag" -a "$debug_flag" == "-debug" ]
@@ -119,6 +120,19 @@ then
fi
fi
+if [ $NeedToUpdate == 0 ]
+then
+ if [ ${swig_input_file2} -nt ${swig_output_file} ]
+ then
+ NeedToUpdate=1
+ if [ $Debug == 1 ]
+ then
+ echo "${swig_input_file2} is newer than ${swig_output_file}"
+ echo "swig file will need to be re-built."
+ fi
+ fi
+fi
+
os_name=`uname -s`
python_version=`/usr/bin/python --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'`
@@ -147,6 +161,10 @@ then
exit 0
else
echo "SWIG needs to be re-run."
+ if [ -f ${swig_output_file} ]
+ then
+ rm ${swig_output_file}
+ fi
fi
OpenPOWER on IntegriCloud