xref: /dpdk/lib/bpf/meson.build (revision 4edbcc7b5313949083f7694847342b1a45659d6b)
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
10if arch_subdir == 'x86' and dpdk_conf.get('RTE_ARCH_32')
11    build = false
12    reason = 'not supported on 32-bit x86'
13    subdir_done()
14endif
15
16sources = files('bpf.c',
17        'bpf_dump.c',
18        'bpf_exec.c',
19        'bpf_load.c',
20        'bpf_pkt.c',
21        'bpf_stub.c',
22        'bpf_validate.c')
23
24if arch_subdir == 'x86' and dpdk_conf.get('RTE_ARCH_64')
25    sources += files('bpf_jit_x86.c')
26elif dpdk_conf.has('RTE_ARCH_ARM64')
27    sources += files('bpf_jit_arm64.c')
28endif
29
30headers = files('bpf_def.h',
31        'rte_bpf.h',
32        'rte_bpf_ethdev.h')
33
34deps += ['mbuf', 'net', 'ethdev']
35
36dep = dependency('libelf', required: false, method: 'pkg-config')
37if dep.found()
38    dpdk_conf.set('RTE_LIBRTE_BPF_ELF', 1)
39    sources += files('bpf_load_elf.c')
40    ext_deps += dep
41else
42    warning('libelf is missing, rte_bpf_elf_load API will be disabled')
43endif
44
45if dpdk_conf.has('RTE_HAS_LIBPCAP')
46    sources += files('bpf_convert.c')
47    ext_deps += pcap_dep
48else
49    warning('libpcap is missing, rte_bpf_convert API will be disabled')
50endif
51