]> granicus.if.org Git - postgis/commitdiff
Add libxml2 version information in postgis_full_version. Add libxml2 support informat...
authorOlivier Courtin <olivier.courtin@camptocamp.com>
Mon, 23 Nov 2009 14:26:45 +0000 (14:26 +0000)
committerOlivier Courtin <olivier.courtin@camptocamp.com>
Mon, 23 Nov 2009 14:26:45 +0000 (14:26 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4885 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac
doc/reference_management.xml
postgis/lwgeom_functions_basic.c
postgis/postgis.sql.in.c
postgis/sqldefines.h.in
postgis_config.h.in

index b79cd184712826d82f449268d2f98ebfab00e477..b49c088d4655cf2b8d846bd5809be943fb7653e3 100644 (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 -------- ])
index c5a1b2c5ffb01ccd81bd723083af8ca84084968a..1c44c1a95f78fc29f81b226f10e768c5edbcb19b 100644 (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>
index 63d7bc82230c6d261d8d635706438ce0085ac953..bb8ee4236f5c1533c293f47f695f804b119eb489 100644 (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
  */
@@ -3470,4 +3490,4 @@ Datum ST_CollectionExtract(PG_FUNCTION_ARGS)
        lwgeom_free(lwgeom); 
 
        PG_RETURN_POINTER(output);
-}
\ No newline at end of file
+}
index 05dc8f37296ed3f33ead9ef197d849fca4ab26ae..74ef91e3f7a9f6f91711c68ca79b4bc2eb605565 100644 (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;
@@ -6273,4 +6285,4 @@ CREATE OR REPLACE FUNCTION ST_MinimumBoundingCircle(geometry)
  LANGUAGE 'sql' IMMUTABLE STRICT;
 COMMIT;
 
-#include "postgis_drop.sql.in.c"
\ No newline at end of file
+#include "postgis_drop.sql.in.c"
index 4cad91d5d389c03b05dc6f51d78a082ce7c3fe0a..07fc95364e28215970f01f95a830d28d6f2be1f1 100644 (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
index 93cbab664badc1a041a21c589002cd7e9747c135..b0de37400187733812fe0d6c5844b79dd0c90c8e 100644 (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