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 C2E21C43334 for ; Wed, 20 Jul 2022 10:31:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1E88884085; Wed, 20 Jul 2022 12:31:54 +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="TRInCcDJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 707B782EEA; Wed, 20 Jul 2022 12:31:52 +0200 (CEST) Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (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 079E484079 for ; Wed, 20 Jul 2022 12:31:50 +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-ed1-x531.google.com with SMTP id r6so23198807edd.7 for ; Wed, 20 Jul 2022 03:31:50 -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=1C76R2UmqJtg10LIOpoz7zRFxtYlTP5fJU74wE/QoBk=; b=TRInCcDJJX3ib5nXBE1QOB6nUbxrdmtb87/6S/JUlzSTAw99WIRYSv0+NnoOeSOnM2 rCU63mfPa9EpAHDAhCLiefizPVZyYEgi41Lj6BBuGaTSkiewHMs8x0MQ8sFEfv2tdMZz 0KCN3iOg2n6giB8AKwhfpNK5nEdU0OL2gX4pb71AflLVfk2R2MP/jfN0Wd5KSntVcu5s wPIv3gna1D2UJP2WB0e7ektiynD/RSWbNwYtSXyPegOR1UeEt00He5arDx8zkEl6vklU VIkkXij54//ZeImaQphh6cCT7vG/Bag23CrJUqrD88HtHl7zI5EVgV4i5rLutbVKOKrJ 4rAg== 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=1C76R2UmqJtg10LIOpoz7zRFxtYlTP5fJU74wE/QoBk=; b=OjGOXVow25gVNkBv229VMrbrYAWEIUR+V0Ze7jJpQ6A4oHpJpF1UnNVrgtWLvt45p2 Ee4cQ/uaVLGFCqKsPcvnLyx724tYOCz4PYwvgAi1zJV7owBip0cwB/TqdVzUx2BNXPgZ 1GxLu66Qj5SfOyHP4Ut3NmBVOjbmHTm3kW3h4yLZwmFCbnsfwadQy/pzayfoQiIS/xLu fCr9RKYRd7tuWRwxMhO4p1IglRjDMPAKfV8dy3DLgBHCOR2Z6It/fnmBj2tQCcnEyHis zTPI6D+JrsXZs0rcpLeNTYN2eD9kxPHC+gDkbaz36+p+JRS5sWACU+vB+/Qo8O3RnTBj FALQ== X-Gm-Message-State: AJIora/s2bhTR74i574P+HDG8lyhzD46MSYTeBNkC/AxVUQk54DhxJ9I usJOzYtGHBC0SGlj3+YNe4R48EhYAQ0= X-Google-Smtp-Source: AGRyM1ubbcSkZMq6rvpQny3sxRbJDVjIkXEfWxL3+RqnpjcvUocLPyl8ky0WmZgZBrgZGv0s3dCmaQ== X-Received: by 2002:a05:6402:2287:b0:43b:a9d:ab1 with SMTP id cw7-20020a056402228700b0043b0a9d0ab1mr49008766edb.325.1658313108935; Wed, 20 Jul 2022 03:31:48 -0700 (PDT) Received: from hthiery.fritz.box ([2a02:810b:5a40:2a43:8e16:45ff:fe22:ad85]) by smtp.gmail.com with ESMTPSA id r17-20020a056402035100b0043a6a7048absm12099727edw.95.2022.07.20.03.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 03:31:48 -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 , Samuel Holland , Heinrich Schuchardt , Heiko Thiery Subject: [PATCH v3 1/2] tools: mkeficapsule: use pkg-config to get -luuid and -lgnutls Date: Wed, 20 Jul 2022 12:31:33 +0200 Message-Id: <20220720103133.601566-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. 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") hostprogs-$(CONFIG_TOOLS_MKEFICAPSULE) += mkeficapsule # We build some files with extra pedantic flags to try to minimize things -- 2.30.2