@@ -301,7 +301,7 @@ $(LIBTRACEEVENT_STATIC): force $(obj)/lib/traceevent/plugins/trace_python_dir \
$(LIBTRACECMD_STATIC): force
$(Q)$(MAKE) -C $(src)/lib/trace-cmd $@
-$(LIBTRACECMD_SHARED): force
+$(LIBTRACECMD_SHARED): force $(LIBTRACEEVENT_SHARED)
$(Q)$(MAKE) -C $(src)/lib/trace-cmd $@
libtraceevent.so: $(LIBTRACEEVENT_SHARED)
@@ -35,6 +35,8 @@ $(DEPS): | $(bdir)
$(bdir)/libtracecmd.a: $(OBJS)
$(Q)$(call do_build_static_lib)
+LIBS = -L$(obj)/lib/traceevent -ltraceevent
+
$(bdir)/libtracecmd.so: $(OBJS)
$(Q)$(call do_compile_shared_library)
@@ -61,7 +61,7 @@ do_build_static_lib = \
do_compile_shared_library = \
($(print_shared_lib_compile) \
- $(CC) --shared $^ -Wl,-soname,$(@F) -o $@)
+ $(CC) --shared $^ $(LIBS) -Wl,-soname,$(@F) -o $@)
do_compile_plugin_obj = \
($(print_plugin_obj_compile) \
@@ -135,9 +135,11 @@ define do_install_data
endef
define do_install_ld
- $(print_install) \
- if [ -d '$(DESTDIR_SQ)$2' ]; then \
- echo '$3' >> $(DESTDIR_SQ)$2/$1; \
- ldconfig; \
+ $(print_install) \
+ if [ -d '$(DESTDIR_SQ)$2' ]; then \
+ if ! grep -q $3 $(DESTDIR_SQ)$2/$1 2>/dev/null; then \
+ echo '$3' >> $(DESTDIR_SQ)$2/$1; \
+ ldconfig; \
+ fi \
fi
endef