m4macros: Windows may have a versioned directory for headers.

Basically the same fix as 61c11b04c1, on
pythondev.m4 (for Python2) instead of python3dev.m4.
This commit is contained in:
Jehan
2019-08-06 16:38:49 +02:00
parent 30e4a7ee5e
commit ac0c81b38f

View File

@ -219,18 +219,19 @@ dnl function also defines PYTHON_INCLUDES
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
[AC_REQUIRE([AM_PATH_PYTHON2])
AC_MSG_CHECKING(for headers required to compile python extensions)
dnl Win32 doesn't have a versioned directory for headers
if test "$PYTHON_PLATFORM" != "win32"; then
py_versiondir="/python${PYTHON_VERSION}"
else
py_versiondir=
fi
dnl deduce PYTHON_INCLUDES
py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"`
py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"`
PYTHON_INCLUDES="-I${py_prefix}/include${py_versiondir}"
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include${py_versiondir}"
py_versiondir="${py_exec_prefix}/include/python${PYTHON_VERSION}"
dnl Win32 doesn't always have a versioned directory for headers
if test "$PYTHON_PLATFORM" = "win32"; then
if test -d "${py_versiondir}" ; then
py_versiondir=${py_exec_prefix}/include
fi
fi
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_versiondir}"
fi
AC_SUBST(PYTHON_INCLUDES)
dnl check if the headers exist: