fix: add missing closedir in _get_max_cpuid_from_sysfs()
[lttng-ust.git] / configure.ac
index 7a5775f37e541bb5c83f0bc32143322d8d9f1a52..437d71961871ec30fe9405b05fe933817aced698 100644 (file)
@@ -7,12 +7,12 @@ dnl Process this file with autoconf to produce a configure script.
 
 # Project version information
 m4_define([ust_version_major], [2])
-m4_define([ust_version_minor], [13])
+m4_define([ust_version_minor], [14])
 m4_define([ust_version_patch], [0])
-m4_define([ust_version_dev_stage], [-rc1])
+m4_define([ust_version_dev_stage], [-pre])
 m4_define([ust_version], ust_version_major[.]ust_version_minor[.]ust_version_patch[]ust_version_dev_stage)
-m4_define([ust_version_name], [[Nordicité]])
-m4_define([ust_version_description], [[The product of a collaboration between Champ Libre and Boréale, this farmhouse IPA is brewed with Kveik yeast and Québec-grown barley, oats and juniper branches. The result is a remarkable fruity hazy golden IPA that offers a balanced touch of resinous and woodsy bitterness.]])
+m4_define([ust_version_name], [[O-Beer]])
+m4_define([ust_version_description], [[An alcoholic drink made from yeast-fermented malt flavored with hops.]])
 
 # Library version information of "liblttng-ust"
 # Following the numbering scheme proposed by libtool for the library version
@@ -162,6 +162,7 @@ m4_define([WARN_FLAGS_LIST], [ dnl
   -Wno-sign-compare dnl
   -Wno-missing-field-initializers dnl
   -Wno-null-dereference dnl
+  -Wno-gnu dnl Disable warnings for GNU extensions on Clang
 ])
 
 # Pass -Werror as an extra flag during the test: this is needed to make the
@@ -319,10 +320,15 @@ PKG_CHECK_MODULES([URCU], [liburcu >= 0.12])
 # Additional variables captured during ./configure
 
 AC_ARG_VAR([CLASSPATH], [Java class path])
+AC_ARG_VAR([JAVACFLAGS], [Java compiler flags])
+AC_ARG_VAR([JAVAC], [Java compiler])
+AC_ARG_VAR([JAVAFLAGS], [Java VM flags])
+AC_ARG_VAR([JAVA], [Java VM])
+AC_ARG_VAR([JAVAPREFIX], [prefix where Java runtime is installed])
 
 
 ##                              ##
-## Optionnal features selection ##
+## Optional features selection ##
 ##                              ##
 
 # numa integration
@@ -340,10 +346,15 @@ AE_FEATURE([jni-interface], [build JNI interface between C and Java])
 AE_FEATURE_DEFAULT_DISABLE
 AE_FEATURE([java-agent-jul],[build the LTTng UST Java agent with JUL support])
 
-# Build the Java Log4j agent
+# Build the Java Log4j 1.x agent
 # Disabled by default
 AE_FEATURE_DEFAULT_DISABLE
-AE_FEATURE([java-agent-log4j],[build the LTTng UST Java agent with Log4j support])
+AE_FEATURE([java-agent-log4j],[build the LTTng UST Java agent with Log4j 1.x support (deprecated)])
+
+# Build the Java Log4j 2.x agent
+# Disabled by default
+AE_FEATURE_DEFAULT_DISABLE
+AE_FEATURE([java-agent-log4j2],[build the LTTng UST Java agent with Log4j 2.x support])
 
 # Build both Java agents
 # Disabled by default
@@ -380,9 +391,6 @@ AS_HELP_STRING([--with-lttng-system-rundir], [Location of the system directory w
   lttng_system_rundir="/var/run/lttng"
 ])
 
-# Add the java command line arguments like '--wit-java-prefix'
-AX_JAVA_OPTIONS
-
 
 ##                                          ##
 ## Check for conflicting features selection ##
