From 1933c7cb8ab4b8e7c2453d8d0c96742db2c88815 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Thu, 31 Jul 2014 03:21:19 +0000 Subject: [PATCH] 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. --- configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 2928a0ab24..7baf54ecaf 100644 --- a/configure.ac +++ b/configure.ac @@ -568,9 +568,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"