XML2_CPPFLAGS=`$XML2CONFIG --cflags`
dnl Extract the version
- XML2_VERSION=`$XML2CONFIG --version`
+ POSTGIS_LIBXML2_VERSION=`$XML2CONFIG --version`
dnl Check headers file
CPPFLAGS_SAVE="$CPPFLAGS"
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
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`
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 -------- ])
<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>
<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>
<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>
<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>
<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>
<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>
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);
}
+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
*/
lwgeom_free(lwgeom);
PG_RETURN_POINTER(output);
-}
\ No newline at end of file
+}
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;
libver text;
projver text;
geosver text;
+ libxmlver text;
usestats bool;
dbproc text;
relproc text;
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;
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;
LANGUAGE 'sql' IMMUTABLE STRICT;
COMMIT;
-#include "postgis_drop.sql.in.c"
\ No newline at end of file
+#include "postgis_drop.sql.in.c"
#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
/* libxml/tree.h libxml/parser.h header */
#undef HAVE_LIBXML2
+/* PostGIS libxml2 version */
+#undef POSTGIS_LIBXML2_VERSION
+
/* PostGIS library version */
#undef POSTGIS_LIB_VERSION