mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480)
It is possible to use either '-isysroot /some/path' (with a space) or '-isysroot/some/path' (no space in between). Support both forms in places where special handling of -isysroot is done, rather than just the first form. Co-authored-by: Ned Deily <nad@python.org>
This commit is contained in:
parent
3a69f3caee
commit
b310700976
5 changed files with 79 additions and 16 deletions
|
@ -174,6 +174,29 @@ class Test_OSXSupport(unittest.TestCase):
|
|||
_osx_support._remove_universal_flags(
|
||||
config_vars))
|
||||
|
||||
def test__remove_universal_flags_alternate(self):
|
||||
# bpo-38360: also test the alternate single-argument form of -isysroot
|
||||
config_vars = {
|
||||
'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ',
|
||||
'LDFLAGS': '-arch ppc -arch i386 -g',
|
||||
'CPPFLAGS': '-I. -isysroot/Developer/SDKs/MacOSX10.4u.sdk',
|
||||
'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g',
|
||||
'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 '
|
||||
'-isysroot/Developer/SDKs/MacOSX10.4u.sdk -g',
|
||||
}
|
||||
expected_vars = {
|
||||
'CFLAGS': '-fno-strict-aliasing -g -O3 ',
|
||||
'LDFLAGS': ' -g',
|
||||
'CPPFLAGS': '-I. ',
|
||||
'BLDSHARED': 'gcc-4.0 -bundle -g',
|
||||
'LDSHARED': 'gcc-4.0 -bundle -g',
|
||||
}
|
||||
self.add_expected_saved_initial_values(config_vars, expected_vars)
|
||||
|
||||
self.assertEqual(expected_vars,
|
||||
_osx_support._remove_universal_flags(
|
||||
config_vars))
|
||||
|
||||
def test__remove_unsupported_archs(self):
|
||||
config_vars = {
|
||||
'CC': 'clang',
|
||||
|
@ -261,6 +284,34 @@ class Test_OSXSupport(unittest.TestCase):
|
|||
_osx_support._check_for_unavailable_sdk(
|
||||
config_vars))
|
||||
|
||||
def test__check_for_unavailable_sdk_alternate(self):
|
||||
# bpo-38360: also test the alternate single-argument form of -isysroot
|
||||
config_vars = {
|
||||
'CC': 'clang',
|
||||
'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 '
|
||||
'-isysroot/Developer/SDKs/MacOSX10.1.sdk',
|
||||
'LDFLAGS': '-arch ppc -arch i386 -g',
|
||||
'CPPFLAGS': '-I. -isysroot/Developer/SDKs/MacOSX10.1.sdk',
|
||||
'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g',
|
||||
'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 '
|
||||
'-isysroot/Developer/SDKs/MacOSX10.1.sdk -g',
|
||||
}
|
||||
expected_vars = {
|
||||
'CC': 'clang',
|
||||
'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 '
|
||||
' ',
|
||||
'LDFLAGS': '-arch ppc -arch i386 -g',
|
||||
'CPPFLAGS': '-I. ',
|
||||
'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g',
|
||||
'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 '
|
||||
' -g',
|
||||
}
|
||||
self.add_expected_saved_initial_values(config_vars, expected_vars)
|
||||
|
||||
self.assertEqual(expected_vars,
|
||||
_osx_support._check_for_unavailable_sdk(
|
||||
config_vars))
|
||||
|
||||
def test_get_platform_osx(self):
|
||||
# Note, get_platform_osx is currently tested more extensively
|
||||
# indirectly by test_sysconfig and test_distutils
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue