[sr-dev] git:master:ae882fa9: rabbitmq: use pkg-config if available to get the path for cflags and libs

Daniel-Constantin Mierla miconda at gmail.com
Mon Sep 19 15:20:14 CEST 2016


Module: kamailio
Branch: master
Commit: ae882fa9e9848747a5f78052725324302272f80a
URL: https://github.com/kamailio/kamailio/commit/ae882fa9e9848747a5f78052725324302272f80a

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-09-19T15:19:51+02:00

rabbitmq: use pkg-config if available to get the path for cflags and libs

---

Modified: modules/rabbitmq/Makefile

---

Diff:  https://github.com/kamailio/kamailio/commit/ae882fa9e9848747a5f78052725324302272f80a.diff
Patch: https://github.com/kamailio/kamailio/commit/ae882fa9e9848747a5f78052725324302272f80a.patch

---

diff --git a/modules/rabbitmq/Makefile b/modules/rabbitmq/Makefile
index f4667de..9b26c4e 100644
--- a/modules/rabbitmq/Makefile
+++ b/modules/rabbitmq/Makefile
@@ -5,9 +5,22 @@ auto_gen=
 NAME=rabbitmq.so
 LIBS=
 
-DEFS+=-DKAMAILIO_MOD_INTERFACE
-LIBS+=-lrabbitmq
+ifeq ($(CROSS_COMPILE),)
+RMQ_BUILDER=$(shell \
+	if pkg-config --exists librabbitmq; then \
+		echo 'pkg-config librabbitmq'; \
+	fi)
+endif
+
+ifneq ($(RMQ_BUILDER),)
+	DEFS += $(shell $(RMQ_BUILDER) --cflags)
+	LIBS += $(shell $(RMQ_BUILDER) --libs)
+else
+	DEFS+=-I$(LOCALBASE)/include
+	LIBS+=-L$(SYSBASE)/include/lib -L$(LOCALBASE)/lib -lrabbitmq
+endif
 
+DEFS+=-DKAMAILIO_MOD_INTERFACE
 
 SERLIBPATH=../../lib
 SER_LIBS+=$(SERLIBPATH)/kcore/kcore




More information about the sr-dev mailing list