Look for swig in /usr/bin and /usr/local/bin.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@126732 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/scripts/Python/build-swig-Python.sh b/scripts/Python/build-swig-Python.sh
index f412fb8..a4304fa 100755
--- a/scripts/Python/build-swig-Python.sh
+++ b/scripts/Python/build-swig-Python.sh
@@ -16,6 +16,7 @@
 CONFIG_BUILD_DIR=$3
 PYTHON_INSTALL_DIR=$4
 debug_flag=$5 
+SWIG=$6
 
 swig_output_file=${SRC_ROOT}/source/LLDBWrapPython.cpp
 swig_input_file=${SRC_ROOT}/scripts/lldb.swig
@@ -170,7 +171,7 @@
 
 # Build the SWIG C++ wrapper file for Python.
 
-swig -c++ -shadow -python -I"/usr/include" -I"${SRC_ROOT}/include" -I./. -outdir "${CONFIG_BUILD_DIR}" -o "${swig_output_file}" "${swig_input_file}"
+$SWIG -c++ -shadow -python -I"/usr/include" -I"${SRC_ROOT}/include" -I./. -outdir "${CONFIG_BUILD_DIR}" -o "${swig_output_file}" "${swig_input_file}"
 
 # Append global variable to lldb Python module.
 
diff --git a/scripts/build-swig-wrapper-classes.sh b/scripts/build-swig-wrapper-classes.sh
index 5582ba0..1680d2e 100755
--- a/scripts/build-swig-wrapper-classes.sh
+++ b/scripts/build-swig-wrapper-classes.sh
@@ -55,6 +55,27 @@
 fi
 
 #
+# Next look for swig
+#
+
+SWIG=
+if [ -f /usr/bin/swig ]
+then
+    SWIG=/usr/bin/swig
+else
+    if [ -f /usr/local/bin/swig ]
+    then
+        SWIG=/usr/local/bin/swig
+    fi
+fi
+
+if [ ${SWIG}a == a ]
+then
+    echo Error: could not find the swig binary
+    exit 1
+fi
+
+#
 # For each scripting language, make sure the build script for that language
 # exists, and if so, call it.
 #
@@ -98,7 +119,7 @@
                 echo "Executing $curlang build script..."
             fi
 
-            ./build-swig-${curlang}.sh  $SRC_ROOT $TARGET_DIR $CONFIG_BUILD_DIR "${PREFIX}" "${debug_flag}"
+            ./build-swig-${curlang}.sh  $SRC_ROOT $TARGET_DIR $CONFIG_BUILD_DIR "${PREFIX}" "${debug_flag}" "${SWIG}"
         fi
     fi
 done