diff mbox series

[3/5] trace-cmd: Add installation of ld.conf.d file for library paths

Message ID 20200122171329.340613663@goodmis.org (mailing list archive)
State Superseded
Headers show
Series trace-cmd: A few updates | expand

Commit Message

Steven Rostedt Jan. 22, 2020, 5:12 p.m. UTC
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

As just installing the shared libraries is not enough to have them accessed
by the applications, ldconfig needs to also be run. To find the location of
the libraries, their paths need to be added to ld.conf.d directory
configuration file.

Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile         | 4 ++++
 scripts/utils.mk | 8 ++++++++
 2 files changed, 12 insertions(+)

Comments

Steven Rostedt Jan. 22, 2020, 5:22 p.m. UTC | #1
On Wed, 22 Jan 2020 12:12:53 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> diff --git a/scripts/utils.mk b/scripts/utils.mk
> index d1d5135063fc..4da8829159a0 100644
> --- a/scripts/utils.mk
> +++ b/scripts/utils.mk
> @@ -133,3 +133,11 @@ define do_install_data
>  	fi;						\
>  	$(INSTALL) -m 644 $1 '$(DESTDIR_SQ)$2'
>  endef
> +
> +define do_install_ld
> +	$(print_install)				\

Hmm, the print should only happen inside the if.

> +	if [ -d '$(DESTDIR_SQ)$2' ]; then		\

Bah, I fixed this if statement but applied it to another commit.

Will post a v2.

-- Steve

> +		echo '$3' >> $(DESTDIR_SQ)$2/$1;	\
> +		ldconfig;				\
> +	fi
> +endef
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index efd9ed4b296e..c22aa7847b51 100644
--- a/Makefile
+++ b/Makefile
@@ -88,6 +88,8 @@  HELP_DIR_SQ = '$(subst ','\'',$(HELP_DIR))'
 #' emacs highlighting gets confused by the above escaped quote.
 
 BASH_COMPLETE_DIR ?= /etc/bash_completion.d
+LD_SO_CONF_DIR ?= /etc/ld.so.conf.d
+TRACE_LD_FILE ?= trace.conf
 
 export PLUGIN_DIR_TRACEEVENT
 export PLUGIN_DIR_TRACECMD
@@ -380,6 +382,8 @@  install_libs: libs
 	$(Q)$(call do_install,$(src)/include/traceevent/trace-seq.h,$(includedir_SQ)/traceevent)
 	$(Q)$(call do_install,$(src)/include/trace-cmd/trace-cmd.h,$(includedir_SQ)/trace-cmd)
 	$(Q)$(call do_install,$(src)/include/trace-cmd/trace-filter-hash.h,$(includedir_SQ)/trace-cmd)
+	$(Q)$(call do_install_ld,$(TRACE_LD_FILE),$(LD_SO_CONF_DIR),$(libdir_SQ)/trace-cmd)
+	$(Q)$(call do_install_ld,$(TRACE_LD_FILE),$(LD_SO_CONF_DIR),$(libdir_SQ)/traceevent)
 
 doc:
 	$(MAKE) -C $(src)/Documentation all
diff --git a/scripts/utils.mk b/scripts/utils.mk
index d1d5135063fc..4da8829159a0 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -133,3 +133,11 @@  define do_install_data
 	fi;						\
 	$(INSTALL) -m 644 $1 '$(DESTDIR_SQ)$2'
 endef
+
+define do_install_ld
+	$(print_install)				\
+	if [ -d '$(DESTDIR_SQ)$2' ]; then		\
+		echo '$3' >> $(DESTDIR_SQ)$2/$1;	\
+		ldconfig;				\
+	fi
+endef