]> granicus.if.org Git - postgis/commitdiff
Libxml become mandatory. Cf #344. Modify configure step, remove all HAVE_LIBXML2...
authorOlivier Courtin <olivier.courtin@camptocamp.com>
Fri, 18 Dec 2009 19:08:20 +0000 (19:08 +0000)
committerOlivier Courtin <olivier.courtin@camptocamp.com>
Fri, 18 Dec 2009 19:08:20 +0000 (19:08 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@5032 b70326c6-7e19-0410-871a-916f4a2858ee

12 files changed:
configure.ac
doc/reference_constructor.xml
doc/reference_management.xml
doc/release_notes.xml
postgis/lwgeom_functions_basic.c
postgis/lwgeom_in_gml.c
postgis/lwgeom_in_kml.c
postgis/postgis.sql.in.c
postgis/sqldefines.h.in
postgis/uninstall_postgis.sql.in.c
postgis_config.h.in
regress/Makefile.in

index 77f5860e4c05e287089fafaf95719d1b111f582c..1e2279997605fb4ce1fa433afc79772c14204c23 100644 (file)
@@ -353,7 +353,7 @@ AC_SUBST([POSTGIS_PGSQL_VERSION])
 
 dnl ===========================================================================
 dnl Detect libxml2 if it is installed
-dnl (needed to GeomFromGML function, but not required to PostGIS build)
+dnl (needed to GeomFromGML and GeomFromKML functions)
 dnl ===========================================================================
 
 AC_ARG_WITH([xml2config], 
@@ -366,9 +366,7 @@ if test "x$XML2CONFIG" = "x"; then
 
        dnl If we couldn't find xml2-config, display a warning
        if test "x$XML2CONFIG" = "x"; then
-               AC_MSG_WARN([could not find xml2-config from libxml2, some imports functions will be deactivated])
-       else
-               FOUND_LIBXML2=1
+               AC_MSG_ERROR([could not find xml2-config from libxml2 within the current path. You may need to try re-running configure with a --with-xml2config parameter.])
        fi
 else
        dnl XML2CONFIG was specified; display a message to the user
@@ -377,49 +375,34 @@ else
        else
                if test -f $XML2CONFIG; then
                        AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG])
-                       FOUND_LIBXML2=1
                else
                        AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist])
                fi      
        fi
 fi
 
-dnl xml2-config founded, retrieve flags and version
-if test "$FOUND_LIBXML2" = "1"; then
-
-       dnl Extract the linker and include flags 
-       XML2_LDFLAGS=`$XML2CONFIG --libs`
-       XML2_CPPFLAGS=`$XML2CONFIG --cflags`
 
-       dnl Extract the version
-       POSTGIS_LIBXML2_VERSION=`$XML2CONFIG --version`
+dnl Extract the linker and include flags 
+XML2_LDFLAGS=`$XML2CONFIG --libs`
+XML2_CPPFLAGS=`$XML2CONFIG --cflags`
 
-       dnl Check headers file
-       CPPFLAGS_SAVE="$CPPFLAGS"
-       CPPFLAGS="$XML2_CPPFLAGS"
-       AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h],
-                        [HAVE_LIBXML2=1],
-                        [AC_MSG_ERROR([could not find headers include related to libxml2])])
+dnl Extract the version
+POSTGIS_LIBXML2_VERSION=`$XML2CONFIG --version`
 
-       dnl Ensure we can link against libxml2
-       LIBS_SAVE="$LIBS"
-       LIBS="$XML2_LDFLAGS"
-       AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], [])
+dnl Check headers file
+CPPFLAGS_SAVE="$CPPFLAGS"
+CPPFLAGS="$XML2_CPPFLAGS"
+AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h],
+                [], [AC_MSG_ERROR([could not find headers include related to libxml2])])
 
-       AC_DEFINE_UNQUOTED([HAVE_LIBXML2], [$HAVE_LIBXML2],
-                          [libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h header])
-       AC_SUBST([HAVE_LIBXML2])
+dnl Ensure we can link against libxml2
+LIBS_SAVE="$LIBS"
+LIBS="$XML2_LDFLAGS"
+AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], [])
 
-       AC_DEFINE_UNQUOTED([POSTGIS_LIBXML2_VERSION], ["$POSTGIS_LIBXML2_VERSION"], [PostGIS libxml2 version])
-       AC_SUBST([POSTGIS_LIBXML2_VERSION])
-fi
+AC_DEFINE_UNQUOTED([POSTGIS_LIBXML2_VERSION], ["$POSTGIS_LIBXML2_VERSION"], [PostGIS libxml2 version])
+AC_SUBST([POSTGIS_LIBXML2_VERSION])
 
