From patchwork Tue Jul 19 18:38:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1658178 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=OtaBBCVH; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LnSKT65Y9z9s2R for ; Wed, 20 Jul 2022 04:39:08 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8B55984044; Tue, 19 Jul 2022 20:38:55 +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="OtaBBCVH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3369583FEE; Tue, 19 Jul 2022 20:38:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) (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 15D228403C for ; Tue, 19 Jul 2022 20:38:52 +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-x62f.google.com with SMTP id oy13so28778486ejb.1 for ; Tue, 19 Jul 2022 11:38:52 -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=WgnRCbQ4u4Ae02ZegUuqApOfUBZKaxPzOxU9TxP5drg=; b=OtaBBCVHp9VJJd20sZOH9uf1oxUu5OBBdhtMCIjdru52l+cbW0sm/74mX88TW2KpVz rtk3+K0PCoJWmC7zimDP0cLBp2q8AillxCrvlnUtRsZfwHmWDTr6pKozz+Xx2XhW8mh2 lfbP8Z70FFDB+qlP+thFRNHOGq80QXNE4HmkNW4zwkZk9y/r5IWrneGfS9L/jTqvZCH2 lb9jyyIzuzF99vUXt6cYPqSejteYaO+VR4rpjWccB51tro3Wp2T6S+zGz1/A9I6S2mPF kEw59Po9LE5husadvs0ARYje8ixFyj4GIrcbWEB8t9y7KkOMRt7aNvtf4y9p4xe8yDqK TmqA== 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=WgnRCbQ4u4Ae02ZegUuqApOfUBZKaxPzOxU9TxP5drg=; b=jLyHzbkeq3hvfVS9UI+kT6jsnb7OIIXMtOyqGAuXMjsg9D5SIQjjTLBd/jsMdnOLWn zp4G4Xx9+ZM/nqyag8G/BjqpQBOWqvq5Inh7ehAVmitFaSGkmqPb8yF2A6ZTEPSPoLUw TwCRC82MKnet/a2kFVSJsGYLiPal8egsde51DKkCdAUS5fj4gXIDPEKm3/1vAHq3kmmF Zwzx1mmDBWQ2dvS4JasdzqfCrOXit0kdHu5Odph7Tcl9Xu2wsdS7l2KZtW795pMBiOmp 4QwmE7SFKc0YfCtbhVZh2wbQFA5au/gipCIuDf2TplUc6dGhvM8BG/IbTvOIsfNv2axJ 0L+A== X-Gm-Message-State: AJIora+NG/eYi1B1wb9l8mC6zncf3CPtFG80HzpUpc3icBYT3aGd7ZSJ UZctfBce7h8D8GGt9hJ9U8E2g9+f1f4= X-Google-Smtp-Source: AGRyM1vw8UoZsqmcNEu5ZT5rcMeOacvbgCBAsbaN7MCgbxdcmOfjyMNMGTDueEzsK6ayTT/9FlNvXw== X-Received: by 2002:a17:906:ef8b:b0:72b:58da:b115 with SMTP id ze11-20020a170906ef8b00b0072b58dab115mr30542476ejb.417.1658255931044; Tue, 19 Jul 2022 11:38:51 -0700 (PDT) Received: from hthiery.fritz.box ([2a02:810b:5a40:2a43:8e16:45ff:fe22:ad85]) by smtp.gmail.com with ESMTPSA id sb12-20020a1709076d8c00b0072b2ffc662esm6912665ejc.156.2022.07.19.11.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 11:38:50 -0700 (PDT) From: Heiko Thiery To: u-boot@lists.denx.de Cc: =?utf-8?q?Pali_Roh=C3=A1r?= , Stefan Roese , Simon Glass , Chris Packham , =?utf-8?q?Marek_Beh=C3=BAn?= , AKASHI Takahiro , Samuel Holland , Heiko Thiery Subject: [PATCH 1/2] tools: mkeficapsule: use pkg-config to get -luuid and -lgnutls Date: Tue, 19 Jul 2022 20:38:37 +0200 Message-Id: <20220719183837.536343-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 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 Reviewed-by: Heinrich Schuchardt --- tools/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index 9f2339666a..9f6b282ad8 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -242,7 +242,8 @@ hostprogs-$(CONFIG_MIPS) += mips-relocs hostprogs-$(CONFIG_ASN1_COMPILER) += asn1_compiler HOSTCFLAGS_asn1_compiler.o = -idirafter $(srctree)/include -HOSTLDLIBS_mkeficapsule += -lgnutls -luuid +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 From patchwork Tue Jul 19 18:38:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1658179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=KLUy0DyI; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LnSKb24Ptz9s2R for ; Wed, 20 Jul 2022 04:39:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 778A38405E; Tue, 19 Jul 2022 20:39:10 +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="KLUy0DyI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B8B368403C; Tue, 19 Jul 2022 20:39:04 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (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 D715F8405C for ; Tue, 19 Jul 2022 20:38:59 +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-x62d.google.com with SMTP id b11so28816738eju.10 for ; Tue, 19 Jul 2022 11:38:59 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=eauDl9rSGtHwQbEkj9Yh+VK/0H2L+thxh/BnsCvMYwI=; b=KLUy0DyINho9wM6ZC35n7o3UG9hJL8f5E5fpheFGkU5pT6blnAm7zNnb5mJ2d8kMOX KOgaphJyJmDbUslL4XsYkEaqTokksexL+u2R1gMubkDIVZueX7h6Z6OwSlC5MA0pBTiX kdAelpmDcM84bohgfzZSuboWNJTGTzLRvCi/nV5alJn3NXQrAlMvAjisk85jhIDJzv8+ vHdmH1ZqS9oyMfiqiNSO+CagN4+G0u+HAdqiZ08T2MYfVeE6suHALBJPm8QK+K12JWZX Nlv/EQQxlnibsYIrKh1iPMdRTubD3vjzf1G6a+8xlNXebT2Cbp4RGgA2NGiXlQph2IN1 psnQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=eauDl9rSGtHwQbEkj9Yh+VK/0H2L+thxh/BnsCvMYwI=; b=0p4BwQQrJKbHvWf9keba4kpO1FsSkcBpH852Sr7b9mrLpf2Z9JubmAJzq4isHqeH3Z YHzihXvUZGyay5kbAW4fY1HgDsKLWBHzlnbQLiz+CjIXR8XrLeqaBv1+GMnEAA98CADQ nfvygM3NTFKzOdktAbtjou9Ht1HvMaTXK8oEl4zH80ZoJzanTiLlEMxmI4E0VHDM+lMY c9C7ZosvOXpBhpEe18+CtGPifOL3Ikl7j888x+U8ViGRLsKN8embIp+nxlg+M662abiU iiAkmM7aaUmuIEC2WQFYq+GecuxFr4L/cJxrNL3Y9N3pacS0HNDjp+dT1bmOj9PA6vdF 2gtg== X-Gm-Message-State: AJIora9sm+noJ7vtaiUQEz2VDrlHgIm+AlfVz3ZjGIg8gCbwQGZ3W/LS v64sv7ZFMsM0Qf0GznPtxDqJXaxzSXI= X-Google-Smtp-Source: AGRyM1tUx9NFV0C8LFDHjlMex8H6Id57l47ktLY6AsE/TBDKxsx6Wi8duP3D7IK8k02r4RZZpTudAg== X-Received: by 2002:a17:907:7ba2:b0:72b:57da:a76e with SMTP id ne34-20020a1709077ba200b0072b57daa76emr31683509ejc.210.1658255938702; Tue, 19 Jul 2022 11:38:58 -0700 (PDT) Received: from hthiery.fritz.box ([2a02:810b:5a40:2a43:8e16:45ff:fe22:ad85]) by smtp.gmail.com with ESMTPSA id sb12-20020a1709076d8c00b0072b2ffc662esm6912665ejc.156.2022.07.19.11.38.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 11:38:57 -0700 (PDT) From: Heiko Thiery To: u-boot@lists.denx.de Cc: =?utf-8?q?Pali_Roh=C3=A1r?= , Stefan Roese , Simon Glass , Chris Packham , =?utf-8?q?Marek_Beh=C3=BAn?= , AKASHI Takahiro , Samuel Holland , Heiko Thiery Subject: [PATCH 2/2] tools: kwboot: use pkg-config to get -ltinfo Date: Tue, 19 Jul 2022 20:38:39 +0200 Message-Id: <20220719183837.536343-2-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220719183837.536343-1-heiko.thiery@gmail.com> References: <20220719183837.536343-1-heiko.thiery@gmail.com> MIME-Version: 1.0 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 -ltinfo as the flags needed to build kwboot, use pkg-config when available. We gracefully fallback on the previous behavior of hardcoding -ltinfo if pkg-config is not available or fails with an error. Signed-off-by: Heiko Thiery Reviewed-by: Pali Rohár --- tools/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index 9f6b282ad8..45195a8ce7 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -198,7 +198,9 @@ hostprogs-$(CONFIG_EXYNOS5420) += mkexynosspl HOSTCFLAGS_mkexynosspl.o := -pedantic HOSTCFLAGS_kwboot.o += -pthread -HOSTLDLIBS_kwboot += -pthread -ltinfo +HOSTLDLIBS_kwboot += -pthread +HOSTLDLIBS_kwboot += \ + $(shell pkg-config --libs tinfo 2> /dev/null || echo "-ltinfo") ifdtool-objs := $(LIBFDT_OBJS) ifdtool.o hostprogs-$(CONFIG_X86) += ifdtool