]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: add network driver build option
authorPavel Hrdina <phrdina@redhat.com>
Thu, 30 Apr 2020 11:35:50 +0000 (13:35 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:00 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
configure.ac
m4/virt-driver-network.m4 [deleted file]
meson.build
meson_options.txt

index 771242e39fdd4b28101243d5a7960ededff05e9b..2740a9f4a50690e245cb1412c42e67f3541f1e71 100644 (file)
@@ -97,10 +97,8 @@ dnl
 dnl Virtualization drivers check
 dnl
 
-LIBVIRT_DRIVER_ARG_NETWORK
 LIBVIRT_DRIVER_ARG_INTERFACE
 
-LIBVIRT_DRIVER_CHECK_NETWORK
 LIBVIRT_DRIVER_CHECK_INTERFACE
 
 
@@ -285,7 +283,6 @@ AC_MSG_NOTICE([=====================])
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Drivers])
 AC_MSG_NOTICE([])
-LIBVIRT_DRIVER_RESULT_NETWORK
 LIBVIRT_DRIVER_RESULT_INTERFACE
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Storage Drivers])
diff --git a/m4/virt-driver-network.m4 b/m4/virt-driver-network.m4
deleted file mode 100644 (file)
index b98ce07..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-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([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, where it breaks the compile
-
-  if test "$with_libvirtd" = "no" || test "$with_macos" = "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])
-])
index f85ce4e26dfa6c411a223307d68435fb3d9d1d74..fb6f0d5dd456b4173b6cfe9a42333c4bc870e7b4 100644 (file)
@@ -1701,6 +1701,12 @@ elif get_option('driver_lxc').enabled()
   error('linux and remote_driver are required for LXC')
 endif
 
+# there's no use compiling the network driver without the libvirt
+# daemon, nor compiling it for macOS, where it breaks the compile
+if not get_option('driver_network').disabled() and conf.has('WITH_LIBVIRTD') and host_machine.system() != 'darwin'
+  conf.set('WITH_NETWORK', 1)
+endif
+
 if not get_option('driver_openvz').disabled() and host_machine.system() == 'linux'
   conf.set('WITH_OPENVZ', 1)
 elif get_option('driver_openvz').enabled()
@@ -1854,6 +1860,10 @@ elif get_option('secdriver_selinux').enabled()
   error('You must install the libselinux development package in order to compile libvirt.')
 endif
 
+if conf.has('WITH_QEMU') or conf.has('WITH_LXC') or conf.has('WITH_NETWORK')
+  conf.set('WITH_BRIDGE', 1)
+endif
+
 
 # define top include directory
 
@@ -1886,6 +1896,7 @@ driver_summary = {
   'Bhyve': conf.has('WITH_BHYVE'),
   'Test': conf.has('WITH_TEST'),
   'Remote': conf.has('WITH_REMOTE'),
+  'Network': conf.has('WITH_NETWORK'),
   'Libvirtd': conf.has('WITH_LIBVIRTD'),
 }
 summary(driver_summary, section: 'Drivers', bool_yn: true)
index fcf3b263cc8b5f6da30b3af798811b57f2d2aba7..6ef11e82dd706146df9756b3ff7f8db918561bc6 100644 (file)
@@ -54,6 +54,7 @@ option('driver_hyperv', type: 'feature', value: 'auto', description: 'Hyper-V dr
 option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver')
 option('driver_libxl', type: 'feature', value: 'auto', description: 'libxenlight driver')
 option('driver_lxc', type: 'feature', value: 'auto', description: 'Linux Container driver')
+option('driver_network', type: 'feature', value: 'auto', description: 'virtual network driver')
 option('driver_openvz', type: 'feature', value: 'auto', description: 'OpenVZ driver')
 option('driver_qemu', type: 'feature', value: 'auto', description: 'QEMU/KVM driver')
 option('qemu_user', type: 'string', value: '', description: 'username to run QEMU system instance as')