[Pkg-voip-commits] [pjproject] 26/45: Reduce number of libraries linked with pjlib

Jonas Smedegaard dr at jones.dk
Tue Jun 7 22:01:24 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository pjproject.

commit 07bd3e90c8832e955b9779b3183ef8349e66661d
Author: Jeremy Lainé <jeremy.laine at m4x.org>
Date:   Thu Oct 30 08:09:42 2014 +0200

    Reduce number of libraries linked with pjlib
    
    All libraries and applications were gratuitously linked against
    libcrypto, libssl and libuuid, but only libpj needs them.
---
 aconfigure.ac        | 7 ++++---
 build.mak.in         | 2 ++
 pjlib/build/Makefile | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/aconfigure.ac b/aconfigure.ac
index 0f0e201..214284d 100644
--- a/aconfigure.ac
+++ b/aconfigure.ac
@@ -113,7 +113,8 @@ AC_CHECK_LIB(winmm,puts)
 AC_CHECK_LIB(socket,puts)
 AC_CHECK_LIB(rt,puts)
 AC_CHECK_LIB(m,sin)
-AC_CHECK_LIB(uuid,uuid_generate)
+AC_SUBST(PJLIB_EXT)
+AC_CHECK_LIB(uuid,uuid_generate,[PJLIB_EXT="-luuid $PJLIB_EXT"])
 AC_CHECK_LIB(uuid,uuid_generate,[ac_has_uuid_lib=1])
 AC_SEARCH_LIBS(gethostbyname,nsl)
 
@@ -1618,8 +1619,8 @@ AC_ARG_ENABLE(ssl,
 		AC_SUBST(libssl_present)
 		AC_SUBST(libcrypto_present)
 		AC_CHECK_HEADER(openssl/ssl.h,[openssl_h_present=1])
-		AC_CHECK_LIB(crypto,ERR_load_BIO_strings,[libcrypto_present=1 && LIBS="-lcrypto $LIBS"])
-		AC_CHECK_LIB(ssl,SSL_library_init,[libssl_present=1 && LIBS="-lssl $LIBS"])
+		AC_CHECK_LIB(crypto,ERR_load_BIO_strings,[libcrypto_present=1 && PJLIB_EXT="-lcrypto $PJLIB_EXT"])
+		AC_CHECK_LIB(ssl,SSL_library_init,[libssl_present=1 && PJLIB_EXT="-lssl $PJLIB_EXT"])
 		if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then
 	        	AC_MSG_RESULT([OpenSSL library found, SSL support enabled])
 			# PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK
diff --git a/build.mak.in b/build.mak.in
index 074977d..1add583 100644
--- a/build.mak.in
+++ b/build.mak.in
@@ -28,6 +28,8 @@ export APP_THIRD_PARTY_EXT :=
 export APP_THIRD_PARTY_LIBS :=
 export APP_THIRD_PARTY_LIB_FILES :=
 
+PJLIB_EXT = @PJLIB_EXT@
+
 ifeq (@ac_external_srtp@,1)
 # External SRTP library
 APP_THIRD_PARTY_EXT += -lsrtp
diff --git a/pjlib/build/Makefile b/pjlib/build/Makefile
index 1e64950..2bd2b90 100644
--- a/pjlib/build/Makefile
+++ b/pjlib/build/Makefile
@@ -39,7 +39,7 @@ export PJLIB_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
 	string.o timer.o types.o
 export PJLIB_CFLAGS += $(_CFLAGS)
 export PJLIB_CXXFLAGS += $(_CXXFLAGS)
-export PJLIB_LDFLAGS += $(_LDFLAGS)
+export PJLIB_LDFLAGS += $(PJLIB_EXT) $(_LDFLAGS)
 
 ###############################################################################
 # Defines for building test application

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/pjproject.git



More information about the Pkg-voip-commits mailing list