Skip to content

Commit fe31672

Browse files
olsajiriacmel
authored andcommitted
tools lib traceevent: Add version for traceevent shared object
Adding version support for libtraceevent.so object. Using the existing EVENT_PARSE_VERSION variable to construct the .so object version string, which now consists of: $(EP_VERSION).$(EP_PATCHLEVEL).$(EP_EXTRAVERSION) Looks like it was created for this purpose anyway. The build will now produce following traeceevent libraries: $ ll libtraceevent* libtraceevent.a libtraceevent.so -> libtraceevent.so.1.1.0 libtraceevent.so.1 -> libtraceevent.so.1.1.0 libtraceevent.so.1.1.0 Also the install target will carry them: $ make DESTDIR=/tmp/krava prefix=/usr install INSTALL trace_plugins INSTALL libtraceevent.a INSTALL libtraceevent.so.1.1.0 $ find /tmp/krava/ | xargs ls -l ... /tmp/krava/usr/lib64: total 572 libtraceevent.a libtraceevent.so -> libtraceevent.so.1.1.0 libtraceevent.so.1 -> libtraceevent.so.1.1.0 libtraceevent.so.1.1.0 ... Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/n/tip-v64z62fh0dwt0ueie5usrnac@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 39944a7 commit fe31672

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎tools/lib/traceevent/Makefile‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ libdir_SQ = $(subst ','\'',$(libdir))
9999
libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
100100
plugin_dir_SQ = $(subst ','\'',$(plugin_dir))
101101

102-
LIB_TARGET = libtraceevent.a libtraceevent.so
103-
104102
CONFIG_INCLUDES =
105103
CONFIG_LIBS =
106104
CONFIG_FLAGS =
@@ -114,6 +112,9 @@ N =
114112

115113
EVENT_PARSE_VERSION = $(EP_VERSION).$(EP_PATCHLEVEL).$(EP_EXTRAVERSION)
116114

115+
LIB_TARGET = libtraceevent.a libtraceevent.so.$(EVENT_PARSE_VERSION)
116+
LIB_INSTALL = libtraceevent.a libtraceevent.so*
117+
117118
INCLUDES = -I. -I $(srctree)/tools/include $(CONFIG_INCLUDES)
118119

119120
# Set compile option CFLAGS
@@ -171,8 +172,10 @@ all_cmd: $(CMD_TARGETS)
171172
$(TE_IN): force
172173
$(Q)$(MAKE) $(build)=libtraceevent
173174

174-
$(OUTPUT)libtraceevent.so: $(TE_IN)
175-
$(QUIET_LINK)$(CC) --shared $^ -o $@
175+
$(OUTPUT)libtraceevent.so.$(EVENT_PARSE_VERSION): $(TE_IN)
176+
$(QUIET_LINK)$(CC) --shared $^ -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@
177+
@ln -sf $(@F) $(OUTPUT)libtraceevent.so
178+
@ln -sf $(@F) $(OUTPUT)libtraceevent.so.$(EP_VERSION)
176179

177180
$(OUTPUT)libtraceevent.a: $(TE_IN)
178181
$(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^
@@ -262,7 +265,8 @@ endef
262265

263266
install_lib: all_cmd install_plugins
264267
$(call QUIET_INSTALL, $(LIB_TARGET)) \
265-
$(call do_install,$(LIB_TARGET),$(libdir_SQ))
268+
$(call do_install_mkdir,$(libdir_SQ)); \
269+
cp -fpR $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ)
266270

267271
install_plugins: $(PLUGINS)
268272
$(call QUIET_INSTALL, trace_plugins) \

0 commit comments

Comments
 (0)