diff options
m--------- | src/3rdparty | 0 | ||||
-rw-r--r-- | src/core/core_gyp_generator.pro | 3 | ||||
-rw-r--r-- | src/core/core_module.pro | 104 | ||||
-rw-r--r-- | src/core/web_engine_context.cpp | 1 | ||||
-rw-r--r-- | src/core/web_engine_library_info.cpp | 14 | ||||
-rw-r--r-- | src/process/Info_mac.plist | 22 | ||||
-rw-r--r-- | src/process/process.pro | 3 | ||||
-rw-r--r-- | src/src.pro | 42 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineview.cpp | 2 | ||||
-rw-r--r-- | src/webengine/ui_delegates_manager.cpp | 31 | ||||
-rw-r--r-- | sync.profile | 8 | ||||
-rwxr-xr-x | tools/buildscripts/gyp_qtwebengine | 2 | ||||
-rw-r--r-- | tools/qmake/config.tests/libcap/libcap.cpp | 44 | ||||
-rw-r--r-- | tools/qmake/config.tests/libcap/libcap.pro | 3 | ||||
-rw-r--r-- | tools/qmake/mkspecs/features/configure.prf | 31 | ||||
-rw-r--r-- | tools/qmake/mkspecs/features/default_post.prf | 8 | ||||
-rw-r--r-- | tools/qmake/mkspecs/features/default_pre.prf | 7 | ||||
-rw-r--r-- | tools/qmake/mkspecs/features/functions.prf | 20 | ||||
-rw-r--r-- | tools/qmake/mkspecs/features/gyp_generator.prf | 5 |
19 files changed, 240 insertions, 110 deletions
diff --git a/src/3rdparty b/src/3rdparty -Subproject 66388297cf2ca42049fb099237134ec33465e2f +Subproject f9c03801de86b5e9da2b915a9e490c2f2254fec diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro index 90a665e84..ae2422957 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/core_module.pro b/src/core/core_module.pro index 8801dd4cf..e6933cc4b 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -13,6 +13,18 @@ QMAKE_INFO_PLIST = Info_mac.plist error("Could not find the linking information that gyp should have generated.") } +# We distribute the module binary but headers are only available in-tree. +CONFIG += no_module_headers +load(qt_module) + +# Using -Wl,-Bsymbolic-functions seems to confuse the dynamic linker +# and doesn't let Chromium get access to libc symbols through dlsym. +CONFIG -= bsymbolic_functions + +contains(QT_CONFIG, egl): CONFIG += egl + +linux: contains(QT_CONFIG, separate_debug_info): QMAKE_POST_LINK="cd $(DESTDIR) && $(STRIP) --strip-unneeded $(TARGET)" + REPACK_DIR = $$OUT_PWD/$$getConfigDir()/gen/repack # Duplicated from resources/resources.gyp LOCALE_LIST = am ar bg bn ca cs da de el en-GB en-US es-419 es et fa fi fil fr gu he hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv sw ta te th tr uk vi zh-CN zh-TW @@ -32,58 +44,48 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat plugins.files = $$OUT_PWD/$$getConfigDir()/$${PLUGIN_PREFIX}ffmpegsumo$${PLUGIN_EXTENSION} -!debug_and_release|!build_all|CONFIG(release, debug|release):contains(QT_CONFIG, qt_framework) { - locales.version = Versions - locales.path = Resources/qtwebengine_locales - resources.version = Versions - resources.path = Resources - icu.version = Versions - icu.path = Resources - plugins.version = Versions - plugins.path = Libraries - # No files, this prepares the bundle Helpers symlink, process.pro will create the directories - qtwebengineprocessplaceholder.version = Versions - qtwebengineprocessplaceholder.path = Helpers - QMAKE_BUNDLE_DATA += icu locales resources plugins qtwebengineprocessplaceholder -} else { - locales.CONFIG += no_check_exist - locales.path = $$[QT_INSTALL_TRANSLATIONS]/qtwebengine_locales - resources.CONFIG += no_check_exist - resources.path = $$[QT_INSTALL_DATA] - icu.CONFIG += no_check_exist - icu.path = $$[QT_INSTALL_DATA] - plugins.CONFIG += no_check_exist - plugins.path = $$[QT_INSTALL_PLUGINS]/qtwebengine - INSTALLS += icu locales resources plugins -} - -# We distribute the module binary but headers are only available in-tree. -CONFIG += no_module_headers -load(qt_module) - -# Using -Wl,-Bsymbolic-functions seems to confuse the dynamic linker -# and doesn't let Chromium get access to libc symbols through dlsym. -CONFIG -= bsymbolic_functions - -contains(QT_CONFIG, egl): CONFIG += egl - -linux: contains(QT_CONFIG, separate_debug_info): QMAKE_POST_LINK="cd $(DESTDIR) && $(STRIP) --strip-unneeded $(TARGET)" +!debug_and_release|!build_all|CONFIG(release, debug|release) { + contains(QT_CONFIG, qt_framework) { + locales.version = Versions + locales.path = Resources/qtwebengine_locales + resources.version = Versions + resources.path = Resources + icu.version = Versions + icu.path = Resources + plugins.version = Versions + plugins.path = Libraries + # No files, this prepares the bundle Helpers symlink, process.pro will create the directories + qtwebengineprocessplaceholder.version = Versions + qtwebengineprocessplaceholder.path = Helpers + QMAKE_BUNDLE_DATA += icu locales resources plugins qtwebengineprocessplaceholder + } else { + locales.CONFIG += no_check_exist + locales.path = $$[QT_INSTALL_TRANSLATIONS]/qtwebengine_locales + resources.CONFIG += no_check_exist + resources.path = $$[QT_INSTALL_DATA] + icu.CONFIG += no_check_exist + icu.path = $$[QT_INSTALL_DATA] + plugins.CONFIG += no_check_exist + plugins.path = $$[QT_INSTALL_PLUGINS]/qtwebengine + INSTALLS += icu locales resources plugins + } -!contains(QT_CONFIG, qt_framework): contains(QT_CONFIG, private_tests) { - ICU_TARGET = $$shell_path($$[QT_INSTALL_DATA]/icudtl.dat) - ICU_FILE = $$shell_path($$OUT_PWD/$$getConfigDir()/icudtl.dat) - icu_rule.target = $$ICU_TARGET - unix: icu_rule.commands = if [ -e $$ICU_FILE ] ; then $$QMAKE_COPY $$ICU_FILE $$ICU_TARGET ; fi - win32: icu_rule.commands = if exist $$ICU_FILE ( $$QMAKE_COPY $$ICU_FILE $$ICU_TARGET ) + !contains(QT_CONFIG, qt_framework): contains(QT_CONFIG, private_tests) { + ICU_TARGET = $$shell_path($$[QT_INSTALL_DATA]/icudtl.dat) + ICU_FILE = $$shell_path($$OUT_PWD/$$getConfigDir()/icudtl.dat) + icu_rule.target = $$ICU_TARGET + unix: icu_rule.commands = if [ -e $$ICU_FILE ] ; then $$QMAKE_COPY $$ICU_FILE $$ICU_TARGET ; fi + win32: icu_rule.commands = if exist $$ICU_FILE ( $$QMAKE_COPY $$ICU_FILE $$ICU_TARGET ) - PLUGIN_DIR = $$shell_path($$[QT_INSTALL_PLUGINS]/qtwebengine) - PLUGIN_TARGET = $$shell_path($$PLUGIN_DIR/$${PLUGIN_PREFIX}ffmpegsumo$${PLUGIN_EXTENSION}) - PLUGIN_FILE = $$shell_path($$OUT_PWD/$$getConfigDir()/$${PLUGIN_PREFIX}ffmpegsumo$${PLUGIN_EXTENSION}) - plugins_rule.target = $$PLUGIN_TARGET - unix: plugins_rule.commands = $$QMAKE_MKDIR $$PLUGIN_DIR && if [ -e $$PLUGIN_FILE ] ; then $$QMAKE_COPY $$PLUGIN_FILE $$PLUGIN_TARGET ; fi - win32: plugins_rule.commands = (if not exist $$PLUGIN_DIR ( $$QMAKE_MKDIR $$PLUGIN_DIR )) && \ - if exist $$PLUGIN_FILE ( $$QMAKE_COPY $$PLUGIN_FILE $$PLUGIN_TARGET ) + PLUGIN_DIR = $$shell_path($$[QT_INSTALL_PLUGINS]/qtwebengine) + PLUGIN_TARGET = $$shell_path($$PLUGIN_DIR/$${PLUGIN_PREFIX}ffmpegsumo$${PLUGIN_EXTENSION}) + PLUGIN_FILE = $$shell_path($$OUT_PWD/$$getConfigDir()/$${PLUGIN_PREFIX}ffmpegsumo$${PLUGIN_EXTENSION}) + plugins_rule.target = $$PLUGIN_TARGET + unix: plugins_rule.commands = $$QMAKE_MKDIR $$PLUGIN_DIR && if [ -e $$PLUGIN_FILE ] ; then $$QMAKE_COPY $$PLUGIN_FILE $$PLUGIN_TARGET ; fi + win32: plugins_rule.commands = (if not exist $$PLUGIN_DIR ( $$QMAKE_MKDIR $$PLUGIN_DIR )) && \ + if exist $$PLUGIN_FILE ( $$QMAKE_COPY $$PLUGIN_FILE $$PLUGIN_TARGET ) - QMAKE_EXTRA_TARGETS += icu_rule plugins_rule - PRE_TARGETDEPS += $$ICU_TARGET $$PLUGIN_TARGET + QMAKE_EXTRA_TARGETS += icu_rule plugins_rule + PRE_TARGETDEPS += $$ICU_TARGET $$PLUGIN_TARGET + } } diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index d48c23815..85c1136d9 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -250,6 +250,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 09e2af495..452eee306 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/process/Info_mac.plist b/src/process/Info_mac.plist new file mode 100644 index 000000000..de1d010bc --- /dev/null +++ b/src/process/Info_mac.plist @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>NSPrincipalClass</key> + <string>NSApplication</string> + <key>CFBundleIconFile</key> + <string>@ICON@</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleGetInfoString</key> + <string>Created by Qt/QMake</string> + <key>CFBundleSignature</key> + <string>@TYPEINFO@</string> + <key>CFBundleExecutable</key> + <string>@EXECUTABLE@</string> + <key>CFBundleIdentifier</key> + <string>@BUNDLEIDENTIFIER@</string> + <key>LSUIElement</key> + <string>1</string> +</dict> +</plist> diff --git a/src/process/process.pro b/src/process/process.pro index ad1575c81..443c5c3d9 100644 --- a/src/process/process.pro +++ b/src/process/process.pro @@ -1,6 +1,9 @@ TARGET = $$QTWEBENGINEPROCESS_NAME TEMPLATE = app +# Needed to set LSUIElement=1 +QMAKE_INFO_PLIST = Info_mac.plist + load(qt_build_paths) contains(QT_CONFIG, qt_framework) { # Deploy the QtWebEngineProcess app bundle into the QtWebEngineCore framework. diff --git a/src/src.pro b/src/src.pro index 60f873c76..ed402c582 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/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index 6d666feb9..1b95f86b4 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -188,7 +188,7 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu // FIXME: expose the context menu data as an attached property to make this more useful if (contextMenuExtraItems) { ui()->addMenuSeparator(menu); - if (QObject* menuExtras = contextMenuExtraItems->create(ui()->creationContextForComponent(contextMenuExtraItems))) { + if (QObject* menuExtras = contextMenuExtraItems->create(qmlContext(q))) { menuExtras->setParent(menu); QQmlListReference entries(menu, defaultPropertyName(menu), qmlEngine(q)); if (entries.isValid()) diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp index 95e04d699..48e1bee7e 100644 --- a/src/webengine/ui_delegates_manager.cpp +++ b/src/webengine/ui_delegates_manager.cpp @@ -173,24 +173,15 @@ bool UIDelegatesManager::ensureComponentLoaded(ComponentType type) *component = (new QQmlComponent(engine, QUrl::fromLocalFile(fi.absoluteFilePath()), QQmlComponent::PreferSynchronous, m_view)); if ((*component)->status() != QQmlComponent::Ready) { -#ifdef UI_DELEGATES_DEBUG Q_FOREACH (const QQmlError& err, (*component)->errors()) - fprintf(stderr, " component error: %s\n", qPrintable(err.toString())); -#endif + qWarning("QtWebEngine: component error: %s\n", qPrintable(err.toString())); + delete *component; + *component = 0; return false; } return true; } -QQmlContext *UIDelegatesManager::creationContextForComponent(QQmlComponent *component) -{ - Q_ASSERT(component); - - QQmlContext* baseContext = component->creationContext() ? component->creationContext() : qmlContext(m_view); - Q_ASSERT(baseContext); - return baseContext; -} - #define CHECK_QML_SIGNAL_PROPERTY(prop, location) \ if (!prop.isSignalProperty()) \ qWarning("%s is missing %s signal property.\n", qPrintable(location.toString()), qPrintable(prop.name())); @@ -200,7 +191,7 @@ void UIDelegatesManager::addMenuItem(MenuItemHandler *menuItemHandler, const QSt Q_ASSERT(menuItemHandler); if (!ensureComponentLoaded(MenuItem)) return; - QObject *it = menuItemComponent->beginCreate(creationContextForComponent(menuItemComponent)); + QObject *it = menuItemComponent->beginCreate(qmlContext(m_view)); QQmlProperty(it, QStringLiteral("text")).write(text); QQmlProperty(it, QStringLiteral("iconName")).write(iconName); @@ -224,7 +215,7 @@ void UIDelegatesManager::addMenuSeparator(QObject *menu) if (!ensureComponentLoaded(MenuSeparator)) return; - QQmlContext *itemContext = creationContextForComponent(menuSeparatorComponent); + QQmlContext *itemContext = qmlContext(m_view); QObject *sep = menuSeparatorComponent->create(itemContext); sep->setParent(menu); @@ -238,7 +229,7 @@ QObject *UIDelegatesManager::addMenu(QObject *parentMenu, const QString &title, if (!ensureComponentLoaded(Menu)) return 0; - QQmlContext *context(creationContextForComponent(menuComponent)); + QQmlContext *context = qmlContext(m_view); QObject *menu = menuComponent->beginCreate(context); // Useful when not using Qt Quick Controls' Menu if (QQuickItem* item = qobject_cast<QQuickItem*>(menu)) @@ -296,8 +287,12 @@ void UIDelegatesManager::showDialog(QSharedPointer<JavaScriptDialogController> d Q_UNREACHABLE(); } - if (!ensureComponentLoaded(dialogComponentType)) + if (!ensureComponentLoaded(dialogComponentType)) { + // Let the controller know it couldn't be loaded + qWarning("Failed to load dialog, rejecting."); + dialogController->reject(); return; + } QQmlComponent *dialogComponent = Q_NULLPTR; switch (dialogComponentType) { @@ -306,7 +301,7 @@ void UIDelegatesManager::showDialog(QSharedPointer<JavaScriptDialogController> d Q_UNREACHABLE(); } - QQmlContext *context(creationContextForComponent(dialogComponent)); + QQmlContext *context = qmlContext(m_view); QObject *dialog = dialogComponent->beginCreate(context); dialog->setParent(m_view); QQmlProperty textProp(dialog, QStringLiteral("text")); @@ -391,7 +386,7 @@ void UIDelegatesManager::showFilePicker(WebContentsAdapterClient::FileChooserMod if (!ensureComponentLoaded(FilePicker)) return; - QQmlContext *context(creationContextForComponent(filePickerComponent)); + QQmlContext *context = qmlContext(m_view); QObject *filePicker = filePickerComponent->beginCreate(context); if (QQuickItem* item = qobject_cast<QQuickItem*>(filePicker)) item->setParentItem(m_view); diff --git a/sync.profile b/sync.profile index 2f3aab8c5..1e9519fe3 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 6f2bbc936..970cce54e 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 000000000..c0bba3eae --- /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 000000000..2c688f809 --- /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 000000000..6e74b5547 --- /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 000000000..d09ba05fd --- /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 aeb7c0b3b..02f4f24d4 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 3a25bb0d6..338a9ec27 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) } @@ -142,3 +145,8 @@ defineReplace(findOrBuildNinja) { } return($$out) } + +defineTest(skipBuild) { + skipBuildReason = "$$skipBuildReason $${EOL}$$1" + export(skipBuildReason) +} diff --git a/tools/qmake/mkspecs/features/gyp_generator.prf b/tools/qmake/mkspecs/features/gyp_generator.prf index 5ef3110cc..eea11ef09 100644 --- a/tools/qmake/mkspecs/features/gyp_generator.prf +++ b/tools/qmake/mkspecs/features/gyp_generator.prf @@ -24,7 +24,7 @@ defineReplace(mocAction) { " 'inputs': ['$$INPUT_FILE',]," \ " 'outputs': ['$$OUTPUT_FILE',]," \ " 'action': [" - for(token, MOC_COMMAND): contents += " '$$token'," + for(token, MOC_COMMAND): contents += " '$$replace(token,\',)'," contents += " '$$INPUT_FILE'," \ " '-o'," \ " '$$OUTPUT_FILE'," \ @@ -39,12 +39,13 @@ defineReplace(rccAction) { OUTPUT_NAME = $$rccOutput($$INPUT_FILE) EXTERN_FUNC = $$rccExternFunc($$INPUT_FILE) OUTPUT_FILE = $$RCC_GEN_DIR/$${OUTPUT_NAME} + CLEAN_QMAKE_RCC = $$clean_path($$QMAKE_RCC) contents = " {" \ " 'action_name':'$$OUTPUT_NAME'," \ " 'inputs': ['$$INPUT_FILE',]," \ " 'outputs': ['$$OUTPUT_FILE',]," \ " 'action': [" \ - " '$$clean_path($$QMAKE_RCC)'," + " '$$replace(CLEAN_QMAKE_RCC,\',)'," for(resource_flag, $$QMAKE_RESOURCE_FLAGS): contents += " '$$resource_flag'," contents += " '-name'," \ " '$$EXTERN_FUNC'," \ |