From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D002DA051C; Tue, 11 Feb 2020 02:20:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 00D5F1BF9C; Tue, 11 Feb 2020 02:20:05 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 5F40D1BF7A for ; Tue, 11 Feb 2020 02:20:02 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A7E0621FBC; Mon, 10 Feb 2020 20:20:01 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 10 Feb 2020 20:20:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=6711hToojC 2tXwPiTgG2PV8Q5PellWmvK3/lkPrvOE4=; b=YNNxSHCDsczHlRvMREFnrR+WXY p5i9QoQPBXxKsLfb+0RfNiDfh4IwQs97AFE5XTuV6JY/YxT2iAhxanLTdYxT+GP6 QxcLYqREFnOHEujvf7fYyI6hcLU/xTjMUlS6IBFEMj6ic9o+gtRLZJNIEplRrTCp lrKz/Z3jmq0zD/pGQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=6711hToojC2tXwPiTgG2PV8Q5PellWmvK3/lkPrvOE4=; b=gFP6BK1f u+CNPIwQYbUc+Qt+vIVb2wkZQEj3olQY5T/qpmtYllZ0bPAgxR52ChVIC2+rj9H/ 8sD42KaUFV6zbThQwFEg92aqSQ6Prv8v26abmj9leEF00+4YDG49Zw8skHbwRAf9 WxjZ5tXE8y3iW9Vwpo3IT7XBiNO8dz3P1H2OwkZ5Z7U9P1xFP14gxCFVLlYtk1aZ zOuVOglFZNb82cCh3VMEJQe509dNxor3Uf+Wc66LwJvzPn3Qk4Jy0KAI9xjINiUO 8V526B9c1eN2qvqN0aZayrtan/skC2aPKCe2A/+aPfvyPRH3S4kfxXIuIwX/mzcd iHlX4DEJc16iyQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedriedvgdefvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgepvdenucfrrghr rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id D5D6C3280059; Mon, 10 Feb 2020 20:20:00 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: bruce.richardson@intel.com, Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Date: Tue, 11 Feb 2020 02:19:39 +0100 Message-Id: <20200211011942.1569573-3-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200211011942.1569573-1-thomas@monjalon.net> References: <20200127154402.4008069-1-thomas@monjalon.net> <20200211011942.1569573-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 2/5] buildtools: get static mlx dependencies for meson X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The shell script options-ibverbs-static.sh was used with make in forcing static linkage of ibverbs libraries. When choosing to link with a static dependency in meson, the generated .pc file will not force such static linkage. The solution will rely on using this script in meson. If linking with libraries installed in a non-standard path, an option -L is provided via EXTRA_LDFLAGS in case of using make. With meson, tuning PKG_CONFIG_PATH for pkg-config should be enough. When statically linking an application, the .pc file must save the -L path so the application link will work without any extra option. That's why --libs-only-l is replaced with --libs which includes -L. Options which are neither -l or -L are filtered out because not needed and can cause compilation issues with the legacy system using make. The other change in this script is to move the main library file (libiverbs.a) at the end of the list of dependencies. It fixes some undefined references when linking a static application using libdpdk.pc. Signed-off-by: Thomas Monjalon --- buildtools/options-ibverbs-static.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/buildtools/options-ibverbs-static.sh b/buildtools/options-ibverbs-static.sh index 0f285a343b..43578a37f3 100755 --- a/buildtools/options-ibverbs-static.sh +++ b/buildtools/options-ibverbs-static.sh @@ -9,6 +9,12 @@ # # PKG_CONFIG_PATH may be required to be set if libibverbs.pc is not installed. -pkg-config --libs-only-l --static libibverbs | +lib='libibverbs' +deps='pthread|nl' + +pkg-config --libs --static $lib | tr '[:space:]' '\n' | - sed -r '/^-l(pthread|nl)/! s,(^-l)(.*),\1:lib\2.a,' + sed -r "/^-l($deps)/! s,(^-l)(.*),\1:lib\2.a," | # explicit .a + sed -n '/^-[Ll]/p' | # extra link options may break with make + sed "/$lib/d" # move main lib at the end +echo -l:$lib.a -- 2.25.0