summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-01-31 18:36:18 +0100
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-06-19 16:37:49 +0200
commit14bbab09c158e3eb54169b42c4a303d396a32f0e (patch)
treefd4706e980c1440eb6b91868d71979060af2398c /tools
parent528192a78b3250964ee99efab42b6683da02eb11 (diff)
introduce ability to build projects for the host system
when qmake runs into the new option(host_build) command, it will restart the project evaluation with a host spec. the new default host spec is called default-host (gasp!). it is overridden with the pre-exising -spec / -platform option, while the new -xspec / -xplatform option overrides the pre-existing default spec. specifying -spec but not -xspec will set the xspec, too, so the behavior is backwards-compatible. same for the XQMAKESPEC override read from .qmake.cache and the environment variable. the cleaner solution would be adding -hostspec, to be symmetrical with the override semantics, but that would deviate from configure in turn. Change-Id: I4297c873780af16ab7928421b434ce0f1d3820da Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/configure/configureapp.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index ba50d9604c..ff2744397d 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -2583,13 +2583,18 @@ void Configure::generateCachefile()
moduleStream << "QMAKE_INCDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/include", true) << endl;
moduleStream << "QMAKE_LIBDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/lib", true) << endl;
-
- QString targetSpec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ];
- QString mkspec_path = fixSeparators(sourcePath + "/mkspecs/" + targetSpec);
+ QString hostSpec = dictionary[ "QMAKESPEC" ];
+ QString targetSpec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : hostSpec;
+ QString xmkspec_path = fixSeparators(sourcePath + "/mkspecs/" + targetSpec);
+ if (QFile::exists(xmkspec_path))
+ moduleStream << "XQMAKESPEC = " << escapeSeparators(xmkspec_path) << endl;
+ else
+ moduleStream << "XQMAKESPEC = " << fixSeparators(targetSpec, true) << endl;
+ QString mkspec_path = fixSeparators(sourcePath + "/mkspecs/" + hostSpec);
if (QFile::exists(mkspec_path))
moduleStream << "QMAKESPEC = " << escapeSeparators(mkspec_path) << endl;
else
- moduleStream << "QMAKESPEC = " << fixSeparators(targetSpec, true) << endl;
+ moduleStream << "QMAKESPEC = " << fixSeparators(hostSpec, true) << endl;
if (dictionary["QT_EDITION"] != "QT_EDITION_OPENSOURCE")
moduleStream << "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" << endl;
@@ -3109,7 +3114,8 @@ void Configure::generateConfigfiles()
}
QString spec = dictionary.contains("XQMAKESPEC") ? dictionary["XQMAKESPEC"] : dictionary["QMAKESPEC"];
- if (!copySpec("default", "", spec))
+ if (!copySpec("default", "", spec)
+ || !copySpec("default-host", "host ", dictionary["QMAKESPEC"]))
return;
// Generate the new qconfig.cpp file