Module: sip-router
Branch: master
Commit: 16784302104e5fc40b3873019938d140c402eff6
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1678430…
Author: Ovidiu Sas <osas(a)voipembedded.com>
Committer: Ovidiu Sas <osas(a)voipembedded.com>
Date: Tue Jan 8 13:08:44 2013 -0500
module*/*/Makefile: libcurl dependencies build fixes
---
modules/auth_identity/Makefile | 22 ++++++++++++++++++----
modules/utils/Makefile | 14 +++++++++-----
modules_k/xcap_client/Makefile | 9 +++++++--
3 files changed, 34 insertions(+), 11 deletions(-)
diff --git a/modules/auth_identity/Makefile b/modules/auth_identity/Makefile
index f4974b0..7ff53cf 100644
--- a/modules/auth_identity/Makefile
+++ b/modules/auth_identity/Makefile
@@ -1,16 +1,30 @@
include ../../Makefile.defs
-
auto_gen=
NAME=auth_identity.so
+ifeq ($(CROSS_COMPILE),)
+CURL_BUILDER=$(shell \
+ if pkg-config --exists libcurl; then \
+ echo 'pkg-config libcurl'; \
+ else \
+ which curl-config; \
+ fi)
+endif
+
+ifneq ($(CURL_BUILDER),)
+ DEFS += $(shell $(CURL_BUILDER) --cflags )
+ LIBS += $(shell $(CURL_BUILDER) --libs)
+else
+ DEFS+=-I$(LOCALBASE)/include
+ LIBS+=-L$(LOCALBASE)/lib -lcurl
+endif
+
DEFS+= -Wall -I$(LOCALBASE)/ssl/include
-#
# Dynamic linking
#
-LIBS+= -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib -lssl -lcrypto -lcurl
+LIBS+= -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib -lssl -lcrypto
-#
# Static linking, if you'd like to use TLS and AUTH_IDENTITY at the same time
#
#LIBS+= /usr/lib/libcurl.a /usr/lib/libssl.a /usr/lib/libcrypto.a -lkrb5 -lidn -lz
-lgssapi_krb5 -lrt -lldap
diff --git a/modules/utils/Makefile b/modules/utils/Makefile
index ff34623..4a56e22 100644
--- a/modules/utils/Makefile
+++ b/modules/utils/Makefile
@@ -7,11 +7,15 @@
include ../../Makefile.defs
auto_gen=
NAME=utils.so
-LIBS=
ifeq ($(CROSS_COMPILE),)
XML2CFG=$(shell which xml2-config)
-CURL2CFG=$(shell which curl-config)
+CURL_BUILDER=$(shell \
+ if pkg-config --exists libcurl; then \
+ echo 'pkg-config libcurl'; \
+ else \
+ which curl-config; \
+ fi)
endif
ifneq ($(XML2CFG),)
@@ -23,9 +27,9 @@ else
LIBS+=-L$(LOCALBASE)/lib -lxml2
endif
-ifneq ($(CURL2CFG),)
- DEFS += $(shell $(CURL2CFG) --cflags )
- LIBS += $(shell $(CURL2CFG) --libs)
+ifneq ($(CURL_BUILDER),)
+ DEFS += $(shell $(CURL_BUILDER) --cflags )
+ LIBS += $(shell $(CURL_BUILDER) --libs)
else
DEFS+=-I$(LOCALBASE)/include
LIBS+=-L$(LOCALBASE)/lib -lcurl
diff --git a/modules_k/xcap_client/Makefile b/modules_k/xcap_client/Makefile
index 938d45d..89b3563 100644
--- a/modules_k/xcap_client/Makefile
+++ b/modules_k/xcap_client/Makefile
@@ -10,7 +10,12 @@ auto_gen=
NAME=xcap_client.so
ifeq ($(CROSS_COMPILE),)
-CURLCFG=$(shell which curl-config)
+CURL_BUILDER=$(shell \
+ if pkg-config --exists libcurl; then \
+ echo 'pkg-config libcurl'; \
+ else \
+ which curl-config; \
+ fi)
endif
ifneq ($(CURLCFG),)
@@ -18,7 +23,7 @@ ifneq ($(CURLCFG),)
LIBS += $(shell $(CURLCFG) --libs)
else
DEFS+=-I$(LOCALBASE)/include
- LIBS+=-L$(SYSBASE)/lib -L$(LOCALBASE)/lib -lcurl
+ LIBS+=-L$(LOCALBASE)/lib -lcurl
endif
DEFS+=-DKAMAILIO_MOD_INTERFACE