+# Set os specific options
+AS_CASE([$host_os],
+ [freebsd*], [NO_NUMA=1]
+)
+
+# Configuration options, which will be installed in the config.h
+AH_TEMPLATE([LTTNG_UST_HAVE_SDT_INTEGRATION], [SystemTap integration via sdt.h])
+
+# Checks for libraries.
+AC_CHECK_LIB([dl], [dlopen], [
+ libdl_name=dl
+ DL_LIBS="-ldl"
+], [
+ #libdl not found, check for dlopen 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 support.
+AH_TEMPLATE([HAVE_DLMOPEN], ["Define to 1 if dlmopen is available."])
+AC_CHECK_LIB([$libdl_name], [dlmopen],
+ [AC_DEFINE([HAVE_DLMOPEN], [1])]
+)
+
+AM_CONDITIONAL([ENABLE_UST_DL], [test "x${ac_cv_have_decl_RTLD_DI_LINKMAP}" = "xyes"])
+
+# Require URCU >= 0.12 for DEFINE_URCU_TLS_INIT
+PKG_CHECK_MODULES([URCU], [liburcu >= 0.12])
+
+# numa.h integration
+AS_IF([test "x$NO_NUMA" = "x1"],[
+ AS_IF([test "x$enable_numa" = "x" ], [enable_numa=no])