]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
m4/virt-libxml: use only pkg-config to check for libxml2
authorPavel Hrdina <phrdina@redhat.com>
Mon, 19 Dec 2016 14:16:05 +0000 (15:16 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 21 Dec 2016 14:39:38 +0000 (15:39 +0100)
Pkg-config file libxml-2.0.pc was introduced in libxml2-2.2.4 and we
require at least 2.6.0 so the crazy xml2-config check can be dropped.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
m4/virt-libxml.m4

index 3e1c04f16748ef4962c6df0ca678b2a8361d2a85..6d3ae9a14ef3c32158121541102bc5b2911378db 100644 (file)
@@ -23,7 +23,6 @@ AC_DEFUN([LIBVIRT_ARG_LIBXML], [
 
 AC_DEFUN([LIBVIRT_CHECK_LIBXML], [
   LIBXML_REQUIRED="2.6.0"
-  LIBXML_CONFIG="xml2-config"
   LIBXML_CFLAGS=""
   LIBXML_LIBS=""
   LIBXML_FOUND="no"
@@ -35,24 +34,7 @@ AC_DEFUN([LIBVIRT_CHECK_LIBXML], [
     PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED, [LIBXML_FOUND=yes], [LIBXML_FOUND=no])
   fi
   if test "$LIBXML_FOUND" = "no" ; then
-    if test "x$with_libxml" != "xcheck" ; then
-      LIBXML_CONFIG=$with_libxml/bin/$LIBXML_CONFIG
-    fi
-    AC_MSG_CHECKING(libxml2 $LIBXML_CONFIG >= $LIBXML_REQUIRED )
-    if ! $LIBXML_CONFIG --version > /dev/null 2>&1 ; then
-      AC_MSG_ERROR([Could not find libxml2 anywhere (see config.log for details).])
-    fi
-    vers=`$LIBXML_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
-    minvers=`echo $LIBXML_REQUIRED | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
-    if test "$vers" -ge "$minvers" ; then
-      LIBXML_LIBS="`$LIBXML_CONFIG --libs`"
-      LIBXML_CFLAGS="`$LIBXML_CONFIG --cflags`"
-      LIBXML_FOUND="yes"
-      AC_MSG_RESULT(yes)
-    else
-      AC_MSG_ERROR(
-        [You need at least libxml2 $LIBXML_REQUIRED for this version of libvirt])
-    fi
+    AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt])
   fi
 
   AC_SUBST([LIBXML_CFLAGS])