Skip to content

Commit

Permalink
Makefile.defs: Only add -ldl on systems that use it
Browse files Browse the repository at this point in the history
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 bca9768)
  • Loading branch information
gdt authored and miconda committed Mar 19, 2020
1 parent 7597685 commit 4196754
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Makefile.defs
Expand Up @@ -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 =
Expand Down

0 comments on commit 4196754

Please sign in to comment.