Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e9551bc authored by Stephane Eranian's avatar Stephane Eranian Committed by Arnaldo Carvalho de Melo
Browse files

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: default avatarStephane Eranian <eranian@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.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/1456378056-18812-1-git-send-email-eranian@google.com


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 5104ffb2
Loading
Loading
Loading
Loading
+13 −4
Original line number Original line Diff line number Diff line
@@ -35,12 +35,21 @@ SOLIBEXT=so


# The following works at least on fedora 23, you may need the next
# The following works at least on fedora 23, you may need the next
# line for other distros.
# line for other distros.
ifeq (,$(wildcard /usr/sbin/update-java-alternatives))
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')
    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
else
JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3)
  ifeq (,$(wildcard $(JDIR)/include/jvmti.h))
  $(error the openjdk development package appears to me missing, install and try again)
  endif
  endif

endif
$(info Using Java from $(JDIR))
# -lrt required in 32-bit mode for clock_gettime()
# -lrt required in 32-bit mode for clock_gettime()
LIBS=-lelf -lrt
LIBS=-lelf -lrt
INCDIR=-I $(JDIR)/include -I $(JDIR)/include/linux
INCDIR=-I $(JDIR)/include -I $(JDIR)/include/linux