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