summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/sysconfig.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2004-06-03 12:41:45 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2004-06-03 12:41:45 (GMT)
commit6b08a40442ca500c8e2073e012b51af66cab9c5a (patch)
tree0281a80cf4080212fbfeb8c45d3b6411798bb976 /Lib/distutils/sysconfig.py
parentbc555e386bf666c6bf18c2b60c1471007e379d4d (diff)
downloadcpython-6b08a40442ca500c8e2073e012b51af66cab9c5a.zip
cpython-6b08a40442ca500c8e2073e012b51af66cab9c5a.tar.gz
cpython-6b08a40442ca500c8e2073e012b51af66cab9c5a.tar.bz2
Partial fix for #887242 (link extensions with dynamic_lookup in stead
of hard linking against the framework). 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. Distutils checks whether a value for MACOSX_DEPLOYMENT_TARGET was recorded in the Makefile, and if it was insists that the current value matches. This is only a partial fix because it only applies to 2.4, and the "two python problem" exists with Python 2.3 shipped with MacOSX 10.3, which we have no influence over.
Diffstat (limited to 'Lib/distutils/sysconfig.py')
-rw-r--r--Lib/distutils/sysconfig.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 46d1acb..c912a15 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -355,7 +355,19 @@ def _init_posix():
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.
+ # An alternative would be to force MACOSX_DEPLOYMENT_TARGET to be
+ # the same as during configure.
+ 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 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.