From 06d5870306c1b58823ebaae294bc67a458ce87aa Mon Sep 17 00:00:00 2001
From: Lars Knoll <lars.knoll@qt.io>
Date: Fri, 19 Aug 2016 11:56:40 +0200
Subject: [PATCH] Adjust webengine to the qtConfig() changes in qtbase

Change-Id: I907f6ea73a1d707eda536764c4b0b2edea49a963
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
---
 .../webengine/quicknanobrowser/quicknanobrowser.pro    |  2 +-
 src/core/api/core_api.pro                              |  6 +++---
 src/core/config/linux.pri                              | 10 +++++-----
 src/core/config/windows.pri                            |  2 +-
 src/core/core_gyp_generator.pro                        |  3 +--
 src/core/core_module.pro                               |  8 ++++----
 src/core/gyp_run.pro                                   | 10 +++++-----
 src/process/process.pro                                |  6 +++---
 tests/quicktestbrowser/quicktestbrowser.pro            |  2 +-
 tools/qmake/mkspecs/features/configure.prf             |  6 +++---
 tools/qmake/mkspecs/features/functions.prf             |  4 ++--
 11 files changed, 29 insertions(+), 30 deletions(-)

diff --git a/examples/webengine/quicknanobrowser/quicknanobrowser.pro b/examples/webengine/quicknanobrowser/quicknanobrowser.pro
index 6cf556984..5a27f5fd4 100644
--- a/examples/webengine/quicknanobrowser/quicknanobrowser.pro
+++ b/examples/webengine/quicknanobrowser/quicknanobrowser.pro
@@ -1,4 +1,4 @@
-requires(contains(QT_CONFIG, accessibility))
+requires(qtConfig(accessibility))
 
 TEMPLATE = app
 TARGET = quicknanobrowser
diff --git a/src/core/api/core_api.pro b/src/core/api/core_api.pro
index 6e2d606b2..cb9d33087 100644
--- a/src/core/api/core_api.pro
+++ b/src/core/api/core_api.pro
@@ -15,9 +15,9 @@ CONFIG -= create_prl
 # Copy this logic from qt_module.prf so that the intermediate library can be
 # created to the same rules as the final module linking in core_module.pro.
 !host_build:if(win32|mac):!macx-xcode {
-    contains(QT_CONFIG, simulator_and_device): CONFIG += simulator_and_device
-    contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release
-    contains(QT_CONFIG, build_all):CONFIG += build_all
+    qtConfig(simulator_and_device): CONFIG += simulator_and_device
+    qtConfig(debug_and_release): CONFIG += debug_and_release
+    qtConfig(build_all): CONFIG += build_all
 }
 
 DEFINES += \
diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri
index a71d36c53..5e04701a0 100644
--- a/src/core/config/linux.pri
+++ b/src/core/config/linux.pri
@@ -35,12 +35,12 @@ use?(nss) {
 
 gcc:!clang: greaterThan(QT_GCC_MAJOR_VERSION, 5): GYP_CONFIG += v8_no_delete_null_pointer_checks=1
 
-contains(QT_CONFIG, system-zlib): use?(system_minizip): GYP_CONFIG += use_system_zlib=1
-contains(QT_CONFIG, system-png): GYP_CONFIG += use_system_libpng=1
-contains(QT_CONFIG, system-jpeg): GYP_CONFIG += use_system_libjpeg=1
-contains(QT_CONFIG, system-harfbuzz): GYP_CONFIG += use_system_harfbuzz=1
+qtConfig(system-zlib): use?(system_minizip): GYP_CONFIG += use_system_zlib=1
+qtConfig(system-png): GYP_CONFIG += use_system_libpng=1
+qtConfig(system-jpeg): GYP_CONFIG += use_system_libjpeg=1
+qtConfig(system-harfbuzz): GYP_CONFIG += use_system_harfbuzz=1
 !contains(QT_CONFIG, pulseaudio): GYP_CONFIG += use_pulseaudio=0
-!contains(QT_CONFIG, glib): GYP_CONFIG += use_glib=0
+!qtConfig(glib): GYP_CONFIG += use_glib=0
 use?(system_libevent): GYP_CONFIG += use_system_libevent=1
 use?(system_libwebp):  GYP_CONFIG += use_system_libwebp=1
 use?(system_libsrtp):  GYP_CONFIG += use_system_libsrtp=1
diff --git a/src/core/config/windows.pri b/src/core/config/windows.pri
index ff86aea70..46dc6931a 100644
--- a/src/core/config/windows.pri
+++ b/src/core/config/windows.pri
@@ -17,7 +17,7 @@ GYP_ARGS += "-D perl_exe=\"perl.exe\" -D bison_exe=\"bison.exe\" -D gperf_exe=\"
 # Gyp's parallel processing is broken on Windows
 GYP_ARGS += "--no-parallel"
 
-contains(QT_CONFIG, angle) {
+qtConfig(angle) {
     CONFIG(release, debug|release) {
         GYP_ARGS += "-D qt_egl_library=\"libEGL.lib\" -D qt_glesv2_library=\"libGLESv2.lib\""
     } else {
diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro
index 70644e5f6..b2cd7b693 100644
--- a/src/core/core_gyp_generator.pro
+++ b/src/core/core_gyp_generator.pro
@@ -25,8 +25,7 @@ RCC_DIR = $$OUT_PWD/$$getConfigDir()/.rcc
 # whenever we are cross compiling.
 cross_compile: DEFINES += QTWEBENGINE_EMBEDDED_SWITCHES
 
-contains(QT_CONFIG, egl): CONFIG += egl
-else: DEFINES += QT_NO_EGL
+qtConfig(egl): CONFIG += egl
 
 RESOURCES += devtools.qrc
 
diff --git a/src/core/core_module.pro b/src/core/core_module.pro
index 3b9dab457..65e46dcec 100644
--- a/src/core/core_module.pro
+++ b/src/core/core_module.pro
@@ -40,9 +40,9 @@ win32-msvc* {
 # and doesn't let Chromium get access to libc symbols through dlsym.
 CONFIG -= bsymbolic_functions
 
-contains(QT_CONFIG, egl): CONFIG += egl
+qtConfig(egl): CONFIG += egl
 
-linux: contains(QT_CONFIG, separate_debug_info): QMAKE_POST_LINK="cd $(DESTDIR) && $(STRIP) --strip-unneeded $(TARGET)"
+linux:qtConfig(separate_debug_info): QMAKE_POST_LINK="cd $(DESTDIR) && $(STRIP) --strip-unneeded $(TARGET)"
 
 REPACK_DIR = $$OUT_PWD/$$getConfigDir()/gen/repack
 # Duplicated from resources/resources.gyp
@@ -58,7 +58,7 @@ resources.files = $$REPACK_DIR/qtwebengine_resources.pak \
 icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat
 
 !debug_and_release|!build_all|CONFIG(release, debug|release) {
-    contains(QT_CONFIG, qt_framework) {
+    qtConfig(framework) {
         locales.version = Versions
         locales.path = Resources/qtwebengine_locales
         resources.version = Versions
@@ -83,7 +83,7 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat
         }
     }
 
-    !contains(QT_CONFIG, qt_framework):!force_independent {
+    !qtConfig(framework):!force_independent {
         #
         # Copy essential files to the qtbase build directory for non-prefix builds
         #
diff --git a/src/core/gyp_run.pro b/src/core/gyp_run.pro
index 2264d9b70..ea911afda 100644
--- a/src/core/gyp_run.pro
+++ b/src/core/gyp_run.pro
@@ -22,7 +22,7 @@ GYP_CONFIG += disable_glibcxx_debug=1
 !webcore_debug: GYP_CONFIG += remove_webcore_debug_symbols=1
 !v8base_debug: GYP_CONFIG += remove_v8base_debug_symbols=1
 
-linux:contains(QT_CONFIG, separate_debug_info): GYP_CONFIG += linux_dump_symbols=1
+linux:qtConfig(separate_debug_info): GYP_CONFIG += linux_dump_symbols=1
 
 force_debug_info {
     win32: GYP_CONFIG += win_release_extra_cflags=-Zi
@@ -34,9 +34,9 @@ force_debug_info {
 # Copy this logic from qt_module.prf so that ninja can run according
 # to the same rules as the final module linking in core_module.pro.
 !host_build:if(win32|mac):!macx-xcode {
-    contains(QT_CONFIG, simulator_and_device): CONFIG += simulator_and_device
-    contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release
-    contains(QT_CONFIG, build_all):CONFIG += build_all
+    qtConfig(simulator_and_device): CONFIG += simulator_and_device
+    qtConfig(debug_and_release): CONFIG += debug_and_release
+    qtConfig(build_all): CONFIG += build_all
 }
 
 cross_compile {
@@ -124,7 +124,7 @@ contains(WEBENGINE_CONFIG, no_spellcheck): {
     osx: GYP_CONFIG += use_browser_spellchecker=1
 }
 
-!contains(QT_CONFIG, qt_framework): contains(QT_CONFIG, private_tests) {
+!qtConfig(framework):qtConfig(private_tests) {
     GYP_CONFIG += qt_install_data=\"$$[QT_INSTALL_DATA/get]\"
     GYP_CONFIG += qt_install_translations=\"$$[QT_INSTALL_TRANSLATIONS/get]\"
 }
diff --git a/src/process/process.pro b/src/process/process.pro
index cd60b1f91..5e2e734f4 100644
--- a/src/process/process.pro
+++ b/src/process/process.pro
@@ -16,9 +16,9 @@ win32 {
 
 load(qt_app)
 
-contains(QT_CONFIG, build_all): CONFIG += build_all
+qtConfig(build_all): CONFIG += build_all
 
-contains(QT_CONFIG, qt_framework) {
+qtConfig(framework) {
     # Deploy the QtWebEngineProcess app bundle into the QtWebEngineCore framework.
     DESTDIR = $$MODULE_BASE_OUTDIR/lib/QtWebEngineCore.framework/Versions/5/Helpers
 } else {
@@ -28,7 +28,7 @@ contains(QT_CONFIG, qt_framework) {
 }
 msvc: QMAKE_LFLAGS *= /LARGEADDRESSAWARE
 
-contains(QT_CONFIG, qt_framework) {
+qtConfig(framework) {
     target.path = $$[QT_INSTALL_LIBS]/QtWebEngineCore.framework/Versions/5/Helpers
 } else {
     target.path = $$[QT_INSTALL_LIBEXECS]
diff --git a/tests/quicktestbrowser/quicktestbrowser.pro b/tests/quicktestbrowser/quicktestbrowser.pro
index 996e82a63..b4fb9a58d 100644
--- a/tests/quicktestbrowser/quicktestbrowser.pro
+++ b/tests/quicktestbrowser/quicktestbrowser.pro
@@ -1,4 +1,4 @@
-requires(contains(QT_CONFIG, accessibility))
+requires(qtConfig(accessibility))
 
 TEMPLATE = app
 TARGET = quicktestbrowser
diff --git a/tools/qmake/mkspecs/features/configure.prf b/tools/qmake/mkspecs/features/configure.prf
index 9663c1072..597a6d9d3 100644
--- a/tools/qmake/mkspecs/features/configure.prf
+++ b/tools/qmake/mkspecs/features/configure.prf
@@ -24,10 +24,10 @@ defineTest(runConfigure) {
         !config_khr:skipBuild("khronos development headers appear to be missing (mesa/libegl1-mesa-dev)")
 
         REQUIRED_PACKAGES = dbus-1 fontconfig
-        !cross_compile: contains(QT_CONFIG, xcb): REQUIRED_PACKAGES += libdrm xcomposite xcursor xi xrandr xscrnsaver xtst
+        !cross_compile: qtConfig(xcb): REQUIRED_PACKAGES += libdrm xcomposite xcursor xi xrandr xscrnsaver xtst
         contains(QT_CONFIG, pulseaudio): REQUIRED_PACKAGES += libpulse
-        contains(QT_CONFIG, system-png): REQUIRED_PACKAGES += libpng
-        contains(QT_CONFIG, system-harfbuzz): REQUIRED_PACKAGES += harfbuzz
+        qtConfig(system-png): REQUIRED_PACKAGES += libpng
+        qtConfig(system-harfbuzz): REQUIRED_PACKAGES += harfbuzz
         !cross_compile: REQUIRED_PACKAGES += libpci
 
         for(package, $$list($$REQUIRED_PACKAGES)) {
diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf
index c8c8e0cc8..590d521e8 100644
--- a/tools/qmake/mkspecs/features/functions.prf
+++ b/tools/qmake/mkspecs/features/functions.prf
@@ -50,7 +50,7 @@ defineTest(isPlatformSupported) {
     skipBuild("C++11 support is required in order to build chromium.")
     return(false)
   }
-  contains(QT_CONFIG, mirclient) {
+  qtConfig(mirclient) {
     skipBuild("Mir is not yet supported as graphics backend for Qt WebEngine.")
     return(false)
   }
@@ -90,7 +90,7 @@ defineTest(isGCCVersionSupported) {
 }
 
 defineTest(isQMLTestSupportApiEnabled) {
-    contains(QT_CONFIG, private_tests): return(true) # enable for developer-build
+    qtConfig(private_tests): return(true) # enable for developer-build
     contains(QT_BUILD_PARTS, tests): return(true)
     contains(WEBENGINE_CONFIG, testsupport): return(true)
     return(false)
-- 
GitLab