From ff5ba560999703f2d6572a59203ae52d78d221bb Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 9 Dec 2014 14:57:14 +0100 Subject: Remove possible quoting characters qmake may have quoted already because of certain characters like ~ in build path Change-Id: I8a085d23da3da8876f3acd807c9468fc43c7dacb Reviewed-by: Jocelyn Turcotte --- tools/qmake/mkspecs/features/gyp_generator.prf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tools') 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'," \ -- cgit v1.2.3 From 98349dbdd88970ac0274e8d9e5f12dc0e9737bdb Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Wed, 14 Jan 2015 14:54:32 +0100 Subject: Print only major.minor.micro version of python. This will avoid printing the compiler version python was built with. Showing the compiler version led to confusion multiple times. Change-Id: I4ced2128b92c83a41f616bcf756f2c313a9caed3 Reviewed-by: Andras Becsi --- tools/buildscripts/gyp_qtwebengine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') 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', ' ') -- cgit v1.2.3 From 1364ba04b2df4e91d8f648fb02e0c19dcac1ab30 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Fri, 9 Jan 2015 11:05:04 +0100 Subject: Refactor our build skipping logic Move the logic to mkspecs to keep the .pro files robust. Add the basic infrastructure for config.tests, the first one of which will consistently ensure we have libcap on linux. Change-Id: Iee4207e747e589ba67d5353cb4c18f156e555c11 Reviewed-by: Andras Becsi --- tools/qmake/config.tests/libcap/libcap.cpp | 44 +++++++++++++++++++++++++++ tools/qmake/config.tests/libcap/libcap.pro | 3 ++ tools/qmake/mkspecs/features/configure.prf | 23 ++++++++++++++ tools/qmake/mkspecs/features/default_post.prf | 8 +++++ tools/qmake/mkspecs/features/default_pre.prf | 7 +++++ tools/qmake/mkspecs/features/functions.prf | 20 ++++++++---- 6 files changed, 99 insertions(+), 6 deletions(-) create mode 100644 tools/qmake/config.tests/libcap/libcap.cpp create mode 100644 tools/qmake/config.tests/libcap/libcap.pro create mode 100644 tools/qmake/mkspecs/features/configure.prf create mode 100644 tools/qmake/mkspecs/features/default_post.prf (limited to 'tools') 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 + +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..d0cb50877 --- /dev/null +++ b/tools/qmake/mkspecs/features/configure.prf @@ -0,0 +1,23 @@ +# Load configure.prf from qtbase first +load(configure) +load(functions) + +defineTest(runConfigure) { + webengine_successfully_configured: return(true) + # 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") + + 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 acf15a811..4c2547d57 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) +} -- cgit v1.2.3 From ae657b918ff22da2553dc577c877b03f49cc2bdf Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Mon, 12 Jan 2015 18:56:52 +0100 Subject: Add additional dependency checks For dependencies that have caused trouble before, such as libdrm. Task-number: QTBUG-41516 Change-Id: I0cee98282e93460971471796a65a43be4750c6b0 Reviewed-by: Andras Becsi --- tools/qmake/mkspecs/features/configure.prf | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/qmake/mkspecs/features/configure.prf b/tools/qmake/mkspecs/features/configure.prf index d0cb50877..6e74b5547 100644 --- a/tools/qmake/mkspecs/features/configure.prf +++ b/tools/qmake/mkspecs/features/configure.prf @@ -4,6 +4,10 @@ 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 @@ -17,7 +21,11 @@ defineTest(runConfigure) { } # 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)) } -- cgit v1.2.3