Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
configure.ac | 24 +++-------------------
m4/virt-driver-network.m4 | 51 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 21 deletions(-)
create mode 100644 m4/virt-driver-network.m4
diff --git a/configure.ac b/configure.ac
index 50a7615400..5fe6ec3038 100644
--- a/configure.ac
+++ b/configure.ac
@@ -607,26 +607,8 @@ LIBVIRT_DRIVER_CHECK_PHYP
dnl check if the network driver should be compiled
-LIBVIRT_ARG_WITH_ALT([NETWORK], [with virtual network driver], [yes])
-
-dnl there's no use compiling the network driver without the libvirt
-dnl daemon, nor compiling it for MacOS X, where it breaks the compile
-
-if test "$with_libvirtd" = "no" || test "$with_osx" =
"yes"; then
- with_network=no
-fi
-
-if test "$with_network" = "yes" ; then
- AC_DEFINE_UNQUOTED([WITH_NETWORK], 1, [whether network driver is enabled])
-fi
-AM_CONDITIONAL([WITH_NETWORK], [test "$with_network" = "yes"])
-
-with_bridge=no
-if test "$with_qemu:$with_lxc:$with_network" != "no:no:no"; then
- with_bridge=yes
- AC_DEFINE_UNQUOTED([WITH_BRIDGE], 1, [whether bridge code is needed])
-fi
-AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"])
+LIBVIRT_DRIVER_ARG_NETWORK
+LIBVIRT_DRIVER_CHECK_NETWORK
LIBVIRT_ARG_WITH([SECRETS], [local secrets management driver], [yes])
@@ -1300,7 +1282,7 @@ LIBVIRT_DRIVER_RESULT_VZ
LIBVIRT_DRIVER_RESULT_BHYVE
LIBVIRT_DRIVER_RESULT_TEST
LIBVIRT_DRIVER_RESULT_REMOTE
-AC_MSG_NOTICE([ Network: $with_network])
+LIBVIRT_DRIVER_RESULT_NETWORK
LIBVIRT_DRIVER_RESULT_LIBVIRTD
AC_MSG_NOTICE([Interface: $with_interface])
AC_MSG_NOTICE([])
diff --git a/m4/virt-driver-network.m4 b/m4/virt-driver-network.m4
new file mode 100644
index 0000000000..ab7b9015ad
--- /dev/null
+++ b/m4/virt-driver-network.m4
@@ -0,0 +1,51 @@
+dnl The network driver
+dnl
+dnl Copyright (C) 2016 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_DRIVER_ARG_NETWORK], [
+ LIBVIRT_ARG_WITH_ALT([NETWORK], [with virtual network driver], [yes])
+])
+
+AC_DEFUN([LIBVIRT_DRIVER_CHECK_NETWORK], [
+ AC_REQUIRE([LIBVIRT_DRIVER_CHECK_LIBVIRTD])
+ AC_REQUIRE([LIBVIRT_DRIVER_CHECK_QEMU])
+ AC_REQUIRE([LIBVIRT_DRIVER_CHECK_LXC])
+
+ dnl there's no use compiling the network driver without the libvirt
+ dnl daemon, nor compiling it for MacOS X, where it breaks the compile
+
+ if test "$with_libvirtd" = "no" || test "$with_osx" =
"yes"; then
+ with_network=no
+ fi
+
+ if test "$with_network" = "yes" ; then
+ AC_DEFINE_UNQUOTED([WITH_NETWORK], 1, [whether network driver is enabled])
+ fi
+ AM_CONDITIONAL([WITH_NETWORK], [test "$with_network" = "yes"])
+
+ with_bridge=no
+ if test "$with_qemu:$with_lxc:$with_network" != "no:no:no"; then
+ with_bridge=yes
+ AC_DEFINE_UNQUOTED([WITH_BRIDGE], 1, [whether bridge code is needed])
+ fi
+ AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"])
+])
+
+AC_DEFUN([LIBVIRT_DRIVER_RESULT_NETWORK], [
+ LIBVIRT_RESULT([Network], [$with_network])
+])
--
2.11.0