Convert openwsman check to use LIBVIRT_CHECK_PKG

This commit is contained in:
Daniel P. Berrange 2013-01-08 22:08:53 +00:00
parent 0eec69729d
commit a99bfb4b5e
2 changed files with 39 additions and 18 deletions

View File

@ -102,7 +102,6 @@ POLKIT_REQUIRED="0.6"
PARTED_REQUIRED="1.8.0"
XMLRPC_REQUIRED=1.14.0
DEVMAPPER_REQUIRED=1.0.0
OPENWSMAN_REQUIRED="2.2.3"
LIBPCAP_REQUIRED="1.0.0"
LIBNL_REQUIRED="1.1"
@ -155,6 +154,7 @@ LIBVIRT_CHECK_FUSE
LIBVIRT_CHECK_HAL
LIBVIRT_CHECK_NETCF
LIBVIRT_CHECK_NUMACTL
LIBVIRT_CHECK_OPENWSMAN
LIBVIRT_CHECK_PCIACCESS
LIBVIRT_CHECK_SANLOCK
LIBVIRT_CHECK_SASL
@ -1850,25 +1850,19 @@ AC_SUBST([LIBCURL_LIBS])
dnl
dnl check for openwsman (Hyper-V)
dnl check for Hyper-V
dnl
OPENWSMAN_CFLAGS=""
OPENWSMAN_LIBS=""
if test "$with_hyperv" = "yes" || test "$with_hyperv" = "check"; then
PKG_CHECK_MODULES([OPENWSMAN], [openwsman >= $OPENWSMAN_REQUIRED], [
if test "$with_hyperv" = "check"; then
with_hyperv=yes
fi
], [
if test "$with_hyperv" = "check"; then
with_hyperv=no
AC_MSG_NOTICE([openwsman is required for the Hyper-V driver, disabling it])
elif test "$with_hyperv" = "yes"; then
AC_MSG_ERROR([openwsman >= $OPENWSMAN_REQUIRED is required for the Hyper-V driver])
fi
])
if test "$with_hyperv" != "no"; then
if test "$with_openwsman" != "yes"; then
if test "$with_hyperv" = "check"; then
with_hyperv=no
else
AC_MSG_ERROR([openwsman is required for the Hyper-V driver])
fi
else
with_hyperv=yes
fi
fi
if test "$with_hyperv" = "yes" ; then
@ -2484,6 +2478,7 @@ LIBVIRT_RESULT_FUSE
LIBVIRT_RESULT_HAL
LIBVIRT_RESULT_NETCF
LIBVIRT_RESULT_NUMACTL
LIBVIRT_RESULT_OPENWSMAN
LIBVIRT_RESULT_PCIACCESS
LIBVIRT_RESULT_SANLOCK
LIBVIRT_RESULT_SASL

26
m4/virt-openwsman.m4 Normal file
View File

@ -0,0 +1,26 @@
dnl The libopenwsman.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_OPENWSMAN],[
LIBVIRT_CHECK_PKG([OPENWSMAN], [openwsman], [2.2.3])
])
AC_DEFUN([LIBVIRT_RESULT_OPENWSMAN],[
LIBVIRT_RESULT_LIB([OPENWSMAN])
])