X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=configure.ac;h=81bcbb5c33ab39de4abe0f421f7e2a6cb4ad667b;hb=a31bebe46fbf4fde1ab4f39ae349a6e9497fb706;hp=d1b1c108f027ff6690e7aafb2c8a29f2e6680845;hpb=3814680423984b3c46c2f99e944c2a71862bde9f;p=libguestfs.git diff --git a/configure.ac b/configure.ac index d1b1c10..81bcbb5 100644 --- a/configure.ac +++ b/configure.ac @@ -19,8 +19,8 @@ # add extra information using --with-extra="..." which may be any # freeform string. m4_define([libguestfs_major], [1]) -m4_define([libguestfs_minor], [13]) -m4_define([libguestfs_release], [23]) +m4_define([libguestfs_minor], [14]) +m4_define([libguestfs_release], [1]) AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release) AC_CONFIG_AUX_DIR([build-aux]) @@ -713,7 +713,9 @@ AS_IF([test "x$enable_python" != "xno"], AC_MSG_RESULT([$PYTHON_PREFIX]) AC_MSG_CHECKING([Python version]) - PYTHON_VERSION=`$PYTHON -c "import sys; print (sys.version[[0:3]])"` + PYTHON_VERSION_MAJOR=`$PYTHON -c "import sys; print (sys.version_info.major)"` + PYTHON_VERSION_MINOR=`$PYTHON -c "import sys; print (sys.version_info.minor)"` + PYTHON_VERSION="$PYTHON_VERSION_MAJOR.$PYTHON_VERSION_MINOR" AC_MSG_RESULT([$PYTHON_VERSION]) AC_MSG_CHECKING([for Python include path]) @@ -741,9 +743,19 @@ AS_IF([test "x$enable_python" != "xno"], AC_MSG_RESULT([$PYTHON_INSTALLDIR]) fi + dnl Look for libpython and some optional symbols in it. old_LIBS="$LIBS" - LIBS="$LIBS -lpython$PYTHON_VERSION" - AC_CHECK_FUNCS([PyCapsule_New]) + if test "x$PYTHON_VERSION_MAJOR" = "x3"; then + dnl libpython3 is called "libpython3.Xmu.so" + LIBPYTHON="python${PYTHON_VERSION}mu" + else + LIBPYTHON="python$PYTHON_VERSION" + fi + AC_CHECK_LIB([$LIBPYTHON], [PyList_Size], [], + [AC_MSG_FAILURE([$LIBPYTHON is not installed])]) + + AC_CHECK_FUNCS([PyCapsule_New \ + PyString_AsString]) LIBS="$old_LIBS" fi