| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
include ../../Makefile.defs |
| 5 |
auto_gen= |
| 6 |
NAME=db_postgres.so |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
ifeq ($(CROSS_COMPILE),) |
| 13 |
LIBPQ_BUILDER = $(shell \ |
| 14 |
if pkg-config --exists libpq; then \ |
| 15 |
echo 'pkg-config libpq'; \ |
| 16 |
fi) |
| 17 |
ifneq ($(LIBPQ_BUILDER),) |
| 18 |
DEFS += $(shell $(LIBPQ_BUILDER) --cflags) |
| 19 |
LIBS += $(shell $(LIBPQ_BUILDER) --libs) |
| 20 |
endif |
| 21 |
endif |
| 22 |
|
| 23 |
ifeq ($(LIBPQ_BUILDER),) |
| 24 |
|
| 25 |
ifeq ($(CROSS_COMPILE),) |
| 26 |
PGCFG=$(shell which pg_config) |
| 27 |
endif |
| 28 |
|
| 29 |
ifneq ($(PGCFG),) |
| 30 |
# use autodetection |
| 31 |
DEFS += -I$(shell $(PGCFG) --includedir) |
| 32 |
LIBS += -L$(shell $(PGCFG) --libdir) -lpq |
| 33 |
else |
| 34 |
# use standard know paths |
| 35 |
# libpq-fe.h locations |
| 36 |
DEFS +=-I$(LOCALBASE)/include -I$(LOCALBASE)/pgsql/include \ |
| 37 |
-I$(SYSBASE)/include/pgsql -I$(SYSBASE)/include/postgresql \ |
| 38 |
-I$(SYSBASE)/include/postgresql/8.0 |
| 39 |
LIBS +=-L$(LOCALBASE)/lib -L$(LOCALBASE)/pgsql/lib \ |
| 40 |
-L$(LOCALBASE)/lib/pgsql -lpq |
| 41 |
endif |
| 42 |
|
| 43 |
endif |
| 44 |
|
| 45 |
include ../../Makefile.modules |
| 46 |
|
| 47 |
ifeq ($(INSTALL_FLAVOUR),kamailio) |
| 48 |
|
| 49 |
|
| 50 |
install-pgsql-scripts: $(bin_prefix)/$(bin_dir) |
| 51 |
PGSQLON=yes $(MAKE) -C ../../../utils/kamctl/ install-modules |
| 52 |
|
| 53 |
install-scripts: install-pgsql-scripts |
| 54 |
|
| 55 |
endif |