linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] libtraceevent: Some Makefile updates
@ 2020-11-23 18:48 Steven Rostedt
  2020-11-23 18:48 ` [PATCH 1/2] libtraceevent: Add libtraceevent.so.$(EP_VERSION) to targets and fix links Steven Rostedt
  2020-11-23 18:48 ` [PATCH 2/2] libtracevent: Remove tempfile libtraceevent.pc Steven Rostedt
  0 siblings, 2 replies; 6+ messages in thread
From: Steven Rostedt @ 2020-11-23 18:48 UTC (permalink / raw)
  To: linux-trace-devel

Fixed the links in installing the library, as well as removing the
temporary file of libtraceveent.pc that is created by root doing an
install.


Steven Rostedt (VMware) (2):
      libtraceevent: Add libtraceevent.so.$(EP_VERSION) to targets and fix links
      libtracevent: Remove tempfile libtraceevent.pc

----
 Makefile | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] libtraceevent: Add libtraceevent.so.$(EP_VERSION) to targets and fix links
  2020-11-23 18:48 [PATCH 0/2] libtraceevent: Some Makefile updates Steven Rostedt
@ 2020-11-23 18:48 ` Steven Rostedt
  2020-11-24  5:10   ` Tzvetomir Stoyanov
  2020-11-23 18:48 ` [PATCH 2/2] libtracevent: Remove tempfile libtraceevent.pc Steven Rostedt
  1 sibling, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2020-11-23 18:48 UTC (permalink / raw)
  To: linux-trace-devel

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

"make clean" left a broken symbolic link of libtraceevent.so.1 around,
because the clean target removes $(TARGET) and *.so, where $(TARGET) removes
the so that libtraceevent.so.1 points to, and *.so removes the symbolic link
that points to libtraceevent.so.1. But nothing removes libtraceevent.so.1.

Add both libtraceevent.so and libtraceevent.so.<major_version> to the
LIB_TARGETS variable (for cleaning them up), and also to fix the links, as
before it was:

 libtraceevent.so -> libtraceevent.so.1.1.0
 libtraceveent.so.1 -> libtraceveent.so.1.1.0

Where it should be a cascade of:

 libtraceevent.so -> libtraceevent.so.1
 libtraceevent.so.1 -> libtraceevent.so.1.1.0

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 9e2b428760a4..2a6bfcce814f 100644
--- a/Makefile
+++ b/Makefile
@@ -91,7 +91,7 @@ N		=
 
 EVENT_PARSE_VERSION = $(EP_VERSION).$(EP_PATCHLEVEL).$(EP_EXTRAVERSION)
 
-LIB_TARGET  = libtraceevent.a libtraceevent.so.$(EVENT_PARSE_VERSION)
+LIB_TARGET  = libtraceevent.a libtraceevent.so libtraceevent.so.$(EP_VERSION) libtraceevent.so.$(EVENT_PARSE_VERSION)
 LIB_INSTALL = libtraceevent.a libtraceevent.so*
 LIB_INSTALL := $(addprefix $(OUTPUT),$(LIB_INSTALL))
 
@@ -139,8 +139,12 @@ $(TE_IN): force
 
 $(OUTPUT)libtraceevent.so.$(EVENT_PARSE_VERSION): $(TE_IN)
 	$(QUIET_LINK)$(CC) --shared $(LDFLAGS) $^ -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@
-	@ln -sf $(@F) $(OUTPUT)libtraceevent.so
-	@ln -sf $(@F) $(OUTPUT)libtraceevent.so.$(EP_VERSION)
+
+$(OUTPUT)libtraceevent.so: $(OUTPUT)libtraceevent.so.$(EP_VERSION)
+	@ln -sf $(<F) $@
+
+$(OUTPUT)libtraceevent.so.$(EP_VERSION): $(OUTPUT)libtraceevent.so.$(EVENT_PARSE_VERSION)
+	@ln -sf $(<F) $@
 
 $(OUTPUT)libtraceevent.a: $(TE_IN)
 	$(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] libtracevent: Remove tempfile libtraceevent.pc
  2020-11-23 18:48 [PATCH 0/2] libtraceevent: Some Makefile updates Steven Rostedt
  2020-11-23 18:48 ` [PATCH 1/2] libtraceevent: Add libtraceevent.so.$(EP_VERSION) to targets and fix links Steven Rostedt
