[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Snarf a patch from Twisted to make the Darwin build hap...



Update of /home/minion/cvsroot/src/minion
In directory moria.mit.edu:/tmp/cvs-serv20920

Modified Files:
	setup.py 
Log Message:
Snarf a patch from Twisted to make the Darwin build happpier.

Index: setup.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/setup.py,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- setup.py	14 Jul 2003 15:38:50 -0000	1.71
+++ setup.py	15 Jul 2003 04:42:14 -0000	1.72
@@ -271,6 +271,28 @@
     MACROS.append( ("MM_O_ENDIAN", 1)  )
 
 #======================================================================
+# Apple's OS X 10.2 has really weird options for its Python distutils.
+# The logic to fix this comes from Twisted.
+
+BROKEN_CONFIG = '2.2 (#1, 07/14/02, 23:25:09) \n[GCC Apple cpp-precomp 6.14]'
+if sys.platform == 'darwin' and sys.version == BROKEN_CONFIG:
+    # change this to 1 if you have some need to compile
+    # with -flat_namespace as opposed to -bundle_loader
+    FLAT_NAMESPACE = 0
+    BROKEN_ARCH = '-arch i386'
+    BROKEN_NAMESPACE = '-flat_namespace -undefined_suppress'
+    import distutils.sysconfig
+    distutils.sysconfig.get_config_vars()
+    x = distutils.sysconfig._config_vars['LDSHARED']
+    y = x.replace(BROKEN_ARCH, '')
+    if not FLAT_NAMESPACE:
+        e = os.path.realpath(sys.executable)
+        y = y.replace(BROKEN_NAMESPACE, '-bundle_loader ' + e)
+    if y != x:
+        print "Fixing some of Apple's compiler flag mistakes..."
+        distutils.sysconfig._config_vars['LDSHARED'] = y
+
+#======================================================================
 # Create a startup script if we're installing.
 
 # This isn't as fully general as distutils allows.  Unfortunately, distutils