Skip to contentSkip to conversation

perf: Make the install relative to DESTDIR if specified

PATCH In review John Kacur 2 participants 6 messages Mar 11, 2010 perf events

lore
Share & tools
lore

John Kacur

author
#0 lore raw

PATCH 1/1 perf: Make the install relative to DESTDIR if specified

Without this change, the install path is relative to prefix/DESTDIR
where prefix is automatically set to $HOME

This can produce unexpected results. For example

make -C tools/perf DESTDIR=/home/jkacur/tmp install-man

creates the directory: /home/jkacur/home/jkacur/tmp/share/...
instead of the expected: /home/jkacur/tmp/share/...

---
 tools/perf/Documentation/Makefile |    4 +++-
 tools/perf/Makefile               |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
tools/perf/Documentation/Makefile +3 -1
index bdd3b7e..bd498d4 100644
@@ -24,7 +24,10 @@ DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
 DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
 DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
 
+# Make the path relative to DESTDIR, not prefix
+ifndef DESTDIR
 prefix?=$(HOME)
+endif
 bindir?=$(prefix)/bin
 htmldir?=$(prefix)/share/doc/perf-doc
 pdfdir?=$(prefix)/share/doc/perf-doc
@@ -32,7 +35,6 @@ mandir?=$(prefix)/share/man
 man1dir=$(mandir)/man1
 man5dir=$(mandir)/man5
 man7dir=$(mandir)/man7
-# DESTDIR=
 
 ASCIIDOC=asciidoc
 ASCIIDOC_EXTRA = --unsafe
tools/perf/Makefile +3 -1
index 2d53738..5da0cd0 100644
@@ -216,7 +216,10 @@ STRIP ?= strip
 # runtime figures out where they are based on the path to the executable.
 # This can help installing the suite in a relocatable way.
 
+# Make the path relative to DESTDIR, not to prefix
+ifndef DESTDIR
 prefix = $(HOME)
+endif
 bindir_relative = bin
 bindir = $(prefix)/$(bindir_relative)
 mandir = share/man
@@ -233,7 +236,6 @@ sysconfdir = $(prefix)/etc
 ETC_PERFCONFIG = etc/perfconfig
 endif
 lib = lib
-# DESTDIR=
 
 export prefix bindir sharedir sysconfdir
 
Signature · 1 line
1.6.6.1
author
#1 lore raw
Quoted 61 lines · John Kacur

Without this change, the install path is relative to prefix/DESTDIR
where prefix is automatically set to $HOME

This can produce unexpected results. For example

make -C tools/perf DESTDIR=/home/jkacur/tmp install-man

creates the directory:          /home/jkacur/home/jkacur/tmp/share/... instead of  the expected:       /home/jkacur/tmp/share/...

---
 tools/perf/Documentation/Makefile |    4 +++-
 tools/perf/Makefile               |    4 +++-

 2 files changed, 6 insertions(+), 2 deletions(-)
tools/perf/Documentation/Makefile +3 -0
index bdd3b7e..bd498d4 100644
@@ -24,7 +24,10 @@ DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
  DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
  DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
 
+# Make the path relative to DESTDIR, not prefix
+ifndef DESTDIR
  prefix?=$(HOME)
+endif

 bindir?=$(prefix)/bin
 htmldir?=$(prefix)/share/doc/perf-doc
 pdfdir?=$(prefix)/share/doc/perf-doc

tools/perf/Documentation/Makefile +0 -0
@@ -32,7 +35,6 @@ mandir?=$(prefix)/share/man

 man1dir=$(mandir)/man1
 man5dir=$(mandir)/man5
 man7dir=$(mandir)/man7
-# DESTDIR=

 ASCIIDOC=asciidoc
 ASCIIDOC_EXTRA = --unsafe

tools/perf/Makefile +3 -0
index 2d53738..5da0cd0 100644
@@ -216,7 +216,10 @@ STRIP ?= strip
  # runtime figures out where they are based on the path to the executable.
  # This can help installing the suite in a relocatable way.
 
+# Make the path relative to DESTDIR, not to prefix
+ifndef DESTDIR
  prefix = $(HOME)
+endif

 bindir_relative = bin
 bindir = $(prefix)/$(bindir_relative)
 mandir = share/man

