@@ -5,21 +5,21 @@ ac_previous_libs=$LIBS
AC_PATH_PROG([pyconfig], [$PYTHON-config], [no])
AS_IF([test x"$pyconfig" = x"no"], [
dnl For those that don't have python-config
- CPPFLAGS="$CFLAGS `$PYTHON -c 'import distutils.sysconfig; \
- print("-I" + distutils.sysconfig.get_config_var("INCLUDEPY"))'`"
- CPPFLAGS="$CPPFLAGS `$PYTHON -c 'import distutils.sysconfig; \
- print(distutils.sysconfig.get_config_var("CFLAGS"))'`"
- LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
- print("-L" + distutils.sysconfig.get_python_lib(plat_specific=1,\
+ CPPFLAGS="$CFLAGS `$PYTHON -c 'import sysconfig; \
+ print("-I" + sysconfig.get_config_var("INCLUDEPY"))'`"
+ CPPFLAGS="$CPPFLAGS `$PYTHON -c 'import sysconfig; \
+ print(sysconfig.get_config_var("CFLAGS"))'`"
+ LDFLAGS="$LDFLAGS `$PYTHON -c 'import sysconfig; \
+ print("-L" + sysconfig.get_python_lib(plat_specific=1,\
standard_lib=1) + "/config")'`"
- LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
- print(distutils.sysconfig.get_config_var("LINKFORSHARED"))'`"
- LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
- print(distutils.sysconfig.get_config_var("LDFLAGS"))'`"
- LIBS="$LIBS `$PYTHON -c 'import distutils.sysconfig; \
- print(distutils.sysconfig.get_config_var("LIBS"))'`"
- LIBS="$LIBS `$PYTHON -c 'import distutils.sysconfig; \
- print(distutils.sysconfig.get_config_var("SYSLIBS"))'`"
+ LDFLAGS="$LDFLAGS `$PYTHON -c 'import sysconfig; \
+ print(sysconfig.get_config_var("LINKFORSHARED"))'`"
+ LDFLAGS="$LDFLAGS `$PYTHON -c 'import sysconfig; \
+ print(sysconfig.get_config_var("LDFLAGS"))'`"
+ LIBS="$LIBS `$PYTHON -c 'import sysconfig; \
+ print(sysconfig.get_config_var("LIBS"))'`"
+ LIBS="$LIBS `$PYTHON -c 'import sysconfig; \
+ print(sysconfig.get_config_var("SYSLIBS"))'`"
], [
dnl If python-config is found use it
CPPFLAGS="$CFLAGS `$PYTHON-config --cflags`"
@@ -73,8 +73,8 @@ $(PYLIB): $(PYSRC)
python-bindings: $(PYLIB) $(PYMOD)
pythonlibdir = $(shell $(PYTHON) -c \
- 'import distutils.sysconfig as cfg; \
- print(cfg.get_python_lib(False, False, prefix="$(prefix)"))')
+ 'import sysconfig; \
+ print(sysconfig.get_python_lib("platlib", vars={"platbase": "$(prefix)"}))')
.PHONY: install-python-bindings
install-python-bindings: $(PYLIB) $(PYMOD)
Python distutils is deprecated and is going to be removed in Python 3.12. The distutils.sysconfig is available as sysconfig module in stdlib since Python 3.2, so use that directly. Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> --- m4/python_devel.m4 | 28 ++++++++++++++-------------- tools/libs/stat/Makefile | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-)