Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e79fbfd

Browse files
committedJun 17, 2011
Improve library discovery process by using PostgreSQL's pg_config.
Based on patch from Silly Sad.
1 parent 74e74ac commit e79fbfd

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed
 

‎config

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,30 @@ if [ -n "$LIBPQ_INC" -o -n "$LIBPQ_LIB" ]; then
1414
fi
1515
. auto/feature
1616
else
17+
if [ -z "$PG_CONFIG" ]; then
18+
PG_CONFIG=pg_config
19+
fi
20+
21+
if type $PG_CONFIG >/dev/null 2>&1; then
22+
# based on information from pg_config
23+
ngx_feature="libpq library (via $PG_CONFIG)"
24+
ngx_feature_path="`$PG_CONFIG --includedir`"
25+
if [ $NGX_RPATH = YES ]; then
26+
ngx_feature_libs="-R`$PG_CONFIG --libdir` -L`$PG_CONFIG --libdir` -lpq"
27+
else
28+
ngx_feature_libs="-L`$PG_CONFIG --libdir` -lpq"
29+
fi
30+
. auto/feature
31+
fi
32+
1733
# auto-discovery
18-
ngx_feature="libpq library"
19-
ngx_feature_path=
20-
ngx_feature_libs="-lpq"
21-
. auto/feature
34+
if [ $ngx_found = no ]; then
35+
# system-wide
36+
ngx_feature="libpq library"
37+
ngx_feature_path=
38+
ngx_feature_libs="-lpq"
39+
. auto/feature
40+
fi
2241

2342
if [ $ngx_found = no ]; then
2443
# Debian

0 commit comments

Comments
 (0)
Please sign in to comment.