-POSTGIS_HAVE_LIBXML2=0
-if test "x$HAVE_LIBXML2" = "x1"; then
-       POSTGIS_HAVE_LIBXML2=1
-fi
-AC_DEFINE([POSTGIS_HAVE_LIBXML2])
-AC_SUBST([POSTGIS_HAVE_LIBXML2])
 
 
 dnl ===========================================================================
index a636505e8d9f7cc3f1f2c4ff346a04cd389675d9..8ade2d2c8164757a3d1dcc964b10cd142808ecef 100644 (file)
@@ -347,9 +347,6 @@ SELECT ST_GeomFromEWKT('CIRCULARSTRING(220268 150415 1,220227 150505 2,220227 15
          <refsection>
                <title>Description</title>
                <para>Constructs a PostGIS ST_Geometry object from the OGC GML representation.</para>
-               <note>
-                       <para>Requires compilation with libxml2 2.5+</para>
-               </note>
                <para>ST_GeomFromGML works only for GML Geometry fragments. It throws an error if you try to use it on a whole GML document.</para>
                <para>
                        OGC GML versions supported:
@@ -367,7 +364,7 @@ SELECT ST_GeomFromEWKT('CIRCULARSTRING(220268 150415 1,220227 150505 2,220227 15
                        OGC GML standards, cf: <ulink url="http://www.opengeospatial.org/standards/gml">http://www.opengeospatial.org/standards/gml</ulink>:
                </para>
 
-               <para>Availability: 1.5 - requires libxml2 &gt;= 2.5+</para>
+               <para>Availability: 1.5</para>
                <para>&Z_support;</para>
                <para>GML allow mixed dimensions (2D and 3D inside the same MultiGeometry for instance). As PostGIS geometries don't, ST_GeomFromGML convert the whole geometry to 2D if a missing Z dimension is found once.</para>
                
@@ -433,9 +430,6 @@ SELECT ST_GeomFromEWKT('CIRCULARSTRING(220268 150415 1,220227 150505 2,220227 15
          <refsection>
                <title>Description</title>
                <para>Constructs a PostGIS ST_Geometry object from the OGC KML representation.</para>
-               <note>
-                       <para>Requires compilation with libxml2 2.5+</para>
-               </note>
                <para>ST_GeomFromKML works only for KML Geometry fragments. It throws an error if you try to use it on a whole KML document.</para>
                <para>
                        OGC KML versions supported:
@@ -447,7 +441,7 @@ SELECT ST_GeomFromEWKT('CIRCULARSTRING(220268 150415 1,220227 150505 2,220227 15
                        OGC KML standards, cf: <ulink url="http://www.opengeospatial.org/standards/kml">http://www.opengeospatial.org/standards/kml</ulink>:
                </para>
 
-               <para>Availability: 1.5 - requires libxml2 &gt;= 2.5+</para>
+               <para>Availability: 1.5</para>
                <para>&Z_support;</para>
                <note>
                        <para>ST_GeomFromKML function not support SQL/MM curves geometries.</para>
@@ -487,7 +481,7 @@ SELECT ST_GeomFromEWKT('CIRCULARSTRING(220268 150415 1,220227 150505 2,220227 15
                  <refsection>
                        <title>Description</title>
                        <para>&sqlmm_compliant; SQL-MM 3: 5.1.50 (except for curves support).</para>
-                       <para>Availability: 1.5 - requires libxml2 &gt;= 2.5+</para>
+                       <para>Availability: 1.5</para>
                  </refsection>
                  <refsection>
                        <title>See Also</title>
index 7ab33a05311293170652b4a4c7c81decbbfa0367..acdacd5afbde650eb0c18be8c4f2ae33ab48153e 100644 (file)
@@ -404,8 +404,7 @@ the_geom IS NULL)
          <refsection>
                <title>Description</title>
 
-               <para>Returns the version number of the LibXML2 library, or
-               <varname>NULL</varname> if LibXML2 support is not enabled.</para>
+               <para>Returns the version number of the LibXML2 library.</para>
                <para>Availability: 1.5</para>
          </refsection>
 
index 86c47344b250ab52ce224537e4b2d2ca3478eb01..c20809d7eeea7b254c7339b3a75448fa636d0a95 100644 (file)
@@ -18,7 +18,7 @@
           <para>The versions below are the *minimum* requirements for PostGIS 1.5</para>
           <para>PostgreSQL 8.3 and higher on all platforms</para>
           <para>GEOS 3.0 and higher only (GEOS 3.2+ to take advantage of all features)</para>
-                 <para>libxml2 2.5+ to enable ST_GeomFromGML/KML functionality</para>
+         <para>libxml2 2.5+ related to new ST_GeomFromGML/KML functionality</para>
           <para>PROJ4 4.5 and higher only</para>
         </simplesect>
 
index 8ca3777f16f2383e8b6dd40fab187c5881cc1401..29e7a3d31a37c2ebb75293514dc87db8b9729c0c 100644 (file)
@@ -201,16 +201,12 @@ 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
 }
 
 
index 6573dfec543a8f1fdba2b6bed07f66847a920820..920adce8c2f13e8a657fe18acdb30abd478f771d 100644 (file)
@@ -39,7 +39,6 @@
 #include "executor/spi.h"
 
 
-#if HAVE_LIBXML2
 #include <libxml/tree.h> 
 #include <libxml/parser.h> 
 #include <libxml/xpath.h> 
@@ -1576,5 +1575,3 @@ static LWGEOM* parse_gml(xmlNodePtr xnode, bool *hasz, int *root_srid)
        lwerror("invalid GML representation");
        return NULL; /* Never reach */
 }
-
-#endif /* if HAVE_LIBXML2 */
index 70fc95aa76674433242905887988c4787893d4e5..06452e192d66a7ab8dc6cc0455dde2b64d2b2571 100644 (file)
@@ -32,7 +32,6 @@
 #include "liblwgeom.h"
 
 
-#if HAVE_LIBXML2
 #include <libxml/tree.h> 
 #include <libxml/parser.h> 
 
@@ -466,5 +465,3 @@ static LWGEOM* parse_kml(xmlNodePtr xnode, bool *hasz)
        lwerror("invalid KML representation");
        return NULL; /* Never reach */
 }
-
-#endif /* if HAVE_LIBXML2 */
index cfa49243530879c78ba46519c30df936784f41b9..8f5246ff5028b171b83c2f63f12da51e439270f1 100644 (file)
@@ -3428,9 +3428,7 @@ 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;
@@ -4503,7 +4501,6 @@ CREATE OR REPLACE FUNCTION ST_Equals(geometry,geometry)
        LANGUAGE 'SQL' IMMUTABLE STRICT;
 
 
-#if HAVE_LIBXML2
 -----------------------------------------------------------------------
 -- GML & KML INPUT
 -- Availability: 1.5.0
@@ -4523,7 +4520,6 @@ CREATE OR REPLACE FUNCTION ST_GeomFromKML(text)
        AS 'MODULE_PATHNAME','geom_from_kml'
        LANGUAGE 'C' IMMUTABLE STRICT;
 
-#endif
 -----------------------------------------------------------------------
 -- SVG OUTPUT
 -----------------------------------------------------------------------
index af0be9349aa6e0a0323246e1c3b5e55439a55fd3..1ca43fb34e3054f7768cbe78cb409e4d67fc1d42 100644 (file)
@@ -19,9 +19,4 @@
 #define _POSTGIS_SQL_SELECT_POSTGIS_BUILD_DATE 'SELECT ''@POSTGIS_BUILD_DATE@''::text AS version'
 #define _POSTGIS_SQL_SELECT_POSTGIS_SCRIPTS_VERSION 'SELECT ''@POSTGIS_SCRIPTS_VERSION@''::text AS version'
 
-/* 
- * libxml2 support
- */
-#define HAVE_LIBXML2 @POSTGIS_HAVE_LIBXML2@
-
 #endif /* _LWPGIS_DEFINES */
index 04a55866cfd73f3fd56ff70a7c06ed20865ee2a6..a71c3d662e7c3ca1d674fb1aa8e725e4373bbf04 100644 (file)
@@ -249,12 +249,9 @@ DROP FUNCTION AsGML(geometry);
 DROP FUNCTION ST_AsGML(geometry, int4);
 DROP FUNCTION AsGML(geometry, int4);
 DROP FUNCTION _ST_AsGML(int4, geometry, int4, int4);
-
-#if HAVE_LIBXML2
 DROP FUNCTION ST_GeomFromGML(text);
 DROP FUNCTION ST_GMLToSQL(text);
 DROP FUNCTION ST_GeomFromKML(text);
-#endif
 
 -----------------------------------------------------------------------
 -- SVG OUTPUT
index f5c846aeab1982b3642d12c6e5f37976ac75ca92..289c659810ab9626e932f0dbe6fcc4b30c68df0f 100644 (file)
@@ -21,9 +21,6 @@
 /* Define to 1 if you have the `proj' library (-lproj). */
 #undef HAVE_LIBPROJ
 
-/* libxml/tree.h libxml/parser.h header */
-#undef HAVE_LIBXML2
-
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
index f549345590c2f784bb1151ae16b3c249d2a8bd52..4e5a5e3b804cd0887c8c7b5282e1ac4555d25cc5 100644 (file)
@@ -60,6 +60,8 @@ TESTS = \
        gml \
        svg \
        kml \
+       in_gml \
+       in_kml \
        regress_ogc \
        regress_bdpoly \
        regress_proj \
@@ -87,13 +89,6 @@ ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 32),1)
        TESTS += hausdorff
 endif
 
-# Some import functions need libxml2
-ifeq ($(shell expr $(HAVE_LIBXML2) "=" 1),1)
-       TESTS += in_gml
-       TESTS += in_kml
-endif
-
-
 
 all: test