Add libxml2 version information in postgis_full_version. Add libxml2 support information in postgis_version. Add new postgis_libxml_version function. Add doc entry for this new function.

git-svn-id: http://svn.osgeo.org/postgis/trunk@4885 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Olivier Courtin 2009-11-23 14:26:45 +00:00
parent c6042246ec
commit d1f3fe6f05
6 changed files with 99 additions and 4 deletions

View file

@ -371,7 +371,7 @@ if test "$FOUND_LIBXML2" = "1"; then
XML2_CPPFLAGS=`$XML2CONFIG --cflags`
dnl Extract the version
XML2_VERSION=`$XML2CONFIG --version`
POSTGIS_LIBXML2_VERSION=`$XML2CONFIG --version`
dnl Check headers file
CPPFLAGS_SAVE="$CPPFLAGS"
@ -388,6 +388,9 @@ if test "$FOUND_LIBXML2" = "1"; then
AC_DEFINE_UNQUOTED([HAVE_LIBXML2], [$HAVE_LIBXML2],
[libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h header])
AC_SUBST([HAVE_LIBXML2])
AC_DEFINE_UNQUOTED([POSTGIS_LIBXML2_VERSION], ["$POSTGIS_LIBXML2_VERSION"], [PostGIS libxml2 version])
AC_SUBST([POSTGIS_LIBXML2_VERSION])
fi
@ -570,6 +573,10 @@ dnl Define version macros
dnl
POSTGIS_VERSION="$POSTGIS_MAJOR_VERSION.$POSTGIS_MINOR_VERSION USE_GEOS=1 USE_PROJ=1 USE_STATS=1"
if test "$HAVE_LIBXML2" = "1"; then
POSTGIS_VERSION="$POSTGIS_VERSION USE_LIBXML2=1"
fi
POSTGIS_LIB_VERSION="$POSTGIS_MAJOR_VERSION.$POSTGIS_MINOR_VERSION.$POSTGIS_MICRO_VERSION"
POSTGIS_BUILD_DATE=`date -u "+%Y-%m-%d %H:%M:%S"`
POSTGIS_SCRIPTS_SVNREV=`perl utils/read_scripts_version.pl`
@ -625,7 +632,7 @@ AC_MSG_RESULT([ PostgreSQL config: ${PGCONFIG}])
AC_MSG_RESULT([ PostgreSQL version: ${PGSQL_MAJOR_VERSION}.${PGSQL_MINOR_VERSION}])
AC_MSG_RESULT([ PROJ4 version: ${POSTGIS_PROJ_VERSION}])
AC_MSG_RESULT([ Libxml2 config: ${XML2CONFIG}])
AC_MSG_RESULT([ Libxml2 version: ${XML2_VERSION}])
AC_MSG_RESULT([ Libxml2 version: ${POSTGIS_LIBXML2_VERSION}])
AC_MSG_RESULT([ PostGIS debug level: ${POSTGIS_DEBUG_LEVEL}])
AC_MSG_RESULT()
AC_MSG_RESULT([ -------- Documentation Generation -------- ])

View file

@ -331,6 +331,7 @@ the_geom IS NULL)
<para><xref linkend="PostGIS_GEOS_Version" />, <xref
linkend="PostGIS_Lib_Version" />, <xref
linkend="PostGIS_LibXML_Version" />, <xref
linkend="PostGIS_PROJ_Version" />, <xref
linkend="PostGIS_Version" /></para>
</refsection>
@ -376,11 +377,58 @@ the_geom IS NULL)
<para><xref linkend="PostGIS_Full_Version" />, <xref
linkend="PostGIS_Lib_Version" />, <xref
linkend="PostGIS_LibXML_Version" />, <xref
linkend="PostGIS_PROJ_Version" />, <xref
linkend="PostGIS_Version" /></para>
</refsection>
</refentry>
<refentry id="PostGIS_LibXML_Version">
<refnamediv>
<refname>PostGIS_LibXML_Version</refname>
<refpurpose>Returns the version number of the libxml2
library.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>text <function>PostGIS_LibXML_Version</function></funcdef>
<paramdef></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsection>
<title>Description</title>
<para>Returns the version number of the LibXML2 library, or
<varname>NULL</varname> if LibXML2 support is not enabled.</para>
</refsection>
<refsection>
<title>Examples</title>
<programlisting>SELECT PostGIS_LibXML_Version();
postgis_libxml_version
----------------------
2.7.6
(1 row)</programlisting>
</refsection>
<refsection>
<title>See Also</title>
<para><xref linkend="PostGIS_Full_Version" />, <xref
linkend="PostGIS_Lib_Version" />, <xref
linkend="PostGIS_PROJ_Version" />, <xref
linkend="PostGIS_GEOS_Version" />, <xref
linkend="PostGIS_Version" /></para>
</refsection>
</refentry>
<refentry id="PostGIS_Lib_Build_Date">
<refnamediv>
<refname>PostGIS_Lib_Build_Date</refname>
@ -454,6 +502,7 @@ the_geom IS NULL)
<para><xref linkend="PostGIS_Full_Version" />, <xref
linkend="PostGIS_GEOS_Version" />, <xref
linkend="PostGIS_LibXML_Version" />, <xref
linkend="PostGIS_PROJ_Version" />, <xref
linkend="PostGIS_Version" /></para>
</refsection>
@ -500,6 +549,7 @@ the_geom IS NULL)
<para><xref linkend="PostGIS_Full_Version" />, <xref
linkend="PostGIS_GEOS_Version" />, <xref
linkend="PostGIS_Lib_Version" />, <xref
linkend="PostGIS_LibXML_Version" />, <xref
linkend="PostGIS_Version" /></para>
</refsection>
</refentry>
@ -545,6 +595,7 @@ the_geom IS NULL)
<para><xref linkend="PostGIS_Full_Version" />, <xref
linkend="PostGIS_GEOS_Version" />, <xref
linkend="PostGIS_Lib_Version" />, <xref
linkend="PostGIS_LibXML_Version" />, <xref
linkend="PostGIS_Version" /></para>
</refsection>
</refentry>
@ -733,6 +784,7 @@ the_geom IS NULL)
<para><xref linkend="PostGIS_Full_Version" />, <xref
linkend="PostGIS_GEOS_Version" />,<xref
linkend="PostGIS_Lib_Version" />, <xref
linkend="PostGIS_LibXML_Version" />, <xref
linkend="PostGIS_PROJ_Version" /></para>
</refsection>
</refentry>

