From: Sandro Santilli Date: Mon, 13 Feb 2012 14:48:17 +0000 (+0000) Subject: Move SRID max and user-max definitions to configure.ac X-Git-Tag: 2.0.0alpha5~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13839e6dfbde2d7ce0e2f31654aa715aecd03380;p=postgis Move SRID max and user-max definitions to configure.ac 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 --- diff --git a/.gitignore b/.gitignore index 740032ed8..d0fe24a27 100644 --- a/.gitignore +++ b/.gitignore @@ -110,3 +110,4 @@ topology/uninstall_topology.sql authors.git libpgcommon/Makefile libpgcommon/cunit/Makefile +utils/Makefile diff --git a/configure.ac b/configure.ac index 4b6888c3b..b02964221 100644 --- a/configure.ac +++ b/configure.ac @@ -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 =========================================================================== diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in index 92e9d38bc..20f4b61ed 100644 --- a/liblwgeom/liblwgeom.h.in +++ b/liblwgeom/liblwgeom.h.in @@ -143,13 +143,13 @@ * 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 index e5ff05938..000000000 --- a/utils/Makefile +++ /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 index 000000000..9e50169ab --- /dev/null +++ b/utils/Makefile.in @@ -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: diff --git a/utils/postgis_restore.pl b/utils/postgis_restore.pl.in similarity index 99% rename from utils/postgis_restore.pl rename to utils/postgis_restore.pl.in index d61f35e34..1c1ee1574 100755 --- a/utils/postgis_restore.pl +++ b/utils/postgis_restore.pl.in @@ -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;