From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 557D0C43334 for ; Wed, 20 Jul 2022 10:55:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CE14984070; Wed, 20 Jul 2022 12:55:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="jSfAVH7U"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3F84883FEA; Wed, 20 Jul 2022 12:55:26 +0200 (CEST) Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 810E384070 for ; Wed, 20 Jul 2022 12:55:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pl1-x630.google.com with SMTP id v21so14622042plo.0 for ; Wed, 20 Jul 2022 03:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc; bh=btuezBJlqyGbsCNfOo/D9JsZL7mI1NdrMcMO+zSZqxA=; b=jSfAVH7Us0cVzB8b8P4+Mq8cn7DPmn0U5iaJS0q2zO4/wcHJbLQjP7YSC9ecf9T46I AhH/d68qyeBPgdSImsxAIDBwF9rNs84GpGevYreppN+itpg9yk24fQv+kjWsnKe/saje +bZhIUt+4NOtahJsmBuG4+RT2NhBHb5WSpyDSb0Jug91vTk2nyD1UeeRdsvOKIgwXYDv eZQ60LFPrNyzmrWBD2uW8nLMCi68VNrM+m3W1RTwa+yLnfbn2MKV3C7iPuDjZXby6DFo JHFNEXdW7Gp9GwQLS/qZwsBhTYs6NyJU9pYMQu4N4pvbqMV0RV9qnMMv2vHgLHK00e2j FlHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc; bh=btuezBJlqyGbsCNfOo/D9JsZL7mI1NdrMcMO+zSZqxA=; b=Hra0TuuXVrt9n65DuUIMK5UYrV3ZY0C4rd0d4sx0DV7o2Bdw+DvJVETc0bsZ2JVEnt uu9cdqmLkEFY8kxEzbCjC5mC7W5kCR81H/c8giAQfMv8oUjDRE/pq9T5Tyo9Lmc41SeS ruEshQTow2DsVOA946sjdo2M0vwXAiwf/oetyTuSTCYishwQ3wnlBXt1E09puPj6Yfbe pGSlO36g1SVze3ZbUVE+OMmvftBKYr8Za9oAyfcBqWdyU7e0lXF565FQ5RvPCpgjEWQ2 axifNt2nlkYSCIqvz6H9t944YqqK4WE13TZ5ZlYPsUzs4RxqQAlhOgXbHUmVRQKv7i/e gHqQ== X-Gm-Message-State: AJIora/TaWQKHGlHHFTvH8/fVOcSHsL4VPUoPaMeRvQ1IIMgQ4EvJuQx CE54zW/lerrHFFNzFI+uNTd/0A== X-Google-Smtp-Source: AGRyM1vVndOktal6niNOAmdlXjpCPMQBWiI1Tf2RngBf5+a9y9bXPMEhnX+qmSgL6AOX3mxzWph/bQ== X-Received: by 2002:a17:90b:3b8d:b0:1f0:22f1:27d8 with SMTP id pc13-20020a17090b3b8d00b001f022f127d8mr4807897pjb.56.1658314521289; Wed, 20 Jul 2022 03:55:21 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:f416:6ef9:e0c6:d3cb]) by smtp.gmail.com with ESMTPSA id y11-20020a17090322cb00b0016c33dc879esm13636628plg.113.2022.07.20.03.55.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 03:55:20 -0700 (PDT) Date: Wed, 20 Jul 2022 19:55:15 +0900 From: AKASHI Takahiro To: Heiko Thiery Cc: u-boot@lists.denx.de, Pali Roh??r , Stefan Roese , Simon Glass , Chris Packham , Marek Beh??n , Samuel Holland , Heinrich Schuchardt Subject: Re: [PATCH v3 1/2] tools: mkeficapsule: use pkg-config to get -luuid and -lgnutls Message-ID: <20220720105515.GA69190@laputa> Mail-Followup-To: AKASHI Takahiro , Heiko Thiery , u-boot@lists.denx.de, Pali Roh??r , Stefan Roese , Simon Glass , Chris Packham , Marek Beh??n , Samuel Holland , Heinrich Schuchardt References: <20220720103133.601566-1-heiko.thiery@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220720103133.601566-1-heiko.thiery@gmail.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On Wed, Jul 20, 2022 at 12:31:33PM +0200, Heiko Thiery wrote: > Instead of hardcoding -luuid -lgnutls as the flags needed to build > mkeficapsule, use pkg-config when available. > > We gracefully fallback on the previous behavior of hardcoding -luuid > -lgnutls if pkg-config is not available or fails with an error. > > Reviewed-by: Heinrich Schuchardt > Signed-off-by: Heiko Thiery > --- > v3: > - added reviewed-by > > v2: > - also add cflags detection via pkg-config (Thanks Pali) > > tools/Makefile | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/tools/Makefile b/tools/Makefile > index 9f2339666a..aab06aec93 100644 > --- a/tools/Makefile > +++ b/tools/Makefile > @@ -242,7 +242,10 @@ hostprogs-$(CONFIG_MIPS) += mips-relocs > hostprogs-$(CONFIG_ASN1_COMPILER) += asn1_compiler > HOSTCFLAGS_asn1_compiler.o = -idirafter $(srctree)/include > > -HOSTLDLIBS_mkeficapsule += -lgnutls -luuid > +HOSTCFLAGS_mkeficapsule.o += \ > + $(shell pkg-config --cflags gnutls uuid 2> /dev/null || echo "") > +HOSTLDLIBS_mkeficapsule += \ > + $(shell pkg-config --libs gnutls uuid 2> /dev/null || echo "-lgnutls -luuid") It would be logically better to call pkg-config for each library, that is, HOSTLDLIBS_mkeficapsule += \ $(shell pkg-config --libs gnutls 2> /dev/null || echo " -lgnutls") HOSTLDLIBS_mkeficapsule += \ $(shell pkg-config --libs uuid 2> /dev/null || echo " -luuid") Thanks, -Takahiro Akashi > hostprogs-$(CONFIG_TOOLS_MKEFICAPSULE) += mkeficapsule > > # We build some files with extra pedantic flags to try to minimize things > -- > 2.30.2 >