-AS_IF([test "x$with_sdt" = "xyes"],[
- AC_MSG_CHECKING([STAP_PROBEV()])
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
- #define SDT_USE_VARIADIC
- #include <sys/sdt.h>
- void fct(void)
- {
- STAP_PROBEV(provider,name,1,2,3,4,5,6,7,8,9,10);
- }
- ]])],[
- AC_MSG_RESULT([yes])
- AC_DEFINE([LTTNG_UST_HAVE_SDT_INTEGRATION], [1])
- ],[
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([The sdt.h integration was requested but the STAP_PROBEV define cannot be used. Make sure it is installed, and up to date, or use CPPFLAGS=-I/path/ to specify a non-standard path to sys/sdt.h])
- ])
+# Override the default runtime directory
+AC_ARG_WITH([lttng-system-rundir], [
+AS_HELP_STRING([--with-lttng-system-rundir], [Location of the system directory where LTTng-UST expects the system-wide lttng-sessiond runtime files. The default is "/var/run/lttng".]),
+], [
+ lttng_system_rundir="$withval"
+], [
+ lttng_system_rundir="/var/run/lttng"
+])
+
+# Add the java command line arguments like '--wit-java-prefix'
+AX_JAVA_OPTIONS
+
+
+## ##
+## Check for conflicting features selection ##
+## ##
+
+AE_IF_FEATURE_DISABLED([shared], [
+ AC_MSG_ERROR(LTTng-UST requires shared libraries to be enabled)
+])
+
+AE_IF_FEATURE_ENABLED([java-agent-all], [
+ AE_FEATURE_ENABLE([java-agent-jul])
+ AE_FEATURE_ENABLE([java-agent-log4j])
+])
+
+
+## ##
+## Check for optional features dependencies ##
+## ##
+
+# The numa integration requires libnuma
+AE_IF_FEATURE_ENABLED([numa], [
+ AC_CHECK_LIB([numa], [numa_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
+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])], [
+ AX_PROG_JAVAC
+ AX_PROG_JAVA
+ AX_PROG_JAR
+
+ # Get the CPPFLAGS required to build jni libaries
+ AX_JNI_INCLUDE_DIR
+ for jni_include_dir in $JNI_INCLUDE_DIRS; do
+ JNI_CPPFLAGS="$JNI_CPPFLAGS -I$jni_include_dir"
+ done
+
+ # Check for javah and jni.h
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $JNI_CPPFLAGS"
+ AX_PROG_JAVAH
+ CPPFLAGS="$saved_CPPFLAGS"
+])
+
+# The log4j 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"], [
+ 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 jar via the Java CLASSPATH
+environment variable, e.g. ./configure CLASSPATH="/path/to/log4j.jar"
+
+Current CLASSPATH: "$CLASSPATH"
+ ])
+ ])
+])
+
+# The python agent requires a python interpreter
+AE_IF_FEATURE_ENABLED([python-agent], [
+ AS_IF([test "x$PYTHON" = "x"], [
+ AC_MSG_ERROR([dnl
+Cannot find a suitable python interpreter. You can override it with the PYTHON
+environment variable.
+ ])
+ ])
+])
+
+# Check for asciidoc and xmlto if we enabled building the man pages.
+AE_IF_FEATURE_ENABLED([man-pages], [
+ AS_IF([test "x$ASCIIDOC" = "x" || test "x$XMLTO" = "x"], [
+ AE_IF_IN_GIT_REPO([
+ # This is an error because we're in the Git repo, which
+ # means the man pages are not already generated for us,
+ # thus asciidoc/xmlto are required because we were asked
+ # to build the man pages.
+ AC_MSG_ERROR([dnl
+Both asciidoc and xmlto are needed to build the LTTng-UST man pages. Use
+--disable-man-pages to disable building the man pages, in which case
+they will not be installed.
+ ])
+ ], [
+ # Only warn here: since we're in the tarball, the man
+ # pages should already be generated at this point, thus
+ # asciidoc/xmlto are not strictly required.
+ warn_prebuilt_man_pages=yes
+ ])
+ ], [
+ have_asciidoc_xmlto=yes
+ ])