INSTALL = $(SHELL) ../install-sh
LIBTOOL = @LIBTOOL@
+SOVER = @POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
+
IFACE_CURRENT = @LIBLWGEOM_CURRENT@
IFACE_AGE = @LIBLWGEOM_AGE@
IFACE_REV = @LIBLWGEOM_REV@
liblwgeom.la: $(LT_OBJS)
$(LIBTOOL) --tag=CC --mode=link $(CC) -rpath $(libdir) $(LT_OBJS) \
- -version-info $(VERSION_INFO) $(LDFLAGS) -o $@
+ -release $(SOVER) -version-info $(VERSION_INFO) $(LDFLAGS) -o $@
maintainer-clean: clean
rm -f lwin_wkt_lex.c
#define LIBLWGEOM_VERSION_MINOR "@POSTGIS_MINOR_VERSION@"
#define LIBLWGEOM_GEOS_VERSION "@POSTGIS_GEOS_VERSION@"
+/** Return lwgeom version string (not to be freed) */
+const char* lwgeom_version(void);
+
/**
* Return types for functions with status returns.
*/
#include <stdio.h>
#include <errno.h>
#include <assert.h>
+#include "../postgis_svn_revision.h"
/*
* Lower this to reduce integrity checks
*/
#define PARANOIA_LEVEL 1
+const char *
+lwgeom_version()
+{
+ static char *ptr = NULL;
+ static char buf[256];
+ if ( ! ptr )
+ {
+ ptr = buf;
+ snprintf(ptr, 256, LIBLWGEOM_VERSION" r%d", POSTGIS_SVN_REVISION);
+ }
+
+ return ptr;
+}
+
/**********************************************************************
* BOX routines
Datum postgis_autocache_bbox(PG_FUNCTION_ARGS);
Datum postgis_scripts_released(PG_FUNCTION_ARGS);
Datum postgis_version(PG_FUNCTION_ARGS);
+Datum postgis_liblwgeom_version(PG_FUNCTION_ARGS);
Datum postgis_lib_version(PG_FUNCTION_ARGS);
Datum postgis_svn_version(PG_FUNCTION_ARGS);
Datum postgis_libxml_version(PG_FUNCTION_ARGS);
PG_RETURN_TEXT_P(result);
}
+PG_FUNCTION_INFO_V1(postgis_liblwgeom_version);
+Datum postgis_liblwgeom_version(PG_FUNCTION_ARGS)
+{
+ const char *ver = lwgeom_version();
+ text *result = cstring2text(ver);
+ PG_RETURN_TEXT_P(result);
+}
+
PG_FUNCTION_INFO_V1(postgis_lib_version);
Datum postgis_lib_version(PG_FUNCTION_ARGS)
{
AS 'MODULE_PATHNAME'
LANGUAGE 'c' IMMUTABLE;
+CREATE OR REPLACE FUNCTION postgis_liblwgeom_version() RETURNS text
+ AS 'MODULE_PATHNAME'
+ LANGUAGE 'c' IMMUTABLE;
+
CREATE OR REPLACE FUNCTION postgis_proj_version() RETURNS text
AS 'MODULE_PATHNAME'
LANGUAGE 'c' IMMUTABLE;
cgalver text;
gdalver text;
libxmlver text;
+ liblwgeomver text;
dbproc text;
relproc text;
fullver text;
WHEN undefined_function THEN
sfcgalver := NULL;
END;
+ SELECT postgis_liblwgeom_version() INTO liblwgeomver;
SELECT postgis_libxml_version() INTO libxmlver;
SELECT postgis_scripts_installed() INTO dbproc;
SELECT postgis_scripts_released() INTO relproc;
fullver = fullver || '"';
+ IF liblwgeomver != relproc THEN
+ fullver = fullver || ' (liblwgeom version mismatch: "' || liblwgeomver || '")';
+ END IF;
+
+
IF geosver IS NOT NULL THEN
fullver = fullver || ' GEOS="' || geosver || '"';
END IF;