Commit 98bef7ce authored by Stefan Behnel's avatar Stefan Behnel

Extend "buildenv" test to show more information about the build system,...

Extend "buildenv" test to show more information about the build system, including the distutils configuration.
parent e050eb08
......@@ -4,7 +4,10 @@ Non-test that prints debug information about the current build environment.
from __future__ import print_function
import os
import sys
from distutils import sysconfig
cdef extern from *:
"""
......@@ -45,6 +48,8 @@ cdef extern from *:
cdef int SIZEOF_SIZE_T
cdef int SIZEOF_LONG_LONG
cdef int SIZEOF_VOID_P
cdef int SIZEOF_OFF_T
cdef int SIZEOF_UINTPTR_T
# PyLong internals
cdef long PyLong_BASE
......@@ -54,6 +59,12 @@ cdef extern from *:
cdef int sdigit
def config_var(name, default=''):
return sysconfig.get_config_var(name) or default
get_env = os.environ.get
print(f"""Python build environment:
Python {sys.version_info}
PY_VERSION_HEX 0x{PY_VERSION_HEX:X}
......@@ -85,4 +96,21 @@ SIZEOF_LONG {SIZEOF_LONG} ({sizeof(long)})
SIZEOF_SIZE_T {SIZEOF_SIZE_T} ({sizeof(Py_ssize_t)}, {getattr(sys, 'maxsize', getattr(sys, 'maxint', None))})
SIZEOF_LONG_LONG {SIZEOF_LONG_LONG} ({sizeof(long long)})
SIZEOF_VOID_P {SIZEOF_VOID_P} ({sizeof(void*)})
SIZEOF_UINTPTR_T {SIZEOF_UINTPTR_T} ({sizeof(unsigned int *)})
SIZEOF_OFF_T {SIZEOF_OFF_T}
Distutils:
INCDIR = {sysconfig.get_python_inc()}
LIBS = {config_var('LIBS')}
LIBDIR = {config_var('LIBDIR')}
LIBPL = {config_var('LIBPL')}
Python LIBRARY = {config_var('LIBRARY')}
LINKFORSHARED = {config_var('LINKFORSHARED')}
CC (distutils) = {config_var('CC')}
CC (env) = {get_env('CC', '')}
CFLAGS (distutils) = {config_var('CFLAGS')}
CFLAGS (env) = {get_env('CFLAGS', '')}
LINKCC (distutils) = {config_var('LINKCC')}
LINKCC (env) = {get_env('LINKCC', '')}
""")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment