From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760444AbcBYNpt (ORCPT ); Thu, 25 Feb 2016 08:45:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52722 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759644AbcBYNps (ORCPT ); Thu, 25 Feb 2016 08:45:48 -0500 Date: Thu, 25 Feb 2016 10:45:42 -0300 From: Arnaldo Carvalho de Melo To: Stephane Eranian Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@elte.hu, ak@linux.intel.com, kan.liang@intel.com, jolsa@redhat.com, namhyung@kernel.org, adrian.hunter@intel.com, acme@kernel.org Subject: Re: [PATCH] perf/jvmti: improve error message in Makefile Message-ID: <20160225134542.GE2749@redhat.com> References: <1456378056-18812-1-git-send-email-eranian@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456378056-18812-1-git-send-email-eranian@google.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-12-10) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 25 Feb 2016 13:45:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Feb 25, 2016 at 06:27:36AM +0100, Stephane Eranian escreveu: > 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= Thanks, tested on a RHEL6.7 VM without openjdk packages, works as advertised. Applied. - Arnaldo > Signed-off-by: Stephane Eranian > --- > 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 0277a64b391b..5ce61a1bda9c 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 > -- > 1.9.1