summaryrefslogtreecommitdiffstats
path: root/patches/Python-2.7.16/0007-add-more-search-paths.patch
blob: 3e6e234eef8cf3e3e012346bffda7e1be629cb65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Thu, 13 Jun 2013 10:42:58 +0200
Subject: [PATCH] add more search paths

Without this setup.py won't find libs in <sysroot>/lib

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 setup.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/setup.py b/setup.py
index 213a4d969fbc..4ce7075150d1 100644
--- a/setup.py
+++ b/setup.py
@@ -502,8 +502,10 @@ class PyBuildExt(build_ext):
             # (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"))
+            libdir = sysconfig.get_config_var("LIBDIR")
+            add_dir_to_list(self.compiler.library_dirs, libdir)
+            if libdir.endswith('/usr/lib'):
+                add_dir_to_list(self.compiler.library_dirs, libdir.replace('/usr/lib','/lib'))
             add_dir_to_list(self.compiler.include_dirs,
                             sysconfig.get_config_var("INCLUDEDIR"))