python: Recognize python-X.Y-embed flavor introduced with Python 3.8 in Debian
authorHilko Bengen <bengen@debian.org>
Fri, 10 Jan 2020 23:15:24 +0000 (00:15 +0100)
committerHilko Bengen <bengen@debian.org>
Sun, 30 Aug 2020 21:34:05 +0000 (22:34 +0100)
The non-"embed" .pc file does not include linker instructions. See
Debian bug #948017

Gbp-Pq: Name 0017-python-Recognize-python-X.Y-embed-flavor-introduced-.patch

m4/guestfs-python.m4

index 3210c49bd170ad2045ace73b3c009ceca4b950a8..227f31cd0b4996f5ee0dd243b7b240b9217e0f88 100644 (file)
@@ -38,23 +38,30 @@ AS_IF([test "x$enable_python" != "xno"],[
            AC_MSG_ERROR([found Python $PYTHON_VERSION, while Python $PYTHON_REQ_MAJOR.$PYTHON_REQ_MINOR is required])
         ])
        AC_MSG_RESULT([$PYTHON_VERSION])
-
-        # Debian: python-2.7.pc, python-3.2.pc
-        PKG_CHECK_MODULES([PYTHON], [python-"$PYTHON_VERSION"],[
+        # Debian: python-2.7.pc, python-3.2.pc. But also: python-3.8-embed.pc
+        PKG_CHECK_MODULES([PYTHON], [python-"$PYTHON_VERSION"-embed],[
             have_python_module=1
             AC_SUBST([PYTHON_CFLAGS])
             AC_SUBST([PYTHON_LIBS])
             AC_SUBST([PYTHON_VERSION])
             AC_DEFINE([HAVE_PYTHON],[1],[Python library found at compile time])
         ],[
-            PKG_CHECK_MODULES([PYTHON], [python],[
+            PKG_CHECK_MODULES([PYTHON], [python-"$PYTHON_VERSION"],[
                 have_python_module=1
                 AC_SUBST([PYTHON_CFLAGS])
                 AC_SUBST([PYTHON_LIBS])
                 AC_SUBST([PYTHON_VERSION])
                 AC_DEFINE([HAVE_PYTHON],[1],[Python library found at compile time])
             ],[
-                AC_MSG_WARN([python $PYTHON_VERSION not found])
+                PKG_CHECK_MODULES([PYTHON], [python],[
+                    have_python_module=1
+                    AC_SUBST([PYTHON_CFLAGS])
+                    AC_SUBST([PYTHON_LIBS])
+                    AC_SUBST([PYTHON_VERSION])
+                    AC_DEFINE([HAVE_PYTHON],[1],[Python library found at compile time])
+                ],[
+                    AC_MSG_WARN([python $PYTHON_VERSION not found])
+                ])
             ])
         ])