fix: python agent: use stdlib distutils when setuptools is installed
[lttng-ust.git] / configure.ac
index fd50f681f993f26c45508ddfb72d9c808d1b5c01..1ea435fc0a8ee7ed8d81e8bcb261e1a850234d5f 100644 (file)
@@ -422,8 +422,21 @@ AS_HELP_STRING([--enable-python-agent], [build the LTTng UST Python agent [defau
 AM_CONDITIONAL([BUILD_PYTHON_AGENT], [test "x$python_agent" = "xyes"])
 AS_IF([test "x$python_agent" = "xyes"], [
        AM_PATH_PYTHON([2.7])
+
+       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])
+         ], [
+           AC_MSG_RESULT([no])
+           AC_MSG_ERROR([Python >= 3.12 removed 'distutils', the 'setuptools' module needs to be installed for the selected interpreter.])
+         ])
+       ])
 ])
 
+AM_CONDITIONAL([HAVE_PYTHON_312_OR_GREATER], [test "x$have_python_312_or_greater" = "xyes"])
+
 # sdt.h integration
 AC_ARG_WITH([sdt], [
 AS_HELP_STRING([--with-sdt], [provide SystemTap integration via sdt.h [default=no]])
This page took 0.023647 seconds and 4 git commands to generate.