X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fpython-lttngust%2FMakefile.am;h=d53e21da6f9957cb5deece0d2034ac32218fd075;hb=d6fbc3fd938da93b77edd5033af0f2591eb8a806;hp=f95482d3e15822dcffe2698a21d3ce40391855d2;hpb=9d4c8b2d907edb9ebc9bfde55602598e7ba0832e;p=lttng-ust.git diff --git a/src/python-lttngust/Makefile.am b/src/python-lttngust/Makefile.am index f95482d3..d53e21da 100644 --- a/src/python-lttngust/Makefile.am +++ b/src/python-lttngust/Makefile.am @@ -10,6 +10,19 @@ STATIC_BINDINGS_DEPS = \ lttngust/debug.py \ lttngust/loghandler.py +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)) @@ -23,7 +36,7 @@ copy-static-deps.stamp: $(addprefix $(srcdir)/, $(STATIC_BINDINGS_DEPS)) # Use setup.py for the installation instead of Autoconf. # This ease the installation process and assure a *pythonic* # installation. -build-python-bindings.stamp: copy-static-deps.stamp +build-python-bindings.stamp: copy-static-deps.stamp $(GENERATED_BINDINGS_DEPS) $(PYTHON) $(builddir)/setup.py build --force touch $@ @@ -32,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