X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fpython-lttngust%2FMakefile.am;h=d53e21da6f9957cb5deece0d2034ac32218fd075;hb=62ac73652e744e80132b30994267c66ebc4a9ccc;hp=64800e6fafd53587eadc5e94f6dbd8dba7858674;hpb=b5d90d0b363db46ec5b583a2604309c5ef4b8938;p=lttng-ust.git diff --git a/src/python-lttngust/Makefile.am b/src/python-lttngust/Makefile.am index 64800e6f..d53e21da 100644 --- a/src/python-lttngust/Makefile.am +++ b/src/python-lttngust/Makefile.am @@ -14,6 +14,15 @@ GENERATED_BINDINGS_DEPS = \ lttngust/version.py \ setup.py +# For python < 3.12, force the use of distutils even if setuptools is +# installed. For python >= 3.12, set the externally managed option to allow +# installation in a directory which isn't in the current PYTHONPATH. +if HAVE_PYTHON_312_OR_GREATER +PY_INSTALL_OPTS = --single-version-externally-managed +else +export SETUPTOOLS_USE_DISTUTILS=stdlib +endif + all-local: build-python-bindings.stamp copy-static-deps.stamp: $(addprefix $(srcdir)/, $(STATIC_BINDINGS_DEPS)) @@ -36,7 +45,7 @@ install-exec-local: build-python-bindings.stamp if [ "$(DESTDIR)" != "" ]; then \ opts="$$opts --root=$(DESTDIR)"; \ fi; \ - $(PYTHON) $(builddir)/setup.py install $$opts; + $(PYTHON) $(builddir)/setup.py install $(PY_INSTALL_OPTS) $$opts; clean-local: rm -rf $(builddir)/build