-AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"])
-AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"])
-
-AC_CHECK_LIB([pthread], [pthread_create])
-AC_CHECK_LIB([pthread], [pthread_setname_np],
- AC_DEFINE([HAVE_PTHREAD_SETNAME_NP], [1], [Define to 1 if pthread_setname_np is available.]),
- AC_CHECK_LIB([pthread], [pthread_set_name_np],
- AC_DEFINE([HAVE_PTHREAD_SET_NAME_NP], [1], [Define to 1 if pthread_set_name_np is available.]),
- AC_MSG_RESULT([pthread setname/set_name not found.])))
-
-# Check for dlfcn.h
-AC_CHECK_HEADER([dlfcn.h])
-AS_IF([test "x${ac_cv_header_dlfcn_h}" = "xyes"], [
- AC_CHECK_DECLS([RTLD_DI_LINKMAP], [], [], [
- #define _GNU_SOURCE /* Required on Linux to get GNU extensions */
- #include <dlfcn.h>
- ])
-], [
- ac_cv_have_decl_RTLD_DI_LINKMAP="no"
-])
-
-AM_CONDITIONAL([HAVE_DLINFO], [test "x${ac_cv_have_decl_RTLD_DI_LINKMAP}" = "xyes"])
-
-# Checks for header files.
-dnl AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_C_INLINE
-dnl AC_TYPE_INT16_T
-dnl AC_TYPE_INT32_T
-dnl AC_TYPE_INT64_T
-dnl AC_TYPE_INT8_T
-dnl AC_TYPE_PID_T
-dnl AC_TYPE_SIZE_T
-dnl AC_TYPE_SSIZE_T
-dnl AC_TYPE_UINT16_T
-dnl AC_TYPE_UINT32_T
-dnl AC_TYPE_UINT64_T
-dnl AC_TYPE_UINT8_T
-dnl AC_CHECK_TYPES([ptrdiff_t])
-
-# Checks for library functions.
-AC_FUNC_MALLOC
-AC_CHECK_FUNCS([gettimeofday munmap socket strerror strtol sched_getcpu sysconf])
-
-CFLAGS="-Wall $CFLAGS"
+# 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])]
+)