Module: sip-router
Branch: master
Commit: d18997cd35d3ac03f446a61a7f198eb1b0704bd0
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d18997c…
Author: Ovidiu Sas <osas(a)voipembedded.com>
Committer: Ovidiu Sas <osas(a)voipembedded.com>
Date: Fri Jan 11 14:13:07 2013 -0500
websocket: fix cross-compilation
---
modules/websocket/Makefile | 32 +++++++++++++++++++++++---------
1 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/modules/websocket/Makefile b/modules/websocket/Makefile
index d11f3a3..bb7c809 100644
--- a/modules/websocket/Makefile
+++ b/modules/websocket/Makefile
@@ -7,17 +7,31 @@ include ../../Makefile.defs
auto_gen=
NAME=websocket.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+= -lunistring
+
+LIBS+= $(TLS_EXTRA_LIBS) -lunistring
+
+# Static linking, if you'd like to use TLS and WEBSOCKET 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