Visitar URL original
[2.7] bpo-19960: Fix building of zlib on macOS without installed headers by ned-deily · Pull Request #14257 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20211101201213/https://github.com/python/cpython/pull/14257/files
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.7] bpo-19960: Fix building of zlib on macOS without installed headers #14257

Merged
merged 1 commit into from Jul 1, 2019
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,4 @@
When building 2.7 on macOS without system header files installed in
``/usr/include``, a few extension modules dependent on system-supplied
third-party libraries were not being built, most notably zlib.

@@ -39,8 +39,15 @@ def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
1) 'dir' is not already in 'dirlist'
2) 'dir' actually exists, and is a directory."""
if dir is not None and os.path.isdir(dir) and dir not in dirlist:
dirlist.insert(0, dir)
if dir is not None and dir not in dirlist:
if host_platform == 'darwin' and is_macosx_sdk_path(dir):
# If in a macOS SDK path, check relative to the SDK root
dir_exists = os.path.isdir(
os.path.join(macosx_sdk_root(), dir[1:]))
else:
dir_exists = os.path.isdir(dir)
if dir_exists:
dirlist.insert(0, dir)

MACOS_SDK_ROOT = None