diff --git a/include/lldb/API/SBDefines.h b/include/lldb/API/SBDefines.h
index 82805d0..f7bf616 100644
--- a/include/lldb/API/SBDefines.h
+++ b/include/lldb/API/SBDefines.h
@@ -63,8 +63,8 @@ class SBTypeCategory;
 class SBTypeFilter;
 class SBTypeFormat;
 class SBTypeNameSpecifier;
-class SBTypeSummary;
 #ifndef LLDB_DISABLE_PYTHON
+class SBTypeSummary;
 class SBTypeSynthetic;    
 #endif
 class SBTypeList;
diff --git a/include/lldb/API/SBValue.h b/include/lldb/API/SBValue.h
index 2495543..9f7a32b 100644
--- a/include/lldb/API/SBValue.h
+++ b/include/lldb/API/SBValue.h
@@ -80,8 +80,10 @@ public:
     bool
     GetValueDidChange ();
 
+#ifndef LLDB_DISABLE_PYTHON
     const char *
     GetSummary ();
+#endif
     
     const char *
     GetObjectDescription ();
diff --git a/lldb.xcodeproj/project.pbxproj b/lldb.xcodeproj/project.pbxproj
index ae07f1a..3a65ff0 100644
--- a/lldb.xcodeproj/project.pbxproj
+++ b/lldb.xcodeproj/project.pbxproj
@@ -4027,6 +4027,7 @@
 					__STDC_LIMIT_MACROS,
 					LLDB_CONFIGURATION_DEBUG,
 					LLDB_DISABLE_PYTHON,
+					LLDB_DISABLE_PYTHON_BINDINGS,
 					NO_XPC_SERVICES,
 				);
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
@@ -4082,6 +4083,7 @@
 					__STDC_LIMIT_MACROS,
 					LLDB_CONFIGURATION_RELEASE,
 					LLDB_DISABLE_PYTHON,
+					LLDB_DISABLE_PYTHON_BINDINGS,
 					NO_XPC_SERVICES,
 				);
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
@@ -4442,6 +4444,7 @@
 					__STDC_LIMIT_MACROS,
 					LLDB_CONFIGURATION_BUILD_AND_INTEGRATION,
 					LLDB_DISABLE_PYTHON,
+					LLDB_DISABLE_PYTHON_BINDINGS,
 					NO_XPC_SERVICES,
 				);
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
diff --git a/scripts/Python/build-swig-Python.sh b/scripts/Python/build-swig-Python.sh
index 76c5383..381ca78 100755
--- a/scripts/Python/build-swig-Python.sh
+++ b/scripts/Python/build-swig-Python.sh
@@ -33,16 +33,26 @@ else
     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[^ ]*')
+
+SwigDefinitions=""
+if [[ -n "$DISABLE_PYTHON" ]]
+then
+  SwigDefinitions+="-D$DISABLE_PYTHON"
+fi
+
 HEADER_FILES="${SRC_ROOT}/include/lldb/lldb.h"\
 " ${SRC_ROOT}/include/lldb/lldb-defines.h"\
 " ${SRC_ROOT}/include/lldb/lldb-enumerations.h"\
@@ -280,8 +290,7 @@ fi
 
 
 # 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 -threads -I"/usr/include" -I"${SRC_ROOT}/include" -I./. -outdir "${CONFIG_BUILD_DIR}" -o "${swig_output_file}" $SwigDefinitions "${swig_input_file}"
 
 # Implement the iterator protocol and/or eq/ne operators for some lldb objects.
 # Append global variable to lldb Python module.
diff --git a/scripts/Python/interface/SBDebugger.i b/scripts/Python/interface/SBDebugger.i
index 465c856..e61271e 100644
--- a/scripts/Python/interface/SBDebugger.i
+++ b/scripts/Python/interface/SBDebugger.i
@@ -349,15 +349,19 @@ public:
     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
