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 B2530A09E0; Fri, 13 Nov 2020 17:08:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2A138C88E; Fri, 13 Nov 2020 17:08:36 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 24C6FC87A for ; Fri, 13 Nov 2020 17:08:32 +0100 (CET) IronPort-SDR: eBRaa0GVVhVt98cLnbe1QE/nkkgVVsWbocbtbtiQNQCYcZsGCneStHkDsSlM1TUkAC3SxZcX7N ss8mm8tS3+gQ== X-IronPort-AV: E=McAfee;i="6000,8403,9804"; a="157513543" X-IronPort-AV: E=Sophos;i="5.77,475,1596524400"; d="scan'208";a="157513543" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2020 08:08:31 -0800 IronPort-SDR: ZfG4vbpioCPFD6Xq+xCOqyw2Ga7hF36WTrUn9bvbxcnBqcSLaoSMRWpdZfq+k7LALTeK/Xioqs UZxDR1IFLS8w== X-IronPort-AV: E=Sophos;i="5.77,475,1596524400"; d="scan'208";a="542702184" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.18.250]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 13 Nov 2020 08:08:29 -0800 Date: Fri, 13 Nov 2020 16:08:25 +0000 From: Bruce Richardson To: David Marchand Cc: dev , Thomas Monjalon , Declan Doherty , Pablo de Lara , Akhil Goyal , Fiona Trahe , Fan Zhang Message-ID: <20201113160825.GB1441@bricha3-MOBL.ger.corp.intel.com> References: <20201110151219.4893-1-david.marchand@redhat.com> <20201113122430.25354-1-david.marchand@redhat.com> <20201113122430.25354-5-david.marchand@redhat.com> <20201113135314.GB53@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH v2 04/11] examples/l2fwd-crypto: fix build with pkg-config 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" On Fri, Nov 13, 2020 at 04:41:52PM +0100, David Marchand wrote: > On Fri, Nov 13, 2020 at 3:15 PM David Marchand > wrote: > > > > On Fri, Nov 13, 2020 at 2:53 PM Bruce Richardson > > wrote: > > > > +NEED_CRYPTO_SCHEDULER = $(shell echo RTE_CRYPTO_SCHEDULER | $(CPP) $(CFLAGS) -P - | tail -1) > > > > +ifeq ($(NEED_CRYPTO_SCHEDULER), 1) > > > > > > Sorry for the last-minute comment, but I wonder for this check if we can do > > > better by adding into each makefile something like: > > > > > > CONFIG_DEFINES=$(shell $(CC) $(CFLAGS) -dM -E - < /dev/null) > > > > > > Then we can easily do multiple checks for vars as needed using findstring, > > > e.g. > > > > > > ifeq ($(findstring RTE_CRYPTO_SCHEDULER,$(CONFIG_DEFINES),) > > > $(info No crypto scheduler found) > > > else > > > ... > > > endif > > > > > > Whatever approach we use here, I'd like applicable across all makefiles for > > > consistency, and shelling out per-value seems wasteful. Pulling all macro > > > values also allows checks for architecture and instruction set levels too, > > > if so desired. > > --- a/examples/l2fwd-crypto/Makefile > +++ b/examples/l2fwd-crypto/Makefile > @@ -23,9 +23,15 @@ PKGCONF ?= pkg-config > > PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) > CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) > +CONFIG_DEFINES = $(shell $(CC) $(CFLAGS) -dM -E - < /dev/null) > LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) > +ifneq ($(findstring RTE_CRYPTO_SCHEDULER,$(CONFIG_DEFINES)),) > +LDFLAGS_SHARED += -lrte_crypto_scheduler > +endif > LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) > Can we perhaps keep the existing pkg-config query lines together in the existing block, and just add the extra checks for this particular app afterwards? Having done changes en-mass to the example makefiles a couple of times, it was made a lot easier by having the exact same lines in each as much as possible, allowing changes to be made by applying a single patch-file to each makefile in turn.