[PATCH glib] Fix check for libvirt optional functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The checks for virDomainOpenGraphicsFD and
virNetworkGetDHCPLeases in configure are simply trying
to compile and link a test program. This was assuming
that libvirt was installed in /usr/lib & /usr/include,
which is not always the case. Using a pkg-config version
check avoids needing to compile and thus avoids the
bad assumptions about install locations.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---

Pushed as a broken build fix

 configure.ac | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index f71e5cf..b2848f2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -92,13 +92,19 @@ LIBVIRT_GLIB_COMPILE_WARNINGS
 
 PKG_CHECK_MODULES(LIBVIRT, libvirt >= $LIBVIRT_REQUIRED)
 # virDomainOpenGraphicsFD was introduced in libvirt 1.2.8
-AC_CHECK_LIB([virt],
-             [virDomainOpenGraphicsFD],
-             [AC_DEFINE([HAVE_VIR_DOMAIN_OPEN_GRAPHICS_FD], 1, [Have virDomainOpenGraphicsFD?])])
+AC_MSG_CHECKING([for virDomainOpenGraphicsFD])
+PKG_CHECK_EXISTS(libvirt >= 21.2.8,
+                 [
+		   AC_DEFINE([HAVE_VIR_DOMAIN_OPEN_GRAPHICS_FD], 1, [Have virDomainOpenGraphicsFD?])
+		   AC_MSG_RESULT([yes])
+		 ],[AC_MSG_RESULT([no])])
 # virNetworkGetDHCPLeases was introduced in libvirt 1.2.6
-AC_CHECK_LIB([virt],
-             [virNetworkGetDHCPLeases],
-             [AC_DEFINE([HAVE_VIR_NETWORK_GET_DHCP_LEASES], 1, [Have virNetworkGetDHCPLeases?])])
+AC_MSG_CHECKING([for virNetworkGetDHCPLeases])
+PKG_CHECK_EXISTS(libvirt >= 21.2.6,
+                 [
+		   AC_DEFINE([HAVE_VIR_NETWORK_GET_DHCP_LEASES], 1, [Have virNetworkGetDHCPLeases?])
+		   AC_MSG_RESULT([yes])
+		 ],[AC_MSG_RESULT([no])])
 enable_tests=no
 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_TEST_REQUIRED,
                   [enable_tests=yes],
-- 
2.7.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]