tools/perf/Makefile +0 -0
@@ -233,7 +236,6 @@ sysconfdir = $(prefix)/etc

 ETC_PERFCONFIG = etc/perfconfig
 endif
 lib = lib
-# DESTDIR=

Quoted 4 lines

 export prefix bindir sharedir sysconfdir

--
1.6.6.1

Sorry, I'd like to withdraw this patch.

I see I can achieve my desired ends without changing the behaviour for others who expect the old behaviour,
simply by setting "prefix" on the command line, eg:
make -C tools/perf prefix="" DESTDIR=/home/jkacur/tmp install-man

Thanks.

#2 lore raw
Quoted 64 lines · John Kacur
Quoted 63 lines · John Kacur

Without this change, the install path is relative to prefix/DESTDIR
where prefix is automatically set to $HOME

This can produce unexpected results. For example

make -C tools/perf DESTDIR=/home/jkacur/tmp install-man

creates the directory: ? ? ? ? ?/home/jkacur/home/jkacur/tmp/share/... instead of ?the expected: ? ? ? /home/jkacur/tmp/share/...

---
?tools/perf/Documentation/Makefile | ? ?4 +++-
?tools/perf/Makefile ? ? ? ? ? ? ? | ? ?4 +++-
?2 files changed, 6 insertions(+), 2 deletions(-)

tools/perf/Documentation/Makefile +3 -0
index bdd3b7e..bd498d4 100644
@@ -24,7 +24,10 @@ DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
 ?DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
 ?DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
 
+# Make the path relative to DESTDIR, not prefix
+ifndef DESTDIR
 ?prefix?=$(HOME)
+endif

?bindir?=$(prefix)/bin
?htmldir?=$(prefix)/share/doc/perf-doc
?pdfdir?=$(prefix)/share/doc/perf-doc

tools/perf/Documentation/Makefile +0 -0
@@ -32,7 +35,6 @@ mandir?=$(prefix)/share/man

?man1dir=$(mandir)/man1
?man5dir=$(mandir)/man5
?man7dir=$(mandir)/man7
-# DESTDIR=

?ASCIIDOC=asciidoc
?ASCIIDOC_EXTRA = --unsafe

tools/perf/Makefile +0 -0
index 2d53738..5da0cd0 100644
@@ -216,7 +216,10 @@ STRIP ?= strip

?# runtime figures out where they are based on the path to the executable. ?# This can help installing the suite in a relocatable way.

tools/perf/Makefile +2 -0
+# Make the path relative to DESTDIR, not to prefix
+ifndef DESTDIR

?prefix = $(HOME)
+endif
?bindir_relative = bin
?bindir = $(prefix)/$(bindir_relative)
?mandir = share/man

tools/perf/Makefile +0 -0
@@ -233,7 +236,6 @@ sysconfdir = $(prefix)/etc

?ETC_PERFCONFIG = etc/perfconfig
?endif
?lib = lib
-# DESTDIR=

?export prefix bindir sharedir sysconfdir

Quoted 7 lines
Quoted 2 lines

--
1.6.6.1

Sorry, I'd like to withdraw this patch.

I see I can achieve my desired ends without changing the behaviour for others who expect the old behaviour,

The old behavior doesnt look very logical though, right?

Ingo

author
#3 lore raw
Quoted 75 lines · ----- "Ingo Molnar
Quoted 1 line · John Kacur

On Thu, Mar 11, 2010 at 1:57 PM, John Kacur <[email protected]>

Quoted 9 lines · wrote:
Quoted 9 lines

Without this change, the install path is relative to prefix/DESTDIR
where prefix is automatically set to $HOME

This can produce unexpected results. For example

make -C tools/perf DESTDIR=/home/jkacur/tmp install-man

creates the directory: ? ? ? ?

?/home/jkacur/home/jkacur/tmp/share/...

Quoted 9 lines

Review

Quoted 9 lines

instead of ?the expected: ? ? ? /home/jkacur/tmp/share/...

---
?tools/perf/Documentation/Makefile | ? ?4 +++-
?tools/perf/Makefile ? ? ? ? ? ? ? | ? ?4 +++-
?2 files changed, 6 insertions(+), 2 deletions(-)

