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