public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf build: conditionally add feature check flags for libtrace{event,fs}
@ 2024-06-27 15:06 Guilherme Amadio
  2024-06-27 15:06 ` [PATCH 2/2] perf build: warn if libtracefs is not found Guilherme Amadio
  2024-06-28 13:06 ` [PATCH 1/2] perf build: conditionally add feature check flags for libtrace{event,fs} Guilherme Amadio
  0 siblings, 2 replies; 5+ messages in thread
From: Guilherme Amadio @ 2024-06-27 15:06 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Namhyung Kim, Ian Rogers, Linux Kernel Mailing List,
	linux-perf-users, Guilherme Amadio

This avoids reported warnings when the packages are not installed.

Fixes: 0f0e1f44569061e3dc590cd0b8cb74d8fd53706b
Signed-off-by: Guilherme Amadio <amadio@gentoo.org>
---
 tools/perf/Makefile.config | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 81f73f68d256..987b48f242d3 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -182,14 +182,6 @@ endif
 FEATURE_CHECK_CFLAGS-libzstd := $(LIBZSTD_CFLAGS)
 FEATURE_CHECK_LDFLAGS-libzstd := $(LIBZSTD_LDFLAGS)
 
-# for linking with debug library, run like:
-# make DEBUG=1 PKG_CONFIG_PATH=/opt/libtraceevent/(lib|lib64)/pkgconfig
-FEATURE_CHECK_CFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --cflags libtraceevent)
-FEATURE_CHECK_LDFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --libs libtraceevent)
-
-FEATURE_CHECK_CFLAGS-libtracefs := $(shell $(PKG_CONFIG) --cflags libtracefs)
-FEATURE_CHECK_LDFLAGS-libtracefs := $(shell $(PKG_CONFIG) --libs libtracefs)
-
 FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi
 # include ARCH specific config
 -include $(src-perf)/arch/$(SRCARCH)/Makefile
@@ -211,6 +203,17 @@ endif
 ifneq ($(NO_LIBTRACEEVENT),1)
   ifeq ($(call get-executable,$(PKG_CONFIG)),)
   dummy := $(error Error: $(PKG_CONFIG) needed by libtraceevent is missing on this system, please install it)
+  else
+    ifeq ($(shell $(PKG_CONFIG) --exists libtraceevent),0)
+      # for linking with debug library, run like:
+      # make DEBUG=1 PKG_CONFIG_PATH=/opt/libtraceevent/(lib|lib64)/pkgconfig
+      FEATURE_CHECK_CFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --cflags libtraceevent)
+      FEATURE_CHECK_LDFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --libs libtraceevent)
+    endif
+    ifeq ($(shell $(PKG_CONFIG) --exists libtracefs),0)
+      FEATURE_CHECK_CFLAGS-libtracefs := $(shell $(PKG_CONFIG) --cflags libtracefs)
+      FEATURE_CHECK_LDFLAGS-libtracefs := $(shell $(PKG_CONFIG) --libs libtracefs)
+    endif
   endif
 endif
 
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-06-28 18:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-27 15:06 [PATCH 1/2] perf build: conditionally add feature check flags for libtrace{event,fs} Guilherme Amadio
2024-06-27 15:06 ` [PATCH 2/2] perf build: warn if libtracefs is not found Guilherme Amadio
2024-06-27 17:26   ` Ian Rogers
2024-06-28 13:06 ` [PATCH 1/2] perf build: conditionally add feature check flags for libtrace{event,fs} Guilherme Amadio
2024-06-28 18:54   ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox