AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Have clock_gettime])],
[AC_DEFINE([HAVE_CLOCK_GETTIME],[0],[Have clock_gettime])])
-# Check for the ability to call dlopen
+# Check for the ability to call dlopen (used in libhostile)
AS_IF([test "x$enable_shared" = xyes],
- [AC_CHECK_LIB([dl],[dlopen],
- [AC_SUBST([DL_LIB],[-ldl])
- AC_DEFINE([HAVE_LIBDL],[1],[Have dlopen])])],
- [AC_DEFINE([HAVE_LIBDL],[0],[Have dlopen])])
+ [AX_CHECK_LIBRARY([DL],[dlfcn.h],[dl],
+ [AC_DEFINE([HAVE_LIBDL],[1],[Have dlopen])
+ AC_CHECK_LIB([dl],[dlopen],[AC_DEFINE([HAVE_DLOPEN],[1],[Have dlopen])])
+ AC_CHECK_LIB([dl],[dladdr],[AC_DEFINE([HAVE_DLADDR],[1],[Have dladdr])])])
+ ])
AC_CHECK_HEADERS([atomic.h])
AS_IF([test "x$ac_cv_header_atomic_h" = "xyes"],