diff --git a/scripts/Python/interface/SBTypeCategory.i b/scripts/Python/interface/SBTypeCategory.i
index fa1a63c..a6b9c1c 100644
--- a/scripts/Python/interface/SBTypeCategory.i
+++ b/scripts/Python/interface/SBTypeCategory.i
@@ -48,8 +48,10 @@ namespace lldb {
         uint32_t
         GetNumFilters ();
         
+#ifndef LLDB_DISABLE_PYTHON
         uint32_t
         GetNumSynthetics ();
+#endif
         
         lldb::SBTypeNameSpecifier
         GetTypeNameSpecifierForFilterAtIndex (uint32_t);
@@ -60,8 +62,10 @@ namespace lldb {
         lldb::SBTypeNameSpecifier
         GetTypeNameSpecifierForSummaryAtIndex (uint32_t);
 
+#ifndef LLDB_DISABLE_PYTHON
         lldb::SBTypeNameSpecifier
         GetTypeNameSpecifierForSyntheticAtIndex (uint32_t);
+#endif
         
         lldb::SBTypeFilter
         GetFilterForType (lldb::SBTypeNameSpecifier);
@@ -69,6 +73,7 @@ namespace lldb {
         lldb::SBTypeFormat
         GetFormatForType (lldb::SBTypeNameSpecifier);
         
+#ifndef LLDB_DISABLE_PYTHON
         lldb::SBTypeSummary
         GetSummaryForType (lldb::SBTypeNameSpecifier);
 
@@ -77,15 +82,18 @@ namespace lldb {
         
         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 @@ namespace lldb {
         bool
         DeleteTypeFormat (lldb::SBTypeNameSpecifier);
         
+#ifndef LLDB_DISABLE_PYTHON
         bool
         AddTypeSummary (lldb::SBTypeNameSpecifier,
                         lldb::SBTypeSummary);
+#endif
         
         bool
         DeleteTypeSummary (lldb::SBTypeNameSpecifier);
@@ -108,13 +118,21 @@ namespace lldb {
         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)
@@ -122,8 +140,6 @@ namespace lldb {
             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)
diff --git a/scripts/Python/interface/SBTypeSummary.i b/scripts/Python/interface/SBTypeSummary.i
index f968977..e258a66 100644
--- a/scripts/Python/interface/SBTypeSummary.i
+++ b/scripts/Python/interface/SBTypeSummary.i
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifndef LLDB_DISABLE_PYTHON
+
 namespace lldb {
     
     %feature("docstring",
@@ -91,3 +93,5 @@ namespace lldb {
 
 } // namespace lldb
 
+#endif // LLDB_DISABLE_PYTHON
+
diff --git a/scripts/Python/interface/SBTypeSynthetic.i b/scripts/Python/interface/SBTypeSynthetic.i
index 3e785ff..f7b74ad 100644
--- a/scripts/Python/interface/SBTypeSynthetic.i
+++ b/scripts/Python/interface/SBTypeSynthetic.i
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifndef LLDB_DISABLE_PYTHON
+
 namespace lldb {
     
     %feature("docstring",
@@ -72,3 +74,5 @@ namespace lldb {
     };
     
 } // namespace lldb
+
+#endif // LLDB_DISABLE_PYTHON
diff --git a/scripts/Python/interface/SBValue.i b/scripts/Python/interface/SBValue.i
index d61c7aa..ee1826a 100644
--- a/scripts/Python/interface/SBValue.i
+++ b/scripts/Python/interface/SBValue.i
@@ -115,8 +115,10 @@ public:
     bool
     GetValueDidChange ();
 
+#ifndef LLDB_DISABLE_PYTHON
     const char *
     GetSummary ();
+#endif
     
     const char *
     GetObjectDescription ();
@@ -139,14 +141,18 @@ public:
     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,6 +381,14 @@ public:
     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
@@ -424,9 +438,6 @@ public:
         __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)
 
diff --git a/scripts/Python/python-extensions.swig b/scripts/Python/python-extensions.swig
index cd8f1cf..9ce7ab6 100644
--- a/scripts/Python/python-extensions.swig
+++ b/scripts/Python/python-extensions.swig
@@ -392,6 +392,7 @@
                     return PyString_FromString("");
         }
 }
+#ifndef LLDB_DISABLE_PYTHON
 %extend lldb::SBTypeSummary {
         PyObject *lldb::SBTypeSummary::__str__ (){
                 lldb::SBStream description;
@@ -420,6 +421,7 @@
                     return PyString_FromString("");
         }
 }
+#endif // LLDB_DISABLE_PYTHON
 %extend lldb::SBThread {
         PyObject *lldb::SBThread::__str__ (){
                 lldb::SBStream description;
diff --git a/source/API/SBCommandInterpreter.cpp b/source/API/SBCommandInterpreter.cpp
index 4593a59..8605114 100644
--- a/source/API/SBCommandInterpreter.cpp
+++ b/source/API/SBCommandInterpreter.cpp
@@ -327,22 +327,14 @@ SBCommandInterpreter::SetCommandOverrideCallback (const char *command_name,
     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
diff --git a/source/Core/FormatManager.cpp b/source/Core/FormatManager.cpp
index 1423936..5f042b0 100644
--- a/source/Core/FormatManager.cpp
+++ b/source/Core/FormatManager.cpp
@@ -765,9 +765,7 @@ AddScriptSummary(TypeCategoryImpl::SharedPointer category_sp,
     category_sp->GetSummaryNavigator()->Add(type_name,
                                             summary_sp);
 }
-#endif
 
-#ifndef LLDB_DISABLE_PYTHON
 void
 FormatManager::LoadObjCFormatters()
 {
