net/af_xdp: fix meson for non Linux platforms
Subsystems (2)
PATCH 1/1 net/af_xdp: fix meson for non Linux platforms
--- drivers/net/af_xdp/meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/af_xdp/meson.build +1 -2
@@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel Corporation +build = false if host_machine.system() == 'linux' bpf_dep = dependency('libbpf', required: false) if bpf_dep.found()
@@ -10,8 +11,6 @@ if host_machine.system() == 'linux' if bpf_dep.found() and cc.has_header('bpf/xsk.h', dependencies: bpf_dep) and cc.has_header('linux/if_xdp.h') build = true pkgconfig_extra_libs += '-lbpf' - else - build = false endif endif ext_deps += bpf_dep
Signature · 1 line
2.20.1
PATCH 1/1 net/af_xdp: simplify meson build specification
The build spec has lots of levels of indentation, which can be reduced by not explicitly checking for linux, but for the needed header and library files needed for the driver.
--- drivers/net/af_xdp/meson.build | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-)
drivers/net/af_xdp/meson.build +11 -14
@@ -1,19 +1,16 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel Corporation -if host_machine.system() == 'linux' - bpf_dep = dependency('libbpf', required: false) - if bpf_dep.found() - build = true - else - bpf_dep = cc.find_library('bpf', required: false) - if bpf_dep.found() and cc.has_header('bpf/xsk.h', dependencies: bpf_dep) and cc.has_header('linux/if_xdp.h') - build = true - pkgconfig_extra_libs += '-lbpf' - else - build = false - endif - endif +sources = files('rte_eth_af_xdp.c') + +bpf_dep = dependency('libbpf', required: false) +if not bpf_dep.found() + bpf_dep = cc.find_library('bpf', required: false) +endif + +if bpf_dep.found() and cc.has_header('bpf/xsk.h') and cc.has_header('linux/if_xdp.h') ext_deps += bpf_dep + pkgconfig_extra_libs += '-lbpf' +else + build = false endif -sources = files('rte_eth_af_xdp.c')
Signature · 1 line
2.20.1
Re: [dpdk-dev] [PATCH] net/af_xdp: simplify meson build specification
Quoted 35 lines · Bruce Richardson
The build spec has lots of levels of indentation, which can be reduced by not explicitly checking for linux, but for the needed header and library files needed for the driver.
Signed-off-by Bruce Richardson <[email protected]>--- drivers/net/af_xdp/meson.build | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-)drivers/net/af_xdp/meson.build +4
-13@@ -1,19 +1,16 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel Corporation -if host_machine.system() == 'linux' - bpf_dep = dependency('libbpf', required: false) - if bpf_dep.found() - build = true - else - bpf_dep = cc.find_library('bpf', required: false) - if bpf_dep.found() and cc.has_header('bpf/xsk.h', dependencies: bpf_dep) and cc.has_header('linux/if_xdp.h') - build = true - pkgconfig_extra_libs += '-lbpf' - else - build = false - endif - endif +sources = files('rte_eth_af_xdp.c') + +bpf_dep = dependency('libbpf', required: false) +if not bpf_dep.found()
drivers/net/af_xdp/meson.build line 19
Quoted 10 lines
drivers/net/af_xdp/meson.build +7
-1+ bpf_dep = cc.find_library('bpf', required: false) +endif + +if bpf_dep.found() and cc.has_header('bpf/xsk.h') and cc.has_header('linux/if_xdp.h') ext_deps += bpf_dep + pkgconfig_extra_libs += '-lbpf' +else + build = false endif -sources = files('rte_eth_af_xdp.c')
Looks good to me.
Re: [dpdk-dev] [PATCH] net/af_xdp: simplify meson build specification
In reply to Bruce RichardsonQuoted 5 lines · Bruce Richardson
The build spec has lots of levels of indentation, which can be reduced by not explicitly checking for linux, but for the needed header and library files needed for the driver.
Signed-off-by Bruce Richardson <[email protected]>
Squashed into relevant commit in next-net, thanks.