Skip to content

Commit 4751bdd

Browse files
committed
perf tools: Make GTK2 support opt-in
This is bitrotting, nobody is stepping up to work on it, and since we treat warnings as errors, feature detection is failing in its main, faster test (tools/build/feature/test-all.c) because of the GTK+2 infobar check. So make this opt-in, at some point ditch this if nobody volunteers to take care of this. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 09b54b3 commit 4751bdd

6 files changed

Lines changed: 9 additions & 19 deletions

File tree

‎tools/build/Makefile.feature‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ FEATURE_TESTS_BASIC := \
3838
get_current_dir_name \
3939
gettid \
4040
glibc \
41-
gtk2 \
42-
gtk2-infobar \
4341
libbfd \
4442
libbfd-buildid \
4543
libcap \
@@ -82,6 +80,8 @@ FEATURE_TESTS_EXTRA := \
8280
compile-32 \
8381
compile-x32 \
8482
cplus-demangle \
83+
gtk2 \
84+
gtk2-infobar \
8585
hello \
8686
libbabeltrace \
8787
libbfd-liberty \
@@ -112,7 +112,6 @@ FEATURE_DISPLAY ?= \
112112
dwarf \
113113
dwarf_getlocations \
114114
glibc \
115-
gtk2 \
116115
libbfd \
117116
libbfd-buildid \
118117
libcap \

‎tools/build/feature/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(
9191
###############################
9292

9393
$(OUTPUT)test-all.bin:
94-
$(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -I/usr/include/slang -lslang $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma
94+
$(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -I/usr/include/slang -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma
9595

9696
$(OUTPUT)test-hello.bin:
9797
$(BUILD)

‎tools/build/feature/test-all.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,6 @@
7878
# include "test-libslang.c"
7979
#undef main
8080

81-
#define main main_test_gtk2
82-
# include "test-gtk2.c"
83-
#undef main
84-
85-
#define main main_test_gtk2_infobar
86-
# include "test-gtk2-infobar.c"
87-
#undef main
88-
8981
#define main main_test_libbfd
9082
# include "test-libbfd.c"
9183
#undef main
@@ -209,8 +201,6 @@ int main(int argc, char *argv[])
209201
main_test_libelf_getshdrstrndx();
210202
main_test_libunwind();
211203
main_test_libslang();
212-
main_test_gtk2(argc, argv);
213-
main_test_gtk2_infobar(argc, argv);
214204
main_test_libbfd();
215205
main_test_libbfd_buildid();
216206
main_test_backtrace();

‎tools/perf/Makefile.config‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,12 +724,14 @@ ifndef NO_SLANG
724724
endif
725725
endif
726726

727-
ifndef NO_GTK2
727+
ifdef GTK2
728728
FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
729+
$(call feature_check,gtk2)
729730
ifneq ($(feature-gtk2), 1)
730731
msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
731732
NO_GTK2 := 1
732733
else
734+
$(call feature_check,gtk2-infobar)
733735
ifeq ($(feature-gtk2-infobar), 1)
734736
GTK_CFLAGS := -DHAVE_GTK_INFO_BAR_SUPPORT
735737
endif

‎tools/perf/Makefile.perf‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ include ../scripts/utilities.mak
4848
#
4949
# Define NO_SLANG if you do not want TUI support.
5050
#
51-
# Define NO_GTK2 if you do not want GTK+ GUI support.
51+
# Define GTK2 if you want GTK+ GUI support.
5252
#
5353
# Define NO_DEMANGLE if you do not want C++ symbol demangling.
5454
#
@@ -386,7 +386,7 @@ ifneq ($(OUTPUT),)
386386
CFLAGS += -I$(OUTPUT)
387387
endif
388388

389-
ifndef NO_GTK2
389+
ifdef GTK2
390390
ALL_PROGRAMS += $(OUTPUT)libperf-gtk.so
391391
GTK_IN := $(OUTPUT)gtk-in.o
392392
endif
@@ -886,7 +886,7 @@ check: $(OUTPUT)common-cmds.h
886886

887887
### Installation rules
888888

889-
ifndef NO_GTK2
889+
ifdef GTK2
890890
install-gtk: $(OUTPUT)libperf-gtk.so
891891
$(call QUIET_INSTALL, 'GTK UI') \
892892
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \

‎tools/perf/builtin-version.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ static void library_status(void)
6060
STATUS(HAVE_DWARF_SUPPORT, dwarf);
6161
STATUS(HAVE_DWARF_GETLOCATIONS_SUPPORT, dwarf_getlocations);
6262
STATUS(HAVE_GLIBC_SUPPORT, glibc);
63-
STATUS(HAVE_GTK2_SUPPORT, gtk2);
6463
#ifndef HAVE_SYSCALL_TABLE_SUPPORT
6564
STATUS(HAVE_LIBAUDIT_SUPPORT, libaudit);
6665
#endif

0 commit comments

Comments
 (0)