[sr-dev] git:master: carrierroute: fix cross-compilation

Ovidiu Sas osas at voipembedded.com
Fri Jan 18 01:24:18 CET 2013


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

Author: Ovidiu Sas <osas at voipembedded.com>
Committer: Ovidiu Sas <osas at voipembedded.com>
Date:   Thu Jan 17 19:19:37 2013 -0500

carrierroute: fix cross-compilation

---

 modules/carrierroute/Makefile |   28 +++++++++++-----------------
 1 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/modules/carrierroute/Makefile b/modules/carrierroute/Makefile
index d4bc7bc..b06441a 100644
--- a/modules/carrierroute/Makefile
+++ b/modules/carrierroute/Makefile
@@ -10,28 +10,22 @@ auto_gen=
 NAME=carrierroute.so
 
 ifeq ($(CROSS_COMPILE),)
-BUILDER = $(shell which confuse-config)
+CONFUSE_BUILDER = $(shell \
+	if which confuse-config &>/dev/null;then \
+		echo 'confuse-config'; \
+	elif pkg-config --exists libconfuse; then \
+		echo 'pkg-config libconfuse'; \
+	fi)
 endif
 
-ifeq ($(BUILDER),)
-	ifeq ($(CROSS_COMPILE),)
-	BUILDER = $(shell which pkg-config)
-	endif
-	ifeq ($(BUILDER),)
-		CONFUSEDEFS=-I$(LOCALBASE)/include
-		CONFUSELIBS=-L$(LOCALBASE)/lib -lconfuse
-	else
-		CONFUSEDEFS = $(shell pkg-config --cflags libconfuse)
-		CONFUSELIBS = $(shell pkg-config --libs libconfuse)
-	endif
+ifeq ($(CONFUSE_BUILDER),)
+	DEFS += -I$(LOCALBASE)/include
+	LIBS += -L$(LOCALBASE)/lib -lconfuse
 else
-		CONFUSEDEFS = $(shell confuse-config --cflags)
-		CONFUSELIBS = $(shell confuse-config --libs)
+	DEFS += $(shell $(CONFUSE_BUILDER) --cflags)
+	LIBS += $(shell $(CONFUSE_BUILDER) --libs)
 endif
 
-DEFS+=$(CONFUSEDEFS)
-LIBS=$(CONFUSELIBS)
-
 DEFS+=-DKAMAILIO_MOD_INTERFACE
 
 SERLIBPATH=../../lib




More information about the sr-dev mailing list