From 28c987263980afc5b606a36a8d264b68cb01e9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Wed, 14 Aug 2024 21:44:58 +0200 Subject: [PATCH] meson: switch checks to depend on json-c as well as yajl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure both are required during this series to make bisecting smooth. Signed-off-by: Ján Tomko Reviewed-by: Peter Krempa --- libvirt.spec.in | 3 ++- meson.build | 12 ++++++------ meson_options.txt | 6 +++--- src/meson.build | 1 + src/util/meson.build | 1 + tests/meson.build | 1 + tools/nss/meson.build | 2 ++ 7 files changed, 16 insertions(+), 10 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 0636f2229b..a1d942a996 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -362,6 +362,7 @@ BuildRequires: augeas BuildRequires: systemd-devel >= 185 BuildRequires: libpciaccess-devel >= 0.10.9 BuildRequires: yajl-devel +BuildRequires: json-c-devel %if %{with_sanlock} BuildRequires: sanlock-devel >= 2.4 %endif @@ -1367,8 +1368,8 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Dapparmor_profiles=disabled \ -Dsecdriver_apparmor=disabled \ -Dudev=enabled \ - -Djson_c=disabled \ -Dyajl=enabled \ + -Djson_c=enabled \ %{?arg_sanlock} \ -Dlibpcap=enabled \ %{?arg_nbdkit} \ diff --git a/meson.build b/meson.build index 1f43b99c2d..8693f48767 100644 --- a/meson.build +++ b/meson.build @@ -1627,10 +1627,10 @@ if not get_option('driver_ch').disabled() and host_machine.system() == 'linux' a endif endif - if not yajl_dep.found() + if not yajl_dep.found() or not json_c_dep.found() use_ch = false if get_option('driver_ch').enabled() - error('YAJL 2 is required to build Cloud-Hypervisor driver') + error('YAJL 2 *AND* json-c is required to build Cloud-Hypervisor driver') endif endif @@ -1701,10 +1701,10 @@ endif if not get_option('driver_qemu').disabled() use_qemu = true - if not yajl_dep.found() + if not yajl_dep.found() or not json_c_dep.found() use_qemu = false if get_option('driver_qemu').enabled() - error('YAJL 2 is required to build QEMU driver') + error('YAJL 2 *AND* json-c is required to build QEMU driver') endif endif @@ -2027,9 +2027,9 @@ endif if not get_option('nss').disabled() use_nss = true - if not yajl_dep.found() + if not yajl_dep.found() or not json_c_dep.found() if get_option('nss').enabled() - error('Can\'t build nss plugin without yajl') + error('Can\'t build nss plugin without YAJL 2 *AND* json-c') else use_nss = false endif diff --git a/meson_options.txt b/meson_options.txt index 9b1610fcfe..122cda0350 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -68,14 +68,14 @@ option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd option('driver_libxl', type: 'feature', value: 'auto', description: 'libxenlight driver') # dep:driver_remote dep:driver_libvirtd option('driver_lxc', type: 'feature', value: 'auto', description: 'Linux Container driver') -# dep:curl dep:yajl dep:driver_remote dep:driver_libvirtd +# dep:curl dep:json_c dep:driver_remote dep:driver_libvirtd option('driver_ch', type: 'feature', value: 'auto', description: 'Cloud-Hypervisor driver') option('ch_user', type: 'string', value: '', description: 'username to run Cloud-Hypervisor system instance as') option('ch_group', type: 'string', value: '', description: 'groupname to run Cloud-Hypervisor system instance as') # dep:driver_remote dep:driver_libvirtd option('driver_network', type: 'feature', value: 'auto', description: 'virtual network driver') option('driver_openvz', type: 'feature', value: 'auto', description: 'OpenVZ driver') -# dep:yajl dep:driver_remote dep:driver_libvirtd +# dep:json_c dep:driver_remote dep:driver_libvirtd 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') option('qemu_group', type: 'string', value: '', description: 'groupname to run QEMU system instance as') @@ -123,7 +123,7 @@ option('host_validate', type: 'feature', value: 'auto', description: 'build virt 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 : paths. Both pairs and list items are separated by a colon.') option('login_shell', type: 'feature', value: 'auto', description: 'build virt-login-shell') -# dep:yajl dep:driver_network dep:libvirtd +# dep:json_c dep:driver_network dep:libvirtd option('nss', type: 'feature', value: 'auto', description: 'enable Name Service Switch plugin for resolving guest IP addresses') # dep:numactl option('numad', type: 'feature', value: 'auto', description: 'use numad to manage CPU placement dynamically') diff --git a/src/meson.build b/src/meson.build index 8cce42c7ad..b9652785dd 100644 --- a/src/meson.build +++ b/src/meson.build @@ -552,6 +552,7 @@ if conf.has('WITH_REMOTE') capng_dep, devmapper_dep, gnutls_dep, + json_c_dep, libssh2_dep, libssh_dep, sasl_dep, diff --git a/src/util/meson.build b/src/util/meson.build index 54db542957..f8f7e736a6 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -193,6 +193,7 @@ virt_util_lib = static_library( capng_dep, devmapper_dep, gnutls_dep, + json_c_dep, intl_dep, libbsd_dep, libm_dep, diff --git a/tests/meson.build b/tests/meson.build index 700a5d4049..e8fd9bac0c 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -10,6 +10,7 @@ tests_dep = declare_dependency( dlopen_dep, glib_dep, gnutls_dep, + json_c_dep, libnl_dep, libxml_dep, rpc_dep, diff --git a/tools/nss/meson.build b/tools/nss/meson.build index 85e2838fb7..1cae93ac67 100644 --- a/tools/nss/meson.build +++ b/tools/nss/meson.build @@ -28,6 +28,7 @@ nss_libvirt_impl = static_library( '-DLIBVIRT_NSS' ], dependencies: [ + json_c_dep, tools_dep, yajl_dep, ], @@ -44,6 +45,7 @@ nss_libvirt_guest_impl = static_library( '-DLIBVIRT_NSS_GUEST', ], dependencies: [ + json_c_dep, tools_dep, yajl_dep, ],