From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934251AbcBQMHm (ORCPT ); Wed, 17 Feb 2016 07:07:42 -0500 Received: from terminus.zytor.com ([198.137.202.10]:55842 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934160AbcBQMHj (ORCPT ); Wed, 17 Feb 2016 07:07:39 -0500 Date: Wed, 17 Feb 2016 04:06:46 -0800 From: tip-bot for Stephane Eranian Message-ID: Cc: hpa@zytor.com, peterz@infradead.org, ak@linux.intel.com, dsahern@gmail.com, linux-kernel@vger.kernel.org, namhyung@kernel.org, eranian@google.com, acme@redhat.com, mingo@kernel.org, jolsa@redhat.com, adrian.hunter@intel.com, kan.liang@intel.com, tglx@linutronix.de Reply-To: mingo@kernel.org, acme@redhat.com, eranian@google.com, adrian.hunter@intel.com, jolsa@redhat.com, kan.liang@intel.com, tglx@linutronix.de, peterz@infradead.org, ak@linux.intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org, dsahern@gmail.com, namhyung@kernel.org In-Reply-To: <1455604661-9357-1-git-send-email-eranian@google.com> References: <1455604661-9357-1-git-send-email-eranian@google.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf jvmti: Add check for java alternatives cmd in Makefile Git-Commit-ID: d646ae0a73deb0d80792a6a9c0757317ad8049c5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d646ae0a73deb0d80792a6a9c0757317ad8049c5 Gitweb: http://git.kernel.org/tip/d646ae0a73deb0d80792a6a9c0757317ad8049c5 Author: Stephane Eranian AuthorDate: Tue, 16 Feb 2016 07:37:41 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 16 Feb 2016 17:12:46 -0300 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 Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Jiri Olsa Cc: Kan Liang Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1455604661-9357-1-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo --- 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