blob: d0ddbbc7fd712cb64cc50e0941ee0b0160c60fc5 [file] [log] [blame]
Andrew Geissler6ce62a22020-11-30 19:58:47 -06001From 57d073c12e7bede29919117b0141df14015eb27f Mon Sep 17 00:00:00 2001
Andrew Geissler82c905d2020-04-13 13:39:40 -05002From: 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
Andrew Geissler6ce62a22020-11-30 19:58:47 -060024index ebd99da..13e57ae 100644
Andrew Geissler82c905d2020-04-13 13:39:40 -050025--- 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':
Andrew Geissler6ce62a22020-11-30 19:58:47 -060040- print(getvar('prefix'))
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041+ print(sysconfig.PREFIX)
42
43 elif opt == '--exec-prefix':
Andrew Geissler6ce62a22020-11-30 19:58:47 -060044- print(getvar('exec_prefix'))
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045+ 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))