Merge pull request #893 from RobinD42/fix-darwin-linking

Fix darwin linking
(cherry picked from commit de143e9d83)
This commit is contained in:
Robin Dunn
2018-06-22 22:43:44 -07:00
parent b1b0c9e297
commit f418dde5d8
3 changed files with 31 additions and 2 deletions

View File

@@ -42,6 +42,23 @@ Other changes in this release:
4.0.3 ""
---------------------------
* ??-June-2018
PyPI: https://pypi.org/project/wxPython/4.0.3
Extras: https://extras.wxPython.org/wxPython4/extras/
Pip: ``pip install wxPython==4.0.3``
Changes in this release include the following:
* Fixed a linking problem on macOS. The new waf added an explicit link to the
Python shared library which menat that it would try to load it at runtime,
even if a different Python (such as Anaconda, EDM or Homebrew) was used to
import wxPython. This, of course, caused runtime errors.
4.0.2 "Cute as a June bug!"
---------------------------
* 16-June-2018

View File

@@ -265,7 +265,7 @@ class Configuration(object):
# Combine with wx's ld command and stash it in the env
# where distutils will get it later.
LDSHARED = self.getWxConfigValue('--ld').replace(' -o', '') + ' ' + LDSHARED
os.environ["LDSHARED"] = LDSHARED
self.LDSHARED = os.environ["LDSHARED"] = LDSHARED
# wxGTK settings

14
wscript
View File

@@ -308,13 +308,25 @@ def configure(conf):
for key in flags:
_cleanFlags(conf, key)
# Waf 2 is now calling pythonX.Y-config for fetching libs and flags,
# and it may be outputing flags that will cause an explicit link to
# Python's lib, which we don't want as that could tie us to that
# speicifc Python instance instead of the one that is loading the
# wxPython extension modules. That's okay for PYEMBED but not for PYEXT
# configs.
if isDarwin:
conf.env.LIBPATH_PYEXT = []
conf.env.LIB_PYEXT = []
# Use the same compilers that wxWidgets used
if cfg.CC:
conf.env.CC = cfg.CC.split()
if cfg.CXX:
conf.env.CXX = cfg.CXX.split()
if cfg.LDSHARED:
conf.env.LINK_CC = cfg.LDSHARED.split()
conf.env.LINK_CXX = cfg.LDSHARED.split()
# Some Mac-specific stuff
if isDarwin: