summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3/python-config.patch
blob: c53f646af3524778e6a2a6e46dd83b5ecf86e928 (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
44
45
46
47
48
49
50
51
52
53
54
55
From 57d073c12e7bede29919117b0141df14015eb27f Mon Sep 17 00:00:00 2001
From: Tyler Hall <tylerwhall@gmail.com>
Date: Sun, 4 May 2014 20:06:43 -0400
Subject: [PATCH] python-config: Revert to using distutils.sysconfig

The newer sysconfig module shares some code with distutils.sysconfig, but the same modifications as in

12-distutils-prefix-is-inside-staging-area.patch makes distutils.sysconfig

affect the native runtime as well as cross building. Use the old, patched
implementation which returns paths in the staging directory and for the target,
as appropriate.

Upstream-Status: Inappropriate [Embedded Specific]

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>

---
 Misc/python-config.in | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Misc/python-config.in b/Misc/python-config.in
index ebd99da..13e57ae 100644
--- a/Misc/python-config.in
+++ b/Misc/python-config.in
@@ -6,7 +6,9 @@
 import getopt
 import os
 import sys
-import sysconfig
+import warnings
+warnings.filterwarnings("ignore", category=DeprecationWarning)
+from distutils import sysconfig
 
 valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
               'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir',
@@ -35,14 +35,14 @@ if '--help' in opt_flags:
 
 for opt in opt_flags:
     if opt == '--prefix':
-        print(getvar('prefix'))
+        print(sysconfig.PREFIX)
 
     elif opt == '--exec-prefix':
-        print(getvar('exec_prefix'))
+        print(sysconfig.EXEC_PREFIX)
 
     elif opt in ('--includes', '--cflags'):
-        flags = ['-I' + sysconfig.get_path('include'),
-                 '-I' + sysconfig.get_path('platinclude')]
+        flags = ['-I' + sysconfig.get_python_inc(),
+                 '-I' + sysconfig.get_python_inc(plat_specific=True)]
         if opt == '--cflags':
             flags.extend(getvar('CFLAGS').split())
         print(' '.join(flags))