-AC_MSG_CHECKING([whether shared libraries are enabled])
-AS_IF([test "x$enable_shared" = "xyes"],
- [
- AC_MSG_RESULT([yes])
- ],
- [
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([LTTng-UST requires shared libraries to be enabled])
- ])
-
-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"])
-AC_DEFINE_UNQUOTED([LTTNG_SYSTEM_RUNDIR], ["$lttng_system_rundir"],
- [LTTng system runtime directory])
-
-lttnglibjavadir="${libdir}/lttng/java"
-AC_SUBST(lttnglibjavadir)
-
-AM_PATH_PYTHON([2.7],BUILD_GEN_TP_EXAMPLES=1,[:])
-AM_CONDITIONAL([BUILD_GEN_TP_EXAMPLES], [test $BUILD_GEN_TP_EXAMPLES], [Build examples requiring lttng-gen-tp])
+# 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
+ ])
+])
+
+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], [SystemTap integration via sdt.h])
+ ], [
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([dnl
+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
+ ])
+ ])
+])
+
+
+## ##
+## Set defines for optional features conditionnals in the source code ##
+## ##
+
+AC_DEFINE_UNQUOTED([LTTNG_SYSTEM_RUNDIR], ["$lttng_system_rundir"], [LTTng system runtime directory])
+
+# Defined in include/lttng/ust-version.h
+AC_DEFINE([LTTNG_UST_MAJOR_VERSION], ust_version_major, [LTTng UST major version])
+AC_DEFINE([LTTNG_UST_MINOR_VERSION], ust_version_minor, [LTTng UST minor version])
+AC_DEFINE([LTTNG_UST_PATCHLEVEL_VERSION], ust_version_patch, [LTTng UST patch version])
+AC_DEFINE([LTTNG_UST_VERSION], ["]ust_version["], [LTTng UST version string])
+AC_DEFINE([LTTNG_UST_LIB_SONAME_MAJOR], [ust_lib_version_current], [Major SONAME number of liblttng-ust])
+AC_DEFINE([LTTNG_UST_CTL_LIB_SONAME_MAJOR], [ust_ctl_lib_version_current], [Major SONAME number of liblttng-ust-ctl])
+