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