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
@@ -22,7 +22,7 @@
import os, sys
-include_python = '#include <Python.h>'
+include_python = '# include <Python.h>'
include_python_ifdef = '''#if defined (__APPLE__)
@@ -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.
- include_python_found = True
+ if line.startswith(include_python):
+ # Write out the modified lines.
# Otherwise, copy the line verbatim to the output file.
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)?