1 dnl SPDX-License-Identifier: GPL-2.0-only
3 AC_INIT([lttng-tools],[2.14.0-pre],[jeremie.galarneau@efficios.com],[],[https://lttng.org])
5 AC_CONFIG_HEADERS([include/config.h])
6 AC_CONFIG_AUX_DIR([config])
7 AC_CONFIG_MACRO_DIR([m4])
12 AM_INIT_AUTOMAKE([1.12 foreign dist-bzip2 no-dist-gzip tar-pax nostdinc])
13 AM_MAINTAINER_MODE([enable])
15 # Enable silent rules if available (Introduced in AM 1.11)
16 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
20 ## C compiler checks ##
23 # Choose the C compiler
25 # AC_PROG_CC_STDC was merged in AC_PROG_CC in autoconf 2.70
26 m4_version_prereq([2.70], [], [AC_PROG_CC_STDC])
28 # Make sure the C compiler supports C99
29 AS_IF([test "$ac_cv_prog_cc_c99" = "no"], [AC_MSG_ERROR([The compiler does not support C99])])
31 # Enable available system extensions and LFS support
32 AC_USE_SYSTEM_EXTENSIONS
35 # Make sure the C compiler supports __attribute__
37 AS_IF([test "x$ax_cv___attribute__" != "xyes"],
38 [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])])
40 # Make sure we have pthread support
41 AX_PTHREAD([], [AC_MSG_ERROR([Could not configure pthread support])])
43 # Checks for typedefs, structures, and compiler characteristics.
58 # Detect warning flags supported by the C and C++ compilers and append them to
59 # WARN_CFLAGS and WARN_CXXFLAGS.
60 m4_define([WARN_FLAGS_COMMON_LIST], [ dnl
62 -Wnull-dereference dnl
64 -Wmissing-noreturn dnl
66 dnl We currently get this warning when building with Clang:
68 dnl /usr/include/setjmp.h:54:12: error: declaration of built-in function '__sigsetjmp' requires the declaration of the 'jmp_buf' type, commonly provided in the header <setjmp.h>. [-Werror,-Wincomplete-setjmp-declaration]
69 dnl extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROWNL;
71 -Wno-incomplete-setjmp-declaration dnl
72 -Wmissing-declarations dnl
74 -Wno-gnu-folding-constant dnl
75 -Wsuggest-attribute=format dnl
79 # Detect warning flags specific to the C compiler and append them to
81 m4_define([WARN_FLAGS_C_LIST], [ dnl
82 -Wdiscarded-qualifiers dnl
83 -Wmissing-prototypes dnl
84 -Wmissing-parameter-type dnl
87 # Pass -Werror as an extra flag during the test: this is needed to make the
88 # -Wunknown-warning-option diagnostic fatal with clang.
90 AX_APPEND_COMPILE_FLAGS([WARN_FLAGS_COMMON_LIST WARN_FLAGS_C_LIST], [WARN_CFLAGS], [-Werror])
93 # The test used in AX_APPEND_COMPILE_FLAGS, generated using AC_LANG_PROGRAM, is
94 # written in such a way that it triggers warnings with the following warning
95 # flags. So they would always end up disabled if we put them there, because
96 # the test program would not build.
98 # Enable them here unconditionally. They are supported by GCC >= 4.8 and by
99 # Clang >= 3.3 (required by the project) and are only valid for C code.
100 WARN_CFLAGS="${WARN_CFLAGS} -Wold-style-definition -Wstrict-prototypes"
102 # Disable 'strict aliasing' if the C compiler supports it.
104 AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [OPT_CFLAGS], [-Werror])
109 ## C++ compiler checks ##
112 # Find a C++11 compiler with GNU extensions (-std=gnu++11)
113 AX_CXX_COMPILE_STDCXX([11], [ext], [mandatory])
115 # Detect warning flags specific to the C++ compiler and append them to
117 m4_define([WARN_FLAGS_CXX_LIST], [ dnl
118 dnl GCC enables this with -Wall in C++, and that generates a
119 dnl lot of warnings that have on average a low value to fix.
120 -Wno-sign-compare dnl
123 # Pass -Werror as an extra flag during the test: this is needed to make the
124 # -Wunknown-warning-option diagnostic fatal with clang.
126 AX_APPEND_COMPILE_FLAGS([WARN_FLAGS_COMMON_LIST WARN_FLAGS_CXX_LIST], [WARN_CXXFLAGS], [-Werror])
129 # Disable 'strict aliasing' if the C++ compiler supports it.
131 AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [OPT_CXXFLAGS], [-Werror])
135 # When given, add -Werror to WARN_CFLAGS and WARN_CXXFLAGS.
136 AC_ARG_ENABLE([Werror],[
137 AS_HELP_STRING([--enable-Werror], [Treat compiler warnings as errors.])
140 AS_IF([test "x$enable_Werror" = "xyes"], [
141 WARN_CFLAGS="${WARN_CFLAGS} -Werror"
142 WARN_CXXFLAGS="${WARN_CXXFLAGS} -Werror"
145 # Checks for programs.
149 AC_PATH_PROG([report_fold], [fold])
152 # Check for objcopy, required by the base address statedump and dynamic linker tests
153 AC_CHECK_TOOL([OBJCOPY], [objcopy], [no])
154 AS_IF([test "x$OBJCOPY" = "xno"],
155 [AC_MSG_WARN([Cannot find objcopy. The base address statedump and dynamic linker tests will be disabled. Install the binutils package to remediate this.])]
157 AM_CONDITIONAL([HAVE_OBJCOPY], [test "x$OBJCOPY" != xno])
160 AC_PATH_PROG([PGREP], [pgrep], [no])
161 AM_CONDITIONAL([HAVE_PGREP], [test "x$PGREP" != "xno"])
163 # set $IN_GIT_REPO if we're in the Git repository; the `bootstrap` file
164 # is not distributed in tarballs
165 AS_IF([test -f "$srcdir/bootstrap"], [in_git_repo=yes], [in_git_repo=no])
166 AM_CONDITIONAL([IN_GIT_REPO], [test "x$in_git_repo" = "xyes"])
171 AX_PROG_BISON_VERSION([2.4], [have_bison=yes])
173 AS_IF([test "x$have_bison" != "xyes"], [
174 AS_IF([test "x$in_git_repo" = "xyes"], [
176 Bison >= 2.4 is required when building from the Git repository. You can
177 set the YACC variable to override automatic detection.
181 Missing Bison >= 2.4. Note that the parser files are already built in
182 this distribution tarball, so Bison is only needed if you intend to
183 modify their sources. You can set the YACC variable to override automatic
188 AM_CONDITIONAL([HAVE_BISON], [test "x$have_bison" = "xyes"])
191 # Prior to autoconf 2.70, AC_PROG_FLEX did not take an argument. This is not a
192 # problem since the argument is silently ignored by older versions.
193 AC_PROG_LEX([noyywrap])
195 AX_PROG_FLEX_VERSION([2.5.35], [have_flex=yes])
197 AS_IF([test "x$have_flex" != "xyes"], [
198 AS_IF([test "x$in_git_repo" = "xyes"], [
200 Flex >= 2.5.35 is required when building from the Git repository. You can
201 set the LEX variable to override automatic detection.
205 Missing Flex >= 2.5.35. Note that the lexer files are already built in
206 this distribution tarball, so Flex is only needed if you intend to
207 modify their sources. You can set the LEX variable to override automatic
212 AM_CONDITIONAL([HAVE_FLEX], [test "x$have_flex" = "xyes"])
216 # Check if linker has the -no-pie option.
217 AX_CHECK_LINK_FLAG([-no-pie], [linker_have_no_pie_option=yes])
218 AM_CONDITIONAL([LINKER_HAVE_NO_PIE_OPTION], [test "x$linker_have_no_pie_option" = "xyes"])
226 LT_NO_UNDEFINED="-no-undefined"
228 [cygwin*|darwin*|mingw*|solaris*],
230 # On platforms where we only support the relayd, disable the other binaries by default
231 AS_IF([test "x$enable_bin_lttng" = "x" ], [enable_bin_lttng=no])
232 AS_IF([test "x$enable_bin_lttng_consumerd" = "x" ], [enable_bin_lttng_consumerd=no])
233 AS_IF([test "x$enable_bin_lttng_crash" = "x" ], [enable_bin_lttng_crash=no])
234 AS_IF([test "x$enable_bin_lttng_sessiond" = "x" ], [enable_bin_lttng_sessiond=no])
235 AS_IF([test "x$enable_extras" = "x" ], [enable_extras=no])
236 AS_IF([test "x$with_lttng_ust" = "x" ], [with_lttng_ust=no])
240 AC_SUBST(LT_NO_UNDEFINED)
242 # Compute minor/major/patchlevel version numbers
243 major_version=$(echo AC_PACKAGE_VERSION | $SED 's/^\([[0-9]]\)*\.[[0-9]]*\.[[0-9]]*.*$/\1/')
244 minor_version=$(echo AC_PACKAGE_VERSION | $SED 's/^[[0-9]]*\.\([[0-9]]*\)\.[[0-9]]*.*$/\1/')
245 patchlevel_version=$(echo AC_PACKAGE_VERSION | $SED 's/^[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\).*$/\1/')
247 AC_SUBST([MAJOR_VERSION], [$major_version])
248 AC_SUBST([MINOR_VERSION], [$minor_version])
249 AC_SUBST([PATCHLEVEL_VERSION], [$patchlevel_version])
250 AC_DEFINE_UNQUOTED([VERSION_MAJOR], $major_version, [LTTng-Tools major version number])
251 AC_DEFINE_UNQUOTED([VERSION_MINOR], $minor_version, [LTTng-Tools minor version number])
252 AC_DEFINE_UNQUOTED([VERSION_PATCHLEVEL], $patchlevel_version, [LTTng-Tools patchlevel version number])
254 version_name="O-Beer"
255 version_description="An alcoholic drink made from yeast-fermented malt flavored with hops."
256 version_description_c=$(echo $version_description | $SED 's/"/\\"/g')
258 AC_DEFINE_UNQUOTED([VERSION_NAME], ["$version_name"], "")
259 AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], ["$version_description_c"], "")
261 # libtool link_all_deplibs fixup. See http://bugs.lttng.org/issues/321.
262 AC_ARG_ENABLE(libtool-linkdep-fixup,
263 AS_HELP_STRING([--disable-libtool-linkdep-fixup],
264 [disable the libtool fixup for linking all dependent libraries (link_all_deplibs)]),
265 libtool_fixup=$enableval,
268 AS_IF([test "x$libtool_fixup" = "xyes"],
270 libtool_m4="$srcdir/m4/libtool.m4"
271 libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)"
272 AC_MSG_CHECKING([for occurrence(s) of link_all_deplibs = no in $libtool_m4])
273 libtool_flag_pattern_count=$($GREP -c "$libtool_flag_pattern\s*=\s*no" $libtool_m4)
274 AS_IF([test $libtool_flag_pattern_count -ne 0],
276 AC_MSG_RESULT([$libtool_flag_pattern_count])
277 AC_MSG_WARN([the detected libtool will not link all dependencies, forcing link_all_deplibs = unknown])
278 $SED -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4
281 AC_MSG_RESULT([none])
285 AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno])
288 sys/types.h unistd.h fcntl.h string.h pthread.h limits.h \
289 signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \
290 getopt.h sys/ipc.h sys/shm.h popt.h grp.h arpa/inet.h \
291 netdb.h netinet/in.h paths.h stddef.h sys/file.h sys/ioctl.h \
292 sys/mount.h sys/param.h sys/time.h elf.h
295 AM_CONDITIONAL([HAVE_ELF_H], [test x$ac_cv_header_elf_h = xyes])
297 # Basic functions check
299 atexit bzero clock_gettime dup2 fdatasync fls ftruncate \
300 gethostbyname gethostname getpagesize localtime_r memchr memrchr memset \
301 mkdir munmap putenv realpath rmdir socket strchr strcspn strdup \
302 strncasecmp strndup strnlen strpbrk strrchr strstr strtol strtoul \
303 strtoull dirfd gethostbyname2 getipnodebyname epoll_create1 \
304 sched_getcpu sysconf sync_file_range
307 # Check for pthread_setname_np and pthread_getname_np
308 LTTNG_PTHREAD_SETNAME_NP
309 LTTNG_PTHREAD_GETNAME_NP
311 # Check if clock_gettime, timer_create, timer_settime, and timer_delete are available in lib rt, and if so,
313 AC_CHECK_LIB([rt], [clock_gettime, timer_create, timer_settime, timer_delete])
316 AC_CHECK_LIB([dl], [dlopen], [
321 # libdl not found, check for dlopen in libc.
322 AC_CHECK_LIB([c], [dlopen], [
327 AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.])
332 # Check if libdl has dlmopen support.
333 AH_TEMPLATE([HAVE_DLMOPEN], ["Define to 1 if dlmopen is available."])
334 AC_CHECK_LIB([$libdl_name], [dlmopen], [
335 AC_DEFINE([HAVE_DLMOPEN], [1])
340 AC_SUBST(HAVE_DLMOPEN)
342 # Babeltrace viewer check
343 AC_ARG_WITH([babeltrace-bin],
344 AS_HELP_STRING([--with-babeltrace-bin],
345 [Location of the babeltrace viewer executable (including the filename)]),
346 [BABELTRACE_BIN="$withval"],
348 AC_SUBST([BABELTRACE_BIN])
350 AC_ARG_WITH([babeltrace2-bin],
351 AS_HELP_STRING([--with-babeltrace2-bin],
352 [Location of the babeltrace2 viewer executable (including the filename)]),
353 [BABELTRACE2_BIN="$withval"],
354 [BABELTRACE2_BIN=''])
355 AC_SUBST([BABELTRACE2_BIN])
357 AC_ARG_WITH([consumerd32-bin],
358 AS_HELP_STRING([--with-consumerd32-bin],
359 [Location of the 32-bit consumerd executable (including the filename)]),
360 [CONSUMERD32_BIN="$withval"],
361 [CONSUMERD32_BIN=''])
362 AC_SUBST([CONSUMERD32_BIN])
364 AC_ARG_WITH([consumerd64-bin],
365 AS_HELP_STRING([--with-consumerd64-bin],
366 [Location of the 64-bit consumerd executable (including the filename)]),
367 [CONSUMERD64_BIN="$withval"],
368 [CONSUMERD64_BIN=''])
369 AC_SUBST([CONSUMERD64_BIN])
371 AC_ARG_WITH([consumerd32-libdir],
372 AS_HELP_STRING([--with-consumerd32-libdir],
373 [Directory containing the 32-bit consumerd libraries]),
374 [CONSUMERD32_LIBDIR="$withval"],
375 [CONSUMERD32_LIBDIR=''])
376 AC_SUBST([CONSUMERD32_LIBDIR])
378 AC_ARG_WITH([consumerd64-libdir],
379 AS_HELP_STRING([--with-consumerd64-libdir],
380 [Directory containing the 64-bit consumerd libraries]),
381 [CONSUMERD64_LIBDIR="$withval"],
382 [CONSUMERD64_LIBDIR=''])
383 AC_SUBST([CONSUMERD64_LIBDIR])
385 AC_ARG_WITH([sessiond-bin],
386 AS_HELP_STRING([--with-sessiond-bin],
387 [Location of the sessiond executable (including the filename)]),
388 [SESSIOND_BIN="$withval"],
390 AC_SUBST([SESSIOND_BIN])
392 AC_ARG_WITH([lttng-system-rundir],
393 AS_HELP_STRING([--with-lttng-system-rundir],
394 [Location of the system directory where the system-wide lttng-sessiond runtime files are kept. The default is "/var/run/lttng".]),
395 [LTTNG_SYSTEM_RUNDIR="$withval"],
396 [LTTNG_SYSTEM_RUNDIR="/var/run/lttng"])
397 AC_SUBST([LTTNG_SYSTEM_RUNDIR])
399 AC_ARG_ENABLE([test-java-agent-jul],
400 [AS_HELP_STRING([--enable-test-java-agent-jul],[enable the LTTng UST Java agent JUL tests [default=no]])],
401 [test_java_agent_jul=$enableval],
402 [test_java_agent_jul=no]
405 AC_ARG_ENABLE([test-java-agent-log4j],
406 [AS_HELP_STRING([--enable-test-java-agent-log4j],[enable the LTTng UST Java agent Log4j 1.x tests [default=no]])],
407 [test_java_agent_log4j=$enableval],
408 [test_java_agent_log4j=no]
411 AC_ARG_ENABLE([test-java-agent-log4j2],
412 [AS_HELP_STRING([--enable-test-java-agent-log4j2],[enable the LTTng UST Java agent Log4j 2.x tests [default=no]])],
413 [test_java_agent_log4j2=$enableval],
414 [test_java_agent_log4j2=no]
417 AC_ARG_ENABLE([test-java-agent-all],
418 [AS_HELP_STRING([--enable-test-java-agent-all],[enable all the LTTng UST Java agent tests [default=no]])],
419 [test_java_agent_jul=$enableval
420 test_java_agent_log4j=$enableval
421 test_java_agent_log4j2=$enableval],
425 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.])
426 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable])
427 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
428 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
429 AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.])
430 AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE2_BIN], "$BABELTRACE2_BIN", [Location of the babeltrace2 viewer executable.])
431 AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sessiond executable.])
432 AC_DEFINE_UNQUOTED([CONFIG_LTTNG_SYSTEM_RUNDIR], ["$LTTNG_SYSTEM_RUNDIR"], [LTTng system runtime directory])
434 AC_DEFUN([_AC_DEFINE_AND_SUBST], [
435 AC_DEFINE_UNQUOTED([CONFIG_$1], [$2], [$1])
440 AC_DEFUN([_AC_DEFINE_QUOTED_AND_SUBST], [
441 AC_DEFINE_UNQUOTED([CONFIG_$1], ["$2"], [$1])
447 m4_define([_DEFAULT_CHANNEL_SUBBUF_SIZE], [16384])
448 m4_define([_DEFAULT_CHANNEL_SUBBUF_NUM], [4])
449 m4_define([_DEFAULT_CHANNEL_SWITCH_TIMER], [0])
450 m4_define([_DEFAULT_CHANNEL_LIVE_TIMER], [0])
451 m4_define([_DEFAULT_CHANNEL_READ_TIMER], [200000])
452 m4_define([_DEFAULT_CHANNEL_MONITOR_TIMER], [1000000])
453 m4_define([_DEFAULT_CHANNEL_BLOCKING_TIMEOUT], [0])
454 _AC_DEFINE_AND_SUBST([DEFAULT_AGENT_TCP_PORT_RANGE_BEGIN], [5345])
455 _AC_DEFINE_AND_SUBST([DEFAULT_AGENT_TCP_PORT_RANGE_END], [5354])
456 _AC_DEFINE_AND_SUBST([DEFAULT_APP_SOCKET_RW_TIMEOUT], [5])
457 _AC_DEFINE_AND_SUBST([DEFAULT_CHANNEL_SUBBUF_SIZE], [_DEFAULT_CHANNEL_SUBBUF_SIZE])
458 _AC_DEFINE_AND_SUBST([DEFAULT_CHANNEL_TRACEFILE_COUNT], [0])
459 _AC_DEFINE_AND_SUBST([DEFAULT_CHANNEL_TRACEFILE_SIZE], [0])
460 _AC_DEFINE_AND_SUBST([DEFAULT_KERNEL_CHANNEL_LIVE_TIMER], [_DEFAULT_CHANNEL_LIVE_TIMER])
461 _AC_DEFINE_AND_SUBST([DEFAULT_KERNEL_CHANNEL_READ_TIMER], [_DEFAULT_CHANNEL_READ_TIMER])
462 _AC_DEFINE_AND_SUBST([DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM], [_DEFAULT_CHANNEL_SUBBUF_NUM])
463 _AC_DEFINE_AND_SUBST([DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE], [1048576])
464 _AC_DEFINE_AND_SUBST([DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER], [_DEFAULT_CHANNEL_SWITCH_TIMER])
465 _AC_DEFINE_AND_SUBST([DEFAULT_KERNEL_CHANNEL_MONITOR_TIMER], [_DEFAULT_CHANNEL_MONITOR_TIMER])
466 _AC_DEFINE_AND_SUBST([DEFAULT_KERNEL_CHANNEL_BLOCKING_TIMEOUT], [_DEFAULT_CHANNEL_BLOCKING_TIMEOUT])
467 _AC_DEFINE_AND_SUBST([DEFAULT_LTTNG_LIVE_TIMER], [1000000])
468 _AC_DEFINE_AND_SUBST([DEFAULT_METADATA_CACHE_SIZE], [4096])
469 _AC_DEFINE_AND_SUBST([DEFAULT_METADATA_READ_TIMER], [0])
470 _AC_DEFINE_AND_SUBST([DEFAULT_METADATA_SUBBUF_NUM], [2])
471 _AC_DEFINE_AND_SUBST([DEFAULT_METADATA_SUBBUF_SIZE], [4096])
472 _AC_DEFINE_AND_SUBST([DEFAULT_METADATA_SWITCH_TIMER], [_DEFAULT_CHANNEL_SWITCH_TIMER])
473 _AC_DEFINE_AND_SUBST([DEFAULT_NETWORK_CONTROL_PORT], [5342])
474 _AC_DEFINE_AND_SUBST([DEFAULT_NETWORK_DATA_PORT], [5343])
475 _AC_DEFINE_AND_SUBST([DEFAULT_NETWORK_VIEWER_PORT], [5344])
476 _AC_DEFINE_AND_SUBST([DEFAULT_UST_PID_CHANNEL_LIVE_TIMER], [_DEFAULT_CHANNEL_LIVE_TIMER])
477 _AC_DEFINE_AND_SUBST([DEFAULT_UST_PID_CHANNEL_READ_TIMER], [0])
478 _AC_DEFINE_AND_SUBST([DEFAULT_UST_PID_CHANNEL_BLOCKING_TIMEOUT], [0])
479 _AC_DEFINE_AND_SUBST([DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM], [_DEFAULT_CHANNEL_SUBBUF_NUM])
480 _AC_DEFINE_AND_SUBST([DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE], [_DEFAULT_CHANNEL_SUBBUF_SIZE])
481 _AC_DEFINE_AND_SUBST([DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER], [_DEFAULT_CHANNEL_SWITCH_TIMER])
482 _AC_DEFINE_AND_SUBST([DEFAULT_UST_PID_CHANNEL_MONITOR_TIMER], [_DEFAULT_CHANNEL_MONITOR_TIMER])
483 _AC_DEFINE_AND_SUBST([DEFAULT_UST_UID_CHANNEL_LIVE_TIMER], [_DEFAULT_CHANNEL_LIVE_TIMER])
484 _AC_DEFINE_AND_SUBST([DEFAULT_UST_UID_CHANNEL_READ_TIMER], [0])
485 _AC_DEFINE_AND_SUBST([DEFAULT_UST_UID_CHANNEL_BLOCKING_TIMEOUT], [0])
486 _AC_DEFINE_AND_SUBST([DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM], [_DEFAULT_CHANNEL_SUBBUF_NUM])
487 _AC_DEFINE_AND_SUBST([DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE], [524288])
488 _AC_DEFINE_AND_SUBST([DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER], [_DEFAULT_CHANNEL_SWITCH_TIMER])
489 _AC_DEFINE_AND_SUBST([DEFAULT_UST_UID_CHANNEL_MONITOR_TIMER], [_DEFAULT_CHANNEL_MONITOR_TIMER])
490 _AC_DEFINE_QUOTED_AND_SUBST([DEFAULT_AGENT_BIND_ADDRESS], [localhost])
491 _AC_DEFINE_QUOTED_AND_SUBST([DEFAULT_NETWORK_CONTROL_BIND_ADDRESS], [0.0.0.0])
492 _AC_DEFINE_QUOTED_AND_SUBST([DEFAULT_NETWORK_DATA_BIND_ADDRESS], [0.0.0.0])
493 _AC_DEFINE_QUOTED_AND_SUBST([DEFAULT_NETWORK_VIEWER_BIND_ADDRESS], [localhost])
494 _AC_DEFINE_AND_SUBST([DEFAULT_NETWORK_RELAYD_CTRL_MAX_PAYLOAD_SIZE], [134217728])
495 _AC_DEFINE_AND_SUBST([DEFAULT_ROTATE_PENDING_TIMER], [500000])
496 _AC_DEFINE_AND_SUBST([DEFAULT_EVENT_NOTIFIER_ERROR_COUNT_MAP_SIZE], [4096])
498 # Command short descriptions
499 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_ADD_CONTEXT], [Add context fields to be recorded])
500 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_ADD_TRIGGER], [Add a trigger])
501 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_CLEAR], [Clear a recording session])
502 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_CREATE], [Create a recording session])
503 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_DESTROY], [Destroy recording sessions])
504 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_DISABLE_CHANNEL], [Disable channels])
505 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_DISABLE_EVENT], [Disable recording event rules])
506 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_DISABLE_ROTATION], [Unset a recording session rotation schedule])
507 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_ENABLE_CHANNEL], [Create or enable a channel])
508 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_ENABLE_EVENT], [Create or enable recording event rules])
509 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_ENABLE_ROTATION], [Set a recording session rotation schedule])
510 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_HELP], [Show the help of a command])
511 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_LIST], [List recording sessions and instrumentation points])
512 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_LIST_TRIGGERS], [List triggers])
513 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_LOAD], [Load recording session configurations])
514 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_REGENERATE], [Regenerate specific recording session data])
515 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_REMOVE_TRIGGER], [Remove a trigger])
516 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_ROTATE], [Archive the current trace chunk of a recording session])
517 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_SAVE], [Save recording session configurations])
518 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_SET_SESSION], [Set the current recording session])
519 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_SNAPSHOT], [Take a recording session snapshot])
520 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_START], [Start a recording session])
521 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_STATUS], [Show the status of the current recording session])
522 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_STOP], [Stop a recording session])
523 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_TRACK], [Allow specific processes to record events])
524 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_UNTRACK], [Disallow specific processes to record events])
525 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_VERSION], [Show LTTng-tools version information])
526 _AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_VIEW], [Launch a trace reader])
528 if test "x$prefix" = "xNONE"; then
529 prefix=$ac_default_prefix
531 CONFDIR=`eval echo $sysconfdir`
533 AC_DEFINE_UNQUOTED([CONFIG_LTTNG_SYSTEM_CONFIGDIR],"$CONFDIR", [LTTng system configuration directory.])
535 AX_DEFINE_DIR([CONFIG_LTTNG_SYSTEM_DATADIR], [datadir], [LTTng system data directory.])
538 PKG_CHECK_MODULES([POPT], [popt],
540 dnl PKG_CHECK_MODULES defines POPT_LIBS
543 AC_MSG_WARN([pkg-config was unable to find a valid .pc for libpopt. Set PKG_CONFIG_PATH to specify the pkgconfig configuration file location])
544 AC_MSG_WARN([Finding libpopt without pkg-config.])
547 [POPT_LIBS="-lpopt"],
549 AC_MSG_FAILURE([Cannot find libpopt. Either set PKG_CONFIG_PATH to the configuration file location or use LDFLAGS=-Ldir to specify the library location])
556 PKG_CHECK_MODULES([libxml2], [libxml-2.0 >= 2.7.6])
558 AC_CHECK_FUNC([clock_gettime], [AC_DEFINE_UNQUOTED([LTTNG_HAVE_CLOCK_GETTIME], 1, [Has clock_gettime() support.])])
560 # URCU library version needed or newer
561 PKG_CHECK_MODULES([URCU], [liburcu >= 0.11])
562 PKG_CHECK_MODULES([URCU_CDS], [liburcu-cds >= 0.11])
563 AM_CPPFLAGS="$AM_CPPFLAGS $URCU_CFLAGS"
565 # Check for libkmod, it will be auto-neabled if found but won't fail if it's not,
566 # it can be explicitly disabled with --without-kmod
567 AH_TEMPLATE([HAVE_KMOD], [Define if you have kmod support])
569 [AS_HELP_STRING([--with-kmod], [build with lkmod support @<:@default=check@:>@])],
574 AS_IF([test "x$with_kmod" != "xno"],
576 AC_CHECK_LIB([kmod], [kmod_module_probe_insert_module],
578 AC_DEFINE([HAVE_KMOD], [1])
582 if test "x$with_kmod" != xcheck; then
583 AC_MSG_FAILURE([Cannot find libkmod. Use [LDFLAGS]=-Ldir and [CPPFLAGS]=-Idir to specify its location.])
593 # Check for liblttng-ust-ctl, fail if it's not found,
594 # it can be explicitly disabled with --without-lttng-ust
595 AH_TEMPLATE([HAVE_LIBLTTNG_UST_CTL], [Define if you have LTTng-UST control support])
596 AC_ARG_WITH([lttng-ust],
597 [AS_HELP_STRING([--without-lttng-ust], [build without LTTng-UST (Userspace Tracing) support])],
602 AS_IF([test "x$with_lttng_ust" = "xyes"], [
603 AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1])
605 # Check for liblttng-ust
606 PKG_CHECK_MODULES([UST], [lttng-ust >= $major_version.$minor_version])
608 # Check for liblttng-ust-ctl
609 PKG_CHECK_MODULES([UST_CTL], [lttng-ust-ctl >= $major_version.$minor_version])
611 AM_CPPFLAGS="$AM_CPPFLAGS $UST_CFLAGS"
614 AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$with_lttng_ust" = "xyes"])
618 AC_CHECK_LIB([c], [fmemopen],
620 AC_DEFINE_UNQUOTED([LTTNG_HAVE_FMEMOPEN], 1, [Has fmemopen support.])
625 AC_CHECK_LIB([pfm], [pfm_initialize],
629 AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBPFM], [test "x$have_libpfm" = "xyes"])
632 # SWIG version needed or newer:
635 AC_ARG_ENABLE([python-bindings],
636 [AS_HELP_STRING([--enable-python-bindings],
637 [compile Python bindings])],
638 [enable_python_binding=$enableval], [enable_python_binding=no])
640 AM_CONDITIONAL([PYTHON_BINDING], [test "x$enable_python_binding" = xyes])
642 if test "x$enable_python_binding" = xyes; then
643 AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ])
644 AS_IF([test x$enable_shared = xno], [ AC_MSG_ERROR([Python bindings require shared libraries.]) ])
645 AM_PATH_PYTHON([3.0])
647 AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config])
648 AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
649 AS_IF([test -z "$PYTHON_INCLUDE"], [
650 AS_IF([test -z "$PYTHON_CONFIG"], [
651 AC_PATH_PROGS([PYTHON_CONFIG],
652 [python$PYTHON_VERSION-config python-config],
655 AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])])
657 AC_MSG_CHECKING([python include flags])
658 PYTHON_INCLUDE=`$PYTHON_CONFIG --includes`
659 AC_MSG_RESULT([$PYTHON_INCLUDE])
663 AC_MSG_NOTICE([You may configure with --enable-python-bindings ]dnl
664 [if you want Python bindings.])
668 # Epoll check. If not present, the build will fallback on poll() API
670 [AX_CONFIG_FEATURE_ENABLE(epoll)],
671 [AX_CONFIG_FEATURE_DISABLE(epoll)]
674 [epoll], [This platform supports epoll(7)],
675 [HAVE_EPOLL], [This platform supports epoll(7).]
678 AS_IF([test "x$ac_cv_func_dirfd" = "xyes"],
679 [AX_CONFIG_FEATURE_ENABLE(dirfd)],
680 [AX_CONFIG_FEATURE_DISABLE(dirfd)]
683 [dirfd], [Use directory file descriptors],
684 [HAVE_DIRFD], [This platform supports directory file descriptors.]
687 AM_CONDITIONAL([TEST_JAVA_JUL_AGENT], [test "x$test_java_agent_jul" = "xyes"])
688 AM_CONDITIONAL([TEST_JAVA_LOG4J_AGENT], [test "x$test_java_agent_log4j" = "xyes"])
689 AM_CONDITIONAL([TEST_JAVA_LOG4J2_AGENT], [test "x$test_java_agent_log4j2" = "xyes"])
691 if test "x$test_java_agent_jul" = "xyes" || test "x$test_java_agent_log4j" = "xyes" || test "x$test_java_agent_log4j2" = "xyes"; then
699 # Check for Java UST agent common class first
700 AX_CHECK_CLASS(org.lttng.ust.agent.AbstractLttngAgent)
701 if test "x$ac_cv_class_org_lttng_ust_agent_AbstractLttngAgent" = "xno"; then
702 AC_MSG_ERROR([The UST Java agent common class was not found. Please specify the location of the jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/lttng-ust-agent-common.jar"])
705 if test "x$test_java_agent_jul" = "xyes"; then
706 # Check for JUL agent class
707 AX_CHECK_CLASS(org.lttng.ust.agent.jul.LttngLogHandler)
708 if test "x$ac_cv_class_org_lttng_ust_agent_jul_LttngLogHandler" = "xno"; then
709 AC_MSG_ERROR([The UST Java agent JUL class was not found. Please specify the location of the jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/lttng-ust-agent-jul.jar"])
713 if test "x$test_java_agent_log4j" = "xyes"; then
714 # Check for Log4j agent class
715 AX_CHECK_CLASS(org.lttng.ust.agent.log4j.LttngLogAppender)
716 if test "x$ac_cv_class_org_lttng_ust_agent_log4j_LttngLogAppender" = "xno"; then
717 AC_MSG_ERROR([The UST Java agent Log4j class was not found. Please specify the location of the jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/lttng-ust-agent-log4j.jar"])
720 # Check for Log4j class
721 AX_CHECK_CLASS(org.apache.log4j.Logger)
722 if test "x$ac_cv_class_org_apache_log4j_Logger" = "xno"; then
723 AC_MSG_ERROR([The Log4j class was not found. Please specify the location of the jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/log4j.jar"])
727 if test "x$test_java_agent_log4j2" = "xyes"; then
728 # Check for Log4j2 agent class
729 AX_CHECK_CLASS(org.lttng.ust.agent.log4j2.LttngLogAppender)
730 if test "x$ac_cv_class_org_lttng_ust_agent_log4j2_LttngLogAppender" = "xno"; then
731 AC_MSG_ERROR([The UST Java agent Log4j 2.x class was not found. Please specify the location of the jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/lttng-ust-agent-log4j2.jar"])
734 # Check for Log4j 2.x classes
735 AX_CHECK_CLASS([org.apache.logging.log4j.Logger])
736 AX_CHECK_CLASS([org.apache.logging.log4j.core.Core])
737 if test "x$ac_cv_class_org_apache_logging_log4j_Logger" = "xno" || test "x$ac_cv_class_org_apache_logging_log4j_core_Core" = "xno"; then
738 AC_MSG_ERROR([The Log4j 2.x API or core class was not found. Please specify the location of the jars via the Java CLASSPATH e.g: export CLASSPATH="/path/to/log4j-core.jar:/path/to/log4j-api.jar"])
743 # enable building man pages (user's intention)
747 [--disable-man-pages],
748 [Do not build and install man pages (already built in a distributed tarball)]
750 [man_pages_opt=$enableval],
754 # check for asciidoc and xmlto if we enabled building the man pages
755 have_asciidoc_xmlto=no
756 warn_prebuilt_man_pages=no
758 AS_IF([test "x$man_pages_opt" = "xyes"], [
759 AC_PATH_PROG([ASCIIDOC], [asciidoc], [no])
760 AC_PATH_PROG([XMLTO], [xmlto], [no])
762 AS_IF([test "x$ASCIIDOC" = "xno" || test "x$XMLTO" = "xno"], [
763 AS_IF([test "x$in_git_repo" = "xyes"], [
764 # this is an error because we're in the Git repo, which
765 # means the man pages are not already generated for us,
766 # thus asciidoc/xmlto are required because we were asked
767 # to build the man pages
769 You need asciidoc and xmlto to build the LTTng-tools man pages. Use
770 --disable-man-pages to disable building the man pages, in which case
771 they will not be installed.
774 # only warn here: since we're in the tarball, the man
775 # pages should already be generated at this point, thus
776 # asciidoc/xmlto are not strictly required
777 warn_prebuilt_man_pages=yes
780 have_asciidoc_xmlto=yes
784 # export man page build condition: build the man pages if the user
785 # asked for it, and if the tools are available
786 AM_CONDITIONAL([MAN_PAGES_OPT], [test "x$man_pages_opt" != "xno"])
787 AM_CONDITIONAL([HAVE_ASCIIDOC_XMLTO], [test "x$have_asciidoc_xmlto" = "xyes"])
789 AC_DEFINE_UNQUOTED([MANPATH], ["`eval eval echo $mandir`"], [Path to man pages.])
791 # embedded --help message
795 [--enable-embedded-help],
796 [Embed the --help messages in the executable files]
798 [embedded_help=$enableval],
801 AS_IF([test "x$embedded_help" = "xyes"], [
802 AS_IF([test "x$man_pages_opt" = "xno"], [
803 AC_MSG_ERROR([You need the --enable-man-pages option with the --enable-embedded-help option.])
805 AC_PATH_PROG([man_prog_path], [man], [no])
806 AS_IF([test "x$man_prog_path" = "xno"], [
807 AC_MSG_ERROR([You need man with the --enable-embedded-help option.])
809 AC_DEFINE_UNQUOTED([LTTNG_EMBED_HELP], 1, [Embed --help messages.])
810 AC_SUBST([MANPROG], [$man_prog_path])
812 AM_CONDITIONAL([EMBED_HELP], [test "x$embedded_help" != "xno"])
815 UST_PYTHON_AGENT="lttngust"
817 AC_ARG_ENABLE(test-python2-agent,
818 AS_HELP_STRING([--enable-test-python2-agent],
819 [enable tests for python2 agent. Python2 interpreter path can be overridden by setting the PYTHON2 environment variable. Default: Autodetect]
820 ),[:],[test_python2_agent_autodetect=yes]
823 AC_ARG_ENABLE(test-python3-agent,
824 AS_HELP_STRING([--enable-test-python3-agent],
825 [enable tests for python3 agent. Python3 interpreter path can be overridden by setting the PYTHON3 environment variable. Default: Autodetect]
826 ),[:],[test_python3_agent_autodetect=yes]
829 AC_ARG_ENABLE(test-python-agent-all,
830 AS_HELP_STRING([--enable-test-python-agent-all],
831 [enable test for all python{2/3} agent.]
835 AS_IF([test ! -z "$enable_test_python_agent_all"], [
836 unset test_python2_agent_autodetect
837 unset test_python3_agent_autodetect
840 AS_IF([test "x$enable_test_python_agent_all" = "xyes"], [
841 enable_test_python2_agent=yes
842 enable_test_python3_agent=yes
845 AS_IF([test "x$enable_test_python_agent_all" = "xno"], [
846 enable_test_python2_agent=no
847 enable_test_python3_agent=no
851 AS_IF([test "x$enable_test_python2_agent" = "xyes" -o "x$test_python2_agent_autodetect" = "xyes" ], [
852 AS_IF([test -z "$PYTHON2"], [
855 AC_MSG_WARN([Using user-defined PYTHON2 ($PYTHON2) for lttng-ust python2 agent check])
858 AC_PATH_PROG([PYTHON2_BIN],[$PYTHON2])
859 AS_IF([test -z "$PYTHON2_BIN"], [
860 AS_IF([test -z "$test_python2_agent_autodetect"],[
861 AC_MSG_ERROR([No python2 interpreter found. PYTHON2 can be set to override default interpreter path])
864 AC_MSG_CHECKING([for python2 lttng-ust agent])
865 AS_IF([$PYTHON2_BIN -c "import $UST_PYTHON_AGENT" 2>/dev/null], [
866 PYTHON2_AGENT=$PYTHON2_BIN
868 RUN_PYTHON_AGENT_TEST=yes
871 AS_IF([test -z "$test_python2_agent_autodetect"],[
872 AC_MSG_ERROR([No python2 agent found. The path to the agent can be specified by setting the PYTHONPATH environment variable.])
880 AS_IF([test "x$enable_test_python3_agent" = "xyes" -o "x$test_python3_agent_autodetect" = "xyes" ], [
881 AS_IF([test -z "$PYTHON3"], [
884 AC_MSG_WARN([Using user-defined PYTHON3 ($PYTHON3) for lttng-ust python3 agent check])
887 AC_PATH_PROG([PYTHON3_BIN],[$PYTHON3])
888 AS_IF([test -z "$PYTHON3_BIN"], [
889 AS_IF([test -z "$test_python3_agent_autodetect"],[
890 AC_MSG_ERROR([No python3 interpreter found. PYTHON3 can be set to override default interpreter path])
893 AC_MSG_CHECKING([for python3 lttng-ust agent])
894 AS_IF([$PYTHON3_BIN -c "import $UST_PYTHON_AGENT" 2>/dev/null], [
895 PYTHON3_AGENT=$PYTHON3_BIN
897 RUN_PYTHON_AGENT_TEST=yes
900 AS_IF([test -z "$test_python3_agent_autodetect"],[
901 AC_MSG_ERROR([No python3 agent found. The path to the agent can be specified by setting the PYTHONPATH environment variable.])
907 AC_SUBST([RUN_PYTHON_AGENT_TEST])
908 AC_SUBST([PYTHON2_AGENT])
909 AC_SUBST([PYTHON3_AGENT])
911 AC_ARG_ENABLE([test-sdt-uprobe],
912 [AS_HELP_STRING([--enable-test-sdt-uprobe], [enable the LTTng UST SDT uprobe tests [default=autodetect]])],
913 [test_sdt_uprobe="$enableval"],
914 [test_sdt_uprobe=autodetect]
917 AS_IF([test "$test_sdt_uprobe" != "no"], [
918 LTTNG_CHECK_SDT_WORKS
919 AC_PATH_PROG([DTRACE], [dtrace])
922 AS_IF([test "$test_sdt_uprobe" = "yes"], [
923 AS_IF([test "$lttng_cv_sdt_works" = "no"], [
924 AC_MSG_ERROR([Cannot find 'sys/sdt.h'.])
926 AS_IF([test "x$DTRACE" = "x"], [
927 AC_MSG_ERROR([Cannot find SystemTap dtrace. You can set the DTRACE variable to override automatic detection.])
931 AS_IF([test "$test_sdt_uprobe" = "autodetect"], [
932 AS_IF([test "$lttng_cv_sdt_works" = "yes"], [
933 AS_IF([test "x$DTRACE" != "x"], [
939 AM_CONDITIONAL([TEST_SDT_UPROBE], [test "$test_sdt_uprobe" = "yes"])
941 # Arguments for binaries build exclusion
942 AC_ARG_ENABLE([bin-lttng], AS_HELP_STRING([--disable-bin-lttng],[Disable the build of lttng binaries]))
943 AC_ARG_ENABLE([bin-lttng-consumerd], AS_HELP_STRING([--disable-bin-lttng-consumerd],
944 [Disable the build of lttng-consumerd binaries]))
945 AC_ARG_ENABLE([bin-lttng-crash], AS_HELP_STRING([--disable-bin-lttng-crash],[Disable the build of lttng-crash binaries]))
946 AC_ARG_ENABLE([bin-lttng-relayd], AS_HELP_STRING([--disable-bin-lttng-relayd],
947 [Disable the build of lttng-relayd binaries]))
948 AC_ARG_ENABLE([bin-lttng-sessiond], AS_HELP_STRING([--disable-bin-lttng-sessiond],
949 [Disable the build of lttng-sessiond binaries]))
950 AC_ARG_ENABLE([extras], AS_HELP_STRING([--disable-extras],
951 [Disable the build of the extra components]))
954 build_lib_consumer=no
957 build_lib_kernel_consumer=no
958 build_lib_kernel_ctl=no
959 build_lib_lttng_ctl=no
961 build_lib_sessiond_comm=no
962 build_lib_testpoint=no
963 build_lib_ust_consumer=no
965 # There is an overlap for enabled dependencies, but this makes everything
966 # simpler. libcommon and libconfig are always compiled so they are not repeated
969 # Enable binary dependencies.
970 AS_IF([test x$enable_bin_lttng != xno],
972 build_lib_lttng_ctl=yes
976 AS_IF([test x$enable_bin_lttng_consumerd != xno],
978 build_lib_consumer=yes
979 build_lib_sessiond_comm=yes
982 build_lib_testpoint=yes
986 AS_IF([test x$enable_bin_lttng_crash != xno],
987 # Do nothing since libconfig and libcommon are built by default.
991 AS_IF([test x$enable_bin_lttng_relayd != xno],
993 build_lib_sessiond_comm=yes
996 build_lib_testpoint=yes
999 AS_IF([test x$enable_bin_lttng_sessiond != xno],
1001 build_lib_lttng_ctl=yes
1002 build_lib_sessiond_comm=yes
1003 build_lib_kernel_ctl=yes
1004 build_lib_relayd=yes
1005 build_lib_testpoint=yes
1006 build_lib_health=yes
1010 # Libraries dependencies enabling
1011 AS_IF([test x$build_lib_lttng_ctl = xyes],
1013 build_lib_sessiond_comm=yes
1017 AS_IF([test x$build_lib_consumer = xyes],
1019 build_lib_sessiond_comm=yes
1020 build_lib_kernel_consumer=yes
1021 build_lib_relayd=yes
1022 AS_IF([test "x$with_lttng_ust" = "xyes"], [build_lib_ust_consumer=yes])
1026 AS_IF([test x$build_lib_kernel_consumer = xyes],
1028 build_lib_kernel_ctl=yes
1029 build_lib_relayd=yes
1033 AS_IF([test x$build_lib_relayd = xyes],
1035 build_lib_sessiond_comm=yes
1040 AS_CASE([$host_cpu],
1041 [k1om], [ARCHTYPE="x86"],
1042 [i386], [ARCHTYPE="x86"],
1043 [i486], [ARCHTYPE="x86"],
1044 [i586], [ARCHTYPE="x86"],
1045 [i686], [ARCHTYPE="x86"],
1046 [amd64], [ARCHTYPE="x86"],
1047 [x86_64], [ARCHTYPE="x86"],
1048 [powerpc], [ARCHTYPE="ppc"],
1049 [ppc64], [ARCHTYPE="ppc"],
1050 [powerpc64], [ARCHTYPE="ppc"],
1051 [powerpc64le], [ARCHTYPE="ppc"],
1052 [ppc], [ARCHTYPE="ppc"],
1053 [s390], [ARCHTYPE="s390"],
1054 [s390x], [ARCHTYPE="s390"],
1055 [sparc], [ARCHTYPE="sparc64"],
1056 [sparc64], [ARCHTYPE="sparc64"],
1057 [alpha*], [ARCHTYPE="alpha"],
1058 [ia64], [ARCHTYPE="ia64"],
1059 [arm*], [ARCHTYPE="arm"],
1060 [aarch64*], [ARCHTYPE="aarch64"],
1061 [mips*], [ARCHTYPE="mips"],
1062 [nios2*], [ARCHTYPE="nios2"],
1063 [tile*], [ARCHTYPE="tile"],
1064 [hppa*], [ARCHTYPE="hppa"],
1065 [m68k], [ARCHTYPE="m68k"],
1066 [riscv*], [ARCHTYPE="riscv"],
1067 [ARCHTYPE="unknown"]
1073 [linux*], [OSTYPE="linux"],
1074 [freebsd*], [OSTYPE="freebsd"],
1075 [solaris*], [OSTYPE="solaris"],
1076 [cygwin*], [OSTYPE="cygwin"],
1077 [mingw*], [OSTYPE="mingw"],
1081 AM_CONDITIONAL([IS_LINUX], [test $OSTYPE = "linux"])
1085 # Userspace callstack capture is only supported by the Linux kernel on x86.
1086 AH_TEMPLATE([HAVE_MODULES_USERSPACE_CALLSTACK_CONTEXT], [Define if you have LTTng-modules userspace callstack tracing support])
1087 AS_IF([test "x$ARCHTYPE" = "xx86" && test "x$OSTYPE" = "xlinux"],[
1088 have_modules_userspace_callstack_context=yes
1089 AC_DEFINE([HAVE_MODULES_USERSPACE_CALLSTACK_CONTEXT], [1])
1091 AM_CONDITIONAL([HAVE_MODULES_USERSPACE_CALLSTACK_CONTEXT], [test x$have_modules_userspace_callstack_context = xyes])
1093 # Export binaries build conditions.
1094 AM_CONDITIONAL([BUILD_BIN_LTTNG], [test x$enable_bin_lttng != xno])
1095 AM_CONDITIONAL([BUILD_BIN_LTTNG_CONSUMERD], [test x$enable_bin_lttng_consumerd != xno])
1096 AM_CONDITIONAL([BUILD_BIN_LTTNG_CRASH], [test x$enable_bin_lttng_crash != xno])
1097 AM_CONDITIONAL([BUILD_BIN_LTTNG_RELAYD], [test x$enable_bin_lttng_relayd != xno])
1098 AM_CONDITIONAL([BUILD_BIN_LTTNG_SESSIOND], [test x$enable_bin_lttng_sessiond != xno])
1100 # Export the tests and extras build conditions.
1102 test "x$enable_bin_lttng" != "xno" && \
1103 test "x$enable_bin_lttng_consumerd" != "xno" && \
1104 test "x$enable_bin_lttng_crash" != "xno" && \
1105 test "x$enable_bin_lttng_relayd" != "xno" && \
1106 test "x$enable_bin_lttng_sessiond" != "xno"],
1111 AM_CONDITIONAL([BUILD_TESTS], [test x$build_tests = xyes])
1112 AM_CONDITIONAL([BUILD_EXTRAS], [test x$enable_extras != xno])
1114 # Export libraries build conditions.
1115 AM_CONDITIONAL([BUILD_LIB_CONSUMER], [test x$build_lib_consumer = xyes])
1116 AM_CONDITIONAL([BUILD_LIB_HEALTH], [test x$build_lib_health = xyes])
1117 AM_CONDITIONAL([BUILD_LIB_INDEX], [test x$build_lib_index = xyes])
1118 AM_CONDITIONAL([BUILD_LIB_KERNEL_CONSUMER], [test x$build_lib_kernel_consumer = xyes])
1119 AM_CONDITIONAL([BUILD_LIB_KERNEL_CTL], [test x$build_lib_kernel_ctl = xyes])
1120 AM_CONDITIONAL([BUILD_LIB_LTTNG_CTL], [test x$build_lib_lttng_ctl = xyes])
1121 AM_CONDITIONAL([BUILD_LIB_RELAYD], [test x$build_lib_relayd = xyes])
1122 AM_CONDITIONAL([BUILD_LIB_SESSIOND_COMM], [test x$build_lib_sessiond_comm = xyes])
1123 AM_CONDITIONAL([BUILD_LIB_TESTPOINT], [test x$build_lib_testpoint = xyes])
1124 AM_CONDITIONAL([BUILD_LIB_UST_CONSUMER], [test x$build_lib_ust_consumer = xyes])
1126 AM_CFLAGS="-fvisibility=hidden $OPT_CFLAGS $WARN_CFLAGS $PTHREAD_CFLAGS"
1129 AM_CXXFLAGS="-fvisibility=hidden -fvisibility-inlines-hidden $OPT_CXXFLAGS $WARN_CXXFLAGS $PTHREAD_CFLAGS"
1130 AC_SUBST(AM_CXXFLAGS)
1132 # This is set even though it is empty, so Makefiles can do "AM_LDFLAGS += ...".
1134 AC_SUBST(AM_LDFLAGS)
1136 # The order in which the include folders are searched is important.
1137 # The top_builddir should always be searched first in the event that a build
1138 # time generated file is included. An example of this is the "version.i" file.
1139 # In a scenario where lttng-tools is built from a distribution tarball and in a
1140 # out-of-tree manner, the generated "version.i" has priority on the one from
1141 # the source (distribution tarball) and must be found first.
1142 AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_srcdir)/include -I\$(top_builddir)/src -I\$(top_srcdir)/src -include config.h $AM_CPPFLAGS"
1143 AC_SUBST(AM_CPPFLAGS)
1145 lttngincludedir="${includedir}/lttng"
1146 AC_SUBST(lttngincludedir)
1148 lttngactionincludedir="${includedir}/lttng/action"
1149 AC_SUBST(lttngactionincludedir)
1151 lttngconditionincludedir="${includedir}/lttng/condition"
1152 AC_SUBST(lttngconditionincludedir)
1154 lttngnotificationincludedir="${includedir}/lttng/notification"
1155 AC_SUBST(lttngnotificationincludedir)
1157 lttngtriggerincludedir="${includedir}/lttng/trigger"
1158 AC_SUBST(lttngtriggerincludedir)
1160 lttngeventruleincludedir="${includedir}/lttng/event-rule"
1161 AC_SUBST(lttngeventruleincludedir)
1163 lttnglibexecdir="${libdir}/lttng/libexec"
1164 AC_SUBST(lttnglibexecdir)
1169 doc/examples/Makefile
1170 doc/examples/rotation/Makefile
1171 doc/examples/trigger-condition-event-matches/Makefile
1173 doc/man/asciidoc-attrs.conf
1176 extras/bindings/Makefile
1177 extras/bindings/swig/Makefile
1178 extras/bindings/swig/python/Makefile
1179 extras/core-handler/Makefile
1183 src/lib/lttng-ctl/Makefile
1184 src/lib/lttng-ctl/lttng-ctl.pc
1186 src/bin/lttng-consumerd/Makefile
1187 src/bin/lttng-sessiond/Makefile
1188 src/bin/lttng-relayd/Makefile
1189 src/bin/lttng/Makefile
1190 src/bin/lttng-crash/Makefile
1192 src/vendor/msgpack/Makefile
1194 tests/destructive/Makefile
1195 tests/regression/Makefile
1196 tests/regression/kernel/Makefile
1197 tests/regression/tools/Makefile
1198 tests/regression/tools/streaming/Makefile
1199 tests/regression/tools/filtering/Makefile
1200 tests/regression/tools/health/Makefile
1201 tests/regression/tools/tracefile-limits/Makefile
1202 tests/regression/tools/snapshots/Makefile
1203 tests/regression/tools/live/Makefile
1204 tests/regression/tools/exclusion/Makefile
1205 tests/regression/tools/save-load/Makefile
1206 tests/regression/tools/save-load/configuration/Makefile
1207 tests/regression/tools/mi/Makefile
1208 tests/regression/tools/wildcard/Makefile
1209 tests/regression/tools/channel/Makefile
1210 tests/regression/tools/crash/Makefile
1211 tests/regression/tools/regen-metadata/Makefile
1212 tests/regression/tools/regen-statedump/Makefile
1213 tests/regression/tools/notification/Makefile
1214 tests/regression/tools/rotation/Makefile
1215 tests/regression/tools/base-path/Makefile
1216 tests/regression/tools/metadata/Makefile
1217 tests/regression/tools/tracker/Makefile
1218 tests/regression/tools/working-directory/Makefile
1219 tests/regression/tools/relayd-grouping/Makefile
1220 tests/regression/tools/clear/Makefile
1221 tests/regression/tools/trigger/Makefile
1222 tests/regression/tools/trigger/rate-policy/Makefile
1223 tests/regression/tools/trigger/start-stop/Makefile
1224 tests/regression/tools/trigger/utils/Makefile
1225 tests/regression/tools/trigger/name/Makefile
1226 tests/regression/tools/trigger/hidden/Makefile
1227 tests/regression/ust/Makefile
1228 tests/regression/ust/nprocesses/Makefile
1229 tests/regression/ust/high-throughput/Makefile
1230 tests/regression/ust/low-throughput/Makefile
1231 tests/regression/ust/before-after/Makefile
1232 tests/regression/ust/buffers-pid/Makefile
1233 tests/regression/ust/periodical-metadata-flush/Makefile
1234 tests/regression/ust/multi-session/Makefile
1235 tests/regression/ust/multi-lib/Makefile
1236 tests/regression/ust/overlap/Makefile
1237 tests/regression/ust/overlap/demo/Makefile
1238 tests/regression/ust/linking/Makefile
1239 tests/regression/ust/daemon/Makefile
1240 tests/regression/ust/exit-fast/Makefile
1241 tests/regression/ust/fork/Makefile
1242 tests/regression/ust/libc-wrapper/Makefile
1243 tests/regression/ust/baddr-statedump/Makefile
1244 tests/regression/ust/ust-dl/Makefile
1245 tests/regression/ust/java-jul/Makefile
1246 tests/regression/ust/java-log4j/Makefile
1247 tests/regression/ust/java-log4j2/Makefile
1248 tests/regression/ust/getcpu-override/Makefile
1249 tests/regression/ust/clock-override/Makefile
1250 tests/regression/ust/type-declarations/Makefile
1251 tests/regression/ust/rotation-destroy-flush/Makefile
1252 tests/regression/ust/blocking/Makefile
1253 tests/regression/ust/namespaces/Makefile
1254 tests/stress/Makefile
1256 tests/unit/ini_config/Makefile
1258 tests/utils/Makefile
1259 tests/utils/tap/Makefile
1260 tests/utils/testapp/Makefile
1261 tests/utils/testapp/gen-ns-events/Makefile
1262 tests/utils/testapp/gen-kernel-test-events/Makefile
1263 tests/utils/testapp/gen-py-events/Makefile
1264 tests/utils/testapp/gen-ust-events/Makefile
1265 tests/utils/testapp/gen-ust-events-ns/Makefile
1266 tests/utils/testapp/gen-syscall-events-callstack/Makefile
1267 tests/utils/testapp/gen-ust-nevents/Makefile
1268 tests/utils/testapp/gen-ust-nevents-str/Makefile
1269 tests/utils/testapp/gen-syscall-events/Makefile
1270 tests/utils/testapp/gen-ust-tracef/Makefile
1271 tests/utils/testapp/userspace-probe-elf-binary/Makefile
1272 tests/utils/testapp/userspace-probe-elf-cxx-binary/Makefile
1273 tests/utils/testapp/userspace-probe-sdt-binary/Makefile
1274 tests/utils/xml-utils/Makefile
1277 # Inject variable into python test script.
1278 AC_CONFIG_FILES([tests/regression/ust/python-logging/test_python_logging],[chmod +x tests/regression/ust/python-logging/test_python_logging])
1279 # Inject LTTNG_TOOLS_BUILD_WITH_LIBPFM variable in test script.
1280 AC_CONFIG_FILES([tests/perf/test_perf_raw],[chmod +x tests/perf/test_perf_raw])
1281 AC_CONFIG_FILES([tests/regression/ust/ust-dl/test_ust-dl],[chmod +x tests/regression/ust/ust-dl/test_ust-dl])
1286 # Mini-report on what will be built.
1290 PPRINT_SET_INDENT(1)
1294 AS_ECHO("${PPRINT_COLOR_BLDBLU}LTTng-tools $PACKAGE_VERSION \"$version_name\"$PPRINT_COLOR_RST")
1297 AS_IF([test -n "$report_fold"], [
1298 AS_ECHO("`AS_ECHO("$version_description") | $report_fold -s`")
1300 AS_ECHO("$version_description")
1304 PPRINT_SUBTITLE([Features])
1306 # Target architecture we're building for.
1307 target_arch=$host_cpu
1309 for f in $CFLAGS; do
1310 if test $f = "-m32"; then
1311 target_arch="32-bit"
1312 elif test $f = "-m64"; then
1313 target_arch="64-bit"
1317 PPRINT_PROP_STRING([Target architecture], $target_arch)
1319 # kmod enabled/disabled
1320 test "x$with_kmod" != "xno" && value=1 || value=0
1321 PPRINT_PROP_BOOL([libkmod support], $value)
1323 # LTTng-UST enabled/disabled
1324 test "x$with_lttng_ust" = "xyes" && value=1 || value=0
1325 PPRINT_PROP_BOOL([LTTng-UST support], $value)
1328 PPRINT_SUBTITLE([Binaries])
1330 # List binaries to be built
1331 test x$enable_bin_lttng != xno && value=1 || value=0
1332 PPRINT_PROP_BOOL([lttng], $value)
1334 test x$enable_bin_lttng_consumerd != xno && value=1 || value=0
1335 PPRINT_PROP_BOOL([lttng-consumerd], $value)
1337 test x$enable_bin_lttng_crash != xno && value=1 || value=0
1338 PPRINT_PROP_BOOL([lttng-crash], $value)
1340 test x$enable_bin_lttng_relayd != xno && value=1 || value=0
1341 PPRINT_PROP_BOOL([lttng-relayd], $value)
1343 test x$enable_bin_lttng_sessiond != xno && value=1 || value=0
1344 PPRINT_PROP_BOOL([lttng-sessiond], $value)
1347 test x$enable_extras != xno && value=1 || value=0
1349 PPRINT_SET_INDENT(0)
1350 PPRINT_PROP_BOOL([Extras], $value, $PPRINT_COLOR_SUBTITLE)
1351 PPRINT_SET_INDENT(1)
1354 PPRINT_SUBTITLE([Tests])
1356 # Print clear message that tests won't be built
1357 AS_IF([test "x$build_tests" = "xno"],[
1358 PPRINT_WARN([Tests won't be built since some binaries were disabled])
1361 # LTTng UST Java agent JUL tests enabled/disabled
1362 test "x$test_java_agent_jul" = "xyes" && value=1 || value=0
1363 PPRINT_PROP_BOOL([LTTng-UST Java agent JUL tests], $value)
1365 # LTTng UST Java agent Log4j 1.x tests enabled/disabled
1366 test "x$test_java_agent_log4j" = "xyes" && value=1 || value=0
1367 PPRINT_PROP_BOOL([LTTng-UST Java agent Log4j 1.x tests], $value)
1369 # LTTng UST Java agent Log4j 2.x tests enabled/disabled
1370 test "x$test_java_agent_log4j2" = "xyes" && value=1 || value=0
1371 PPRINT_PROP_BOOL([LTTng-UST Java agent Log4j 2.x tests], $value)
1373 test ! -z "$PYTHON2_AGENT" && value=1 || value=0
1374 PPRINT_PROP_BOOL([LTTng-UST Python2 agent tests], $value)
1376 test ! -z "$PYTHON3_AGENT" && value=1 || value=0
1377 PPRINT_PROP_BOOL([LTTng-UST Python3 agent tests], $value)
1379 # userspace-probe SDT instrumentation tests enabled/disabled
1380 test "x$test_sdt_uprobe" = "xyes" && value=1 || value=0
1381 PPRINT_PROP_BOOL([LTTng-modules SDT uprobe tests], $value)
1383 #Python binding enabled/disabled
1384 test "x$enable_python_binding" = xyes && value=1 || value=0
1386 PPRINT_SET_INDENT(0)
1387 PPRINT_PROP_BOOL([Python binding], $value, $PPRINT_COLOR_SUBTITLE)
1389 # man pages build enabled/disabled
1390 m4_pushdef([build_man_pages_msg], [Build and install man pages])
1392 AS_IF([test "x$man_pages_opt" != "xno"], [
1393 AS_IF([test "x$in_git_repo" = "xyes"], [
1394 PPRINT_PROP_BOOL([build_man_pages_msg], 1, $PPRINT_COLOR_SUBTITLE)
1396 AS_IF([test "x$have_asciidoc_xmlto" = "xyes"], [
1397 PPRINT_PROP_BOOL([build_man_pages_msg], 1, $PPRINT_COLOR_SUBTITLE)
1399 PPRINT_PROP_STRING([build_man_pages_msg],
1400 [${PPRINT_COLOR_BLDGRN}yes (already built)],
1401 $PPRINT_COLOR_SUBTITLE)
1405 PPRINT_PROP_BOOL([build_man_pages_msg], 0, $PPRINT_COLOR_SUBTITLE)
1408 m4_popdef([build_man_pages_msg])
1410 test "x$embedded_help" = xyes && value=1 || value=0
1411 PPRINT_PROP_BOOL([Embed --help messages], $value, $PPRINT_COLOR_SUBTITLE)
1413 PPRINT_SET_INDENT(1)
1415 report_bindir="`eval eval echo $bindir`"
1416 report_libdir="`eval eval echo $libdir`"
1418 # Print the bindir and libdir this `make install' will install into.
1420 PPRINT_SUBTITLE([Install directories])
1421 PPRINT_PROP_STRING([Binaries], [$report_bindir])
1422 PPRINT_PROP_STRING([Libraries], [$report_libdir])
1425 PPRINT_SUBTITLE([Search directories])
1427 # If we build the sessiond, print the paths it will use
1428 AS_IF([test "$SESSIOND_BIN" = ""],[
1429 path="$report_bindir/lttng-sessiond"
1431 path="$SESSIOND_BIN"
1433 PPRINT_PROP_STRING([lttng-sessiond executable], [$path])
1435 AS_IF([test "$CONSUMERD32_BIN" = ""],[
1436 path="`eval eval echo $lttnglibexecdir`/lttng-consumerd"
1438 path="$CONSUMERD32_BIN"
1440 PPRINT_PROP_STRING([32-bit lttng-consumerd executable], [$path])
1442 AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[
1443 path="`eval eval echo $libdir`"
1445 path="$CONSUMERD32_LIBDIR"
1447 PPRINT_PROP_STRING([32-bit consumer libraries], [$path])
1449 AS_IF([test "$CONSUMERD64_BIN" = ""],[
1450 path="`eval eval echo $lttnglibexecdir`/lttng-consumerd"
1452 path="$CONSUMERD64_BIN"
1454 PPRINT_PROP_STRING([64-bit lttng-consumerd executable], [$path])
1456 AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[
1457 path="`eval eval echo $libdir`"
1459 path="$CONSUMERD64_LIBDIR"
1461 PPRINT_PROP_STRING([64-bit consumer libraries], [$path])
1462 PPRINT_SET_INDENT(0)
1464 AS_IF([test "x$warn_prebuilt_man_pages" = "xyes" ], [
1466 PPRINT_WARN([You need asciidoc and xmlto to build the LTTng-tools man pages.
1468 Note that the man pages are already built in this distribution tarball,
1469 therefore asciidoc and xmlto are only needed if you intend to modify
1472 Also note that the installed man pages will contain the project's
1473 default command-line option and environment variable values.
1475 Use --disable-man-pages to completely disable building and installing