Module: kamailio
Branch: 5.2
Commit: 8662b187a9a3df0bd2ac683b56bb512987487081
URL:
https://github.com/kamailio/kamailio/commit/8662b187a9a3df0bd2ac683b56bb512…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-04-03T11:44:30+02:00
db_postgres: try to use pkg-config for lib paths
- GH #1915
(cherry picked from commit b23e8e47474d9c25c6de0f6c3da07ae43b85ad8a)
---
Modified: src/modules/db_postgres/Makefile
---
Diff:
https://github.com/kamailio/kamailio/commit/8662b187a9a3df0bd2ac683b56bb512…
Patch:
https://github.com/kamailio/kamailio/commit/8662b187a9a3df0bd2ac683b56bb512…
---
diff --git a/src/modules/db_postgres/Makefile b/src/modules/db_postgres/Makefile
index f3a0f6eba9..2663ee7515 100644
--- a/src/modules/db_postgres/Makefile
+++ b/src/modules/db_postgres/Makefile
@@ -9,6 +9,19 @@ NAME=db_postgres.so
# the autodetection
# CROSS_COMPILE=true
+ifeq ($(CROSS_COMPILE),)
+LIBPQL_BUILDER = $(shell \
+ if pkg-config --exists libpq; then \
+ echo 'pkg-config libpq'; \
+ fi)
+ifneq ($(LIBPQ_BUILDER),)
+ DEFS += $(shell $(LIBPQL_BUILDER) --cflags)
+ LIBS += $(shell $(LIBPQL_BUILDER) --libs)
+endif
+endif
+
+ifeq ($(LIBPQ_BUILDER),)
+
ifeq ($(CROSS_COMPILE),)
PGCFG=$(shell which pg_config)
endif
@@ -27,6 +40,8 @@ else
-L$(LOCALBASE)/lib/pgsql -lpq
endif
+endif
+
SERLIBPATH=../../lib
SER_LIBS=$(SERLIBPATH)/srdb2/srdb2 $(SERLIBPATH)/srdb1/srdb1