From patchwork Thu Jan 24 16:38:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Ehrhardt X-Patchwork-Id: 1030557 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lnsB2HH0z9s2P for ; Fri, 25 Jan 2019 03:38:22 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 25B60974; Thu, 24 Jan 2019 16:38:19 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 562732C for ; Thu, 24 Jan 2019 16:38:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C4CF3872 for ; Thu, 24 Jan 2019 16:38:16 +0000 (UTC) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1gmi19-0004jm-3D; Thu, 24 Jan 2019 16:38:15 +0000 From: Christian Ehrhardt To: dev@openvswitch.org Date: Thu, 24 Jan 2019 17:38:13 +0100 Message-Id: <20190124163813.23928-1-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Luca Boccassi Subject: [ovs-dev] [PATCH] acinclude: Also use LIBS from dpkg pkg-config X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org DPDK 18.11 builds using the more modern meson build system no more provide the -ldpdk linker script. Instead it is expected to use pkgconfig for linker options as well. This change will set DPDK_LIB from pkg-config (if pkg-config was available) and since that already carries the whole-archive flags around the PMDs skips the further wrapping in more whole-archive if that is already part of DPDK_LIB. Signed-off-by: Christian Ehrhardt Acked-by: Luca Boccassi --- acinclude.m4 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index f038fd457..a45411860 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -223,9 +223,9 @@ AC_DEFUN([OVS_CHECK_DPDK], [ case "$with_dpdk" in yes) DPDK_AUTO_DISCOVER="true" - PKG_CHECK_MODULES([DPDK], [libdpdk], - [DPDK_INCLUDE="$DPDK_CFLAGS"], - [DPDK_INCLUDE="-I/usr/local/include/dpdk -I/usr/include/dpdk"]) + PKG_CHECK_MODULES_STATIC([DPDK], [libdpdk], + [DPDK_INCLUDE="$DPDK_CFLAGS", DPDK_LIB="$DPDK_LIBS"], + [DPDK_INCLUDE="-I/usr/local/include/dpdk -I/usr/include/dpdk", DPDK_LIB="-ldpdk"]) ;; *) DPDK_AUTO_DISCOVER="false" @@ -238,10 +238,10 @@ AC_DEFUN([OVS_CHECK_DPDK], [ DPDK_INCLUDE="-I$DPDK_INCLUDE_PATH/dpdk" fi DPDK_LIB_DIR="$with_dpdk/lib" + DPDK_LIB="-ldpdk" ;; esac - DPDK_LIB="-ldpdk" DPDK_EXTRA_LIB="" ovs_save_CFLAGS="$CFLAGS" @@ -346,7 +346,14 @@ AC_DEFUN([OVS_CHECK_DPDK], [ # # These options are specified inside a single -Wl directive to prevent # autotools from reordering them. - DPDK_vswitchd_LDFLAGS=-Wl,--whole-archive,$DPDK_LIB,--no-whole-archive + # + # OTOH newer versions of dpdk pkg-config (generated with Meson) + # will already have flagged just the right set of libs with + # --whole-archive - in those cases do not wrap it once more. + case "$DPDK_LIB" in + *whole-archive*) DPDK_vswitchd_LDFLAGS=$DPDK_LIB;; + *) DPDK_vswitchd_LDFLAGS=-Wl,--whole-archive,$DPDK_LIB,--no-whole-archive + esac AC_SUBST([DPDK_vswitchd_LDFLAGS]) AC_DEFINE([DPDK_NETDEV], [1], [System uses the DPDK module.]) fi