xref: /dpdk/lib/bpf/meson.build (revision d6024c0a)
1# SPDX-License-Identifier: BSD-3-Clause
2# Copyright(c) 2018 Intel Corporation
3
4if is_windows
5    build = false
6    reason = 'not supported on Windows'
7    subdir_done()
8endif
9
10sources = files('bpf.c',
11        'bpf_dump.c',
12        'bpf_exec.c',
13        'bpf_load.c',
14        'bpf_pkt.c',
15        'bpf_stub.c',
16        'bpf_validate.c')
17
18if arch_subdir == 'x86' and dpdk_conf.get('RTE_ARCH_64')
19    sources += files('bpf_jit_x86.c')
20elif dpdk_conf.has('RTE_ARCH_ARM64')
21    sources += files('bpf_jit_arm64.c')
22endif
23
24headers = files('bpf_def.h',
25        'rte_bpf.h',
26        'rte_bpf_ethdev.h')
27
28deps += ['mbuf', 'net', 'ethdev']
29
30dep = dependency('libelf', required: false, method: 'pkg-config')
31if dep.found()
32    dpdk_conf.set('RTE_LIBRTE_BPF_ELF', 1)
33    sources += files('bpf_load_elf.c')
34    ext_deps += dep
35else
36    warning('libelf is missing, rte_bpf_elf_load API will be disabled')
37endif
38
39if dpdk_conf.has('RTE_HAS_LIBPCAP')
40    sources += files('bpf_convert.c')
41    ext_deps += pcap_dep
42else
43    warning('libpcap is missing, rte_bpf_convert API will be disabled')
44endif
45