aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2013-03-17 19:19:44 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-05-29 07:44:03 -0400
commit3082cb339fb51b156db66516a80599b958dabbf4 (patch)
tree04eaa9f3ef4ae68c320aad81bd38e2e4fa3570bd /tools
parent58cabf6ab1f68f4a44e88bee5d578f68d8a39b38 (diff)
perf tools: Move libperl check config into config/Makefile
Moving libperl check config into config/Makefile. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1369398928-9809-12-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/Makefile20
-rw-r--r--tools/perf/config/Makefile21
2 files changed, 24 insertions, 17 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 8e59a4d40b4e..f856bb5b8009 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -530,23 +530,9 @@ ifndef NO_GTK2
530 LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o 530 LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o
531endif 531endif
532 532
533ifdef NO_LIBPERL 533ifndef NO_LIBPERL
534 BASIC_CFLAGS += -DNO_LIBPERL 534 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
535else 535 LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
536 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
537 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
538 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
539 PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
540 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
541
542 ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED),perl),y)
543 BASIC_CFLAGS += -DNO_LIBPERL
544 else
545 ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS)
546 EXTLIBS += $(PERL_EMBED_LIBADD)
547 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
548 LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
549 endif
550endif 536endif
551 537
552disable-python = $(eval $(disable-python_code)) 538disable-python = $(eval $(disable-python_code))
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 8cf0958c6daa..a42c7b8e071d 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -240,3 +240,24 @@ ifndef NO_GTK2
240 EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null) 240 EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null)
241 endif 241 endif
242endif 242endif
243
244grep-libs = $(filter -l%,$(1))
245strip-libs = $(filter-out -l%,$(1))
246
247ifdef NO_LIBPERL
248 BASIC_CFLAGS += -DNO_LIBPERL
249else
250 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
251 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
252 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
253 PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
254 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
255
256 ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED),perl),y)
257 BASIC_CFLAGS += -DNO_LIBPERL
258 NO_LIBPERL := 1
259 else
260 ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS)
261 EXTLIBS += $(PERL_EMBED_LIBADD)
262 endif
263endif