@@ -395,6 +403,7 @@ AE_IF_FEATURE_DISABLED([shared], [
 AE_IF_FEATURE_ENABLED([java-agent-all], [
   AE_FEATURE_ENABLE([java-agent-jul])
   AE_FEATURE_ENABLE([java-agent-log4j])
+  AE_FEATURE_ENABLE([java-agent-log4j2])
 ])
 
 
@@ -404,7 +413,9 @@ AE_IF_FEATURE_ENABLED([java-agent-all], [
 
 # The numa integration requires libnuma
 AE_IF_FEATURE_ENABLED([numa], [
-  AC_CHECK_LIB([numa], [numa_available], [], [
+  AC_CHECK_LIB([numa], [numa_available], [
+    AC_DEFINE([HAVE_LIBNUMA], [1], [Define to 1 if libnuma is available.])
+  ], [
     AC_MSG_ERROR([dnl
 libnuma is not available. Please either install it (e.g. libnuma-dev) or use
 [LDFLAGS]=-Ldir to specify the right location, or use --disable-numa configure
@@ -414,12 +425,13 @@ argument to disable NUMA support.
 ])
 
 # The JNI interface and Java Agents require a working Java JDK
-AS_IF([AE_IS_FEATURE_ENABLED([jni-interface]) || AE_IS_FEATURE_ENABLED([java-agent-jul]) || AE_IS_FEATURE_ENABLED([java-agent-log4j])], [
+AS_IF([AE_IS_FEATURE_ENABLED([jni-interface]) || AE_IS_FEATURE_ENABLED([java-agent-jul]) || \
+    AE_IS_FEATURE_ENABLED([java-agent-log4j]) || AE_IS_FEATURE_ENABLED([java-agent-log4j2])], [
   AX_PROG_JAVAC
   AX_PROG_JAVA
   AX_PROG_JAR
 
-  # Get the CPPFLAGS required to build jni libaries
+  # Get the CPPFLAGS required to build jni libraries
   AX_JNI_INCLUDE_DIR
   for jni_include_dir in $JNI_INCLUDE_DIRS; do
     JNI_CPPFLAGS="$JNI_CPPFLAGS -I$jni_include_dir"
@@ -432,7 +444,7 @@ AS_IF([AE_IS_FEATURE_ENABLED([jni-interface]) || AE_IS_FEATURE_ENABLED([java-age
   CPPFLAGS="$saved_CPPFLAGS"
 ])
 
-# The log4j agent requires the log4j jar in the classpath
+# The log4j 1.x agent requires the log4j jar in the classpath
 AE_IF_FEATURE_ENABLED([java-agent-log4j], [
   AX_CHECK_CLASS([org.apache.log4j.Logger])
   AS_IF([test "x$ac_cv_class_org_apache_log4j_Logger" = "xno"], [
@@ -446,6 +458,21 @@ Current CLASSPATH: "$CLASSPATH"
   ])
 ])
 
+# The log4j 2.x agent requires the log4j core and api jars in the classpath
+AE_IF_FEATURE_ENABLED([java-agent-log4j2], [
+  AX_CHECK_CLASS([org.apache.logging.log4j.Logger])
+  AX_CHECK_CLASS([org.apache.logging.log4j.core.Core])
+  AS_IF([test "x$ac_cv_class_org_apache_logging_log4j_Logger" = "xno" || test "x$ac_cv_class_org_apache_logging_log4j_core_Core" = "xno"], [
+    AC_MSG_ERROR([dnl
+The UST Java agent support for log4j was requested but the Log4j classes were
+not found. Please specify the location of the Log4j API and core 2.x jars via the Java CLASSPATH
+environment variable, e.g. ./configure CLASSPATH="/path/to/log4j-core.jar:/path/to/log4j-api.jar"
+
+Current CLASSPATH: "$CLASSPATH"
+    ])
+  ])
+])
+
 # The python agent requires a python interpreter
 AE_IF_FEATURE_ENABLED([python-agent], [
   AS_IF([test "x$PYTHON" = "x"], [
@@ -524,9 +551,11 @@ AC_DEFINE([LTTNG_UST_CTL_LIB_SONAME_MAJOR], [ust_ctl_lib_version_current], [Majo
 
 AM_CONDITIONAL([ENABLE_EXAMPLES], AE_IS_FEATURE_ENABLED([examples]))
 AM_CONDITIONAL([ENABLE_GEN_TP_EXAMPLES], [test "x$PYTHON" != "x"])
-AM_CONDITIONAL([ENABLE_JAVA_AGENT], AE_IS_FEATURE_ENABLED([java-agent-jul]) || AE_IS_FEATURE_ENABLED([java-agent-log4j]))
+AM_CONDITIONAL([ENABLE_JAVA_AGENT], AE_IS_FEATURE_ENABLED([java-agent-jul]) || AE_IS_FEATURE_ENABLED([java-agent-log4j]) || AE_IS_FEATURE_ENABLED([java-agent-log4j2]))
 AM_CONDITIONAL([ENABLE_JAVA_AGENT_WITH_JUL], AE_IS_FEATURE_ENABLED([java-agent-jul]))
 AM_CONDITIONAL([ENABLE_JAVA_AGENT_WITH_LOG4J], AE_IS_FEATURE_ENABLED([java-agent-log4j]))
+AM_CONDITIONAL([ENABLE_JAVA_AGENT_WITH_LOG4J2], AE_IS_FEATURE_ENABLED([java-agent-log4j2]))
+AM_CONDITIONAL([ENABLE_JAVA_AGENT_WITH_LOG4J_COMMON], AE_IS_FEATURE_ENABLED([java-agent-log4j]) || AE_IS_FEATURE_ENABLED([java-agent-log4j2]))
 AM_CONDITIONAL([ENABLE_JNI_INTERFACE], AE_IS_FEATURE_ENABLED([jni-interface]))
 AM_CONDITIONAL([ENABLE_MAN_PAGES], AE_IS_FEATURE_ENABLED([man-pages]))
 AM_CONDITIONAL([ENABLE_NUMA], AE_IS_FEATURE_ENABLED([numa]))
@@ -575,6 +604,7 @@ AC_CONFIG_FILES([
   doc/examples/Makefile
   doc/Makefile
   doc/man/Makefile
+  extras/Makefile
   include/Makefile
   src/common/Makefile
   src/lib/lttng-ust-common/Makefile
@@ -587,6 +617,7 @@ AC_CONFIG_FILES([
   src/lib/lttng-ust-java-agent/java/lttng-ust-agent-common/Makefile
   src/lib/lttng-ust-java-agent/java/lttng-ust-agent-jul/Makefile
   src/lib/lttng-ust-java-agent/java/lttng-ust-agent-log4j/Makefile
+  src/lib/lttng-ust-java-agent/java/lttng-ust-agent-log4j2/Makefile
   src/lib/lttng-ust-java-agent/java/Makefile
   src/lib/lttng-ust-java-agent/jni/common/Makefile
   src/lib/lttng-ust-java-agent/jni/jul/Makefile
@@ -625,6 +656,7 @@ AC_CONFIG_FILES([
   tests/regression/abi0-conflict/Makefile
   tests/regression/Makefile
   tests/unit/gcc-weak-hidden/Makefile
+  tests/unit/libcommon/Makefile
   tests/unit/libmsgpack/Makefile
   tests/unit/libringbuffer/Makefile
   tests/unit/Makefile
@@ -685,7 +717,10 @@ AE_IS_FEATURE_ENABLED([java-agent-jul]) && value=1 || value=0
 PPRINT_PROP_BOOL_CUSTOM([Java agent (JUL support)], $value, [use --enable-java-agent-jul])
 
 AE_IS_FEATURE_ENABLED([java-agent-log4j]) && value=1 || value=0
-PPRINT_PROP_BOOL_CUSTOM([Java agent (Log4j support)], $value, [use --enable-java-agent-log4j])
+PPRINT_PROP_BOOL_CUSTOM([Java agent (Log4j 1.x support (deprecated))], $value, [use --enable-java-agent-log4j])
+
+AE_IS_FEATURE_ENABLED([java-agent-log4j2]) && value=1 || value=0
+PPRINT_PROP_BOOL_CUSTOM([Java agent (Log4j 2.x support)], $value, [use --enable-java-agent-log4j2])
 
 AE_IS_FEATURE_ENABLED([jni-interface]) && value=1 || value=0
 PPRINT_PROP_BOOL_CUSTOM([JNI interface (JNI)], $value, [use --enable-jni-interface])
This page took 0.026017 seconds and 4 git commands to generate.