Created
March 19, 2011 13:54
-
-
Save ento/877491 to your computer and use it in GitHub Desktop.
Installing lxml on a Mac OS X 10.6 that has no PPC support (read: Xcode 4)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/buildlibxml.py b/buildlibxml.py | |
index bfcf3e4..7bf36e5 100644 | |
--- a/buildlibxml.py | |
+++ b/buildlibxml.py | |
@@ -284,8 +284,11 @@ def build_libxml2xslt(download_dir, build_dir, | |
}) | |
else: | |
env.update({ | |
- 'CFLAGS' : "-arch ppc -arch i386 -arch x86_64 -O2", | |
- 'LDFLAGS' : "-arch ppc -arch i386 -arch x86_64", | |
+ #'CFLAGS' : "-arch ppc -arch i386 -arch x86_64 -O2", | |
+ #'LDFLAGS' : "-arch ppc -arch i386 -arch x86_64", | |
+ # For Xcode 4.0 | |
+ 'CFLAGS' : "-arch i386 -arch x86_64 -O2", | |
+ 'LDFLAGS' : "-arch i386 -arch x86_64", | |
'MACOSX_DEPLOYMENT_TARGET' : "10.6" | |
}) | |
call_setup['env'] = env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Xcode 4.0 doesn't support PPC so we need to exclude ppc from -arch | |
curl -O http://pypi.python.org/packages/source/l/lxml/lxml-2.2.8.tar.gz | |
tar xfzv lxml-2.2.8.tar.gz | |
cd lxml-2.2.8 | |
vi buildlibxml.py # apply the patch above to fix libxml2/libxslt build | |
# The following lines are needed to exclude ppc from lxml itself. | |
export CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64" | |
export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64" | |
python setup.py build --static-deps --libxml2-version=2.7.8 --libxslt-version=1.1.26 | |
python setup.py install | |
# Note: alternative is to install Xcode 3.2.6 along side Xcode 4 | |
# http://www.cocoabuilder.com/archive/xcode/299924-no-ppc-from-xcode-4.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment