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 0C8D5C43334 for ; Tue, 19 Jul 2022 19:15:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E1EC684068; Tue, 19 Jul 2022 21:15:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="UduzDYxS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E45C284039; Tue, 19 Jul 2022 21:15:36 +0200 (CEST) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (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 6730C84069 for ; Tue, 19 Jul 2022 21:15:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heiko.thiery@gmail.com Received: by mail-ej1-x631.google.com with SMTP id z23so29032273eju.8 for ; Tue, 19 Jul 2022 12:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CqglIDxvLKXeWIjHVWYQ4QBNbX0FvQtDsk/X3uCZ0ac=; b=UduzDYxSNDGIR0o+qVWg5ARkKBwSICgEgCAfw0cvfv8A+CotN47At73znwLgcE5uw/ i68BbSAAmaHAbrQB+5yrNLe8e7KUIzwhHa3pJsN8DA6peKx9zGwYDEOP282z4b3t1+Ka zLX8JY0AQJHx/zEMTSQ7diGpBFI9NnC4S4SxycVgkWZDPjjc9S8TP+1eAYU+Gh6TfMCh c/5E0oDhvl/SeUG6SSXbgGP0yylMTYgLpdpTJ17GEz0wQk7R+dVkb5u+aE/gZRaebGCP aahV9F7cctRdTnm+KYpvdghIUyY0HaaVk6mv9TZMvZ6DZ7Yywj5s/d7bCwtTkpK/nve9 SQ4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CqglIDxvLKXeWIjHVWYQ4QBNbX0FvQtDsk/X3uCZ0ac=; b=PdJzTTUbrtgtwhGwg7103v+AvX06tRhrCdtd3wU24BctGGXHy+iZWDawK13N/aY84M eSQ2S+plZCs3eAo7vOL3ox3aPx3uuXtzrTYeg28hG58b+HuRqfIEaqArTxu5wpK6z0mK wFRhXogCfrqvB8o7MJEcJgkWOXvgEWFLJT2rbktG+qPQrGiHdtVZRuXETBZXfasEulZ3 fnrTIYogyFULIF5q4Y+P8X4ITDTHc/l/g0nvfbv34jziCEG0ROczRvNVMfKXrqhUjRXE bm+UryAAAL3WeX8NdW5tZLVG22nOtOaeF9i3XsiK/LEX9v7eR2SmJODD3frg3wqGGljj k62w== X-Gm-Message-State: AJIora9O73W27DO5NPwgKk5CQtA1j2LoR6YRWrYcI62M0q/iSbIAFUMx ShlErwKLhR5T9GkX9kvK0//T1SeWUk2GiA== X-Google-Smtp-Source: AGRyM1sCM8gBNrioLLIPBlSfWD11rCOXNID2g1ba38BbnkDC7VCh5ezPwHarAumMF+W8VE0vA/v06w== X-Received: by 2002:a17:907:2c6a:b0:72b:52eb:1681 with SMTP id ib10-20020a1709072c6a00b0072b52eb1681mr32394088ejc.232.1658258132310; Tue, 19 Jul 2022 12:15:32 -0700 (PDT) Received: from hthiery.fritz.box ([2a02:810b:5a40:2a43:8e16:45ff:fe22:ad85]) by smtp.gmail.com with ESMTPSA id t18-20020a1709067c1200b00722bc0aa9e3sm6966802ejo.162.2022.07.19.12.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 12:15:31 -0700 (PDT) From: Heiko Thiery To: u-boot@lists.denx.de Cc: =?UTF-8?q?Pali=20Roh=C3=A1r?= , Stefan Roese , Simon Glass , Chris Packham , =?UTF-8?q?Marek=20Beh=C3=BAn?= , AKASHI Takahiro , Heinrich Schuchardt , Samuel Holland , Heiko Thiery Subject: [PATCH v2 1/2] tools: mkeficapsule: use pkg-config to get -luuid and -lgnutls Date: Tue, 19 Jul 2022 21:15:15 +0200 Message-Id: <20220719191515.559452-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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. Signed-off-by: Heiko Thiery --- 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") hostprogs-$(CONFIG_TOOLS_MKEFICAPSULE) += mkeficapsule # We build some files with extra pedantic flags to try to minimize things -- 2.30.2