summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-09-07 14:51:22 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2019-09-07 14:53:00 -0400
commit3eff9bac4e602523384f2f479544552481b2609f (patch)
tree0479c6a434ccdefc6d4e68eedbc68f5ab93c5027
parentea6006944bc6de9eba8b9fa44cc326005bde5091 (diff)
downloadlighttpd1.4-3eff9bac4e602523384f2f479544552481b2609f.tar.gz
lighttpd1.4-3eff9bac4e602523384f2f479544552481b2609f.zip
[build] prefer pkg-config for postgres (fixes #2965)
x-ref: "pg_config is deprecated to build postgres client applications" https://redmine.lighttpd.net/issues/2965
-rw-r--r--configure.ac24
1 files changed, 15 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 1e8c8293..662e17f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -303,20 +303,26 @@ PGSQL_LIBS=
if test "$WITH_PGSQL" != no; then
if test "$WITH_PGSQL" = yes; then
- AC_PATH_PROG([PGSQL_CONFIG], [pg_config])
+ PKG_CHECK_MODULES([PGSQL],[libpq],[
+ PGSQL_CONFIG=$PKG_CONFIG
+ ],[
+ AC_PATH_PROG([PGSQL_CONFIG], [pg_config])
+ ])
else
PGSQL_CONFIG=$WITH_PGSQL
fi
- if test -z "$PGSQL_CONFIG"; then
- AC_MSG_ERROR([pg_config is not found])
- fi
- if test ! -x "$PGSQL_CONFIG"; then
- AC_MSG_ERROR([pg_config not exists or not executable, use --with-pgsql=path-to-pg_config])
- fi
+ if test "$PGSQL_CONFIG" != "$PKG_CONFIG"; then
+ if test -z "$PGSQL_CONFIG"; then
+ AC_MSG_ERROR([pg_config is not found])
+ fi
+ if test ! -x "$PGSQL_CONFIG"; then
+ AC_MSG_ERROR([pg_config not exists or not executable, use --with-pgsql=path-to-pg_config])
+ fi
- PGSQL_INCLUDE="-I`"$PGSQL_CONFIG" --includedir`"
- PGSQL_LIBS="-L`"$PGSQL_CONFIG" --libdir` -lpq"
+ PGSQL_INCLUDE="-I`"$PGSQL_CONFIG" --includedir`"
+ PGSQL_LIBS="-L`"$PGSQL_CONFIG" --libdir` -lpq"
+ fi
AC_MSG_CHECKING([for PgSQL includes at])
AC_MSG_RESULT([$PGSQL_INCLUDE])