diff --git a/m4/openssl.m4 b/m4/openssl.m4 index 5d91a789..d9f8e163 100644 --- a/m4/openssl.m4 +++ b/m4/openssl.m4 @@ -29,8 +29,11 @@ AC_DEFUN(tinc_OPENSSL, [AC_MSG_ERROR("OpenSSL libraries not found.")] ) - AC_CHECK_LIB(dl, dlopen, - [LIBS="$LIBS -ldl"], - [AC_MSG_ERROR("OpenSSL depends on libdl.")] + AC_CHECK_FUNC(dlopen, + [], + AC_CHECK_LIB(dl, dlopen, + [LIBS="$LIBS -ldl"], + [AC_MSG_ERROR("OpenSSL depends on libdl.")] + ) ) ])