churchyard / rpms / python38

Forked from rpms/python38 a year ago
Clone
a3483f
diff -up Python-3.1.1/Lib/distutils/unixccompiler.py.rpath Python-3.1.1/Lib/distutils/unixccompiler.py
a3483f
--- Python-3.1.1/Lib/distutils/unixccompiler.py.rpath	2009-09-04 17:29:34.000000000 -0400
a3483f
+++ Python-3.1.1/Lib/distutils/unixccompiler.py	2009-09-04 17:49:54.000000000 -0400
eef42f
@@ -141,6 +141,15 @@ class UnixCCompiler(CCompiler):
a3483f
     if sys.platform == "cygwin":
a3483f
         exe_extension = ".exe"
a3483f
 
a3483f
+    def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs):
a3483f
+        """Remove standard library path from rpath"""
eef42f
+        libraries, library_dirs, runtime_library_dirs = super()._fix_lib_args(
eef42f
+            libraries, library_dirs, runtime_library_dirs)
a3483f
+        libdir = sysconfig.get_config_var('LIBDIR')
a3483f
+        if runtime_library_dirs and (libdir in runtime_library_dirs):
a3483f
+            runtime_library_dirs.remove(libdir)
a3483f
+        return libraries, library_dirs, runtime_library_dirs
a3483f
+
a3483f
     def preprocess(self, source, output_file=None, macros=None,
a3483f
                    include_dirs=None, extra_preargs=None, extra_postargs=None):
a3483f
         fixed_args = self._fix_compile_args(None, macros, include_dirs)