]> granicus.if.org Git - postgis/commitdiff
Move SRID max and user-max definitions to configure.ac
authorSandro Santilli <strk@keybit.net>
Mon, 13 Feb 2012 14:48:17 +0000 (14:48 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 13 Feb 2012 14:48:17 +0000 (14:48 +0000)
This should help keeping postgis_restore.pl and core in sync
wrt SRID ranges.

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

.gitignore
configure.ac
liblwgeom/liblwgeom.h.in
utils/Makefile [deleted file]
utils/Makefile.in [new file with mode: 0644]
utils/postgis_restore.pl.in [moved from utils/postgis_restore.pl with 99% similarity]

index 740032ed8897116c4a9cb591311d4fbaaa21cbb6..d0fe24a27173babea5cb401cd98f408f0422fda0 100644 (file)
@@ -110,3 +110,4 @@ topology/uninstall_topology.sql
 authors.git
 libpgcommon/Makefile
 libpgcommon/cunit/Makefile
+utils/Makefile
index 4b6888c3b920939086c5593a406aebbcb19115da..b029642210b54c31369e5ae2fd27f8a8dbf14448 100644 (file)
@@ -831,6 +831,15 @@ fi
 
 AC_SUBST([TOPOLOGY])
 
+dnl ===========================================================================
+dnl SRID stuff
+dnl ===========================================================================
+
+SRID_MAX=999999
+SRID_USR_MAX=998999
+AC_SUBST([SRID_MAX])
+AC_SUBST([SRID_USR_MAX])
+
 
 dnl ====================================
 dnl raster stuff
@@ -1025,6 +1034,7 @@ AC_OUTPUT([GNUmakefile
    doc/Makefile 
    doc/Makefile.comments 
    doc/html/image_src/Makefile 
+   utils/Makefile 
    $RT_MAKEFILE_LIST])
     
 dnl ===========================================================================
index 92e9d38bc9e3a133b30774eaf29de0a30a8238b6..20f4b61edf0e8fea42f8d42fdffb207458fff8ab 100644 (file)
 * Maximum allowed SRID value in serialized geometry.
 * Currently we are using 21 bits (2097152) of storage for SRID.
 */
-#define SRID_MAXIMUM 999999
+#define SRID_MAXIMUM @SRID_MAX@
 
 /**
  * Maximum valid SRID value for the user
  * We reserve 1000 values for internal use
  */
-#define SRID_USER_MAXIMUM 998999
+#define SRID_USER_MAXIMUM @SRID_USR_MAX@
 
 /** Unknown SRID value */
 #define SRID_UNKNOWN 0
diff --git a/utils/Makefile b/utils/Makefile
deleted file mode 100644 (file)
index e5ff059..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-SCRIPTS = \
-       postgis_restore.pl \
-       create_undef.pl \
-       svn_repo_revision.pl \
-       postgis_proc_upgrade.pl \
-       profile_intersects.pl \
-       test_estimation.pl \
-       test_joinestimation.pl
-
-all:
-       chmod +x $(SCRIPTS)
-
-# We don't install utils (why?)
-install uninstall:
-
-# There's nothing to clean
-clean distclean:
-
-# And there's nothing to check
-check:
diff --git a/utils/Makefile.in b/utils/Makefile.in
new file mode 100644 (file)
index 0000000..9e50169
--- /dev/null
@@ -0,0 +1,42 @@
+# **********************************************************************
+# * $Id$
+# *
+# * PostGIS - Spatial Types for PostgreSQL
+# * http://postgis.refractions.net
+# *
+# * Copyright 2008 Mark Cave-Ayland
+# *
+# * This is free software; you can redistribute and/or modify it under
+# * the terms of the GNU General Public Licence. See the COPYING file.
+# *
+# **********************************************************************
+
+SCRIPTS = \
+       postgis_restore.pl \
+       create_undef.pl \
+       svn_repo_revision.pl \
+       postgis_proc_upgrade.pl \
+       profile_intersects.pl \
+       test_estimation.pl \
+       test_joinestimation.pl
+
+SRID_MAXIMUM = @SRID_MAX@
+SRID_USER_MAXIMUM = @SRID_USR_MAX@
+
+all: postgis_restore.pl
+       chmod +x $(SCRIPTS)
+
+postgis_restore.pl: postgis_restore.pl.in
+       sed 's,@SRID_MAXIMUM@,$(SRID_MAXIMUM),g;s,@SRID_USER_MAXIMUM@,$(SRID_USER_MAXIMUM),' $< >$@
+
+# We don't install utils (why?)
+install uninstall:
+
+clean:
+       rm -f postgis_restore.pl
+
+distclean: clean
+       rm -f Makefile
+
+# And there's nothing to check
+check:
similarity index 99%
rename from utils/postgis_restore.pl
rename to utils/postgis_restore.pl.in
index d61f35e3405cd9391f45833e6bb33e21473673bf..1c1ee15740102f78eeb38e27045a6ecf511091c9 100755 (executable)
@@ -53,8 +53,8 @@ my $DEBUG = 0;
 
 # NOTE: the SRID limits here are being discussed:
 # http://postgis.refractions.net/pipermail/postgis-devel/2012-February/018463.html
-my $SRID_MAXIMUM = 999999;
-my $SRID_USER_MAXIMUM = 998999
+my $SRID_MAXIMUM = @SRID_MAXIMUM@;
+my $SRID_USER_MAXIMUM = @SRID_USER_MAXIMUM@
 
 if ( @ARGV && $ARGV[0] eq '-v' ) {
   $DEBUG = 1;