public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools lib traceevent: install libtraceevent.a into libdir.
@ 2015-05-05  2:25 Wang Nan
  2015-05-06  7:07 ` Jiri Olsa
  0 siblings, 1 reply; 6+ messages in thread
From: Wang Nan @ 2015-05-05  2:25 UTC (permalink / raw)
  To: jolsa, acme; +Cc: lizefan, linux-kernel

Before this patch, 'make install' installs libraries into bindir:

  $ make install DESTDIR=./tree
   INSTALL  trace_plugins
   INSTALL  libtraceevent.a
   INSTALL  libtraceevent.so
  $ find ./tree
   ./tree/
   ./tree/usr
   ./tree/usr/local
   ./tree/usr/local/bin
   ./tree/usr/local/bin/libtraceevent.a
   ./tree/usr/local/bin/libtraceevent.so
   ...

/usr/local/lib should be a better place.

This patch replace 'bin' with 'lib'.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
---
 tools/lib/traceevent/Makefile | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index d410da3..6e7b63d 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
@@ -35,8 +35,8 @@ DESTDIR ?=
 DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))'
 
 prefix ?= /usr/local
-bindir_relative = bin
-bindir = $(prefix)/$(bindir_relative)
+libdir_relative = lib
+libdir = $(prefix)/$(libdir_relative)
 man_dir = $(prefix)/share/man
 man_dir_SQ = '$(subst ','\'',$(man_dir))'
 
@@ -85,11 +85,11 @@ srctree := $(patsubst %/,%,$(dir $(srctree)))
 #$(info Determined 'srctree' to be $(srctree))
 endif
 
-export prefix bindir src obj
+export prefix libdir src obj
 
 # Shell quotes
-bindir_SQ = $(subst ','\'',$(bindir))
-bindir_relative_SQ = $(subst ','\'',$(bindir_relative))
+libdir_SQ = $(subst ','\'',$(libdir))
+libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
 plugin_dir_SQ = $(subst ','\'',$(plugin_dir))
 
 LIB_FILE = libtraceevent.a libtraceevent.so
@@ -240,7 +240,7 @@ endef
 
 install_lib: all_cmd install_plugins
 	$(call QUIET_INSTALL, $(LIB_FILE)) \
-		$(call do_install,$(LIB_FILE),$(bindir_SQ))
+		$(call do_install,$(LIB_FILE),$(libdir_SQ))
 
 install_plugins: $(PLUGINS)
 	$(call QUIET_INSTALL, trace_plugins) \
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools lib traceevent: install libtraceevent.a into libdir.
  2015-05-05  2:25 [PATCH] tools lib traceevent: install libtraceevent.a into libdir Wang Nan
@ 2015-05-06  7:07 ` Jiri Olsa
  2015-05-06 10:00   ` [PATCH v2] " Wang Nan
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Olsa @ 2015-05-06  7:07 UTC (permalink / raw)
  To: Wang Nan; +Cc: jolsa, acme, lizefan, linux-kernel

On Tue, May 05, 2015 at 02:25:31AM +0000, Wang Nan wrote:
> Before this patch, 'make install' installs libraries into bindir:
> 
>   $ make install DESTDIR=./tree
>    INSTALL  trace_plugins
>    INSTALL  libtraceevent.a
>    INSTALL  libtraceevent.so
>   $ find ./tree
>    ./tree/
>    ./tree/usr
>    ./tree/usr/local
>    ./tree/usr/local/bin
>    ./tree/usr/local/bin/libtraceevent.a
>    ./tree/usr/local/bin/libtraceevent.so
>    ...
> 
> /usr/local/lib should be a better place.

it's better, but it should also be lib64 for 64-bit archs

please check perf's config/Makefile.arch, there's oneline
check for this

jirka

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] tools lib traceevent: install libtraceevent.a into libdir.
  2015-05-06  7:07 ` Jiri Olsa
@ 2015-05-06 10:00   ` Wang Nan
  2015-05-06 20:29     ` Jiri Olsa
  0 siblings, 1 reply; 6+ messages in thread
