[PATCH 19/29] Convert netcf check to use LIBVIRT_CHECK_PKG

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 configure.ac     | 42 ++----------------------------------------
 m4/virt-netcf.m4 | 23 +++++++++++++++++++++++
 2 files changed, 25 insertions(+), 40 deletions(-)
 create mode 100644 m4/virt-netcf.m4

diff --git a/configure.ac b/configure.ac
index 2232c5c..141d321 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,7 +101,6 @@ GNUTLS_REQUIRED="1.0.25"
 AVAHI_REQUIRED="0.6.0"
 POLKIT_REQUIRED="0.6"
 PARTED_REQUIRED="1.8.0"
-NETCF_REQUIRED="0.1.4"
 UDEV_REQUIRED=145
 PCIACCESS_REQUIRED=0.10.0
 XMLRPC_REQUIRED=1.14.0
@@ -152,6 +151,7 @@ LIBVIRT_CHECK_APPARMOR
 LIBVIRT_CHECK_AUDIT
 LIBVIRT_CHECK_CAPNG
 LIBVIRT_CHECK_LIBATTR
+LIBVIRT_CHECK_NETCF
 LIBVIRT_CHECK_NUMACTL
 LIBVIRT_CHECK_SANLOCK
 LIBVIRT_CHECK_SASL
@@ -1499,40 +1499,6 @@ if test "$with_qemu:$with_lxc:$with_network" != "no:no:no"; then
 fi
 AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"])
 
-dnl netcf library
-AC_ARG_WITH([netcf],
-  AC_HELP_STRING([--with-netcf], [libnetcf support to configure physical host network interfaces @<:@default=check@:>@]),
-[], [with_netcf=check])
-
-NETCF_CFLAGS=
-NETCF_LIBS=
-if test "$with_libvirtd" = "no" ; then
-  with_netcf=no
-fi
-if test "$with_netcf" = "yes" || test "$with_netcf" = "check"; then
-  PKG_CHECK_MODULES(NETCF, netcf >= $NETCF_REQUIRED,
-    [with_netcf=yes], [
-    if test "$with_netcf" = "check" ; then
-       with_netcf=no
-    else
-       AC_MSG_ERROR(
-         [You must install libnetcf >= $NETCF_REQUIRED to compile libvirt])
-    fi
-  ])
-  if test "$with_netcf" = "yes" ; then
-    AC_DEFINE_UNQUOTED([WITH_NETCF], 1,
-      [whether libnetcf is available to configure physical host network interfaces])
-    AC_CHECK_LIB([netcf], [ncf_change_begin], [netcf_transactions=1], [netcf_transactions=0])
-    if test "$netcf_transactions" = "1" ; then
-        AC_DEFINE_UNQUOTED([HAVE_NETCF_TRANSACTIONS], 1,
-          [we have sufficiently new version of netcf for transaction network API])
-    fi
-  fi
-fi
-AM_CONDITIONAL([WITH_NETCF], [test "$with_netcf" = "yes"])
-AC_SUBST([NETCF_CFLAGS])
-AC_SUBST([NETCF_LIBS])
-
 
 AC_ARG_WITH([secrets],
   AC_HELP_STRING([--with-secrets], [with local secrets management driver @<:@default=yes@:>@]),[],[with_secrets=yes])
@@ -2669,6 +2635,7 @@ LIBVIRT_RESULT_APPARMOR
 LIBVIRT_RESULT_AUDIT
 LIBVIRT_RESULT_CAPNG
 LIBVIRT_RESULT_LIBATTR
+LIBVIRT_RESULT_NETCF
 LIBVIRT_RESULT_NUMACTL
 LIBVIRT_RESULT_SANLOCK
 LIBVIRT_RESULT_SASL
@@ -2732,11 +2699,6 @@ AC_MSG_NOTICE([    udev: $UDEV_CFLAGS $UDEV_LIBS $PCIACCESS_CFLAGS $PCIACCESS_LI
 else
 AC_MSG_NOTICE([    udev: no])
 fi
-if test "$with_netcf" = "yes" ; then
-AC_MSG_NOTICE([   netcf: $NETCF_CFLAGS $NETCF_LIBS])
-else
-AC_MSG_NOTICE([   netcf: no])
-fi
 if test "$with_qemu" = "yes" && test "$LIBPCAP_FOUND" != "no"; then
 AC_MSG_NOTICE([    pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS])
 else
diff --git a/m4/virt-netcf.m4 b/m4/virt-netcf.m4
new file mode 100644
index 0000000..419beb2
--- /dev/null
+++ b/m4/virt-netcf.m4
@@ -0,0 +1,23 @@
+dnl The libnetcf.so library
+
+AC_DEFUN([LIBVIRT_CHECK_NETCF],[
+  LIBVIRT_CHECK_PKG([NETCF], [netcf], [netcf], [0.1.4])
+
+  if test "$with_netcf" = "yes" ; then
+    old_CFLAGS="$CFLAGS"
+    old_LIBS="$CFLAGS"
+    CFLAGS="$CFLAGS $NETCF_CFLAGS"
+    LIBS="$LIBS $NETCF_LIBS"
+    AC_CHECK_FUNC([ncf_change_begin], [netcf_transactions=1], [netcf_transactions=0])
+    if test "$netcf_transactions" = "1" ; then
+        AC_DEFINE_UNQUOTED([HAVE_NETCF_TRANSACTIONS], 1,
+          [we have sufficiently new version of netcf for transaction network API])
+    fi
+    CFLAGS="$old_CFLAGS"
+    LIBS="$old_LIBS"
+  fi
+])
+
+AC_DEFUN([LIBVIRT_RESULT_NETCF],[
+  LIBVIRT_RESULT_LIB([NETCF], [netcf])
+])
-- 
1.7.11.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]