]> granicus.if.org Git - postgis/commitdiff
Rework PGSQL_VERSION again so to use 2-digits minor from 10 onward
authorSandro Santilli <strk@kbt.io>
Tue, 5 Sep 2017 20:50:39 +0000 (20:50 +0000)
committerSandro Santilli <strk@kbt.io>
Tue, 5 Sep 2017 20:50:39 +0000 (20:50 +0000)
See #3614 (for 2.3 branch)

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

configure.ac
libpgcommon/gserialized_gist.c
postgis/gserialized_estimate.c
postgis/gserialized_gist_nd.c

index ebf8eb40257fa1b4aa4acf6d0702a9645f5c1212..811b442f308e00161a4b175125f494ededaf867d 100644 (file)
@@ -430,18 +430,22 @@ 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/'`
-  
+  if test "$PGSQL_MINOR_VERSION" = "$PGSQL_FULL_VERSION"; then
+      dnl No match means there's no minor version
+      PGSQL_MINOR_VERSION="0"
+  fi
+
   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
+       dnl ==================================================================
+       dnl Starting with PostgreSQL 10, we use 2 digits for minor version
+       dnl This is to prevent things like 10.31 ranking higher than 11.0
+       dnl===================================================================
+       PGSQL_MINOR_VERSION=`printf %.2d $PGSQL_MINOR_VERSION`
   fi
-  
+
   POSTGIS_PGSQL_VERSION="$PGSQL_MAJOR_VERSION$PGSQL_MINOR_VERSION"
 
   PGSQL_PKGLIBDIR=`$PG_CONFIG --pkglibdir`
index ec2585d6a42b590f295860a5a603d0a64402ccf9..beb0b12867a5f77538dabe1c32fa584fb7953479 100644 (file)
@@ -22,7 +22,7 @@
 #include "lwgeom_pg.h"       /* For debugging macros. */
 #include "gserialized_gist.h"
 
-#if POSTGIS_PGSQL_VERSION >= 100
+#if POSTGIS_PGSQL_VERSION >= 1000
 #include <float.h>
 #endif
 
index ea343495b0d08c974c4f68dbc6f8735c4aa6d746..16b209080cfdcfbbee557d56dcbff1c324e360cb 100644 (file)
@@ -836,7 +836,7 @@ pg_nd_stats_from_tuple(HeapTuple stats_tuple, int mode)
 
     /* Then read the geom status histogram from that */
   
-#if POSTGIS_PGSQL_VERSION < 100
+#if POSTGIS_PGSQL_VERSION < 1000
        float4 *floatptr;
        int nvalues;
        
index e8c16c5ad48f3d2fc3a6f6624e1b1a49ea11fa66..112a54c8db1a817345f5e5fdf5805a418348f747 100644 (file)
@@ -52,7 +52,7 @@
 
 #include <assert.h>
 
-#if POSTGIS_PGSQL_VERSION >= 100
+#if POSTGIS_PGSQL_VERSION >= 1000
 #include <float.h>
 #endif