Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libtraceevent: Allow custom libdir path

When I use prefix=/usr and try to install libtraceevent in my laptop it
tries to install in /usr/lib64. I am not having any folder as /usr/lib64
and also the debian policy doesnot allow installing in /usr/lib64. It
should be in /usr/lib/x86_64-linux-gnu/.

Quote: No package for a 64 bit architecture may install files in
/usr/lib64/ or in a subdirectory of it.

ref: https://www.debian.org/doc/debian-policy/ch-opersys.html

Make it more flexible by allowing to mention libdir_relative while
installing so that distros can mention the path according to their
policy or use the default one.

Signed-off-by: Sudipm Mukherjee <sudipm.mukherjee@gmail.com>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Sudipm Mukherjee <sudipm.mukherjee@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Link: http://lore.kernel.org/lkml/20191207111440.6574-1-sudipm.mukherjee@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Sudip Mukherjee and committed by
Arnaldo Carvalho de Melo
c09982f8 28707826

+6 -4
+3 -2
tools/lib/traceevent/Makefile
··· 39 39 40 40 LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1) 41 41 ifeq ($(LP64), 1) 42 - libdir_relative = lib64 42 + libdir_relative_temp = lib64 43 43 else 44 - libdir_relative = lib 44 + libdir_relative_temp = lib 45 45 endif 46 46 47 + libdir_relative ?= $(libdir_relative_temp) 47 48 prefix ?= /usr/local 48 49 libdir = $(prefix)/$(libdir_relative) 49 50 man_dir = $(prefix)/share/man
+3 -2
tools/lib/traceevent/plugins/Makefile
··· 32 32 33 33 LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1) 34 34 ifeq ($(LP64), 1) 35 - libdir_relative = lib64 35 + libdir_relative_tmp = lib64 36 36 else 37 - libdir_relative = lib 37 + libdir_relative_tmp = lib 38 38 endif 39 39 40 + libdir_relative ?= $(libdir_relative_tmp) 40 41 prefix ?= /usr/local 41 42 libdir = $(prefix)/$(libdir_relative) 42 43