From 890a4d40ecd384ba4f59643374948a6fdddb741a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Nov 2016 13:57:14 +0100 Subject: nuke obsolete comment amends 56ee007b3. Change-Id: Ida4f79ae72f185ce1f4cca9add30e3084da9c5bf Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 3 --- 1 file changed, 3 deletions(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 6b500c0f3e..bfc460edca 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1552,9 +1552,6 @@ defineTest(qtConfOutput_publicFeature) { } } -# currently this is somewhat inconsistent, as the feature is output to the public pro file, -# whereas the define is being added to the private pro file. -# This should get cleaned up to add to the private pro and header instead. defineTest(qtConfOutput_privateFeature) { name = "$$eval($${1}.name)" isEmpty(name): \ -- cgit v1.2.3 From 66ad9668f3158ab5a0ee8f93fe3ddf062e37967e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Nov 2016 15:15:19 +0100 Subject: fix iteration over a feature's outputs use precalculated path instead of incorrectly assembling it from scratch. it accidentally worked when the features happened to be in the right order, as the iteration variable 'feature' from the calling function was inherited. however, if the feature was accessed via dependency resolution, things blew up. amends 90eee08b3e, which presumably came to be this way due to a missing adjustment to a refactoring. Change-Id: I78b0acc0682cfc27a458df014ce14262a65c6241 Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index bfc460edca..1d7e810cc8 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1182,8 +1182,8 @@ defineTest(qtConfCheckFeature) { $${fpfx}.available = $$result export($${fpfx}.available) - for (i, $${currentConfig}.features.$${feature}.output._KEYS_): \ - qtConfProcessOneOutput($$feature, $$i) + for (i, $${fpfx}.output._KEYS_): \ + qtConfProcessOneOutput($${1}, $$i) return(true) } -- cgit v1.2.3 From 7ac15ab0ffeeb88a156cd5dd935fadcda4a559f9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Nov 2016 17:08:26 +0100 Subject: don't clear config.log unless re-checking it is counterproductive to clear the log when cached test results are used, as that makes it hard to determine how they came to be. -recheck isn't as clear-cut as -recheck-all, as only part of the results is discarded, and we can't reasonably discard only part of the log. i opted for clearing the log entirely, as having both the old and new results in the log would be probably quite confusing. Change-Id: Ibb391f2ba2ea86d73c23365d46cc66ed8a2158d6 Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 1d7e810cc8..810e3106ab 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1729,6 +1729,8 @@ equals(QMAKE_CONFIG_CACHE_USE, none) { "cache.xplatform = $$[QMAKE_XSPEC]" write_file($$QMAKE_CONFIG_CACHE, cont) } +!equals(QMAKE_CONFIG_CACHE_USE, all): \ + write_file($$QMAKE_CONFIG_LOG, "") for (currentConfig, allConfigs) { qtConfSetModuleName() -- cgit v1.2.3 From 6c7f81cac93d32072e64466a713eebfcf5e68807 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Nov 2016 17:58:53 +0100 Subject: don't write "Checking for ..." to config.log the more precise test/library name is already logged. Change-Id: I73d3229a9e20a0024582b18bfe9f2848cab5f4ff Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 810e3106ab..94001dc1d5 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -794,10 +794,8 @@ defineTest(qtLogTestIntro) { label = $$eval($${1}.label) isEmpty(label): return() - msg = "Checking for $${label}... " - log($$msg) + log("Checking for $${label}... ") $$QMAKE_CONFIG_VERBOSE: log("$$escape_expand(\\n)") - write_file($$QMAKE_CONFIG_LOG, msg, append) } defineTest(qtLogTestResult) { -- cgit v1.2.3 From b4979082b89842ee14cfc28639129bd15935bfc8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Nov 2016 18:00:16 +0100 Subject: don't log silent tests to config.log they were already omitted from the console output; there is no need to spam the log with them (their completion was not logged, either). Change-Id: I32c97413d2e6ceb18ee61356855cc6a7fa2222bf Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 94001dc1d5..d5b9c6dc11 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -611,9 +611,7 @@ defineTest(qtConfHandleLibrary) { return() } - qtLogTestIntro($${lpfx}) - msg = "looking for library $${1}" - write_file($$QMAKE_CONFIG_LOG, msg, append) + qtLogTestIntro($${lpfx}, "looking for library $${1}") result = false for (s, $${lpfx}.sources._KEYS_) { @@ -796,6 +794,7 @@ defineTest(qtLogTestIntro) { log("Checking for $${label}... ") $$QMAKE_CONFIG_VERBOSE: log("$$escape_expand(\\n)") + write_file($$QMAKE_CONFIG_LOG, 2, append) } defineTest(qtLogTestResult) { @@ -921,9 +920,7 @@ defineTest(qtRunSingleTest) { qtConfLoadResult($${tpfx}, $$1): \ return() - qtLogTestIntro($${tpfx}) - msg = "executing config test $${1}" - write_file($$QMAKE_CONFIG_LOG, msg, append) + qtLogTestIntro($${tpfx}, "executing config test $${1}") result = false $${call}($${tpfx}): result = true -- cgit v1.2.3 From aeb2768a7c5b23260e6ca0826b844777b9948b6c Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Fri, 11 Nov 2016 10:02:34 +0100 Subject: Introduce QMAKE_CD to enable us to cd from one Windows drive to another On Windows cd does not change the drive. So when you are on drive C: and type "cd D:\data" it will change the directory on drive D: but not affect your current working directory. To also change your drive you have to provide the parameter /d on Windows, so "cd /d D:\data" will also change the drive. Task-number: QTBUG-57080 Change-Id: Ib629879534523982eec693cef725f20a535a1a74 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_configure.prf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index d5b9c6dc11..47772be8de 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -324,7 +324,7 @@ defineTest(qtConfParseCommandLine) { defineReplace(qtConfToolchainSupportsFlag) { test_out_dir = $$shadowed($$QMAKE_CONFIG_TESTS_DIR) - test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&" + test_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$test_out_dir)) &&" conftest = "int main() { return 0; }" write_file("$$test_out_dir/conftest.cpp", conftest)|error() @@ -696,7 +696,7 @@ defineTest(qtConfTest_compile) { test_out_dir = $$shadowed($$test_dir) !isEmpty($${1}.pro): \ test_dir = $$test_dir/$$eval($${1}.pro) - test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&" + test_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$test_out_dir)) &&" qmake_args = $$qtConfPkgConfigEnv()$$system_quote($$system_path($$QMAKE_QMAKE)) !isEmpty(QMAKE_QTCONF): \ -- cgit v1.2.3 From 6de11782d093dea2e6fe9406fb712706a984ff61 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 11 Nov 2016 09:09:12 +0100 Subject: Allow checking for the existence of modules in configure.json You can now use 'module.gui' to check whether the Qt Gui module exists in the current build of Qt. Task-number: QTBUG-56656 Change-Id: Ic73f162ed0578e07c70e3ec3706f285b6d09a41d Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_configure.prf | 45 +++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 47772be8de..bdf9f21fc9 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -932,6 +932,15 @@ defineTest(qtRunSingleTest) { qtConfSaveResult($${tpfx}, $$1) } +defineTest(qtConfHaveModule) { + module = $$replace(1, -, _) + !isEmpty(QT.$${module}.skip):$$eval(QT.$${module}.skip): \ + return(false) + !isEmpty(QT.$${module}.name): \ + return(true) + return(false) +} + defineReplace(qtConfEvaluate) { isEmpty(1): return(true) @@ -1015,6 +1024,10 @@ defineReplace(qtConfEvaluateSingleExpression) { var = $$replace(e, "^config\.", "") result = false contains(CONFIG, $$var): result = true + } else: contains(e, "^module\..*") { + var = $$replace(e, "^module\.", "") + result = false + qtConfHaveModule($$var): result = true } else: contains(e, "^arch\..*") { var = $$replace(e, "^arch\.", "") result = false @@ -1183,6 +1196,17 @@ defineTest(qtConfCheckFeature) { return(true) } +defineTest(qtConfCheckModuleCondition) { + QT.$${currentModule}.skip = false + !$$qtConfEvaluate($$eval($${currentConfig}.condition)): \ + QT.$${currentModule}.skip = true + export(QT.$${currentModule}.skip) + + # ensure qtConfHaveModule() works + QT.$${currentModule}.name = - + export(QT.$${currentModule}.name) +} + defineTest(qtConfProcessFeatures) { for (feature, $${currentConfig}.features._KEYS_): \ @@ -1758,15 +1782,28 @@ for (currentConfig, allConfigs) { } } - # process all features - qtConfProcessFeatures() + qtConfCheckModuleCondition() + + qtConfHaveModule($$currentModule) { + # process all features + qtConfProcessFeatures() + } else { + qtConfOutputVar(assign, "privatePro", "QT.$${currentModule}.skip", "true") + } # generate files and reports qtConfProcessOutput() - qtConfCreateReport() - qtConfCreateSummary() + qtConfHaveModule($$currentModule) { + qtConfCreateReport() + qtConfCreateSummary() + } else { + QT_CONFIGURE_SKIPPED_MODULES += " $$currentModule" + } } +!isEmpty(QT_CONFIGURE_SKIPPED_MODULES): \ + qtConfAddNote("The following modules are not being compiled in this configuration:" $$QT_CONFIGURE_SKIPPED_MODULES) + # these come from the pri files loaded above. for (p, QMAKE_POST_CONFIGURE): \ eval($$p) -- cgit v1.2.3 From c64e4bf6b436c779d9ab03fd6886ab8d27c90235 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 9 Nov 2016 15:02:11 +0100 Subject: Make 'use' entries work across module boundaries 'use' entries in the tests and libraries sections of configure.json files should work acrosss library boundaries, so a test in qtwayland can refer to a library from qtbase. Change-Id: Ide02b9985be427a27982a422ca84a29b23145bcf Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_configure.prf | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index bdf9f21fc9..38305890b5 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -675,13 +675,33 @@ defineTest(qtConfTest_library) { defineTest(qtConfTestPrepare_compile) { for (u, $$list($$eval($${1}.use))) { - !contains($${currentConfig}.libraries._KEYS_, $$u): \ - error("Test $$1 tries to use undeclared library '$$u'") - qtConfHandleLibrary($$u) - lpfx = $${currentConfig}.libraries.$${u} - isEmpty($${lpfx}.source): \ - return(false) - $${1}.literal_args += $$qtConfLibraryArgs($${lpfx}.sources.$$eval($${lpfx}.source)) + libConfig = + contains($${currentConfig}.libraries._KEYS_, $$u) { + libConfig = $${currentConfig} + qtConfHandleLibrary($$u) + } else { + for (d, QMAKE_CONFIG_DEPS) { + contains($${d}.libraries._KEYS_, $$u) { + libConfig = $$d + break() + } + } + } + isEmpty(libConfig) { + nu = $$upper($$u) + libs = $$eval(QMAKE_LIBS_$$nu) $$eval(QMAKE_LIBS_$${nu}_DEBUG) $$eval(QMAKE_LIBS_$${nu}_RELEASE) + defines = $$eval(QMAKE_DEFINES_$${nu}) + includes = $$eval(QMAKE_INCDIR_$${nu}) + + isEmpty(libs):isEmpty(defines):isEmpty(includes): \ + error("Test $$1 tries to use undeclared library '$$u'") + $${1}.literal_args += $$system_quote(QMAKE_USE += $$u) + } else { + lpfx = $${libConfig}.libraries.$${u} + isEmpty($${lpfx}.source): \ + return(false) + $${1}.literal_args += $$qtConfLibraryArgs($${lpfx}.sources.$$eval($${lpfx}.source)) + } } export($${1}.literal_args) return(true) -- cgit v1.2.3 From fa8e467804428127429ca91aaa1538bae70b1871 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 11 Nov 2016 18:01:41 +0100 Subject: fix configure logging when no cache is present yet this got broken in 2ad4d75754. however, the new configure system operates from the top-level build dir anyway, so there is no point in messing with the cache as a reference point to start with - just use OUT_PWD. Task-number: QTBUG-57120 Change-Id: I69629bf497931574bff8452939170abb1776ab60 Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 38305890b5..2810faad1a 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1768,6 +1768,8 @@ equals(QMAKE_CONFIG_CACHE_USE, none) { "cache.xplatform = $$[QMAKE_XSPEC]" write_file($$QMAKE_CONFIG_CACHE, cont) } + +QMAKE_CONFIG_LOG = $$OUT_PWD/config.log !equals(QMAKE_CONFIG_CACHE_USE, all): \ write_file($$QMAKE_CONFIG_LOG, "") -- cgit v1.2.3 From d01c774f4508b1606dfac0905a66ac5748af6b90 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 11 Nov 2016 18:59:16 +0100 Subject: configure: fix caching of includedir results amends ce7df6ac7. Change-Id: Id56ee59b5955addb58cc4d0879dc097bdd7841d8 Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 2810faad1a..c984206f0d 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -647,7 +647,7 @@ defineTest(qtConfHandleLibrary) { qtLog(" => source accepted.") $${lpfx}.cache += source - for (v, $$list(libs includes cflags version export)): \ + for (v, $$list(libs includedir cflags version export)): \ $${lpfx}.cache += sources.$${s}.$${v} for (b, $${spfx}.builds._KEYS_): \ $${lpfx}.cache += sources.$${s}.builds.$${b} -- cgit v1.2.3 From 1a43199fcea1bcec1ebf1a1a12cd3dcb942d67b4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 8 Nov 2016 18:50:54 +0100 Subject: configure: turn qtConfOutputPostProcess_*() callbacks into replace functions now the callbacks don't need to re-export the designated file contents, which improves the abstraction and removes some boilerplate. Change-Id: Ifa50313155fc96762025e2610b810ebb71daa373 Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index c984206f0d..289e2250bd 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1672,13 +1672,17 @@ defineTest(qtConfProcessOutput) { } } - ppScope = - !isEmpty(module): ppScope = $${module}_ - defined(qtConfOutputPostProcess_$${ppScope}$${type}, test): \ - qtConfOutputPostProcess_$${ppScope}$${type}() + content = $$eval($${currentConfig}.output.$${type}) + + !isEmpty(module): \ + call = qtConfOutputPostProcess_$${module}_$${type} + else: \ + call = qtConfOutputPostProcess_$${type} + defined($$call, replace): \ + eval(content = \$\$"$$call"(\$\$content)) file = $$eval($${currentConfig}.files.$${type}) - fileCont.$$file += $$eval($${currentConfig}.output.$${type}) + fileCont.$$file += $$content fileCont._KEYS_ *= $$file } -- cgit v1.2.3