diff options
author | Stephane Eranian <eranian@google.com> | 2016-02-16 01:37:41 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-02-16 15:12:46 -0500 |
commit | d646ae0a73deb0d80792a6a9c0757317ad8049c5 (patch) | |
tree | 554e5903258c1ad7045fa29da41be141b6ad95e7 /tools | |
parent | fe7a2eaa71c55aadbf95d01d32df8dccc0db0646 (diff) |
perf jvmti: Add check for java alternatives cmd in Makefile
This patch modifies the jvmti makefile to check if the
/usr/sbin/java-update-alternatives utility 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>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1455604661-9357-1-git-send-email-eranian@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/jvmti/Makefile | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/jvmti/Makefile b/tools/perf/jvmti/Makefile index 5968f8332a28..0277a64b391b 100644 --- a/tools/perf/jvmti/Makefile +++ b/tools/perf/jvmti/Makefile | |||
@@ -35,8 +35,12 @@ SOLIBEXT=so | |||
35 | 35 | ||
36 | # The following works at least on fedora 23, you may need the next | 36 | # The following works at least on fedora 23, you may need the next |
37 | # line for other distros. | 37 | # line for other distros. |
38 | ifeq (,$(wildcard /usr/sbin/update-java-alternatives)) | ||
38 | JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g') | 39 | JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g') |
39 | #JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3) | 40 | else |
41 | JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3) | ||
42 | endif | ||
43 | |||
40 | # -lrt required in 32-bit mode for clock_gettime() | 44 | # -lrt required in 32-bit mode for clock_gettime() |
41 | LIBS=-lelf -lrt | 45 | LIBS=-lelf -lrt |
42 | INCDIR=-I $(JDIR)/include -I $(JDIR)/include/linux | 46 | INCDIR=-I $(JDIR)/include -I $(JDIR)/include/linux |