+AM_PROG_AR
+AC_PROG_SED
+AC_PROG_GREP
+AC_PROG_LN_S
+AC_PROG_MKDIR_P
+AC_PROG_MAKE_SET
+AC_CHECK_PROGS([ASCIIDOC], [asciidoc])
+AC_CHECK_PROGS([CMAKE], [cmake])
+AC_CHECK_PROGS([FOLD], [fold])
+AC_CHECK_PROGS([XMLTO], [xmlto])
+
+AM_PATH_PYTHON([2.7], [], [PYTHON=""])
+
+# Initialize and configure libtool
+LT_INIT([disable-static])
+
+
+## ##
+## Library checks ##
+## ##
+
+AC_FUNC_CHOWN
+AC_FUNC_FORK
+AC_FUNC_MMAP
+AC_FUNC_STRERROR_R
+AC_FUNC_STRNLEN
+AC_CHECK_FUNCS([ \
+ atexit \
+ clock_gettime \
+ ftruncate \
+ getpagesize \
+ gettid \
+ gettimeofday \
+ localeconv \
+ memchr \
+ memmove \
+ memset \
+ mkdir \
+ munmap \
+ realpath \
+ sched_getcpu \
+ socket \
+ strchr \
+ strdup \
+ strerror \
+ strtol \
+ strtoul \
+ sysconf \
+])
+
+# AC_FUNC_MALLOC causes problems when cross-compiling.
+#AC_FUNC_MALLOC
+#AC_FUNC_REALLOC
+
+# Check for pthread_setname_np and its signature
+LTTNG_PTHREAD_SETNAME_NP
+LTTNG_PTHREAD_GETNAME_NP
+
+# Check dor dlopen() in -ldl or -lc
+AC_CHECK_LIB([dl], [dlopen], [
+ libdl_name=dl
+ DL_LIBS="-ldl"
+], [
+ # dlopen not found in libdl, check in libc
+ AC_CHECK_LIB([c], [dlopen], [
+ libdl_name=c
+ DL_LIBS="-lc"
+ ], [
+ AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.])
+ ])
+])
+AC_SUBST(DL_LIBS)
+
+# Check if libdl has dlmopen()
+AC_CHECK_LIB([$libdl_name], [dlmopen], [
+ AC_DEFINE([HAVE_DLMOPEN], [1], [Define to 1 if dlmopen is available.])
+])
+
+# Require URCU >= 0.12 for DEFINE_URCU_TLS_INIT
+PKG_CHECK_MODULES([URCU], [liburcu >= 0.12])
+
+
+## ##
+## User variables ##
+## ##
+
+# Additional variables captured during ./configure
+
+AC_ARG_VAR([CLASSPATH], [Java class path])
+
+
+## ##
+## Optional features selection ##
+## ##
+
+# numa integration
+# Enabled by default, except on some platforms
+AE_FEATURE_DEFAULT_ENABLE
+AE_FEATURE([numa],[disable NUMA support])
+
+# Java JNI interface library
+# Disabled by default
+AE_FEATURE_DEFAULT_DISABLE
+AE_FEATURE([jni-interface], [build JNI interface between C and Java])
+
+# Build the Java Logging API agent
+# Disabled by default
+AE_FEATURE_DEFAULT_DISABLE
+AE_FEATURE([java-agent-jul],[build the LTTng UST Java agent with JUL support])
+
+# Build the Java Log4j agent
+# Disabled by default
+AE_FEATURE_DEFAULT_DISABLE
+AE_FEATURE([java-agent-log4j],[build the LTTng UST Java agent with Log4j support])
+
+# Build both Java agents
+# Disabled by default
+AE_FEATURE_DEFAULT_DISABLE
+AE_FEATURE([java-agent-all],[build the LTTng UST Java agent with all supported backends])
+
+# Build the Python agent
+# Disabled by default
+AE_FEATURE_DEFAULT_DISABLE
+AE_FEATURE([python-agent],[build the LTTng UST Python agent])
+
+# Build the examples
+# Disabled by default
+AE_FEATURE_DEFAULT_ENABLE
+AE_FEATURE([examples],[Do not build and install examples])
+
+# Man pages
+# Enabled by default
+AE_FEATURE_DEFAULT_ENABLE
+AE_FEATURE([man-pages],[Do not build and install man pages (already built in a distributed tarball)])
+
+# Systemtap sdt.h integration
+# Disabled by default
+AC_ARG_WITH([sdt],
+ [AS_HELP_STRING([--with-sdt], [provide SystemTap integration via sdt.h [default=no]])]