Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 1 | From 57d073c12e7bede29919117b0141df14015eb27f Mon Sep 17 00:00:00 2001 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 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 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 24 | index ebd99da..13e57ae 100644 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 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': |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 40 | - print(getvar('prefix')) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 41 | + print(sysconfig.PREFIX) |
| 42 | |
| 43 | elif opt == '--exec-prefix': |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 44 | - print(getvar('exec_prefix')) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 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)) |