All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Subject: [PATCH 5/8] libtracefs: Allow the pkg-config libs and cflags prefix to be overwritten
Date: Wed, 16 Dec 2020 15:11:11 -0500	[thread overview]
Message-ID: <20201216201134.772542934@goodmis.org> (raw)
In-Reply-To: 20201216201106.170659791@goodmis.org

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

In case libtracecmd needs to be built in a destination directory where
libtracefs will be located, and not on the host machine, it will need a
way to override the location of the include and library directories.
Facilitate this by having them use the ${prefix} variable.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile               | 7 ++++---
 libtracefs.pc.template | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index ab64ef3e4f54..142b824ca421 100644
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,8 @@ man_dir = $(prefix)/share/man
 man_dir_SQ = '$(subst ','\'',$(man_dir))'
 libdir = $(prefix)/$(libdir_relative)
 libdir_SQ = '$(subst ','\'',$(libdir))'
-includedir = $(prefix)/include/tracefs
+includedir_relative ?= include/tracefs
+includedir = $(prefix)/$(includedir_relative)
 includedir_SQ = '$(subst ','\'',$(includedir))'
 pkgconfig_dir ?= $(word 1,$(shell $(PKG_CONFIG) 		\
 			--variable pc_path pkg-config | tr ":" " "))
@@ -193,8 +194,8 @@ define do_make_pkgconfig_file
 	cp -f ${PKG_CONFIG_SOURCE_FILE}.template ${PKG_CONFIG_FILE};	\
 	sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE}; 		\
 	sed -i "s|LIB_VERSION|${TRACEFS_VERSION}|g" ${PKG_CONFIG_FILE}; \
-	sed -i "s|LIB_DIR|${libdir}|g" ${PKG_CONFIG_FILE}; \
-	sed -i "s|HEADER_DIR|$(includedir)|g" ${PKG_CONFIG_FILE};
+	sed -i "s|LIB_DIR|${libdir_relative}|g" ${PKG_CONFIG_FILE}; \
+	sed -i "s|HEADER_DIR|$(includedir_relative)|g" ${PKG_CONFIG_FILE};
 endef
 
 BUILD_PREFIX := $(BUILD_OUTPUT)/build_prefix
diff --git a/libtracefs.pc.template b/libtracefs.pc.template
index 5e7d54a4456c..a674fee24007 100644
--- a/libtracefs.pc.template
+++ b/libtracefs.pc.template
@@ -1,6 +1,6 @@
 prefix=INSTALL_PREFIX
-libdir=LIB_DIR
-includedir=HEADER_DIR
+libdir=${prefix}/LIB_DIR
+includedir=${prefix}/HEADER_DIR
 
 Name: libtracefs
 URL: https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/
-- 
2.29.2



  parent reply	other threads:[~2020-12-16 20:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16 20:11 [PATCH 0/8] libtracefs: More Makefile updates to make packaging the library easier Steven Rostedt
2020-12-16 20:11 ` [PATCH 1/8] libtracefs: Clean up tracefs.h Steven Rostedt
2020-12-16 20:11 ` [PATCH 2/8] libtracefs: Use $(objtree) instead of $(OUTPUT) for ld.so test Steven Rostedt
2020-12-16 20:11 ` [PATCH 3/8] libtracefs: Do not hardcode location of libtraceevent Steven Rostedt
2020-12-16 20:11 ` [PATCH 4/8] libtracefs: Use $(obj) instead of $(OUTPUT) for libtracefs.pc file Steven Rostedt
2020-12-16 20:11 ` Steven Rostedt [this message]
2020-12-16 20:11 ` [PATCH 6/8] libtracefs: Remove unneccessary TRACE_LIBS variable Steven Rostedt
2020-12-16 20:11 ` [PATCH 7/8] libtracefs: Have only one definition of overriding CFLAGS Steven Rostedt
2020-12-16 20:11 ` [PATCH 8/8] libtracefs: Add -rpath to libtracefs.so 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=20201216201134.772542934@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.