View Ticket
Not logged in
Ticket Hash: ac85f0fca35de00b9aaadb5078061791fc799d9c
Title: Fails to build with libxml 2.14.x
Status: Open Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Resolution: Open
Last Modified: 2025-08-14 14:55:38
Version Found In: 5.1.0
User Comments:
anonymous added on 2025-05-27 07:56:03:

As reported by Matthias Klose in Debian Bug #1106621:

http://qa-logs.debian.net/2025/05/23/spatialite_5.1.0-3_unstable_libxml2.log

[...]
wfs_in.c: In function 'reset_wfs_http_connection':
wfs_in.c:4640:5: error: implicit declaration of function 
'xmlNanoHTTPCleanup' [-Wimplicit-function-declaration]
 4640 |     xmlNanoHTTPCleanup ();
      |     ^~~~~~~~~~~~~~~~~~
wfs_in.c: In function 'reset_wfs_http_connection':
wfs_in.c:4640:5: error: implicit declaration of function 
'xmlNanoHTTPCleanup' [-Wimplicit-function-declaration]
 4640 |     xmlNanoHTTPCleanup ();
      |     ^~~~~~~~~~~~~~~~~~
make[4]: *** [Makefile:418: wfs_in.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: *** [Makefile:425: wfs_la-wfs_in.lo] Error 1

anonymous added on 2025-06-02 12:18:41:

Update from Mattias Klose in the Debian bugreport:

from libxml2 NEWS:

Support for HTTP and LZMA compression is planned to be removed in the 2.15 release.

I have now uploaded libxml2 with these two features explicitly enabled. But better prepare for 2.15 ...


anonymous added on 2025-08-14 14:55:38:

Proposed patch:

Index: spatialite-5.1.0/configure.ac
===================================================================
--- spatialite-5.1.0.orig/configure.ac
+++ spatialite-5.1.0/configure.ac
@@ -61,6 +61,8 @@ AH_TEMPLATE([OMIT_FREEXL],
             [Should be defined in order to disable FREEXL support.])
 AH_TEMPLATE([ENABLE_LIBXML2],
             [Should be defined in order to enable LIBXML2 support.])
+AH_TEMPLATE([ENABLE_LIBXML2_NANOHTTP],
+            [Should be defined in order to enable LIBXML2 HTTP support.])
 AH_TEMPLATE([ENABLE_MINIZIP],
             [Should be defined in order to enable MiniZIP support.])
 AH_TEMPLATE([ENABLE_GEOPACKAGE],
@@ -441,6 +443,7 @@ if test x"$enable_libxml2" != "xno"; the
   AC_SUBST(LIBXML2_CFLAGS)
   AC_SUBST(LIBXML2_LIBS)
   AC_DEFINE(ENABLE_LIBXML2)
+  AC_SEARCH_LIBS(xmlNanoHTTPCleanup,xml2,AC_DEFINE(ENABLE_LIBXML2_NANOHTTP),,)
 fi
 
 #-----------------------------------------------------------------------
Index: spatialite-5.1.0/src/wfs/wfs_in.c
===================================================================
--- spatialite-5.1.0.orig/src/wfs/wfs_in.c
+++ spatialite-5.1.0/src/wfs/wfs_in.c
@@ -76,7 +76,10 @@ Regione Toscana - Settore Sistema Inform
 #ifdef ENABLE_LIBXML2          /* LIBXML2 enabled: supporting XML documents */
 
 #include <libxml/parser.h>
+
+#ifdef ENABLE_LIBXML2_NANOHTTP
 #include <libxml/nanohttp.h>
+#endif
 
 #define MAX_GTYPES     28
 
@@ -4636,8 +4639,13 @@ get_wfs_schema_column_info (gaiaWFScolum
 SPATIALITE_DECLARE void
 reset_wfs_http_connection (void)
 {
+#ifdef ENABLE_LIBXML2_NANOHTTP
 /* Resets the libxml2 "nano HTTP": useful when changing the HTTP_PROXY settings */
     xmlNanoHTTPCleanup ();
+#else
+/* LIBXML2 doesn't have HTTP support: does absolutely nothing */
+    return;
+#endif
 }
 
 #else /* LIBXML2 isn't enabled */