(quoted diff) +0 -0

b/tools/perf/Documentation/Makefile

Quoted 20 lines
Quoted 20 lines

index bdd3b7e..bd498d4 100644

tools/perf/Documentation/Makefile +3 -0
@@ -24,7 +24,10 @@ DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
 ?DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
 ?DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
 
+# Make the path relative to DESTDIR, not prefix
+ifndef DESTDIR
 ?prefix?=$(HOME)
+endif

?bindir?=$(prefix)/bin
?htmldir?=$(prefix)/share/doc/perf-doc
?pdfdir?=$(prefix)/share/doc/perf-doc

tools/perf/Documentation/Makefile +0 -0
@@ -32,7 +35,6 @@ mandir?=$(prefix)/share/man

?man1dir=$(mandir)/man1
?man5dir=$(mandir)/man5
?man7dir=$(mandir)/man7
-# DESTDIR=

Quoted 8 lines
Quoted 8 lines

?ASCIIDOC=asciidoc
?ASCIIDOC_EXTRA = --unsafe

tools/perf/Makefile +0 -0
index 2d53738..5da0cd0 100644
@@ -216,7 +216,10 @@ STRIP ?= strip

?# runtime figures out where they are based on the path to the

executable.

Quoted 22 lines
Quoted 15 lines

?# This can help installing the suite in a relocatable way.

tools/perf/Makefile +2 -0
+# Make the path relative to DESTDIR, not to prefix
+ifndef DESTDIR

?prefix = $(HOME)
+endif
?bindir_relative = bin
?bindir = $(prefix)/$(bindir_relative)
?mandir = share/man

tools/perf/Makefile +0 -0
@@ -233,7 +236,6 @@ sysconfdir = $(prefix)/etc

?ETC_PERFCONFIG = etc/perfconfig
?endif
?lib = lib
-# DESTDIR=

Quoted 4 lines

?export prefix bindir sharedir sysconfdir

--
1.6.6.1

Sorry, I'd like to withdraw this patch.

Quoted 5 lines
Quoted 1 line

I see I can achieve my desired ends without changing the behaviour

for

Quoted 1 line

others who expect the old behaviour,

The old behavior doesnt look very logical though, right?

No, not really. Well, logical for people quickly prototyping code on their own machines, but perf has grown beyond that.

However, I don't like my quick fix either, maybe I can come-up with something cleaner.

John

#4 lore raw
Quoted 82 lines · John Kacur
Quoted 79 lines · ----- "Ingo Molnar
Quoted 1 line · John Kacur

On Thu, Mar 11, 2010 at 1:57 PM, John Kacur <[email protected]>

Quoted 9 lines · wrote:
Quoted 9 lines

Without this change, the install path is relative to prefix/DESTDIR
where prefix is automatically set to $HOME

This can produce unexpected results. For example

make -C tools/perf DESTDIR=/home/jkacur/tmp install-man

creates the directory: ? ? ? ?

?/home/jkacur/home/jkacur/tmp/share/...

Quoted 9 lines

Review

Quoted 9 lines

instead of ?the expected: ? ? ? /home/jkacur/tmp/share/...

---
?tools/perf/Documentation/Makefile | ? ?4 +++-
?tools/perf/Makefile ? ? ? ? ? ? ? | ? ?4 +++-
?2 files changed, 6 insertions(+), 2 deletions(-)

(quoted diff) +0 -0

b/tools/perf/Documentation/Makefile

Quoted 20 lines
Quoted 20 lines

index bdd3b7e..bd498d4 100644

tools/perf/Documentation/Makefile +3 -0
@@ -24,7 +24,10 @@ DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
 ?DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
 ?DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
 
+# Make the path relative to DESTDIR, not prefix
+ifndef DESTDIR
 ?prefix?=$(HOME)
+endif

?bindir?=$(prefix)/bin
?htmldir?=$(prefix)/share/doc/perf-doc
?pdfdir?=$(prefix)/share/doc/perf-doc

tools/perf/Documentation/Makefile +0 -0
@@ -32,7 +35,6 @@ mandir?=$(prefix)/share/man

?man1dir=$(mandir)/man1
?man5dir=$(mandir)/man5
?man7dir=$(mandir)/man7
-# DESTDIR=

