[lldb-dev] Cannot compile without manual change to script.

Eugene Ostroukhov eostroukhov at gmail.com
Wed Oct 2 22:32:32 PDT 2013


I was trying to compile LLDB on my system (10.8/Xcode4.x) and it failed until I did this change:

diff --git a/scripts/Python/edit-swig-python-wrapper-file.py b/scripts/Python/edit-swig-python-wrapper-file.py
index d64c0b4..8c376b9 100644
--- a/scripts/Python/edit-swig-python-wrapper-file.py
+++ b/scripts/Python/edit-swig-python-wrapper-file.py
@@ -22,7 +22,7 @@
 
 import os, sys
 
-include_python = '#include <Python.h>'
+include_python = '# include <Python.h>'
 include_python_ifdef = '''#if defined (__APPLE__)
 #include <Python/Python.h>
 #else
@@ -40,14 +40,11 @@ full_output_name = full_input_name + ".edited"
 
 with open(full_input_name, 'r') as f_in:
     with open(full_output_name, 'w') as f_out:
-        include_python_found = False
         for line in f_in:
-            if not include_python_found:
-                if line.startswith(include_python):
-                    # Write out the modified lines.
-                    f_out.write(include_python_ifdef)
-                    include_python_found = True
-                    continue
+            if line.startswith(include_python):
+                # Write out the modified lines.
+                f_out.write(include_python_ifdef)
+                continue
 
             # Otherwise, copy the line verbatim to the output file.
             f_out.write(line)



The problems I had:
1. There's a space between "#" and "include"
2. #include <Python.h> should be replaced twice.

Is this a problem with my system setup (e.g. wrong swig version or something)?

Best regards,
Eugene 



More information about the lldb-dev mailing list