diff --git a/configure.pri b/configure.pri
index 0bf4ca41a3e39235040061e13a347635e9f25caf..3d6d991bad681ecbe53b662c084bc8fc8d8b2f53 100644
--- a/configure.pri
+++ b/configure.pri
@@ -1,5 +1,4 @@
-load(platform)
-
+include(src/buildtools/config/platform.pri)
 include(src/buildtools/config/functions.pri)
 
 # this must be done outside any function
@@ -104,7 +103,7 @@ defineTest(qtConfTest_detectBison) {
 }
 
 defineTest(qtConfTest_detectPlatform) {
-   !isPlatformSupported() {
+   !qtwebengine_isPlatformSupported() {
         qtLog("Platform not supported".)
         return(false)
    }
@@ -112,7 +111,7 @@ defineTest(qtConfTest_detectPlatform) {
 }
 
 defineTest(qtConfTest_detectArch) {
-   !isArchSupported() {
+   !qtwebengine_isArchSupported() {
         qtLog("Architecture not supported".)
         return(false)
    }
diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf
index 7617005ea999534ec09d0e7c14a6703be455de61..b512db2f13fdbb25991d3f4a30e986d936240a2b 100644
--- a/mkspecs/features/functions.prf
+++ b/mkspecs/features/functions.prf
@@ -1,3 +1,5 @@
+include($$QTWEBENGINE_ROOT/src/buildtools/config/platform.pri)
+
 defineReplace(getConfigDir) {
   CONFIG(release, debug|release):return("release")
   return("debug")
@@ -96,48 +98,42 @@ defineReplace(gnOS) {
     return(unknown)
 }
 
-defineTest(skipBuild) {
-    isEmpty(skipBuildReason): skipBuildReason = $$1
-    else: skipBuildReason = "$$skipBuildReason $${EOL}$$1"
-    export(skipBuildReason)
-}
-
 defineTest(isWebEngineCoreBuild) {
 
     static {
-       skipBuild("Static builds of QtWebEngine are not supported.")
+       qtwebengine_skipBuild("Static builds of QtWebEngine are not supported.")
        return(false)
     }
 
     !qtHaveModule(gui) {
-        skipBuild("QtWebEngine requires QtGui.")
+        qtwebengine_skipBuild("QtWebEngine requires QtGui.")
         return(false)
     }
 
     !exists($$QTWEBENGINE_ROOT/src/3rdparty/chromium) {
-        skipBuild("Submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.")
+        qtwebengine_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.")
+        qtwebengine_skipBuild("QtWebEngine cannot be built in a path that contains whitespace characters.")
         return(false)
     }
 
-    !isPlatformSupported() {
+    !qtwebengine_isPlatformSupported() {
         # make sure we have skipBuildReason
-        isEmpty(skipBuildReason): skipBuild("Unknow error. Platform unspported.")
+        isEmpty(skipBuildReason): qtwebengine_skipBuild("Unknow error. Platform unspported.")
         return(false)
     }
 
-    !isArchSupported() {
-        isEmpty(skipBuildReason): skipBuild("Unknown error. Architecture unsupported.")
+    !qtwebengine_isArchSupported() {
+        isEmpty(skipBuildReason): qtwebengine_skipBuild("Unknown error. Architecture unsupported.")
         return(false)
     }
 
     linux:contains(QT_CONFIG,no-pkg-config) {
-        skipBuild("pkg-config is required")
+        qtwebengine_skipBuild("pkg-config is required")
         return(false)
     }
 
@@ -145,65 +141,65 @@ defineTest(isWebEngineCoreBuild) {
     QT_FOR_CONFIG += buildtools-private
 
     win32:!qtConfig(webengine-win-compiler64) {
-        skipBuild("Required 64-bit cross-building or native toolchain could not be found.")
+        qtwebengine_skipBuild("Required 64-bit cross-building or native toolchain could not be found.")
         return(false)
     }
 
     win32:!qtConfig(webengine-winversion) {
-        skipBuild("Needs Visual Studio 2017 or higher")
+        qtwebengine_skipBuild("Needs Visual Studio 2017 or higher")
         return(false)
     }
 
     !qtConfig(webengine-gperf) {
-        skipBuild("Required gperf could not be found.")
+        qtwebengine_skipBuild("Required gperf could not be found.")
         return(false)
     }
     !qtConfig(webengine-bison) {
-        skipBuild("Required bison could not be found.")
+        qtwebengine_skipBuild("Required bison could not be found.")
         return(false)
     }
     !qtConfig(webengine-flex) {
-        skipBuild("Required flex could not be found.")
+        qtwebengine_skipBuild("Required flex could not be found.")
         return(false)
     }
     !qtConfig(webengine-python2) {
-        skipBuild("A suitable version of python2 could not be found.")
+        qtwebengine_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.")
+        qtwebengine_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")
+            qtwebengine_skipBuild("Host pkg-config is required")
             return(false)
         }
 
         !qtConfig(webengine-system-glibc) {
-            skipBuild("A suitable version >= 2.27 of libc could not be found.")
+            qtwebengine_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)")
+            qtwebengine_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.")
+                qtwebengine_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")
+            qtwebengine_skipBuild("Could not find all necessary libraries for qpa-xcb support")
             return(false)
         }
     }
diff --git a/qtwebengine.pro b/qtwebengine.pro
index 6d4089b26dbe5aac6da11f8a3c8bc3beb0c65386..dae059a4060289fc55fc3ff50b73ef128088e0a8 100644
--- a/qtwebengine.pro
+++ b/qtwebengine.pro
@@ -1,6 +1,5 @@
 load(qt_parts)
 load(functions)
-load(platform)
 
 QMAKE_DISTCLEAN += .qmake.cache
 
diff --git a/mkspecs/features/platform.prf b/src/buildtools/config/platform.pri
similarity index 58%
rename from mkspecs/features/platform.prf
rename to src/buildtools/config/platform.pri
index 05854d90fd9f2e434f474b48ac69302fef00fead..d75c0be26263cd679f630115be2c23bf7cffee75 100644
--- a/mkspecs/features/platform.prf
+++ b/src/buildtools/config/platform.pri
@@ -1,98 +1,90 @@
-defineTest(isQtMinimum) {
-    !equals(QT_MAJOR_VERSION, $$1): return(false)
-    count(ARGS, 1, greaterThan) {
-        lessThan(QT_MINOR_VERSION, $$2): return(false)
-    }
-    return(true)
-}
-
-defineTest(isLinuxPlatformSupported) {
+defineTest(qtwebengine_isLinuxPlatformSupported) {
     !gcc|intel_icc {
-        skipBuild("Qt WebEngine on Linux requires clang or GCC.")
+        qtwebengine_skipBuild("Qt WebEngine on Linux requires clang or GCC.")
         return(false)
     }
-    gcc:!clang:!isGCCVersionSupported(): return(false)
-    gcc:!contains(QT_CONFIG, c++14) {
-        skipBuild("C++14 support is required in order to build chromium.")
+    gcc:!clang:!qtwebengine_isGCCVersionSupported(): return(false)
+    gcc:!qtConfig(c++14) {
+        qtwebengine_skipBuild("C++14 support is required in order to build chromium.")
         return(false)
     }
     return(true)
 }
 
-defineTest(isWindowsPlatformSupported) {
+defineTest(qtwebengine_isWindowsPlatformSupported) {
     winrt {
-        skipBuild("WinRT is not supported.")
+        qtwebengine_skipBuild("WinRT is not supported.")
         return(false)
     }
-    isBuildingOnWin32() {
-        skipBuild("Qt WebEngine on Windows must be built on a 64-bit machine.")
+    qtwebengine_isBuildingOnWin32() {
+        qtwebengine_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).")
+        qtwebengine_skipBuild("Qt WebEngine on Windows requires MSVC or Clang (MSVC mode).")
         return(false)
     }
-    !isMinWinSDKVersion(10, 17763): {
-        skipBuild("Qt WebEngine on Windows requires a Windows SDK version 10.0.17763 or newer.")
+    !qtwebengine_isMinWinSDKVersion(10, 17763): {
+        qtwebengine_skipBuild("Qt WebEngine on Windows requires a Windows SDK version 10.0.17763 or newer.")
         return(false)
     }
     return(true)
 }
 
-defineTest(isMacOsPlatformSupported) {
+defineTest(qtwebengine_isMacOsPlatformSupported) {
     # FIXME: Try to get it back down to 8.2 for building on OS X 10.11
-    !isMinXcodeVersion(8, 3, 3) {
-        skipBuild("Using Xcode version $$QMAKE_XCODE_VERSION, but at least version 8.3.3 is required to build Qt WebEngine.")
+    !qtwebengine_isMinXcodeVersion(8, 3, 3) {
+        qtwebengine_skipBuild("Using Xcode version $$QMAKE_XCODE_VERSION, but at least version 8.3.3 is required to build Qt WebEngine.")
         return(false)
     }
     !clang|intel_icc {
-        skipBuild("Qt WebEngine on macOS requires Clang.")
+        qtwebengine_skipBuild("Qt WebEngine on macOS requires Clang.")
         return(false)
     }
     # We require macOS 10.12 (darwin version 16.0.0) or newer.
     darwin_major_version = $$section(QMAKE_HOST.version, ., 0, 0)
     lessThan(darwin_major_version, 16) {
-        skipBuild("Building Qt WebEngine requires macOS version 10.12 or newer.")
+        qtwebengine_skipBuild("Building Qt WebEngine requires macOS version 10.12 or newer.")
         return(false)
     }
-    !isMinOSXSDKVersion(10, 12): {
-        skipBuild("Building Qt WebEngine requires a macOS SDK version of 10.12 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
+    !qtwebengine_isMinOSXSDKVersion(10, 12): {
+        qtwebengine_skipBuild("Building Qt WebEngine requires a macOS SDK version of 10.12 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
         return(false)
     }
     return(true)
 }
 
-defineTest(isPlatformSupported) {
+defineTest(qtwebengine_isPlatformSupported) {
     QT_FOR_CONFIG += gui-private
     !linux:!win32:!macos {
-        skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and macOS.")
+        qtwebengine_skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and macOS.")
         return(false)
     }
-    linux:isLinuxPlatformSupported(): return(true)
-    win32:isWindowsPlatformSupported(): return(true)
-    macos:isMacOsPlatformSupported(): return(true)
+    linux:qtwebengine_isLinuxPlatformSupported(): return(true)
+    win32:qtwebengine_isWindowsPlatformSupported(): return(true)
+    macos:qtwebengine_isMacOsPlatformSupported(): return(true)
     return(false)
 }
 
-defineTest(isArchSupported) {
+defineTest(qtwebengine_isArchSupported) {
     contains(QT_ARCH, "i386")|contains(QT_ARCH, "x86_64"): return(true)
     contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true)
     contains(QT_ARCH, "mips"): return(true)
 #     contains(QT_ARCH, "mips64"): return(true)
 
-    skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
+    qtwebengine_skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
     return(false)
 }
 
-defineTest(isGCCVersionSupported) {
+defineTest(qtwebengine_isGCCVersionSupported) {
   # Keep in sync with src/webengine/doc/src/qtwebengine-platform-notes.qdoc
-  greaterThan(QT_GCC_MAJOR_VERSION, 4):return(true)
+  greaterThan(QMAKE_GCC_MAJOR_VERSION, 4):return(true)
 
-  skipBuild("Using gcc version "$$QT_GCC_MAJOR_VERSION"."$$QT_GCC_MINOR_VERSION", but at least gcc version 5 is required to build Qt WebEngine.")
+  qtwebengine_skipBuild("Using gcc version "$$QMAKE_GCC_MAJOR_VERSION"."$$QMAKE_GCC_MINOR_VERSION", but at least gcc version 5 is required to build Qt WebEngine.")
   return(false)
 }
 
-defineTest(isBuildingOnWin32) {
+defineTest(qtwebengine_isBuildingOnWin32) {
     # The check below is ugly, but necessary, as it seems to be the only reliable way to detect if the host
     # architecture is 32 bit. QMAKE_HOST.arch does not work as it returns the architecture that the toolchain
     # is building for, not the system's actual architecture.
@@ -101,7 +93,7 @@ defineTest(isBuildingOnWin32) {
     return(false)
 }
 
-defineTest(isMinOSXSDKVersion) {
+defineTest(qtwebengine_isMinOSXSDKVersion) {
     requested_major = $$1
     requested_minor = $$2
     requested_patch = $$3
@@ -109,7 +101,7 @@ defineTest(isMinOSXSDKVersion) {
     WEBENGINE_OSX_SDK_PRODUCT_VERSION = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version ProductVersion 2>/dev/null")
     export(WEBENGINE_OSX_SDK_PRODUCT_VERSION)
     isEmpty(WEBENGINE_OSX_SDK_PRODUCT_VERSION) {
-        skipBuild("Could not resolve SDK product version for \'$$QMAKE_MAC_SDK\'.")
+        qtwebengine_skipBuild("Could not resolve SDK product version for \'$$QMAKE_MAC_SDK\'.")
         return(false)
     }
     major_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 0, 0)
@@ -124,7 +116,7 @@ defineTest(isMinOSXSDKVersion) {
     return(false)
 }
 
-defineTest(isMinXcodeVersion) {
+defineTest(qtwebengine_isMinXcodeVersion) {
     requested_major = $$1
     requested_minor = $$2
     requested_patch = $$3
@@ -144,13 +136,13 @@ defineTest(isMinXcodeVersion) {
     return(false)
 }
 
-defineTest(isMinWinSDKVersion) {
+defineTest(qtwebengine_isMinWinSDKVersion) {
     requested_major = $$1
     requested_minor = $$2
     WIN_SDK_VERSION = $$(WindowsSDKVersion)
 
     isEmpty(WIN_SDK_VERSION)|equals(WIN_SDK_VERSION, "\\") {
-        skipBuild("Could not detect Windows SDK version (\'WindowsSDKVersion\' environment variable is not set).")
+        qtwebengine_skipBuild("Could not detect Windows SDK version (\'WindowsSDKVersion\' environment variable is not set).")
         return(false)
     }
 
@@ -164,3 +156,9 @@ defineTest(isMinWinSDKVersion) {
 
     return(false)
 }
+
+defineTest(qtwebengine_skipBuild) {
+    isEmpty(skipBuildReason): skipBuildReason = $$1
+    else: skipBuildReason = "$$skipBuildReason $${EOL}$$1"
+    export(skipBuildReason)
+}
diff --git a/src/buildtools/configure.json b/src/buildtools/configure.json
index 3e7c2cd5dcad5e98792914207a14f63b4b61ffa8..05a05bb4af71a1864823f8e03fecd37da3476ceb 100644
--- a/src/buildtools/configure.json
+++ b/src/buildtools/configure.json
@@ -685,12 +685,12 @@
         {
             "type": "skipBuildWarning",
             "condition": "tests.webengine-platform",
-            "message": "isPlatformSupported"
+            "message": "qtwebengine_isPlatformSupported"
         },
         {
             "type": "skipBuildWarning",
             "condition": "tests.webengine-architecture",
-            "message": "isArchSupported"
+            "message": "qtwebengine_isArchSupported"
         }
     ],
     "summary": [
diff --git a/src/src.pro b/src/src.pro
index e620fcdd811d844581981d3528ccd0d06a0074f6..31b91ccab4ee7ea1c3ee1564acb46b5658f6f6d1 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -1,4 +1,4 @@
-load(platform)
+load(functions)
 
 include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
 include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)