[virt-tools-list] [PATCH glib] Fix check for libvirt optional functions

Christophe Fergeau cfergeau at redhat.com
Thu Jul 28 12:36:54 UTC 2016


On Thu, Jul 28, 2016 at 01:30:12PM +0100, Daniel P. Berrange wrote:
> 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 at redhat.com>
> ---
> 
> 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,

s/21/1

> +                 [
> +		   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,

Ditto

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20160728/dd1ec983/attachment.sig>


More information about the virt-tools-list mailing list