X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=configure.ac;h=90c8d679f1836129b689e7319672bca39c498c59;hp=ea327f9b8ee82fa2ab7f2d3893fd855e21191e06;hb=dfd6e9d757670c41bdda3bc895829d6080962322;hpb=c30417c11fcaf0406c4cfb3a09373c848a86e291 diff --git a/configure.ac b/configure.ac index ea327f9b8..90c8d679f 100644 --- a/configure.ac +++ b/configure.ac @@ -57,26 +57,47 @@ 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_LIST], [ dnl +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 . [-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-declarations dnl -Wmissing-prototypes dnl -Wmissing-parameter-type dnl - -Wshadow dnl - -Wno-gnu-folding-constant dnl + -Wjump-misses-init dnl + -Wnested-externs 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_LIST], [WARN_CFLAGS], [-Werror]) +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 @@ -101,10 +122,18 @@ AC_LANG_POP([C]) # 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. AC_LANG_PUSH([C++]) -AX_APPEND_COMPILE_FLAGS([WARN_FLAGS_LIST], [WARN_CXXFLAGS], [-Werror]) +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. @@ -250,7 +279,7 @@ AS_IF([test "x$libtool_fixup" = "xyes"], [ 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], [ @@ -384,15 +413,22 @@ AC_ARG_ENABLE([test-java-agent-jul], ) 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], [:] ) @@ -660,8 +696,9 @@ AX_CONFIG_FEATURE( 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 @@ -696,6 +733,21 @@ if test "x$test_java_agent_jul" = "xyes" || test "x$test_java_agent_log4j" = "xy 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) @@ -948,7 +1000,6 @@ AS_IF([test x$enable_bin_lttng_crash != xno], 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 @@ -1082,10 +1133,10 @@ AM_CONDITIONAL([BUILD_LIB_SESSIOND_COMM], [test x$build_lib_sessiond_comm = xyes 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="$OPT_CFLAGS $WARN_CFLAGS $PTHREAD_CFLAGS" +AM_CFLAGS="-fvisibility=hidden $OPT_CFLAGS $WARN_CFLAGS $PTHREAD_CFLAGS" AC_SUBST(AM_CFLAGS) -AM_CXXFLAGS="$OPT_CXXFLAGS $WARN_CXXFLAGS $PTHREAD_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 += ...". @@ -1138,23 +1189,6 @@ AC_CONFIG_FILES([ 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 @@ -1220,6 +1254,7 @@ AC_CONFIG_FILES([ 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 @@ -1337,9 +1372,13 @@ AS_IF([test "x$build_tests" = "xno"],[ 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) @@ -1347,9 +1386,9 @@ 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