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 A28B8C433EF for ; Tue, 19 Jul 2022 19:15:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C956084079; Tue, 19 Jul 2022 21:15:45 +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="kR3DSSwS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3122D84070; Tue, 19 Jul 2022 21:15:44 +0200 (CEST) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (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 25E3F84079 for ; Tue, 19 Jul 2022 21:15:42 +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-x629.google.com with SMTP id va17so29107490ejb.0 for ; Tue, 19 Jul 2022 12:15:42 -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=qXSu5qopkGgB8hgkrOmZQb+6T8jxXObC1ZLxdJ7yna4=; b=kR3DSSwS4xK5sw6qxsOTwazVfjxFIFiHPhiM6hVu31DDLgVybG9m9E0HuZR/+Swk0S 8o8ZkyKJdGzjunX5mx/+OiCuNYW4Q1olwccUcyXgH/Xq3FraB6/ie3K9qjdSCRNNo3h4 82H6/qwopoyjWoPVtCDDA5IyEZBgsm+K1rPeQQEBXb2hEZdzLNcwX0ac0c+p7ClF+wib B/2c5L+ONjSmjnlRxrYbOH0LjP7ZpI4s/by23mgq7TBlKIvoiSLWpwdHLfCkEtfKGkEQ D0tYpxjHntG3otAh/Ap2cIMZspAzbMcPQl9o4lDPEDE5ZueGVJHxMgYKwMxZ1QJre0jH b3lA== 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=qXSu5qopkGgB8hgkrOmZQb+6T8jxXObC1ZLxdJ7yna4=; b=hHP8tcdhEeGY7wazLZgLQutPW7ro0GhKb6Qy9bI0JTpPkGbguUhyhCqc0lzWGOclKP dHJovoAtsDpOj6Meh+tsfh8+IsxcEhkn/wkX6WO3yY7i3IDKkDI3niPIAy7ZAgBGzBhj U6CIQmSPwuCfezPYKrz7zaAhgOGxkPymgVS9rzAcMzZYfrjlfZPxe48/4rvHb9hwf9WJ Q2WcLgdQyRYaNipnPom0H9ZN3m9Mrl3MGsrvnU5kyhci+VYoUXcp1XU7yCTyR/T+DopY eg40hKyPfnZp+2qriP+uOMHMw0LzV33kXBPwNXxoAEpbVnA04/bJT19k8gDQjmfQmTD9 KVMw== X-Gm-Message-State: AJIora8LPywBGEyCFnZxZY13lWJoEZ7mhmKf3ni/jzc4bC8ZkAnadjAX wjRSCFAScZopHvJIGg87G73uDpVCJrjBSg== X-Google-Smtp-Source: AGRyM1sk7WdZB+61+gehJQo4eVnsWrOcnyQh3Hxblh4jEteGsHnvqAvtn1GhATpFAFQcL8rD6QRwQg== X-Received: by 2002:a17:907:7e87:b0:72b:4af3:bf57 with SMTP id qb7-20020a1709077e8700b0072b4af3bf57mr32397593ejc.9.1658258140953; Tue, 19 Jul 2022 12:15:40 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 12:15:40 -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 2/2] tools: kwboot: use pkg-config to get -ltinfo Date: Tue, 19 Jul 2022 21:15:17 +0200 Message-Id: <20220719191515.559452-2-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220719191515.559452-1-heiko.thiery@gmail.com> References: <20220719191515.559452-1-heiko.thiery@gmail.com> 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 -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 --- v2: - also add cflags detection via pkg-config (Thanks Pali) tools/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index aab06aec93..55d7ea7476 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -198,7 +198,11 @@ hostprogs-$(CONFIG_EXYNOS5420) += mkexynosspl HOSTCFLAGS_mkexynosspl.o := -pedantic HOSTCFLAGS_kwboot.o += -pthread -HOSTLDLIBS_kwboot += -pthread -ltinfo +HOSTCFLAGS_kwboot.o += \ + $(shell pkg-config --cflags tinfo 2> /dev/null || echo "") +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 -- 2.30.2