DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: bluca@debian.org, Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH v2] build: skip detecting libpcap via pcap-config
Date: Fri,  9 Oct 2020 15:19:14 +0100
Message-ID: <20201009141914.205284-1-bruce.richardson@intel.com> (raw)
In-Reply-To: <20201008170536.124111-1-bruce.richardson@intel.com>

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.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 69f2aeb60..9fb903c9b 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)
-- 
2.25.1


  parent reply	other threads:[~2020-10-09 14:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08 17:05 [dpdk-dev] [RFC PATCH] build: use libpcap only from pkg-config Bruce Richardson
2020-10-08 17:08 ` Bruce Richardson
2020-10-09  9:09   ` Luca Boccassi
2020-10-09 10:32     ` Bruce Richardson
2020-10-09 12:51       ` Luca Boccassi
2020-10-09 13:39         ` Bruce Richardson
2020-10-09 14:19 ` Bruce Richardson [this message]
2020-10-09 14:54   ` [dpdk-dev] [PATCH v2] build: skip detecting libpcap via pcap-config Luca Boccassi
2020-10-12 15:12     ` David Marchand
2020-10-12 12:02   ` David Marchand
2020-10-12 12:47     ` Bruce Richardson
2020-10-12 12:48   ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201009141914.205284-1-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=bluca@debian.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git