Index: include/lldb/API/SBDefines.h
===================================================================
--- include/lldb/API/SBDefines.h	(revision 151922)
+++ include/lldb/API/SBDefines.h	(working copy)
@@ -63,8 +63,8 @@
 class SBTypeFilter;
 class SBTypeFormat;
 class SBTypeNameSpecifier;
+#ifndef LLDB_DISABLE_PYTHON
 class SBTypeSummary;
-#ifndef LLDB_DISABLE_PYTHON
 class SBTypeSynthetic;    
 #endif
 class SBTypeList;
Index: include/lldb/API/SBValue.h
===================================================================
--- include/lldb/API/SBValue.h	(revision 151922)
+++ include/lldb/API/SBValue.h	(working copy)
@@ -80,8 +80,10 @@
     bool
     GetValueDidChange ();
 
+#ifndef LLDB_DISABLE_PYTHON
     const char *
     GetSummary ();
+#endif
     
     const char *
     GetObjectDescription ();
Index: source/Core/FormatManager.cpp
===================================================================
--- source/Core/FormatManager.cpp	(revision 151922)
+++ source/Core/FormatManager.cpp	(working copy)
@@ -696,6 +696,7 @@
                                             summary_sp);
 }
 
+#ifndef LLDB_DISABLE_PYTHON
 static void
 AddScriptSummary(TypeCategoryImpl::SharedPointer category_sp,
                  const char* funct_name,
@@ -714,7 +715,6 @@
 }
 
 
-#ifndef LLDB_DISABLE_PYTHON
 void
 FormatManager::LoadObjCFormatters()
 {
Index: source/API/SBCommandInterpreter.cpp
===================================================================
--- source/API/SBCommandInterpreter.cpp	(revision 151922)
+++ source/API/SBCommandInterpreter.cpp	(working copy)
@@ -327,22 +327,14 @@
     return false;
 }
 
-#ifndef LLDB_DISABLE_PYTHON
-
 // Defined in the SWIG source file
-extern "C" void 
-init_lldb(void);
-
-#else
-
 extern "C" void init_lldb(void);
 
-// Usually defined in the SWIG source file, but we have sripting disabled
-extern "C" void 
-init_lldb(void)
+#ifdef LLDB_DISABLE_PYTHON_BINDINGS
+// Usually defined in the SWIG source file, but we have bindings disabled
+extern "C" void init_lldb(void)
 {
 }
-
 #endif
 
 void
Index: scripts/Python/interface/SBTypeSynthetic.i
===================================================================
--- scripts/Python/interface/SBTypeSynthetic.i	(revision 151922)
+++ scripts/Python/interface/SBTypeSynthetic.i	(working copy)
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifndef LLDB_DISABLE_PYTHON
+
 namespace lldb {
     
     %feature("docstring",
@@ -72,3 +74,5 @@
     };
     
 } // namespace lldb
+
+#endif // LLDB_DISABLE_PYTHON
Index: scripts/Python/interface/SBValue.i
===================================================================
--- scripts/Python/interface/SBValue.i	(revision 151922)
+++ scripts/Python/interface/SBValue.i	(working copy)
@@ -115,8 +115,10 @@
     bool
     GetValueDidChange ();
 
+#ifndef LLDB_DISABLE_PYTHON
     const char *
     GetSummary ();
+#endif
     
     const char *
     GetObjectDescription ();
@@ -139,14 +141,18 @@
     lldb::SBTypeFormat
     GetTypeFormat ();
     
+#ifndef LLDB_DISABLE_PYTHON
     lldb::SBTypeSummary
     GetTypeSummary ();
+#endif
     
     lldb::SBTypeFilter
     GetTypeFilter ();
     
+#ifndef LLDB_DISABLE_PYTHON
     lldb::SBTypeSynthetic
     GetTypeSynthetic ();
+#endif
 
     lldb::SBValue
     GetChildAtIndex (uint32_t idx);
