X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2FMakefile.am;h=fee3313430acd46991c6196976723a24937512a2;hb=cb50b38fd0c51b3b0c650b2437cbba572321d53a;hp=6b31a743391c52eae99f471cf9b3bb509c84fbb4;hpb=d617eb920ca0200db3fee1674c7002d5ace084ba;p=babeltrace.git diff --git a/src/bindings/python/bt2/Makefile.am b/src/bindings/python/bt2/Makefile.am index 6b31a743..fee33134 100644 --- a/src/bindings/python/bt2/Makefile.am +++ b/src/bindings/python/bt2/Makefile.am @@ -155,12 +155,21 @@ pyinstall_verbose = $(pyinstall_verbose_@AM_V@) pyinstall_verbose_ = $(pyinstall_verbose_@AM_DEFAULT_V@) pyinstall_verbose_0 = @ +# 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 + install-exec-local: build-python-bindings.stamp $(pyinstall_verbose)opts="--prefix=$(prefix) --exec-prefix=$(exec_prefix) --record $(INSTALLED_FILES) --verbose --no-compile $(DISTSETUPOPTS)"; \ 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