linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH v2 3/5] trace-cmd: Add installation of ld.conf.d file for library paths
Date: Wed, 22 Jan 2020 12:22:50 -0500	[thread overview]
Message-ID: <20200122172410.467870405@goodmis.org> (raw)
In-Reply-To: 20200122172247.539894616@goodmis.org

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 | 10 ++++++++++
 2 files changed, 14 insertions(+)

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..8434aea7c24f 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -133,3 +133,13 @@ define do_install_data
 	fi;						\
 	$(INSTALL) -m 644 $1 '$(DESTDIR_SQ)$2'
 endef
+
+define do_install_ld
+	if [ -d '$(DESTDIR_SQ)$2' ]; then				\
+		$(print_install)					\
+		if ! grep -q $3 $(DESTDIR_SQ)$2/$1 2>/dev/null; then	\
+			echo '$3' >> $(DESTDIR_SQ)$2/$1;		\
+			ldconfig;					\
+		fi							\
+	fi
+endef
-- 
2.24.1



  parent reply	other threads:[~2020-01-22 17:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22 17:22 [PATCH v2 0/5] trace-cmd: A few udpates Steven Rostedt
2020-01-22 17:22 ` [PATCH v2 1/5] trace-cmd: Create TRACECMD_MAGIC macro for magic number of trace-cmd data file Steven Rostedt
2020-01-22 17:22 ` [PATCH v2 2/5] trace-cmd: Place "trace.dat" into the macro DEFAULT_INPUT_FILE Steven Rostedt
2020-01-22 17:22 ` Steven Rostedt [this message]
2020-01-22 17:22 ` [PATCH v2 4/5] trace-cmd: Have libtracecmd.so include libtraceevent Steven Rostedt
2020-01-22 17:22 ` [PATCH v2 5/5] trace-cmd: Remove unused trace_util function declarations Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200122172410.467870405@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).