@@ -193,7 +193,7 @@ def configure(conf):
|
193 | 193 | conf.env.CXXFLAGS_WXPY = list() |
194 | 194 | |
195 | 195 | # 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' |
197 | 197 | conf.check_cfg(path=conf.options.wx_config, package='', |
198 | 198 | args='--cxxflags --libs core,net' + rpath, |
199 | 199 | uselib_store='WX', mandatory=True, |
@@ -325,6 +325,13 @@ def configure(conf):
|
325 | 325 | conf.env.LIBPATH_PYEXT = [] |
326 | 326 | conf.env.LIB_PYEXT = [] |
327 | 327 | |
| 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']) |
328 | 335 | |
329 | 336 | # Use the same compilers that wxWidgets used |
330 | 337 | if cfg.CC: |
|