diff --git a/src/3rdparty b/src/3rdparty
index caa6297dd5254b01276e6ff6aa19001ba3737ccc..f9c03801de86b5e9da2b915a9e490c2f2254fecf 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit caa6297dd5254b01276e6ff6aa19001ba3737ccc
+Subproject commit f9c03801de86b5e9da2b915a9e490c2f2254fecf
diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro
index 38aba3a76934bc66c7340ed8fbcaa75a38f835da..3817c334b7a28a56e7dc03e62d84074237d89acc 100644
--- a/src/core/core_gyp_generator.pro
+++ b/src/core/core_gyp_generator.pro
@@ -29,8 +29,7 @@ else: DEFINES += QT_NO_EGL
 
 RESOURCES += devtools.qrc
 
-# something fishy with qmake in 5.2 ?
-INCLUDEPATH += $$[QT_INSTALL_HEADERS] $$PWD
+INCLUDEPATH += $$PWD
 
 SOURCES = \
         access_token_store_qt.cpp \
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index db3956e5a04cf067db848cd0a4092b28bd6e50f3..446f0e92cdf6b42c46f87c6136e5b8db8987a623 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -196,6 +196,7 @@ WebEngineContext::WebEngineContext()
     content::GpuProcessHost::RegisterGpuMainThreadFactory(content::CreateInProcessGpuThread);
 
     content::ContentMainParams contentMainParams(m_mainDelegate.get());
