Module: sip-router
Branch: master
Commit: 35d8fd13382fc5fa6256f17a0f43c396be7c638d
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=35d8fd13382fc5fa6256f17a0f43c396be7c638d

Author: Ovidiu Sas <[email protected]>
Committer: Ovidiu Sas <[email protected]>
Date:   Fri Jan 11 14:13:53 2013 -0500

outbound: fix cross-compilation

---

 modules_k/outbound/Makefile |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/modules_k/outbound/Makefile b/modules_k/outbound/Makefile
index e877c04..a4c7a73 100644
--- a/modules_k/outbound/Makefile
+++ b/modules_k/outbound/Makefile
@@ -7,17 +7,31 @@ include ../../Makefile.defs
 auto_gen=
 NAME=outbound.so
 
-BUILDER = $(shell which pkg-config)
-ifeq ($(BUILDER),)
-        DEFS+= -I$(LOCALBASE)/ssl/include
-        LIBS=  -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib \
-                       -L$(LOCALBASE)/lib64 -L$(LOCALBASE)/ssl/lib64 \
-                       -lssl
+ifeq ($(CROSS_COMPILE),)
+SSL_BUILDER=$(shell \
+       if pkg-config --exists libssl; then \
+               echo 'pkg-config libssl'; \
+       fi)
+endif
+
+ifneq ($(SSL_BUILDER),)
+       DEFS += $(shell $(SSL_BUILDER) --cflags)
+       LIBS += $(shell $(SSL_BUILDER) --libs)
 else
-       DEFS+= $(shell pkg-config --cflags libssl)
-       LIBS=  $(shell pkg-config --libs libssl)
+       DEFS += -I$(LOCALBASE)/ssl/include
+       LIBS += -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib \
+                       -L$(LOCALBASE)/lib64 -L$(LOCALBASE)/ssl/lib64 \
+                       -lssl -lcrypto
+       # NOTE: depending on the way in which libssl was compiled you might
+       #       have to add -lz -lkrb5   (zlib and kerberos5).
+       #       E.g.: make TLS_HOOKS=1 TLS_EXTRA_LIBS="-lz -lkrb5"
 endif
 
+LIBS+= $(TLS_EXTRA_LIBS)
+
+# Static linking, if you'd like to use TLS and OUTBOUND at the same time
+#
+#LIBS+= /usr/lib/libcurl.a /usr/lib/libssl.a /usr/lib/libcrypto.a -lkrb5 -lidn 
-lz -lgssapi_krb5 -lrt
 DEFS+=-DKAMAILIO_MOD_INTERFACE
 
 SERLIBPATH=../../lib


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to