From 8292326f1bc986f8d87b9f3c244a5e0eb06563f9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 23 Dec 2016 15:48:54 +0100 Subject: configure: make library sources fail more verbosely log a message in all unsuccessful exit paths. Task-number: QTBUG-57217 Change-Id: I8b0f2685d327da583c3e42c8149327e05b2a66cc Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 13 +++++++++---- 1 file changed, 9 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 41bd75c45d..c20a9672e4 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -503,12 +503,16 @@ defineTest(qtConfLibrary_makeSpec) { # the library is found via pkg-config. defineTest(qtConfLibrary_pkgConfig) { pkg_config = $$qtConfPkgConfig($$eval($${1}.host)) - isEmpty(pkg_config): \ + isEmpty(pkg_config) { + qtLog("pkg-config use disabled globally.") return(false) + } args = $$qtConfPrepareArgs($$eval($${1}.args)) - !qtConfPkgConfigPackageExists($$pkg_config, $$args): \ + !qtConfPkgConfigPackageExists($$pkg_config, $$args) { + qtLog("pkg-config did not find package.") return(false) + } qtRunLoggedCommand("$$pkg_config --modversion $$args", version)|return(false) qtRunLoggedCommand("$$pkg_config --libs-only-L --libs-only-l $$args", $${1}.libs)|return(false) @@ -619,8 +623,9 @@ defineTest(qtConfHandleLibrary) { qtLog("Trying source $$s (type $$t) of library $${1} ...") - !$$qtConfEvaluate($$eval($${spfx}.condition)) { - qtLog(" => source failed condition.") + cond = $$eval($${spfx}.condition) + !$$qtConfEvaluate($$cond) { + qtLog(" => source failed condition '$$cond'.") next() } -- cgit v1.2.3 From 7549bbbacbdadacb283ae73ccb8b415a3dbe0c7c Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 23 Dec 2016 16:26:50 +0100 Subject: fail early after command line parsing error we don't want to do the (possibly interactive) license check when the command line is not valid. Task-number: QTBUG-18459 Change-Id: I68c3b7ed4646e49865922ab5612f971930698356 Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 1 + 1 file changed, 1 insertion(+) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index c20a9672e4..e8bddbf09f 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1772,6 +1772,7 @@ for (currentConfig, allConfigs): \ QMAKE_SAVED_ARGS = $$QMAKE_EXTRA_ARGS QMAKE_REDO_CONFIG = false qtConfParseCommandLine() +qtConfCheckErrors() for (currentConfig, allConfigs) { qtConfSetModuleName() -- cgit v1.2.3 From 47784b4352351f042d1e3b61e7151cdcc7c0bac1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 23 Dec 2016 21:11:40 +0100 Subject: re-introduce config.summary Task-number: QTBUG-56225 Change-Id: I954cc1055ab0168c06b6618d02b06f63b4122add Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index e8bddbf09f..ca66862abc 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1368,33 +1368,21 @@ defineTest(qtConfCreateSummary) { } defineTest(qtConfPrintReport) { - for (n, QT_CONFIGURE_REPORT): \ - logn($$n) - logn() - - for (n, QT_CONFIGURE_NOTES) { - logn($$n) - logn() - } - - for (w, QT_CONFIGURE_WARNINGS) { - logn($$w) - logn() - } + blocks = \ + "$$join(QT_CONFIGURE_REPORT, $$escape_expand(\\n))" \ + "$$join(QT_CONFIGURE_NOTES, $$escape_expand(\\n\\n))" \ + "$$join(QT_CONFIGURE_WARNINGS, $$escape_expand(\\n\\n))" !isEmpty(QT_CONFIGURE_ERRORS) { - for (e, QT_CONFIGURE_ERRORS) { - logn($$e) - logn() - } - mention_config_log:!$$QMAKE_CONFIG_VERBOSE { - logn("Check config.log for details.") - logn() - } - - !equals(config.input.continue, yes): \ - error() + blocks += "$$join(QT_CONFIGURE_ERRORS, $$escape_expand(\\n\\n))" + mention_config_log:!$$QMAKE_CONFIG_VERBOSE: \ + blocks += "Check config.log for details." } + blocks = "$$join(blocks, $$escape_expand(\\n\\n))" + logn($$blocks) + !isEmpty(QT_CONFIGURE_ERRORS):!equals(config.input.continue, yes): \ + error() + write_file($$OUT_PWD/config.summary, blocks)|error() } defineTest(qtConfCheckErrors) { -- cgit v1.2.3 From cfba3fff052b0af411d21727a68e78ea3e6a21d0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 3 Jan 2017 16:59:36 +0100 Subject: move emission of final messages to qmake-based configure now qmake is the last command called by the unix configure script. as it happens, this was already the case in the windows script, but only because it didn't print these messages at all, which it implicitly does now. another effect of this is that repositories outside qtbase will now also get the installation note in modular builds, which makes sense. Change-Id: I567146936b216185a8e0f61e445222215608bf13 Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index ca66862abc..8eb8f22347 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1851,3 +1851,19 @@ for (p, QMAKE_POST_CONFIGURE): \ logn("Configure summary:") logn() qtConfPrintReport() + +# final notes for the user +logn() +logn("Qt is now configured for building. Just run '$$QMAKE_MAKE_NAME'.") +pfx = $$[QT_INSTALL_PREFIX] +equals(pfx, $$[QT_INSTALL_PREFIX/get]) { + logn("Once everything is built, Qt is installed.") + logn("You should NOT run '$$QMAKE_MAKE_NAME install'.") +} else { + logn("Once everything is built, you must run '$$QMAKE_MAKE_NAME install'.") + logn("Qt will be installed into '$$system_path($$pfx)'.") +} +logn() +logn("Prior to reconfiguration, make sure you remove any leftovers from") +logn("the previous build.") +logn() -- cgit v1.2.3 From d6778c3597a6e06b866c5b7a994cac4d71aaead3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 3 Jan 2017 19:47:03 +0100 Subject: make skipping of configure in sub-repos less arcane this was introduced in 60e5a1c8 for no apparent reason. Change-Id: Idcbc6df3df4e4846c76b3e4215d753a1c97e2eec Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_configure.prf | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 8eb8f22347..7e2e5cfecc 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1698,16 +1698,18 @@ defineTest(qtConfProcessOutput) { # tie it all together # -cfgs = -isEmpty(_QMAKE_SUPER_CACHE_)|equals(OUT_PWD, $$dirname(_QMAKE_SUPER_CACHE_)) { - c = $$basename(_PRO_FILE_PWD_) - config.$${c}.dir = $$_PRO_FILE_PWD_ - cfgs += $$c - !isEmpty(_QMAKE_SUPER_CACHE_) { - for (s, SUBDIRS) { - config.$${s}.dir = $$_PRO_FILE_PWD_/$${s} - cfgs += $$s - } +!isEmpty(_QMAKE_SUPER_CACHE_):!equals(OUT_PWD, $$dirname(_QMAKE_SUPER_CACHE_)) { + # sub-repo within a top-level build; no need to configure anything. + return() +} + +c = $$basename(_PRO_FILE_PWD_) +config.$${c}.dir = $$_PRO_FILE_PWD_ +cfgs = $$c +!isEmpty(_QMAKE_SUPER_CACHE_) { + for (s, SUBDIRS) { + config.$${s}.dir = $$_PRO_FILE_PWD_/$${s} + cfgs += $$s } } configsToProcess = -- cgit v1.2.3 From 44a68aff6626d8e7beb040fe0d6dc52740e2a210 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 3 Jan 2017 19:51:52 +0100 Subject: name top-level configure scope after the project file ... instead of the directory it resides in, to make it independent of the user's fs layout. this makes logs more comparable, and little else. Change-Id: I0ab3e968dad74ef86577f388c8ca1557e3c17ce4 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_configure.prf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 7e2e5cfecc..f517e69496 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1703,9 +1703,8 @@ defineTest(qtConfProcessOutput) { return() } -c = $$basename(_PRO_FILE_PWD_) -config.$${c}.dir = $$_PRO_FILE_PWD_ -cfgs = $$c +config.$${TARGET}.dir = $$_PRO_FILE_PWD_ +cfgs = $$TARGET !isEmpty(_QMAKE_SUPER_CACHE_) { for (s, SUBDIRS) { config.$${s}.dir = $$_PRO_FILE_PWD_/$${s} -- cgit v1.2.3 From 696c3f9af852537897aa754dc269833ead9fcf41 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 3 Jan 2017 20:23:19 +0100 Subject: complain about various invalid configuration attempts Task-number: QTBUG-56049 Change-Id: Id5eeb014c2b88195d2d14566a62dcb9185206b37 Reviewed-by: Jake Petroules Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_configure.prf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index f517e69496..3adefb743e 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1700,6 +1700,14 @@ defineTest(qtConfProcessOutput) { !isEmpty(_QMAKE_SUPER_CACHE_):!equals(OUT_PWD, $$dirname(_QMAKE_SUPER_CACHE_)) { # sub-repo within a top-level build; no need to configure anything. + !isEmpty(QMAKE_EXTRA_ARGS) { + # sub-projects don't get the extra args passed down automatically, + # so we can use their presence to detect misguided attempts to + # configure the repositories separately. + # caveat: a plain qmake call is indistinguishable from a recursion + # (by design), so we cannot detect this case. + error("You cannot configure $$TARGET separately within a top-level build.") + } return() } @@ -1717,8 +1725,11 @@ for (c, cfgs) { exists($$s/configure.json): \ configsToProcess += $$c } -isEmpty(configsToProcess): \ +isEmpty(configsToProcess) { + !isEmpty(QMAKE_EXTRA_ARGS): \ + error("This module does not accept configure command line arguments.") return() +} load(configure_base) -- cgit v1.2.3 From 342691b80294f8096dd383f9a0a7b4488f40728e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 5 Jan 2017 14:28:41 +0100 Subject: fix configure --opt=val syntax the second dash would end up in the option name, which made it obviously unrecognizable. but the second dash isn't optional in the first place (as evidenced one line up), so remove the question marks. Task-number: QTBUG-57908 Change-Id: I6622fef7d11d7b3c485f16698349d1912037a41e Reviewed-by: Joerg Bornemann --- 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 3adefb743e..a0948dad86 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -241,8 +241,8 @@ defineTest(qtConfParseCommandLine) { opt = $$replace(c, "^--?(disable|no)-(.*)", "\\2") val = no } else: contains(c, "^--([^=]+)=(.*)") { - opt = $$replace(c, "^--?([^=]+)=(.*)", "\\1") - val = $$replace(c, "^--?([^=]+)=(.*)", "\\2") + opt = $$replace(c, "^--([^=]+)=(.*)", "\\1") + val = $$replace(c, "^--([^=]+)=(.*)", "\\2") } else: contains(c, "^--(.*)") { opt = $$replace(c, "^--(.*)", "\\1") val = yes -- cgit v1.2.3 From f2e39c4a154b109b9308ab657a1ce64cff6ab176 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 9 Jan 2017 15:44:30 +0100 Subject: inline "committing" of configure command line built-ins the options may need to take effect before the regular test processing commences (which is actually going to be the case in the next commit). the indirection via the callback only obfuscated the code anyway. Change-Id: I5307b0be15cf4cc2c2db391ce5b5a93f81076b5c Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_configure.prf | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index a0948dad86..5e444f62b2 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1601,19 +1601,6 @@ defineTest(qtConfOutput_privateFeature) { } } -# command line built-ins post-processing -defineTest(qtConfOutput_builtins) { - QMAKE_CONFIG_VERBOSE = $$eval(config.input.verbose) - isEmpty(QMAKE_CONFIG_VERBOSE): \ - QMAKE_CONFIG_VERBOSE = false - export(QMAKE_CONFIG_VERBOSE) - - QMAKE_CONFIG_CACHE_USE = $$eval(config.input.cache_use) - isEmpty(QMAKE_CONFIG_CACHE_USE): \ - QMAKE_CONFIG_CACHE_USE = all - export(QMAKE_CONFIG_CACHE_USE) -} - defineTest(qtConfProcessOneOutput) { feature = $${1} fpfx = $${currentConfig}.features.$${feature} @@ -1786,6 +1773,9 @@ qtConfCheckErrors() QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_SUPER_CACHE_)/config.cache else: \ QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_CACHE_)/config.cache +QMAKE_CONFIG_CACHE_USE = $$eval(config.input.cache_use) +isEmpty(QMAKE_CONFIG_CACHE_USE): \ + QMAKE_CONFIG_CACHE_USE = all !equals(QMAKE_CONFIG_CACHE_USE, none) { include($$QMAKE_CONFIG_CACHE, , true) # this crudely determines when to discard the cache. this also catches the case @@ -1800,6 +1790,9 @@ equals(QMAKE_CONFIG_CACHE_USE, none) { write_file($$QMAKE_CONFIG_CACHE, cont) } +QMAKE_CONFIG_VERBOSE = $$eval(config.input.verbose) +isEmpty(QMAKE_CONFIG_VERBOSE): \ + QMAKE_CONFIG_VERBOSE = false QMAKE_CONFIG_LOG = $$OUT_PWD/config.log !equals(QMAKE_CONFIG_CACHE_USE, all): \ write_file($$QMAKE_CONFIG_LOG, "") -- cgit v1.2.3 From 068fca3ceca5ef8669902c7cf7b70588e3d74256 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 9 Jan 2017 15:38:24 +0100 Subject: log configure command line to config.log that makes the log file mostly self-contained. for code re-use, the qtSystemQuote() function was factored out. Change-Id: Ie3469518ba384131b69f5f15c577240e2674d507 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_configure.prf | 16 ++++++++++++---- 1 file changed, 12 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 5e444f62b2..ee323501f9 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -183,7 +183,9 @@ defineTest(qtConfCommandline_redo) { qtConfAddError("No config.opt present - cannot redo configuration.") return() } - QMAKE_EXTRA_ARGS = $$cat($$OUT_PWD/config.opt, lines) $$QMAKE_EXTRA_ARGS + QMAKE_EXTRA_REDO_ARGS = $$cat($$OUT_PWD/config.opt, lines) + export(QMAKE_EXTRA_REDO_ARGS) # just for config.log + QMAKE_EXTRA_ARGS = $$QMAKE_EXTRA_REDO_ARGS $$QMAKE_EXTRA_ARGS export(QMAKE_EXTRA_ARGS) QMAKE_REDO_CONFIG = true export(QMAKE_REDO_CONFIG) @@ -387,14 +389,17 @@ defineTest(qtConfPkgConfigPackageExists) { return(true) } -defineReplace(qtConfPrepareArgs) { - arglist = $$split(1) +defineReplace(qtSystemQuote) { args = - for (a, arglist): \ + for (a, 1): \ args += $$system_quote($$a) return($$args) } +defineReplace(qtConfPrepareArgs) { + return($$qtSystemQuote($$split(1))) +} + defineTest(qtConfSetupLibraries) { for (l, $${currentConfig}.libraries._KEYS_) { lpfx = $${currentConfig}.libraries.$${l} @@ -1796,6 +1801,9 @@ isEmpty(QMAKE_CONFIG_VERBOSE): \ QMAKE_CONFIG_LOG = $$OUT_PWD/config.log !equals(QMAKE_CONFIG_CACHE_USE, all): \ write_file($$QMAKE_CONFIG_LOG, "") +qtLog("Command line: $$qtSystemQuote($$QMAKE_SAVED_ARGS)") +$$QMAKE_REDO_CONFIG: \ + qtLog("config.opt: $$qtSystemQuote($$QMAKE_EXTRA_REDO_ARGS)") CONFIG += qt_conf_tests_allowed logn() -- cgit v1.2.3 From 9c05ccb6bc89d9ca3fa76daebf15ac3a3c9fd95a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 9 Jan 2017 16:00:08 +0100 Subject: put some empty lines between configure runs into config.log Change-Id: I6c3e3b139752bb9d1b60c590bb1ea72ae2e4fbdf Reviewed-by: Joerg Bornemann --- 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 ee323501f9..4056b4d05a 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1801,6 +1801,8 @@ isEmpty(QMAKE_CONFIG_VERBOSE): \ QMAKE_CONFIG_LOG = $$OUT_PWD/config.log !equals(QMAKE_CONFIG_CACHE_USE, all): \ write_file($$QMAKE_CONFIG_LOG, "") +else: \ + write_file($$QMAKE_CONFIG_LOG, $$list($$escape_expand(\\n)), append) qtLog("Command line: $$qtSystemQuote($$QMAKE_SAVED_ARGS)") $$QMAKE_REDO_CONFIG: \ qtLog("config.opt: $$qtSystemQuote($$QMAKE_EXTRA_REDO_ARGS)") -- cgit v1.2.3