From ab0cc3055d3d1f0faa98f96a7e8ae58b6ef6461a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 16 Nov 2016 15:13:52 +0100 Subject: move all target spec handling to qmake-based configure system we pull this feat off by booting configure with a dummy spec. the proper spec gets loaded subsequently. note that it was necessary to move the cache loading after processing the early checks (from which the spec handling is triggered). this is just fine, as the cache is needed only by tests, which are forbidden at this stage by definition. Change-Id: I5120e25a8bf05fb8cc5485fd93cf6387301089aa Reviewed-by: Jake Petroules --- configure.pri | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'configure.pri') diff --git a/configure.pri b/configure.pri index b8e338bb54..92020abbbb 100644 --- a/configure.pri +++ b/configure.pri @@ -476,6 +476,37 @@ defineTest(reloadSpec) { } } +defineTest(qtConfOutput_prepareSpec) { + device = $$eval(config.input.device) + !isEmpty(device) { + devices = $$files($$[QT_HOST_DATA/src]/mkspecs/devices/*$$device*) + isEmpty(devices): \ + qtConfFatalError("No device matching '$$device'.") + !count(devices, 1) { + err = "Multiple matches for device '$$device'. Candidates are:" + for (d, devices): \ + err += " $$basename(d)" + qtConfFatalError($$err) + } + XSPEC = $$relative_path($$devices, $$[QT_HOST_DATA/src]/mkspecs) + } + xspec = $$eval(config.input.xplatform) + !isEmpty(xspec) { + !exists($$[QT_HOST_DATA/src]/mkspecs/$$xspec/qmake.conf): \ + qtConfFatalError("Invalid target platform '$$xspec'.") + XSPEC = $$xspec + } + isEmpty(XSPEC): \ + XSPEC = $$[QMAKE_SPEC] + export(XSPEC) + QMAKESPEC = $$[QT_HOST_DATA/src]/mkspecs/$$XSPEC + export(QMAKESPEC) + + # deviceOptions() below contains conditionals coming form the spec, + # so this cannot be delayed for a batch reload. + reloadSpec() +} + defineTest(qtConfOutput_prepareOptions) { $${currentConfig}.output.devicePro += \ $$replace(config.input.device-option, "^([^=]+) *= *(.*)$", "\\1 = \\2") @@ -649,7 +680,7 @@ defineReplace(printHostPaths) { $$printInstallPath(HostLibraries, hostlibdir, lib) \ $$printInstallPath(HostData, hostdatadir, .) \ "Sysroot=$$config.input.sysroot" \ - "TargetSpec=$$[QMAKE_XSPEC]" \ + "TargetSpec=$$XSPEC" \ "HostSpec=$$[QMAKE_SPEC]" return($$ret) } -- cgit v1.2.3