Module: kamailio
Branch: master
Commit: 88d8aabb748d2c0ab476cea9a4a17eb990b618f7
URL:
https://github.com/kamailio/kamailio/commit/88d8aabb748d2c0ab476cea9a4a17eb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-03-28T10:22:10+02:00
http_async_client: use pkg-config for libevent compile flags detection
- re-enable pkg-config for libcurl
---
Modified: modules/http_async_client/Makefile
---
Diff:
https://github.com/kamailio/kamailio/commit/88d8aabb748d2c0ab476cea9a4a17eb…
Patch:
https://github.com/kamailio/kamailio/commit/88d8aabb748d2c0ab476cea9a4a17eb…
---
diff --git a/modules/http_async_client/Makefile b/modules/http_async_client/Makefile
index 8ebe26f..a9ae495 100644
--- a/modules/http_async_client/Makefile
+++ b/modules/http_async_client/Makefile
@@ -5,24 +5,42 @@ include ../../Makefile.defs
auto_gen=
NAME=http_async_client.so
-#ifeq ($(CROSS_COMPILE),)
-#CURL_BUILDER=$(shell \
-# if pkg-config --exists libcurl; then \
-# echo 'pkg-config libcurl'; \
-# else \
-# which curl-config; \
-# fi)
-#endif
+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 -I$(SYSBASE)/include
- LIBS+=-L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lcurl -levent
+ CURLDEFS += $(shell $(CURL_BUILDER) --cflags)
+ CURLLIBS += $(shell $(CURL_BUILDER) --libs)
+else
+ CURLDEFS+=-I$(LOCALBASE)/include -I$(SYSBASE)/include
+ CURLLIBS+=-L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lcurl -levent
+endif
+
+ifeq ($(CROSS_COMPILE),)
+LEVENT_BUILDER = $(shell \
+ if pkg-config --exists libevent; then \
+ echo 'pkg-config libevent'; \
+ fi)
endif
+ifeq ($(LEVENT_BUILDER),)
+ LEVENTDEFS=-I$(LOCALBASE)/include -I$(SYSBASE)/include
+ LEVENTLIBS=-L$(LOCALBASE)/lib -levent
+else
+ LEVENTDEFS = $(shell $(LEVENT_BUILDER) --cflags)
+ LEVENTLIBS = $(shell $(LEVENT_BUILDER) --libs)
+endif
+
+DEFS+=$(CURLDEFS) $(LEVENTDEFS)
+LIBS=$(CURLLIBS) $(LEVENTLIBS)
+
DEFS+=-DKAMAILIO_MOD_INTERFACE
SERLIBPATH=../../lib