Skip to content

Commit

Permalink
Update setup.py to handle Xcode 9.0 on MacOS X.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Oct 3, 2017
1 parent 5923101 commit 042d395
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/release-notes/version-4.5.20.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ Version 4.5.20
Version 4.5.20 of mod_wsgi can be obtained from:

https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.5.20

Bugs Fixed
----------

* Installation on MacOS X using ``setup.py`` or ``pip`` would fail if Xcode
9.0 was installed.
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,17 @@ def get_apu_includes():
# case we manually set the locations of the Apache and APR header files.

if (not os.path.exists(APR_CONFIG) and
os.path.exists('/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk')):
INCLUDEDIR = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/apache2'
APR_INCLUDES = ['-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/apr-1']
APU_INCLUDES = []

elif (not os.path.exists(APR_CONFIG) and
os.path.exists('/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdks/MacOSX.sdk')):
INCLUDEDIR = '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdks/MacOSX.sdk/usr/include/apache2'
APR_INCLUDES = ['-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdks/MacOSX.sdk/usr/include/apr-1']
APU_INCLUDES = []

else:
APR_INCLUDES = get_apr_includes().split()
APU_INCLUDES = get_apu_includes().split()
Expand Down

0 comments on commit 042d395

Please sign in to comment.