Module: sip-router Branch: master Commit: a0ef714c12d9d9ae4cf152d6a62bd8a7d6bb5c34 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a0ef714c...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Mon Mar 24 10:11:59 2014 +0100
db_unixodbc: use odbc_config to find paths for include and libs
---
modules/db_unixodbc/Makefile | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/modules/db_unixodbc/Makefile b/modules/db_unixodbc/Makefile index 3754d4e..6661a65 100644 --- a/modules/db_unixodbc/Makefile +++ b/modules/db_unixodbc/Makefile @@ -6,12 +6,24 @@ include ../../Makefile.defs auto_gen= NAME=db_unixodbc.so
-# sql.h locations (freebsd,openbsd solaris) -DEFS += -I$(LOCALBASE)/include +ifeq ($(CROSS_COMPILE),) +ODBCCFG=$(shell which odbc_config) +endif
-# libodbc locations on RH/Suse, Solaris /OpenBSD, FreeBSD -# (Debian does the right thing and puts it in /usr/lib) -LIBS= -L$(LOCALBASE)/lib -lodbc +ifneq ($(ODBCCFG),) + + DEFS += $(shell $(ODBCCFG) --cflags ) + LIBS += $(shell $(ODBCCFG) --libs) + +else + + # sql.h locations (freebsd,openbsd solaris) + DEFS += -I$(LOCALBASE)/include + + # libodbc locations on RH/Suse, Solaris /OpenBSD, FreeBSD + # (Debian does the right thing and puts it in /usr/lib) + LIBS= -L$(LOCALBASE)/lib -lodbc +endif
DEFS+=-DKAMAILIO_MOD_INTERFACE