From b3e2ef408b58e69287572c5b4d63fe6a757deb33 Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Thu, 8 Oct 2020 13:01:29 +0200 Subject: [PATCH] meson: add libnl build option Signed-off-by: Pavel Hrdina Reviewed-by: Andrea Bolognani --- 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 80563ce6ef..cf6c951593 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 6ee15ca8b8..69302766a9 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')