# Enable silent rules if available (Introduced in AM 1.11)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-# Checks for C compiler
-AC_USE_SYSTEM_EXTENSIONS
-AC_SYS_LARGEFILE
+
+## ##
+## C compiler checks ##
+## ##
+
+# Choose the C compiler
AC_PROG_CC
# AC_PROG_CC_STDC was merged in AC_PROG_CC in autoconf 2.70
m4_version_prereq([2.70], [], [AC_PROG_CC_STDC])
-AC_PROG_CXX
-RW_PROG_CXX_WORKS
-AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])
-# Detect warning flags supported by the compiler, append them to WARN_CFLAGS.
+# Make sure the C compiler supports C99
+AS_IF([test "$ac_cv_prog_cc_c99" = "no"], [AC_MSG_ERROR([The compiler does not support C99])])
+
+# Enable available system extensions and LFS support
+AC_USE_SYSTEM_EXTENSIONS
+AC_SYS_LARGEFILE
+
+# Make sure the C compiler supports __attribute__
+AX_C___ATTRIBUTE__
+AS_IF([test "x$ax_cv___attribute__" != "xyes"],
+ [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])])
+
+# Make sure we have pthread support
+AX_PTHREAD([], [AC_MSG_ERROR([Could not configure pthread support])])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_INLINE
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_MODE_T
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+AC_TYPE_UID_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+AC_TYPE_UINT8_T
+
+# Detect warning flags supported by the C and C++ compilers and append them to
+# WARN_CFLAGS and WARN_CXXFLAGS.
+m4_define([WARN_FLAGS_COMMON_LIST], [ dnl
+ -Wall dnl
+ -Wextra dnl
+ -Wmissing-declarations dnl
+ -Wnull-dereference dnl
+ -Wundef dnl
+ -Wredundant-decls dnl
+ -Wshadow dnl
+ -Wsuggest-attribute=format dnl
+ -Wtautological-constant-out-of-range-compare dnl Clang specific
+ -Wwrite-strings dnl
+ -Wformat=2 dnl
+ -Wstrict-aliasing dnl
+ -Wmissing-noreturn dnl
+ -Wduplicated-cond dnl
+ -Wduplicated-branches dnl
+ -Wlogical-op dnl
+ -Winit-self dnl
+ dnl We currently get this warning when building with Clang:
+ dnl
+ 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]
+ dnl extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROWNL;
+ dnl ^
+ -Wno-incomplete-setjmp-declaration dnl
+ -Wno-gnu-folding-constant dnl Clang specific
+])
+
+# Detect warning flags specific to the C compiler and append them to
+# WARN_CFLAGS.
+m4_define([WARN_FLAGS_C_LIST], [ dnl
+ -Wdiscarded-qualifiers dnl
+ -Wmissing-prototypes dnl
+ -Wmissing-parameter-type dnl
+ -Wsuggest-final-types dnl
+ -Wsuggest-final-methods dnl
+ -Wsuggest-override dnl
+])
+
+# Pass -Werror as an extra flag during the test: this is needed to make the
+# -Wunknown-warning-option diagnostic fatal with clang.
+AC_LANG_PUSH([C])
+AX_APPEND_COMPILE_FLAGS([WARN_FLAGS_COMMON_LIST WARN_FLAGS_C_LIST], [WARN_CFLAGS], [-Werror])
+AC_LANG_POP([C])
+
+# The test used in AX_APPEND_COMPILE_FLAGS, generated using AC_LANG_PROGRAM, is
+# written in such a way that it triggers warnings with the following warning
+# flags. So they would always end up disabled if we put them there, because
+# the test program would not build.
#
+# Enable them here unconditionally. They are supported by GCC >= 4.8 and by
+# Clang >= 3.3 (required by the project) and are only valid for C code.
+WARN_CFLAGS="${WARN_CFLAGS} -Wold-style-definition -Wstrict-prototypes"
+
+# Disable 'strict aliasing' if the C compiler supports it.
+AC_LANG_PUSH([C])
+AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [OPT_CFLAGS], [-Werror])
+AC_LANG_POP([C])
+
+
+## ##
+## C++ compiler checks ##
+## ##
+
+# Find a C++11 compiler with GNU extensions (-std=gnu++11)
+AX_CXX_COMPILE_STDCXX([11], [ext], [mandatory])
+
+# Detect warning flags specific to the C++ compiler and append them to
+# WARN_CXXFLAGS.
+m4_define([WARN_FLAGS_CXX_LIST], [ dnl
+ dnl GCC enables this with -Wall in C++, and that generates a
+ dnl lot of warnings that have on average a low value to fix.
+ -Wno-sign-compare dnl
+])
+
# Pass -Werror as an extra flag during the test: this is needed to make the
# -Wunknown-warning-option diagnostic fatal with clang.
-AX_APPEND_COMPILE_FLAGS([ dnl
- -Wall dnl
- dnl We currently get this warning when building with Clang:
- dnl
- 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]
- dnl extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROWNL;
- dnl ^
- -Wno-incomplete-setjmp-declaration dnl
- -Wdiscarded-qualifiers dnl
- -Wmissing-declarations dnl
- -Wmissing-prototypes dnl
- -Wmissing-parameter-type dnl
- -Wold-style-definition dnl
- -Wstrict-prototypes dnl
- -Wshadow dnl
- ],
- [WARN_CFLAGS],
- [-Werror])
-
-# When given, add -Werror to WARN_CFLAGS.
-AC_ARG_ENABLE([Werror],
- [AS_HELP_STRING([--enable-Werror], [Treat compiler warnings as errors.])]
-)
-AS_IF([test "x$enable_Werror" = "xyes"],
- [WARN_CFLAGS="${WARN_CFLAGS} -Werror"]
-)
+AC_LANG_PUSH([C++])
+AX_APPEND_COMPILE_FLAGS([WARN_FLAGS_COMMON_LIST WARN_FLAGS_CXX_LIST], [WARN_CXXFLAGS], [-Werror])
+AC_LANG_POP([C++])
+
+# Disable 'strict aliasing' if the C++ compiler supports it.
+AC_LANG_PUSH([C++])
+AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [OPT_CXXFLAGS], [-Werror])
+AC_LANG_POP([C++])
+
+
+# When given, add -Werror to WARN_CFLAGS and WARN_CXXFLAGS.
+AC_ARG_ENABLE([Werror],[
+ AS_HELP_STRING([--enable-Werror], [Treat compiler warnings as errors.])
+])
+
+AS_IF([test "x$enable_Werror" = "xyes"], [
+ WARN_CFLAGS="${WARN_CFLAGS} -Werror"
+ WARN_CXXFLAGS="${WARN_CXXFLAGS} -Werror"
+])
# Checks for programs.
AC_PROG_GREP
LT_INIT
# Check for objcopy, required by the base address statedump and dynamic linker tests
-AC_CHECK_TOOL([OBJCOPY], [objcopy], [no])
-AS_IF([test "x$OBJCOPY" = "xno"],
+AC_CHECK_TOOL([OBJCOPY], [objcopy])
+AS_IF([test "x$OBJCOPY" = "x"],
[AC_MSG_WARN([Cannot find objcopy. The base address statedump and dynamic linker tests will be disabled. Install the binutils package to remediate this.])]
)
-AM_CONDITIONAL([HAVE_OBJCOPY], [test "x$OBJCOPY" != xno])
+AM_CONDITIONAL([HAVE_OBJCOPY], [test "x$OBJCOPY" != "x"])
# check for pgrep
-AC_PATH_PROG([PGREP], [pgrep], [no])
-AM_CONDITIONAL([HAVE_PGREP], [test "x$PGREP" != "xno"])
+AC_PATH_PROG([PGREP], [pgrep])
+AM_CONDITIONAL([HAVE_PGREP], [test "x$PGREP" != "x"])
# set $IN_GIT_REPO if we're in the Git repository; the `bootstrap` file
# is not distributed in tarballs
AM_CONDITIONAL([HAVE_FLEX], [test "x$have_flex" = "xyes"])
-# Checks for typedefs, structures, and compiler characteristics.
-AC_C_INLINE
-AC_TYPE_INT32_T
-AC_TYPE_INT64_T
-AC_TYPE_MODE_T
-AC_TYPE_OFF_T
-AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-AC_TYPE_SSIZE_T
-AC_TYPE_UID_T
-AC_TYPE_UINT16_T
-AC_TYPE_UINT32_T
-AC_TYPE_UINT64_T
-AC_TYPE_UINT8_T
-
-AX_C___ATTRIBUTE__
-AS_IF([test "x$ax_cv___attribute__" = "xyes"],
- [:],
- [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])])
-
-AX_PTHREAD(,[AC_MSG_ERROR([Could not configure pthreads support])])
# Check if linker has the -no-pie option.
AX_CHECK_LINK_FLAG([-no-pie], [linker_have_no_pie_option=yes])
[
libtool_m4="$srcdir/m4/libtool.m4"
libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)"
- AC_MSG_CHECKING([for occurence(s) of link_all_deplibs = no in $libtool_m4])
+ AC_MSG_CHECKING([for occurrence(s) of link_all_deplibs = no in $libtool_m4])
libtool_flag_pattern_count=$($GREP -c "$libtool_flag_pattern\s*=\s*no" $libtool_m4)
AS_IF([test $libtool_flag_pattern_count -ne 0],
[
signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \
getopt.h sys/ipc.h sys/shm.h popt.h grp.h arpa/inet.h \
netdb.h netinet/in.h paths.h stddef.h sys/file.h sys/ioctl.h \
- sys/mount.h sys/param.h sys/time.h elf.h
+ sys/mount.h sys/param.h sys/time.h elf.h sys/random.h sys/syscall.h
])
AM_CONDITIONAL([HAVE_ELF_H], [test x$ac_cv_header_elf_h = xyes])
mkdir munmap putenv realpath rmdir socket strchr strcspn strdup \
strncasecmp strndup strnlen strpbrk strrchr strstr strtol strtoul \
strtoull dirfd gethostbyname2 getipnodebyname epoll_create1 \
- sched_getcpu sysconf sync_file_range
+ sched_getcpu sysconf sync_file_range getrandom
])
# Check for pthread_setname_np and pthread_getname_np
)
AC_ARG_ENABLE([test-java-agent-log4j],
- [AS_HELP_STRING([--enable-test-java-agent-log4j],[enable the LTTng UST Java agent Log4j tests [default=no]])],
+ [AS_HELP_STRING([--enable-test-java-agent-log4j],[enable the LTTng UST Java agent Log4j 1.x tests [default=no]])],
[test_java_agent_log4j=$enableval],
[test_java_agent_log4j=no]
)
+AC_ARG_ENABLE([test-java-agent-log4j2],
+ [AS_HELP_STRING([--enable-test-java-agent-log4j2],[enable the LTTng UST Java agent Log4j 2.x tests [default=no]])],
+ [test_java_agent_log4j2=$enableval],
+ [test_java_agent_log4j2=no]
+)
+
AC_ARG_ENABLE([test-java-agent-all],
[AS_HELP_STRING([--enable-test-java-agent-all],[enable all the LTTng UST Java agent tests [default=no]])],
[test_java_agent_jul=$enableval
- test_java_agent_log4j=$enableval],
+ test_java_agent_log4j=$enableval
+ test_java_agent_log4j2=$enableval],
[:]
)
AC_CHECK_FUNC([clock_gettime], [AC_DEFINE_UNQUOTED([LTTNG_HAVE_CLOCK_GETTIME], 1, [Has clock_gettime() support.])])
# URCU library version needed or newer
-PKG_CHECK_MODULES([URCU], [liburcu >= 0.11])
-PKG_CHECK_MODULES([URCU_BP], [liburcu-bp >= 0.11])
-PKG_CHECK_MODULES([URCU_CDS], [liburcu-cds >= 0.11])
+PKG_CHECK_MODULES([URCU], [liburcu >= 0.14])
+PKG_CHECK_MODULES([URCU_CDS], [liburcu-cds >= 0.14])
AM_CPPFLAGS="$AM_CPPFLAGS $URCU_CFLAGS"
# Check for libkmod, it will be auto-neabled if found but won't fail if it's not,
AS_IF([test -z "$PYTHON_CONFIG"], [
AC_PATH_PROGS([PYTHON_CONFIG],
[python$PYTHON_VERSION-config python-config],
- [no],
+ [],
[`dirname $PYTHON`])
- AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])])
+ AS_IF([test "x$PYTHON_CONFIG" = "x"], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])])
])
AC_MSG_CHECKING([python include flags])
PYTHON_INCLUDE=`$PYTHON_CONFIG --includes`
AM_CONDITIONAL([TEST_JAVA_JUL_AGENT], [test "x$test_java_agent_jul" = "xyes"])
AM_CONDITIONAL([TEST_JAVA_LOG4J_AGENT], [test "x$test_java_agent_log4j" = "xyes"])
+AM_CONDITIONAL([TEST_JAVA_LOG4J2_AGENT], [test "x$test_java_agent_log4j2" = "xyes"])
-if test "x$test_java_agent_jul" = "xyes" || test "x$test_java_agent_log4j" = "xyes"; then
+if test "x$test_java_agent_jul" = "xyes" || test "x$test_java_agent_log4j" = "xyes" || test "x$test_java_agent_log4j2" = "xyes"; then
AX_JAVA_OPTIONS
AX_PROG_JAVAC
AX_PROG_JAVA
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"])
fi
fi
+
+ if test "x$test_java_agent_log4j2" = "xyes"; then
+ # Check for Log4j2 agent class
+ AX_CHECK_CLASS(org.lttng.ust.agent.log4j2.LttngLogAppender)
+ if test "x$ac_cv_class_org_lttng_ust_agent_log4j2_LttngLogAppender" = "xno"; then
+ 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"])
+ fi
+
+ # Check for Log4j 2.x classes
+ AX_CHECK_CLASS([org.apache.logging.log4j.Logger])
+ AX_CHECK_CLASS([org.apache.logging.log4j.core.Core])
+ 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
+ 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"])
+ fi
+ fi
fi
# enable building man pages (user's intention)
warn_prebuilt_man_pages=no
AS_IF([test "x$man_pages_opt" = "xyes"], [
- AC_PATH_PROG([ASCIIDOC], [asciidoc], [no])
- AC_PATH_PROG([XMLTO], [xmlto], [no])
+ AC_PATH_PROG([ASCIIDOC], [asciidoc])
+ AC_PATH_PROG([XMLTO], [xmlto])
- AS_IF([test "x$ASCIIDOC" = "xno" || test "x$XMLTO" = "xno"], [
+ AS_IF([test "x$ASCIIDOC" = "x" || test "x$XMLTO" = "x"], [
AS_IF([test "x$in_git_repo" = "xyes"], [
# this is an error because we're in the Git repo, which
# means the man pages are not already generated for us,
AS_IF([test "x$man_pages_opt" = "xno"], [
AC_MSG_ERROR([You need the --enable-man-pages option with the --enable-embedded-help option.])
])
- AC_PATH_PROG([man_prog_path], [man], [no])
- AS_IF([test "x$man_prog_path" = "xno"], [
+ AC_PATH_PROG([man_prog_path], [man])
+ AS_IF([test "x$man_prog_path" = "x"], [
AC_MSG_ERROR([You need man with the --enable-embedded-help option.])
])
AC_DEFINE_UNQUOTED([LTTNG_EMBED_HELP], 1, [Embed --help messages.])
AS_IF([test x$enable_bin_lttng_relayd != xno],
[
- build_lib_lttng_ctl=yes
build_lib_sessiond_comm=yes
build_lib_index=yes
build_lib_health=yes
AM_CONDITIONAL([BUILD_LIB_TESTPOINT], [test x$build_lib_testpoint = xyes])
AM_CONDITIONAL([BUILD_LIB_UST_CONSUMER], [test x$build_lib_ust_consumer = xyes])
-AM_CFLAGS="${WARN_CFLAGS} -fno-strict-aliasing $PTHREAD_CFLAGS"
+AM_CFLAGS="-fvisibility=hidden $OPT_CFLAGS $WARN_CFLAGS $PTHREAD_CFLAGS"
AC_SUBST(AM_CFLAGS)
+AM_CXXFLAGS="-fvisibility=hidden -fvisibility-inlines-hidden $OPT_CXXFLAGS $WARN_CXXFLAGS $PTHREAD_CFLAGS"
+AC_SUBST(AM_CXXFLAGS)
+
# This is set even though it is empty, so Makefiles can do "AM_LDFLAGS += ...".
AM_LDFLAGS=""
AC_SUBST(AM_LDFLAGS)
extras/core-handler/Makefile
src/Makefile
src/common/Makefile
- src/common/argpar/Makefile
- src/common/bytecode/Makefile
- src/common/kernel-ctl/Makefile
- src/common/kernel-consumer/Makefile
- src/common/consumer/Makefile
- src/common/ust-consumer/Makefile
- src/common/hashtable/Makefile
- src/common/sessiond-comm/Makefile
- src/common/compat/Makefile
- src/common/relayd/Makefile
- src/common/testpoint/Makefile
- src/common/index/Makefile
- src/common/health/Makefile
- src/common/config/Makefile
- src/common/string-utils/Makefile
- src/common/fd-tracker/Makefile
- src/common/filter/Makefile
src/lib/Makefile
src/lib/lttng-ctl/Makefile
src/lib/lttng-ctl/lttng-ctl.pc
tests/regression/tools/trigger/utils/Makefile
tests/regression/tools/trigger/name/Makefile
tests/regression/tools/trigger/hidden/Makefile
+ tests/regression/tools/context/Makefile
tests/regression/ust/Makefile
tests/regression/ust/nprocesses/Makefile
tests/regression/ust/high-throughput/Makefile
tests/regression/ust/ust-dl/Makefile
tests/regression/ust/java-jul/Makefile
tests/regression/ust/java-log4j/Makefile
+ tests/regression/ust/java-log4j2/Makefile
tests/regression/ust/getcpu-override/Makefile
tests/regression/ust/clock-override/Makefile
tests/regression/ust/type-declarations/Makefile
tests/unit/ini_config/Makefile
tests/perf/Makefile
tests/utils/Makefile
+ tests/utils/lttngtest/Makefile
tests/utils/tap/Makefile
tests/utils/testapp/Makefile
tests/utils/testapp/gen-ns-events/Makefile
test "x$test_java_agent_jul" = "xyes" && value=1 || value=0
PPRINT_PROP_BOOL([LTTng-UST Java agent JUL tests], $value)
-# LTTng UST Java agent Log4j tests enabled/disabled
+# LTTng UST Java agent Log4j 1.x tests enabled/disabled
test "x$test_java_agent_log4j" = "xyes" && value=1 || value=0
-PPRINT_PROP_BOOL([LTTng-UST Java agent Log4j tests], $value)
+PPRINT_PROP_BOOL([LTTng-UST Java agent Log4j 1.x tests], $value)
+
+# LTTng UST Java agent Log4j 2.x tests enabled/disabled
+test "x$test_java_agent_log4j2" = "xyes" && value=1 || value=0
+PPRINT_PROP_BOOL([LTTng-UST Java agent Log4j 2.x tests], $value)
test ! -z "$PYTHON2_AGENT" && value=1 || value=0
PPRINT_PROP_BOOL([LTTng-UST Python2 agent tests], $value)
test ! -z "$PYTHON3_AGENT" && value=1 || value=0
PPRINT_PROP_BOOL([LTTng-UST Python3 agent tests], $value)
-# LTTng UST Java agent Log4j tests enabled/disabled
+# userspace-probe SDT instrumentation tests enabled/disabled
test "x$test_sdt_uprobe" = "xyes" && value=1 || value=0
-PPRINT_PROP_BOOL([LTTng-UST SDT uprobe tests], $value)
+PPRINT_PROP_BOOL([LTTng-modules SDT uprobe tests], $value)
#Python binding enabled/disabled
test "x$enable_python_binding" = xyes && value=1 || value=0