@@ -375,8 +381,16 @@
     bool
     GetExpressionPath (lldb::SBStream &description, bool qualify_cxx_base_classes);
     
+
+#ifndef LLDB_DISABLE_PYTHON
     %pythoncode %{
+        __swig_getmethods__["summary"] = GetSummary
+        if _newclass: x = property(GetSummary, None)
+    %}
+#endif
 
+    %pythoncode %{
+
         __swig_getmethods__["name"] = GetName
         if _newclass: x = property(GetName, None)
 
@@ -424,9 +438,6 @@
         __swig_getmethods__["error"] = GetError
         if _newclass: x = property(GetError, None)
     
-        __swig_getmethods__["summary"] = GetSummary
-        if _newclass: x = property(GetSummary, None)
-
         __swig_getmethods__["description"] = GetObjectDescription
         if _newclass: x = property(GetObjectDescription, None)
 
Index: scripts/Python/interface/SBTypeCategory.i
===================================================================
--- scripts/Python/interface/SBTypeCategory.i	(revision 151922)
+++ scripts/Python/interface/SBTypeCategory.i	(working copy)
@@ -48,8 +48,10 @@
         uint32_t
         GetNumFilters ();
         
+#ifndef LLDB_DISABLE_PYTHON
         uint32_t
         GetNumSynthetics ();
+#endif
         
         lldb::SBTypeNameSpecifier
         GetTypeNameSpecifierForFilterAtIndex (uint32_t);
@@ -60,8 +62,10 @@
         lldb::SBTypeNameSpecifier
         GetTypeNameSpecifierForSummaryAtIndex (uint32_t);
 
+#ifndef LLDB_DISABLE_PYTHON
         lldb::SBTypeNameSpecifier
         GetTypeNameSpecifierForSyntheticAtIndex (uint32_t);
+#endif
         
         lldb::SBTypeFilter
         GetFilterForType (lldb::SBTypeNameSpecifier);
@@ -69,6 +73,7 @@
         lldb::SBTypeFormat
         GetFormatForType (lldb::SBTypeNameSpecifier);
         
+#ifndef LLDB_DISABLE_PYTHON
         lldb::SBTypeSummary
         GetSummaryForType (lldb::SBTypeNameSpecifier);
 
@@ -77,15 +82,18 @@
         
         lldb::SBTypeFilter
         GetFilterAtIndex (uint32_t);
+#endif
         
         lldb::SBTypeFormat
         GetFormatAtIndex (uint32_t);
         
+#ifndef LLDB_DISABLE_PYTHON
         lldb::SBTypeSummary
         GetSummaryAtIndex (uint32_t);
         
         lldb::SBTypeSynthetic
         GetSyntheticAtIndex (uint32_t);
+#endif
         
         bool
         AddTypeFormat (lldb::SBTypeNameSpecifier,
@@ -94,9 +102,11 @@
         bool
         DeleteTypeFormat (lldb::SBTypeNameSpecifier);
         
+#ifndef LLDB_DISABLE_PYTHON
         bool
         AddTypeSummary (lldb::SBTypeNameSpecifier,
                         lldb::SBTypeSummary);
+#endif
         
         bool
         DeleteTypeSummary (lldb::SBTypeNameSpecifier);
@@ -108,22 +118,28 @@
         bool
         DeleteTypeFilter (lldb::SBTypeNameSpecifier);
         
+#ifndef LLDB_DISABLE_PYTHON
         bool
         AddTypeSynthetic (lldb::SBTypeNameSpecifier,
                           lldb::SBTypeSynthetic);
         
         bool
         DeleteTypeSynthetic (lldb::SBTypeNameSpecifier);
+#endif
         
+#ifndef LLDB_DISABLE_PYTHON
         %pythoncode %{
+            __swig_getmethods__["num_synthetics"] = GetNumSynthetics
+            if _newclass: x = property(GetNumSynthetics, None)
+        %}
+#endif
+        %pythoncode %{
             __swig_getmethods__["num_formats"] = GetNumFormats
             if _newclass: x = property(GetNumFormats, None)
             __swig_getmethods__["num_summaries"] = GetNumSummaries
             if _newclass: x = property(GetNumSummaries, None)
             __swig_getmethods__["num_filters"] = GetNumFilters
             if _newclass: x = property(GetNumFilters, None)
-            __swig_getmethods__["num_synthetics"] = GetNumSynthetics
-            if _newclass: x = property(GetNumSynthetics, None)
             
             __swig_getmethods__["name"] = GetName
             if _newclass: x = property(GetName, None)
Index: scripts/Python/interface/SBDebugger.i
===================================================================
--- scripts/Python/interface/SBDebugger.i	(revision 151922)
+++ scripts/Python/interface/SBDebugger.i	(working copy)
@@ -349,15 +349,19 @@
     lldb::SBTypeFormat
     GetFormatForType (lldb::SBTypeNameSpecifier);
 
+#ifndef LLDB_DISABLE_PYTHON
     lldb::SBTypeSummary
     GetSummaryForType (lldb::SBTypeNameSpecifier);
+#endif
 
     lldb::SBTypeFilter
     GetFilterForType (lldb::SBTypeNameSpecifier);
 
+#ifndef LLDB_DISABLE_PYTHON
     lldb::SBTypeSynthetic
     GetSyntheticForType (lldb::SBTypeNameSpecifier);
-                
+#endif
+
 }; // class SBDebugger
 
 } // namespace lldb
Index: scripts/Python/interface/SBTypeSummary.i
===================================================================
--- scripts/Python/interface/SBTypeSummary.i	(revision 151922)
+++ scripts/Python/interface/SBTypeSummary.i	(working copy)
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifndef LLDB_DISABLE_PYTHON
+
 namespace lldb {
     
     %feature("docstring",
@@ -91,3 +93,5 @@
 
 } // namespace lldb
 
+#endif // LLDB_DISABLE_PYTHON
+
Index: scripts/Python/build-swig-Python.sh
===================================================================
--- scripts/Python/build-swig-Python.sh	(revision 151922)
+++ scripts/Python/build-swig-Python.sh	(working copy)
@@ -33,16 +33,22 @@
     Debug=0
 fi
 
-# If this project is being built with LLDB_DISABLE_PYTHON defined,
-# don't bother generating Python swig bindings -- we don't have
-# Python available.
+# If this project is being built with LLDB_DISABLE_PYTHON_BINDINGS defined,
+# don't generate Python swig bindings.
 
-if echo $GCC_PREPROCESSOR_DEFINITIONS | grep LLDB_DISABLE_PYTHON
+if echo $GCC_PREPROCESSOR_DEFINITIONS | grep LLDB_DISABLE_PYTHON_BINDINGS &>-
 then
   echo "" > "${swig_output_file}"
   exit 0
 fi
 
+# If the project is being built with LLDB_DISABLE_PYTHON defined,
+# pass that definition along to swig.
+DISABLE_PYTHON=$(echo $GCC_PREPROCESSOR_DEFINITIONS \
+                | grep -oE 'LLDB_DISABLE_PYTHON[^ ]*')
+
+SWIG_DEFINITIONS+="-D$DISABLE_PYTHON"
+
 HEADER_FILES="${SRC_ROOT}/include/lldb/lldb.h"\
 " ${SRC_ROOT}/include/lldb/lldb-defines.h"\
 " ${SRC_ROOT}/include/lldb/lldb-enumerations.h"\
@@ -280,9 +286,8 @@
 
 
 # Build the SWIG C++ wrapper file for Python.
+$SWIG -c++ -shadow -python -threads -I"/usr/include" -I"${SRC_ROOT}/include" -I./. -outdir "${CONFIG_BUILD_DIR}" -o "${swig_output_file}" $SWIG_DEFINITIONS "${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}"
-
 # Implement the iterator protocol and/or eq/ne operators for some lldb objects.
 # Append global variable to lldb Python module.
 # And initialize the lldb debugger subsystem.
