[Python-checkins] python/dist/src/Lib/distutils sysconfig.py, 1.57, 1.57.12.1

jackjansen at users.sourceforge.net jackjansen at users.sourceforge.net
Tue Jan 11 14:49:19 CET 2005


Update of /cvsroot/python/python/dist/src/Lib/distutils
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29714/Lib/distutils

Modified Files:
      Tag: release23-maint
	sysconfig.py 
Log Message:
Backport of fixes for #887242 and #1097739:

If $MACOSX_DEPLOYMENT_TARGET is set, and >= 10.3, during configure we
setup extensions to link with dynamic lookup. We also record the
value in the Makefile, and distutils uses the same value to build extension
modules. If MACOSX_DEPLOYMENT_TARGET is not set it defaults to the
current OSX version.

If we cannot use -undefined dynamic_lookup (such as on 10.2 or earlier)
we link extensions directly against the dynamic library in the framework in
stead of against the framework. This will fix building extensions for 2.3
after 2.4 has been installed too.



Index: sysconfig.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/sysconfig.py,v
retrieving revision 1.57
retrieving revision 1.57.12.1
diff -u -d -r1.57 -r1.57.12.1
--- sysconfig.py	10 Feb 2003 14:02:33 -0000	1.57
+++ sysconfig.py	11 Jan 2005 13:49:02 -0000	1.57.12.1
@@ -355,7 +355,21 @@
 
         raise DistutilsPlatformError(my_msg)
 
-
+    # On MacOSX we need to check the setting of the environment variable
+    # MACOSX_DEPLOYMENT_TARGET: configure bases some choices on it so
+    # it needs to be compatible.
+    # If it isn't set we set it to the configure-time value
+    if sys.platform == 'darwin' and g.has_key('CONFIGURE_MACOSX_DEPLOYMENT_TARGET'):
+        cfg_target = g['CONFIGURE_MACOSX_DEPLOYMENT_TARGET']
+        cur_target = os.getenv('MACOSX_DEPLOYMENT_TARGET', '')
+        if cur_target == '':
+            cur_target = cfg_target
+            os.putenv('MACOSX_DEPLOYMENT_TARGET', cfg_target)
+        if cfg_target != cur_target:
+            my_msg = ('$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" during configure'
+                % (cur_target, cfg_target))
+            raise DistutilsPlatformError(my_msg)
+        
     # On AIX, there are wrong paths to the linker scripts in the Makefile
     # -- these paths are relative to the Python source, but when installed
     # the scripts are in another directory.



More information about the Python-checkins mailing list