From d90db0f136d727f8e6b9a566eee3eae80cd7d81e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 3 Aug 2016 12:32:48 +0200 Subject: [PATCH] rewrite makespec verification with qmake based system cleaner, and covers windows as well. Change-Id: I0e884909a3f49610fab750ba1ef6112f43e5d5d1 Reviewed-by: Lars Knoll Reviewed-by: Laszlo Agocs --- config.tests/common/verifyspec/verifyspec.cpp | 1 + config.tests/common/verifyspec/verifyspec.pro | 1 + configure | 17 ----------------- configure.json | 12 +++++++++++- mkspecs/features/qt_configure.prf | 7 +++++++ 5 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 config.tests/common/verifyspec/verifyspec.cpp create mode 100644 config.tests/common/verifyspec/verifyspec.pro diff --git a/config.tests/common/verifyspec/verifyspec.cpp b/config.tests/common/verifyspec/verifyspec.cpp new file mode 100644 index 0000000000..bd5560bf02 --- /dev/null +++ b/config.tests/common/verifyspec/verifyspec.cpp @@ -0,0 +1 @@ +int main(int, char **) {} diff --git a/config.tests/common/verifyspec/verifyspec.pro b/config.tests/common/verifyspec/verifyspec.pro new file mode 100644 index 0000000000..d78ed2985a --- /dev/null +++ b/config.tests/common/verifyspec/verifyspec.pro @@ -0,0 +1 @@ +SOURCES = verifyspec.cpp diff --git a/configure b/configure index bd5a0fac8d..b031aae2f9 100755 --- a/configure +++ b/configure @@ -398,10 +398,7 @@ BUILD_ON_MAC=no if [ -d /System/Library/Frameworks/Carbon.framework ]; then BUILD_ON_MAC=yes fi -DEV_NULL=/dev/null if [ "$OSTYPE" = "msys" ]; then - DEV_NULL=/tmp/empty-file - echo "" > $DEV_NULL relpath=`(cd "$relpath"; pwd -W)` outpath=`pwd -W` fi @@ -1863,20 +1860,6 @@ else HOST_VARS_FILE="$HOST_VARS_OUTFILE" fi -#------------------------------------------------------------------------------- -# Verify makespec -#------------------------------------------------------------------------------- -QMAKE_OUTPUT=`"$CFG_QMAKE_PATH" -qtconf "$QTCONFFILE" -E -nocache -spec "$XQMAKESPEC" "QT=" $DEV_NULL 2>&1` -if [ $? != "0" ]; then - echo "Failed to process makespec for platform '$XPLATFORM'" - if [ "$OPT_VERBOSE" = "yes" ]; then - echo "$QMAKE_OUTPUT" - else - echo "Turn on verbose messaging (-v) to see the final report." - fi - exit 101 -fi - #------------------------------------------------------------------------------- # run configure tests #------------------------------------------------------------------------------- diff --git a/configure.json b/configure.json index 5874d8abaa..181fe8aa09 100644 --- a/configure.json +++ b/configure.json @@ -785,7 +785,8 @@ "testTypeDependencies": { "linkerSupportsFlag": [ "use_gold_linker" ], - "compile": [ "shared", "use_gold_linker", "compiler-flags", "gcc-sysroot", "qmakeargs" ], + "verifySpec": [ "shared", "use_gold_linker", "compiler-flags", "gcc-sysroot", "qmakeargs" ], + "compile": [ "verifyspec" ], "detectPkgConfig": [ "cross_compile" ], "library": [ "pkg-config" ], "getPkgConfigVariable": [ "pkg-config" ], @@ -800,6 +801,11 @@ }, "tests": { + "verifyspec": { + "description": "valid makespec", + "type": "verifySpec", + "test": "common/verifyspec" + }, "architecture": { "description": "target architecture", "type": "architecture", @@ -1301,6 +1307,10 @@ "pkgConfig" ] }, + "verifyspec": { + "description": "Have valid makespec", + "condition": "tests.verifyspec" + }, "developer-build": { "description": "Developer build", diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 5a3f8410a2..880d71fab1 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -684,6 +684,13 @@ defineTest(qtConfTest_compile) { return(false) } +defineTest(qtConfTest_verifySpec) { + qtConfTest_compile($$1): return(true) + qtConfAddError("Cannot compile a minimal program. The toolchain or QMakeSpec is broken.", log) + qtConfPrintReport() + error() +} + defineTest(qtConfTest_files) { for(i, $${1}.files._KEYS_) { f = $$eval($${1}.files.$${i})