@ 2020-11-23 18:48 ` Steven Rostedt
  2020-11-24  5:26   ` Tzvetomir Stoyanov
  1 sibling, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2020-11-23 18:48 UTC (permalink / raw)
  To: linux-trace-devel

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

"make install" copies libtraceevent.pc.template to libtraceevent.pc and then
modifies it for the installation. This command is usually executed as root,
and when finished, it leaves behind the libtraceevent.pc file owned by root.

Have the "make install" clean up and remove the temporary libtraceevent.pc
file, so that root owned files do not get left behind.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 2a6bfcce814f..775fbd2b3f0e 100644
--- a/Makefile
+++ b/Makefile
@@ -218,6 +218,7 @@ define do_install_pkgconfig_file
 		sed -i "s|LIB_DIR|${libdir}|g" ${PKG_CONFIG_FILE}; \
 		sed -i "s|HEADER_DIR|$(includedir)|g" ${PKG_CONFIG_FILE}; \
 		$(call do_install,$(PKG_CONFIG_FILE),$(pkgconfig_dir),644); 	\
+		${RM} ${PKG_CONFIG_FILE}; \
 	else 									\
 		(echo Failed to locate pkg-config directory) 1>&2;		\
 	fi
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] libtraceevent: Add libtraceevent.so.$(EP_VERSION) to targets and fix links
  2020-11-23 18:48 ` [PATCH 1/2] libtraceevent: Add libtraceevent.so.$(EP_VERSION) to targets and fix links Steven Rostedt
@ 2020-11-24  5:10   ` Tzvetomir Stoyanov
  0 siblings, 0 replies; 6+ messages in thread
From: Tzvetomir Stoyanov @ 2020-11-24  5:10 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Linux Trace Devel

