]> xenbits.xensource.com Git - libvirt.git/commitdiff
configure: move network driver check to its own file
authorPavel Hrdina <phrdina@redhat.com>
Thu, 1 Dec 2016 11:02:30 +0000 (12:02 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 21 Dec 2016 14:39:42 +0000 (15:39 +0100)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
configure.ac
m4/virt-driver-network.m4 [new file with mode: 0644]

index 2e2293a646d9c87f3d0899a91a94bc6e4fff0a0e..436a108dc7788650c96ca89df920bfd38bbb6f31 100644 (file)
@@ -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 (file)
index 0000000..ab7b901
--- /dev/null
@@ -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])
+])