In configure.ac:
AC_MSG_CHECKING([for python versions]) AC_ARG_WITH([python], [ --without-python do not compile python support]) if test "x$with_python" = "xno"; then AC_MSG_RESULT([skipped]) PYTHONVERS= else PYTHONVERS=$(ls /usr/include/python*/Python.h 2> /dev/null | sed 's|.*\(python[[0-9]]*\.[[0-9]]*\).*|\1|g' | tr '\n' ' ') AC_MSG_RESULT([$PYTHONVERS]) fi AC_SUBST([PYTHONVERS])
Debian's package needs to pass an explicit list of python versions, and some manually built sites might not want to enable all currently-present python versions and/or might want to enable ones installed other than /usr/include (/usr/local, arch-depedent include path, etc). But the only thing this ./configure can do it autodetect all currently present ones from the vendor. Debian's solution is to patch Makefile.in. And Makefile.in does:
for ver in $(PYTHONVERS); do \ pyconfig=$$ver-config; \ [...] PCFLAGS=`$$pyconfig --cflags`; \
which means it detects all the python flags using first found in PATH even if user wants to use some alternative one (and even if user has changes PATH so that /usr isn't where include/python* was detected).
At a minimum, ./configure should take a flag to specify the python versions (overriding autodetection via /usr/include).
The --with-python option should now accept python versions. Thanks for the report.
Metadata Update from @mlichvar: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)