[PATCH] build both 32-bit and 64-bit native extensions on Mac OS X

Steven Streeting steve at stevestreeting.com
Tue Dec 20 04:11:00 CST 2011


# HG changeset patch
# User Steve Streeting <steve at stevestreeting.com>
# Date 1324375049 0
# Node ID 5901397ccb8792059a8903fccae22fb788e6e56e
# Parent  86380f24e6973b5015de67cc53ce7fcfdc9db3ae
build both intel architectures (x386 and x86_64) on mac with xcode 4

ARCHFLAGS was being manually set blank to remove ppc for Xcode 4 (which is no longer supported), but it meant that the native extensions would only work on the native architecture of the build machine, i.e. either i386 or x86_64, not both. This change sets the ARCHFLAGS to include both instead for compatibility (only useful for 10.6 or before)

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -417,7 +417,7 @@
     # Also parse only first digit, because 3.2.1 can't be parsed nicely
     if (version.startswith('Xcode') and
         StrictVersion(version.split()[1]) >= StrictVersion('4.0')):
-        os.environ['ARCHFLAGS'] = ''
+        os.environ['ARCHFLAGS'] = '-arch i386 -arch x86_64'
 
 setup(name='mercurial',
       version=setupversion,



More information about the Mercurial-devel mailing list