summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2018-09-19 16:38:38 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2018-09-19 17:23:11 +0200
commit81a565ebe5ded63c1da77500808d44dfd73d9df8 (patch)
treeae8c83d905cd5a0456bc274a9734d1358646631f /meson.build
parentc7c3acf28029aef8a839ec7629a62e53e963ea81 (diff)
downloadNetworkManager-81a565ebe5ded63c1da77500808d44dfd73d9df8.tar.gz
build: autodetect ebpf support
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build13
1 files changed, 13 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 8d6fa031f0..32e9522171 100644
--- a/meson.build
+++ b/meson.build
@@ -423,6 +423,18 @@ if enable_selinux
endif
config_h.set10('HAVE_SELINUX', enable_selinux)
+# eBPF support
+ebpf_opt = get_option('ebpf')
+if ebpf_opt == 'false'
+ enable_ebpf = false
+else
+ enable_ebpf = true
+ if not cc.has_header('linux/bpf.h')
+ assert(ebpf_opt != 'true', 'eBPF requires kernel support')
+ enable_ebpf = false
+ endif
+endif
+
# libaudit support
libaudit = get_option('libaudit')
enable_libaudit = libaudit.contains('yes')
@@ -994,4 +1006,5 @@ output += ' crypto: ' + crypto + ' (have-gnutls: ' + crypto_gnutls_dep.found().
output += ' sanitizers: ' + get_option('b_sanitize') + '\n'
output += ' Mozilla Public Suffix List: ' + enable_libpsl.to_string() + '\n'
output += ' vapi: ' + enable_vapi.to_string() + '\n'
+output += ' ebpf: ' + enable_ebpf.to_string() + '\n'
message(output)