summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2020-04-27 01:40:25 +0000
committerDmitry V. Levin <ldv@altlinux.org>2020-04-27 01:40:25 +0000
commit275eaa0a17dbefb18e48d8b649aa3156d892cbcc (patch)
tree1c0871af7dfa90e18cb8a1a46fcf8145ff25688d
parentae2ccf5053b171dff644dd339338b0fde00f83a2 (diff)
configure: fix dlopen check
* configure.ac: Check for the library providing dlopen using AC_SEARCH_LIBS instead of AC_CHECK_LIB to handle the case when dlopen is a part of libc.
-rw-r--r--configure.ac11
1 files changed, 9 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 090e45fa..91b68838 100644
--- a/configure.ac
+++ b/configure.ac
@@ -364,8 +364,15 @@ if test x$pam_xauth_path != x ; then
[Additional path of xauth executable])
fi
-dnl Checks for the existence of libdl - on BSD and Tru64 its part of libc
-AC_CHECK_LIB([dl], [dlopen], LIBDL="-ldl", LIBDL="")
+dnl Checks for the existence of libdl - in musl its a part of libc
+saved_LIBS="$LIBS"
+AC_SEARCH_LIBS([dlopen], [dl])
+LIBS="$saved_LIBS"
+case "$ac_cv_search_dlopen" in
+ no) AC_MSG_FAILURE([failed to find dlopen]) ;;
+ -l*) LIBDL="$ac_cv_search_dlopen" ;;
+ *) LIBDL= ;;
+esac
AC_SUBST(LIBDL)
# Check for cracklib