bpo-41116: Ensure system supplied libraries are found on macOS 11 (GH-23301)

On macOS system provided libraries are in a shared library cache
and not at their usual location. This PR teaches distutils to search
in the SDK, even if there was no "-sysroot" argument in
the compiler flags.
This commit is contained in:
Ronald Oussoren 2020-11-22 06:14:25 +01:00 committed by GitHub
parent 453bc1da20
commit 404a719b51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 30 deletions

View file

@ -290,7 +290,7 @@ class UnixCCompiler(CCompiler):
cflags = sysconfig.get_config_var('CFLAGS')
m = re.search(r'-isysroot\s*(\S+)', cflags)
if m is None:
sysroot = '/'
sysroot = _osx_support._default_sysroot(sysconfig.get_config_var('CC'))
else:
sysroot = m.group(1)