From: Wang Nan @ 2015-05-06 10:00 UTC (permalink / raw)
  To: jolsa; +Cc: acme, lizefan, linux-kernel

Before this patch, 'make install' installs libraries into bindir:

  $ make install DESTDIR=./tree
   INSTALL  trace_plugins
   INSTALL  libtraceevent.a
   INSTALL  libtraceevent.so
  $ find ./tree
   ./tree/
   ./tree/usr
   ./tree/usr/local
   ./tree/usr/local/bin
   ./tree/usr/local/bin/libtraceevent.a
   ./tree/usr/local/bin/libtraceevent.so
   ...

/usr/local/lib( or lib64) should be a better place.

This patch replaces 'bin' with libdir. For __LP64__ building, libraries
are installed to /usr/local/lib64. For other building, to
/usr/local/lib instead.

After applying this patch:

  $ make install DESTDIR=./tree
   INSTALL  trace_plugins
   INSTALL  libtraceevent.a
   INSTALL  libtraceevent.so
  $ find ./tree
   ./tree
   ./tree/usr
   ./tree/usr/local
   ./tree/usr/local/lib64
   ./tree/usr/local/lib64/libtraceevent.a
   ./tree/usr/local/lib64/traceevent
   ./tree/usr/local/lib64/traceevent/plugins
   ./tree/usr/local/lib64/traceevent/plugins/plugin_mac80211.so
   ./tree/usr/local/lib64/traceevent/plugins/plugin_hrtimer.so
   ...
   ./tree/usr/local/lib64/libtraceevent.so

Signed-off-by: Wang Nan <wangnan0@huawei.com>
---

v1 -> v2: check __LP64__ and use 'lib64' as libdir for 64 bit building.

---

 tools/lib/traceevent/Makefile | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index d410da3..8464039 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
@@ -34,9 +34,15 @@ INSTALL = install
 DESTDIR ?=
 DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))'
 
+LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
+ifeq ($(LP64), 1)
+  libdir_relative = lib64
+else
+  libdir_relative = lib
+endif
+
 prefix ?= /usr/local
-bindir_relative = bin
-bindir = $(prefix)/$(bindir_relative)
+libdir = $(prefix)/$(libdir_relative)
 man_dir = $(prefix)/share/man
 man_dir_SQ = '$(subst ','\'',$(man_dir))'
 
@@ -58,7 +64,7 @@ ifeq ($(prefix),$(HOME))
 override plugin_dir = $(HOME)/.traceevent/plugins
 set_plugin_dir := 0
 else
-override plugin_dir = $(prefix)/lib/traceevent/plugins
+override plugin_dir = $(libdir)/traceevent/plugins
 endif
 endif
 
@@ -85,11 +91,11 @@ srctree := $(patsubst %/,%,$(dir $(srctree)))
 #$(info Determined 'srctree' to be $(srctree))
 endif
 
-export prefix bindir src obj
+export prefix libdir src obj
 
 # Shell quotes
-bindir_SQ = $(subst ','\'',$(bindir))
-bindir_relative_SQ = $(subst ','\'',$(bindir_relative))
+libdir_SQ = $(subst ','\'',$(libdir))
+libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
 plugin_dir_SQ = $(subst ','\'',$(plugin_dir))
 
 LIB_FILE = libtraceevent.a libtraceevent.so
@@ -240,7 +246,7 @@ endef
 
 install_lib: all_cmd install_plugins
 	$(call QUIET_INSTALL, $(LIB_FILE)) \
-		$(call do_install,$(LIB_FILE),$(bindir_SQ))
+		$(call do_install,$(LIB_FILE),$(libdir_SQ))
 
 install_plugins: $(PLUGINS)
 	$(call QUIET_INSTALL, trace_plugins) \
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] tools lib traceevent: install libtraceevent.a into libdir.
  2015-05-06 10:00   ` [PATCH v2] " Wang Nan
@ 2015-05-06 20:29     ` Jiri Olsa
  2015-05-06 21:23       ` Arnaldo Carvalho de Melo
  2015-05-07  1:04       ` Steven Rostedt
  0 siblings, 2 replies; 6+ messages in thread
