Skip to content

Commit

Permalink
00001: Fixup distutils/unixccompiler.py to remove standard library pa…
Browse files Browse the repository at this point in the history
…th from rpath

Was Patch0 in ivazquez' python3000 specfile
  • Loading branch information
davidmalcolm authored and hroncok committed Oct 12, 2022
1 parent 44adf8a commit dce1a4f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Lib/distutils/unixccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ class UnixCCompiler(CCompiler):
if sys.platform == "cygwin":
exe_extension = ".exe"

def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs):
"""Remove standard library path from rpath"""
libraries, library_dirs, runtime_library_dirs = super()._fix_lib_args(
libraries, library_dirs, runtime_library_dirs)
libdir = sysconfig.get_config_var('LIBDIR')
if runtime_library_dirs and (libdir in runtime_library_dirs):
runtime_library_dirs.remove(libdir)
return libraries, library_dirs, runtime_library_dirs

def preprocess(self, source, output_file=None, macros=None,
include_dirs=None, extra_preargs=None, extra_postargs=None):
fixed_args = self._fix_compile_args(None, macros, include_dirs)
Expand Down

0 comments on commit dce1a4f

Please sign in to comment.