meson: add network driver build option

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-04-30 13:35:50 +02:00
parent d6b6ee9ad4
commit 67f8f99dc0
4 changed files with 12 additions and 54 deletions

View 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])

View File

@ -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])
])

View 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)

View 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')