[sr-dev] git:5.3:41967543: Makefile.defs: Only add -ldl on systems that use it

Daniel-Constantin Mierla miconda at gmail.com
Thu Mar 19 19:24:25 CET 2020


Module: kamailio
Branch: 5.3
Commit: 41967543be401413f5a93682ea537e2e7824ac3b
URL: https://github.com/kamailio/kamailio/commit/41967543be401413f5a93682ea537e2e7824ac3b

Author: Greg Troxel <gdt at lexort.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-03-19T19:20:26+01:00

Makefile.defs: Only add -ldl on systems that use it

kamailio uses dlopen, and on some systems, one must link with -ldl.
On others, this is not needed and there is no libdl.  For now, simply
omit -ldl on NetBSD (which doesn't have or require it), and don't try
to change behavior on other systems.

(cherry picked from commit bca9768b6f2667bad8472fa99a113b8249ca0f9a)

---

Modified: src/Makefile.defs

---

Diff:  https://github.com/kamailio/kamailio/commit/41967543be401413f5a93682ea537e2e7824ac3b.diff
Patch: https://github.com/kamailio/kamailio/commit/41967543be401413f5a93682ea537e2e7824ac3b.patch

---

diff --git a/src/Makefile.defs b/src/Makefile.defs
index a57bc2b91e..41f33a51a0 100644
--- a/src/Makefile.defs
+++ b/src/Makefile.defs
@@ -210,9 +210,18 @@ endif
 
 endif
 
+# dlopen requires -ldl on some systems, but not others.  Until there
+# is clarity on which require -ldl, add just enough ifeq to fix
+# systems known not to use it.
+ifeq ($(OS), netbsd)
+LIBDL=""
+else
+LIBDL="-ldl"
+endif
+
 ifeq ($(LIBSSL_SET_MUTEX_SHARED), 1)
 CC_PMUTEX_OPTS = -pthread -DKSR_PTHREAD_MUTEX_SHARED
-LD_PMUTEX_OPTS = -pthread -rdynamic -ldl -Wl,-Bsymbolic-functions
+LD_PMUTEX_OPTS = -pthread -rdynamic $(LIBDL) -Wl,-Bsymbolic-functions
 else
 CC_PMUTEX_OPTS =
 LD_PMUTEX_OPTS =




More information about the sr-dev mailing list