Detect and document dependency on -ldl on Linux, -lc on BSD for dlopen
[lttng-ust.git] / configure.ac
index 00da3e8c6ac78bd3985a0a2846141347c8466ffe..8b79f9a9566b3809eced77d07ac392a1ab5b35c6 100644 (file)
@@ -42,7 +42,23 @@ AC_PROG_MAKE_SET
 LT_INIT
 
 ## Checks for libraries.
-AC_CHECK_LIB([dl], [dlopen])
+AC_CHECK_LIB([dl], [dlopen],
+[
+       have_libdl=yes
+],
+[
+       #libdl not found, check for dlopen in libc.
+       AC_CHECK_LIB([c], [dlopen],
+       [
+               have_libc_dl=yes
+       ],
+       [
+               AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.])
+       ])
+])
+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])
 
 # Check for libuuid
@@ -59,7 +75,7 @@ AC_CHECK_LIB([uuid], [uuid_generate],
                have_libc_uuid=yes
        ],
        [
-               AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify its location.])
+               AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.])
        ])
 ]
 )
This page took 0.023844 seconds and 4 git commands to generate.