cpython: a7ab09e00dbc (original) (raw)
Mercurial > cpython
changeset 91406:a7ab09e00dbc 2.7
Issue #21811: Anticipated fixes to 3.x and 2.7 for OS X 10.10 Yosemite. [#21811]
Ned Deily nad@acm.org | |
---|---|
date | Wed, 25 Jun 2014 13:33:57 -0700 |
parents | 893e79196fb3 |
children | 2672e30d9095 |
files | Lib/_osx_support.py Lib/distutils/tests/test_build_ext.py Lib/test/test__osx_support.py Lib/test/test_posix.py Mac/BuildScript/build-installer.py setup.py |
diffstat | 6 files changed, 40 insertions(+), 18 deletions(-)[+] [-] Lib/_osx_support.py 12 Lib/distutils/tests/test_build_ext.py 12 Lib/test/test__osx_support.py 4 Lib/test/test_posix.py 2 Mac/BuildScript/build-installer.py 24 setup.py 4 |
line wrap: on
line diff
--- a/Lib/_osx_support.py +++ b/Lib/_osx_support.py @@ -450,8 +450,16 @@ def get_platform_osx(_config_vars, osnam # case and disallow installs. cflags = _config_vars.get(_INITPRE+'CFLAGS', _config_vars.get('CFLAGS', ''))
if ((macrelease + '.') >= '10.4.' and[](#l1.7)
'-arch' in cflags.strip()):[](#l1.8)
if macrelease:[](#l1.9)
try:[](#l1.10)
macrelease = tuple(int(i) for i in macrelease.split('.')[0:2])[](#l1.11)
except ValueError:[](#l1.12)
macrelease = (10, 0)[](#l1.13)
else:[](#l1.14)
# assume no universal support[](#l1.15)
macrelease = (10, 0)[](#l1.16)
if (macrelease >= (10, 4)) and '-arch' in cflags.strip():[](#l1.18) # The universal build will build fat binaries, but not on[](#l1.19) # systems before 10.4[](#l1.20)
--- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/tests/test_build_ext.py @@ -479,8 +479,16 @@ class BuildExtTestCase(support.TempdirMa # get the deployment target that the interpreter was built with target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
target = tuple(map(int, target.split('.')))[](#l2.7)
target = '%02d%01d0' % target[](#l2.8)
target = tuple(map(int, target.split('.')[0:2]))[](#l2.9)
# format the target value as defined in the Apple[](#l2.10)
# Availability Macros. We can't use the macro names since[](#l2.11)
# at least one value we test with will not exist yet.[](#l2.12)
if target[1] < 10:[](#l2.13)
# for 10.1 through 10.9.x -> "10n0"[](#l2.14)
target = '%02d%01d0' % target[](#l2.15)
else:[](#l2.16)
# for 10.10 and beyond -> "10nn00"[](#l2.17)
target = '%02d%02d00' % target[](#l2.18) deptarget_ext = Extension([](#l2.19) 'deptarget',[](#l2.20) [deptarget_c],[](#l2.21)
--- a/Lib/test/test__osx_support.py +++ b/Lib/test/test__osx_support.py @@ -109,7 +109,9 @@ class Test_OSXSupport(unittest.TestCase) def test__supports_universal_builds(self): import platform
self.assertEqual(platform.mac_ver()[0].split('.') >= ['10', '4'],[](#l3.7)
mac_ver_tuple = tuple(int(i) for i in[](#l3.8)
platform.mac_ver()[0].split('.')[0:2])[](#l3.9)
self.assertEqual(mac_ver_tuple >= (10, 4),[](#l3.10) _osx_support._supports_universal_builds())[](#l3.11)
def test__find_appropriate_compiler(self):
--- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -520,7 +520,7 @@ class PosixTester(unittest.TestCase): if sys.platform == 'darwin': import sysconfig dt = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') or '10.0'
if float(dt) < 10.6:[](#l4.7)
if tuple(int(n) for n in dt.split('.')[0:2]) < (10, 6):[](#l4.8) raise unittest.SkipTest("getgroups(2) is broken prior to 10.6")[](#l4.9)
# 'id -G' and 'os.getgroups()' should return the same
--- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -150,17 +150,19 @@ SRCDIR = os.path.dirname(
$MACOSX_DEPLOYMENT_TARGET -> minimum OS X level
DEPTARGET = '10.3' -target_cc_map = { +def getDeptargetTuple():
- target_cc_map = { '10.3': ('gcc-4.0', 'g++-4.0'), '10.4': ('gcc-4.0', 'g++-4.0'), '10.5': ('gcc-4.2', 'g++-4.2'), '10.6': ('gcc-4.2', 'g++-4.2'),
'10.7': ('clang', 'clang++'),[](#l5.17)
'10.8': ('clang', 'clang++'),[](#l5.18)
'10.9': ('clang', 'clang++'),[](#l5.19)
-CC, CXX = target_cc_map[DEPTARGET] +CC, CXX = getTargetCompilers() PYTHON_3 = getVersionTuple() >= (3, 0) @@ -193,10 +195,10 @@ EXPECTED_SHARED_LIBS = {} def library_recipes(): result = []
Disable for now
- if False: # if (getDeptargetTuple() > (10, 5)) and (getVersionTuple() >= (3, 5)): result.extend([ dict( name="Tcl 8.5.15",
@@ -304,7 +306,7 @@ def library_recipes(): ), ])
@@ -458,7 +460,7 @@ def pkg_recipes(): ) )
@@ -679,7 +681,7 @@ def parseOptions(args=None): SDKPATH=os.path.abspath(SDKPATH) DEPSRC=os.path.abspath(DEPSRC)
print("Settings:") print(" * Source directory:", SRCDIR)
--- a/setup.py +++ b/setup.py @@ -733,7 +733,9 @@ class PyBuildExt(build_ext): if host_platform == 'darwin': os_release = int(os.uname()[2].split('.')[0]) dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
if dep_target and dep_target.split('.') < ['10', '5']:[](#l6.7)
if (dep_target and[](#l6.8)
(tuple(int(n) for n in dep_target.split('.')[0:2])[](#l6.9)
< (10, 5) ) ):[](#l6.10) os_release = 8[](#l6.11) if os_release < 9:[](#l6.12) # MacOSX 10.4 has a broken readline. Don't try to build[](#l6.13)