xref: /dpdk/lib/bpf/meson.build (revision 4edbcc7b5313949083f7694847342b1a45659d6b)
199a2dd95SBruce Richardson# SPDX-License-Identifier: BSD-3-Clause
299a2dd95SBruce Richardson# Copyright(c) 2018 Intel Corporation
399a2dd95SBruce Richardson
4b1094939SBruce Richardsonif is_windows
5b1094939SBruce Richardson    build = false
6b1094939SBruce Richardson    reason = 'not supported on Windows'
7b1094939SBruce Richardson    subdir_done()
8b1094939SBruce Richardsonendif
9b1094939SBruce Richardson
10*4edbcc7bSLuca Boccassiif arch_subdir == 'x86' and dpdk_conf.get('RTE_ARCH_32')
11*4edbcc7bSLuca Boccassi    build = false
12*4edbcc7bSLuca Boccassi    reason = 'not supported on 32-bit x86'
13*4edbcc7bSLuca Boccassi    subdir_done()
14*4edbcc7bSLuca Boccassiendif
15*4edbcc7bSLuca Boccassi
1699a2dd95SBruce Richardsonsources = files('bpf.c',
17745b7587SStephen Hemminger        'bpf_dump.c',
1899a2dd95SBruce Richardson        'bpf_exec.c',
1999a2dd95SBruce Richardson        'bpf_load.c',
2099a2dd95SBruce Richardson        'bpf_pkt.c',
2165d9b7c6SKonstantin Ananyev        'bpf_stub.c',
2299a2dd95SBruce Richardson        'bpf_validate.c')
2399a2dd95SBruce Richardson
2499a2dd95SBruce Richardsonif arch_subdir == 'x86' and dpdk_conf.get('RTE_ARCH_64')
2599a2dd95SBruce Richardson    sources += files('bpf_jit_x86.c')
2699a2dd95SBruce Richardsonelif dpdk_conf.has('RTE_ARCH_ARM64')
2799a2dd95SBruce Richardson    sources += files('bpf_jit_arm64.c')
2899a2dd95SBruce Richardsonendif
2999a2dd95SBruce Richardson
3099a2dd95SBruce Richardsonheaders = files('bpf_def.h',
3199a2dd95SBruce Richardson        'rte_bpf.h',
3299a2dd95SBruce Richardson        'rte_bpf_ethdev.h')
3399a2dd95SBruce Richardson
3499a2dd95SBruce Richardsondeps += ['mbuf', 'net', 'ethdev']
3599a2dd95SBruce Richardson
3699a2dd95SBruce Richardsondep = dependency('libelf', required: false, method: 'pkg-config')
3799a2dd95SBruce Richardsonif dep.found()
3899a2dd95SBruce Richardson    dpdk_conf.set('RTE_LIBRTE_BPF_ELF', 1)
3999a2dd95SBruce Richardson    sources += files('bpf_load_elf.c')
4099a2dd95SBruce Richardson    ext_deps += dep
4165d9b7c6SKonstantin Ananyevelse
4265d9b7c6SKonstantin Ananyev    warning('libelf is missing, rte_bpf_elf_load API will be disabled')
4399a2dd95SBruce Richardsonendif
442eccf6afSStephen Hemminger
45d6024c0aSDavid Marchandif dpdk_conf.has('RTE_HAS_LIBPCAP')
462eccf6afSStephen Hemminger    sources += files('bpf_convert.c')
472eccf6afSStephen Hemminger    ext_deps += pcap_dep
4865d9b7c6SKonstantin Ananyevelse
49d6024c0aSDavid Marchand    warning('libpcap is missing, rte_bpf_convert API will be disabled')
502eccf6afSStephen Hemmingerendif
51