Skip to contentSkip to conversation

Fix test: don't link tests directly with plugins

PATCH Jérémie Galarneau 1 participant 1 message Aug 29, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Merged in master and stable-2.0. Thanks!

Jérémie

Quoted 103 lines · Michael Jeanson

Move the debug-info code to a convenience library that is then used by both the plugin and the test code. This fixes build with static libraries disabled where it's not possible to link directly the plugin shared object which is a module.

---
 plugins/lttng-utils/Makefile.am | 28 ++++++++++++++++------------
 tests/plugins/Makefile.am       | 18 ++++++++++++------
 2 files changed, 28 insertions(+), 18 deletions(-)
plugins/lttng-utils/Makefile.am +16 -12
index 72c7331..f826292 100644
@@ -1,36 +1,40 @@
 AM_CPPFLAGS += -I$(top_srcdir)/plugins \
            -I$(top_srcdir)/plugins/libctfcopytrace
 
-SUBDIRS = .
+noinst_LTLIBRARIES = libdebug-info.la
+libdebug_info_la_SOURCES = \
+       bin-info.c \
+       bin-info.h \
+       crc32.c \
+       crc32.h \
+       debug-info.c \
+       debug-info.h \
+       dwarf.c \
+       dwarf.h \
+       logging.c \
+       logging.h
 
 plugindir = "$(PLUGINSDIR)"
 plugin_LTLIBRARIES = babeltrace-plugin-lttng-utils.la
 
 babeltrace_plugin_lttng_utils_la_SOURCES = \
        plugin.c \
-       debug-info.h \
-       debug-info.c \
-       bin-info.c \
-       dwarf.c \
-       crc32.c \
        utils.c \
        copy.c \
-       crc32.h \
-       debug-info.h \
-       dwarf.h \
-       bin-info.h \
        utils.h \
        copy.h \
-       logging.c \
        logging.h
 
+babeltrace_plugin_lttng_utils_la_LIBADD = \
+       libdebug-info.la
+
 babeltrace_plugin_lttng_utils_la_LDFLAGS = \
        $(LT_NO_UNDEFINED) \
        -avoid-version -module \
        $(ELFUTILS_LIBS)
 
 if !ENABLE_BUILT_IN_PLUGINS
-babeltrace_plugin_lttng_utils_la_LIBADD = \
+babeltrace_plugin_lttng_utils_la_LIBADD += \
        $(top_builddir)/lib/libbabeltrace.la \
        $(top_builddir)/common/libbabeltrace-common.la \
        $(top_builddir)/logging/libbabeltrace-logging.la \
tests/plugins/Makefile.am +12 -7
index e34e66a..ffea78b 100644
@@ -20,14 +20,20 @@ LOG_DRIVER_FLAGS='--merge'
 TESTS = test-utils-muxer-complete
 
 if ENABLE_DEBUG_INFO
-test_dwarf_LDFLAGS = -static
-test_dwarf_LDADD = $(LIBTAP) \
-       $(top_builddir)/plugins/lttng-utils/babeltrace-plugin-lttng-utils.la
+test_dwarf_LDADD = \
+       $(top_builddir)/plugins/lttng-utils/libdebug-info.la \
+       $(top_builddir)/logging/libbabeltrace-logging.la \
+       $(top_builddir)/common/libbabeltrace-common.la \
+       $(ELFUTILS_LIBS) \
+       $(LIBTAP)
 test_dwarf_SOURCES = test_dwarf.c
 
-test_bin_info_LDFLAGS = -static
-test_bin_info_LDADD = $(LIBTAP) \
-       $(top_builddir)/plugins/lttng-utils/babeltrace-plugin-lttng-utils.la
+test_bin_info_LDADD = \
+       $(top_builddir)/plugins/lttng-utils/libdebug-info.la \
+       $(top_builddir)/logging/libbabeltrace-logging.la \
+       $(top_builddir)/common/libbabeltrace-common.la \
+       $(ELFUTILS_LIBS) \
+       $(LIBTAP)
 test_bin_info_SOURCES = test_bin_info.c
 
 noinst_PROGRAMS += test_dwarf test_bin_info
--

2.7.4

Signature · 7 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev