xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-devtools/python/python3/python-config.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 8632f25ac4e2c53a3c2c8a1b4fc97fc86e8aad5a Mon Sep 17 00:00:00 2001
2From: Tyler Hall <tylerwhall@gmail.com>
3Date: Sun, 4 May 2014 20:06:43 -0400
4Subject: [PATCH] python-config: Revert to using distutils.sysconfig
5
6The newer sysconfig module shares some code with distutils.sysconfig, but the same modifications as in
7
812-distutils-prefix-is-inside-staging-area.patch makes distutils.sysconfig
9
10affect the native runtime as well as cross building. Use the old, patched
11implementation which returns paths in the staging directory and for the target,
12as appropriate.
13
14Upstream-Status: Inappropriate [Embedded Specific]
15
16Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
17
18---
19 Misc/python-config.in | 12 +++++++-----
20 1 file changed, 7 insertions(+), 5 deletions(-)
21
22diff --git a/Misc/python-config.in b/Misc/python-config.in
23index ebd99da..0492e08 100644
24--- a/Misc/python-config.in
25+++ b/Misc/python-config.in
26@@ -6,7 +6,9 @@
27 import getopt
28 import os
29 import sys
30-import sysconfig
31+import warnings
32+warnings.filterwarnings("ignore", category=DeprecationWarning)
33+from distutils import sysconfig
34
35 valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
36               'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir',
37@@ -35,14 +37,14 @@ if '--help' in opt_flags:
38
39 for opt in opt_flags:
40     if opt == '--prefix':
41-        print(getvar('prefix'))
42+        print(sysconfig.PREFIX)
43
44     elif opt == '--exec-prefix':
45-        print(getvar('exec_prefix'))
46+        print(sysconfig.EXEC_PREFIX)
47
48     elif opt in ('--includes', '--cflags'):
49-        flags = ['-I' + sysconfig.get_path('include'),
50-                 '-I' + sysconfig.get_path('platinclude')]
51+        flags = ['-I' + sysconfig.get_python_inc(),
52+                 '-I' + sysconfig.get_python_inc(plat_specific=True)]
53         if opt == '--cflags':
54             flags.extend(getvar('CFLAGS').split())
55         print(' '.join(flags))
56