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

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

tls: fix ssl cross-compilation

---

 modules/tls/Makefile |   35 ++++++++++++++---------------------
 1 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/modules/tls/Makefile b/modules/tls/Makefile
index 679b37c..ed218d6 100644
--- a/modules/tls/Makefile
+++ b/modules/tls/Makefile
@@ -9,40 +9,32 @@ include ../../Makefile.defs
 auto_gen=
 NAME=tls.so
 
-CFLASFOUND = 0
-
 ifeq ($(CROSS_COMPILE),)
-BUILDER = $(shell which pkg-config)
-endif
-
-ifneq ($(BUILDER),)
-       ifeq ($(CROSS_COMPILE),)
-       SSLLIBS = $(shell pkg-config --silence-errors --libs libssl)
-       endif
-       ifneq ($(SSLLIBS),)
-               DEFS+= $(shell pkg-config --silence-errors --cflags libssl)
-               LIBS+= $(shell pkg-config --silence-errors --libs libssl)
-               LIBS+= $(TLS_EXTRA_LIBS)
-               CFLASFOUND = 1
-       endif
+SSL_BUILDER=$(shell \
+       if pkg-config --exists libssl; then \
+               echo 'pkg-config libssl'; \
+       fi)
 endif
 
-ifeq ($(CFLASFOUND),0)
-       DEFS+= -I$(LOCALBASE)/ssl/include
-       LIBS+=  -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib \
+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 \
-                       $(TLS_EXTRA_LIBS)
+                       -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)
+
 # dcm: tls.cfg installed via local 'install-cfg' to update paths
 #MOD_INSTALL_CFGS=tls.cfg
 
 DEFS+=-DKAMAILIO_MOD_INTERFACE
-
 include ../../Makefile.modules
 
 
@@ -60,3 +52,4 @@ install-cfg:  install-tls-cert
                mv -f "$(cfg_prefix)/$(cfg_dir)tls.cfg.sample" \
                                                
"$(cfg_prefix)/$(cfg_dir)tls.cfg" ; \
        fi
+


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

Reply via email to