View file

@ -38,6 +38,7 @@ Datum postgis_autocache_bbox(PG_FUNCTION_ARGS);
Datum postgis_scripts_released(PG_FUNCTION_ARGS);
Datum postgis_version(PG_FUNCTION_ARGS);
Datum postgis_lib_version(PG_FUNCTION_ARGS);
Datum postgis_libxml_version(PG_FUNCTION_ARGS);
Datum postgis_lib_build_date(PG_FUNCTION_ARGS);
Datum LWGEOM_length2d_linestring(PG_FUNCTION_ARGS);
Datum LWGEOM_length_linestring(PG_FUNCTION_ARGS);
@ -193,6 +194,25 @@ Datum postgis_autocache_bbox(PG_FUNCTION_ARGS)
}
PG_FUNCTION_INFO_V1(postgis_libxml_version);
Datum postgis_libxml_version(PG_FUNCTION_ARGS)
{
#if HAVE_LIBXML2
char *ver = POSTGIS_LIBXML2_VERSION;
text *result;
result = lwalloc(VARHDRSZ + strlen(ver));
SET_VARSIZE(result, VARHDRSZ + strlen(ver));
memcpy(VARDATA(result), ver, strlen(ver));
PG_RETURN_POINTER(result);
#else
PG_RETURN_NULL();
#endif
}
/**
* Recursively count points in a SERIALIZED lwgeom
*/

View file

@ -3407,6 +3407,10 @@ CREATE OR REPLACE FUNCTION postgis_geos_version() RETURNS text
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE;
CREATE OR REPLACE FUNCTION postgis_libxml_version() RETURNS text
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE;
CREATE OR REPLACE FUNCTION postgis_scripts_build_date() RETURNS text
AS _POSTGIS_SQL_SELECT_POSTGIS_BUILD_DATE
LANGUAGE 'sql' IMMUTABLE;
@ -3423,6 +3427,7 @@ DECLARE
libver text;
projver text;
geosver text;
libxmlver text;
usestats bool;
dbproc text;
relproc text;
@ -3431,6 +3436,9 @@ BEGIN
SELECT postgis_lib_version() INTO libver;
SELECT postgis_proj_version() INTO projver;
SELECT postgis_geos_version() INTO geosver;
#if HAVE_LIBXML2
SELECT postgis_libxml_version() INTO libxmlver;
#endif
SELECT postgis_uses_stats() INTO usestats;
SELECT postgis_scripts_installed() INTO dbproc;
SELECT postgis_scripts_released() INTO relproc;
@ -3445,6 +3453,10 @@ BEGIN
fullver = fullver || ' PROJ="' || projver || '"';
END IF;
IF libxmlver IS NOT NULL THEN
fullver = fullver || ' LIBXML="' || libxmlver || '"';
END IF;
IF usestats THEN
fullver = fullver || ' USE_STATS';
END IF;

View file

@ -8,6 +8,7 @@
#define POSTGIS_GEOS_VERSION @POSTGIS_GEOS_VERSION@
#define POSTGIS_PROJ_VERSION @POSTGIS_PROJ_VERSION@
#define POSTGIS_LIB_VERSION @POSTGIS_LIB_VERSION@
#define POSTGIS_LIBXML2_VERSION @POSTGIS_LIBXML2_VERSION@
/*
* Define the build date and the version number

View file

@ -64,6 +64,9 @@
/* libxml/tree.h libxml/parser.h header */
#undef HAVE_LIBXML2
/* PostGIS libxml2 version */
#undef POSTGIS_LIBXML2_VERSION
/* PostGIS library version */
#undef POSTGIS_LIB_VERSION