From: Jiri Olsa @ 2015-05-06 20:29 UTC (permalink / raw)
  To: Wang Nan; +Cc: acme, lizefan, linux-kernel, Steven Rostedt

On Wed, May 06, 2015 at 10:00:20AM +0000, Wang Nan wrote:
> Before this patch, 'make install' installs libraries into bindir:
> 
>   $ make install DESTDIR=./tree
>    INSTALL  trace_plugins
>    INSTALL  libtraceevent.a
>    INSTALL  libtraceevent.so
>   $ find ./tree
>    ./tree/
>    ./tree/usr
>    ./tree/usr/local
>    ./tree/usr/local/bin
>    ./tree/usr/local/bin/libtraceevent.a
>    ./tree/usr/local/bin/libtraceevent.so
>    ...
> 
> /usr/local/lib( or lib64) should be a better place.
> 
> This patch replaces 'bin' with libdir. For __LP64__ building, libraries
> are installed to /usr/local/lib64. For other building, to
> /usr/local/lib instead.
> 
> After applying this patch:
> 
>   $ make install DESTDIR=./tree
>    INSTALL  trace_plugins
>    INSTALL  libtraceevent.a
>    INSTALL  libtraceevent.so
>   $ find ./tree
>    ./tree
>    ./tree/usr
>    ./tree/usr/local
>    ./tree/usr/local/lib64
>    ./tree/usr/local/lib64/libtraceevent.a
>    ./tree/usr/local/lib64/traceevent
>    ./tree/usr/local/lib64/traceevent/plugins
>    ./tree/usr/local/lib64/traceevent/plugins/plugin_mac80211.so
>    ./tree/usr/local/lib64/traceevent/plugins/plugin_hrtimer.so
>    ...
>    ./tree/usr/local/lib64/libtraceevent.so
> 
> Signed-off-by: Wang Nan <wangnan0@huawei.com>

Acked-by: Jiri Olsa <jolsa@kernel.org>

CC-ing Steven

thanks,
jirka


> ---
> 
> v1 -> v2: check __LP64__ and use 'lib64' as libdir for 64 bit building.
> 
> ---
> 
>  tools/lib/traceevent/Makefile | 20 +++++++++++++-------
>  1 file changed, 13 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
> index d410da3..8464039 100644
> --- a/tools/lib/traceevent/Makefile
> +++ b/tools/lib/traceevent/Makefile
> @@ -34,9 +34,15 @@ INSTALL = install
>  DESTDIR ?=
>  DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))'
>  
> +LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
> +ifeq ($(LP64), 1)
> +  libdir_relative = lib64
> +else
> +  libdir_relative = lib
> +endif
> +
>  prefix ?= /usr/local
> -bindir_relative = bin
> -bindir = $(prefix)/$(bindir_relative)
> +libdir = $(prefix)/$(libdir_relative)
>  man_dir = $(prefix)/share/man
>  man_dir_SQ = '$(subst ','\'',$(man_dir))'
>  
> @@ -58,7 +64,7 @@ ifeq ($(prefix),$(HOME))
>  override plugin_dir = $(HOME)/.traceevent/plugins
>  set_plugin_dir := 0
>  else
> -override plugin_dir = $(prefix)/lib/traceevent/plugins
> +override plugin_dir = $(libdir)/traceevent/plugins
>  endif
>  endif
>  
> @@ -85,11 +91,11 @@ srctree := $(patsubst %/,%,$(dir $(srctree)))
>  #$(info Determined 'srctree' to be $(srctree))
>  endif
>  
> -export prefix bindir src obj
> +export prefix libdir src obj
>  
>  # Shell quotes
> -bindir_SQ = $(subst ','\'',$(bindir))
> -bindir_relative_SQ = $(subst ','\'',$(bindir_relative))
> +libdir_SQ = $(subst ','\'',$(libdir))
> +libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
>  plugin_dir_SQ = $(subst ','\'',$(plugin_dir))
>  
>  LIB_FILE = libtraceevent.a libtraceevent.so
> @@ -240,7 +246,7 @@ endef
>  
>  install_lib: all_cmd install_plugins
>  	$(call QUIET_INSTALL, $(LIB_FILE)) \
> -		$(call do_install,$(LIB_FILE),$(bindir_SQ))
> +		$(call do_install,$(LIB_FILE),$(libdir_SQ))
>  
>  install_plugins: $(PLUGINS)
>  	$(call QUIET_INSTALL, trace_plugins) \
> -- 
> 1.8.3.4
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] tools lib traceevent: install libtraceevent.a into libdir.
  2015-05-06 20:29     ` Jiri Olsa
@ 2015-05-06 21:23       ` Arnaldo Carvalho de Melo
  2015-05-07  1:04       ` Steven Rostedt
  1 sibling, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-05-06 21:23 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: Wang Nan, lizefan, linux-kernel, Steven Rostedt

Em Wed, May 06, 2015 at 10:29:15PM +0200, Jiri Olsa escreveu:
> On Wed, May 06, 2015 at 10:00:20AM +0000, Wang Nan wrote:
> >    ...
> >    ./tree/usr/local/lib64/libtraceevent.so
> > 
> > Signed-off-by: Wang Nan <wangnan0@huawei.com>
> 
> Acked-by: Jiri Olsa <jolsa@kernel.org>
> 
> CC-ing Steven

Applying to my perf/core branch.

- Arnaldo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] tools lib traceevent: install libtraceevent.a into libdir.
  2015-05-06 20:29     ` Jiri Olsa
  2015-05-06 21:23       ` Arnaldo Carvalho de Melo
@ 2015-05-07  1:04       ` Steven Rostedt
  1 sibling, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2015-05-07  1:04 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: Wang Nan, acme, lizefan, linux-kernel

