From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Subject: [PATCH 11/12] trace-cmd: Update libtracecmd.pc if prefix is different
Date: Tue, 15 Dec 2020 23:42:01 -0500 [thread overview]
Message-ID: <20201216044214.856860622@goodmis.org> (raw)
In-Reply-To: 20201216044150.375001748@goodmis.org
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
If a build is done with different DESTDIR and the prefix is changed, the
the libtracecmd.pc is not updated with the new prefix, and the one used may
not work with the installation being performed.
Add a "build_prefix" dependency, that creates a file "build_prefix" that has
the last prefix used to build the library. And if a new prefix is used, then
that file gets updated and so does libtracecmd.pc.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
.gitignore | 1 +
Makefile | 7 ++++++-
scripts/utils.mk | 10 ++++++++++
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 1e8c1d4f5734..9ce25c8e031e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,3 +24,4 @@ traceevent_plugin_dir
trace_python_dir
tracecmd_plugin_dir
libtracecmd.pc
+build_prefix
diff --git a/Makefile b/Makefile
index ddceab3f45e7..396a6795bad1 100644
--- a/Makefile
+++ b/Makefile
@@ -343,7 +343,12 @@ CMAKE_COMMAND = /usr/bin/cmake
# Build with "BUILD_TYPE=Release" to remove cmake debug info
BUILD_TYPE ?= RelWithDebInfo
-$(PKG_CONFIG_FILE) : ${PKG_CONFIG_SOURCE_FILE}.template
+BUILD_PREFIX := $(BUILD_OUTPUT)/build_prefix
+
+$(BUILD_PREFIX): force
+ $(Q)$(call build_prefix,$(prefix))
+
+$(PKG_CONFIG_FILE) : ${PKG_CONFIG_SOURCE_FILE}.template $(BUILD_PREFIX)
$(Q) $(call do_make_pkgconfig_file,$(prefix))
$(kshark-dir)/build/Makefile: $(kshark-dir)/CMakeLists.txt
diff --git a/scripts/utils.mk b/scripts/utils.mk
index c8ef44b3776a..c06888795ddf 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -121,6 +121,16 @@ define update_dir
fi);
endef
+define build_prefix
+ (echo $1 > $@.tmp; \
+ if [ -r $@ ] && cmp -s $@ $@.tmp; then \
+ rm -f $@.tmp; \
+ else \
+ $(print_update) \
+ mv -f $@.tmp $@; \
+ fi);
+endef
+
define do_install
$(print_install) \
if [ ! -d '$(DESTDIR_SQ)$2' ]; then \
--
2.29.2
next prev parent reply other threads:[~2020-12-16 4:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-16 4:41 [PATCH 00/12] trace-cmd: Updates to the Makefile Steven Rostedt
2020-12-16 4:41 ` [PATCH 01/12] trace-cmd: Move do_make_pkgconfig_file to utils.mk Steven Rostedt
2020-12-16 4:41 ` [PATCH 02/12] trace-cmd: Have etcdir always be at the root directory Steven Rostedt
2020-12-16 4:41 ` [PATCH 03/12] trace-cmd: Remove unused variable LD_SO_CONF_DIR Steven Rostedt
2020-12-16 4:41 ` [PATCH 04/12] trace-cmd: Use the LIBTRACE{EVENT,FS}_LIBS for building libtracecmd.so Steven Rostedt
2020-12-16 4:41 ` [PATCH 05/12] libtracecmd: Update ld.so.conf.d/trace.conf if needed Steven Rostedt
2020-12-16 4:41 ` [PATCH 06/12] libtracecmd: Make installing show a nice INSTALL output Steven Rostedt
2020-12-16 4:41 ` [PATCH 07/12] libtracecmd: Build libtracecmd.pc when building the library Steven Rostedt
2020-12-16 4:41 ` [PATCH 08/12] libtracecmd: Show building of libtracecmd.pc Steven Rostedt
2020-12-16 4:41 ` [PATCH 09/12] libtracecmd: Install libtracecmd.pc when installing libs Steven Rostedt
2020-12-16 4:42 ` [PATCH 10/12] trace-cmd: Add make uninstall Steven Rostedt
2020-12-16 4:42 ` Steven Rostedt [this message]
2020-12-16 4:42 ` [PATCH 12/12] trace-cmd: Keep build_install files around 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=20201216044214.856860622@goodmis.org \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.