From nobody Wed Dec 17 12:20:46 2025 Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB4833CF73; Fri, 12 Jul 2024 19:45:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720813538; cv=none; b=QYQtjyNHyDfZSJ5ga4Lbc18U+RzYy7tTLIJvSjjvh8KA91vQfqI9sqxCS1Q5ca9k7YTP7khB4aadSVdtjB+BMjEjng+GydZAoaiiYjX3vAMNaX7HMiwvPsp9tjMNgE2ZCbTHLNalXamfY6aV2MmJonahwIXccryVQ3VSSXnwhks= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720813538; c=relaxed/simple; bh=UMrtHpRglXiRcoXLUecsnQQUiI2xFXvCAxxgtcGDmXk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rFyRNu+6hndZojin+dILIjsDQiAaKu9TdWgYgH1y438k2Olweh76MFLaAo+5hxMVCcCjkY2ooyZHC+MrfDO6tCgjcK0UvmhhCUQAbDY5cTYHwkgpeNc3s1nh4mvyecfLYwsgyZp0s6kAUQpXeF0Zye3lH1wn8i0V9uoafrxbVyM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentoo.org; spf=pass smtp.mailfrom=gentoo.org; arc=none smtp.client-ip=140.211.166.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gentoo.org From: Guilherme Amadio To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Ian Rogers , Thorsten Leemhuis , Leo Yan , linux-perf-users@vger.kernel.org, Linux Kernel Mailing List , Guilherme Amadio Subject: [PATCH v3 2/5] tools: Make pkg-config dependency checks usable by other tools Date: Fri, 12 Jul 2024 21:40:47 +0200 Message-ID: <20240712194511.3973899-3-amadio@gentoo.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240712194511.3973899-1-amadio@gentoo.org> References: <20240712194511.3973899-1-amadio@gentoo.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Other tools, in tools/verification and tools/tracing, make use of libtraceevent and libtracefs as dependencies. This allows setting up the feature check flags for them as well. Signed-off-by: Guilherme Amadio --- tools/build/Makefile.feature | 18 ++++++++++++++++++ tools/perf/Makefile.config | 11 +++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature index 1e2ab148d5db..e1900abd44f6 100644 --- a/tools/build/Makefile.feature +++ b/tools/build/Makefile.feature @@ -149,6 +149,24 @@ FEATURE_DISPLAY ?=3D \ # FEATURE_GROUP_MEMBERS-libbfd =3D libbfd-liberty libbfd-liberty-z =20 +# +# Declare list of feature dependency packages that provide pkg-config file= s. +# +FEATURE_PKG_CONFIG ?=3D \ + libtraceevent \ + libtracefs + +feature_pkg_config =3D $(eval $(feature_pkg_config_code)) +define feature_pkg_config_code + FEATURE_CHECK_CFLAGS-$(1) :=3D $(shell $(PKG_CONFIG) --cflags $(1) 2>/de= v/null) + FEATURE_CHECK_LDFLAGS-$(1) :=3D $(shell $(PKG_CONFIG) --libs $(1) 2>/dev= /null) +endef + +# Set FEATURE_CHECK_(C|LD)FLAGS-$(package) for packages using pkg-config. +ifneq ($(PKG_CONFIG),) + $(foreach package,$(FEATURE_PKG_CONFIG),$(call feature_pkg_config,$(pack= age))) +endif + # Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features. # If in the future we need per-feature checks/flags for features not # mentioned in this list we need to refactor this ;-). diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 44f010b9f562..c896babf7a74 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -182,20 +182,15 @@ endif FEATURE_CHECK_CFLAGS-libzstd :=3D $(LIBZSTD_CFLAGS) FEATURE_CHECK_LDFLAGS-libzstd :=3D $(LIBZSTD_LDFLAGS) =20 +# for linking with debug library, run like: +# make DEBUG=3D1 PKG_CONFIG_PATH=3D/opt/libtraceevent/(lib|lib64)/pkgconfig + ifneq ($(NO_LIBTRACEEVENT),1) ifeq ($(call get-executable,$(PKG_CONFIG)),) $(error Error: $(PKG_CONFIG) needed by libtraceevent is missing on thi= s system, please install it) endif endif =20 -# for linking with debug library, run like: -# make DEBUG=3D1 PKG_CONFIG_PATH=3D/opt/libtraceevent/(lib|lib64)/pkgconfig -FEATURE_CHECK_CFLAGS-libtraceevent :=3D $(shell $(PKG_CONFIG) --cflags lib= traceevent 2>/dev/null) -FEATURE_CHECK_LDFLAGS-libtraceevent :=3D $(shell $(PKG_CONFIG) --libs libt= raceevent 2>/dev/null) - -FEATURE_CHECK_CFLAGS-libtracefs :=3D $(shell $(PKG_CONFIG) --cflags libtra= cefs 2>/dev/null) -FEATURE_CHECK_LDFLAGS-libtracefs :=3D $(shell $(PKG_CONFIG) --libs libtrac= efs 2>/dev/null) - FEATURE_CHECK_CFLAGS-bpf =3D -I. -I$(srctree)/tools/include -I$(srctree)/t= ools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi # include ARCH specific config -include $(src-perf)/arch/$(SRCARCH)/Makefile --=20 2.45.2