ソースを参照

module*/*/Makefile: libcurl dependencies build fixes

Ovidiu Sas 12 年 前
コミット
1678430210
3 ファイル変更34 行追加11 行削除
  1. 18 4
      modules/auth_identity/Makefile
  2. 9 5
      modules/utils/Makefile
  3. 7 2
      modules_k/xcap_client/Makefile

+ 18 - 4
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

+ 9 - 5
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

+ 7 - 2
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