Fix build on Debian sid/jessie

Debian has packaged libpq version 9.4beta2.  We were parsing the minor
version as "4beta2" and then trying to treat it as a constant integer,
which obviously doesn't work.

There's not really a perfect way to handle versions like this, so
we'll just pretend it's 9.4.0.
This commit is contained in:
Travis Cross 2014-09-09 12:59:06 +00:00
parent 1c697be17c
commit 790fa8c6c5
1 changed files with 4 additions and 3 deletions

View File

@ -481,9 +481,10 @@ if test x"$enable_core_pgsql_support" = x"yes" ; then
POSTGRESQL_LIBDIR="`$PKG_CONFIG libpq --libs-only-L`"
POSTGRESQL_LDFLAGS="`$PKG_CONFIG --libs libpq`"
POSTGRESQL_VERSION="`$PKG_CONFIG --modversion libpq`"
POSTGRESQL_MAJOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f1`"
POSTGRESQL_MINOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f2`"
POSTGRESQL_PATCH_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f3`"
POSTGRESQL_MAJOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f1 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
POSTGRESQL_MINOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f2 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
POSTGRESQL_PATCH_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f3 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
test -n "$POSTGRESQL_PATCH_VERSION" || POSTGRESQL_PATCH_VERSION=0
fi
save_LIBS="$LIBS"
LIBS="$POSTGRESQL_LIBDIR $LIBS"