From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx> Instead of installing libtracecmd library into its own directory under lib/, where the dynamic linker ld has trouble finding it, use the appropriate lib path (lib or lib64) to place libtracecmd.* Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx> --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0c5da92b54b6..041bd79b5aec 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,14 @@ INSTALL = install DESTDIR ?= DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))' +LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1) +ifeq ($(LP64), 1) + libdir_relative_temp = lib64 +else + libdir_relative_temp = lib +endif + +libdir_relative ?= $(libdir_relative_temp) prefix ?= /usr/local bindir_relative = bin bindir = $(prefix)/$(bindir_relative) @@ -57,7 +65,7 @@ html_install = $(prefix)/share/kernelshark/html html_install_SQ = '$(subst ','\'',$(html_install))' img_install = $(prefix)/share/kernelshark/html/images img_install_SQ = '$(subst ','\'',$(img_install))' -libdir ?= $(prefix)/lib +libdir = $(prefix)/$(libdir_relative) libdir_SQ = '$(subst ','\'',$(libdir))' includedir = $(prefix)/include includedir_SQ = '$(subst ','\'',$(includedir))' @@ -473,7 +481,7 @@ install_tracefs: $(LIBTRACEFS_STATIC_BUILD) $(Q)$(call do_install,$(src)/include/tracefs/tracefs.h,$(includedir_SQ)/tracefs) install_libs: libs $(INSTALL_TRACEEVENT) $(INSTALL_TRACEFS) - $(Q)$(call do_install,$(LIBTRACECMD_SHARED),$(libdir_SQ)/trace-cmd) + $(Q)$(call do_install,$(LIBTRACECMD_SHARED),$(libdir_SQ)) $(Q)$(call do_install,$(src)/include/trace-cmd/trace-cmd.h,$(includedir_SQ)/trace-cmd) doc: -- 2.29.2