xref: /dpdk/lib/bpf/meson.build (revision 3c2ca0a9)
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_validate.c')
16
17if arch_subdir == 'x86' and dpdk_conf.get('RTE_ARCH_64')
18    sources += files('bpf_jit_x86.c')
19elif dpdk_conf.has('RTE_ARCH_ARM64')
20    sources += files('bpf_jit_arm64.c')
21endif
22
23headers = files('bpf_def.h',
24        'rte_bpf.h',
25        'rte_bpf_ethdev.h')
26
27deps += ['mbuf', 'net', 'ethdev']
28
29dep = dependency('libelf', required: false, method: 'pkg-config')
30if dep.found()
31    dpdk_conf.set('RTE_LIBRTE_BPF_ELF', 1)
32    sources += files('bpf_load_elf.c')
33    ext_deps += dep
34endif
35
36if dpdk_conf.has('RTE_PORT_PCAP')
37    sources += files('bpf_convert.c')
38    ext_deps += pcap_dep
39endif
40