[PATCH v2 3/4] perf build: Clear GTK4 instead of setting unused NO_GTK4 when gtk4 is missing

From: Ian Rogers

Date: Thu Oct 01 2026 - 01:41:52 EST


Commit 4751bddd3f98 ("perf tools: Make GTK2 support opt-in") switched
Makefile.config and Makefile.perf from checking 'ifndef NO_GTK2' to
'ifdef GTK2' (now 'ifdef GTK4'), leaving 'NO_GTK4 := 1' in
Makefile.config unused. As a result, when building with GTK4=1 on a
system without gtk4 development headers, Makefile.perf still attempted
to build and install libperf-gtk.so under 'ifdef GTK4'.

Replace 'NO_GTK4 := 1' with 'override GTK4 :=' so that 'ifdef GTK4' in
Makefile.perf evaluates to false when the gtk4 feature check fails.

Fixes: 4751bddd3f98 ("perf tools: Make GTK2 support opt-in")
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/Makefile.config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 8f46885d6df5..cafc7be79643 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -786,7 +786,7 @@ ifdef GTK4
$(call feature_check,gtk4)
ifneq ($(feature-gtk4), 1)
$(warning GTK4 not found, disables GTK4 support. Please install gtk4-devel or libgtk-4-dev)
- NO_GTK4 := 1
+ override GTK4 :=
else
CFLAGS += -DHAVE_GTK4_SUPPORT
GTK_CFLAGS += $(shell $(PKG_CONFIG) --cflags gtk4 2>/dev/null)
--
2.56.0.rc1.315.gc6ed9934b7-goog