rewrite makespec verification with qmake based system

cleaner, and covers windows as well.

Change-Id: I0e884909a3f49610fab750ba1ef6112f43e5d5d1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
Oswald Buddenhagen 2016-08-03 12:32:48 +02:00
parent 97b856b788
commit d90db0f136
5 changed files with 20 additions and 18 deletions

View File

@ -0,0 +1 @@
int main(int, char **) {}

View File

@ -0,0 +1 @@
SOURCES = verifyspec.cpp

17
configure vendored
View File

@ -398,10 +398,7 @@ BUILD_ON_MAC=no
if [ -d /System/Library/Frameworks/Carbon.framework ]; then if [ -d /System/Library/Frameworks/Carbon.framework ]; then
BUILD_ON_MAC=yes BUILD_ON_MAC=yes
fi fi
DEV_NULL=/dev/null
if [ "$OSTYPE" = "msys" ]; then if [ "$OSTYPE" = "msys" ]; then
DEV_NULL=/tmp/empty-file
echo "" > $DEV_NULL
relpath=`(cd "$relpath"; pwd -W)` relpath=`(cd "$relpath"; pwd -W)`
outpath=`pwd -W` outpath=`pwd -W`
fi fi
@ -1863,20 +1860,6 @@ else
HOST_VARS_FILE="$HOST_VARS_OUTFILE" HOST_VARS_FILE="$HOST_VARS_OUTFILE"
fi 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 # run configure tests
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------

View File

@ -785,7 +785,8 @@
"testTypeDependencies": { "testTypeDependencies": {
"linkerSupportsFlag": [ "use_gold_linker" ], "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" ], "detectPkgConfig": [ "cross_compile" ],
"library": [ "pkg-config" ], "library": [ "pkg-config" ],
"getPkgConfigVariable": [ "pkg-config" ], "getPkgConfigVariable": [ "pkg-config" ],
@ -800,6 +801,11 @@
}, },
"tests": { "tests": {
"verifyspec": {
"description": "valid makespec",
"type": "verifySpec",
"test": "common/verifyspec"
},
"architecture": { "architecture": {
"description": "target architecture", "description": "target architecture",
"type": "architecture", "type": "architecture",
@ -1301,6 +1307,10 @@
"pkgConfig" "pkgConfig"
] ]
}, },
"verifyspec": {
"description": "Have valid makespec",
"condition": "tests.verifyspec"
},
"developer-build": { "developer-build": {
"description": "Developer build", "description": "Developer build",

View File

@ -684,6 +684,13 @@ defineTest(qtConfTest_compile) {
return(false) 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) { defineTest(qtConfTest_files) {
for(i, $${1}.files._KEYS_) { for(i, $${1}.files._KEYS_) {
f = $$eval($${1}.files.$${i}) f = $$eval($${1}.files.$${i})