Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve library discovery process by using PostgreSQL's pg_config.

Based on patch from Silly Sad.
  • Loading branch information...
commit e79fbfd6d1fef7e1cd819c84d2c1f74ce318cf62 1 parent 74e74ac
@PiotrSikora PiotrSikora authored
Showing with 23 additions and 4 deletions.
  1. +23 −4 config
View
27 config
@@ -14,11 +14,30 @@ if [ -n "$LIBPQ_INC" -o -n "$LIBPQ_LIB" ]; then
fi
. auto/feature
else
+ if [ -z "$PG_CONFIG" ]; then
+ PG_CONFIG=pg_config
+ fi
+
+ if type $PG_CONFIG >/dev/null 2>&1; then
+ # based on information from pg_config
+ ngx_feature="libpq library (via $PG_CONFIG)"
+ ngx_feature_path="`$PG_CONFIG --includedir`"
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R`$PG_CONFIG --libdir` -L`$PG_CONFIG --libdir` -lpq"
+ else
+ ngx_feature_libs="-L`$PG_CONFIG --libdir` -lpq"
+ fi
+ . auto/feature
+ fi
+
# auto-discovery
- ngx_feature="libpq library"
- ngx_feature_path=
- ngx_feature_libs="-lpq"
- . auto/feature
+ if [ $ngx_found = no ]; then
+ # system-wide
+ ngx_feature="libpq library"
+ ngx_feature_path=
+ ngx_feature_libs="-lpq"
+ . auto/feature
+ fi
if [ $ngx_found = no ]; then
# Debian
Please sign in to comment.
Something went wrong with that request. Please try again.