mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #15184: Ensure consistent results of OS X configuration
tailoring for universal builds by factoring out common OS X-specific customizations from sysconfig, distutils.sysconfig, distutils.util, and distutils.unixccompiler into a new module _osx_support that can eventually also be used by packaging.
This commit is contained in:
parent
0fd1062a76
commit
df8aa2b325
9 changed files with 818 additions and 467 deletions
|
@ -13,6 +13,7 @@ from sysconfig import (get_paths, get_platform, get_config_vars,
|
|||
get_path, get_path_names, _INSTALL_SCHEMES,
|
||||
_get_default_scheme, _expand_vars,
|
||||
get_scheme_names, get_config_var, _main)
|
||||
import _osx_support
|
||||
|
||||
class TestSysConfig(unittest.TestCase):
|
||||
|
||||
|
@ -134,6 +135,7 @@ class TestSysConfig(unittest.TestCase):
|
|||
('Darwin Kernel Version 8.11.1: '
|
||||
'Wed Oct 10 18:23:28 PDT 2007; '
|
||||
'root:xnu-792.25.20~1/RELEASE_I386'), 'PowerPC'))
|
||||
_osx_support._remove_original_values(get_config_vars())
|
||||
get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
|
||||
|
||||
get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
|
||||
|
@ -152,7 +154,7 @@ class TestSysConfig(unittest.TestCase):
|
|||
('Darwin Kernel Version 8.11.1: '
|
||||
'Wed Oct 10 18:23:28 PDT 2007; '
|
||||
'root:xnu-792.25.20~1/RELEASE_I386'), 'i386'))
|
||||
get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
|
||||
_osx_support._remove_original_values(get_config_vars())
|
||||
get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
|
||||
|
||||
get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
|
||||
|
@ -167,6 +169,7 @@ class TestSysConfig(unittest.TestCase):
|
|||
sys.maxsize = maxint
|
||||
|
||||
# macbook with fat binaries (fat, universal or fat64)
|
||||
_osx_support._remove_original_values(get_config_vars())
|
||||
get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.4'
|
||||
get_config_vars()['CFLAGS'] = ('-arch ppc -arch i386 -isysroot '
|
||||
'/Developer/SDKs/MacOSX10.4u.sdk '
|
||||
|
@ -175,6 +178,7 @@ class TestSysConfig(unittest.TestCase):
|
|||
|
||||
self.assertEqual(get_platform(), 'macosx-10.4-fat')
|
||||
|
||||
_osx_support._remove_original_values(get_config_vars())
|
||||
get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch i386 -isysroot '
|
||||
'/Developer/SDKs/MacOSX10.4u.sdk '
|
||||
'-fno-strict-aliasing -fno-common '
|
||||
|
@ -182,18 +186,21 @@ class TestSysConfig(unittest.TestCase):
|
|||
|
||||
self.assertEqual(get_platform(), 'macosx-10.4-intel')
|
||||
|
||||
_osx_support._remove_original_values(get_config_vars())
|
||||
get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc -arch i386 -isysroot '
|
||||
'/Developer/SDKs/MacOSX10.4u.sdk '
|
||||
'-fno-strict-aliasing -fno-common '
|
||||
'-dynamic -DNDEBUG -g -O3')
|
||||
self.assertEqual(get_platform(), 'macosx-10.4-fat3')
|
||||
|
||||
_osx_support._remove_original_values(get_config_vars())
|
||||
get_config_vars()['CFLAGS'] = ('-arch ppc64 -arch x86_64 -arch ppc -arch i386 -isysroot '
|
||||
'/Developer/SDKs/MacOSX10.4u.sdk '
|
||||
'-fno-strict-aliasing -fno-common '
|
||||
'-dynamic -DNDEBUG -g -O3')
|
||||
self.assertEqual(get_platform(), 'macosx-10.4-universal')
|
||||
|
||||
_osx_support._remove_original_values(get_config_vars())
|
||||
get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc64 -isysroot '
|
||||
'/Developer/SDKs/MacOSX10.4u.sdk '
|
||||
'-fno-strict-aliasing -fno-common '
|
||||
|
@ -202,6 +209,7 @@ class TestSysConfig(unittest.TestCase):
|
|||
self.assertEqual(get_platform(), 'macosx-10.4-fat64')
|
||||
|
||||
for arch in ('ppc', 'i386', 'x86_64', 'ppc64'):
|
||||
_osx_support._remove_original_values(get_config_vars())
|
||||
get_config_vars()['CFLAGS'] = ('-arch %s -isysroot '
|
||||
'/Developer/SDKs/MacOSX10.4u.sdk '
|
||||
'-fno-strict-aliasing -fno-common '
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue