From: Bruce Richardson Date: Fri, 9 Oct 2020 14:19:14 +0000 (+0100) Subject: build: skip detecting libpcap via pcap-config X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=cce5aecf3c3ce30724e4686bf867f146dd2fb625;p=dpdk.git build: skip detecting libpcap via pcap-config When compiling for a slightly different architecture, e.g. 32-bit on 64-bit systems using CFLAGS rather than a cross-file, the pcap-config utility can often return parameters that are unusable for the build in question, i.e. providing the native 64-bit library paths rather than checking for 32-bit equivalent. Since many distros now include a version of libpcap with a pkg-config file, and for those that don't find-library should work ok as a fallback, we can explicitly just use pkg-config in the dependency search, causing meson to skip trying to use pcap-config. Cc: stable@dpdk.org Signed-off-by: Bruce Richardson Reviewed-by: Luca Boccassi Tested-by: David Marchand --- diff --git a/config/meson.build b/config/meson.build index 69f2aeb605..9fb903c9ba 100644 --- a/config/meson.build +++ b/config/meson.build @@ -163,11 +163,9 @@ if libbsd.found() endif # check for pcap -pcap_dep = dependency('pcap', required: false) -if pcap_dep.found() - # pcap got a pkg-config file only in 1.9.0 and before that meson uses - # an internal pcap-config finder, which is not compatible with - # cross-compilation, so try to fallback to find_library +pcap_dep = dependency('libpcap', required: false, method: 'pkg-config') +if not pcap_dep.found() + # pcap got a pkg-config file only in 1.9.0 pcap_dep = cc.find_library('pcap', required: false) endif if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)