On Wed, 6 May 2015 22:29:15 +0200
Jiri Olsa <jolsa@redhat.com> wrote:

> On Wed, May 06, 2015 at 10:00:20AM +0000, Wang Nan wrote:
> > Before this patch, 'make install' installs libraries into bindir:
> > 
> >   $ make install DESTDIR=./tree
> >    INSTALL  trace_plugins
> >    INSTALL  libtraceevent.a
> >    INSTALL  libtraceevent.so
> >   $ find ./tree
> >    ./tree/
> >    ./tree/usr
> >    ./tree/usr/local
> >    ./tree/usr/local/bin
> >    ./tree/usr/local/bin/libtraceevent.a
> >    ./tree/usr/local/bin/libtraceevent.so
> >    ...
> > 
> > /usr/local/lib( or lib64) should be a better place.
> > 
> > This patch replaces 'bin' with libdir. For __LP64__ building, libraries
> > are installed to /usr/local/lib64. For other building, to
> > /usr/local/lib instead.
> > 
> > After applying this patch:
> > 
> >   $ make install DESTDIR=./tree
> >    INSTALL  trace_plugins
> >    INSTALL  libtraceevent.a
> >    INSTALL  libtraceevent.so
> >   $ find ./tree
> >    ./tree
> >    ./tree/usr
> >    ./tree/usr/local
> >    ./tree/usr/local/lib64
> >    ./tree/usr/local/lib64/libtraceevent.a
> >    ./tree/usr/local/lib64/traceevent
> >    ./tree/usr/local/lib64/traceevent/plugins
> >    ./tree/usr/local/lib64/traceevent/plugins/plugin_mac80211.so
> >    ./tree/usr/local/lib64/traceevent/plugins/plugin_hrtimer.so
> >    ...
> >    ./tree/usr/local/lib64/libtraceevent.so
> > 
> > Signed-off-by: Wang Nan <wangnan0@huawei.com>
> 
> Acked-by: Jiri Olsa <jolsa@kernel.org>
> 
> CC-ing Steven
> 

Thanks, looks fine to me.

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-05-07  1:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-05  2:25 [PATCH] tools lib traceevent: install libtraceevent.a into libdir Wang Nan
2015-05-06  7:07 ` Jiri Olsa
2015-05-06 10:00   ` [PATCH v2] " Wang Nan
2015-05-06 20:29     ` Jiri Olsa
2015-05-06 21:23       ` Arnaldo Carvalho de Melo
2015-05-07  1:04       ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox