From: Florian Forster Date: Thu, 8 Nov 2007 07:25:10 +0000 (+0100) Subject: configure.in: Change the libvirt detection so it works with my non-standard path. X-Git-Tag: collectd-4.3.0beta0~112 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=df26df90820a743c9b28bd2c27a4b00c96742b31;p=collectd.git configure.in: Change the libvirt detection so it works with my non-standard path. --- diff --git a/configure.in b/configure.in index 362c1df8..8838b5d6 100644 --- a/configure.in +++ b/configure.in @@ -1618,10 +1618,36 @@ AC_CHECK_LIB(xml2,xmlXPathEval, [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