[asterisk-commits] trunk r17628 - in /trunk/res: Makefile
res_config_pgsql.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Wed Apr 5 10:46:12 MST 2006
Author: oej
Date: Wed Apr 5 12:46:09 2006
New Revision: 17628
URL: http://svn.digium.com/view/asterisk?rev=17628&view=rev
Log:
Issue #5637 - Realtime driver for PostgreSQL (mguesdon)
Added:
trunk/res/res_config_pgsql.c
- copied unchanged from r17626, team/oej/res_config_pgsql/res/res_config_pgsql.c
Modified:
trunk/res/Makefile
Modified: trunk/res/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/res/Makefile?rev=17628&r1=17627&r2=17628&view=diff
==============================================================================
--- trunk/res/Makefile (original)
+++ trunk/res/Makefile Wed Apr 5 12:46:09 2006
@@ -43,6 +43,17 @@
endif
endif
+
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include $(CROSS_COMPILE_TARGET)/usr/include/pgsql $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql $(CROSS_COMPILE_TARGET)/opt/pgsql/include $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
+ MODS:=$(filter-out res_config_pgsql.so,$(MODS))
+endif
+
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/net-snmp/net-snmp-config.h),)
+ MODS:=$(filter-out res_snmp.so,$(MODS))
+else
+ SNMP_LDLIBS+=$(shell net-snmp-config --agent-libs)
+endif
+
ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/net-snmp/net-snmp-config.h),)
MODS:=$(filter-out res_snmp.so,$(MODS))
else
@@ -52,6 +63,41 @@
ifeq (${WITH_SMDI},)
MODS:=$(filter-out res_smdi.so,$(MODS))
endif
+
+# Now, go find postgresql libraries
+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql),)
+ CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/include/postgresql
+ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/lib/postgresql
+endif
+
+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include),)
+ CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/pgsql/include
+ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/pgsql/lib
+endif
+
+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql),)
+ CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/include/pgsql
+ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/lib/pgsql
+endif
+
+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql),)
+ CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/pgsql
+ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib/pgsql
+endif
+
+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include),)
+ CFLAGS+=-I$(CROSS_COMPILE_TARGET)/opt/pgsql/include
+ MLFLAGS+=-L$(CROSS_COMPILE_TARGET) /opt/pgsql/lib
+endif
+
+ifneq ($(wilcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql),)
+ CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/include/postgresql
+endif
+
+ifneq ($(wilcard $(CROSS_COMPILE_TARGET)/usr/lib/libpq.so),)
+ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/lib
+endif
+
ifeq (${OSARCH},CYGWIN)
CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
@@ -64,6 +110,8 @@
CRYPTO_LIBS=-lssl -lcrypto
CFLAGS+=
+
+MLFLAGS=
ifndef WITHOUT_ZAPTEL
ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
@@ -128,6 +176,11 @@
res_snmp.so: res_snmp.o snmp/agent.o
$(CC) $(SOLINK) ${SNMP_LDFLAGS} -o $@ ${CYGSOLINK} res_snmp.o snmp/agent.o ${CYGSOLIB} ${SNMP_LDLIBS}
+res_config_pgsql.so: res_config_pgsql.o
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lpq -lz $(MLFLAGS)
+
+
+
ifneq ($(wildcard .depend),)
include .depend
endif
More information about the asterisk-commits
mailing list