From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753928AbcBPGhx (ORCPT ); Tue, 16 Feb 2016 01:37:53 -0500 Received: from mail-pf0-f181.google.com ([209.85.192.181]:36358 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753846AbcBPGhu (ORCPT ); Tue, 16 Feb 2016 01:37:50 -0500 From: Stephane Eranian To: linux-kernel@vger.kernel.org Cc: acme@redhat.com, peterz@infradead.org, mingo@elte.hu, ak@linux.intel.com, kan.liang@intel.com, jolsa@redhat.com, namhyung@kernel.org, adrian.hunter@intel.com, dsahern@gmail.com Subject: [PATCH] perf/jvmti: add check for java alternatives cmd in Makefile Date: Tue, 16 Feb 2016 07:37:41 +0100 Message-Id: <1455604661-9357-1-git-send-email-eranian@google.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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