Files
MINGW-packages/mingw-w64-python/0143-setup.py-don-t-prepend-the-system-library-directorie.patch
2023-12-07 08:12:51 +01:00

36 lines
1.6 KiB
Diff

From 4d02ff37bfa03e1f82710a6f262d32c2bc5ef836 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Fri, 25 Aug 2023 21:36:58 +0200
Subject: [PATCH 143/N] setup.py: don't prepend the system library
directories when building extensions
For some reason the code assumes that relative paths are build paths prepends
the system dirs after relative paths in the existing list. We only uses absolute
paths though, and I don't understand why it even tries to do that.
So just append the system dirs instead.
This fixes the build trying to link against the system Python DLL in case it happens
to be installed.
---
setup.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/setup.py b/setup.py
index e4f15d8..946ee91 100644
--- a/setup.py
+++ b/setup.py
@@ -889,10 +889,8 @@ def init_inc_lib_dirs(self):
# (PYTHONFRAMEWORK is set) to avoid # linking problems when
# building a framework with different architectures than
# the one that is currently installed (issue #7473)
- add_dir_to_list(self.compiler.library_dirs,
- sysconfig.get_config_var("LIBDIR"))
- add_dir_to_list(self.compiler.include_dirs,
- sysconfig.get_config_var("INCLUDEDIR"))
+ self.compiler.library_dirs.append(sysconfig.get_config_var("LIBDIR"))
+ self.compiler.include_dirs.append(sysconfig.get_config_var("INCLUDEDIR"))
system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
system_include_dirs = ['/usr/include']