Update librseq to co-exist with glibc rseq integration
[librseq.git] / configure.ac
index e52697698bd88503f069dec89c5581fc96b10b70..c13be33aa022615ed1e65fbcee6d1e606d865a8a 100644 (file)
@@ -125,6 +125,20 @@ AC_CHECK_FUNCS([ \
 # AC_FUNC_MALLOC causes problems when cross-compiling.
 #AC_FUNC_MALLOC
 
+# Check dor dlopen() in -ldl or -lc
+AC_CHECK_LIB([dl], [dlopen], [
+  libdl_name=dl
+  DL_LIBS="-ldl"
+], [
+  # dlopen not found in libdl, check 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)
 
 ##                                             ##
 ## Substitute variables for use in Makefile.am ##
This page took 0.051835 seconds and 4 git commands to generate.