Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | python-config: Revert to using distutils.sysconfig |
| 2 | |
| 3 | The newer sysconfig module shares some code with distutils.sysconfig, but the same modifications as in |
| 4 | |
| 5 | 12-distutils-prefix-is-inside-staging-area.patch makes distutils.sysconfig |
| 6 | |
| 7 | affect the native runtime as well as cross building. Use the old, patched |
| 8 | implementation which returns paths in the staging directory and for the target, |
| 9 | as appropriate. |
| 10 | |
| 11 | Upstream-Status: Inappropriate [Embedded Specific] |
| 12 | |
| 13 | Signed-off-by: Tyler Hall <tylerwhall@gmail.com> |
| 14 | : |
| 15 | Index: Python-3.3.3/Misc/python-config.in |
| 16 | =================================================================== |
| 17 | --- Python-3.3.3.orig/Misc/python-config.in |
| 18 | +++ Python-3.3.3/Misc/python-config.in |
| 19 | @@ -4,7 +4,7 @@ |
| 20 | import getopt |
| 21 | import os |
| 22 | import sys |
| 23 | -import sysconfig |
| 24 | +from distutils import sysconfig |
| 25 | |
| 26 | valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags', |
| 27 | 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir'] |
| 28 | @@ -32,14 +32,14 @@ if '--help' in opt_flags: |
| 29 | |
| 30 | for opt in opt_flags: |
| 31 | if opt == '--prefix': |
| 32 | - print(sysconfig.get_config_var('prefix')) |
| 33 | + print(sysconfig.PREFIX) |
| 34 | |
| 35 | elif opt == '--exec-prefix': |
| 36 | - print(sysconfig.get_config_var('exec_prefix')) |
| 37 | + print(sysconfig.EXEC_PREFIX) |
| 38 | |
| 39 | elif opt in ('--includes', '--cflags'): |
| 40 | - flags = ['-I' + sysconfig.get_path('include'), |
| 41 | - '-I' + sysconfig.get_path('platinclude')] |
| 42 | + flags = ['-I' + sysconfig.get_python_inc(), |
| 43 | + '-I' + sysconfig.get_python_inc(plat_specific=True)] |
| 44 | if opt == '--cflags': |
| 45 | flags.extend(getvar('CFLAGS').split()) |
| 46 | print(' '.join(flags)) |