configure: Only link -ldl if needed - lightning.git - Portable just-in-time compiler library

index : lightning.git
Portable just-in-time compiler library
summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Cercueil <paul@crapouillou.net>2023年01月20日 16:52:18 +0000
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2023年01月20日 15:22:27 -0300
commit35413a15327fe67e3e7f57286f5d9562e9852b05 (patch)
tree51a4d26fec2e8b39b2d7323ad4df931036b630d3
parent7e919226dd8c8d6b74bcb9564dc2c6f8454ed2cb (diff)
downloadlightning-35413a15327fe67e3e7f57286f5d9562e9852b05.tar.gz
configure: Only link -ldl if needed
Check that the libdl (or libdld) exist and link to it if it does. Otherwise, assume that the dynamic loading functions are provided directly by the C library. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Diffstat
-rw-r--r--configure.ac 15
1 files changed, 10 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index e764808..8100162 100644
--- a/configure.ac
+++ b/configure.ac
@@ -196,11 +196,16 @@ else
fi
AM_CONDITIONAL(strong_type_checking, [test $STRONG_TYPE_CHECKING = yes])
-case "$host_os" in
- *bsd*|osf*) SHLIB="" ;;
- *hpux*) SHLIB="-ldld" ;;
- *) SHLIB="-ldl" ;;
-esac
+AC_CHECK_LIB(dl, dlopen, [HAVE_LIBDL="yes"])
+AC_CHECK_LIB(dld, dlopen, [HAVE_LIBDLD="yes"])
+
+if test "x$HAVE_LIBDL" = xyes; then
+ SHLIB="-ldl";
+elif test "x$HAVE_LIBDLD" = xyes; then
+ SHLIB="-ldld";
+else
+ SHLIB="";
+fi
AC_SUBST(SHLIB)
cpu=
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月17日 21:43:09 +0000

AltStyle によって変換されたページ (->オリジナル) /