[gimp/gimp-2-10] m4macros: Windows may have a versioned directory for headers.



commit ac0c81b38f2413b7aff66e3b381bce0a2a5d9aab
Author: Jehan <jehan girinstud io>
Date:   Tue Aug 6 16:38:49 2019 +0200

    m4macros: Windows may have a versioned directory for headers.
    
    Basically the same fix as 61c11b04c12635fd6aa63cf800b37b24d018fdae, on
    pythondev.m4 (for Python2) instead of python3dev.m4.

 m4macros/pythondev.m4 | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/m4macros/pythondev.m4 b/m4macros/pythondev.m4
index 6a01cf6a74..067a84dbca 100644
--- a/m4macros/pythondev.m4
+++ b/m4macros/pythondev.m4
@@ -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:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]