Skip to content

Commit 1d302f6

Browse files
amadionamhyung
authored andcommitted
perf build: Conditionally add feature check flags for libtrace{event,fs}
This avoids reported warnings when the packages are not installed. [namhyung]: Removed the dummy assignment and unnecessary ifeq checks. Fixes: 0f0e1f4 ("perf build: Use pkg-config for feature check for libtrace{event,fs}") Signed-off-by: Guilherme Amadio <[email protected]> Cc: Leo Yan <[email protected]> Cc: Thorsten Leemhuis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
1 parent 608c3b1 commit 1d302f6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tools/perf/Makefile.config

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,19 @@ endif
182182
FEATURE_CHECK_CFLAGS-libzstd := $(LIBZSTD_CFLAGS)
183183
FEATURE_CHECK_LDFLAGS-libzstd := $(LIBZSTD_LDFLAGS)
184184

185+
ifneq ($(NO_LIBTRACEEVENT),1)
186+
ifeq ($(call get-executable,$(PKG_CONFIG)),)
187+
$(error Error: $(PKG_CONFIG) needed by libtraceevent is missing on this system, please install it)
188+
endif
189+
endif
190+
185191
# for linking with debug library, run like:
186192
# make DEBUG=1 PKG_CONFIG_PATH=/opt/libtraceevent/(lib|lib64)/pkgconfig
187-
FEATURE_CHECK_CFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --cflags libtraceevent)
188-
FEATURE_CHECK_LDFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --libs libtraceevent)
193+
FEATURE_CHECK_CFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --cflags libtraceevent 2>/dev/null)
194+
FEATURE_CHECK_LDFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --libs libtraceevent 2>/dev/null)
189195

190-
FEATURE_CHECK_CFLAGS-libtracefs := $(shell $(PKG_CONFIG) --cflags libtracefs)
191-
FEATURE_CHECK_LDFLAGS-libtracefs := $(shell $(PKG_CONFIG) --libs libtracefs)
196+
FEATURE_CHECK_CFLAGS-libtracefs := $(shell $(PKG_CONFIG) --cflags libtracefs 2>/dev/null)
197+
FEATURE_CHECK_LDFLAGS-libtracefs := $(shell $(PKG_CONFIG) --libs libtracefs 2>/dev/null)
192198

193199
FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi
194200
# include ARCH specific config
@@ -208,12 +214,6 @@ ifeq ($(call get-executable,$(BISON)),)
208214
$(error Error: $(BISON) is missing on this system, please install it)
209215
endif
210216

211-
ifneq ($(NO_LIBTRACEEVENT),1)
212-
ifeq ($(call get-executable,$(PKG_CONFIG)),)
213-
dummy := $(error Error: $(PKG_CONFIG) needed by libtraceevent is missing on this system, please install it)
214-
endif
215-
endif
216-
217217
ifneq ($(OUTPUT),)
218218
ifeq ($(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \>\= 371), 1)
219219
BISON_FILE_PREFIX_MAP := --file-prefix-map=$(OUTPUT)=

0 commit comments

Comments
 (0)