]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backported from the trunk:
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 6 Jan 2005 23:16:03 +0000 (23:16 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 6 Jan 2005 23:16:03 +0000 (23:16 +0000)
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.

Lib/distutils/sysconfig.py
configure
configure.in

index 8986dc9857266394ee008cc085fcacda67c2b8ef..d4eb368e9f379c6e4a321ab3e38b0f7552085106 100644 (file)
@@ -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))
index 583c3a887703d2d1ae73759e9eb1081f8068ccad..d097ff893366e1588aca6e8f6cdb1acd4ed27715 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.475 .
+# From configure.in Revision: 1.475.2.2 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59 for python 2.4.
 #
@@ -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
index fba1a12cfcfc1267e07d649fe1ac1f6f998cb021..917ed976689b736f3f120aab030ad5b505cf6acd 100644 (file)
@@ -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