From 3efe5ec9897251c677bc5bf568a970c16ff2bc24 Mon Sep 17 00:00:00 2001 From: orbea Date: Thu, 13 May 2021 10:16:58 -0700 Subject: [PATCH] build: Add the liblttng-sessiond-comm.la convenience library MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This allows correctly linking test_kernel_data with slibtool. Signed-off-by: orbea Signed-off-by: Jérémie Galarneau Change-Id: Ib076854dc2a4f0234ad3fb04ea1c3c7c4d4a2b7e --- src/bin/lttng-sessiond/Makefile.am | 23 +++++++++++++---------- tests/unit/Makefile.am | 16 ++-------------- tests/unit/test_kernel_data.c | 5 ----- 3 files changed, 15 insertions(+), 29 deletions(-) diff --git a/src/bin/lttng-sessiond/Makefile.am b/src/bin/lttng-sessiond/Makefile.am index d0033a019..11fb85e0b 100644 --- a/src/bin/lttng-sessiond/Makefile.am +++ b/src/bin/lttng-sessiond/Makefile.am @@ -7,9 +7,9 @@ if EMBED_HELP AM_CPPFLAGS += -I$(top_builddir)/doc/man endif -bin_PROGRAMS = lttng-sessiond +noinst_LTLIBRARIES = liblttng-sessiond-common.la -lttng_sessiond_SOURCES = utils.c utils.h \ +liblttng_sessiond_common_la_SOURCES = utils.c utils.h \ trace-kernel.c trace-kernel.h \ kernel.c kernel.h \ ust-app.h ust-sigbus.h trace-ust.h notify-apps.h \ @@ -59,21 +59,16 @@ lttng_sessiond_SOURCES = utils.c utils.h \ action-executor.c action-executor.h\ trigger-error-query.c -lttng_sessiond_LDFLAGS = -rdynamic - if HAVE_LIBLTTNG_UST_CTL -lttng_sessiond_SOURCES += trace-ust.c ust-registry.c ust-app.c \ +liblttng_sessiond_common_la_SOURCES += trace-ust.c ust-registry.c ust-app.c \ ust-consumer.c ust-consumer.h notify-apps.c \ ust-metadata.c ust-clock.h agent-thread.c agent-thread.h \ ust-field-utils.h ust-field-utils.c \ ust-sigbus.c endif -# Add main.c at the end for compile order -lttng_sessiond_SOURCES += lttng-sessiond.h main.c - # link on liblttngctl for check if sessiond is already alive. -lttng_sessiond_LDADD = -lurcu-common $(URCU_LIBS) $(KMOD_LIBS) \ +liblttng_sessiond_common_la_LIBADD = $(URCU_LIBS) $(KMOD_LIBS) \ $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \ $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \ @@ -88,5 +83,13 @@ lttng_sessiond_LDADD = -lurcu-common $(URCU_LIBS) $(KMOD_LIBS) \ if HAVE_LIBLTTNG_UST_CTL -lttng_sessiond_LDADD += $(UST_CTL_LIBS) +liblttng_sessiond_common_la_LIBADD += $(UST_CTL_LIBS) endif + +bin_PROGRAMS = lttng-sessiond + +lttng_sessiond_SOURCES = lttng-sessiond.h main.c + +lttng_sessiond_LDFLAGS = -rdynamic + +lttng_sessiond_LDADD = liblttng-sessiond-common.la diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 4d3b56fde..b3bfffff3 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -43,6 +43,7 @@ LIBSESSIOND_COMM=$(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la LIBHASHTABLE=$(top_builddir)/src/common/hashtable/libhashtable.la LIBRELAYD=$(top_builddir)/src/common/relayd/librelayd.la LIBLTTNG_CTL=$(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la +LIBLTTNG_SESSIOND_COMMON=$(top_builddir)/src/bin/lttng-sessiond/liblttng-sessiond-common.la # Define test programs noinst_PROGRAMS = \ @@ -170,21 +171,8 @@ test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \ test_ust_data_LDADD += $(SESSIOND_OBJS) endif -# Kernel data structures unit test -KERN_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-kernel.$(OBJEXT) \ - $(top_builddir)/src/common/compat/libcompat.la \ - $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \ - $(top_builddir)/src/bin/lttng-sessiond/globals.$(OBJEXT) \ - $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \ - $(top_builddir)/src/bin/lttng-sessiond/tracker.$(OBJEXT) \ - $(top_builddir)/src/common/health/libhealth.la \ - $(top_builddir)/src/bin/lttng-sessiond/notification-thread-commands.$(OBJEXT) \ - $(LIBLTTNG_CTL) - test_kernel_data_SOURCES = test_kernel_data.c -test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \ - $(LIBHASHTABLE) $(DL_LIBS) -lrt -test_kernel_data_LDADD += $(KERN_DATA_TRACE) +test_kernel_data_LDADD = $(LIBTAP) $(LIBLTTNG_SESSIOND_COMMON) $(DL_LIBS) # utils suffix for unit test diff --git a/tests/unit/test_kernel_data.c b/tests/unit/test_kernel_data.c index 7ed0453af..34d12be24 100644 --- a/tests/unit/test_kernel_data.c +++ b/tests/unit/test_kernel_data.c @@ -23,11 +23,6 @@ /* Number of TAP tests in this file */ #define NUM_TESTS 11 -/* For error.h */ -int lttng_opt_quiet = 1; -int lttng_opt_verbose; -int lttng_opt_mi; - static const char alphanum[] = "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" -- 2.34.1