[libvirt PATCH 00/15] various meson fixes and improvements

Pavel Hrdina (15): meson_options: change VMware default from enabled to auto meson_options: change VirtualBox default from enabled to auto meson_options: move firewalld options to build feature options meson: no need to call meson.get_compiler() again meson: properly handle libpcap if it's explicitly disabled meson: properly handle readline if it's explicitly disabled meson: build nodedev driver only if libvirtd is compiled meson: add libnl build option meson: add rbd build option meson: prefix kvm_dep, m_dep and util_dep with lib meson: add missing libraries to summary meson: remove required libraries from summary meson: move build feature options to miscellaneous summary meson: add docs option to enable/disable generating documentation meson: add tests build option to enable/disable unit tests libvirt.spec.in | 2 + meson.build | 135 +++++++++++++++++++++++++----------------- meson_options.txt | 12 ++-- src/bhyve/meson.build | 4 +- src/util/meson.build | 4 +- 5 files changed, 96 insertions(+), 61 deletions(-) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson_options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index 359fcf0a0b..49e418cc82 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -63,7 +63,7 @@ option('driver_secrets', type: 'feature', value: 'auto', description: 'local sec option('driver_test', type: 'feature', value: 'enabled', description: 'test driver') option('driver_vbox', type: 'feature', value: 'enabled', description: 'VirtualBox XPCOMC driver') option('vbox_xpcomc_dir', type: 'string', value: '', description: 'Location of directory containing VirtualBox XPCOMC library') -option('driver_vmware', type: 'feature', value: 'enabled', description: 'VMware driver') +option('driver_vmware', type: 'feature', value: 'auto', description: 'VMware driver') option('driver_vz', type: 'feature', value: 'auto', description: 'Virtuozzo driver') option('secdriver_apparmor', type: 'feature', value: 'auto', description: 'use AppArmor security driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson_options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index 49e418cc82..fafc0d72be 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -61,7 +61,7 @@ option('driver_remote', type: 'feature', value: 'enabled', description: 'remote option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode') option('driver_secrets', type: 'feature', value: 'auto', description: 'local secrets management driver') option('driver_test', type: 'feature', value: 'enabled', description: 'test driver') -option('driver_vbox', type: 'feature', value: 'enabled', description: 'VirtualBox XPCOMC driver') +option('driver_vbox', type: 'feature', value: 'auto', description: 'VirtualBox XPCOMC driver') option('vbox_xpcomc_dir', type: 'string', value: '', description: 'Location of directory containing VirtualBox XPCOMC library') option('driver_vmware', type: 'feature', value: 'auto', description: 'VMware driver') option('driver_vz', type: 'feature', value: 'auto', description: 'Virtuozzo driver') -- 2.26.2

These options don't check for any external libraries, they only enable libvirt features. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson_options.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index fafc0d72be..36aa763526 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -18,8 +18,6 @@ option('bash_completion_dir', type: 'string', value: '', description: 'directory option('blkid', type: 'feature', value: 'auto', description: 'blkid support') option('capng', type: 'feature', value: 'auto', description: 'cap-ng support') option('curl', type: 'feature', value: 'auto', description: 'curl support') -option('firewalld', type: 'feature', value: 'auto', description: 'firewalld support') -option('firewalld_zone', type: 'feature', value: 'auto', description: 'whether to install firewalld libvirt zone') option('fuse', type: 'feature', value: 'auto', description: 'fuse support') option('glusterfs', type: 'feature', value: 'auto', description: 'glusterfs support') option('libiscsi', type: 'feature', value: 'auto', description: 'libiscsi support') @@ -90,6 +88,8 @@ option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS backend # build feature options option('chrdev_lock_files', type: 'string', value: '', description: 'location for UUCP style lock files for character devices (leave empty for default paths on some platforms)') option('dtrace', type: 'feature', value: 'auto', description: 'use dtrace for static probing') +option('firewalld', type: 'feature', value: 'auto', description: 'firewalld support') +option('firewalld_zone', type: 'feature', value: 'auto', description: 'whether to install firewalld libvirt zone') option('host_validate', type: 'feature', value: 'auto', description: 'build virt-host-validate') option('init_script', type: 'combo', choices: ['systemd', 'openrc', 'check', 'none'], value: 'check', description: 'Style of init script to install') option('loader_nvram', type: 'string', value: '', description: 'Pass list of pairs of <loader>:<nvram> paths. Both pairs and list items are separated by a colon.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/meson.build b/meson.build index a5ce8e17a8..48d0d00288 100644 --- a/meson.build +++ b/meson.build @@ -1153,7 +1153,6 @@ endif libxml_version = '2.9.1' libxml_dep = dependency('libxml-2.0', version: '>=' + libxml_version) -cc = meson.get_compiler('c') m_dep = cc.find_library('m', required : false) netcf_version = '0.1.8' -- 2.26.2

If libpcap is detected using pkg-config it would ignore the libpcap option. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 48d0d00288..0941be8136 100644 --- a/meson.build +++ b/meson.build @@ -1101,17 +1101,22 @@ if libparted_dep.found() endif libpcap_version = '1.5.0' -libpcap_dep = dependency('libpcap', version: '>=' + libpcap_version, required: false) -if not libpcap_dep.found() - pcap_config_prog = find_program('pcap-config', required: get_option('libpcap')) - if pcap_config_prog.found() - pcap_args = run_command(pcap_config_prog, '--cflags').stdout().strip().split() - pcap_libs = run_command(pcap_config_prog, '--libs').stdout().strip().split() - libpcap_dep = declare_dependency( - compile_args: pcap_args, - link_args: pcap_libs, - ) +if not get_option('libpcap').disabled() + libpcap_dep = dependency('libpcap', version: '>=' + libpcap_version, required: false) + + if not libpcap_dep.found() + pcap_config_prog = find_program('pcap-config', required: get_option('libpcap')) + if pcap_config_prog.found() + pcap_args = run_command(pcap_config_prog, '--cflags').stdout().strip().split() + pcap_libs = run_command(pcap_config_prog, '--libs').stdout().strip().split() + libpcap_dep = declare_dependency( + compile_args: pcap_args, + link_args: pcap_libs, + ) + endif endif +else + libpcap_dep = dependency('', required: false) endif if libpcap_dep.found() conf.set('WITH_LIBPCAP', 1) -- 2.26.2

If readline is detected using pkg-config it would ignore the readline option. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index 0941be8136..c1f56e8fdb 100644 --- a/meson.build +++ b/meson.build @@ -1243,26 +1243,30 @@ endif # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' -readline_dep = dependency('readline', version: '>=' + readline_version, required: false) -if not readline_dep.found() - readline_dep = cc.find_library('readline', required: get_option('readline')) +if not get_option('readline').disabled() + readline_dep = dependency('readline', version: '>=' + readline_version, required: false) + if not readline_dep.found() + readline_dep = cc.find_library('readline', required: get_option('readline')) - if readline_dep.found() - # This variable is present in all reasonable (5.0+) readline versions; - # however, the macOS base system contains a library called libedit which - # takes over the readline name despite lacking many of its features. We - # want to make sure we only enable readline support when linking against - # the actual readline library, and the availability of this specific - # variable is as good a witness for that fact as any. - correct_rl = cc.has_header_symbol('readline/readline.h', 'rl_completion_quote_character', prefix: '#include <stdio.h>') - if not correct_rl - if get_option('readline').enabled() - error('readline is missing rl_completion_quote_character') - else - readline_dep = dependency('', required: false) + if readline_dep.found() + # This variable is present in all reasonable (5.0+) readline versions; + # however, the macOS base system contains a library called libedit which + # takes over the readline name despite lacking many of its features. We + # want to make sure we only enable readline support when linking against + # the actual readline library, and the availability of this specific + # variable is as good a witness for that fact as any. + correct_rl = cc.has_header_symbol('readline/readline.h', 'rl_completion_quote_character', prefix: '#include <stdio.h>') + if not correct_rl + if get_option('readline').enabled() + error('readline is missing rl_completion_quote_character') + else + readline_dep = dependency('', required: false) + endif endif endif endif +else + readline_dep = dependency('', required: false) endif if readline_dep.found() # Gross kludge for readline include path obtained through pkg-config. -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c1f56e8fdb..bb01731264 100644 --- a/meson.build +++ b/meson.build @@ -1678,7 +1678,7 @@ if not get_option('driver_network').disabled() and conf.has('WITH_LIBVIRTD') and conf.set('WITH_NETWORK', 1) endif -if udev_dep.found() +if udev_dep.found() and conf.has('WITH_LIBVIRTD') conf.set('WITH_NODE_DEVICES', 1) endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- libvirt.spec.in | 1 + meson.build | 8 +++++--- meson_options.txt | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index c0d84c0e75..7c4ccaa659 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1168,6 +1168,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) -Dyajl=enabled \ %{?arg_sanlock} \ -Dlibpcap=enabled \ + -Dlibnl=enabled \ -Daudit=enabled \ -Ddtrace=enabled \ %{?arg_firewalld} \ diff --git a/meson.build b/meson.build index bb01731264..b6e0b1cb76 100644 --- a/meson.build +++ b/meson.build @@ -1075,9 +1075,9 @@ libiscsi_version = '1.18.0' libiscsi_dep = dependency('libiscsi', version: '>=' + libiscsi_version, required: get_option('libiscsi')) libnl_version = '3.0' -if host_machine.system() == 'linux' - libnl_dep = dependency('libnl-3.0', version: '>=' + libnl_version, required: false) - libnl_route_dep = dependency('libnl-route-3.0', version: '>=' + libnl_version, required: false) +if not get_option('libnl').disabled() and host_machine.system() == 'linux' + libnl_dep = dependency('libnl-3.0', version: '>=' + libnl_version, required: get_option('libnl')) + libnl_route_dep = dependency('libnl-route-3.0', version: '>=' + libnl_version, required: get_option('libnl')) if libnl_dep.found() and libnl_route_dep.found() libnl_dep = declare_dependency( @@ -1085,6 +1085,8 @@ if host_machine.system() == 'linux' ) conf.set('WITH_LIBNL', 1) endif +elif get_option('libnl').enabled() + error('libnl can be enabled only on linux') else libnl_dep = dependency('', required: false) endif diff --git a/meson_options.txt b/meson_options.txt index 36aa763526..b3f4d7744f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -21,6 +21,7 @@ option('curl', type: 'feature', value: 'auto', description: 'curl support') option('fuse', type: 'feature', value: 'auto', description: 'fuse support') option('glusterfs', type: 'feature', value: 'auto', description: 'glusterfs support') option('libiscsi', type: 'feature', value: 'auto', description: 'libiscsi support') +option('libnl', type: 'feature', value: 'auto', description: 'libnl support') option('libpcap', type: 'feature', value: 'auto', description: 'libpcap support') option('libssh', type: 'feature', value: 'auto', description: 'libssh support') option('libssh2', type: 'feature', value: 'auto', description: 'libssh2 support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 26 +++++++++++++++++--------- meson_options.txt | 1 + 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/meson.build b/meson.build index b6e0b1cb76..af82f37d32 100644 --- a/meson.build +++ b/meson.build @@ -1228,17 +1228,25 @@ else pkcheck_prog = dependency('', required: false) endif -rbd_dep = cc.find_library('rbd', required: false) -rados_dep = cc.find_library('rados', required: false) -if rbd_dep.found() and not cc.has_function('rbd_get_features', dependencies: rbd_dep) - rbd_dep = dependency('', required: false) -endif -if rbd_dep.found() and rados_dep.found() - if cc.has_function('rbd_list2', dependencies: rbd_dep) - conf.set('WITH_RBD_LIST2', 1) +if not get_option('rbd').disabled() + rbd_dep = cc.find_library('rbd', required: get_option('rbd')) + rados_dep = cc.find_library('rados', required: get_option('rbd')) + + if rbd_dep.found() and not cc.has_function('rbd_get_features', dependencies: rbd_dep) + if get_option('rbd').enabled() + error('rbd is missing rbd_get_features') + else + rbd_dep = dependency('', required: false) + endif endif - rbd_dep = declare_dependency(dependencies: [ rbd_dep, rados_dep ]) + if rbd_dep.found() and rados_dep.found() + if cc.has_function('rbd_list2', dependencies: rbd_dep) + conf.set('WITH_RBD_LIST2', 1) + endif + + rbd_dep = declare_dependency(dependencies: [ rbd_dep, rados_dep ]) + endif else rbd_dep = dependency('', required: false) endif diff --git a/meson_options.txt b/meson_options.txt index b3f4d7744f..452fdab4d0 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -31,6 +31,7 @@ option('numactl', type: 'feature', value: 'auto', description: 'numactl support' option('openwsman', type: 'feature', value: 'auto', description: 'openwsman support') option('pciaccess', type: 'feature', value: 'auto', description: 'pciaccess support') option('polkit', type: 'feature', value: 'auto', description: 'use PolicyKit for UNIX socket access checks') +option('rbd', type: 'feature', value: 'auto', description: 'rbd support') option('readline', type: 'feature', value: 'auto', description: 'readline support') option('sanlock', type: 'feature', value: 'auto', description: 'sanlock support') option('sasl', type: 'feature', value: 'auto', description: 'sasl support') -- 2.26.2

On Thu, 2020-10-08 at 15:58 +0200, Pavel Hrdina wrote:
+++ b/meson_options.txt @@ -31,6 +31,7 @@ option('numactl', type: 'feature', value: 'auto', description: 'numactl support' option('openwsman', type: 'feature', value: 'auto', description: 'openwsman support') option('pciaccess', type: 'feature', value: 'auto', description: 'pciaccess support') option('polkit', type: 'feature', value: 'auto', description: 'use PolicyKit for UNIX socket access checks') +option('rbd', type: 'feature', value: 'auto', description: 'rbd support')
Shouldn't you add -Drbd=enabled to libvirt.spec.in now? -- Andrea Bolognani / Red Hat / Virtualization

On Thu, Oct 08, 2020 at 08:16:49PM +0200, Andrea Bolognani wrote:
On Thu, 2020-10-08 at 15:58 +0200, Pavel Hrdina wrote:
+++ b/meson_options.txt @@ -31,6 +31,7 @@ option('numactl', type: 'feature', value: 'auto', description: 'numactl support' option('openwsman', type: 'feature', value: 'auto', description: 'openwsman support') option('pciaccess', type: 'feature', value: 'auto', description: 'pciaccess support') option('polkit', type: 'feature', value: 'auto', description: 'use PolicyKit for UNIX socket access checks') +option('rbd', type: 'feature', value: 'auto', description: 'rbd support')
Shouldn't you add -Drbd=enabled to libvirt.spec.in now?
Actually there is no need to do that as %meson macro uses --auto-features=%{__meson_auto_features} where the default value of __meson_auto_features is enabled. So by default all auto features are enabled. But looking into the situation I'll drop the patch for now as it would break RPM build in cases where we don't build storage_rbd as we wrap build dependencies in a condition and we would have to do the same for -Drbd as we do for -Dstorage_rbd which doesn't make sense. I'll post a patch where we will reuse the storage_rbd option to figure out if we need to check for rbd libs or not and the same should be probably done for glusterfs and possibly some other libraries. With autotools we had separate options for the library and for the libvirt feature because we could pass a path to library but with meson this is not possible. You can use --pkg-config-path meson option or change env variables. Pavel

We don't use the lib prefix for all libraries but in these cases it makes sense to use the prefix. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 8 ++++---- src/bhyve/meson.build | 4 ++-- src/util/meson.build | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index af82f37d32..cd35756a8a 100644 --- a/meson.build +++ b/meson.build @@ -1066,9 +1066,9 @@ gnutls_dep = dependency('gnutls', version: '>=' + gnutls_version) # Check for BSD kvm (kernel memory interface) if host_machine.system() == 'freebsd' - kvm_dep = cc.find_library('kvm') + libkvm_dep = cc.find_library('kvm') else - kvm_dep = dependency('', required: false) + libkvm_dep = dependency('', required: false) endif libiscsi_version = '1.18.0' @@ -1160,7 +1160,7 @@ endif libxml_version = '2.9.1' libxml_dep = dependency('libxml-2.0', version: '>=' + libxml_version) -m_dep = cc.find_library('m', required : false) +libm_dep = cc.find_library('m', required : false) netcf_version = '0.1.8' netcf_dep = dependency('netcf', version: '>=' + netcf_version, required: get_option('netcf')) @@ -1380,7 +1380,7 @@ if udev_dep.found() conf.set('WITH_UDEV', 1) endif -util_dep = cc.find_library('util', required: false) +libutil_dep = cc.find_library('util', required: false) if host_machine.system() == 'windows' ole32_dep = cc.find_library('ole32') diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build index 975f93a9c0..2b65eecf5e 100644 --- a/src/bhyve/meson.build +++ b/src/bhyve/meson.build @@ -21,9 +21,9 @@ if conf.has('WITH_BHYVE') ], dependencies: [ access_dep, - kvm_dep, + libkvm_dep, + libutil_dep, src_dep, - util_dep, ], include_directories: [ conf_inc_dir, diff --git a/src/util/meson.build b/src/util/meson.build index 4d63173cbd..3b711b1dc2 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -187,13 +187,13 @@ virt_util_lib = static_library( devmapper_dep, gnutls_dep, intl_dep, + libm_dep, libnl_dep, - m_dep, + libutil_dep, numactl_dep, secdriver_dep, src_dep, thread_dep, - util_dep, win32_dep, yajl_dep, ], -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meson.build b/meson.build index cd35756a8a..e94025d315 100644 --- a/meson.build +++ b/meson.build @@ -2385,6 +2385,7 @@ libs_summary = { 'blkid': blkid_dep.found(), 'capng': capng_dep.found(), 'curl': curl_dep.found(), + 'devmapper': devmapper_dep.found(), 'dlopen': dlopen_dep.found(), 'firewalld': conf.has('WITH_FIREWALLD'), 'firewalld-zone': conf.has('WITH_FIREWALLD_ZONE'), @@ -2393,16 +2394,21 @@ libs_summary = { 'glusterfs': glusterfs_dep.found(), 'gnutls': gnutls_dep.found(), 'libiscsi': libiscsi_dep.found(), + 'libkvm': libkvm_dep.found(), + 'libm': libm_dep.found(), 'libnl': libnl_dep.found(), + 'libparted': libparted_dep.found(), 'libpcap': libpcap_dep.found(), 'libssh': libssh_dep.found(), 'libssh2': libssh2_dep.found(), + 'libutil': libutil_dep.found(), 'libxml': libxml_dep.found(), 'netcf': netcf_dep.found(), 'NLS': have_gnu_gettext_tools, 'nss': conf.has('WITH_NSS'), 'numactl': numactl_dep.found(), 'openwsman': openwsman_dep.found(), + 'parallels': parallels_sdk_dep.found(), 'pciaccess': pciaccess_dep.found(), 'pm_utils': conf.has('WITH_PM_UTILS'), 'polkit': conf.has('WITH_POLKIT'), -- 2.26.2

On Thu, Oct 08, 2020 at 08:16:59PM +0200, Andrea Bolognani wrote:
On Thu, 2020-10-08 at 15:59 +0200, Pavel Hrdina wrote:
+ 'parallels': parallels_sdk_dep.found(),
Should this be 'parallels-sdk'?
Sure, I'll change it before pushing. Pavel

These are always enabled so it doesn't make any sense to have the result in summary as meson will fail if they are missing. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 3 --- 1 file changed, 3 deletions(-) diff --git a/meson.build b/meson.build index e94025d315..5a99f59b0c 100644 --- a/meson.build +++ b/meson.build @@ -2390,9 +2390,7 @@ libs_summary = { 'firewalld': conf.has('WITH_FIREWALLD'), 'firewalld-zone': conf.has('WITH_FIREWALLD_ZONE'), 'fuse': fuse_dep.found(), - 'glib_dep': glib_dep.found(), 'glusterfs': glusterfs_dep.found(), - 'gnutls': gnutls_dep.found(), 'libiscsi': libiscsi_dep.found(), 'libkvm': libkvm_dep.found(), 'libm': libm_dep.found(), @@ -2402,7 +2400,6 @@ libs_summary = { 'libssh': libssh_dep.found(), 'libssh2': libssh2_dep.found(), 'libutil': libutil_dep.found(), - 'libxml': libxml_dep.found(), 'netcf': netcf_dep.found(), 'NLS': have_gnu_gettext_tools, 'nss': conf.has('WITH_NSS'), -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 5a99f59b0c..d53909948e 100644 --- a/meson.build +++ b/meson.build @@ -2387,8 +2387,6 @@ libs_summary = { 'curl': curl_dep.found(), 'devmapper': devmapper_dep.found(), 'dlopen': dlopen_dep.found(), - 'firewalld': conf.has('WITH_FIREWALLD'), - 'firewalld-zone': conf.has('WITH_FIREWALLD_ZONE'), 'fuse': fuse_dep.found(), 'glusterfs': glusterfs_dep.found(), 'libiscsi': libiscsi_dep.found(), @@ -2402,12 +2400,10 @@ libs_summary = { 'libutil': libutil_dep.found(), 'netcf': netcf_dep.found(), 'NLS': have_gnu_gettext_tools, - 'nss': conf.has('WITH_NSS'), 'numactl': numactl_dep.found(), 'openwsman': openwsman_dep.found(), 'parallels': parallels_sdk_dep.found(), 'pciaccess': pciaccess_dep.found(), - 'pm_utils': conf.has('WITH_PM_UTILS'), 'polkit': conf.has('WITH_POLKIT'), 'rbd': rbd_dep.found(), 'readline': readline_dep.found(), @@ -2441,10 +2437,14 @@ misc_summary = { 'Use -Werror': cc_flags.contains('-Werror'), 'Warning Flags': supported_cc_flags, 'DTrace': conf.has('WITH_DTRACE_PROBES'), + 'firewalld': conf.has('WITH_FIREWALLD'), + 'firewalld-zone': conf.has('WITH_FIREWALLD_ZONE'), + 'nss': conf.has('WITH_NSS'), 'numad': conf.has('WITH_NUMAD'), 'Init script': init_script, 'Char device locks': chrdev_lock_files, 'Loader/NVRAM': loader_res, + 'pm_utils': conf.has('WITH_PM_UTILS'), 'virt-login-shell': conf.has('WITH_LOGIN_SHELL'), 'virt-host-validate': conf.has('WITH_HOST_VALIDATE'), 'TLS priority': conf.get_unquoted('TLS_PRIORITY'), -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- libvirt.spec.in | 1 + meson.build | 6 +++++- meson_options.txt | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 7c4ccaa659..ef70e4dd29 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1184,6 +1184,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) %{?enable_werror} \ -Dexpensive_tests=enabled \ -Dinit_script=systemd \ + -Ddocs=enabled \ %{?arg_login_shell} %meson_build diff --git a/meson.build b/meson.build index d53909948e..f44cb4424a 100644 --- a/meson.build +++ b/meson.build @@ -2211,7 +2211,10 @@ subdir('examples') subdir('po') -subdir('docs') +gen_docs = not get_option('docs').disabled() +if gen_docs + subdir('docs') +endif subdir('build-aux') @@ -2436,6 +2439,7 @@ endif misc_summary = { 'Use -Werror': cc_flags.contains('-Werror'), 'Warning Flags': supported_cc_flags, + 'docs': gen_docs, 'DTrace': conf.has('WITH_DTRACE_PROBES'), 'firewalld': conf.has('WITH_FIREWALLD'), 'firewalld-zone': conf.has('WITH_FIREWALLD_ZONE'), diff --git a/meson_options.txt b/meson_options.txt index 452fdab4d0..3c6d6a03c5 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -7,6 +7,7 @@ option('expensive_tests', type: 'feature', value: 'auto', description: 'set the option('test_coverage', type: 'boolean', value: false, description: 'turn on code coverage instrumentation') option('git_werror', type: 'feature', value: 'auto', description: 'use -Werror if building from GIT') option('rpath', type: 'feature', value: 'auto', description: 'whether to include rpath information in installed binaries and libraries') +option('docs', type: 'feature', value: 'auto', description: 'whether to generate documentation') # build dependencies options -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 6 +++++- meson_options.txt | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index f44cb4424a..9f8c43d5ab 100644 --- a/meson.build +++ b/meson.build @@ -2205,7 +2205,10 @@ subdir('src') subdir('tools') -subdir('tests') +build_tests = not get_option('tests').disabled() +if build_tests + subdir('tests') +endif subdir('examples') @@ -2440,6 +2443,7 @@ misc_summary = { 'Use -Werror': cc_flags.contains('-Werror'), 'Warning Flags': supported_cc_flags, 'docs': gen_docs, + 'tests': build_tests, 'DTrace': conf.has('WITH_DTRACE_PROBES'), 'firewalld': conf.has('WITH_FIREWALLD'), 'firewalld-zone': conf.has('WITH_FIREWALLD_ZONE'), diff --git a/meson_options.txt b/meson_options.txt index 3c6d6a03c5..78be491704 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,6 +8,7 @@ option('test_coverage', type: 'boolean', value: false, description: 'turn on cod option('git_werror', type: 'feature', value: 'auto', description: 'use -Werror if building from GIT') option('rpath', type: 'feature', value: 'auto', description: 'whether to include rpath information in installed binaries and libraries') option('docs', type: 'feature', value: 'auto', description: 'whether to generate documentation') +option('tests', type: 'feature', value: 'auto', description: 'whether to build tests') # build dependencies options -- 2.26.2

On Thu, 2020-10-08 at 15:59 +0200, Pavel Hrdina wrote:
+++ b/meson_options.txt @@ -8,6 +8,7 @@ option('test_coverage', type: 'boolean', value: false, description: 'turn on cod option('git_werror', type: 'feature', value: 'auto', description: 'use -Werror if building from GIT') option('rpath', type: 'feature', value: 'auto', description: 'whether to include rpath information in installed binaries and libraries') option('docs', type: 'feature', value: 'auto', description: 'whether to generate documentation') +option('tests', type: 'feature', value: 'auto', description: 'whether to build tests')
Don't we want -Dtests=enabled in libvirt.spec.in at this point? -- Andrea Bolognani / Red Hat / Virtualization

On Thu, Oct 08, 2020 at 08:17:09PM +0200, Andrea Bolognani wrote:
On Thu, 2020-10-08 at 15:59 +0200, Pavel Hrdina wrote:
+++ b/meson_options.txt @@ -8,6 +8,7 @@ option('test_coverage', type: 'boolean', value: false, description: 'turn on cod option('git_werror', type: 'feature', value: 'auto', description: 'use -Werror if building from GIT') option('rpath', type: 'feature', value: 'auto', description: 'whether to include rpath information in installed binaries and libraries') option('docs', type: 'feature', value: 'auto', description: 'whether to generate documentation') +option('tests', type: 'feature', value: 'auto', description: 'whether to build tests')
Don't we want -Dtests=enabled in libvirt.spec.in at this point?
As described in a reply to different patch there is no need to do it I think being explicit is better so I'll add it into libvirt.spec file. Pavel

On Thu, 2020-10-08 at 15:58 +0200, Pavel Hrdina wrote:
Pavel Hrdina (15): meson_options: change VMware default from enabled to auto meson_options: change VirtualBox default from enabled to auto meson_options: move firewalld options to build feature options meson: no need to call meson.get_compiler() again meson: properly handle libpcap if it's explicitly disabled meson: properly handle readline if it's explicitly disabled meson: build nodedev driver only if libvirtd is compiled meson: add libnl build option meson: add rbd build option meson: prefix kvm_dep, m_dep and util_dep with lib meson: add missing libraries to summary meson: remove required libraries from summary meson: move build feature options to miscellaneous summary meson: add docs option to enable/disable generating documentation meson: add tests build option to enable/disable unit tests
libvirt.spec.in | 2 + meson.build | 135 +++++++++++++++++++++++++----------------- meson_options.txt | 12 ++-- src/bhyve/meson.build | 4 +- src/util/meson.build | 4 +- 5 files changed, 96 insertions(+), 61 deletions(-)
I've added a few minor comments to individual patches, but regardless of how you decide to address those the series gets a Reviewed-by: Andrea Bolognani <abologna@redhat.com> -- Andrea Bolognani / Red Hat / Virtualization

On Thu, Oct 08, 2020 at 08:18:51PM +0200, Andrea Bolognani wrote:
On Thu, 2020-10-08 at 15:58 +0200, Pavel Hrdina wrote:
Pavel Hrdina (15): meson_options: change VMware default from enabled to auto meson_options: change VirtualBox default from enabled to auto meson_options: move firewalld options to build feature options meson: no need to call meson.get_compiler() again meson: properly handle libpcap if it's explicitly disabled meson: properly handle readline if it's explicitly disabled meson: build nodedev driver only if libvirtd is compiled meson: add libnl build option meson: add rbd build option meson: prefix kvm_dep, m_dep and util_dep with lib meson: add missing libraries to summary meson: remove required libraries from summary meson: move build feature options to miscellaneous summary meson: add docs option to enable/disable generating documentation meson: add tests build option to enable/disable unit tests
libvirt.spec.in | 2 + meson.build | 135 +++++++++++++++++++++++++----------------- meson_options.txt | 12 ++-- src/bhyve/meson.build | 4 +- src/util/meson.build | 4 +- 5 files changed, 96 insertions(+), 61 deletions(-)
I've added a few minor comments to individual patches, but regardless of how you decide to address those the series gets a
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Thanks, I'll fix the issues, drop rbd build option patch and push it. Pavel
participants (2)
-
Andrea Bolognani
-
Pavel Hrdina