]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Convert openwsman check to use LIBVIRT_CHECK_PKG
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 8 Jan 2013 22:08:53 +0000 (22:08 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 14 Jan 2013 13:29:54 +0000 (13:29 +0000)
configure.ac
m4/virt-openwsman.m4 [new file with mode: 0644]

index 25ad5a9b764162b5d77d3ca28ae3b7553af28aa1..14a70ad2d558ec5446bf9ef51c0154c80f4aecba 100644 (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
diff --git a/m4/virt-openwsman.m4 b/m4/virt-openwsman.m4
new file mode 100644 (file)
index 0000000..8ab18c6
--- /dev/null
@@ -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])
+])