src/modules/db_postgres/Makefile
3175f89b
 #
 # WARNING: do not run this directly, it should be run by the master Makefile
 
80b11a13
 include ../../Makefile.defs
3175f89b
 auto_gen=
11b5019c
 NAME=db_postgres.so
3175f89b
 
c53d4d36
 # set CROSS_COMPILE to true if you want to skip
 # the autodetection
 # CROSS_COMPILE=true
 
b23e8e47
 ifeq ($(CROSS_COMPILE),)
49a34c86
 LIBPQ_BUILDER = $(shell \
b23e8e47
 	if pkg-config --exists libpq; then \
 		echo 'pkg-config libpq'; \
 	fi)
 ifneq ($(LIBPQ_BUILDER),)
49a34c86
 	DEFS += $(shell $(LIBPQ_BUILDER) --cflags)
 	LIBS += $(shell $(LIBPQ_BUILDER) --libs)
b23e8e47
 endif
 endif
 
 ifeq ($(LIBPQ_BUILDER),)
 
c53d4d36
 ifeq ($(CROSS_COMPILE),)
 PGCFG=$(shell which pg_config)
 endif
 
 ifneq ($(PGCFG),)
 	# use autodetection
 	DEFS += -I$(shell $(PGCFG) --includedir)
175934a8
 	LIBS += -L$(shell $(PGCFG) --libdir) -lpq
c53d4d36
 else
 	# use standard know paths
 	# libpq-fe.h locations
 	DEFS +=-I$(LOCALBASE)/include -I$(LOCALBASE)/pgsql/include \
175934a8
 		-I$(SYSBASE)/include/pgsql -I$(SYSBASE)/include/postgresql \
 		-I$(SYSBASE)/include/postgresql/8.0
 	LIBS +=-L$(LOCALBASE)/lib -L$(LOCALBASE)/pgsql/lib \
 		-L$(LOCALBASE)/lib/pgsql -lpq
c53d4d36
 endif
 
b23e8e47
 endif
 
b372a105
 SERLIBPATH=../../lib
b6d503bc
 SER_LIBS=$(SERLIBPATH)/srdb2/srdb2 $(SERLIBPATH)/srdb1/srdb1
b372a105
 
3175f89b
 include ../../Makefile.modules
1c4baf2b
 
 ifeq ($(INSTALL_FLAVOUR),kamailio)
 # extra install for kamailio
 
 install-pgsql-scripts: $(bin_prefix)/$(bin_dir)
cfaaab47
 		PGSQLON=yes $(MAKE) -C ../../../utils/kamctl/ install-modules
1c4baf2b
 
 install-scripts: install-pgsql-scripts
 
 endif # INSTALL_FLAVOUR