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 7065BC433EF for ; Wed, 20 Jul 2022 10:32:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4ACDD84079; Wed, 20 Jul 2022 12:32:01 +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="Pq9dwcf7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 183D482EEA; Wed, 20 Jul 2022 12:31:59 +0200 (CEST) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (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 2BB3884089 for ; 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=heiko.thiery@gmail.com Received: by mail-ed1-x535.google.com with SMTP id t3so23232802edd.0 for ; Wed, 20 Jul 2022 03:31:54 -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=ENJUrEPa2mK9hgkoG1dLXioiYd6MdI9lHtib6C6KQM8=; b=Pq9dwcf7fx3E3nEJwRpibNjaj9jSRY53ww4gqeCuNkg86DSPgTPq5hUppnrbaLTYMY l8G/aJsuOrOT8fNV1eyAauJ56BoktrJjs0sHZ23ZjQqLTB+FRWMEFpyhyX4NTf0iCzi9 YWT3eUTYNVQYZbG6FvS9zNvftWszhzA1k/LKWkVyTFtqR9QgJwGWOU5ylsVGJ2QNOmz2 XinaZgIShQPMnaV1iVW5dlix0Cq16iDaPiqbrbaLhdRz8fvPNvRmSyV1aq5Coq0w21DF JGG7ppDXG7+EUGbJM9caC9NNnu9yXFfUdqH0wRWzAVnjoIu3OPiic0RzHUkVTDGG5R7Z 32bw== 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=ENJUrEPa2mK9hgkoG1dLXioiYd6MdI9lHtib6C6KQM8=; b=EVN6V5RNSAWP+yK133oR5hEJ5domOWkr0gAXNmIAgDFVIXnKzU2FbqUerBj2cGiHQa CGgjEsICHclRXf6zSY7Z1l+6EHrspr/WFO+YpV5tRr1cw28ExRGdUMMSj6kQ2ihm0jYz A+Iy7XRc6v0yLdVFRCjJmzH60AFLm61uxcw/QFcZC80Wxjmw8RvAlbB74QS/GV1Uhgkn Xc3ZSeOi1V6tdOr++xHGpm6bQdCySWM1SAMvm+/mpyG8ukyGXQWWr67G+CGOVKCniZdU Kse+WDuDMddCbkwU/7ZVdnARbL34Ren2k2rTt16U40DaOb3erQQeg4OID3p+KGbfbcMC SOUw== X-Gm-Message-State: AJIora87rGCWOZB5w3V8qImjw+AybJdY4ub8bsIWsOQfR+iDrooKLjPT sgf0+cVOIKCDrdcwx52Nb91PrhS7BKw= X-Google-Smtp-Source: AGRyM1sU5VEviCfh5QH7To6CUvPCkyzS7n8K49J7myQV/HuJgBx9jKHHm9Q6crNWr/OMMZIOswOIgg== X-Received: by 2002:a05:6402:c44:b0:431:52cc:f933 with SMTP id cs4-20020a0564020c4400b0043152ccf933mr49834577edb.41.1658313113089; Wed, 20 Jul 2022 03:31:53 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 03:31:52 -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 2/2] tools: kwboot: use pkg-config to get -ltinfo Date: Wed, 20 Jul 2022 12:31:35 +0200 Message-Id: <20220720103133.601566-2-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220720103133.601566-1-heiko.thiery@gmail.com> References: <20220720103133.601566-1-heiko.thiery@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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. Reviewed-by: Pali Rohár Signed-off-by: Heiko Thiery --- v3: - remove cflags detection again - added reviewed-by v2: - also add cflags detection via pkg-config (Thanks Pali) tools/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index aab06aec93..005e7362a3 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 -- 2.30.2