libcap = cc.find_library('cap')
endif
+want_bpf_framework = get_option('bpf-framework')
+bpf_framework_required = want_bpf_framework == 'true'
+
+libbpf = dependency('libbpf', required : bpf_framework_required, version : '>= 0.2')
+conf.set10('HAVE_LIBBPF', libbpf.found())
+
+if want_bpf_framework == 'false'
+ conf.set10('BPF_FRAMEWORK', 0)
+else
+ clang = find_program('clang', required : bpf_framework_required)
+ llvm_strip = find_program('llvm-strip', required : bpf_framework_required)
+ bpftool = find_program('bpftool', required : bpf_framework_required)
+ bpf_arches = ['x86_64']
+ deps_found = libbpf.found() and clang.found() and llvm_strip.found() and bpftool.found()
+ # Can build BPF program from source code in restricted C
+ conf.set10('BPF_FRAMEWORK',
+ bpf_arches.contains(host_machine.cpu_family()) and deps_found)
+endif
+
libmount = dependency('mount',
version : fuzzer_build ? '>= 0' : '>= 2.30')
############################################################
+build_bpf_skel_py = find_program('tools/build-bpf-skel.py')
generate_gperfs = find_program('tools/generate-gperfs.py')
make_autosuspend_rules_py = find_program('tools/make-autosuspend-rules.py')
make_directive_index_py = find_program('tools/make-directive-index.py')
libxz,
libzstd,
liblz4,
+ libbpf,
libcap,
libblkid,
libmount,
['elfutils'],
['gcrypt'],
['gnutls'],
+ ['libbpf'],
['libcryptsetup'],
['libcurl'],
['libfdisk'],
# components
['backlight'],
['binfmt'],
+ ['bpf-framework', conf.get('BPF_FRAMEWORK') == 1],
['coredump'],
['environment.d'],
['efi'],
description : 'install kernel-install and associated files')
option('analyze', type: 'boolean', value: 'true',
description : 'install systemd-analyze')
+
+option('bpf-framework', type : 'combo', choices : ['auto', 'true', 'false'],
+ description: 'build BPF programs from source code in restricted C')