# SPDX-License-Identifier: GPL-2.0-only
AUTOMAKE_OPTIONS = subdir-objects
+noinst_LTLIBRARIES =
-SUBDIRS = \
- string-utils \
- bytecode \
- filter \
- argpar
-
-# Make sure to always distribute all folders
-# since SUBDIRS is decided at configure time.
-DIST_SUBDIRS = \
- compat \
- health \
- hashtable \
- kernel-ctl \
- sessiond-comm \
- relayd \
- kernel-consumer \
- ust-consumer \
- testpoint \
- index \
- config \
- consumer \
- string-utils \
- fd-tracker \
- bytecode \
- filter \
- argpar
-
-# Common library
-noinst_LTLIBRARIES = libcommon.la
-EXTRA_DIST = mi-lttng-4.0.xsd
-
-libcommon_la_SOURCES = \
- actions/action.c \
- actions/group.c \
- actions/notify.c \
- actions/rotate-session.c \
- actions/snapshot-session.c \
- actions/start-session.c \
- actions/stop-session.c \
- buffer-view.h buffer-view.c \
- common.h \
- conditions/buffer-usage.c \
- conditions/condition.c \
- conditions/event-rule.c \
- conditions/session-consumed-size.c \
- conditions/session-rotation.c \
- context.c context.h \
- credentials.c credentials.h \
- daemonize.c daemonize.h \
- defaults.c \
- domain.c \
- dynamic-array.c dynamic-array.h \
- dynamic-buffer.c dynamic-buffer.h \
- endpoint.c \
- error.c error.h \
- evaluation.c \
- event.c \
- event-expr-to-bytecode.c event-expr-to-bytecode.h \
- event-rule/event-rule.c \
- event-rule/kprobe.c \
- event-rule/syscall.c \
- event-rule/uprobe.c \
- event-rule/tracepoint.c \
- filter.c filter.h \
- fd-handle.c fd-handle.h \
- fs-handle.c fs-handle.h fs-handle-internal.h \
- futex.c futex.h \
- kernel-probe.c \
- location.c \
- mi-lttng.c mi-lttng.h \
- notification.c \
- optional.h \
- payload.c payload.h \
- payload-view.c payload-view.h \
- pipe.c pipe.h \
- readwrite.c readwrite.h \
- runas.c runas.h \
- session-descriptor.c \
- snapshot.c snapshot.h \
- spawn-viewer.c spawn-viewer.h \
- time.c \
- trace-chunk.c trace-chunk.h \
- trace-chunk-registry.h \
- trigger.c \
- unix.c unix.h \
- uri.c uri.h \
- userspace-probe.c \
- utils.c utils.h \
- uuid.c uuid.h \
- thread.c thread.h \
- tracker.c tracker.h \
- waiter.c waiter.h
+BUILT_SOURCES =
+
+noinst_HEADERS = \
+ align.hpp \
+ bug.hpp \
+ defaults.hpp \
+ error.hpp \
+ futex.hpp \
+ lttng-kernel.hpp \
+ lttng-kernel-old.hpp \
+ macros.hpp \
+ time.hpp \
+ uri.hpp \
+ utils.hpp
+
+
+# libargpar
+noinst_LTLIBRARIES += libargpar.la
+libargpar_la_SOURCES = \
+ argpar/argpar.c \
+ argpar/argpar.h
+
+
+# libargpar-utils
+noinst_LTLIBRARIES += libargpar-utils.la
+libargpar_utils_la_SOURCES = \
+ argpar-utils/argpar-utils.cpp \
+ argpar-utils/argpar-utils.hpp
+
+
+# libbytecode
+noinst_LTLIBRARIES += libbytecode.la
+libbytecode_la_SOURCES = \
+ bytecode/bytecode.cpp \
+ bytecode/bytecode.hpp
+
+
+# The libcommon-lgpl static archive contains only LGPLv2.1 code. It is
+# meant to be used by LGPLv2.1 libraries such as liblttng-ctl. It also
+# contains libcommon-lgpl.la.
+
+noinst_LTLIBRARIES += libcommon-lgpl.la
+libcommon_lgpl_la_SOURCES = \
+ actions/action.cpp \
+ actions/list.cpp \
+ actions/notify.cpp \
+ actions/path.cpp \
+ actions/rotate-session.cpp \
+ actions/snapshot-session.cpp \
+ actions/start-session.cpp \
+ actions/stop-session.cpp \
+ actions/rate-policy.cpp \
+ buffer-view.hpp buffer-view.cpp \
+ channel.cpp \
+ conditions/buffer-usage.cpp \
+ conditions/condition.cpp \
+ conditions/event-rule-matches.cpp \
+ conditions/session-consumed-size.cpp \
+ conditions/session-rotation.cpp \
+ credentials.cpp credentials.hpp \
+ defaults.cpp \
+ domain.cpp \
+ dynamic-array.cpp dynamic-array.hpp \
+ dynamic-buffer.cpp dynamic-buffer.hpp \
+ endpoint.cpp \
+ error.cpp error.hpp \
+ error-query.cpp \
+ evaluation.cpp \
+ event.cpp \
+ event-expr/event-expr.cpp \
+ event-field-value.cpp \
+ event-rule/event-rule.cpp \
+ event-rule/kernel-kprobe.cpp \
+ event-rule/kernel-syscall.cpp \
+ event-rule/kernel-uprobe.cpp \
+ event-rule/kernel-tracepoint.cpp \
+ event-rule/user-tracepoint.cpp \
+ event-rule/log4j-logging.cpp \
+ event-rule/jul-logging.cpp \
+ event-rule/python-logging.cpp \
+ exception.cpp exception.hpp \
+ fd-handle.cpp fd-handle.hpp\
+ format.hpp \
+ kernel-probe.cpp \
+ location.cpp \
+ locked-reference.hpp \
+ logging-utils.hpp logging-utils.cpp \
+ log-level-rule.cpp \
+ make-unique.hpp \
+ make-unique-wrapper.hpp \
+ mi-lttng.cpp mi-lttng.hpp \
+ notification.cpp \
+ payload.cpp payload.hpp \
+ payload-view.cpp payload-view.hpp \
+ pthread-lock.hpp \
+ readwrite.cpp readwrite.hpp \
+ runas.cpp runas.hpp \
+ session-descriptor.cpp \
+ snapshot.cpp snapshot.hpp \
+ spawn-viewer.cpp spawn-viewer.hpp \
+ thread.cpp thread.hpp \
+ time.cpp \
+ tracker.cpp tracker.hpp \
+ trigger.cpp \
+ unix.cpp unix.hpp \
+ uri.cpp uri.hpp \
+ userspace-probe.cpp \
+ urcu.hpp \
+ utils.cpp utils.hpp
if HAVE_ELF_H
-libcommon_la_SOURCES += \
- lttng-elf.c lttng-elf.h
+libcommon_lgpl_la_SOURCES += \
+ lttng-elf.cpp lttng-elf.hpp
endif
-libcommon_la_LIBADD = \
- $(top_builddir)/src/common/bytecode/libbytecode.la \
- $(top_builddir)/src/common/config/libconfig.la \
- $(top_builddir)/src/common/compat/libcompat.la \
- $(top_builddir)/src/common/hashtable/libhashtable.la \
- $(top_builddir)/src/common/fd-tracker/libfd-tracker.la \
- $(top_builddir)/src/common/filter/libfilter.la \
+libcommon_lgpl_la_LIBADD = \
+ libbytecode.la \
+ libcompat.la \
+ libconfig.la \
+ libfilter.la \
+ libhashtable-lgpl.la \
$(top_builddir)/src/vendor/msgpack/libmsgpack.la
-if BUILD_LIB_COMPAT
-SUBDIRS += compat
+
+# The libpath static archive contains GPLv2 compatible code. It is
+# meant to be used by GPL executables.
+noinst_LTLIBRARIES += libpath.la
+libpath_la_SOURCES = \
+ path.cpp path.hpp
+
+
+# The libcommon-gpl static archive contains GPLv2 compatible code. It is
+# meant to be used by GPL executables.
+noinst_LTLIBRARIES += libcommon-gpl.la
+libcommon_gpl_la_SOURCES = \
+ common.hpp \
+ context.cpp context.hpp \
+ daemonize.cpp daemonize.hpp \
+ filter.cpp filter.hpp \
+ fs-handle.cpp fs-handle.hpp fs-handle-internal.hpp \
+ futex.cpp futex.hpp \
+ index-allocator.cpp index-allocator.hpp \
+ optional.hpp \
+ pipe.cpp pipe.hpp \
+ shm.cpp shm.hpp \
+ trace-chunk.cpp trace-chunk.hpp \
+ trace-chunk-registry.hpp \
+ uuid.cpp uuid.hpp \
+ waiter.cpp waiter.hpp
+
+libcommon_gpl_la_LIBADD = \
+ libcommon-lgpl.la \
+ libpath.la \
+ libini-config.la \
+ libhashtable-gpl.la \
+ libfd-tracker.la
+
+
+# libcompat
+noinst_LTLIBRARIES += libcompat.la
+libcompat_la_SOURCES = \
+ compat/compat-fcntl.cpp \
+ compat/directory-handle.cpp \
+ compat/directory-handle.hpp \
+ compat/dirent.hpp \
+ compat/endian.hpp \
+ compat/errno.hpp \
+ compat/fcntl.hpp \
+ compat/getenv.hpp \
+ compat/mman.hpp \
+ compat/netdb.hpp \
+ compat/path.hpp \
+ compat/paths.hpp \
+ compat/poll.cpp \
+ compat/poll.hpp \
+ compat/pthread.hpp \
+ compat/socket.hpp \
+ compat/string.hpp \
+ compat/tid.hpp \
+ compat/time.hpp
+
+
+# libconfig
+noinst_LTLIBRARIES += libconfig.la
+libconfig_la_SOURCES = \
+ config/config-internal.hpp \
+ config/config-session-abi.hpp \
+ config/session-config.cpp \
+ config/session-config.hpp
+
+libconfig_la_CPPFLAGS = $(libxml2_CFLAGS) $(AM_CPPFLAGS)
+libconfig_la_LIBADD = ${libxml2_LIBS}
+
+
+if BUILD_LIB_CONSUMER
+noinst_LTLIBRARIES += libconsumer.la
+
+libconsumer_la_SOURCES = \
+ consumer/consumer.cpp \
+ consumer/consumer.hpp \
+ consumer/consumer-metadata-cache.cpp \
+ consumer/consumer-metadata-cache.hpp \
+ consumer/consumer-stream.cpp \
+ consumer/consumer-stream.hpp \
+ consumer/consumer-testpoint.hpp \
+ consumer/consumer-timer.cpp \
+ consumer/consumer-timer.hpp \
+ consumer/metadata-bucket.cpp \
+ consumer/metadata-bucket.hpp
+
+libconsumer_la_LIBADD = \
+ libkernel-consumer.la \
+ librelayd.la \
+ libsessiond-comm.la
+
+if HAVE_LIBLTTNG_UST_CTL
+libconsumer_la_LIBADD += \
+ libust-consumer.la
endif
+endif # BUILD_LIB_CONSUMER
+
+
+# libfd-tracker
+noinst_LTLIBRARIES += libfd-tracker.la
+libfd_tracker_la_SOURCES = \
+ fd-tracker/fd-tracker.cpp \
+ fd-tracker/fd-tracker.hpp \
+ fd-tracker/inode.cpp \
+ fd-tracker/inode.hpp \
+ fd-tracker/utils.cpp \
+ fd-tracker/utils.hpp \
+ fd-tracker/utils-poll.cpp
+
+
+# libfilter
+noinst_LTLIBRARIES += libfilter.la
+
+libfilter_la_SOURCES = \
+ filter/filter-ast.hpp \
+ filter/filter-ir.hpp \
+ filter/filter-lexer.lpp \
+ filter/filter-parser.ypp \
+ filter/filter-symbols.hpp \
+ filter/filter-visitor-generate-bytecode.cpp \
+ filter/filter-visitor-generate-ir.cpp \
+ filter/filter-visitor-ir-check-binary-op-nesting.cpp \
+ filter/filter-visitor-ir-normalize-glob-patterns.cpp \
+ filter/filter-visitor-ir-validate-globbing.cpp \
+ filter/filter-visitor-ir-validate-string.cpp \
+ filter/filter-visitor-xml.cpp \
+ filter/memstream.hpp
+
+BUILT_SOURCES += filter/filter-parser.hpp
+
+# Disable some warning flags for generated sources.
+FILTER_WARN_FLAGS = \
+ -Wno-null-dereference \
+ -Wno-redundant-decls \
+ -Wno-unused-parameter
+
+libfilter_la_CFLAGS = $(AM_CFLAGS) $(FILTER_WARN_FLAGS)
+libfilter_la_CXXFLAGS = -include filter-symbols.hpp $(AM_CXXFLAGS) $(FILTER_WARN_FLAGS)
+libfilter_la_CPPFLAGS = -I$(srcdir)/filter -I$(builddir)/filter $(AM_CPPFLAGS)
+libfilter_la_LIBADD = libstring-utils.la
+
+AM_YFLAGS = -t -d -v -Wno-yacc
+
+# start with empty files to clean
+CLEANFILES =
+
+if HAVE_BISON
+# we have bison: we can clean the generated parser files
+CLEANFILES += \
+ filter/filter-parser.cpp \
+ filter/filter-parser.hpp \
+ filter/filter-parser.output
+else # HAVE_BISON
+# create target used to stop the build if we want to build the parser,
+# but we don't have the necessary tool to do so
+filter/filter-parser.cpp filter/filter-parser.hpp: filter/filter-parser.ypp
+ @echo "Error: Cannot build target because bison is missing."
+ @echo "Make sure bison is installed and run the configure script again."
+ @false
+
+BUILT_SOURCES += filter/filter-parser.cpp filter/filter-parser.hpp
+endif # HAVE_BISON
+
+if HAVE_FLEX
+# we have flex: we can clean the generated lexer files
+CLEANFILES += filter/filter-lexer.cpp
+else # HAVE_FLEX
+# create target used to stop the build if we want to build the lexer,
+# but we don't have the necessary tool to do so
+filter/filter-lexer.cpp: filter/filter-lexer.lpp
+ @echo "Error: Cannot build target because flex is missing."
+ @echo "Make sure flex is installed and run the configure script again."
+ @false
+
+BUILT_SOURCES += filter/filter-lexer.cpp
+endif # HAVE_FLEX
+
+
+noinst_LTLIBRARIES += libhashtable-lgpl.la
+libhashtable_lgpl_la_SOURCES = \
+ hashtable/seed.cpp \
+ hashtable/utils.cpp \
+ hashtable/utils.hpp
+
+
+noinst_LTLIBRARIES += libhashtable-gpl.la
+libhashtable_gpl_la_SOURCES = \
+ hashtable/hashtable.cpp \
+ hashtable/hashtable.hpp \
+ hashtable/hashtable-symbols.hpp
+
+libhashtable_gpl_la_LIBADD = \
+ $(URCU_LIBS) \
+ $(URCU_CDS_LIBS)
+
if BUILD_LIB_HEALTH
-SUBDIRS += health
+noinst_LTLIBRARIES += libhealth.la
+
+libhealth_la_SOURCES = \
+ health/health.cpp
endif
-if BUILD_LIB_HASHTABLE
-SUBDIRS += hashtable
+
+# libini-config
+noinst_LTLIBRARIES += libini-config.la
+libini_config_la_SOURCES = \
+ ini-config/ini.cpp \
+ ini-config/ini.hpp \
+ ini-config/ini-config.cpp \
+ ini-config/ini-config.hpp
+
+
+if BUILD_LIB_INDEX
+noinst_LTLIBRARIES += libindex.la
+
+libindex_la_SOURCES = \
+ index/ctf-index.hpp \
+ index/index.cpp \
+ index/index.hpp
endif
+
if BUILD_LIB_KERNEL_CTL
-SUBDIRS += kernel-ctl
+noinst_LTLIBRARIES += libkernel-ctl.la
+
+libkernel_ctl_la_SOURCES = \
+ kernel-ctl/kernel-ctl.cpp \
+ kernel-ctl/kernel-ctl.hpp \
+ kernel-ctl/kernel-ioctl.hpp
endif
if BUILD_LIB_SESSIOND_COMM
-SUBDIRS += sessiond-comm
+noinst_LTLIBRARIES += libsessiond-comm.la
+
+libsessiond_comm_la_SOURCES = \
+ sessiond-comm/agent.hpp \
+ sessiond-comm/inet.cpp \
+ sessiond-comm/inet.hpp \
+ sessiond-comm/inet6.cpp \
+ sessiond-comm/inet6.hpp \
+ sessiond-comm/relayd.hpp \
+ sessiond-comm/sessiond-comm.cpp \
+ sessiond-comm/sessiond-comm.hpp
endif
if BUILD_LIB_RELAYD
-SUBDIRS += relayd
-endif
+noinst_LTLIBRARIES += librelayd.la
+
+librelayd_la_SOURCES = \
+ relayd/relayd.cpp \
+ relayd/relayd.hpp
-if BUILD_LIB_FD_TRACKER
-SUBDIRS += fd-tracker
+librelayd_la_LIBADD = libsessiond-comm.la
endif
+
if BUILD_LIB_KERNEL_CONSUMER
-SUBDIRS += kernel-consumer
+noinst_LTLIBRARIES += libkernel-consumer.la
+
+libkernel_consumer_la_SOURCES = \
+ kernel-consumer/kernel-consumer.cpp \
+ kernel-consumer/kernel-consumer.hpp
+
+libkernel_consumer_la_LIBADD = \
+ libkernel-ctl.la
endif
if BUILD_LIB_UST_CONSUMER
-SUBDIRS += ust-consumer
+if HAVE_LIBLTTNG_UST_CTL
+noinst_LTLIBRARIES += libust-consumer.la
+
+libust_consumer_la_SOURCES = \
+ ust-consumer/ust-consumer.cpp \
+ ust-consumer/ust-consumer.hpp
+
+libust_consumer_la_LIBADD = \
+ $(UST_CTL_LIBS)
+endif
endif
if BUILD_LIB_TESTPOINT
-SUBDIRS += testpoint
-endif
+noinst_LTLIBRARIES += libtestpoint.la
-if BUILD_LIB_INDEX
-SUBDIRS += index
-endif
+libtestpoint_la_SOURCES = \
+ testpoint/testpoint.cpp \
+ testpoint/testpoint.hpp
-if BUILD_LIB_CONFIG
-SUBDIRS += config
+libtestpoint_la_LIBADD = $(DL_LIBS)
endif
-if BUILD_LIB_CONSUMER
-SUBDIRS += consumer
-endif
-noinst_HEADERS = \
- align.h \
- bug.h \
- defaults.h \
- error.h \
- futex.h \
- lttng-kernel.h \
- lttng-kernel-old.h \
- macros.h \
- time.h \
- uri.h \
- utils.h
+# libstring-utils
+noinst_LTLIBRARIES += libstring-utils.la
+libstring_utils_la_SOURCES = \
+ string-utils/format.hpp \
+ string-utils/string-utils.cpp \
+ string-utils/string-utils.hpp
+
+
+noinst_PROGRAMS = filter-grammar-test
+filter_grammar_test_SOURCES = filter-grammar-test.cpp
+filter_grammar_test_LDADD = libcommon-gpl.la
+
+EXTRA_DIST = \
+ mi-lttng-4.1.xsd \
+ session.xsd
+
+xmldir = $(datadir)/xml/lttng
+dist_xml_DATA = session.xsd
+# Copy EXTRA_DIST files to the build directory
all-local:
@if [ x"$(srcdir)" != x"$(builddir)" ]; then \
for script in $(EXTRA_DIST); do \