Quoted 8 lines
Quoted 8 lines

?ASCIIDOC=asciidoc
?ASCIIDOC_EXTRA = --unsafe

tools/perf/Makefile +0 -0
index 2d53738..5da0cd0 100644
@@ -216,7 +216,10 @@ STRIP ?= strip

?# runtime figures out where they are based on the path to the

executable.

Quoted 15 lines
Quoted 15 lines

?# This can help installing the suite in a relocatable way.

tools/perf/Makefile +2 -0
+# Make the path relative to DESTDIR, not to prefix
+ifndef DESTDIR

?prefix = $(HOME)
+endif
?bindir_relative = bin
?bindir = $(prefix)/$(bindir_relative)
?mandir = share/man

tools/perf/Makefile +0 -0
@@ -233,7 +236,6 @@ sysconfdir = $(prefix)/etc

?ETC_PERFCONFIG = etc/perfconfig
?endif
?lib = lib
-# DESTDIR=

Quoted 8 lines
Quoted 4 lines

?export prefix bindir sharedir sysconfdir

--
1.6.6.1

Sorry, I'd like to withdraw this patch.

I see I can achieve my desired ends without changing the behaviour

for

Quoted 1 line

others who expect the old behaviour,

Quoted 7 lines
Quoted 1 line

The old behavior doesnt look very logical though, right?

No, not really. Well, logical for people quickly prototyping code on their own machines, but perf has grown beyond that.

However, I don't like my quick fix either, maybe I can come-up with something cleaner.

I've applied it meanwhile though, as /home/jkacur/home/jkacur/ is clearly a misbehavior :-)

Ingo

#5 lore raw
In reply to John Kacur
Commit-ID:  7ae5f21361fea11f58c398701da635f778635d13
Gitweb:     http://git.kernel.org/tip/7ae5f21361fea11f58c398701da635f778635d13
Author:     John Kacur <[email protected]>
AuthorDate: Thu, 11 Mar 2010 13:57:00 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 11 Mar 2010 14:08:11 +0100

perf: Make the install relative to DESTDIR if specified

Without this change, the install path is relative to prefix/DESTDIR where prefix is automatically set to $HOME.

This can produce unexpected results. For example:

make -C tools/perf DESTDIR=/home/jkacur/tmp install-man

creates the directory: /home/jkacur/home/jkacur/tmp/share/...
instead of the expected: /home/jkacur/tmp/share/...

Cc Peter Zijlstra <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Tom Zanussi <[email protected]>
Cc Kyle McMartin <[email protected]>

LKML-Reference: <[email protected]>

---
 tools/perf/Documentation/Makefile |    4 +++-
 tools/perf/Makefile               |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
tools/perf/Documentation/Makefile +3 -1
index bdd3b7e..bd498d4 100644
@@ -24,7 +24,10 @@ DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
 DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
 DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
 
+# Make the path relative to DESTDIR, not prefix
+ifndef DESTDIR
 prefix?=$(HOME)
+endif
 bindir?=$(prefix)/bin
 htmldir?=$(prefix)/share/doc/perf-doc
 pdfdir?=$(prefix)/share/doc/perf-doc
@@ -32,7 +35,6 @@ mandir?=$(prefix)/share/man
 man1dir=$(mandir)/man1
 man5dir=$(mandir)/man5
 man7dir=$(mandir)/man7
-# DESTDIR=
 
 ASCIIDOC=asciidoc
 ASCIIDOC_EXTRA = --unsafe
tools/perf/Makefile +3 -1
index 5840499..8a8f52d 100644
@@ -216,7 +216,10 @@ STRIP ?= strip
 # runtime figures out where they are based on the path to the executable.
 # This can help installing the suite in a relocatable way.
 
+# Make the path relative to DESTDIR, not to prefix
+ifndef DESTDIR
 prefix = $(HOME)
+endif
 bindir_relative = bin
 bindir = $(prefix)/$(bindir_relative)
 mandir = share/man
@@ -233,7 +236,6 @@ sysconfdir = $(prefix)/etc
 ETC_PERFCONFIG = etc/perfconfig
 endif
 lib = lib
-# DESTDIR=
 
 export prefix bindir sharedir sysconfdir