summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d21209f)
raw | patch | inline | side by side (parent: d21209f)
author | Florian Forster <octo@huhu.verplant.org> | |
Thu, 8 Nov 2007 07:25:10 +0000 (08:25 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Thu, 8 Nov 2007 07:25:10 +0000 (08:25 +0100) |
configure.in | patch | blob | history |
diff --git a/configure.in b/configure.in
index 362c1df8da040fcfec78648202b75e9a9bc421a7..8838b5d66fc6a92c6a455257eef7ee9dc166945b 100644 (file)
--- a/configure.in
+++ b/configure.in
[with_libxml2="no"])
with_libvirt="no"
-if test "x$with_libxml2" = "xyes"; then
- AC_CHECK_LIB(virt,virDomainBlockStats,
- [with_libvirt="yes"],
- [with_libvirt="no (symbol virDomainBlockStats not found)"])
+with_libvirt_cflags=""
+with_libvirt_ldflags=""
+if test "x$with_libxml2" = "xyes"
+then
+ with_libvirt="yes"
+ with_libvirt_cflags="`pkg-config --cflags libvirt`"
+ if test $? -ne 0
+ then
+ with_libvirt="no"
+ fi
+ with_libvirt_ldflags="`pkg-config --libs libvirt`"
+ if test $? -ne 0
+ then
+ with_libvirt="no"
+ fi
+fi
+if test "x$with_libvirt" = "xyes"
+then
+ SAVE_CFLAGS="$CFLAGS"
+ SAVE_LD_FLAGS="$LDFLAGS"
+
+ CFLAGS="$CFLAGS $with_libvirt_cflags"
+ LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
+
+ AC_CHECK_LIB(virt,virDomainBlockStats,
+ [with_libvirt="yes"],
+ [with_libvirt="no (symbol virDomainBlockStats not found)"])
+
+ CFLAGS="$SAVE_CFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
fi
dnl Add the right compiler flags and libraries.
if test "x$with_libvirt" = "xyes"; then