07e5494a8cb810feb5a7976e3c139b269fbbfd43
[dpdk.git] / lib / bpf / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2018 Intel Corporation
3
4 sources = files('bpf.c',
5         'bpf_dump.c',
6         'bpf_exec.c',
7         'bpf_load.c',
8         'bpf_pkt.c',
9         'bpf_validate.c')
10
11 if arch_subdir == 'x86' and dpdk_conf.get('RTE_ARCH_64')
12     sources += files('bpf_jit_x86.c')
13 elif dpdk_conf.has('RTE_ARCH_ARM64')
14     sources += files('bpf_jit_arm64.c')
15 endif
16
17 headers = files('bpf_def.h',
18         'rte_bpf.h',
19         'rte_bpf_ethdev.h')
20
21 deps += ['mbuf', 'net', 'ethdev']
22
23 dep = dependency('libelf', required: false, method: 'pkg-config')
24 if dep.found()
25     dpdk_conf.set('RTE_LIBRTE_BPF_ELF', 1)
26     sources += files('bpf_load_elf.c')
27     ext_deps += dep
28 endif
29
30 if dpdk_conf.has('RTE_PORT_PCAP')
31     sources += files('bpf_convert.c')
32     ext_deps += pcap_dep
33 endif