From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423461AbcB0Jkn (ORCPT ); Sat, 27 Feb 2016 04:40:43 -0500 Received: from torg.zytor.com ([198.137.202.12]:39090 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756291AbcB0Jkl (ORCPT ); Sat, 27 Feb 2016 04:40:41 -0500 Date: Sat, 27 Feb 2016 01:39:57 -0800 From: tip-bot for Stephane Eranian Message-ID: Cc: hpa@zytor.com, tglx@linutronix.de, adrian.hunter@intel.com, acme@redhat.com, peterz@infradead.org, jolsa@redhat.com, kan.liang@intel.com, linux-kernel@vger.kernel.org, eranian@google.com, namhyung@kernel.org, mingo@kernel.org, ak@linux.intel.com Reply-To: namhyung@kernel.org, eranian@google.com, linux-kernel@vger.kernel.org, ak@linux.intel.com, mingo@kernel.org, peterz@infradead.org, acme@redhat.com, adrian.hunter@intel.com, tglx@linutronix.de, hpa@zytor.com, kan.liang@intel.com, jolsa@redhat.com In-Reply-To: <1456378056-18812-1-git-send-email-eranian@google.com> References: <1456378056-18812-1-git-send-email-eranian@google.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf jvmti: improve error message in Makefile Git-Commit-ID: 7e9551bc72201838ebaf388224ff43ddf2b0d853 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: 7e9551bc72201838ebaf388224ff43ddf2b0d853 Gitweb: http://git.kernel.org/tip/7e9551bc72201838ebaf388224ff43ddf2b0d853 Author: Stephane Eranian AuthorDate: Thu, 25 Feb 2016 06:27:36 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 25 Feb 2016 10:43:28 -0300 perf jvmti: improve error message in Makefile This patch improves the error message given by jvmti Makefile when the alternatives command cannot be found. It now suggests the user locates the root of their Java installation and pass it with JDIR= Signed-off-by: Stephane Eranian Cc: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Cc: Kan Liang Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1456378056-18812-1-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/jvmti/Makefile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/perf/jvmti/Makefile b/tools/perf/jvmti/Makefile index 0277a64..5ce61a1 100644 --- a/tools/perf/jvmti/Makefile +++ b/tools/perf/jvmti/Makefile @@ -35,12 +35,21 @@ 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') -else +ifneq (,$(wildcard /usr/sbin/update-java-alternatives)) JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3) +else + ifneq (,$(wildcard /usr/sbin/alternatives)) + JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g') + endif endif - +ifndef JDIR +$(error Could not find alternatives command, you need to set JDIR= to point to the root of your Java directory) +else + ifeq (,$(wildcard $(JDIR)/include/jvmti.h)) + $(error the openjdk development package appears to me missing, install and try again) + endif +endif +$(info Using Java from $(JDIR)) # -lrt required in 32-bit mode for clock_gettime() LIBS=-lelf -lrt INCDIR=-I $(JDIR)/include -I $(JDIR)/include/linux