Skip to content

Commit

Permalink
Print found libpq version in build log
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Dec 9, 2017
1 parent 468ef77 commit 46e9641
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ PKG_LIBS_STATIC="-lpq -lssl -lcrypto -lldap"
if [ $(command -v pkg-config) ]; then
PKGCONFIG_CFLAGS=$(pkg-config --cflags --silence-errors ${PKG_CONFIG_NAME})
PKGCONFIG_LIBS=$(pkg-config --libs --silence-errors ${PKG_CONFIG_NAME})
PKGCONFIG_MODVERSION=$(pkg-config --modversion --silence-errors ${PKG_CONFIG_NAME})

# MacOS seems to ship a broken libpq.pc file
if [[ "$PKGCONFIG_CFLAGS" == *"Internal.sdk"* ]]; then
Expand All @@ -34,6 +35,7 @@ fi
if [ $(command -v pg_config) ]; then
PG_INC_DIR=$(pg_config --includedir)
PG_LIB_DIR=$(pg_config --libdir)
PG_VERSION=$(pg_config --version)
fi

# Note that cflags may be empty in case of success
Expand All @@ -42,11 +44,11 @@ if [ "$INCLUDE_DIR" ] || [ "$LIB_DIR" ]; then
PKG_CFLAGS="-I$INCLUDE_DIR $PKG_CFLAGS"
PKG_LIBS="-L$LIB_DIR $PKG_LIBS"
elif [ "$PKGCONFIG_CFLAGS" ] || [ "$PKGCONFIG_LIBS" ]; then
echo "Using pkg-config cflags and libs!"
echo "Using pkg-config cflags and libs ($PKG_CONFIG_NAME $PKGCONFIG_MODVERSION)!"
PKG_CFLAGS=${PKGCONFIG_CFLAGS}
PKG_LIBS=${PKGCONFIG_LIBS}
elif [ "$PG_INC_DIR" ] || [ "$PG_LIB_DIR" ]; then
echo "Using pg_config includedir and libdir!"
echo "Using pg_config includedir and libdir ($PG_VERSION)!"
PKG_CFLAGS="-I${PG_INC_DIR}"
PKG_LIBS="-L${PG_LIB_DIR} ${PKG_LIBS}"
elif [[ "$OSTYPE" == "darwin"* ]]; then
Expand Down

0 comments on commit 46e9641

Please sign in to comment.