On Mon, Nov 23, 2020 at 8:50 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
>
> "make clean" left a broken symbolic link of libtraceevent.so.1 around,
> because the clean target removes $(TARGET) and *.so, where $(TARGET) removes
> the so that libtraceevent.so.1 points to, and *.so removes the symbolic link
> that points to libtraceevent.so.1. But nothing removes libtraceevent.so.1.
>
> Add both libtraceevent.so and libtraceevent.so.<major_version> to the
> LIB_TARGETS variable (for cleaning them up), and also to fix the links, as
> before it was:
>
>  libtraceevent.so -> libtraceevent.so.1.1.0
>  libtraceveent.so.1 -> libtraceveent.so.1.1.0
>
> Where it should be a cascade of:
>
>  libtraceevent.so -> libtraceevent.so.1
>  libtraceevent.so.1 -> libtraceevent.so.1.1.0
>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
>  Makefile | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 9e2b428760a4..2a6bfcce814f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -91,7 +91,7 @@ N             =
>
>  EVENT_PARSE_VERSION = $(EP_VERSION).$(EP_PATCHLEVEL).$(EP_EXTRAVERSION)
>
> -LIB_TARGET  = libtraceevent.a libtraceevent.so.$(EVENT_PARSE_VERSION)
> +LIB_TARGET  = libtraceevent.a libtraceevent.so libtraceevent.so.$(EP_VERSION) libtraceevent.so.$(EVENT_PARSE_VERSION)
>  LIB_INSTALL = libtraceevent.a libtraceevent.so*
>  LIB_INSTALL := $(addprefix $(OUTPUT),$(LIB_INSTALL))
>
> @@ -139,8 +139,12 @@ $(TE_IN): force
>
>  $(OUTPUT)libtraceevent.so.$(EVENT_PARSE_VERSION): $(TE_IN)
>         $(QUIET_LINK)$(CC) --shared $(LDFLAGS) $^ -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@
> -       @ln -sf $(@F) $(OUTPUT)libtraceevent.so
> -       @ln -sf $(@F) $(OUTPUT)libtraceevent.so.$(EP_VERSION)
> +
> +$(OUTPUT)libtraceevent.so: $(OUTPUT)libtraceevent.so.$(EP_VERSION)
> +       @ln -sf $(<F) $@
> +
> +$(OUTPUT)libtraceevent.so.$(EP_VERSION): $(OUTPUT)libtraceevent.so.$(EVENT_PARSE_VERSION)
> +       @ln -sf $(<F) $@
>
>  $(OUTPUT)libtraceevent.a: $(TE_IN)
>         $(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^
> --
> 2.28.0
>
>
Thanks Steven!
Acked-by: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
-- 
Tzvetomir (Ceco) Stoyanov
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] libtracevent: Remove tempfile libtraceevent.pc
  2020-11-23 18:48 ` [PATCH 2/2] libtracevent: Remove tempfile libtraceevent.pc Steven Rostedt
@ 2020-11-24  5:26   ` Tzvetomir Stoyanov
  2020-11-24 13:51     ` Steven Rostedt
  0 siblings, 1 reply; 6+ messages in thread
From: Tzvetomir Stoyanov @ 2020-11-24  5:26 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Linux Trace Devel

On Mon, Nov 23, 2020 at 8:50 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
>
> "make install" copies libtraceevent.pc.template to libtraceevent.pc and then
> modifies it for the installation. This command is usually executed as root,
> and when finished, it leaves behind the libtraceevent.pc file owned by root.
>
> Have the "make install" clean up and remove the temporary libtraceevent.pc
> file, so that root owned files do not get left behind.

Isn't it useful to have this file after the "make install" command, for debug
purposes - to see how exactly it was modified ? The file is removed by
"make clean".

>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
>  Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Makefile b/Makefile
> index 2a6bfcce814f..775fbd2b3f0e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -218,6 +218,7 @@ define do_install_pkgconfig_file
>                 sed -i "s|LIB_DIR|${libdir}|g" ${PKG_CONFIG_FILE}; \
>                 sed -i "s|HEADER_DIR|$(includedir)|g" ${PKG_CONFIG_FILE}; \
>                 $(call do_install,$(PKG_CONFIG_FILE),$(pkgconfig_dir),644);     \
> +               ${RM} ${PKG_CONFIG_FILE}; \
>         else                                                                    \
>                 (echo Failed to locate pkg-config directory) 1>&2;              \
>         fi
> --
> 2.28.0
>
>

-- 
Tzvetomir (Ceco) Stoyanov
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] libtracevent: Remove tempfile libtraceevent.pc
  2020-11-24  5:26   ` Tzvetomir Stoyanov
@ 2020-11-24 13:51     ` Steven Rostedt
  0 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2020-11-24 13:51 UTC (permalink / raw)
  To: Tzvetomir Stoyanov; +Cc: Linux Trace Devel

On Tue, 24 Nov 2020 07:26:25 +0200
Tzvetomir Stoyanov <tz.stoyanov@gmail.com> wrote:

> On Mon, Nov 23, 2020 at 8:50 PM Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> >
> > "make install" copies libtraceevent.pc.template to libtraceevent.pc and then
> > modifies it for the installation. This command is usually executed as root,
> > and when finished, it leaves behind the libtraceevent.pc file owned by root.
> >
> > Have the "make install" clean up and remove the temporary libtraceevent.pc
> > file, so that root owned files do not get left behind.  
> 
> Isn't it useful to have this file after the "make install" command, for debug
> purposes - to see how exactly it was modified ? The file is removed by
> "make clean".

Then it needs to be created via normal make. "make install" should leave no
"artifacts" lying around. It's usually done as root, and anything left may
be stuck there for the normal user (not be able to delete it).

The files removed by "make clean" are only those created by normal makes.

I can change the patch to have the creation of the package config created
by "make" and not by "make install", and then have it removed by "make
clean".

-- Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-24 13:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23 18:48 [PATCH 0/2] libtraceevent: Some Makefile updates Steven Rostedt
2020-11-23 18:48 ` [PATCH 1/2] libtraceevent: Add libtraceevent.so.$(EP_VERSION) to targets and fix links Steven Rostedt
2020-11-24  5:10   ` Tzvetomir Stoyanov
2020-11-23 18:48 ` [PATCH 2/2] libtracevent: Remove tempfile libtraceevent.pc Steven Rostedt
2020-11-24  5:26   ` Tzvetomir Stoyanov
2020-11-24 13:51     ` Steven Rostedt

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).