[gimp/gimp-2-10] m4macros: fix pythondev.m4.



commit 0e8cdd0f74d4d5ab0f67058f7f365a8ddab46761
Author: Jehan <jehan girinstud io>
Date:   Tue Aug 6 19:06:27 2019 +0200

    m4macros: fix pythondev.m4.
    
    My previous commit was bugged. Fix it and simplify the code a bit. No
    need to check for existence for non-versionned include directory on
    Windows. Just add the non-versionned dirs at the end, without other
    condition that the target platform being Windows. This way, whether the
    headers are installed in the versionned or non-versionned dirs, they
    will be found.

 m4macros/pythondev.m4 | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/m4macros/pythondev.m4 b/m4macros/pythondev.m4
index 067a84dbca..d4a02f5507 100644
--- a/m4macros/pythondev.m4
+++ b/m4macros/pythondev.m4
@@ -222,16 +222,16 @@ AC_MSG_CHECKING(for headers required to compile python extensions)
 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}"
+PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
 if test "$py_prefix" != "$py_exec_prefix"; then
-  py_versiondir="${py_exec_prefix}/include/python${PYTHON_VERSION}"
-  dnl Win32 doesn't always have a versioned directory for headers
+  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
   if test "$PYTHON_PLATFORM" = "win32"; then
-    if test -d "${py_versiondir}" ; then
-        py_versiondir=${py_exec_prefix}/include
-    fi
+    dnl Win32 doesn't always have a versioned directory for headers
+    PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include"
   fi
-  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_versiondir}"
+fi
+if test "$PYTHON_PLATFORM" = "win32"; then
+  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_prefix}/include"
 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]