diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2004-12-26 23:07:48 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2004-12-26 23:07:48 (GMT) |
commit | be95462c1c2955a9e41d754e7ebe9f825c980409 (patch) | |
tree | 4836eae1a9673b0b564f222ff1f0790e82d61427 | |
parent | 6116f07fdc8793eb3d8e0c48de3d705d11c31dae (diff) | |
download | cpython-be95462c1c2955a9e41d754e7ebe9f825c980409.zip cpython-be95462c1c2955a9e41d754e7ebe9f825c980409.tar.gz cpython-be95462c1c2955a9e41d754e7ebe9f825c980409.tar.bz2 |
After discussion on the PythonMac-SIG it was decided that it is better
to make using "-undefined dynamic_lookup" for linking extensions more
automatic on 10.3 and later. So if we're on that platform and
MACOSX_DEPLOYMENT_TARGET is not set we now set it to the current OSX
version during configure. Additionally, distutils will pick up the
configure-time value by default.
Will backport.
-rw-r--r-- | Lib/distutils/sysconfig.py | 6 | ||||
-rwxr-xr-x | configure | 7 | ||||
-rw-r--r-- | configure.in | 5 |
3 files changed, 11 insertions, 7 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py index 8986dc9..d4eb368 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -360,11 +360,13 @@ def _init_posix(): # 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 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)) @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1.475 . +# From configure.in Revision: 1.477 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for python 2.5. # @@ -10322,11 +10322,12 @@ then Darwin/*) # Use -undefined dynamic_lookup whenever possible (10.3 and later). # This allows an extension to be used in any Python - if test ${MACOSX_DEPLOYMENT_TARGET-10.1} '>' 10.2 + cur_target=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'` + if test ${MACOSX_DEPLOYMENT_TARGET-${cur_target}} '>' 10.2 then LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup' BLDSHARED="$LDSHARED" - CONFIGURE_MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET + CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}} else LDSHARED='$(CC) $(LDFLAGS) -bundle' if test "$enable_framework" ; then diff --git a/configure.in b/configure.in index 68720e7..9371a57 100644 --- a/configure.in +++ b/configure.in @@ -1324,11 +1324,12 @@ then Darwin/*) # Use -undefined dynamic_lookup whenever possible (10.3 and later). # This allows an extension to be used in any Python - if test ${MACOSX_DEPLOYMENT_TARGET-10.1} '>' 10.2 + cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'` + if test ${MACOSX_DEPLOYMENT_TARGET-${cur_target}} '>' 10.2 then LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup' BLDSHARED="$LDSHARED" - CONFIGURE_MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET + CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}} else LDSHARED='$(CC) $(LDFLAGS) -bundle' if test "$enable_framework" ; then |