summaryrefslogtreecommitdiffstats
path: root/patches/Python-3.5.4/0001-python3-don-t-leak-host-path-into-cross-compilation.patch
blob: fbe2c312f5915b5e1308ce0faf60163fdfa97c67 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Tue, 15 Sep 2015 15:33:58 +0200
Subject: [PATCH] python3: don't leak host path into cross compilation

Based on a patch by Han Sirkstra <han@protonic.nl>

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

diff --git a/setup.py b/setup.py
index 40f8bf20ee74..ee04dba88fa8 100644
--- a/setup.py
+++ b/setup.py
@@ -533,7 +533,8 @@ class PyBuildExt(build_ext):
                         add_dir_to_list(dir_list, directory)
 
         if os.path.normpath(sys.base_prefix) != '/usr' \
-                and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+                and not sysconfig.get_config_var('PYTHONFRAMEWORK') \
+                and not cross_compiling:
             # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
             # (PYTHONFRAMEWORK is set) to avoid # linking problems when
             # building a framework with different architectures than
@@ -1274,7 +1275,6 @@ class PyBuildExt(build_ext):
                         if dbm_setup_debug: print("building dbm using bdb")
                         dbmext = Extension('_dbm', ['_dbmmodule.c'],
                                            library_dirs=dblib_dir,
-                                           runtime_library_dirs=dblib_dir,
                                            include_dirs=db_incs,
                                            define_macros=[
                                                ('HAVE_BERKDB_H', None),
@@ -1323,7 +1323,8 @@ class PyBuildExt(build_ext):
         panel_library = 'panel'
         if curses_library == 'ncursesw':
             curses_defines.append(('HAVE_NCURSESW', '1'))
-            curses_includes.append('/usr/include/ncursesw')
+            if not cross_compiling:
+                curses_includes.append('/usr/include/ncursesw')
             # Bug 1464056: If _curses.so links with ncursesw,
             # _curses_panel.so must link with panelw.
             panel_library = 'panelw'