]> granicus.if.org Git - postgis/commitdiff
Accept dot-less output from pg_config --version
authorSandro Santilli <strk@kbt.io>
Sun, 28 Aug 2016 17:05:38 +0000 (17:05 +0000)
committerSandro Santilli <strk@kbt.io>
Sun, 28 Aug 2016 17:05:38 +0000 (17:05 +0000)
Hopefully fixes #3614

git-svn-id: http://svn.osgeo.org/postgis/trunk@15048 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac

index f5d6c4a4d207d6a94c2d9fca5661841f13e28e9f..0c3f6165d97f76859dc50d68a48361b826367cd7 100644 (file)
@@ -429,9 +429,10 @@ if test "x$LIBLWGEOM_ONLY" = "xno"; then
   dnl Extract the version information from pg_config
   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_MAJOR_VERSION=`$PG_CONFIG --version | sed 's/[[^0-9]]*\([[0-9]]\)\.\([[0-9]]\).*/\1/'`
-  PGSQL_MINOR_VERSION=`$PG_CONFIG --version | sed 's/[[^0-9]]*\([[0-9]]\)\.\([[0-9]]\).*/\2/'`
   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/.*develop.*/0/'`
   POSTGIS_PGSQL_VERSION="$PGSQL_MAJOR_VERSION$PGSQL_MINOR_VERSION"
 
   PGSQL_PKGLIBDIR=`$PG_CONFIG --pkglibdir`