Fix linking failure when cross-compiling
[lttng-ust.git] / configure.ac
index de6300e1bad7e365b850f238210d52d3ff28509a..894b260200f779d66ccc5e9ddace0d90d9cf7df2 100644 (file)
@@ -124,6 +124,16 @@ AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"])
 
 AC_CHECK_LIB([pthread], [pthread_create])
 
+# 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.
 #AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
 
@@ -146,9 +156,6 @@ AC_C_INLINE
 AC_FUNC_MALLOC
 AC_CHECK_FUNCS([gettimeofday munmap socket strerror strtol sched_getcpu sysconf])
 
-AC_CHECK_FUNCS([dlinfo])
-AM_CONDITIONAL([HAVE_DLINFO], [test "${ac_cv_func_dlinfo}" = "yes"])
-
 CFLAGS="-Wall $CFLAGS"
 
 # URCU
This page took 0.024005 seconds and 4 git commands to generate.