mirror of
https://github.com/python/cpython.git
synced 2025-09-13 04:08:37 +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 distutils import util # used to patch _environ_checked
|
|||
from distutils.sysconfig import get_config_vars
|
||||
from distutils import sysconfig
|
||||
from distutils.tests import support
|
||||
import _osx_support
|
||||
|
||||
class UtilTestCase(support.EnvironGuard, unittest.TestCase):
|
||||
|
||||
|
@ -92,6 +93,7 @@ class UtilTestCase(support.EnvironGuard, 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'))
|
||||
_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 '
|
||||
|
@ -105,6 +107,7 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase):
|
|||
sys.maxsize = cursize
|
||||
|
||||
# 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 '
|
||||
|
@ -113,10 +116,12 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase):
|
|||
|
||||
self.assertEqual(get_platform(), 'macosx-10.4-fat')
|
||||
|
||||
_osx_support._remove_original_values(get_config_vars())
|
||||
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.1'
|
||||
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 '
|
||||
|
@ -124,18 +129,21 @@ class UtilTestCase(support.EnvironGuard, 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 '
|
||||
|
@ -144,6 +152,7 @@ class UtilTestCase(support.EnvironGuard, 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