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

[Libguestfs] [PATCH 7/9] python: fix detection of libpython features



Instead of querying distutils.sysconfig for the library name, just use
the $PYTHON_LIBS returned by pkg-config.  This makes sure the tests can
link even with a libpython in a non-standard library directory.
---
 configure.ac | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index 87e066c..1bf291c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1216,20 +1216,14 @@ AS_IF([test "x$enable_python" != "xno"],[
         AC_MSG_RESULT([$PYTHON_EXT_SUFFIX])
 
         dnl Look for some optional symbols in libpython.
-        old_LIBS="$LIBS"
-
-        PYTHON_BLDLIBRARY=`$PYTHON -c "import distutils.sysconfig; \
-                                       print (distutils.sysconfig.get_config_var('BLDLIBRARY'))"`
         AC_CHECK_LIB([c],[PyCapsule_New],
                      [AC_DEFINE([HAVE_PYCAPSULE_NEW],1,
                                 [Found PyCapsule_New in libpython.])],
-                     [],[$PYTHON_BLDLIBRARY])
+                     [],[$PYTHON_LIBS])
         AC_CHECK_LIB([c],[PyString_AsString],
                      [AC_DEFINE([HAVE_PYSTRING_ASSTRING],1,
                                 [Found PyString_AsString in libpython.])],
-                     [],[$PYTHON_BLDLIBRARY])
-
-        LIBS="$old_LIBS"
+                     [],[$PYTHON_LIBS])
     fi
 
     AC_SUBST(PYTHON_PREFIX)
-- 
1.9.3


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