Skip to content

Instantly share code, notes, and snippets.

@filipsalomonsson
Forked from ento/buildlibxml.diff
Created May 9, 2011 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filipsalomonsson/963298 to your computer and use it in GitHub Desktop.
Save filipsalomonsson/963298 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)
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
# 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