[sr-dev] git:master: osp: fix cross-compilation

Ovidiu Sas osas at voipembedded.com
Fri Jan 11 20:18:37 CET 2013


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

Author: Ovidiu Sas <osas at voipembedded.com>
Committer: Ovidiu Sas <osas at voipembedded.com>
Date:   Fri Jan 11 14:13:36 2013 -0500

osp: fix cross-compilation

---

 modules_k/osp/Makefile |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/modules_k/osp/Makefile b/modules_k/osp/Makefile
index 76f93a8..30bde06 100644
--- a/modules_k/osp/Makefile
+++ b/modules_k/osp/Makefile
@@ -6,9 +6,36 @@
 include ../../Makefile.defs
 auto_gen=
 NAME=osp.so
+
+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 += -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 OSP at the same time
+#
+#LIBS+= /usr/lib/libcurl.a /usr/lib/libssl.a /usr/lib/libcrypto.a -lkrb5 -lidn -lz -lgssapi_krb5 -lrt
+
 DEFS+=-D_POSIX_THREADS -I$(LOCALBASE)/include
-LIBS=-L$(LOCALBASE)/lib -losptk -lssl -lcrypto -lpthread -lm
+LIBS+=-L$(LOCALBASE)/lib -losptk -lpthread -lm
 
 DEFS+=-DKAMAILIO_MOD_INTERFACE
 
 include ../../Makefile.modules
+




More information about the sr-dev mailing list