+    contentMainParams.setup_signal_handlers = false;
 #if defined(OS_WIN)
     sandbox::SandboxInterfaceInfo sandbox_info = {0};
     content::InitializeSandboxInfo(&sandbox_info);
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index beae9dd7516c0ded92e4b2789b9788ef07edf7ed..2d72dd5a2323da4ee95e7050cb95ade44df7853c 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -101,7 +101,12 @@ static inline CFBundleRef frameworkBundle()
 static QString getPath(CFBundleRef frameworkBundle)
 {
     QString path;
-    if (frameworkBundle) {
+    // The following is a fix for QtWebEngineProcess crashes on OS X 10.7 and before.
+    // We use it for the other OS X versions as well to make sure it works and because
+    // the directory structure should be the same.
+    if (qApp->applicationName() == QLatin1String(QTWEBENGINEPROCESS_NAME)) {
+        path = QDir::cleanPath(qApp->applicationDirPath() % QLatin1String("/../../../.."));
+    } else if (frameworkBundle) {
         CFURLRef bundleUrl = CFBundleCopyBundleURL(frameworkBundle);
         CFStringRef bundlePath = CFURLCopyFileSystemPath(bundleUrl, kCFURLPOSIXPathStyle);
         path = QString::fromCFString(bundlePath);
@@ -114,7 +119,12 @@ static QString getPath(CFBundleRef frameworkBundle)
 static QString getResourcesPath(CFBundleRef frameworkBundle)
 {
     QString path;
-    if (frameworkBundle) {
+    // The following is a fix for QtWebEngineProcess crashes on OS X 10.7 and before.
+    // We use it for the other OS X versions as well to make sure it works and because
+    // the directory structure should be the same.
+    if (qApp->applicationName() == QLatin1String(QTWEBENGINEPROCESS_NAME)) {
+        path = getPath(frameworkBundle) % QLatin1String("/Resources");
+    } else if (frameworkBundle) {
         CFURLRef resourcesRelativeUrl = CFBundleCopyResourcesDirectoryURL(frameworkBundle);
         CFStringRef resourcesRelativePath = CFURLCopyFileSystemPath(resourcesRelativeUrl, kCFURLPOSIXPathStyle);
         path = getPath(frameworkBundle) % QLatin1Char('/') % QString::fromCFString(resourcesRelativePath);
diff --git a/src/src.pro b/src/src.pro
index 60f873c7630495eaef2da190b57e6ffda40b09a6..ed402c5824d8e3332c59f33e24c39cdf33421683 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -1,30 +1,26 @@
 TEMPLATE = subdirs
 
-isPlatformSupported() {
-    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
-    webengine_experimental_plugin.subdir = webengine/plugin/experimental
-    webengine_experimental_plugin.target = sub-webengine-experimental-plugin
-    webengine_experimental_plugin.depends = webengine
+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
+webengine_experimental_plugin.subdir = webengine/plugin/experimental
+webengine_experimental_plugin.target = sub-webengine-experimental-plugin
+webengine_experimental_plugin.depends = webengine
 
 
-    SUBDIRS += core \
-               process \
-               webengine \
-               webengine_plugin \
-               webengine_experimental_plugin
+SUBDIRS += core \
+           process \
+           webengine \
+           webengine_plugin \
+           webengine_experimental_plugin
 
-    # FIXME: We probably want a bit more control over config options to tweak what to build/ship or not.
-    # Another example of where this could be necessary is to make it easy to build proprietery codecs support.
-    !contains(WEBENGINE_CONFIG, no_ui_delegates): SUBDIRS += webengine/ui
+# FIXME: We probably want a bit more control over config options to tweak what to build/ship or not.
+# Another example of where this could be necessary is to make it easy to build proprietery codecs support.
+!contains(WEBENGINE_CONFIG, no_ui_delegates): SUBDIRS += webengine/ui
 
-    qtHaveModule(widgets) {
-        SUBDIRS += webenginewidgets
-    }
-} else {
-    warning("QtWebEngine is not maintained for this platform/configuration and is therefore disabled.")
+qtHaveModule(widgets) {
+    SUBDIRS += webenginewidgets
 }
diff --git a/sync.profile b/sync.profile
index 2f3aab8c5bec375edecaeb9bc16a2d97f4a8e671..1e9519fe34d71a5456bb88e28f7dfd5c840abc06 100644
--- a/sync.profile
+++ b/sync.profile
@@ -16,9 +16,9 @@
 #   - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch)
 #
 %dependencies = (
-    "qtbase" => "refs/heads/dev",
-    "qtdeclarative" => "refs/heads/dev",
-    "qtxmlpatterns" => "refs/heads/dev",
+    "qtbase" => "",
+    "qtdeclarative" => "",
+    "qtxmlpatterns" => "",
 # FIXME: take examples out into their own module to avoid a potential circular dependency later ?
-    "qtquickcontrols" => "refs/heads/dev",
+    "qtquickcontrols" => "",
 );
diff --git a/tools/buildscripts/gyp_qtwebengine b/tools/buildscripts/gyp_qtwebengine
index 6f2bbc9363c301a2a7cbabdf17300d2dab02c50c..970cce54e149a105c72f0661ce4caf72ac78755f 100755
--- a/tools/buildscripts/gyp_qtwebengine
+++ b/tools/buildscripts/gyp_qtwebengine
@@ -5,7 +5,7 @@ import os
 import sys
 import subprocess
 
-print 'using python: ' + sys.executable + ' version: ' + sys.version
+print 'using python: ' + sys.executable + ' version: ' + str(sys.version_info.major) + '.' + str(sys.version_info.minor) + '.' + str(sys.version_info.micro)
 
 if sys.platform == "darwin":
   print 'xcode version: ' + subprocess.check_output(['xcodebuild', '-version']).replace('\n', ' ')
diff --git a/tools/qmake/config.tests/libcap/libcap.cpp b/tools/qmake/config.tests/libcap/libcap.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c0bba3eae52aecd5a0c1e09b2a8631166357dcea
--- /dev/null
+++ b/tools/qmake/config.tests/libcap/libcap.cpp
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.  For licensing terms and
+** conditions see http://qt.digia.com/licensing.  For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <sys/capability.h>
+
+int main(int, char **)
+{
+    cap_t cap = cap_get_proc();
+    const char *text = cap_to_text(cap, 0);
+    return 0;
+}
diff --git a/tools/qmake/config.tests/libcap/libcap.pro b/tools/qmake/config.tests/libcap/libcap.pro
new file mode 100644
index 0000000000000000000000000000000000000000..2c688f8092542247de5bfb165b29dd84f89d4459
--- /dev/null
+++ b/tools/qmake/config.tests/libcap/libcap.pro
@@ -0,0 +1,3 @@
+linux: SOURCES += libcap.cpp
+LIBS += -lcap
+CONFIG -= qt
diff --git a/tools/qmake/mkspecs/features/configure.prf b/tools/qmake/mkspecs/features/configure.prf
new file mode 100644
index 0000000000000000000000000000000000000000..6e74b554705b98fbf9f8b82081e31fc1557b1c61
--- /dev/null
+++ b/tools/qmake/mkspecs/features/configure.prf
@@ -0,0 +1,31 @@
+# Load configure.prf from qtbase first
+load(configure)
+load(functions)
+
+defineTest(runConfigure) {
+    webengine_successfully_configured: return(true)
+    linux:contains(QT_CONFIG,no-pkg-config) {
+        skipBuild("pkg-config is required")
+        return(false)
+    }
+    # Ignore the cached config tests results in case they were not successful
+    CONFIG += recheck
+    #Override the config.tests path
+    QMAKE_CONFIG_TESTS_DIR = $$QTWEBENGINE_ROOT/tools/qmake/config.tests
+    CONFIG_TESTS = $$files($$QMAKE_CONFIG_TESTS_DIR/*.pro, true)
+    log("Running configure tests$${EOL}")
+    for(test, CONFIG_TESTS) {
+        test = $$basename(test)
+        test ~= s/\\.pro$//
+        qtCompileTest($$test)
+    }
+    # libcap-dev package doesn't ship .pc files on Ubuntu.
+    linux:!config_libcap:skipBuild("libcap appears to be missing")
+    contains(QT_CONFIG, xcb) {
+        for(package, $$list("libdrm xcomposite xi xrandr")) {
+            !packagesExist($$package):skipBuild("Unmet dependency: $$package")
+        }
+    }
+    isEmpty(skipBuildReason):cache(CONFIG, add, $$list(webengine_successfully_configured))
+}
+
diff --git a/tools/qmake/mkspecs/features/default_post.prf b/tools/qmake/mkspecs/features/default_post.prf
new file mode 100644
index 0000000000000000000000000000000000000000..d09ba05fd464acf3e294b17b43b9828adc073508
--- /dev/null
+++ b/tools/qmake/mkspecs/features/default_post.prf
@@ -0,0 +1,8 @@
+load(default_post)
+
+!isEmpty(skipBuildReason) {
+    SUBDIRS =
+    export(SUBDIRS)
+    log($${skipBuildReason}$${EOL})
+    log(QtWebEngine will not be built.$${EOL})
+}
diff --git a/tools/qmake/mkspecs/features/default_pre.prf b/tools/qmake/mkspecs/features/default_pre.prf
index aeb7c0b3bae83fe46ae031a0e84cd8336d469792..02f4f24d4536adadcf943eaf25d2be37da6bbfa7 100644
--- a/tools/qmake/mkspecs/features/default_pre.prf
+++ b/tools/qmake/mkspecs/features/default_pre.prf
@@ -9,8 +9,15 @@ QTWEBENGINEPROCESS_NAME = QtWebEngineProcess
 # Location of sync.profile
 MODULE_BASE_DIR = $$QTWEBENGINE_ROOT
 
+EOL = $$escape_expand(\\n)
 
 load(functions)
 
+# Check platform support and run config tests early enough to bail
+equals(_PRO_FILE_, "$$QTWEBENGINE_ROOT/qtwebengine.pro"): isPlatformSupported() {
+   load(configure)
+   runConfigure()
+}
+
 # Call the original default_pre.
 load(default_pre)
diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf
index acf15a8117427224cf26ef0e83a1883f0333edd8..4c2547d571dbff46e4b31cf015d154da77f48a26 100644
--- a/tools/qmake/mkspecs/features/functions.prf
+++ b/tools/qmake/mkspecs/features/functions.prf
@@ -1,16 +1,19 @@
 defineTest(isPlatformSupported) {
-  static: return(false)
+  static {
+    skipBuild("Static builds of QtWebEngine aren't supported.")
+    return(false)
+  }
   osx:lessThan(QMAKE_XCODE_VERSION, 5.1) {
-    warning("Using xcode version $$QMAKE_XCODE_VERSION, but at least version 5.1 is required to build Qt WebEngine.")
+    skipBuild("Using xcode version $$QMAKE_XCODE_VERSION, but at least version 5.1 is required to build Qt WebEngine.")
     return(false)
   }
 
-  linux-g++*:!isGCCVersionSupported():return(false)
+  linux-g++*:!isGCCVersionSupported(): return(false)
   !isPythonVersionSupported(): return(false)
   linux-g++*|win32-msvc2013|macx-clang: return(true)
   boot2qt: return(true)
 
-  warning("Qt WebEngine can currently only be built for Linux (GCC), Windows (MSVC 2013), OS X (XCode 5.1+) or Qt for Device Creation".)
+  skipBuild("Qt WebEngine can currently only be built for Linux (GCC), Windows (MSVC 2013), OS X (XCode 5.1+) or Qt for Device Creation.")
   return(false)
 }
 
@@ -18,7 +21,7 @@ defineTest(isPythonVersionSupported) {
   python_major_version = $$system('python -c "import sys; print sys.version_info.major"')
   python_minor_version = $$system('python -c "import sys; print sys.version_info.minor"')
   greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): return(true)
-  warning("Using Python version "$$python_major_version"."$$python_minor_version", but at least Python version 2.7 is required to build Qt WebEngine.")
+  skipBuild("Using Python version "$$python_major_version"."$$python_minor_version", but at least Python version 2.7 is required to build Qt WebEngine.")
   return(false)
 }
 
@@ -26,7 +29,7 @@ defineTest(isGCCVersionSupported) {
   # The below will work for gcc 4.6 and up and also match gcc 5
   greaterThan(QT_GCC_MINOR_VERSION, 5):return(true)
   greaterThan(QT_GCC_MAJOR_VERSION, 4):return(true)
-  warning("Using gcc version "$$QT_GCC_MAJOR_VERSION"."$$QT_GCC_MINOR_VERSION", but at least gcc version 4.6 is required to build Qt WebEngine.")
+  skipBuild("Using gcc version "$$QT_GCC_MAJOR_VERSION"."$$QT_GCC_MINOR_VERSION", but at least gcc version 4.6 is required to build Qt WebEngine.")
   return(false)
 }
 
@@ -140,3 +143,8 @@ defineReplace(findOrBuildNinja) {
     }
     return($$out)
 }
+
+defineTest(skipBuild) {
+    skipBuildReason = "$$skipBuildReason $${EOL}$$1"
+    export(skipBuildReason)
+}