From: Regina Obe Date: Sat, 20 May 2017 17:49:52 +0000 (+0000) Subject: Revise the PGVERSION numbering scheme so also works for PostgreSQL 10beta1 and for... X-Git-Tag: 2.4.0alpha~97 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0491e96a3a8413131970b13bdf6a854a83525cf5;p=postgis Revise the PGVERSION numbering scheme so also works for PostgreSQL 10beta1 and for all future PostgreSQL after 10 Note previous patch put in did not consider the case of when 10.11 comes, that would end up ranking higher than 11.0 (110 vs. 1011). So we need to totally disregard the minor version for PostgreSQL >= 10 Closes #3614 git-svn-id: http://svn.osgeo.org/postgis/trunk@15397 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/configure.ac b/configure.ac index c6f3eeef9..661ca6be6 100644 --- a/configure.ac +++ b/configure.ac @@ -436,9 +436,18 @@ if test "x$LIBLWGEOM_ONLY" = "xno"; then dnl Note: we extract the major & minor separately, ensure they are numeric, and then combine to give dnl the final version. This is to guard against user error... PGSQL_FULL_VERSION=`"$PG_CONFIG" --version` + PGSQL_MAJOR_VERSION=`echo $PGSQL_FULL_VERSION | sed 's/[[^0-9]]*\([[0-9]]*\).*/\1/'` - PGSQL_MINOR_VERSION=`echo $PGSQL_FULL_VERSION | sed 's/[[^\.]]*\.\([[0-9]]*\).*/\1/'` - PGSQL_MINOR_VERSION=`echo $PGSQL_MINOR_VERSION | sed 's/.*devel.*/0/'` + PGSQL_MINOR_VERSION=`$PG_CONFIG --version | sed 's/[[^0-9]]*\([[0-9]]\)\.\([[0-9]]\).*/\2/'` + + if test $PGSQL_MAJOR_VERSION -gt 9; then + dnl ================================================================== + dnl Starting with PostgreSQL 10, major is the new minor + dnl This is to prevent things like 10.31 ranking higher than 11.0 + dnl=================================================================== + PGSQL_MINOR_VERSION=0 + fi + POSTGIS_PGSQL_VERSION="$PGSQL_MAJOR_VERSION$PGSQL_MINOR_VERSION" PGSQL_PKGLIBDIR=`"$PG_CONFIG" --pkglibdir`