[Lldb-commits] [lldb] r126732 - in /lldb/trunk/scripts: Python/build-swig-Python.sh build-swig-wrapper-classes.sh

Jim Ingham jingham at apple.com
Mon Feb 28 17:39:04 PST 2011


Author: jingham
Date: Mon Feb 28 19:39:04 2011
New Revision: 126732

URL: http://llvm.org/viewvc/llvm-project?rev=126732&view=rev
Log:
Look for swig in /usr/bin and /usr/local/bin.

Modified:
    lldb/trunk/scripts/Python/build-swig-Python.sh
    lldb/trunk/scripts/build-swig-wrapper-classes.sh

Modified: lldb/trunk/scripts/Python/build-swig-Python.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/build-swig-Python.sh?rev=126732&r1=126731&r2=126732&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/build-swig-Python.sh (original)
+++ lldb/trunk/scripts/Python/build-swig-Python.sh Mon Feb 28 19:39:04 2011
@@ -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.
 

Modified: lldb/trunk/scripts/build-swig-wrapper-classes.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/build-swig-wrapper-classes.sh?rev=126732&r1=126731&r2=126732&view=diff
==============================================================================
--- lldb/trunk/scripts/build-swig-wrapper-classes.sh (original)
+++ lldb/trunk/scripts/build-swig-wrapper-classes.sh Mon Feb 28 19:39:04 2011
@@ -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





More information about the lldb-commits mailing list