blob: 4da399e46e7d3cc09cdc567cc406fa219001207f [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001From 8632f25ac4e2c53a3c2c8a1b4fc97fc86e8aad5a 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>
Andrew Geissler82c905d2020-04-13 13:39:40 -050017
18---
Andrew Geissler595f6302022-01-24 19:11:47 +000019 Misc/python-config.in | 12 +++++++-----
20 1 file changed, 7 insertions(+), 5 deletions(-)
Andrew Geissler82c905d2020-04-13 13:39:40 -050021
22diff --git a/Misc/python-config.in b/Misc/python-config.in
Andrew Geissler595f6302022-01-24 19:11:47 +000023index ebd99da..0492e08 100644
Andrew Geissler82c905d2020-04-13 13:39:40 -050024--- a/Misc/python-config.in
25+++ b/Misc/python-config.in
Andrew Geissler595f6302022-01-24 19:11:47 +000026@@ -6,7 +6,9 @@
Patrick Williamsc124f4f2015-09-15 14:41:29 -050027 import getopt
28 import os
29 import sys
30-import sysconfig
Andrew Geissler595f6302022-01-24 19:11:47 +000031+import warnings
32+warnings.filterwarnings("ignore", category=DeprecationWarning)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033+from distutils import sysconfig
34
35 valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
Andrew Geissler82c905d2020-04-13 13:39:40 -050036 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir',
Andrew Geissler595f6302022-01-24 19:11:47 +000037@@ -35,14 +37,14 @@ if '--help' in opt_flags:
Patrick Williamsc124f4f2015-09-15 14:41:29 -050038
39 for opt in opt_flags:
40 if opt == '--prefix':
Andrew Geissler6ce62a22020-11-30 19:58:47 -060041- print(getvar('prefix'))
Patrick Williamsc124f4f2015-09-15 14:41:29 -050042+ print(sysconfig.PREFIX)
43
44 elif opt == '--exec-prefix':
Andrew Geissler6ce62a22020-11-30 19:58:47 -060045- print(getvar('exec_prefix'))
Patrick Williamsc124f4f2015-09-15 14:41:29 -050046+ 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))