Fix: lttng: poptGetArg doesn't provide string ownership
[lttng-tools.git] / src / common / Makefile.am
CommitLineData
ab5be9fa
MJ
1# SPDX-License-Identifier: GPL-2.0-only
2
26821431 3AUTOMAKE_OPTIONS = subdir-objects
4ae04234
MJ
4noinst_LTLIBRARIES =
5
6BUILT_SOURCES =
7
8noinst_HEADERS = \
c9e313bc
SM
9 align.hpp \
10 bug.hpp \
11 defaults.hpp \
12 error.hpp \
13 futex.hpp \
14 lttng-kernel.hpp \
15 lttng-kernel-old.hpp \
16 macros.hpp \
17 time.hpp \
18 uri.hpp \
19 utils.hpp
4ae04234
MJ
20
21
22# libargpar
23noinst_LTLIBRARIES += libargpar.la
24libargpar_la_SOURCES = \
25 argpar/argpar.c \
26 argpar/argpar.h
27
28
29# libargpar-utils
30noinst_LTLIBRARIES += libargpar-utils.la
31libargpar_utils_la_SOURCES = \
32 argpar-utils/argpar-utils.cpp \
c9e313bc 33 argpar-utils/argpar-utils.hpp
4ae04234
MJ
34
35
36# libbytecode
37noinst_LTLIBRARIES += libbytecode.la
38libbytecode_la_SOURCES = \
39 bytecode/bytecode.cpp \
c9e313bc 40 bytecode/bytecode.hpp
26821431 41
b3f35e02 42
93903fd5
MD
43# The libcommon-lgpl static archive contains only LGPLv2.1 code. It is
44# meant to be used by LGPLv2.1 libraries such as liblttng-ctl. It also
45# contains libcommon-lgpl.la.
46
4ae04234 47noinst_LTLIBRARIES += libcommon-lgpl.la
93903fd5 48libcommon_lgpl_la_SOURCES = \
a6bc4ca9
SM
49 actions/action.cpp \
50 actions/list.cpp \
51 actions/notify.cpp \
52 actions/path.cpp \
53 actions/rotate-session.cpp \
54 actions/snapshot-session.cpp \
55 actions/start-session.cpp \
56 actions/stop-session.cpp \
57 actions/rate-policy.cpp \
c9e313bc 58 buffer-view.hpp buffer-view.cpp \
999af9c1 59 channel.cpp \
a6bc4ca9
SM
60 conditions/buffer-usage.cpp \
61 conditions/condition.cpp \
62 conditions/event-rule-matches.cpp \
63 conditions/session-consumed-size.cpp \
64 conditions/session-rotation.cpp \
c9e313bc 65 credentials.cpp credentials.hpp \
a6bc4ca9
SM
66 defaults.cpp \
67 domain.cpp \
c9e313bc
SM
68 dynamic-array.cpp dynamic-array.hpp \
69 dynamic-buffer.cpp dynamic-buffer.hpp \
a6bc4ca9 70 endpoint.cpp \
c9e313bc 71 error.cpp error.hpp \
a6bc4ca9
SM
72 error-query.cpp \
73 evaluation.cpp \
038ab50b 74 event.cpp \
a6bc4ca9
SM
75 event-expr/event-expr.cpp \
76 event-field-value.cpp \
77 event-rule/event-rule.cpp \
78 event-rule/kernel-kprobe.cpp \
79 event-rule/kernel-syscall.cpp \
80 event-rule/kernel-uprobe.cpp \
81 event-rule/kernel-tracepoint.cpp \
82 event-rule/user-tracepoint.cpp \
83 event-rule/log4j-logging.cpp \
84 event-rule/jul-logging.cpp \
85 event-rule/python-logging.cpp \
53cd1e22 86 exception.cpp exception.hpp \
c9e313bc 87 fd-handle.cpp fd-handle.hpp\
05aa7e19 88 format.hpp \
a6bc4ca9 89 kernel-probe.cpp \
a6bc4ca9 90 location.cpp \
a3a56255 91 locked-reference.hpp \
a6bc4ca9 92 log-level-rule.cpp \
1823e905 93 make-unique.hpp \
8802d23b 94 make-unique-wrapper.hpp \
c9e313bc 95 mi-lttng.cpp mi-lttng.hpp \
a6bc4ca9 96 notification.cpp \
c9e313bc
SM
97 payload.cpp payload.hpp \
98 payload-view.cpp payload-view.hpp \
0a325f4d 99 pthread-lock.hpp \
c9e313bc
SM
100 readwrite.cpp readwrite.hpp \
101 runas.cpp runas.hpp \
a6bc4ca9 102 session-descriptor.cpp \
c9e313bc
SM
103 snapshot.cpp snapshot.hpp \
104 spawn-viewer.cpp spawn-viewer.hpp \
105 thread.cpp thread.hpp \
a6bc4ca9 106 time.cpp \
c9e313bc 107 tracker.cpp tracker.hpp \
a6bc4ca9 108 trigger.cpp \
c9e313bc
SM
109 unix.cpp unix.hpp \
110 uri.cpp uri.hpp \
a6bc4ca9 111 userspace-probe.cpp \
0a325f4d 112 urcu.hpp \
c9e313bc 113 utils.cpp utils.hpp
b3f35e02 114
b1b34226 115if HAVE_ELF_H
93903fd5 116libcommon_lgpl_la_SOURCES += \
c9e313bc 117 lttng-elf.cpp lttng-elf.hpp
b1b34226
MJ
118endif
119
93903fd5 120libcommon_lgpl_la_LIBADD = \
4ae04234
MJ
121 libbytecode.la \
122 libcompat.la \
123 libconfig.la \
124 libfilter.la \
125 libhashtable-lgpl.la \
116a02e3 126 $(top_builddir)/src/vendor/msgpack/libmsgpack.la
b3f35e02 127
4ae04234 128
4971b7f0
MD
129# The libpath static archive contains GPLv2 compatible code. It is
130# meant to be used by GPL executables.
4ae04234 131noinst_LTLIBRARIES += libpath.la
4971b7f0 132libpath_la_SOURCES = \
c9e313bc 133 path.cpp path.hpp
4971b7f0 134
4ae04234 135
93903fd5
MD
136# The libcommon-gpl static archive contains GPLv2 compatible code. It is
137# meant to be used by GPL executables.
4ae04234 138noinst_LTLIBRARIES += libcommon-gpl.la
93903fd5 139libcommon_gpl_la_SOURCES = \
c9e313bc
SM
140 common.hpp \
141 context.cpp context.hpp \
142 daemonize.cpp daemonize.hpp \
143 filter.cpp filter.hpp \
144 fs-handle.cpp fs-handle.hpp fs-handle-internal.hpp \
145 futex.cpp futex.hpp \
146 index-allocator.cpp index-allocator.hpp \
147 optional.hpp \
148 pipe.cpp pipe.hpp \
149 shm.cpp shm.hpp \
150 trace-chunk.cpp trace-chunk.hpp \
151 trace-chunk-registry.hpp \
152 uuid.cpp uuid.hpp \
153 waiter.cpp waiter.hpp
93903fd5
MD
154
155libcommon_gpl_la_LIBADD = \
156 libcommon-lgpl.la \
4971b7f0 157 libpath.la \
4ae04234
MJ
158 libini-config.la \
159 libhashtable-gpl.la \
160 libfd-tracker.la
161
162
163# libcompat
164noinst_LTLIBRARIES += libcompat.la
165libcompat_la_SOURCES = \
166 compat/compat-fcntl.cpp \
167 compat/directory-handle.cpp \
c9e313bc
SM
168 compat/directory-handle.hpp \
169 compat/dirent.hpp \
170 compat/endian.hpp \
171 compat/errno.hpp \
172 compat/fcntl.hpp \
173 compat/getenv.hpp \
174 compat/mman.hpp \
175 compat/netdb.hpp \
176 compat/path.hpp \
177 compat/paths.hpp \
4ae04234 178 compat/poll.cpp \
c9e313bc
SM
179 compat/poll.hpp \
180 compat/pthread.hpp \
181 compat/socket.hpp \
182 compat/string.hpp \
183 compat/tid.hpp \
184 compat/time.hpp
4ae04234
MJ
185
186
187# libconfig
188noinst_LTLIBRARIES += libconfig.la
189libconfig_la_SOURCES = \
c9e313bc
SM
190 config/config-internal.hpp \
191 config/config-session-abi.hpp \
4ae04234 192 config/session-config.cpp \
c9e313bc 193 config/session-config.hpp
4ae04234
MJ
194
195libconfig_la_CPPFLAGS = $(libxml2_CFLAGS) $(AM_CPPFLAGS)
196libconfig_la_LIBADD = ${libxml2_LIBS}
197
198
199if BUILD_LIB_CONSUMER
200noinst_LTLIBRARIES += libconsumer.la
201
202libconsumer_la_SOURCES = \
203 consumer/consumer.cpp \
c9e313bc 204 consumer/consumer.hpp \
4ae04234 205 consumer/consumer-metadata-cache.cpp \
c9e313bc 206 consumer/consumer-metadata-cache.hpp \
4ae04234 207 consumer/consumer-stream.cpp \
c9e313bc
SM
208 consumer/consumer-stream.hpp \
209 consumer/consumer-testpoint.hpp \
4ae04234 210 consumer/consumer-timer.cpp \
c9e313bc 211 consumer/consumer-timer.hpp \
4ae04234 212 consumer/metadata-bucket.cpp \
c9e313bc 213 consumer/metadata-bucket.hpp
4ae04234
MJ
214
215libconsumer_la_LIBADD = \
216 libkernel-consumer.la \
217 librelayd.la \
218 libsessiond-comm.la
219
220if HAVE_LIBLTTNG_UST_CTL
221libconsumer_la_LIBADD += \
222 libust-consumer.la
223endif
224endif # BUILD_LIB_CONSUMER
225
226
227# libfd-tracker
228noinst_LTLIBRARIES += libfd-tracker.la
229libfd_tracker_la_SOURCES = \
230 fd-tracker/fd-tracker.cpp \
c9e313bc 231 fd-tracker/fd-tracker.hpp \
4ae04234 232 fd-tracker/inode.cpp \
c9e313bc 233 fd-tracker/inode.hpp \
4ae04234 234 fd-tracker/utils.cpp \
c9e313bc 235 fd-tracker/utils.hpp \
4ae04234
MJ
236 fd-tracker/utils-poll.cpp
237
238
239# libfilter
240noinst_LTLIBRARIES += libfilter.la
241
242libfilter_la_SOURCES = \
c9e313bc
SM
243 filter/filter-ast.hpp \
244 filter/filter-ir.hpp \
4ae04234
MJ
245 filter/filter-lexer.lpp \
246 filter/filter-parser.ypp \
c9e313bc 247 filter/filter-symbols.hpp \
4ae04234
MJ
248 filter/filter-visitor-generate-bytecode.cpp \
249 filter/filter-visitor-generate-ir.cpp \
250 filter/filter-visitor-ir-check-binary-op-nesting.cpp \
251 filter/filter-visitor-ir-normalize-glob-patterns.cpp \
252 filter/filter-visitor-ir-validate-globbing.cpp \
253 filter/filter-visitor-ir-validate-string.cpp \
254 filter/filter-visitor-xml.cpp \
c9e313bc 255 filter/memstream.hpp
4ae04234
MJ
256
257BUILT_SOURCES += filter/filter-parser.hpp
258
6ce1601f
MJ
259# Disable some warning flags for generated sources.
260FILTER_WARN_FLAGS = \
19708280 261 -Wno-null-dereference \
f46376a1
MJ
262 -Wno-redundant-decls \
263 -Wno-unused-parameter
6ce1601f
MJ
264
265libfilter_la_CFLAGS = $(AM_CFLAGS) $(FILTER_WARN_FLAGS)
c9e313bc 266libfilter_la_CXXFLAGS = -include filter-symbols.hpp $(AM_CXXFLAGS) $(FILTER_WARN_FLAGS)
4ae04234
MJ
267libfilter_la_CPPFLAGS = -I$(srcdir)/filter -I$(builddir)/filter $(AM_CPPFLAGS)
268libfilter_la_LIBADD = libstring-utils.la
269
270AM_YFLAGS = -t -d -v -Wno-yacc
271
272# start with empty files to clean
273CLEANFILES =
274
275if HAVE_BISON
276# we have bison: we can clean the generated parser files
277CLEANFILES += \
278 filter/filter-parser.cpp \
279 filter/filter-parser.hpp \
280 filter/filter-parser.output
281else # HAVE_BISON
282# create target used to stop the build if we want to build the parser,
283# but we don't have the necessary tool to do so
284filter/filter-parser.cpp filter/filter-parser.hpp: filter/filter-parser.ypp
285 @echo "Error: Cannot build target because bison is missing."
286 @echo "Make sure bison is installed and run the configure script again."
287 @false
288
289BUILT_SOURCES += filter/filter-parser.cpp filter/filter-parser.hpp
290endif # HAVE_BISON
291
292if HAVE_FLEX
293# we have flex: we can clean the generated lexer files
294CLEANFILES += filter/filter-lexer.cpp
295else # HAVE_FLEX
296# create target used to stop the build if we want to build the lexer,
297# but we don't have the necessary tool to do so
298filter/filter-lexer.cpp: filter/filter-lexer.lpp
299 @echo "Error: Cannot build target because flex is missing."
300 @echo "Make sure flex is installed and run the configure script again."
301 @false
302
303BUILT_SOURCES += filter/filter-lexer.cpp
304endif # HAVE_FLEX
305
306
307noinst_LTLIBRARIES += libhashtable-lgpl.la
308libhashtable_lgpl_la_SOURCES = \
309 hashtable/seed.cpp \
310 hashtable/utils.cpp \
c9e313bc 311 hashtable/utils.hpp
4ae04234
MJ
312
313
314noinst_LTLIBRARIES += libhashtable-gpl.la
315libhashtable_gpl_la_SOURCES = \
316 hashtable/hashtable.cpp \
c9e313bc
SM
317 hashtable/hashtable.hpp \
318 hashtable/hashtable-symbols.hpp
4ae04234
MJ
319
320libhashtable_gpl_la_LIBADD = \
321 $(URCU_LIBS) \
322 $(URCU_CDS_LIBS)
323
93903fd5 324
87fb9fc0 325if BUILD_LIB_HEALTH
4ae04234
MJ
326noinst_LTLIBRARIES += libhealth.la
327
328libhealth_la_SOURCES = \
329 health/health.cpp
87fb9fc0
JR
330endif
331
4ae04234
MJ
332
333# libini-config
334noinst_LTLIBRARIES += libini-config.la
335libini_config_la_SOURCES = \
336 ini-config/ini.cpp \
c9e313bc 337 ini-config/ini.hpp \
4ae04234 338 ini-config/ini-config.cpp \
c9e313bc 339 ini-config/ini-config.hpp
4ae04234
MJ
340
341
342if BUILD_LIB_INDEX
343noinst_LTLIBRARIES += libindex.la
344
345libindex_la_SOURCES = \
c9e313bc 346 index/ctf-index.hpp \
4ae04234 347 index/index.cpp \
c9e313bc 348 index/index.hpp
4ae04234
MJ
349endif
350
351
87fb9fc0 352if BUILD_LIB_KERNEL_CTL
4ae04234
MJ
353noinst_LTLIBRARIES += libkernel-ctl.la
354
355libkernel_ctl_la_SOURCES = \
356 kernel-ctl/kernel-ctl.cpp \
c9e313bc
SM
357 kernel-ctl/kernel-ctl.hpp \
358 kernel-ctl/kernel-ioctl.hpp
87fb9fc0
JR
359endif
360
361if BUILD_LIB_SESSIOND_COMM
4ae04234
MJ
362noinst_LTLIBRARIES += libsessiond-comm.la
363
364libsessiond_comm_la_SOURCES = \
c9e313bc 365 sessiond-comm/agent.hpp \
4ae04234 366 sessiond-comm/inet.cpp \
c9e313bc 367 sessiond-comm/inet.hpp \
4ae04234 368 sessiond-comm/inet6.cpp \
c9e313bc
SM
369 sessiond-comm/inet6.hpp \
370 sessiond-comm/relayd.hpp \
4ae04234 371 sessiond-comm/sessiond-comm.cpp \
c9e313bc 372 sessiond-comm/sessiond-comm.hpp
87fb9fc0
JR
373endif
374
375if BUILD_LIB_RELAYD
4ae04234
MJ
376noinst_LTLIBRARIES += librelayd.la
377
378librelayd_la_SOURCES = \
379 relayd/relayd.cpp \
c9e313bc 380 relayd/relayd.hpp
4ae04234
MJ
381
382librelayd_la_LIBADD = libsessiond-comm.la
aa360a35
JG
383endif
384
87fb9fc0
JR
385
386if BUILD_LIB_KERNEL_CONSUMER
4ae04234
MJ
387noinst_LTLIBRARIES += libkernel-consumer.la
388
389libkernel_consumer_la_SOURCES = \
390 kernel-consumer/kernel-consumer.cpp \
c9e313bc 391 kernel-consumer/kernel-consumer.hpp
4ae04234
MJ
392
393libkernel_consumer_la_LIBADD = \
394 libkernel-ctl.la
87fb9fc0
JR
395endif
396
397if BUILD_LIB_UST_CONSUMER
4ae04234
MJ
398if HAVE_LIBLTTNG_UST_CTL
399noinst_LTLIBRARIES += libust-consumer.la
400
401libust_consumer_la_SOURCES = \
402 ust-consumer/ust-consumer.cpp \
c9e313bc 403 ust-consumer/ust-consumer.hpp
4ae04234
MJ
404
405libust_consumer_la_LIBADD = \
406 $(UST_CTL_LIBS)
407endif
87fb9fc0
JR
408endif
409
410if BUILD_LIB_TESTPOINT
4ae04234 411noinst_LTLIBRARIES += libtestpoint.la
87fb9fc0 412
4ae04234
MJ
413libtestpoint_la_SOURCES = \
414 testpoint/testpoint.cpp \
c9e313bc 415 testpoint/testpoint.hpp
87fb9fc0 416
4ae04234 417libtestpoint_la_LIBADD = $(DL_LIBS)
87fb9fc0 418endif
10a8a223 419
4ae04234
MJ
420
421# libstring-utils
422noinst_LTLIBRARIES += libstring-utils.la
423libstring_utils_la_SOURCES = \
c9e313bc 424 string-utils/format.hpp \
4ae04234 425 string-utils/string-utils.cpp \
c9e313bc 426 string-utils/string-utils.hpp
4ae04234 427
1c39da61 428
e358ddd5 429noinst_PROGRAMS = filter-grammar-test
740da7d5 430filter_grammar_test_SOURCES = filter-grammar-test.cpp
93903fd5 431filter_grammar_test_LDADD = libcommon-gpl.la
e358ddd5 432
4ae04234
MJ
433EXTRA_DIST = \
434 mi-lttng-4.1.xsd \
435 session.xsd
436
437xmldir = $(datadir)/xml/lttng
438dist_xml_DATA = session.xsd
439
440# Copy EXTRA_DIST files to the build directory
c49fc5e4
JR
441all-local:
442 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
443 for script in $(EXTRA_DIST); do \
444 cp -f $(srcdir)/$$script $(builddir); \
445 done; \
446 fi
447
448clean-local:
449 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
450 for script in $(EXTRA_DIST); do \
451 rm -f $(builddir)/$$script; \
452 done; \
453 fi
This page took 0.086287 seconds and 4 git commands to generate.