From d1e4a5b7320905f025e7caea685708b5eea37456 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Fri, 15 Dec 2017 17:19:26 +0000 Subject: [PATCH] net/pcap: fix cross compilation with meson The detection of pcap as a dependency involves invoking pcap-config to get parameters - something not possible in a cross-compilation environment. Therefore we need to just look for the presence of the library in a cross-compilation environment and assume if the library is present we can compile and link against it. Fixes: efd5d1a8d8dd ("drivers/net: build some vdev PMDs with meson") Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi --- drivers/net/pcap/meson.build | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/net/pcap/meson.build b/drivers/net/pcap/meson.build index f88afd946b..8b81214e50 100644 --- a/drivers/net/pcap/meson.build +++ b/drivers/net/pcap/meson.build @@ -1,13 +1,22 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -pcap_dep = dependency('pcap', required: false) -if pcap_dep.found() == true - ext_deps += pcap_dep -elif find_program('pcap-config', required: false).found() == true - ext_deps += cc.find_library('pcap') +if meson.is_cross_build() + pcap_dep = cc.find_library('pcap', required: false) + if pcap_dep.found() + ext_deps += pcap_dep + else + build = false + endif else - build = false + pcap_dep = dependency('pcap', required: false) + if pcap_dep.found() == true + ext_deps += pcap_dep + elif find_program('pcap-config', required: false).found() == true + ext_deps += cc.find_library('pcap') + else + build = false + endif endif sources = files('rte_eth_pcap.c') pkgconfig_extra_libs += '-lpcap' -- 2.20.1