GitHub

Original file line numberDiff line numberDiff line change

@@ -193,7 +193,7 @@ def configure(conf):

193193

conf.env.CXXFLAGS_WXPY = list()

194194
195195

# Check wx-config exists and fetch some values from it

196-

rpath = ' --no-rpath' if not conf.options.no_magic else ''

196+

rpath = ' --no-rpath'

197197

conf.check_cfg(path=conf.options.wx_config, package='',

198198

args='--cxxflags --libs core,net' + rpath,

199199

uselib_store='WX', mandatory=True,

@@ -325,6 +325,13 @@ def configure(conf):

325325

conf.env.LIBPATH_PYEXT = []

326326

conf.env.LIB_PYEXT = []

327327
328+

# Use an explicit -Wl,-rpath,$ORIGIN linker flag rather than relying on

329+

# LD_RUN_PATH. GNU ld silently ignores LD_RUN_PATH whenever any explicit

330+

# -rpath flag appears on the command line (e.g. one injected by pyenv

331+

# Python via sysconfig LDFLAGS). Explicit -rpath entries accumulate, so

332+

# both the pyenv path and $ORIGIN will be present in the final binary.

333+

if not isDarwin and not conf.options.no_magic:

334+

conf.env.append_value('LINKFLAGS_WXPY', ['-Wl,-rpath,$ORIGIN'])

328335
329336

# Use the same compilers that wxWidgets used

330337

if cfg.CC:

Read the original on github.com ↗