+
+## ##
+## 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])
+
+
+## ##
+## Set automake variables for optional feature conditionnals in Makefile.am ##
+## ##
+
+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_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_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]))
+AM_CONDITIONAL([ENABLE_PYTHON_AGENT], AE_IS_FEATURE_ENABLED([python-agent]))
+AM_CONDITIONAL([ENABLE_UST_DL], [test "x$ac_cv_have_decl_RTLD_DI_LINKMAP" = "xyes"])
+AM_CONDITIONAL([HAVE_ASCIIDOC_XMLTO], [test "x$have_asciidoc_xmlto" = "xyes"])
+AM_CONDITIONAL([HAVE_CMAKE], [test "x$CMAKE" != "x"])
+AM_CONDITIONAL([HAVE_CXX], [test "$HAVE_CXX11" = "1"])
+AM_CONDITIONAL([HAVE_JAVAH], [test "x$JAVAH" != "x"])
+AM_CONDITIONAL([HAVE_PERF_EVENT], [test "x$ac_cv_header_linux_perf_event_h" = "xyes"])
+
+
+## ##
+## Substitute variables for use in Makefile.am ##
+## ##
+
+# Library versions for libtool
+AC_SUBST([LTTNG_UST_LIBRARY_VERSION], ust_lib_version)
+AC_SUBST([LTTNG_UST_CTL_LIBRARY_VERSION], ust_ctl_lib_version)
+
+# Major soname for python-lttngust
+AC_SUBST([LTTNG_UST_LIB_SONAME_MAJOR], [ust_lib_version_current])
+
+AM_CFLAGS="$OPT_CFLAGS $WARN_CFLAGS $URCU_CFLAGS $PTHREAD_CFLAGS"
+AC_SUBST(AM_CFLAGS)
+
+AM_CXXFLAGS="$WARN_CXXFLAGS $URCU_CFLAGS $PTHREAD_CFLAGS"
+AC_SUBST(AM_CXXFLAGS)
+
+# The order in which the include folders are searched is important.
+# The top_builddir should always be searched first in the event that a build
+# time generated file is included.
+AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_srcdir)/include -I\$(top_builddir)/src -I\$(top_srcdir)/src -include common/config.h"
+AC_SUBST(AM_CPPFLAGS)
+
+AC_SUBST(JNI_CPPFLAGS)
+
+
+## ##
+## Output files generated by configure ##
+## ##
+
+# List of files to be generated from '.in' templates by AC_OUTPUT
+AC_CONFIG_FILES([
+ Makefile
+ doc/examples/Makefile
+ doc/Makefile
+ doc/man/Makefile
+ include/Makefile
+ src/common/Makefile
+ src/lib/lttng-ust-common/Makefile
+ src/lib/lttng-ust-ctl/Makefile
+ src/lib/lttng-ust-cyg-profile/Makefile
+ src/lib/lttng-ust-dl/Makefile
+ src/lib/lttng-ust-fd/Makefile
+ src/lib/lttng-ust-fork/Makefile
+ src/lib/lttng-ust-java-agent/java/lttng-ust-agent-all/Makefile
+ 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/Makefile
+ src/lib/lttng-ust-java-agent/jni/common/Makefile
+ src/lib/lttng-ust-java-agent/jni/jul/Makefile
+ src/lib/lttng-ust-java-agent/jni/log4j/Makefile
+ src/lib/lttng-ust-java-agent/jni/Makefile
+ src/lib/lttng-ust-java-agent/Makefile
+ src/lib/lttng-ust-java/Makefile
+ src/lib/lttng-ust-libc-wrapper/Makefile
+ src/lib/lttng-ust-pthread-wrapper/Makefile
+ src/lib/lttng-ust-tracepoint/Makefile
+ src/lib/lttng-ust/Makefile
+ src/lib/lttng-ust-python-agent/Makefile
+ src/lib/Makefile
+ src/lib/lttng-ust-ctl.pc
+ src/lib/lttng-ust.pc
+ src/Makefile
+ src/python-lttngust/lttngust/version.py
+ src/python-lttngust/Makefile
+ src/python-lttngust/setup.py
+ tests/benchmark/Makefile
+ tests/compile/api0/ctf-types/Makefile
+ tests/compile/api0/hello.cxx/Makefile
+ tests/compile/api0/hello/Makefile
+ tests/compile/api0/hello-many/Makefile
+ tests/compile/api0/Makefile
+ tests/compile/api0/same_line_tracepoint/Makefile
+ tests/compile/api1/ust-fields/Makefile
+ tests/compile/api1/hello.cxx/Makefile
+ tests/compile/api1/hello/Makefile
+ tests/compile/api1/hello-many/Makefile
+ tests/compile/api1/Makefile
+ tests/compile/api1/same_line_tracepoint/Makefile
+ tests/compile/api1/test-app-ctx/Makefile
+ tests/compile/Makefile
+ tests/Makefile
+ tests/regression/abi0-conflict/Makefile
+ tests/regression/Makefile
+ tests/unit/gcc-weak-hidden/Makefile
+ tests/unit/libmsgpack/Makefile
+ tests/unit/libringbuffer/Makefile
+ tests/unit/Makefile
+ tests/unit/pthread_name/Makefile
+ tests/unit/snprintf/Makefile
+ tests/unit/ust-elf/Makefile
+ tests/unit/ust-error/Makefile
+ tests/unit/ust-utils/Makefile
+ tests/utils/Makefile
+ tools/Makefile