configure: introduce 'subarch' term to expression evaluator

... and make use of it.

it's a logical continuation of the 'arch' term, and will be used also in
qt3d's configure.

Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I940917d6763842499b18fffd1514c96889a0cc63
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Oswald Buddenhagen 2018-02-20 12:33:23 +01:00 committed by Thiago Macieira
parent d98f17d434
commit 5cfd5fd9d7
3 changed files with 16 additions and 29 deletions

View File

@ -213,8 +213,7 @@
"compile": [ "verifyspec" ],
"detectPkgConfig": [ "cross_compile", "machineTuple" ],
"library": [ "pkg-config" ],
"getPkgConfigVariable": [ "pkg-config" ],
"subarch": [ "architecture" ]
"getPkgConfigVariable": [ "pkg-config" ]
},
"testTypeAliases": {
@ -450,21 +449,6 @@
"type": "x86SimdAlways",
"test": "x86_simd"
},
"mips_dsp": {
"label": "MIPS DSP instructions",
"type": "subarch",
"subarch": "dsp"
},
"mips_dspr2": {
"label": "MIPS DSPr2 instructions",
"type": "subarch",
"subarch": "dspr2"
},
"neon": {
"label": "NEON instructions",
"type": "subarch",
"subarch": "neon"
},
"posix_fallocate": {
"label": "POSIX fallocate()",
"type": "compile",
@ -1014,7 +998,7 @@
},
"mips_dsp": {
"label": "DSP",
"condition": "arch.mips && tests.mips_dsp",
"condition": "arch.mips && subarch.dsp",
"output": [
"privateConfig",
{ "type": "define", "name": "QT_COMPILER_SUPPORTS_MIPS_DSP", "value": 1 }
@ -1022,7 +1006,7 @@
},
"mips_dspr2": {
"label": "DSPr2",
"condition": "arch.mips && tests.mips_dspr2",
"condition": "arch.mips && subarch.dspr2",
"output": [
"privateConfig",
{ "type": "define", "name": "QT_COMPILER_SUPPORTS_MIPS_DSPR2", "value": 1 }
@ -1030,7 +1014,7 @@
},
"neon": {
"label": "NEON",
"condition": "(arch.arm || arch.arm64) && tests.neon",
"condition": "(arch.arm || arch.arm64) && subarch.neon",
"output": [
"privateConfig",
{ "type": "define", "name": "QT_COMPILER_SUPPORTS_NEON", "value": 1 }

View File

@ -366,12 +366,6 @@ defineTest(qtConfTest_detectPkgConfig) {
return(true)
}
defineTest(qtConfTest_subarch) {
subarch = $$eval($${1}.subarch)
contains($${currentConfig}.tests.architecture.subarch, $${subarch}): return(true)
return(false)
}
defineTest(qtConfTest_buildParts) {
parts = $$config.input.make
isEmpty(parts) {
@ -914,6 +908,7 @@ defineTest(qtConfOutput_sanitizer) {
defineTest(qtConfOutput_architecture) {
arch = $$qtConfEvaluate("tests.architecture.arch")
subarch = $$qtConfEvaluate('tests.architecture.subarch')
buildabi = $$qtConfEvaluate("tests.architecture.buildabi")
$$qtConfEvaluate("features.cross_compile") {
@ -924,7 +919,7 @@ defineTest(qtConfOutput_architecture) {
"host_build {" \
" QT_CPU_FEATURES.$$host_arch = $$qtConfEvaluate('tests.host_architecture.subarch')" \
"} else {" \
" QT_CPU_FEATURES.$$arch = $$qtConfEvaluate('tests.architecture.subarch')" \
" QT_CPU_FEATURES.$$arch = $$subarch" \
"}"
publicPro = \
"host_build {" \
@ -939,7 +934,7 @@ defineTest(qtConfOutput_architecture) {
} else {
privatePro = \
"QT_CPU_FEATURES.$$arch = $$qtConfEvaluate('tests.architecture.subarch')"
"QT_CPU_FEATURES.$$arch = $$subarch"
publicPro = \
"QT_ARCH = $$arch" \
"QT_BUILDABI = $$buildabi"
@ -950,9 +945,11 @@ defineTest(qtConfOutput_architecture) {
$${currentConfig}.output.privatePro += $$privatePro
export($${currentConfig}.output.privatePro)
# setup QT_ARCH variable used by qtConfEvaluate
# setup QT_ARCH and QT_CPU_FEATURES variables used by qtConfEvaluate
QT_ARCH = $$arch
export(QT_ARCH)
QT_CPU_FEATURES.$$arch = $$subarch
export(QT_CPU_FEATURES.$$arch)
}
defineTest(qtConfOutput_qreal) {

View File

@ -1270,6 +1270,12 @@ defineReplace(qtConfEvaluateSingleExpression) {
isEmpty(QT_ARCH): \
qtConfCheckFeature(architecture)
contains(QT_ARCH, $$var): result = true
} else: contains(e, "^subarch\..*") {
var = $$replace(e, "^subarch\.", "")
result = false
isEmpty(QT_ARCH): \
qtConfCheckFeature(architecture)
contains(QT_CPU_FEATURES.$$QT_ARCH, $$var): result = true
} else: contains(e, "^input\..*") {
result = $$eval(config.$$e)
} else: contains(e, "^var\..*") {