summaryrefslogtreecommitdiffstats
path: root/configure.pri
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2016-11-16 15:13:52 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2016-12-13 18:56:34 +0000
commitab0cc3055d3d1f0faa98f96a7e8ae58b6ef6461a (patch)
treeba14bef85165e3dadaac1b46f5c6cd8a734ececf /configure.pri
parent8861b82f9ef59fa871adc86552012cd90eee6e09 (diff)
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 <jake.petroules@qt.io>
Diffstat (limited to 'configure.pri')
-rw-r--r--configure.pri33
1 files changed, 32 insertions, 1 deletions
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)
}