[Libvirt-cim] [PATCH 3 of 5] Make libxml2 check use pkg-config as well

Dan Smith danms at us.ibm.com
Fri Dec 7 17:01:05 UTC 2007


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1196982080 28800
# Node ID d54e71e6c9e2729d8ce7a5074a1ac50dc0dddb40
# Parent  19fe21b48ba3b5841b80a3a6cccdefd6f3ea5e8d
Make libxml2 check use pkg-config as well

Signed-off-by: Dan Smith <danms at us.ibm.com>

diff -r 19fe21b48ba3 -r d54e71e6c9e2 acinclude.m4
--- a/acinclude.m4	Thu Dec 06 15:01:17 2007 -0800
+++ b/acinclude.m4	Thu Dec 06 15:01:20 2007 -0800
@@ -221,43 +221,12 @@ AC_DEFUN([CHECK_CIMSERVER],
 	]
 )
 
-dnl
-dnl The check for the libxml2 library
-dnl Sets the LIBXML2DIR variable
-dnl
-
-AC_DEFUN([_CHECK_LIBXML2],
-[
-   AC_MSG_CHECKING($1)
-   AC_TRY_LINK(
-   [
-      #include <libxml/tree.h>
-   ],
-   [
-      xmlNodePtr nodeptr;
-   ],
-   [
-      have_LIBXML2=yes
-      dnl AC_MSG_RESULT(yes)
-   ],
-   [
-      have_LIBXML2=no
-      dnl AC_MSG_RESULT(no)
-   ])
-])
-
 AC_DEFUN([CHECK_LIBXML2],
 	[
-	AC_MSG_CHECKING(for libxml2 package)
-	CPPFLAGS="$CPPFLAGS `xml2-config --cflags` "
-	LDFLAGS="$LDFLAGS `xml2-config --libs` "
-	dnl The standard include paths worked.
-	_CHECK_LIBXML2(standard)	
-	if test "$have_LIBXML2" == "no"; then
-        	AC_MSG_ERROR(no. The required libxml2 package is missing.)
-	fi 
-	]
-)
+	PKG_CHECK_MODULES([LIBXML], [libxml-2.0])
+	CPPFLAGS="$CPPFLAGS $LIBXML_CFLAGS"
+	LDFLAGS="$LDFLAGS $LIBXML_LDFLAGS"
+	])
 
 AC_DEFUN([CHECK_LIBCU],
 	[




More information about the Libvirt-cim mailing list