blob: c8a8f3d4aa35e23d7e73eb431ad215a0e4da9e0c [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001From 07df0ae0d70cba6d1847fe1c24a71063930bec60 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
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005
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:
Andrew Geissler82c905d2020-04-13 13:39:40 -050018
19---
20 Misc/python-config.in | 10 +++++-----
21 1 file changed, 5 insertions(+), 5 deletions(-)
22
23diff --git a/Misc/python-config.in b/Misc/python-config.in
24index 727c4a8..c702829 100644
25--- a/Misc/python-config.in
26+++ b/Misc/python-config.in
27@@ -6,7 +6,7 @@
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028 import getopt
29 import os
30 import sys
31-import sysconfig
32+from distutils import sysconfig
33
34 valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
Andrew Geissler82c905d2020-04-13 13:39:40 -050035 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir',
36@@ -35,14 +35,14 @@ if '--help' in opt_flags:
Patrick Williamsc124f4f2015-09-15 14:41:29 -050037
38 for opt in opt_flags:
39 if opt == '--prefix':
40- print(sysconfig.get_config_var('prefix'))
41+ print(sysconfig.PREFIX)
42
43 elif opt == '--exec-prefix':
44- print(sysconfig.get_config_var('exec_prefix'))
45+ print(sysconfig.EXEC_PREFIX)
46
47 elif opt in ('--includes', '--cflags'):
48- flags = ['-I' + sysconfig.get_path('include'),
49- '-I' + sysconfig.get_path('platinclude')]
50+ flags = ['-I' + sysconfig.get_python_inc(),
51+ '-I' + sysconfig.get_python_inc(plat_specific=True)]
52 if opt == '--cflags':
53 flags.extend(getvar('CFLAGS').split())
54 print(' '.join(flags))