From 8fac402edefde2bc876d44168aaafb26a420e508 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 11 Apr 2018 10:05:13 +0200
Subject: [PATCH] Simplify libxml2 system compatibility detection

Test for icu also in xml2 compile test.

Change-Id: I435f609761cb299f58a9b5f68e31698bb238ab1c
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
---
 config.tests/xml2/xml2.cpp |  3 +++
 configure.json             | 11 +++--------
 configure.pri              | 10 ----------
 3 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/config.tests/xml2/xml2.cpp b/config.tests/xml2/xml2.cpp
index 17c3e3ca0..93bc80c97 100644
--- a/config.tests/xml2/xml2.cpp
+++ b/config.tests/xml2/xml2.cpp
@@ -30,6 +30,9 @@
 #if defined(LIBXML_CATALOG_ENABLED)
 #error "libxml catalog enabled"
 #endif
+#if !defined(LIBXML_ICU_ENABLED)
+#error "libxml icu not enabled"
+#endif
 
 int main(int argc, char **argv)
 {
diff --git a/configure.json b/configure.json
index d1ae781a6..cd8098c56 100644
--- a/configure.json
+++ b/configure.json
@@ -288,12 +288,8 @@
             "label": "glibc > 2.16",
             "type": "detectGlibc"
         },
-        "webengine-libxml2-with-icuuc": {
-            "label" : "libxml2 configured with icuuc",
-            "type": "detectLibXml2WithIcuuc"
-        },
-        "webengine-libxml2-without-catalog-support": {
-            "label" : "libxml2 configured without catalog support",
+        "webengine-libxml2-compatible": {
+            "label" : "compatible system libxml2",
             "test" : "xml2",
             "type": "compile"
         },
@@ -587,8 +583,7 @@
             "label": "libxml2 and libxslt",
             "condition": "config.unix
                          && libs.webengine-libxml2
-                         && tests.webengine-libxml2-with-icuuc
-                         && tests.webengine-libxml2-without-catalog-support",
+                         && tests.webengine-libxml2-compatible",
             "output": [ "privateFeature" ]
         },
         "webengine-system-lcms2" : {
diff --git a/configure.pri b/configure.pri
index db36a7ff7..82a7de227 100644
--- a/configure.pri
+++ b/configure.pri
@@ -147,16 +147,6 @@ defineTest(qtConfTest_embedded) {
     return(false)
 }
 
-defineTest(qtConfTest_detectLibXml2WithIcuuc) {
-   pkgConfig = $$qtConfPkgConfig()
-   !isEmpty(pkgConfig) {
-       qtRunLoggedCommand("$$pkgConfig --libs --static libxml-2.0", xmllibs)
-       contains(xmllibs,".*-licuuc.*"):return(true)
-       qtLog("System libxml2 is not configured with ICU")
-   }
-   return(false)
-}
-
 defineTest(qtConfTest_detectHostPkgConfig) {
    PKG_CONFIG = $$qtConfPkgConfig(true)
    isEmpty(PKG_CONFIG) {
-- 
GitLab