])
AX_COMPARE_VERSION(["$PYTHON_VERSION"], [ge], ["3.12"], [
+ have_python_312_or_greater=yes
AC_MSG_CHECKING([for python setuptools])
AS_IF(["$PYTHON" -c "import setuptools" 2>/dev/null], [
AC_MSG_RESULT([yes])
AM_CONDITIONAL([HAVE_CXX], [test "$HAVE_CXX11" = "1"])
AM_CONDITIONAL([HAVE_JAVAH], [test "x$JAVAH" != "x"])
AM_CONDITIONAL([HAVE_PERF_EVENT], [test "x$ac_cv_header_linux_perf_event_h" = "xyes"])
+AM_CONDITIONAL([HAVE_PYTHON_312_OR_GREATER], [test "x$have_python_312_or_greater" = "xyes"])
## ##
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))
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