Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1335070

[PATCH] perf/jvmti: add check for java alternatives cmd in Makefile

From Stephane Eranian <eranian@google.com>
Newsgroups linux.kernel
Subject [PATCH] perf/jvmti: add check for java alternatives cmd in Makefile
Date 2016-02-16 07:40 +0100
Message-ID <r2HsK-408-27@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


This patch modifies the jvmti makefile to check
if /usr/sbin/java-update-alternatives is present.
If so, then use it, if not then use the altenatives
command. This helps handle the difference between
Ubuntu and Fedora Linux distributions.

Signed-off-by: Stephane Eranian <eranian@google.com>
---
 tools/perf/jvmti/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/jvmti/Makefile b/tools/perf/jvmti/Makefile
index 5968f83..0277a64 100644
--- a/tools/perf/jvmti/Makefile
+++ b/tools/perf/jvmti/Makefile
@@ -35,8 +35,12 @@ SOLIBEXT=so
 
 # The following works at least on fedora 23, you may need the next
 # line for other distros.
+ifeq (,$(wildcard /usr/sbin/update-java-alternatives))
 JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g')
-#JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3)
+else
+JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3)
+endif
+
 # -lrt required in 32-bit mode for clock_gettime()
 LIBS=-lelf -lrt
 INCDIR=-I $(JDIR)/include -I $(JDIR)/include/linux
-- 
2.5.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] perf/jvmti: add check for java alternatives cmd in Makefile Stephane Eranian <eranian@google.com> - 2016-02-16 07:40 +0100
  Re: [PATCH] perf/jvmti: add check for java alternatives cmd in  Makefile Arnaldo Carvalho de Melo <acme@redhat.com> - 2016-02-16 15:40 +0100
    Re: [PATCH] perf/jvmti: add check for java alternatives cmd in  Makefile Namhyung Kim <namhyung@kernel.org> - 2016-02-16 15:40 +0100
      Re: [PATCH] perf/jvmti: add check for java alternatives cmd in  Makefile Arnaldo Carvalho de Melo <acme@redhat.com> - 2016-02-16 17:00 +0100
  [tip:perf/core] perf jvmti:   Add check for java alternatives cmd in Makefile tip-bot for Stephane Eranian <tipbot@zytor.com> - 2016-02-17 13:10 +0100

csiph-web