Skip to contentSkip to conversation

perf jit: Fix build issue on Ubuntu

PATCH In review Anton Blanchard 3 participants 3 messages Oct 13, 2016 – Oct 17, 2016 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf jit: Fix build issue on Ubuntu

From: Anton Blanchard <[email protected]>

When building on Ubuntu 16.04, I get the following error:

Makefile:49: *** the openjdk development package appears to me missing, install and try again. Stop.

The problem is that update-java-alternatives has multiple spaces between fields, and cut treats each space as a new delimiter:

java-1.8.0-openjdk-ppc64el 1081 /usr/lib/jvm/java-1.8.0-openjdk-ppc64el

Fix this by using awk, which handles this fine.

---
 tools/perf/jvmti/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/jvmti/Makefile +1 -1
index 5ce61a1..df14e6b 100644
@@ -36,7 +36,7 @@ SOLIBEXT=so
 # The following works at least on fedora 23, you may need the next
 # line for other distros.
 ifneq (,$(wildcard /usr/sbin/update-java-alternatives))
-JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3)
+JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | awk '{print $$3}')
 else
   ifneq (,$(wildcard /usr/sbin/alternatives))
     JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g')
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Anton Blanchard

From: Anton Blanchard <[email protected]>

When building on Ubuntu 16.04, I get the following error:

Makefile:49: *** the openjdk development package appears to me missing, install and try again. Stop.

Quoted 8 lines

The problem is that update-java-alternatives has multiple spaces between fields, and cut treats each space as a new delimiter:

java-1.8.0-openjdk-ppc64el 1081 /usr/lib/jvm/java-1.8.0-openjdk-ppc64el

Fix this by using awk, which handles this fine.

Works for me. Thanks.

Quoted 21 lines
---
 tools/perf/jvmti/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/jvmti/Makefile +1 -2
index 5ce61a1..df14e6b 100644
@@ -36,7 +36,7 @@ SOLIBEXT=so
 # The following works at least on fedora 23, you may need the next
 # line for other distros.
 ifneq (,$(wildcard /usr/sbin/update-java-alternatives))
-JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3)
+JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | awk '{print $$3}')
 else
   ifneq (,$(wildcard /usr/sbin/alternatives))
     JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g')
--

2.7.4

#2 lore raw
In reply to Anton Blanchard
perf jit: Fix build issue on Ubuntu
Commit-ID:  53613e005496234bb684e5db551fbcededa73999
Gitweb:     http://git.kernel.org/tip/53613e005496234bb684e5db551fbcededa73999
Author:     Anton Blanchard <[email protected]>
AuthorDate: Thu, 13 Oct 2016 13:20:43 +1100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 17 Oct 2016 11:25:34 -0300

perf jit: Fix build issue on Ubuntu

When building on Ubuntu 16.04, I get the following error:

Makefile:49: *** the openjdk development package appears to me missing, install and try again. Stop.

The problem is that update-java-alternatives has multiple spaces between fields, and cut treats each space as a new delimiter:

java-1.8.0-openjdk-ppc64el 1081 /usr/lib/jvm/java-1.8.0-openjdk-ppc64el

Fix this by using awk, which handles this fine.

---
 tools/perf/jvmti/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/jvmti/Makefile +1 -1
index 5ce61a1..df14e6b 100644
@@ -36,7 +36,7 @@ SOLIBEXT=so
 # The following works at least on fedora 23, you may need the next
 # line for other distros.
 ifneq (,$(wildcard /usr/sbin/update-java-alternatives))
-JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3)
+JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | awk '{print $$3}')
 else
   ifneq (,$(wildcard /usr/sbin/alternatives))
     JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g')