From a71b53d6004edb59ad1801f3281ef631fb38c7c4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 20 Dec 2016 12:34:20 +0100 Subject: fix sysrootification of install paths initially, the idea was that QLibraryInfo would receive a pre-sysrootified ExtPrefix from the builtin qt.conf. matching this against the sysroot would then tell us whether to sysrootify the Prefix from a "regular" qt.conf as well. however, this would have lead to some major ugliness and inconsistency between the code paths, so i changed my mind. unfortunately, i failed to adjust the remaining code, leading to 169a40d51 entirely breaking sysrootification ... the proper (and nicely consistent) solution is to introduce a SysrootifyPrefix key to qt.conf. this is user-accessible as well, so as a bonus it is now possible to adjust the setting at qmake installation time. incidentally, this omission was the last thing that prevented using the same qmake host build for any imaginable configuration of the same qt version ... i think. Change-Id: Ic0eebf21f93651f6374628c0ad8b206d696a4a7e Reviewed-by: Andy Nichols --- configure.pri | 1 + 1 file changed, 1 insertion(+) (limited to 'configure.pri') diff --git a/configure.pri b/configure.pri index 92020abbbb..7dd1069c0b 100644 --- a/configure.pri +++ b/configure.pri @@ -680,6 +680,7 @@ defineReplace(printHostPaths) { $$printInstallPath(HostLibraries, hostlibdir, lib) \ $$printInstallPath(HostData, hostdatadir, .) \ "Sysroot=$$config.input.sysroot" \ + "SysrootifyPrefix=$$qmake_sysrootify" \ "TargetSpec=$$XSPEC" \ "HostSpec=$$[QMAKE_SPEC]" return($$ret) -- cgit v1.2.3 From 4cbec6b7303302a2b3026d5602262e2e9469a0a6 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 20 Dec 2016 16:32:59 +0100 Subject: configure: reload spec after configuring paths this fixes the x-build for raspberry pi, as that spec refers to the sysroot. the path setup doesn't require the device options to be in effect yet, so it was sufficient to move the existing spec reload to a later point in time. Change-Id: Idc521aa13ff441931e954c7c9004472cf7061ee1 Reviewed-by: Andy Nichols --- configure.pri | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'configure.pri') diff --git a/configure.pri b/configure.pri index 7dd1069c0b..10eb8b287e 100644 --- a/configure.pri +++ b/configure.pri @@ -593,9 +593,8 @@ defineTest(qtConfOutput_prepareOptions) { export($${currentConfig}.output.devicePro) - # reload the spec to make the settings actually take effect. - !isEmpty($${currentConfig}.output.devicePro): \ - reloadSpec() + # if any settings were made, the spec will be reloaded later + # to make them take effect. } defineTest(qtConfOutput_machineTuple) { @@ -842,6 +841,15 @@ defineTest(qtConfOutput_preparePaths) { "Prefix=$$QT_SOURCE_TREE" write_file($$QT_BUILD_TREE/bin/qt.conf, cont)|error() reload_properties() + + # if a sysroot was configured, the spec will be reloaded later, + # as some specs contain $$[SYSROOT] references. +} + +defineTest(qtConfOutput_reloadSpec) { + !isEmpty($${currentConfig}.output.devicePro)| \ + !isEmpty(config.input.sysroot): \ + reloadSpec() } defineTest(qtConfOutput_shared) { -- cgit v1.2.3 From 1b5271f27f7d5c6f814567d6d3bf211b41244cc8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 15 Dec 2016 16:20:27 +0100 Subject: determine compiler version at build time, not in configure this makes it consistent with the determination of the default include/library paths. this makes sense, as it's possible to switch the sdk/toolchain after building qt (within reason). a side effect of this change is that for compilers which emulate other compilers, both the real and the emulated version are now made available. Change-Id: Icfcc672c0d2e3d1b5e622993c366063d70ad327c Started-by: Thiago Macieira Reviewed-by: Lars Knoll --- configure.pri | 63 ----------------------------------------------------------- 1 file changed, 63 deletions(-) (limited to 'configure.pri') diff --git a/configure.pri b/configure.pri index 10eb8b287e..1744972f92 100644 --- a/configure.pri +++ b/configure.pri @@ -397,50 +397,6 @@ defineTest(qtConfTest_buildParts) { return(true) } -defineTest(qtConfTest_checkCompiler) { - contains(QMAKE_CXX, ".*clang.*") { - qtRunLoggedCommand("$$QMAKE_CXX -v 2>&1", versionstr)|return(false) - versionstr = "$$versionstr" - contains(versionstr, "^Apple (clang|LLVM) version .*") { - $${1}.compilerDescription = "Apple Clang" - $${1}.compilerId = "apple_clang" - $${1}.compilerVersion = $$replace(versionstr, "^Apple (clang|LLVM) version ([0-9.]+).*$", "\\2") - } else: contains(versionstr, ".*clang version.*") { - $${1}.compilerDescription = "Clang" - $${1}.compilerId = "clang" - $${1}.compilerVersion = $$replace(versionstr, "^.*clang version ([0-9.]+).*", "\\1") - } else { - return(false) - } - } else: contains(QMAKE_CXX, ".*g\\+\\+.*") { - qtRunLoggedCommand("$$QMAKE_CXX -dumpversion", version)|return(false) - $${1}.compilerDescription = "GCC" - $${1}.compilerId = "gcc" - $${1}.compilerVersion = $$version - } else: contains(QMAKE_CXX, ".*icpc") { - qtRunLoggedCommand("$$QMAKE_CXX -dumpversion", version)|return(false) - $${1}.compilerDescription = "ICC" - $${1}.compilerId = "icc" - $${1}.compilerVersion = $$version - } else: msvc { - command = $$QMAKE_CXX /EP /nologo $$source $$system_quote($$QMAKE_CONFIG_TESTS_DIR/win/msvc_version.cpp) - qtRunLoggedCommand("$$command", version)|return(false) - version = "$$version" - $${1}.compilerDescription = "MSVC" - $${1}.compilerId = "cl" - $${1}.compilerVersion = $$replace(version, "^.*([0-9]{2})([0-9]{2})([0-9]{5}).*$", "\\1.\\2.\\3") - } else { - return(false) - } - $${1}.compilerDescription += $$eval($${1}.compilerVersion) - export($${1}.compilerDescription) - export($${1}.compilerId) - export($${1}.compilerVersion) - $${1}.cache += compilerDescription compilerId compilerVersion - export($${1}.cache) - return(true) -} - # custom outputs # this reloads the qmakespec as completely as reasonably possible. @@ -947,25 +903,6 @@ defineTest(qtConfOutput_debugAndRelease) { } } -defineTest(qtConfOutput_compilerVersion) { - !$${2}: return() - - name = $$upper($$eval($${currentConfig}.tests.compiler.compilerId)) - version = $$eval($${currentConfig}.tests.compiler.compilerVersion) - major = $$section(version, '.', 0, 0) - minor = $$section(version, '.', 1, 1) - patch = $$section(version, '.', 2, 2) - isEmpty(minor): minor = 0 - isEmpty(patch): patch = 0 - - $${currentConfig}.output.publicPro += \ - "QT_$${name}_MAJOR_VERSION = $$major" \ - "QT_$${name}_MINOR_VERSION = $$minor" \ - "QT_$${name}_PATCH_VERSION = $$patch" - - export($${currentConfig}.output.publicPro) -} - defineTest(qtConfOutput_compilerFlags) { # this output also exports the variables locally, so that subsequent compiler tests can use them -- 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 --- configure.pri | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'configure.pri') diff --git a/configure.pri b/configure.pri index 1744972f92..3f9a7e208c 100644 --- a/configure.pri +++ b/configure.pri @@ -458,6 +458,10 @@ defineTest(qtConfOutput_prepareSpec) { QMAKESPEC = $$[QT_HOST_DATA/src]/mkspecs/$$XSPEC export(QMAKESPEC) + notes = $$cat($$OUT_PWD/.config.notes, lines) + !isEmpty(notes): \ + qtConfAddNote("Also available for $$notes") + # deviceOptions() below contains conditionals coming form the spec, # so this cannot be delayed for a batch reload. reloadSpec() -- cgit v1.2.3 From 52d64fca662d0e488801fc40dffdc0a732cfdbd5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 3 Jan 2017 16:40:30 +0100 Subject: revert to building qmake with qconfig.cpp turns out that just appending builtin-qt.conf isn't a good idea: executable-editing tools (objcopy, prelink, etc.) will happily drop the "attachment". a safe method would be adding a proper section to the executable, but there doesn't appear to be an objcopy equivalent in msvc, and using entirely different methods of embedding the file with different toolchains seems like a rather bad idea. so instead go back to the old method of building qmake with a generated qconfig.cpp. of course, as said file is now created by qmake itself, we have to compile qlibraryinfo.cpp a second time, and link a second qmake executable. Task-number: QTBUG-57803 Change-Id: I9e232693550aa870cec154e49cc06add13017cc2 Reviewed-by: Lars Knoll --- configure.pri | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) (limited to 'configure.pri') diff --git a/configure.pri b/configure.pri index 3f9a7e208c..b184ceff5b 100644 --- a/configure.pri +++ b/configure.pri @@ -748,40 +748,56 @@ defineTest(qtConfOutput_preparePaths) { addConfStr($$config.rel_input.examplesdir) addConfStr($$config.rel_input.testsdir) + QT_CONFIGURE_STR_OFFSETS_ALL = $$QT_CONFIGURE_STR_OFFSETS + QT_CONFIGURE_STRS_ALL = $$QT_CONFIGURE_STRS + QT_CONFIGURE_STR_OFFSETS = + QT_CONFIGURE_STRS = + + addConfStr($$config.input.sysroot) + addConfStr($$qmake_sysrootify) + addConfStr($$config.rel_input.hostbindir) + addConfStr($$config.rel_input.hostlibdir) + addConfStr($$config.rel_input.hostdatadir) + addConfStr($$XSPEC) + addConfStr($$[QMAKE_SPEC]) + $${currentConfig}.output.qconfigSource = \ "/* Installation date */" \ "static const char qt_configure_installation [12+11] = \"qt_instdate=2012-12-20\";" \ "" \ "/* Installation Info */" \ "static const char qt_configure_prefix_path_str [12+256] = \"qt_prfxpath=$$config.input.prefix\";" \ + "$${LITERAL_HASH}ifdef QT_BUILD_QMAKE" \ + "static const char qt_configure_ext_prefix_path_str [12+256] = \"qt_epfxpath=$$config.input.extprefix\";" \ + "static const char qt_configure_host_prefix_path_str [12+256] = \"qt_hpfxpath=$$config.input.hostprefix\";" \ + "$${LITERAL_HASH}endif" \ "" \ "static const short qt_configure_str_offsets[] = {" \ + $$QT_CONFIGURE_STR_OFFSETS_ALL \ + "$${LITERAL_HASH}ifdef QT_BUILD_QMAKE" \ $$QT_CONFIGURE_STR_OFFSETS \ + "$${LITERAL_HASH}endif" \ "};" \ "static const char qt_configure_strs[] =" \ + $$QT_CONFIGURE_STRS_ALL \ + "$${LITERAL_HASH}ifdef QT_BUILD_QMAKE" \ $$QT_CONFIGURE_STRS \ + "$${LITERAL_HASH}endif" \ ";" \ "" \ "$${LITERAL_HASH}define QT_CONFIGURE_SETTINGS_PATH \"$$config.rel_input.sysconfdir\"" \ "" \ - "$${LITERAL_HASH}define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12" + "$${LITERAL_HASH}ifdef QT_BUILD_QMAKE" \ + "$${LITERAL_HASH} define QT_CONFIGURE_SYSROOTIFY_PREFIX $$qmake_sysrootify" \ + "$${LITERAL_HASH}endif" \ + "" \ + "$${LITERAL_HASH}define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12" \ + "$${LITERAL_HASH}ifdef QT_BUILD_QMAKE" \ + "$${LITERAL_HASH} define QT_CONFIGURE_EXT_PREFIX_PATH qt_configure_ext_prefix_path_str + 12" \ + "$${LITERAL_HASH} define QT_CONFIGURE_HOST_PREFIX_PATH qt_configure_host_prefix_path_str + 12" \ + "$${LITERAL_HASH}endif" export($${currentConfig}.output.qconfigSource) - # populate qmake/builtin-qt.conf - - $${currentConfig}.output.builtinQtConf = \ - " " \ - "===========================================================" \ - "==================== qt.conf beginning ====================" \ - "===========================================================" \ - "[Paths]" \ - "ExtPrefix=$$config.input.extprefix" \ - "Prefix=$$config.input.prefix" \ - $$printInstallPaths() \ - "Settings=$$config.rel_input.sysconfdir" \ - $$printHostPaths() - export($${currentConfig}.output.builtinQtConf) - # create bin/qt.conf. this doesn't use the regular file output # mechanism, as the file is relied upon by configure tests. -- cgit v1.2.3 From fd3ea76d4ef0a9d287e618c2ab074eb7515fa778 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 17 Jan 2017 16:50:59 +0100 Subject: configure: better suppression magic for old qdevice.pri instead of forcing an early load and discarding its contents again before they could cause harm, trick qmake into not loading it at all. Change-Id: I672ca9de362b1f23bf5cfea007053570c8534fc6 Reviewed-by: Joerg Bornemann --- configure.pri | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'configure.pri') diff --git a/configure.pri b/configure.pri index b184ceff5b..cc173b6777 100644 --- a/configure.pri +++ b/configure.pri @@ -409,13 +409,12 @@ defineTest(reloadSpec) { } # nobody's going to try to re-load the features above, # so don't bother with being selective. - QMAKE_INTERNAL_INCLUDED_FEATURES = + QMAKE_INTERNAL_INCLUDED_FEATURES = \ + # loading it gets simulated below. + $$[QT_HOST_DATA/src]/mkspecs/features/device_config.prf _SAVED_CONFIG = $$CONFIG load(spec_pre) - load(device_config) # avoid that the spec loads it later. - # discard possible settings from an earlier configure run. - discard_from($$[QT_HOST_DATA/get]/mkspecs/qdevice.pri) # qdevice.pri gets written too late (and we can't write it early # enough, as it's populated in stages, with later ones depending # on earlier ones). so inject its variables manually. -- cgit v1.2.3 From 6834d0eeccc7333ab9d53251b3bd4a24058843da Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 17 Jan 2017 17:10:21 +0100 Subject: prevent configure from putting garbage into .qmake.stash in cross-builds, toolchain.prf was loaded before CROSS_COMPILE was set up, leading to caching of possibly nonsensical values. this change also necessitated that msvc-version.conf is loaded only when toolchain.prf is, which is best done by loading the former from within the latter. that seems quite appropriate in the first place. Change-Id: I62577e827a75e335e03df016bd1aa1932643fd6c Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- configure.pri | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'configure.pri') diff --git a/configure.pri b/configure.pri index cc173b6777..94aea44b13 100644 --- a/configure.pri +++ b/configure.pri @@ -411,7 +411,10 @@ defineTest(reloadSpec) { # so don't bother with being selective. QMAKE_INTERNAL_INCLUDED_FEATURES = \ # loading it gets simulated below. - $$[QT_HOST_DATA/src]/mkspecs/features/device_config.prf + $$[QT_HOST_DATA/src]/mkspecs/features/device_config.prf \ + # must be delayed until qdevice.pri is ready. + $$[QT_HOST_DATA/src]/mkspecs/features/mac/toolchain.prf \ + $$[QT_HOST_DATA/src]/mkspecs/features/toolchain.prf _SAVED_CONFIG = $$CONFIG load(spec_pre) @@ -825,6 +828,13 @@ defineTest(qtConfOutput_reloadSpec) { !isEmpty($${currentConfig}.output.devicePro)| \ !isEmpty(config.input.sysroot): \ reloadSpec() + + bypassNesting() { + QMAKE_INTERNAL_INCLUDED_FEATURES -= \ + $$[QT_HOST_DATA/src]/mkspecs/features/mac/toolchain.prf \ + $$[QT_HOST_DATA/src]/mkspecs/features/toolchain.prf + load(toolchain) + } } defineTest(qtConfOutput_shared) { -- cgit v1.2.3