summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-04 09:47:52 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-04 09:51:36 +0200
commit0936bc54f907066644503c7d4c390968711c73a7 (patch)
tree6eb8c614e7083eae6ca619435f901dcb1380108f /tools
parent83080e8a7cb7aaa794a9659eeaf34690afe71ddb (diff)
parentffd44acd0de4fc7079e76f1fe4689b655f9dc763 (diff)
Merge remote-tracking branch 'origin/5.3' into dev
Conflicts: config.tests/arch/arch.cpp src/opengl/qgl_qpa.cpp src/widgets/kernel/qapplication.cpp Change-Id: I80b442a4c2c9632743a5b5c7319ff201ec5bc4fd
Diffstat (limited to 'tools')
-rw-r--r--tools/configure/configureapp.cpp29
-rw-r--r--tools/configure/configureapp.h1
2 files changed, 23 insertions, 7 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 679362aa68..f8715ef32e 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -3077,14 +3077,24 @@ void Configure::generateCachefile()
}
}
+void Configure::addSysroot(QString *command)
+{
+ const QString &sysroot = dictionary["CFG_SYSROOT"];
+ if (!sysroot.isEmpty() && dictionary["CFG_GCC_SYSROOT"] == "yes") {
+ command->append(" QMAKE_LFLAGS+=--sysroot=" + sysroot);
+ command->append(" QMAKE_CXXFLAGS+=--sysroot=" + sysroot);
+ }
+}
+
struct ArchData {
+ bool isHost;
const char *qmakespec;
const char *key;
const char *subarchKey;
const char *type;
ArchData() {}
- ArchData(const char *t, const char *qm, const char *k, const char *sak)
- : qmakespec(qm), key(k), subarchKey(sak), type(t)
+ ArchData(bool h, const char *t, const char *qm, const char *k, const char *sak)
+ : isHost(h), qmakespec(qm), key(k), subarchKey(sak), type(t)
{}
};
@@ -3110,8 +3120,8 @@ void Configure::detectArch()
QVector<ArchData> qmakespecs;
if (dictionary.contains("XQMAKESPEC"))
- qmakespecs << ArchData("target", "XQMAKESPEC", "QT_ARCH", "QT_CPU_FEATURES");
- qmakespecs << ArchData("host", "QMAKESPEC", "QT_HOST_ARCH", "QT_HOST_CPU_FEATURES");
+ qmakespecs << ArchData(false, "target", "XQMAKESPEC", "QT_ARCH", "QT_CPU_FEATURES");
+ qmakespecs << ArchData(true, "host", "QMAKESPEC", "QT_HOST_ARCH", "QT_HOST_CPU_FEATURES");
for (int i = 0; i < qmakespecs.count(); ++i) {
const ArchData &data = qmakespecs.at(i);
@@ -3123,10 +3133,14 @@ void Configure::detectArch()
QString command = QString("%1 -spec %2 %3")
.arg(QDir::toNativeSeparators(buildPath + "/bin/qmake.exe"),
QDir::toNativeSeparators(qmakespec),
- QDir::toNativeSeparators(sourcePath + "/config.tests/arch/arch.pro"));
+ QDir::toNativeSeparators(sourcePath + "/config.tests/arch/arch"
+ + (data.isHost ? "_host" : "") + ".pro"));
- if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone"))
- command.append(" QMAKE_LFLAGS+=/ENTRY:main");
+ if (!data.isHost) {
+ if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone"))
+ command.append(" QMAKE_LFLAGS+=/ENTRY:main");
+ addSysroot(&command);
+ }
int returnValue = 0;
Environment::execute(command, &returnValue);
@@ -3233,6 +3247,7 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext
const QString qmakespec = dictionary["XQMAKESPEC"];
if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone"))
command.append(" QMAKE_LFLAGS+=/ENTRY:main");
+ addSysroot(&command);
}
int code = 0;
diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h
index 71ef210e89..38b3e37799 100644
--- a/tools/configure/configureapp.h
+++ b/tools/configure/configureapp.h
@@ -162,6 +162,7 @@ private:
void reloadCmdLine();
void saveCmdLine();
+ void addSysroot(QString *command);
bool tryCompileProject(const QString &projectPath, const QString &extraOptions = QString());
bool compilerSupportsFlag(const QString &compilerAndArgs);