diff --git a/configure.json b/configure.json
index 9c49729beeba8baaa44c9317ab120673fbecdf8e..4801beb9433f45e56442a5c23c411a3b62fd0396 100644
--- a/configure.json
+++ b/configure.json
@@ -1,7 +1,335 @@
 {
+    "files": {
+       "privatePro": "src/qtwebengine-main-config.pri"
+    },
+
     "subconfigs": [
         "src/core",
         "src/webengine",
         "src/webenginewidgets"
+    ],
+    "commandline": {
+        "options": {
+            "webengine-core": "boolean"
+        }
+    },
+    "libraries": {
+        "webengine-dbus": {
+            "label": "d-bus",
+            "sources": [
+                { "type": "pkgConfig", "args": "dbus-1" }
+            ]
+        },
+        "webengine-fontconfig": {
+            "label": "fontconfig",
+            "sources": [
+                { "type": "pkgConfig", "args": "fontconfig" }
+            ]
+        },
+        "webengine-libdrm": {
+            "label": "libdrm",
+            "sources": [
+                { "type": "pkgConfig", "args": "libdrm" }
+            ]
+        },
+        "webengine-xcomposite": {
+            "label": "xcomposite",
+            "sources": [
+                { "type": "pkgConfig", "args": "xcomposite" }
+            ]
+        },
+        "webengine-xcursor": {
+            "label": "xcursor",
+            "sources": [
+                { "type": "pkgConfig", "args": "xcursor" }
+            ]
+        },
+        "webengine-xi": {
+            "label": "xi",
+            "sources": [
+                { "type": "pkgConfig", "args": "xi" }
+            ]
+        },
+        "webengine-xtst": {
+            "label": "xtst",
+            "sources": [
+                { "type": "pkgConfig", "args": "xtst" }
+            ]
+        },
+        "webengine-nss": {
+            "label": "nss >= 3.26",
+            "sources": [
+                { "type": "pkgConfig", "args": "nss >= 3.26" }
+            ]
+        },
+        "webengine-x11" : {
+            "label" : "x11",
+            "sources": [
+                { "type": "pkgConfig", "args": "x11" }
+            ]
+        }
+    },
+
+    "testDir": "config.tests",
+    "tests" : {
+        "webengine-bison": {
+            "label": "bison",
+            "type": "detectBison"
+        },
+        "webengine-flex": {
+            "label": "flex",
+            "type": "detectFlex"
+        },
+        "webengine-gn": {
+            "label": "system gn",
+            "type": "detectGn"
+        },
+        "webengine-glibc": {
+            "label": "glibc > 2.26",
+            "type": "compile",
+            "test": {
+                "include": "features.h",
+                "tail": [
+                    "#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 27",
+                    "#error glibc versions below 2.27 are not supported",
+                    "#endif"
+                ]
+            }
+        },
+        "webengine-gperf": {
+            "label": "gperf",
+            "type": "detectGperf"
+        },
+        "webengine-khr": {
+            "label": "khr",
+            "type": "compile",
+            "test": {
+                "include": "KHR/khrplatform.h",
+                "qmake" : [
+                    "!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL",
+                    "!isEmpty(QMAKE_INCDIR_OPENGL): INCLUDEPATH += $$QMAKE_INCDIR_OPENGL"
+                ]
+            }
+        },
+        "webengine-ninja": {
+            "label": "system ninja",
+            "type": "detectNinja"
+        },
+        "webengine-python2": {
+            "label": "python2",
+            "type": "detectPython2",
+            "log": "location"
+        },
+        "webengine-winversion": {
+            "label": "winversion",
+            "type": "compile",
+            "test": {
+                 "head" : [
+                    "#if !defined(__clang__) && _MSC_FULL_VER < 191426428",
+                    "#error unsupported Visual Studio version",
+                    "#endif"
+                 ]
+            }
+        },
+        "webengine-host-pkg-config": {
+                   "label": "host pkg-config",
+                   "type": "detectHostPkgConfig",
+                   "log": "path"
+        },
+        "webengine-xcb": {
+            "label": "qtbase xcb",
+            "type": "detectXcb"
+        }
+    },
+    "features": {
+        "webengine-core": {
+            "label": "Support Qt WebEngine Core",
+            "purpose": "Provides WebEngine Core support.",
+            "condition": "module.gui
+                         && features.webengine-python2
+                         && features.webengine-gperf
+                         && features.webengine-bison
+                         && features.webengine-flex
+                         && (!tests.webengine-xcb || features.webengine-ozone-x11)",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-python2": {
+            "label": "python2",
+            "condition": "tests.webengine-python2",
+            "output": [
+                "privateFeature",
+                { "type": "varAssign", "name": "QMAKE_PYTHON2", "value": "tests.webengine-python2.location" }
+            ]
+        },
+        "webengine-gperf": {
+            "label": "gperf",
+            "condition": "tests.webengine-gperf",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-bison": {
+            "label": "bison",
+            "condition": "tests.webengine-bison",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-flex": {
+            "label": "flex",
+            "condition": "tests.webengine-flex",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-system-ninja": {
+            "label": "Use System Ninja",
+            "condition": "tests.webengine-ninja",
+            "output": [ "privateFeature" ]
+        },
+           "webengine-system-fontconfig": {
+            "label": "fontconfig",
+            "condition": "libs.webengine-fontconfig",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-system-dbus": {
+            "label": "dbus",
+            "condition": "libs.webengine-dbus",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-system-libdrm": {
+            "label": "libdrm",
+            "condition": "libs.webengine-libdrm",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-system-xcomposite": {
+            "label": "xcomposite",
+            "condition": "libs.webengine-xcomposite",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-system-xcursor": {
+            "label": "xcursor",
+            "condition": "libs.webengine-xcursor",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-system-xi": {
+            "label": "xi",
+            "condition": "libs.webengine-xi",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-system-xtst": {
+            "label": "xtst",
+            "condition": "libs.webengine-xtst",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-system-gn": {
+            "label": "Use System Gn",
+            "autoDetect": "false",
+            "condition": "tests.webengine-gn",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-system-khr" : {
+            "label": "khr",
+            "condition": "config.unix && tests.webengine-khr",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-system-nss": {
+            "label": "nss",
+            "condition": "config.unix && !config.darwin && libs.webengine-nss",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-system-glibc": {
+            "label": "glibc",
+            "condition": "config.linux && tests.webengine-glibc",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-system-x11" : {
+            "label": "x11",
+            "condition": "config.unix && libs.webengine-x11",
+            "output": [ "privateFeature" ]
+        },
+        "webengine-host-pkg-config": {
+            "label": "host-pkg-config",
+            "condition": "config.unix && tests.webengine-host-pkg-config",
+            "output": [
+                "privateFeature",
+                { "type": "varAssign", "name": "QMAKE_PKG_CONFIG_HOST", "value": "tests.webengine-host-pkg-config.path" }
+            ]
+        },
+        "webengine-ozone-x11" : {
+             "label": "Support qpa-xcb",
+             "condition": "config.unix
+                          && tests.webengine-xcb
+                          && features.webengine-system-x11
+                          && features.webengine-system-libdrm
+                          && features.webengine-system-xcomposite
+                          && features.webengine-system-xcursor
+                          && features.webengine-system-xi
+                          && features.webengine-system-xtst",
+             "output": [ "privateFeature" ]
+        },
+        "webengine-winversion" : {
+            "label": "winversion",
+            "condition": "config.win32 && tests.webengine-winversion",
+            "output": [ "privateFeature" ]
+        }
+    },
+    "report": [
+        {
+            "type": "warning",
+            "condition": "!module.gui",
+            "message": "QtWebEngine requires QtGui."
+        },
+        {
+            "type": "warning",
+            "condition": "!features.webengine-python2",
+            "message": "Python version 2 (2.7.5 or later) is required to build QtWebEngine."
+        },
+        {
+            "type": "warning",
+            "condition": "!features.webengine-gperf",
+            "message": "gperf is required to build QtWebEngine."
+        },
+        {
+            "type": "warning",
+            "condition": "!features.webengine-bison",
+            "message": "bison is required to build QtWebEngine."
+        },
+        {
+            "type": "warning",
+            "condition": "!features.webengine-flex",
+            "message": "flex is required to build QtWebEngine."
+        },
+        {
+            "type": "warning",
+            "condition": "config.linux && !features.webengine-ozone-x11 && tests.webengine-xcb",
+            "message": "Could not find all necessary libraries for qpa-xcb support."
+        }
+    ],
+    "summary": [
+        {
+            "section": "Build Tools",
+            "entries": [
+                "webengine-system-ninja",
+                "webengine-system-gn"
+            ]
+        },
+        {
+            "section": "Required system libraries",
+            "condition": "config.unix && !config.macos && features.webengine-core",
+            "entries": [
+                "webengine-system-fontconfig",
+                "webengine-system-dbus",
+                "webengine-system-nss",
+                "webengine-system-khr",
+                "webengine-system-glibc"
+            ]
+        },
+        {
+            "section": "Required system libraries for qpa-xcb",
+            "condition": "config.unix && !config.macos && features.webengine-core",
+            "entries": [
+                "webengine-system-x11",
+                "webengine-system-libdrm",
+                "webengine-system-xcomposite",
+                "webengine-system-xcursor",
+                "webengine-system-xi",
+                "webengine-system-xtst"
+             ]
+        }
     ]
 }
diff --git a/configure.pri b/configure.pri
index 23f72c5c63d26bc9b00f7e9b9d49a099d878f3bf..a90b066875affc87e47020ad942392e1c9404999 100644
--- a/configure.pri
+++ b/configure.pri
@@ -120,7 +120,7 @@ defineTest(qtConfTest_detectGn) {
     return(false)
 }
 
-defineTest(qtConfTest_embedded) {
+defineTest(qtConfTest_detectEmbedded) {
     lessThan(QT_MINOR_VERSION, 9) {
         cross_compile: return(true)
         return(false)
@@ -129,6 +129,20 @@ defineTest(qtConfTest_embedded) {
     return(false)
 }
 
+defineTest(qtConfTest_detectXcb) {
+    #workaround for for not working 'depends' in main configure when no 'module'
+    QT_FOR_CONFIG += gui-private
+    qtConfig(xcb): return(true)
+    return(false)
+}
+
+defineTest(qtConfTest_detectDeveloperBuild) {
+    #workaround for for not working 'depends' in main configure when no 'module'
+    QT_FOR_CONFIG += core-private
+    qtConfig(private_tests): return(true) # enabled for developer-build
+    return(false)
+}
+
 defineTest(qtConfTest_detectHostPkgConfig) {
    PKG_CONFIG = $$qtConfPkgConfig(true)
    isEmpty(PKG_CONFIG) {
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
deleted file mode 100644
index cc84182b7ecc51ef4e3176408c85fe28e9afede2..0000000000000000000000000000000000000000
--- a/mkspecs/features/configure.prf
+++ /dev/null
@@ -1,103 +0,0 @@
-# Load configure.prf from qtbase first
-load(configure)
-load(functions)
-load(platform)
-
-defineTest(runConfigure) {
-    !qtHaveModule(gui) {
-        skipBuild("QtWebEngine requires QtGui.")
-        return(false)
-    }
-
-    !exists(src/3rdparty/chromium) {
-        skipBuild("Submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.")
-        return(false)
-    }
-
-    WSPC = $$find(OUT_PWD, \\s)
-    !isEmpty(WSPC) {
-        skipBuild("QtWebEngine cannot be built in a path that contains whitespace characters.")
-        return(false)
-    }
-
-    !isPlatformSupported() {
-        # make sure we have skipBuildReason
-        isEmpty(skipBuildReason): skipBuild("Unknow error. Platform unspported")
-        return(false)
-    }
-
-    linux:contains(QT_CONFIG,no-pkg-config) {
-        skipBuild("pkg-config is required")
-        return(false)
-    }
-
-    include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
-    QT_FOR_CONFIG += webenginecore-private
-
-    !qtConfig(webengine-v8-snapshot-support):qtConfig(webengine-v8-snapshot) {
-        skipBuild("V8 snapshot cannot be built. Most likely, the 32-bit host compiler does not work."\
-                  "Please make sure you have 32-bit devel environment installed, or "\
-                  "configure webengine with '-no-webengine-v8-snapshot'")
-        return(false)
-    }
-
-    win32:!qtConfig(webengine-win-compiler64) {
-        skipBuild("Required 64-bit cross-building or native toolchain could not be found.")
-        return(false)
-    }
-
-    !qtConfig(webengine-gperf) {
-        skipBuild("Required gperf could not be found.")
-        return(false)
-    }
-    !qtConfig(webengine-bison) {
-        skipBuild("Required bison could not be found.")
-        return(false)
-    }
-    !qtConfig(webengine-flex) {
-        skipBuild("Required flex could not be found.")
-        return(false)
-    }
-    !qtConfig(webengine-python2) {
-        skipBuild("A suitable version of python2 could not be found.")
-        return(false)
-    }
-
-    sanitizer: !qtConfig(webengine-sanitizer) {
-        skipBuild("Chosen sanitizer configuration is not supported. Check config.log for details or use -feature-webengine-sanitizer to force build with the chosen sanitizer configuration.")
-        return(false);
-    }
-
-    linux {
-
-        !qtConfig(webengine-host-pkg-config) {
-            skipBuild("Host pkg-config is required")
-            return(false)
-        }
-
-        !qtConfig(webengine-system-glibc) {
-            skipBuild("A suitable version >= 2.27 of libc could not be found.")
-            return(false)
-        }
-
-        QT_FOR_CONFIG += gui-private
-
-        !qtConfig(webengine-system-khr) {
-            skipBuild("khronos development headers appear to be missing (mesa/libegl1-mesa-dev)")
-            return(false)
-        }
-
-        for(package, $$list("nss dbus fontconfig")) {
-            !qtConfig(webengine-system-$$package) {
-                skipBuild("A suitable version of $$package could not be found.")
-                return(false)
-            }
-         }
-
-        !qtConfig(webengine-embedded-build): qtConfig(xcb) : !qtConfig(webengine-ozone-x11) {
-            skipBuild("Could not find all necessary libraries for qpa-xcb support")
-            return(false)
-        }
-    }
-}
-
diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf
index d3eda85b2d5fbfe32d5ea64343709f80f8a1b4c6..f858243e1f8efb674f00aaa571838e8d00327c09 100644
--- a/mkspecs/features/functions.prf
+++ b/mkspecs/features/functions.prf
@@ -96,16 +96,103 @@ defineReplace(gnOS) {
     return(unknown)
 }
 
-defineTest(isDeveloperBuild) {
-    qtConfig(private_tests): return(true) # enabled for developer-build
-    return(false)
-}
-
 defineTest(skipBuild) {
-    skipBuildReason = "$$skipBuildReason $${EOL}$$1"
+    isEmpty(skipBuildReason): skipBuildReason = $$1
+    else: skipBuildReason = "$$skipBuildReason $${EOL}$$1"
     export(skipBuildReason)
 }
 
+defineTest(isWebEngineCoreBuild) {
+    !qtHaveModule(gui) {
+        skipBuild("QtWebEngine requires QtGui.")
+        return(false)
+    }
+
+    !exists($$QTWEBENGINE_ROOT/src/3rdparty/chromium) {
+        skipBuild("Submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.")
+        return(false)
+    }
+
+    WSPC = $$find(OUT_PWD, \\s)
+    !isEmpty(WSPC) {
+        skipBuild("QtWebEngine cannot be built in a path that contains whitespace characters.")
+        return(false)
+    }
+
+    !isPlatformSupported() {
+        # make sure we have skipBuildReason
+        isEmpty(skipBuildReason): skipBuild("Unknow error. Platform unspported")
+        return(false)
+    }
+
+    linux:contains(QT_CONFIG,no-pkg-config) {
+        skipBuild("pkg-config is required")
+        return(false)
+    }
+
+    include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
+    QT_FOR_CONFIG += webenginecore-private
+
+    win32:!qtConfig(webengine-win-compiler64) {
+        skipBuild("Required 64-bit cross-building or native toolchain could not be found.")
+        return(false)
+    }
+
+    !qtConfig(webengine-gperf) {
+        skipBuild("Required gperf could not be found.")
+        return(false)
+    }
+    !qtConfig(webengine-bison) {
+        skipBuild("Required bison could not be found.")
+        return(false)
+    }
+    !qtConfig(webengine-flex) {
+        skipBuild("Required flex could not be found.")
+        return(false)
+    }
+    !qtConfig(webengine-python2) {
+        skipBuild("A suitable version of python2 could not be found.")
+        return(false)
+    }
+
+    sanitizer: !qtConfig(webengine-sanitizer) {
+        skipBuild("Chosen sanitizer configuration is not supported. Check config.log for details or use -feature-webengine-sanitizer to force build with the chosen sanitizer configuration.")
+        return(false);
+    }
+
+    linux {
+
+        !qtConfig(webengine-host-pkg-config) {
+            skipBuild("Host pkg-config is required")
+            return(false)
+        }
+
+        !qtConfig(webengine-system-glibc) {
+            skipBuild("A suitable version >= 2.27 of libc could not be found.")
+            return(false)
+        }
+
+        QT_FOR_CONFIG += gui-private
+
+        !qtConfig(webengine-system-khr) {
+            skipBuild("khronos development headers appear to be missing (mesa/libegl1-mesa-dev)")
+            return(false)
+        }
+
+        for(package, $$list("nss dbus fontconfig")) {
+            !qtConfig(webengine-system-$$package) {
+                skipBuild("A suitable version of $$package could not be found.")
+                return(false)
+            }
+         }
+
+        qtConfig(xcb) : !qtConfig(webengine-ozone-x11) {
+            skipBuild("Could not find all necessary libraries for qpa-xcb support")
+            return(false)
+        }
+    }
+}
+
 defineReplace(pkgConfigHostExecutable) {
     wrapper_name = $$OUT_PWD/pkg-config-host_wrapper.sh
     wrapper_cmd = $$QMAKE_PKG_CONFIG_HOST
diff --git a/mkspecs/features/platform.prf b/mkspecs/features/platform.prf
index ef1c86d39292d1fec8d810035863907c3385b388..bdd81d33762e0598025e7b6307896c6c71d321c5 100644
--- a/mkspecs/features/platform.prf
+++ b/mkspecs/features/platform.prf
@@ -1,5 +1,4 @@
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
-QT_FOR_CONFIG += webenginecore-private
+include($$QTWEBENGINE_OUT_ROOT/src/qtwebengine-main-config.pri)
 
 defineTest(isQtMinimum) {
     !equals(QT_MAJOR_VERSION, $$1): return(false)
@@ -24,6 +23,7 @@ defineTest(isPlatformSupported) {
     }
     isBuildingOnWin32() {
       skipBuild("Qt WebEngine on Windows must be built on a 64-bit machine.")
+      return(false)
     }
     !msvc|intel_icl {
       skipBuild("Qt WebEngine on Windows requires MSVC or Clang (MSVC mode).")
diff --git a/qtwebengine.pro b/qtwebengine.pro
index 620f451f161d8522eba6e4128ade429a016c13a0..6d4089b26dbe5aac6da11f8a3c8bc3beb0c65386 100644
--- a/qtwebengine.pro
+++ b/qtwebengine.pro
@@ -1,13 +1,6 @@
 load(qt_parts)
-load(configure)
-
-runConfigure()
-
-!isEmpty(skipBuildReason) {
-    SUBDIRS =
-    log($${skipBuildReason}$${EOL})
-    log(QtWebEngine will not be built.$${EOL})
-}
+load(functions)
+load(platform)
 
 QMAKE_DISTCLEAN += .qmake.cache
 
@@ -20,3 +13,7 @@ OTHER_FILES = \
     config.tests/snappy/* \
     config.tests/re2/* \
     mkspecs/features/*
+
+!isWebEngineCoreBuild():!isEmpty(skipBuildReason):!build_pass {
+    log(QtWebEngine will not be built. $${skipBuildReason} $${EOL})
+}
diff --git a/src/buildtools/gn.pro b/src/buildtools/gn.pro
index b6bf9cfc4da1eda1e745b2065b410984595a0cb1..6b0a41fbe7d09114266f06af933e585c279c26c0 100644
--- a/src/buildtools/gn.pro
+++ b/src/buildtools/gn.pro
@@ -3,7 +3,7 @@ option(host_build)
 
 !debug_and_release: CONFIG += release
 
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
+include($$QTWEBENGINE_OUT_ROOT/src/qtwebengine-main-config.pri)
 QT_FOR_CONFIG += webenginecore-private
 
 build_pass|!debug_and_release {
diff --git a/src/buildtools/ninja.pro b/src/buildtools/ninja.pro
index 6382d6cfbd28c242a434723b0f69ed6a975112aa..dee285b7e12c686593116b99c41c83eaa9cbb4c2 100644
--- a/src/buildtools/ninja.pro
+++ b/src/buildtools/ninja.pro
@@ -2,7 +2,7 @@ TEMPLATE = aux
 
 !debug_and_release: CONFIG += release
 
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
+include($$QTWEBENGINE_OUT_ROOT/src/qtwebengine-main-config.pri)
 QT_FOR_CONFIG += webenginecore-private
 
 build_pass|!debug_and_release {
diff --git a/src/core/config/common.pri b/src/core/config/common.pri
index edebdb33cce6215f1e901dc741b2a09afd344a37..019b77c49179cd00a636967096ae6807da8abbfa 100644
--- a/src/core/config/common.pri
+++ b/src/core/config/common.pri
@@ -73,11 +73,11 @@ precompile_header {
     gn_args += enable_precompiled_headers=false
 }
 
-CONFIG(release, debug|release):!isDeveloperBuild() {
+CONFIG(release, debug|release):!qtConfig(webengine-developer-build) {
     gn_args += is_official_build=true
 } else {
     gn_args += is_official_build=false
-    !isDeveloperBuild(): gn_args += is_unsafe_developer_build=false
+    !qtConfig(webengine-developer-build): gn_args += is_unsafe_developer_build=false
 }
 
 CONFIG(release, debug|release) {
@@ -116,7 +116,7 @@ optimize_size: gn_args += optimize_for_size=true
     sanitize_undefined: gn_args += is_ubsan=true is_ubsan_vptr=true
 }
 
-qtConfig(webengine-v8-snapshot) {
+qtConfig(webengine-v8-snapshot):qtConfig(webengine-v8-snapshot-support) {
     gn_args += v8_use_snapshot=true
 } else {
     gn_args += v8_use_snapshot=false
diff --git a/src/core/config/windows.pri b/src/core/config/windows.pri
index 385faeed056963ab47cf560cb02cf8944dfb6193..dfa40e9dcc184cd5af9ce28f2e5d02cdcda5156c 100644
--- a/src/core/config/windows.pri
+++ b/src/core/config/windows.pri
@@ -22,7 +22,7 @@ clang_cl {
     gn_args += is_clang=false use_lld=false
 }
 
-isDeveloperBuild() {
+qtConfig(webengine-developer-build) {
     gn_args += \
         is_win_fastlink=true
 
diff --git a/src/core/configure.json b/src/core/configure.json
index d868e7f12d06e21b7e39ca88d47ad3cf84d1ef92..a93132326cca270e90c84370b90f065acea7579a 100644
--- a/src/core/configure.json
+++ b/src/core/configure.json
@@ -5,7 +5,7 @@
         "gui-private",
         "printsupport"
     ],
-    "condition": "module.gui",
+    "condition": "features.webengine-core",
     "testDir": "../../config.tests",
     "commandline": {
         "options": {
@@ -56,18 +56,6 @@
             "sources" : [{ "type": "pkgConfig", "args": "alsa" }
             ]
         },
-        "webengine-dbus": {
-            "label": "d-bus",
-            "sources": [
-                { "type": "pkgConfig", "args": "dbus-1" }
-            ]
-        },
-        "webengine-fontconfig": {
-            "label": "fontconfig",
-            "sources": [
-                { "type": "pkgConfig", "args": "fontconfig" }
-            ]
-        },
         "webengine-libdrm": {
             "label": "libdrm",
             "sources": [
@@ -189,12 +177,6 @@
                 { "type": "pkgConfig", "args": "libwebp libwebpmux libwebpdemux" }
             ]
         },
-        "webengine-nss": {
-            "label": "nss >= 3.26",
-            "sources": [
-                { "type": "pkgConfig", "args": "nss >= 3.26" }
-            ]
-        },
         "webengine-png": {
             "label": "libpng >= 1.6.0",
             "sources": [
@@ -276,12 +258,6 @@
                 "-lsnappy"
             ]
         },
-        "webengine-x11" : {
-            "label" : "x11",
-            "sources": [
-                { "type": "pkgConfig", "args": "x11" }
-            ]
-        },
         "webengine-libvpx": {
             "label": "libvpx",
             "test": {
@@ -305,77 +281,22 @@
             "host": "true",
             "type": "compile"
         },
-        "webengine-khr": {
-            "label": "khr",
-            "type": "compile",
-            "test": {
-                "include": "KHR/khrplatform.h",
-                "qmake" : [
-                    "!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL",
-                    "!isEmpty(QMAKE_INCDIR_OPENGL): INCLUDEPATH += $$QMAKE_INCDIR_OPENGL"
-                ]
-            }
-        },
-        "webengine-winversion": {
-            "label": "winversion",
-            "type": "compile",
-            "test": {
-                 "head" : [
-                    "#if !defined(__clang__) && _MSC_FULL_VER < 191426428",
-                    "#error unsupported Visual Studio version",
-                    "#endif"
-                 ]
-            }
-        },
         "webengine-protoc": {
             "label": "protoc",
             "type": "detectProtoc"
         },
-        "webengine-python2": {
-            "label": "python2",
-            "type": "detectPython2",
-            "log": "location"
-        },
         "webengine-host-pkg-config": {
             "label": "host pkg-config",
             "type": "detectHostPkgConfig",
             "log": "path"
         },
-        "webengine-gperf": {
-            "label": "gperf",
-            "type": "detectGperf"
-        },
-        "webengine-bison": {
-            "label": "bison",
-            "type": "detectBison"
-        },
-        "webengine-flex": {
-            "label": "flex",
-            "type": "detectFlex"
-        },
-        "webengine-ninja": {
-            "label": "system ninja",
-            "type": "detectNinja"
-        },
-        "webengine-gn": {
-            "label": "system gn",
-            "type": "detectGn"
-        },
         "webengine-embedded-build": {
-            "label": "embedded",
-            "type": "embedded"
+            "label": "embedded build",
+            "type": "detectEmbedded"
         },
-        "webengine-glibc": {
-            "label": "glibc > 2.26",
-            "type": "compile",
-            "test": {
-                "include": "features.h",
-                "tail": [
-                    "#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 27",
-                    "#error glibc versions below 2.27 are not supported",
-                    "#endif"
-                ]
-            }
+        "webengine-developer-build": {
+            "label": "developer build",
+            "type": "detectDeveloperBuild"
         },
         "webengine-sanitizer": {
             "label" : "sanitizer support",
@@ -399,18 +320,7 @@
             "flag": "-z,noexecstack"
         }
     },
-
     "features": {
-        "webengine-system-fontconfig": {
-            "label": "fontconfig",
-            "condition": "libs.webengine-fontconfig",
-            "output": [ "privateFeature" ]
-        },
-        "webengine-system-dbus": {
-            "label": "dbus",
-            "condition": "libs.webengine-dbus",
-            "output": [ "privateFeature" ]
-        },
         "webengine-system-libdrm": {
             "label": "libdrm",
             "condition": "libs.webengine-libdrm",
@@ -481,37 +391,6 @@
             "condition": "config.unix && features.system-jpeg && libs.webengine-jpeglib",
             "output": [ "privateFeature" ]
         },
-        "webengine-python2": {
-            "label": "python2",
-            "condition": "tests.webengine-python2",
-            "output": [
-                "privateFeature",
-                { "type": "varAssign", "name": "QMAKE_PYTHON2", "value": "tests.webengine-python2.location" }
-            ]
-        },
-        "webengine-host-pkg-config": {
-            "label": "host-pkg-config",
-            "condition": "config.unix && tests.webengine-host-pkg-config",
-            "output": [
-                "privateFeature",
-                { "type": "varAssign", "name": "QMAKE_PKG_CONFIG_HOST", "value": "tests.webengine-host-pkg-config.path" }
-            ]
-        },
-        "webengine-gperf": {
-            "label": "gperf",
-            "condition": "tests.webengine-gperf",
-            "output": [ "privateFeature" ]
-        },
-        "webengine-bison": {
-            "label": "bison",
-            "condition": "tests.webengine-bison",
-            "output": [ "privateFeature" ]
-        },
-        "webengine-flex": {
-            "label": "flex",
-            "condition": "tests.webengine-flex",
-            "output": [ "privateFeature" ]
-        },
         "webengine-embedded-build": {
             "label": "Embedded build",
             "purpose": "Enables the embedded build configuration.",
@@ -520,6 +399,12 @@
             "autoDetect": "tests.webengine-embedded-build",
             "output": [ "privateFeature" ]
         },
+        "webengine-developer-build": {
+            "label": "Developer build",
+            "purpose": "Enables the developer build configuration.",
+            "autoDetect": "tests.webengine-developer-build",
+            "output": [ "privateFeature" ]
+        },
         "webengine-alsa": {
             "label": "Use ALSA",
             "condition": "config.unix && libs.webengine-alsa",
@@ -536,11 +421,6 @@
             "condition": "!config.unix || !features.cross_compile || arch.arm64 || tests.webengine-host-compiler",
             "output": [ "privateFeature" ]
         },
-        "webengine-system-khr" : {
-            "label": "khr",
-            "condition": "config.unix && tests.webengine-khr",
-            "output": [ "privateFeature" ]
-        },
         "webengine-system-libvpx" : {
             "label": "libvpx",
             "condition": "config.unix && libs.webengine-libvpx",
@@ -551,11 +431,6 @@
             "condition": "config.unix && libs.webengine-snappy",
             "output": [ "privateFeature" ]
         },
-        "webengine-winversion" : {
-            "label": "winversion",
-            "condition": "config.win32 && tests.webengine-winversion",
-            "output": [ "privateFeature" ]
-        },
         "webengine-geolocation": {
             "label": "Geolocation",
             "condition": "module.positioning",
@@ -632,11 +507,6 @@
             "autoDetect": "!features.webengine-embedded-build",
             "output": [ "privateFeature" ]
         },
-        "webengine-system-nss": {
-            "label": "nss",
-            "condition": "config.unix && !config.darwin && libs.webengine-nss",
-            "output": [ "privateFeature" ]
-        },
         "webengine-system-libwebp": {
             "label": "libwebp, libwebpmux and libwebpdemux",
             "autoDetect": "config.unix",
@@ -667,22 +537,6 @@
             "condition": "libs.webengine-re2",
             "output": [ "privateFeature" ]
         },
-        "webengine-system-ninja": {
-            "label": "Use System Ninja",
-            "condition": "tests.webengine-ninja",
-            "output": [ "privateFeature" ]
-        },
-        "webengine-system-gn": {
-            "label": "Use System Gn",
-            "autoDetect": false,
-            "condition": "tests.webengine-gn",
-            "output": [ "privateFeature" ]
-        },
-        "webengine-system-glibc": {
-            "label": "glibc",
-            "condition": "config.linux && tests.webengine-glibc",
-            "output": [ "privateFeature" ]
-        },
         "webengine-system-libxml2": {
             "label": "libxml2 and libxslt",
             "condition": "config.unix && libs.webengine-libxml2",
@@ -699,11 +553,6 @@
             "condition": "config.unix && features.system-freetype && libs.webengine-freetype",
             "output": [ "privateFeature" ]
         },
-        "webengine-system-x11" : {
-            "label": "x11",
-            "condition": "config.unix && libs.webengine-x11",
-            "output": [ "privateFeature" ]
-        },
         "webengine-ozone-x11" : {
              "label": "Support qpa-xcb",
              "condition": "config.unix
@@ -755,26 +604,6 @@
     },
 
     "report": [
-        {
-            "type": "warning",
-            "condition": "!features.webengine-python2",
-            "message": "Python version 2 (2.7.5 or later) is required to build QtWebEngine."
-        },
-        {
-            "type": "warning",
-            "condition": "!features.webengine-gperf",
-            "message": "gperf is required to build QtWebEngine."
-        },
-        {
-            "type": "warning",
-            "condition": "!features.webengine-bison",
-            "message": "bison is required to build QtWebEngine."
-        },
-        {
-            "type": "warning",
-            "condition": "!features.webengine-flex",
-            "message": "flex is required to build QtWebEngine."
-        },
         {
             "type": "warning",
             "condition": "config.sanitizer && !tests.webengine-sanitizer && !features.webengine-sanitizer",
@@ -794,14 +623,46 @@
             "type": "warning",
             "condition": "config.linux && features.webengine-embedded-build && !features.webengine-system-ffmpeg && arch.arm && !features.webengine-arm-thumb",
             "message": "Thumb instruction set is required to build ffmpeg for QtWebEngine."
+        },
+        {
+            "type": "warning",
+            "condition": "config.linux && features.webengine-v8-snapshot && !features.webengine-v8-snapshot-support",
+            "message": "V8 snapshot cannot be built. Most likely, the 32-bit host compiler does not work. Please make sure you have 32-bit devel environment installed."
         }
     ],
 
     "summary": [
+        {
+           "section": "Optional system libraries used",
+           "condition": "config.unix",
+           "entries": [
+                "webengine-system-re2",
+                "webengine-system-icu",
+                "webengine-system-libwebp",
+                "webengine-system-opus",
+                "webengine-system-ffmpeg",
+                "webengine-system-libvpx",
+                "webengine-system-snappy",
+                "webengine-system-glib",
+                "webengine-system-zlib",
+                "webengine-system-minizip",
+                "webengine-system-libevent",
+                "webengine-system-jsoncpp",
+                "webengine-system-protobuf",
+                "webengine-system-libxml2",
+                "webengine-system-lcms2",
+                "webengine-system-png",
+                "webengine-system-jpeg",
+                "webengine-system-harfbuzz",
+                "webengine-system-freetype"
+            ]
+        },
         {
             "section": "Qt WebEngineCore",
+            "condition": "features.webengine-core",
             "entries": [
                 "webengine-embedded-build",
+                "webengine-developer-build",
                 "webengine-full-debug-info",
                 "webengine-pepper-plugins",
                 "webengine-printing-and-pdf",
@@ -809,7 +670,6 @@
                 "webengine-spellchecker",
                 "webengine-native-spellchecker",
                 "webengine-webrtc",
-                "webengine-system-ninja",
                 "webengine-geolocation",
                 "webengine-webchannel",
                 "webengine-v8-snapshot",
@@ -869,54 +729,6 @@
                     "type": "macosToolchainVersion",
                     "args": "deploymentTarget",
                     "condition": "config.macos"
-                },
-                {
-                   "section": "Optional system libraries used",
-                   "condition": "config.unix",
-                   "entries": [
-                        "webengine-system-re2",
-                        "webengine-system-icu",
-                        "webengine-system-libwebp",
-                        "webengine-system-opus",
-                        "webengine-system-ffmpeg",
-                        "webengine-system-libvpx",
-                        "webengine-system-snappy",
-                        "webengine-system-glib",
-                        "webengine-system-zlib",
-                        "webengine-system-minizip",
-                        "webengine-system-libevent",
-                        "webengine-system-jsoncpp",
-                        "webengine-system-protobuf",
-                        "webengine-system-libxml2",
-                        "webengine-system-lcms2",
-                        "webengine-system-png",
-                        "webengine-system-jpeg",
-                        "webengine-system-harfbuzz",
-                        "webengine-system-freetype"
-                    ]
-                },
-                {
-                   "section": "Required system libraries",
-                   "condition": "config.unix && !config.macos",
-                   "entries": [
-                        "webengine-system-fontconfig",
-                        "webengine-system-dbus",
-                        "webengine-system-nss",
-                        "webengine-system-khr",
-                        "webengine-system-glibc"
-                    ]
-                },
-                {
-                   "section": "Required system libraries for qpa-xcb",
-                   "condition": "config.unix && !config.macos",
-                   "entries": [
-                        "webengine-system-x11",
-                        "webengine-system-libdrm",
-                        "webengine-system-xcomposite",
-                        "webengine-system-xcursor",
-                        "webengine-system-xi",
-                        "webengine-system-xtst"
-                    ]
                 }
             ]
         }
diff --git a/src/core/core_module.pro b/src/core/core_module.pro
index b220af4a55ef3586c5959a32b45d4e38acfa18b6..4b9268e1a9a9fcdd5b1be8c491801343816af123 100644
--- a/src/core/core_module.pro
+++ b/src/core/core_module.pro
@@ -63,7 +63,7 @@ CONFIG *= no_smart_library_merge
 osx {
     LIBS_PRIVATE += -Wl,-force_load,$${api_library_path}$${QMAKE_DIR_SEP}lib$${api_library_name}.a
 } else: win32 {
-    !isDeveloperBuild() {
+    !qtConfig(webengine-developer-build) {
         # Remove unused functions and data in debug non-developer builds, because the binaries will
         # be smaller in the shipped packages.
         QMAKE_LFLAGS += /OPT:REF
diff --git a/src/core/gn_run.pro b/src/core/gn_run.pro
index 0219a2be96ead0f186e01bcab8a63397cc293b27..94c1ede1cdad12e67280be8460f56380e5c65bc2 100644
--- a/src/core/gn_run.pro
+++ b/src/core/gn_run.pro
@@ -1,5 +1,6 @@
+include($$QTWEBENGINE_OUT_ROOT/src/qtwebengine-main-config.pri)
 include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
-QT_FOR_CONFIG += webenginecore-private
+QT_FOR_CONFIG += webenginecore-private core-private gui-private
 
 TEMPLATE = aux
 
diff --git a/src/src.pro b/src/src.pro
index 8bf014dea38c9fc1dbb3df58743a9f6d4cd29d33..1ace7a44b462f14234905dc0f54446e8ed20e3ca 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -1,34 +1,49 @@
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/webengine/qtwebengine-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/webenginewidgets/qtwebenginewidgets-config.pri)
-QT_FOR_CONFIG += webenginecore webenginecore-private webengine-private webenginewidgets-private
+load(platform)
+
+include($$QTWEBENGINE_OUT_ROOT/src/qtwebengine-main-config.pri)
 
 TEMPLATE = subdirs
 
-process.depends = core
-webengine.depends = core
-webenginewidgets.depends = core webengine
-webengine_plugin.subdir = webengine/plugin
-webengine_plugin.target = sub-webengine-plugin
-webengine_plugin.depends = webengine
+isWebEngineCoreBuild():qtConfig(webengine-core) {
+    include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
+    include($$QTWEBENGINE_OUT_ROOT/src/webengine/qtwebengine-config.pri)
+    include($$QTWEBENGINE_OUT_ROOT/src/webenginewidgets/qtwebenginewidgets-config.pri)
+    QT_FOR_CONFIG += webenginecore webenginecore-private webengine-private webenginewidgets-private
+
+    process.depends = core
+    webengine.depends = core
+    webenginewidgets.depends = core webengine
+    webengine_plugin.subdir = webengine/plugin
+    webengine_plugin.target = sub-webengine-plugin
+    webengine_plugin.depends = webengine
 
-core.depends = buildtools
+    core.depends = buildtools
 
-SUBDIRS += buildtools \
-           core \
-           process
+    SUBDIRS += buildtools \
+        core \
+        process
 
-qtConfig(webengine-spellchecker):!qtConfig(webengine-native-spellchecker):!cross_compile {
+    qtConfig(webengine-spellchecker):!qtConfig(webengine-native-spellchecker):!cross_compile {
     SUBDIRS += qwebengine_convert_dict
     qwebengine_convert_dict.subdir = tools/qwebengine_convert_dict
     qwebengine_convert_dict.depends = core
-}
+    }
 
-qtConfig(webengine-qml) {
-   SUBDIRS += webengine
-}
+    qtConfig(webengine-qml) {
+        SUBDIRS += webengine
+    }
 
-qtConfig(webengine-widgets) {
-   SUBDIRS += plugins webenginewidgets
-   plugins.depends = webenginewidgets
+    qtConfig(webengine-widgets) {
+        SUBDIRS += plugins webenginewidgets
+        plugins.depends = webenginewidgets
+    }
+} else {
+    !isEmpty(skipBuildReason):!build_pass {
+            log(QtWebEngine will not be built. $${skipBuildReason} $${EOL})
+            errorbuild.commands = @echo QtWebEngine will not be built. $${skipBuildReason}
+            errorbuild.CONFIG = phony
+            QMAKE_EXTRA_TARGETS += errorbuild
+            first.depends += errorbuild
+            QMAKE_EXTRA_TARGETS += first
+   }
 }
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 06430cf8e054eb3b6996f609c5fdd6730a931990..59bcd5aefc9762b5cb374fe7aea2f6184a66bb4d 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -1,9 +1,9 @@
 TEMPLATE = subdirs
 
-SUBDIRS = quick
+qtHaveModule(webengine) {
+    SUBDIRS += quick
+}
 
 qtHaveModule(webenginewidgets) {
-    SUBDIRS += widgets
-# core tests depend on widgets for now
-    SUBDIRS += core
+    SUBDIRS += core widgets
 }
diff --git a/tests/tests.pro b/tests/tests.pro
index 2922e50760cfc39b9ab058e78b227d10b3f3a83c..acb2236403d544b3339ed256e2c7b6ad085ef796 100644
--- a/tests/tests.pro
+++ b/tests/tests.pro
@@ -1,3 +1,7 @@
 TEMPLATE = subdirs
 
-SUBDIRS +=  auto quicktestbrowser
+SUBDIRS +=  auto
+
+qtHaveModule(webengine) {
+    SUBDIRS += quicktestbrowser
+}