From 77ca30962b076496a40eaf7d7bcc8269f838fdf5 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Mon, 28 Aug 2017 14:48:58 -0400 Subject: [PATCH] Fix test: don't link tests directly with plugins MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. Reviewed-by: Julien Desfossez Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- plugins/lttng-utils/Makefile.am | 28 ++++++++++++++++------------ tests/plugins/Makefile.am | 18 ++++++++++++------ 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/plugins/lttng-utils/Makefile.am b/plugins/lttng-utils/Makefile.am index 72c733110..f82629266 100644 --- a/plugins/lttng-utils/Makefile.am +++ b/plugins/lttng-utils/Makefile.am @@ -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 \ diff --git a/tests/plugins/Makefile.am b/tests/plugins/Makefile.am index e34e66a6e..ffea78bd9 100644 --- a/tests/plugins/Makefile.am +++ b/tests/plugins/Makefile.am @@ -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.34.1