Import CStringView from the Babeltrace tree
[lttng-tools.git] / src / common / Makefile.am
1 # SPDX-License-Identifier: GPL-2.0-only
2
3 AUTOMAKE_OPTIONS = subdir-objects
4 noinst_LTLIBRARIES =
5
6 BUILT_SOURCES =
7
8 noinst_HEADERS = \
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
20
21
22 # libargpar
23 noinst_LTLIBRARIES += libargpar.la
24 libargpar_la_SOURCES = \
25 argpar/argpar.c \
26 argpar/argpar.h
27
28
29 # libargpar-utils
30 noinst_LTLIBRARIES += libargpar-utils.la
31 libargpar_utils_la_SOURCES = \
32 argpar-utils/argpar-utils.cpp \
33 argpar-utils/argpar-utils.hpp
34
35
36 # libbytecode
37 noinst_LTLIBRARIES += libbytecode.la
38 libbytecode_la_SOURCES = \
39 bytecode/bytecode.cpp \
40 bytecode/bytecode.hpp
41
42
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
47 noinst_LTLIBRARIES += libcommon-lgpl.la
48 libcommon_lgpl_la_SOURCES = \
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 \
58 buffer-view.hpp buffer-view.cpp \
59 channel.cpp \
60 compiler.hpp \
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 \
66 container-wrapper.hpp \
67 credentials.cpp credentials.hpp \
68 defaults.cpp \
69 domain.cpp \
70 dynamic-array.cpp dynamic-array.hpp \
71 dynamic-buffer.cpp dynamic-buffer.hpp \
72 endpoint.cpp \
73 error.cpp error.hpp \
74 error-query.cpp \
75 evaluation.cpp \
76 event.cpp \
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 \
88 exception.cpp exception.hpp \
89 file-descriptor.hpp file-descriptor.cpp \
90 fd-handle.cpp fd-handle.hpp \
91 format.hpp \
92 io-hint.cpp \
93 io-hint.hpp \
94 kernel-probe.cpp \
95 location.cpp \
96 lockfile.cpp lockfile.hpp \
97 locked-reference.hpp \
98 logging-utils.hpp logging-utils.cpp \
99 log-level-rule.cpp \
100 make-unique.hpp \
101 make-unique-wrapper.hpp \
102 mi-lttng.cpp mi-lttng.hpp \
103 notification.cpp \
104 payload.cpp payload.hpp \
105 payload-view.cpp payload-view.hpp \
106 pthread-lock.hpp \
107 random.cpp random.hpp \
108 readwrite.cpp readwrite.hpp \
109 runas.cpp runas.hpp \
110 scope-exit.hpp \
111 session-descriptor.cpp \
112 snapshot.cpp snapshot.hpp \
113 spawn-viewer.cpp spawn-viewer.hpp \
114 thread.cpp thread.hpp \
115 time.cpp \
116 tracker.cpp tracker.hpp \
117 trigger.cpp \
118 type-traits.hpp \
119 unix.cpp unix.hpp \
120 uri.cpp uri.hpp \
121 userspace-probe.cpp \
122 urcu.hpp \
123 utils.cpp utils.hpp
124
125 if IS_LINUX
126 libcommon_lgpl_la_SOURCES += eventfd.cpp eventfd.hpp
127 endif
128
129 if HAVE_ELF_H
130 libcommon_lgpl_la_SOURCES += \
131 lttng-elf.cpp lttng-elf.hpp
132 endif
133
134 libcommon_lgpl_la_LIBADD = \
135 libbytecode.la \
136 libcompat.la \
137 libconfig.la \
138 libfilter.la \
139 libhashtable-lgpl.la \
140 $(top_builddir)/src/vendor/msgpack/libmsgpack.la
141
142
143 # The libpath static archive contains GPLv2 compatible code. It is
144 # meant to be used by GPL executables.
145 noinst_LTLIBRARIES += libpath.la
146 libpath_la_SOURCES = \
147 path.cpp path.hpp
148
149
150 # The libcommon-gpl static archive contains GPLv2 compatible code. It is
151 # meant to be used by GPL executables.
152 noinst_LTLIBRARIES += libcommon-gpl.la
153 libcommon_gpl_la_SOURCES = \
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
168
169 libcommon_gpl_la_LIBADD = \
170 libcommon-lgpl.la \
171 libpath.la \
172 libini-config.la \
173 libhashtable-gpl.la \
174 libfd-tracker.la
175
176
177 # libcompat
178 noinst_LTLIBRARIES += libcompat.la
179 libcompat_la_SOURCES = \
180 compat/directory-handle.cpp \
181 compat/directory-handle.hpp \
182 compat/dirent.hpp \
183 compat/endian.hpp \
184 compat/errno.hpp \
185 compat/getenv.hpp \
186 compat/mman.hpp \
187 compat/netdb.hpp \
188 compat/path.hpp \
189 compat/paths.hpp \
190 compat/poll.cpp \
191 compat/poll.hpp \
192 compat/pthread.hpp \
193 compat/socket.hpp \
194 compat/string.hpp \
195 compat/tid.hpp \
196 compat/time.hpp
197
198
199 # libconfig
200 noinst_LTLIBRARIES += libconfig.la
201 libconfig_la_SOURCES = \
202 config/config-internal.hpp \
203 config/config-session-abi.hpp \
204 config/session-config.cpp \
205 config/session-config.hpp
206
207 libconfig_la_CPPFLAGS = $(libxml2_CFLAGS) $(AM_CPPFLAGS)
208 libconfig_la_LIBADD = ${libxml2_LIBS}
209
210
211 if BUILD_LIB_CONSUMER
212 noinst_LTLIBRARIES += libconsumer.la
213
214 libconsumer_la_SOURCES = \
215 consumer/consumer.cpp \
216 consumer/consumer.hpp \
217 consumer/consumer-metadata-cache.cpp \
218 consumer/consumer-metadata-cache.hpp \
219 consumer/consumer-stream.cpp \
220 consumer/consumer-stream.hpp \
221 consumer/consumer-testpoint.hpp \
222 consumer/consumer-timer.cpp \
223 consumer/consumer-timer.hpp \
224 consumer/metadata-bucket.cpp \
225 consumer/metadata-bucket.hpp
226
227 libconsumer_la_LIBADD = \
228 libkernel-consumer.la \
229 librelayd.la \
230 libsessiond-comm.la
231
232 if HAVE_LIBLTTNG_UST_CTL
233 libconsumer_la_LIBADD += \
234 libust-consumer.la
235 endif
236 endif # BUILD_LIB_CONSUMER
237
238
239 # libfd-tracker
240 noinst_LTLIBRARIES += libfd-tracker.la
241 libfd_tracker_la_SOURCES = \
242 fd-tracker/fd-tracker.cpp \
243 fd-tracker/fd-tracker.hpp \
244 fd-tracker/inode.cpp \
245 fd-tracker/inode.hpp \
246 fd-tracker/utils.cpp \
247 fd-tracker/utils.hpp \
248 fd-tracker/utils-poll.cpp
249
250
251 # libfilter
252 noinst_LTLIBRARIES += libfilter.la
253
254 libfilter_la_SOURCES = \
255 filter/filter-ast.hpp \
256 filter/filter-ir.hpp \
257 filter/filter-lexer.lpp \
258 filter/filter-parser.ypp \
259 filter/filter-symbols.hpp \
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 \
267 filter/memstream.hpp
268
269 BUILT_SOURCES += filter/filter-parser.hpp
270
271 # Disable some warning flags for generated sources.
272 FILTER_WARN_FLAGS = \
273 -Wno-null-dereference \
274 -Wno-redundant-decls \
275 -Wno-unused-parameter
276
277 libfilter_la_CFLAGS = $(AM_CFLAGS) $(FILTER_WARN_FLAGS)
278 libfilter_la_CXXFLAGS = -include filter-symbols.hpp $(AM_CXXFLAGS) $(FILTER_WARN_FLAGS)
279 libfilter_la_CPPFLAGS = -I$(srcdir)/filter -I$(builddir)/filter $(AM_CPPFLAGS)
280 libfilter_la_LIBADD = libstring-utils.la
281
282 AM_YFLAGS = -t -d -v -Wno-yacc
283
284 # start with empty files to clean
285 CLEANFILES =
286
287 if HAVE_BISON
288 # we have bison: we can clean the generated parser files
289 CLEANFILES += \
290 filter/filter-parser.cpp \
291 filter/filter-parser.hpp \
292 filter/filter-parser.output
293 else # 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
296 filter/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
301 BUILT_SOURCES += filter/filter-parser.cpp filter/filter-parser.hpp
302 endif # HAVE_BISON
303
304 if HAVE_FLEX
305 # we have flex: we can clean the generated lexer files
306 CLEANFILES += filter/filter-lexer.cpp
307 else # 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
310 filter/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
315 BUILT_SOURCES += filter/filter-lexer.cpp
316 endif # HAVE_FLEX
317
318
319 noinst_LTLIBRARIES += libhashtable-lgpl.la
320 libhashtable_lgpl_la_SOURCES = \
321 hashtable/seed.cpp \
322 hashtable/utils.cpp \
323 hashtable/utils.hpp
324
325
326 noinst_LTLIBRARIES += libhashtable-gpl.la
327 libhashtable_gpl_la_SOURCES = \
328 hashtable/hashtable.cpp \
329 hashtable/hashtable.hpp \
330 hashtable/hashtable-symbols.hpp
331
332 libhashtable_gpl_la_LIBADD = \
333 $(URCU_LIBS) \
334 $(URCU_CDS_LIBS)
335
336
337 if BUILD_LIB_HEALTH
338 noinst_LTLIBRARIES += libhealth.la
339
340 libhealth_la_SOURCES = \
341 health/health.cpp
342 endif
343
344
345 # libini-config
346 noinst_LTLIBRARIES += libini-config.la
347 libini_config_la_SOURCES = \
348 ini-config/ini.cpp \
349 ini-config/ini.hpp \
350 ini-config/ini-config.cpp \
351 ini-config/ini-config.hpp
352
353
354 if BUILD_LIB_INDEX
355 noinst_LTLIBRARIES += libindex.la
356
357 libindex_la_SOURCES = \
358 index/ctf-index.hpp \
359 index/index.cpp \
360 index/index.hpp
361 endif
362
363
364 if BUILD_LIB_KERNEL_CTL
365 noinst_LTLIBRARIES += libkernel-ctl.la
366
367 libkernel_ctl_la_SOURCES = \
368 kernel-ctl/kernel-ctl.cpp \
369 kernel-ctl/kernel-ctl.hpp \
370 kernel-ctl/kernel-ioctl.hpp
371 endif
372
373 if BUILD_LIB_SESSIOND_COMM
374 noinst_LTLIBRARIES += libsessiond-comm.la
375
376 libsessiond_comm_la_SOURCES = \
377 sessiond-comm/agent.hpp \
378 sessiond-comm/inet.cpp \
379 sessiond-comm/inet.hpp \
380 sessiond-comm/inet6.cpp \
381 sessiond-comm/inet6.hpp \
382 sessiond-comm/relayd.hpp \
383 sessiond-comm/sessiond-comm.cpp \
384 sessiond-comm/sessiond-comm.hpp
385 endif
386
387 if BUILD_LIB_RELAYD
388 noinst_LTLIBRARIES += librelayd.la
389
390 librelayd_la_SOURCES = \
391 relayd/relayd.cpp \
392 relayd/relayd.hpp
393
394 librelayd_la_LIBADD = libsessiond-comm.la
395 endif
396
397
398 if BUILD_LIB_KERNEL_CONSUMER
399 noinst_LTLIBRARIES += libkernel-consumer.la
400
401 libkernel_consumer_la_SOURCES = \
402 kernel-consumer/kernel-consumer.cpp \
403 kernel-consumer/kernel-consumer.hpp
404
405 libkernel_consumer_la_LIBADD = \
406 libkernel-ctl.la
407 endif
408
409 if BUILD_LIB_UST_CONSUMER
410 if HAVE_LIBLTTNG_UST_CTL
411 noinst_LTLIBRARIES += libust-consumer.la
412
413 libust_consumer_la_SOURCES = \
414 ust-consumer/ust-consumer.cpp \
415 ust-consumer/ust-consumer.hpp
416
417 libust_consumer_la_LIBADD = \
418 $(UST_CTL_LIBS)
419 endif
420 endif
421
422 if BUILD_LIB_TESTPOINT
423 noinst_LTLIBRARIES += libtestpoint.la
424
425 libtestpoint_la_SOURCES = \
426 testpoint/testpoint.cpp \
427 testpoint/testpoint.hpp
428
429 libtestpoint_la_LIBADD = $(DL_LIBS)
430 endif
431
432
433 # libstring-utils
434 noinst_LTLIBRARIES += libstring-utils.la
435 libstring_utils_la_SOURCES = \
436 string-utils/c-string-view.hpp \
437 string-utils/format.hpp \
438 string-utils/string-utils.cpp \
439 string-utils/string-utils.hpp
440
441
442 noinst_PROGRAMS = filter-grammar-test
443 filter_grammar_test_SOURCES = filter-grammar-test.cpp
444 filter_grammar_test_LDADD = libcommon-gpl.la
445
446 EXTRA_DIST = \
447 mi-lttng-4.1.xsd \
448 session.xsd
449
450 xmldir = $(datadir)/xml/lttng
451 dist_xml_DATA = session.xsd
452
453 # Copy EXTRA_DIST files to the build directory
454 all-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
461 clean-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.039329 seconds and 5 git commands to generate.