diff options
| author | Wang Nan <wangnan0@huawei.com> | 2015-05-17 06:56:28 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-05-18 11:36:25 -0400 |
| commit | bb53e176fed9b6c9321904558b4e605b4770e454 (patch) | |
| tree | 187d946aba6a7180eca6bfe6cf0ede8c27246f63 /tools/lib | |
| parent | c4f035473d93c1594d8225f6dd97332317820801 (diff) | |
tools lib traceevent: Install libtraceevent.a into libdir
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>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David Ahern <dsahern@gmail.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: pi3orama@163.com
Cc: Zefan Li <lizefan@huawei.com>
Link: http://lkml.kernel.org/r/1431860222-61636-4-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib')
| -rw-r--r-- | tools/lib/traceevent/Makefile | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile index d410da335e3d..84640394ebf9 100644 --- a/tools/lib/traceevent/Makefile +++ b/tools/lib/traceevent/Makefile | |||
| @@ -34,9 +34,15 @@ INSTALL = install | |||
| 34 | DESTDIR ?= | 34 | DESTDIR ?= |
| 35 | DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))' | 35 | DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))' |
| 36 | 36 | ||
| 37 | LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1) | ||
| 38 | ifeq ($(LP64), 1) | ||
| 39 | libdir_relative = lib64 | ||
| 40 | else | ||
| 41 | libdir_relative = lib | ||
| 42 | endif | ||
| 43 | |||
| 37 | prefix ?= /usr/local | 44 | prefix ?= /usr/local |
| 38 | bindir_relative = bin | 45 | libdir = $(prefix)/$(libdir_relative) |
| 39 | bindir = $(prefix)/$(bindir_relative) | ||
| 40 | man_dir = $(prefix)/share/man | 46 | man_dir = $(prefix)/share/man |
| 41 | man_dir_SQ = '$(subst ','\'',$(man_dir))' | 47 | man_dir_SQ = '$(subst ','\'',$(man_dir))' |
| 42 | 48 | ||
| @@ -58,7 +64,7 @@ ifeq ($(prefix),$(HOME)) | |||
| 58 | override plugin_dir = $(HOME)/.traceevent/plugins | 64 | override plugin_dir = $(HOME)/.traceevent/plugins |
| 59 | set_plugin_dir := 0 | 65 | set_plugin_dir := 0 |
| 60 | else | 66 | else |
| 61 | override plugin_dir = $(prefix)/lib/traceevent/plugins | 67 | override plugin_dir = $(libdir)/traceevent/plugins |
| 62 | endif | 68 | endif |
| 63 | endif | 69 | endif |
| 64 | 70 | ||
| @@ -85,11 +91,11 @@ srctree := $(patsubst %/,%,$(dir $(srctree))) | |||
| 85 | #$(info Determined 'srctree' to be $(srctree)) | 91 | #$(info Determined 'srctree' to be $(srctree)) |
| 86 | endif | 92 | endif |
| 87 | 93 | ||
| 88 | export prefix bindir src obj | 94 | export prefix libdir src obj |
| 89 | 95 | ||
| 90 | # Shell quotes | 96 | # Shell quotes |
| 91 | bindir_SQ = $(subst ','\'',$(bindir)) | 97 | libdir_SQ = $(subst ','\'',$(libdir)) |
| 92 | bindir_relative_SQ = $(subst ','\'',$(bindir_relative)) | 98 | libdir_relative_SQ = $(subst ','\'',$(libdir_relative)) |
| 93 | plugin_dir_SQ = $(subst ','\'',$(plugin_dir)) | 99 | plugin_dir_SQ = $(subst ','\'',$(plugin_dir)) |
| 94 | 100 | ||
| 95 | LIB_FILE = libtraceevent.a libtraceevent.so | 101 | LIB_FILE = libtraceevent.a libtraceevent.so |
| @@ -240,7 +246,7 @@ endef | |||
| 240 | 246 | ||
| 241 | install_lib: all_cmd install_plugins | 247 | install_lib: all_cmd install_plugins |
| 242 | $(call QUIET_INSTALL, $(LIB_FILE)) \ | 248 | $(call QUIET_INSTALL, $(LIB_FILE)) \ |
| 243 | $(call do_install,$(LIB_FILE),$(bindir_SQ)) | 249 | $(call do_install,$(LIB_FILE),$(libdir_SQ)) |
| 244 | 250 | ||
| 245 | install_plugins: $(PLUGINS) | 251 | install_plugins: $(PLUGINS) |
| 246 | $(call QUIET_INSTALL, trace_plugins) \ | 252 | $(call QUIET_INSTALL, trace_plugins) \ |
