From: Steven Rostedt <rostedt@goodmis.org>
To: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: "linux-trace-devel@vger.kernel.org" <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH v2] tools/lib/traceevent: Added support for pkg-config
Date: Mon, 19 Nov 2018 23:07:44 -0500 [thread overview]
Message-ID: <20181119230616.10958fa3@vmware.local.home> (raw)
In-Reply-To: <20181018120458.3792-1-tstoyanov@vmware.com>
On Thu, 18 Oct 2018 12:05:09 +0000
Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:
> This patch implements integration with pkg-config framework.
> pkg-config can be used by the library users to determine
> required CFLAGS and LDFLAGS in order to use the library
>
OK, this is a v2 of a single patch of the previous patch queue.
Note, this would normally mean the other two patches should be dropped
(when doing a v2 or other version, keep all the patches in the queue,
unless the other patches were already accepted, which they don't appear
to be).
The only time I allow (but other maintainers do not), to update a
single patch in the queue is if it is a reply to the patch it is
updating. That is, you can send a v2 of a single patch, but it must be
a reply to (not a start of a new thread) of a patch it is updating.
I will state that new patch sets, must start their own threads.
-- Steve
> Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
> ---
> tools/lib/traceevent/Makefile | 26 ++++++++++++++++---
> .../lib/traceevent/libtraceevent.pc.template | 10 +++++++
> 2 files changed, 33 insertions(+), 3 deletions(-)
> create mode 100644 tools/lib/traceevent/libtraceevent.pc.template
>
> diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
> index 0b4e833088a4..05ac0ec9bcd1 100644
> --- a/tools/lib/traceevent/Makefile
> +++ b/tools/lib/traceevent/Makefile
> @@ -25,6 +25,7 @@ endef
> $(call allow-override,CC,$(CROSS_COMPILE)gcc)
> $(call allow-override,AR,$(CROSS_COMPILE)ar)
> $(call allow-override,NM,$(CROSS_COMPILE)nm)
> +$(call allow-override,PKG_CONFIG,pkg-config)
>
> EXT = -std=gnu99
> INSTALL = install
> @@ -47,6 +48,8 @@ prefix ?= /usr/local
> libdir = $(prefix)/$(libdir_relative)
> man_dir = $(prefix)/share/man
> man_dir_SQ = '$(subst ','\'',$(man_dir))'
> +pkgconfig_dir ?= $(word 1,$(shell $(PKG_CONFIG) \
> + --variable pc_path pkg-config | tr ":" " "))
>
> export man_dir man_dir_SQ INSTALL
> export DESTDIR DESTDIR_SQ
> @@ -270,7 +273,19 @@ define do_generate_dynamic_list_file
> fi
> endef
>
> -install_lib: all_cmd install_plugins
> +PKG_CONFIG_FILE = libtraceevent.pc
> +define do_install_pkgconfig_file
> + if [ -n "${pkgconfig_dir}" ]; then \
> + cp -f ${PKG_CONFIG_FILE}.template ${PKG_CONFIG_FILE}; \
> + sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE}; \
> + sed -i "s|LIB_VERSION|${EVENT_PARSE_VERSION}|g" ${PKG_CONFIG_FILE}; \
> + $(call do_install,$(PKG_CONFIG_FILE),$(pkgconfig_dir),644); \
> + else \
> + (echo Failed to locate pkg-config directory) 1>&2; \
> + fi
> +endef
> +
> +install_lib: all_cmd install_plugins install_pkgconfig
> $(call QUIET_INSTALL, $(LIB_TARGET)) \
> $(call do_install_mkdir,$(libdir_SQ)); \
> cp -fpR $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ)
> @@ -279,6 +294,10 @@ install_plugins: $(PLUGINS)
> $(call QUIET_INSTALL, trace_plugins) \
> $(call do_install_plugins, $(PLUGINS))
>
> +install_pkgconfig:
> + $(call QUIET_INSTALL, $(PKG_CONFIG_FILE)) \
> + $(call do_install_pkgconfig_file,$(prefix))
> +
> install_headers:
> $(call QUIET_INSTALL, headers) \
> $(call do_install,event-parse.h,$(prefix)/include/traceevent,644); \
> @@ -289,8 +308,9 @@ install: install_lib
>
> clean:
> $(call QUIET_CLEAN, libtraceevent) \
> - $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d .*.cmd \
> - $(RM) TRACEEVENT-CFLAGS tags TAGS
> + $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d .*.cmd; \
> + $(RM) TRACEEVENT-CFLAGS tags TAGS; \
> + $(RM) $(PKG_CONFIG_FILE)
>
> PHONY += force plugins
> force:
> diff --git a/tools/lib/traceevent/libtraceevent.pc.template b/tools/lib/traceevent/libtraceevent.pc.template
> new file mode 100644
> index 000000000000..42e4d6cb6b9e
> --- /dev/null
> +++ b/tools/lib/traceevent/libtraceevent.pc.template
> @@ -0,0 +1,10 @@
> +prefix=INSTALL_PREFIX
> +libdir=${prefix}/lib64
> +includedir=${prefix}/include/traceevent
> +
> +Name: libtraceevent
> +URL: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> +Description: Linux kernel trace event library
> +Version: LIB_VERSION
> +Cflags: -I${includedir}
> +Libs: -L${libdir} -ltraceevent
next prev parent reply other threads:[~2018-11-20 14:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-18 12:05 [PATCH v2] tools/lib/traceevent: Added support for pkg-config Tzvetomir Stoyanov
2018-11-20 4:07 ` Steven Rostedt [this message]
2018-11-20 7:55 ` Tzvetomir Stoyanov
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=20181119230616.10958fa3@vmware.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=tstoyanov@vmware.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).