Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | From 07df0ae0d70cba6d1847fe1c24a71063930bec60 Mon Sep 17 00:00:00 2001 |
| 2 | From: Tyler Hall <tylerwhall@gmail.com> |
| 3 | Date: Sun, 4 May 2014 20:06:43 -0400 |
| 4 | Subject: [PATCH] python-config: Revert to using distutils.sysconfig |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 5 | |
| 6 | The newer sysconfig module shares some code with distutils.sysconfig, but the same modifications as in |
| 7 | |
| 8 | 12-distutils-prefix-is-inside-staging-area.patch makes distutils.sysconfig |
| 9 | |
| 10 | affect the native runtime as well as cross building. Use the old, patched |
| 11 | implementation which returns paths in the staging directory and for the target, |
| 12 | as appropriate. |
| 13 | |
| 14 | Upstream-Status: Inappropriate [Embedded Specific] |
| 15 | |
| 16 | Signed-off-by: Tyler Hall <tylerwhall@gmail.com> |
| 17 | : |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 18 | |
| 19 | --- |
| 20 | Misc/python-config.in | 10 +++++----- |
| 21 | 1 file changed, 5 insertions(+), 5 deletions(-) |
| 22 | |
| 23 | diff --git a/Misc/python-config.in b/Misc/python-config.in |
| 24 | index 727c4a8..c702829 100644 |
| 25 | --- a/Misc/python-config.in |
| 26 | +++ b/Misc/python-config.in |
| 27 | @@ -6,7 +6,7 @@ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | 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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 35 | 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir', |
| 36 | @@ -35,14 +35,14 @@ if '--help' in opt_flags: |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | |
| 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)) |