Commit 83085439 authored by Tobias Hunger's avatar Tobias Hunger

Support multiple mkspecs per tool chain

This is necessary to handle Qt 5 moving mkspecs out of unsupported.

Task-number: QTCREATORBUG-6862
Change-Id: I193e3d16467773a2a714ef44f8d441d2d2395801
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent b4942447
......@@ -406,7 +406,7 @@ Utils::FileName GccToolChain::debuggerCommand() const
return m_debuggerCommand;
}
Utils::FileName GccToolChain::suggestedMkspec() const
QList<Utils::FileName> GccToolChain::suggestedMkspecList() const
{
Abi abi = targetAbi();
Abi host = Abi::hostAbi();
......@@ -415,30 +415,30 @@ Utils::FileName GccToolChain::suggestedMkspec() const
if (abi.architecture() != host.architecture()
|| abi.os() != host.os()
|| abi.osFlavor() != host.osFlavor()) // Note: This can fail:-(
return Utils::FileName();
return QList<Utils::FileName>();
if (abi.os() == Abi::MacOS) {
QString v = version();
// prefer versioned g++ on mac. This is required to enable building for older Mac OS versions
if (v.startsWith(QLatin1String("4.0")) && m_compilerCommand.endsWith(QLatin1String("-4.0")))
return Utils::FileName::fromString(QLatin1String("macx-g++40"));
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("macx-g++40"));
if (v.startsWith(QLatin1String("4.2")) && m_compilerCommand.endsWith(QLatin1String("-4.2")))
return Utils::FileName::fromString(QLatin1String("macx-g++42"));
return Utils::FileName::fromString(QLatin1String("macx-g++"));
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("macx-g++42"));
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("macx-g++"));
}
if (abi.os() == Abi::LinuxOS) {
if (abi.osFlavor() != Abi::GenericLinuxFlavor)
return Utils::FileName(); // most likely not a desktop, so leave the mkspec alone.
return QList<Utils::FileName>(); // most likely not a desktop, so leave the mkspec alone.
if (abi.wordWidth() == host.wordWidth())
return Utils::FileName::fromString(QLatin1String("linux-g++")); // no need to explicitly set the word width
return Utils::FileName::fromString(QLatin1String("linux-g++-") + QString::number(m_targetAbi.wordWidth()));
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("linux-g++")); // no need to explicitly set the word width
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("linux-g++-") + QString::number(m_targetAbi.wordWidth()));
}
if (abi.os() == Abi::BsdOS && abi.osFlavor() == Abi::FreeBsdFlavor)
return Utils::FileName::fromString(QLatin1String("freebsd-g++"));
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("freebsd-g++"));
return Utils::FileName();
return QList<Utils::FileName>();
}
QString GccToolChain::makeCommand() const
......@@ -702,7 +702,7 @@ void Internal::GccToolChainConfigWidget::apply()
tc->setTargetAbi(m_abiWidget->currentAbi());
tc->setDisplayName(displayName); // reset display name
tc->setDebuggerCommand(debuggerCommand());
tc->setMkspec(mkspec());
tc->setMkspecList(mkspecList());
m_autoDebuggerCommand = Utils::FileName::fromString(QLatin1String("<manually set>"));
}
......@@ -716,7 +716,7 @@ void Internal::GccToolChainConfigWidget::setFromToolchain()
if (!m_isReadOnly && !m_compilerCommand->path().isEmpty())
m_abiWidget->setEnabled(true);
setDebuggerCommand(tc->debuggerCommand());
setMkspec(tc->mkspec());
setMkspecList(tc->mkspecList());
blockSignals(blocked);
}
......@@ -727,7 +727,7 @@ bool Internal::GccToolChainConfigWidget::isDirty() const
return m_compilerCommand->fileName() != tc->compilerCommand()
|| m_abiWidget->currentAbi() != tc->targetAbi()
|| debuggerCommand() != tc->debuggerCommand()
|| mkspec() != tc->mkspec();
|| mkspecList() != tc->mkspecList();
}
void Internal::GccToolChainConfigWidget::makeReadOnly()
......@@ -792,14 +792,18 @@ QString ClangToolChain::makeCommand() const
#endif
}
Utils::FileName ClangToolChain::suggestedMkspec() const
QList<Utils::FileName> ClangToolChain::suggestedMkspecList() const
{
Abi abi = targetAbi();
if (abi.os() == Abi::MacOS)
return Utils::FileName::fromString(QLatin1String("unsupported/macx-clang"));
return QList<Utils::FileName>()
<< Utils::FileName::fromString(QLatin1String("macx-clang"))
<< Utils::FileName::fromString(QLatin1String("unsupported/macx-clang"));
else if (abi.os() == Abi::LinuxOS)
return Utils::FileName::fromString(QLatin1String("unsupported/linux-clang"));
return Utils::FileName(); // Note: Not supported by Qt yet, so default to the mkspec the Qt was build with
return QList<Utils::FileName>()
<< Utils::FileName::fromString(QLatin1String("linux-clang"))
<< Utils::FileName::fromString(QLatin1String("unsupported/linux-clang"));
return QList<Utils::FileName>(); // Note: Not supported by Qt yet, so default to the mkspec the Qt was build with
}
IOutputParser *ClangToolChain::outputParser() const
......@@ -880,15 +884,19 @@ QString MingwToolChain::typeDisplayName() const
return Internal::MingwToolChainFactory::tr("MinGW");
}
Utils::FileName MingwToolChain::suggestedMkspec() const
QList<Utils::FileName> MingwToolChain::suggestedMkspecList() const
{
#if defined(Q_OS_WIN)
return Utils::FileName::fromString(QLatin1String("win32-g++"));
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("win32-g++"));
#elif defined(Q_OS_LINUX)
if (version().startsWith("4.6."))
return Utils::FileName::fromString(QLatin1String("unsupported/win32-g++-4.6-cross"));
return QList<Utils::FileName>()
<< Utils::FileName::fromString(QLatin1String("win32-g++-4.6-cross"))
<< Utils::FileName::fromString(QLatin1String("unsupported/win32-g++-4.6-cross"));
else
return Utils::FileName::fromString(QLatin1String("unsupported/win32-g++-cross"));
return QList<Utils::FileName>()
<< Utils::FileName::fromString(QLatin1String("win32-g++-cross"))
<< Utils::FileName::fromString(QLatin1String("unsupported/win32-g++-cross"));
#else
return Utils::FileName();
#endif
......@@ -992,9 +1000,10 @@ IOutputParser *LinuxIccToolChain::outputParser() const
return new LinuxIccParser;
}
Utils::FileName LinuxIccToolChain::suggestedMkspec() const
QList<Utils::FileName> LinuxIccToolChain::suggestedMkspecList() const
{
return Utils::FileName::fromString(QLatin1String("linux-icc-") + QString::number(targetAbi().wordWidth()));
return QList<Utils::FileName>()
<< Utils::FileName::fromString(QLatin1String("linux-icc-") + QString::number(targetAbi().wordWidth()));
}
ToolChain *LinuxIccToolChain::clone() const
......
......@@ -71,7 +71,7 @@ public:
QString makeCommand() const;
void setDebuggerCommand(const Utils::FileName &);
Utils::FileName debuggerCommand() const;
Utils::FileName suggestedMkspec() const;
QList<Utils::FileName> suggestedMkspecList() const;
IOutputParser *outputParser() const;
QVariantMap toMap() const;
......@@ -129,7 +129,7 @@ public:
ToolChain *clone() const;
Utils::FileName suggestedMkspec() const;
QList<Utils::FileName> suggestedMkspecList() const;
private:
ClangToolChain(bool autodetect);
......@@ -151,7 +151,7 @@ public:
ToolChain *clone() const;
Utils::FileName suggestedMkspec() const;
QList<Utils::FileName> suggestedMkspecList() const;
private:
MingwToolChain(bool autodetect);
......@@ -174,7 +174,7 @@ public:
ToolChain *clone() const;
Utils::FileName suggestedMkspec() const;
QList<Utils::FileName> suggestedMkspecList() const;
private:
LinuxIccToolChain(bool autodetect);
......
......@@ -328,15 +328,15 @@ QString MsvcToolChain::typeDisplayName() const
return MsvcToolChainFactory::tr("MSVC");
}
Utils::FileName MsvcToolChain::suggestedMkspec() const
QList<Utils::FileName> MsvcToolChain::suggestedMkspecList() const
{
if (m_abi.osFlavor() == Abi::WindowsMsvc2005Flavor)
return Utils::FileName::fromString(QLatin1String("win32-msvc2005"));
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("win32-msvc2005"));
if (m_abi.osFlavor() == Abi::WindowsMsvc2008Flavor)
return Utils::FileName::fromString(QLatin1String("win32-msvc2008"));
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("win32-msvc2008"));
if (m_abi.osFlavor() == Abi::WindowsMsvc2010Flavor)
return Utils::FileName::fromString(QLatin1String("win32-msvc2010"));
return Utils::FileName();
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("win32-msvc2010"));
return QList<Utils::FileName>();
}
QVariantMap MsvcToolChain::toMap() const
......@@ -436,7 +436,7 @@ void MsvcToolChainConfigWidget::apply()
MsvcToolChain *tc = static_cast<MsvcToolChain *>(toolChain());
QTC_ASSERT(tc, return; );
tc->setDebuggerCommand(debuggerCommand());
tc->setMkspec(mkspec());
tc->setMkspecList(mkspecList());
}
void MsvcToolChainConfigWidget::setFromToolChain()
......@@ -450,7 +450,7 @@ void MsvcToolChainConfigWidget::setFromToolChain()
}
m_varsBatDisplayLabel->setText(varsBatDisplay);
setDebuggerCommand(tc->debuggerCommand());
setMkspec(tc->mkspec());
setMkspecList(tc->mkspecList());
}
bool MsvcToolChainConfigWidget::isDirty() const
......@@ -458,7 +458,7 @@ bool MsvcToolChainConfigWidget::isDirty() const
MsvcToolChain *tc = static_cast<MsvcToolChain *>(toolChain());
QTC_ASSERT(tc, return false);
return debuggerCommand() != tc->debuggerCommand()
|| mkspec() != tc->mkspec();
|| mkspecList() != tc->mkspecList();
}
void MsvcToolChainConfigWidget::autoDetectDebugger()
......
......@@ -57,7 +57,7 @@ public:
MsvcToolChain(const QString &name, const Abi &abi,
const QString &varsBat, const QString &varsBatArg, bool autodetect = false);
QString legacyId() const;
Utils::FileName suggestedMkspec() const;
QList<Utils::FileName> suggestedMkspecList() const;
static MsvcToolChain *readFromMap(const QVariantMap &data);
......
......@@ -45,6 +45,29 @@ static const char DISPLAY_NAME_KEY[] = "ProjectExplorer.ToolChain.DisplayName";
static const char AUTODETECT_KEY[] = "ProjectExplorer.ToolChain.Autodetect";
static const char MKSPEC_KEY[] = "ProjectExplorer.ToolChain.MkSpecOverride";
namespace {
QString mkspecListToString(const QList<Utils::FileName> &specList)
{
QStringList result;
foreach (const Utils::FileName &spec, specList)
result.append(spec.toString());
return result.join(QChar::fromLatin1(';'));
}
QList<Utils::FileName> mkspecListFromString(const QString &string)
{
QList<Utils::FileName> result;
QStringList partList;
if (!string.isEmpty())
partList = string.split(QLatin1Char(';'));
foreach (const QString &part, partList)
result.append(Utils::FileName::fromString(part));
return result;
}
} // namespace
namespace ProjectExplorer {
namespace Internal {
......@@ -76,7 +99,7 @@ public:
QString m_id;
bool m_autodetect;
mutable QString m_displayName;
Utils::FileName m_mkspec;
QList<Utils::FileName> m_mkspecList;
};
} // namespace Internal
......@@ -143,19 +166,19 @@ QStringList ToolChain::restrictedToTargets() const
return QStringList();
}
Utils::FileName ToolChain::mkspec() const
QList<Utils::FileName> ToolChain::mkspecList() const
{
if (d->m_mkspec.isEmpty())
return suggestedMkspec();
return d->m_mkspec;
if (d->m_mkspecList.isEmpty())
return suggestedMkspecList();
return d->m_mkspecList;
}
void ToolChain::setMkspec(const Utils::FileName &spec)
void ToolChain::setMkspecList(const QList<Utils::FileName> &specList)
{
Utils::FileName oldSpecs = mkspec();
d->m_mkspec = spec;
QList<Utils::FileName> oldSpecList = mkspecList();
d->m_mkspecList = specList;
if (oldSpecs != mkspec())
if (oldSpecList != mkspecList())
toolChainUpdated();
}
......@@ -193,7 +216,7 @@ QVariantMap ToolChain::toMap() const
result.insert(QLatin1String(ID_KEY), id());
result.insert(QLatin1String(DISPLAY_NAME_KEY), displayName());
result.insert(QLatin1String(AUTODETECT_KEY), isAutoDetected());
result.insert(QLatin1String(MKSPEC_KEY), d->m_mkspec.toString());
result.insert(QLatin1String(MKSPEC_KEY), mkspecListToString(d->m_mkspecList));
return result;
}
......@@ -223,7 +246,7 @@ bool ToolChain::fromMap(const QVariantMap &data)
// make sure we have new style ids:
d->m_id = Internal::ToolChainPrivate::createId(data.value(QLatin1String(ID_KEY)).toString());
d->m_autodetect = data.value(QLatin1String(AUTODETECT_KEY), false).toBool();
d->m_mkspec = Utils::FileName::fromString(data.value(QLatin1String(MKSPEC_KEY)).toString());
d->m_mkspecList = mkspecListFromString(data.value(QLatin1String(MKSPEC_KEY)).toString());
return true;
}
......
......@@ -88,9 +88,9 @@ public:
virtual void addToEnvironment(Utils::Environment &env) const = 0;
virtual QString makeCommand() const = 0;
Utils::FileName mkspec() const;
void setMkspec(const Utils::FileName &mkspec);
virtual Utils::FileName suggestedMkspec() const { return Utils::FileName(); }
QList<Utils::FileName> mkspecList() const;
void setMkspecList(const QList<Utils::FileName> &specList);
virtual QList<Utils::FileName> suggestedMkspecList() const { return QList<Utils::FileName>(); }
virtual Utils::FileName compilerCommand() const = 0;
virtual Utils::FileName debuggerCommand() const = 0;
......
......@@ -45,24 +45,43 @@
#include <QtGui/QPushButton>
namespace {
const char DEFAULT_MKSPEC[] = "default";
Utils::FileName mkspecFromString(const QString &spec)
QString mkspecListToString(const QList<Utils::FileName> &specList)
{
if (spec == QLatin1String(DEFAULT_MKSPEC))
return Utils::FileName();
else
return Utils::FileName::fromUserInput(spec);
QStringList specStrings;
foreach (const Utils::FileName &spec, specList) {
if (spec.isEmpty())
specStrings.append(QLatin1String(DEFAULT_MKSPEC));
else
specStrings.append(spec.toUserOutput());
}
QString specString = specStrings.join(QChar::fromAscii(';'));
if (specString.isEmpty())
return QLatin1String(DEFAULT_MKSPEC);
return specString;
}
QString mkspecToString(const Utils::FileName spec)
QList<Utils::FileName> mkspecListFromString(const QString &specString)
{
if (spec.isEmpty())
return QLatin1String(DEFAULT_MKSPEC);
else
return spec.toUserOutput();
QStringList specList = specString.split(QLatin1Char(';'));
QList<Utils::FileName> result;
foreach (const QString &spec, specList) {
QString trimmed = spec.trimmed();
if (trimmed == QLatin1String(DEFAULT_MKSPEC))
result.append(Utils::FileName());
else
result.append(Utils::FileName::fromUserInput(trimmed));
}
if (result.size() == 1 && result.at(0).isEmpty())
return QList<Utils::FileName>();
return result;
}
} // namespace
namespace ProjectExplorer {
......@@ -90,7 +109,7 @@ public:
QPushButton *m_mkspecResetButton;
bool m_mkspecEdited;
QLabel *m_errorLabel;
Utils::FileName m_suggestedMkspec;
QList<Utils::FileName> m_suggestedMkspec;
};
} // namespace Internal
......@@ -127,17 +146,17 @@ void ToolChainConfigWidget::makeReadOnly()
void ToolChainConfigWidget::emitDirty()
{
if (d->m_mkspecEdit)
d->m_mkspecEdited = (mkspecFromString(d->m_mkspecEdit->text()) != d->m_suggestedMkspec);
d->m_mkspecEdited = (mkspecListFromString(d->m_mkspecEdit->text()) != d->m_suggestedMkspec);
if (d->m_mkspecResetButton)
d->m_mkspecResetButton->setEnabled(d->m_mkspecEdited);
emit dirty(toolChain());
}
void ToolChainConfigWidget::resetMkspec()
void ToolChainConfigWidget::resetMkspecList()
{
if (!d->m_mkspecEdit || !d->m_mkspecEdited)
return;
d->m_mkspecEdit->setText(mkspecToString(d->m_suggestedMkspec));
d->m_mkspecEdit->setText(mkspecListToString(d->m_suggestedMkspec));
d->m_mkspecEdited = false;
}
......@@ -211,34 +230,34 @@ void ToolChainConfigWidget::ensureMkspecEdit()
QTC_CHECK(!d->m_mkspecLayout);
QTC_CHECK(!d->m_mkspecResetButton);
d->m_suggestedMkspec = d->m_toolChain->suggestedMkspec();
d->m_suggestedMkspec = d->m_toolChain->suggestedMkspecList();
d->m_mkspecLayout = new QHBoxLayout;
d->m_mkspecLayout->setMargin(0);
d->m_mkspecEdit = new QLineEdit;
d->m_mkspecEdit->setWhatsThis(tr("All possible mkspecs separated by a semicolon (';')."));
d->m_mkspecResetButton = new QPushButton(tr("Reset"));
d->m_mkspecResetButton->setEnabled(d->m_mkspecEdited);
d->m_mkspecLayout->addWidget(d->m_mkspecEdit);
d->m_mkspecLayout->addWidget(d->m_mkspecResetButton);
connect(d->m_mkspecEdit, SIGNAL(textChanged(QString)), this, SLOT(emitDirty()));
connect(d->m_mkspecResetButton, SIGNAL(clicked()), this, SLOT(resetMkspec()));
connect(d->m_mkspecResetButton, SIGNAL(clicked()), this, SLOT(resetMkspecList()));
}
Utils::FileName ToolChainConfigWidget::mkspec() const
QList<Utils::FileName> ToolChainConfigWidget::mkspecList() const
{
QTC_ASSERT(d->m_mkspecEdit, return Utils::FileName());
QTC_ASSERT(d->m_mkspecEdit, return QList<Utils::FileName>());
return mkspecFromString(d->m_mkspecEdit->text());
return mkspecListFromString(d->m_mkspecEdit->text());
}
void ToolChainConfigWidget::setMkspec(const Utils::FileName &spec)
void ToolChainConfigWidget::setMkspecList(const QList<Utils::FileName> &specList)
{
QTC_ASSERT(d->m_mkspecEdit, return);
QString text = mkspecToString(spec);
d->m_mkspecEdit->setText(text);
d->m_mkspecEdit->setText(mkspecListToString(specList));
emitDirty();
}
......
......@@ -75,7 +75,7 @@ signals:
protected slots:
void emitDirty();
void resetMkspec();
void resetMkspecList();
void setErrorMessage(const QString &);
void clearErrorMessage();
......@@ -94,8 +94,8 @@ protected:
Utils::FileName debuggerCommand() const;
void setDebuggerCommand(const Utils::FileName &debugger);
Utils::FileName mkspec() const;
void setMkspec(const Utils::FileName &spec);
QList<Utils::FileName> mkspecList() const;
void setMkspecList(const QList<Utils::FileName> &specList);
private:
void ensureDebuggerPathChooser(const QStringList &versionArguments);
......
......@@ -305,7 +305,7 @@ QString WinCEToolChain::typeDisplayName() const
return WinCEToolChainFactory::tr("WinCE");
}
Utils::FileName WinCEToolChain::suggestedMkspec() const
QList<Utils::FileName> WinCEToolChain::suggestedMkspecList() const
{
const QChar specSeperator(QLatin1Char('-'));
......@@ -317,7 +317,7 @@ Utils::FileName WinCEToolChain::suggestedMkspec() const
specString += specSeperator;
specString += m_msvcVer;
return Utils::FileName::fromString(specString);
return QList<Utils::FileName>() << Utils::FileName::fromString(specString);
}
......
......@@ -58,14 +58,14 @@ public:
bool autodetect = false);
QString legacyId() const;
Utils::FileName suggestedMkspec() const;
QList<Utils::FileName> suggestedMkspecList() const;
static WinCEToolChain *readFromMap(const QVariantMap &data);
QString type() const;
QString typeDisplayName() const;
Utils::FileName mkspec() const;
Utils::FileName mkspecList() const;
QString ceVer() const;
......
......@@ -697,10 +697,9 @@ void QMakeStepConfigWidget::updateSummaryLabel()
ToolChain *tc = qt4bc->toolChain();
if (!tc)
return;
Utils::FileName tcSpec = tc->mkspec();
if (!tcSpec.isEmpty() && tcSpec != m_step->mkspec())
setAdditionalSummaryText(tr("<b>Warning:</b> The tool chain suggested \"%1\" as mkspec.").arg(tcSpec.toUserOutput()));
QList<Utils::FileName> tcSpecList = tc->mkspecList();
if (!tcSpecList.contains(m_step->mkspec()))
setAdditionalSummaryText(tr("<b>Warning:</b> The tool chain suggests using another mkspec."));
else
setAdditionalSummaryText(QString());
}
......
......@@ -413,7 +413,7 @@ void RvctToolChainConfigWidget::apply()
tc->setArmVersion(static_cast<RvctToolChain::ArmVersion>(m_ui->versionComboBox->currentIndex()));
tc->setEnvironmentChanges(changes);
tc->setDebuggerCommand(debuggerCommand());
tc->setMkspec(mkspec());
tc->setMkspecList(mkspecList());
m_model->setUserChanges(changes);
}
......@@ -428,7 +428,7 @@ void RvctToolChainConfigWidget::setFromToolChain()
m_ui->compilerPath->setFileName(tc->compilerCommand());
m_ui->versionComboBox->setCurrentIndex(static_cast<int>(tc->armVersion()));
setDebuggerCommand(tc->debuggerCommand());
setMkspec(tc->mkspec());
setMkspecList(tc->mkspecList());
}
bool RvctToolChainConfigWidget::isDirty() const
......@@ -440,7 +440,7 @@ bool RvctToolChainConfigWidget::isDirty() const
|| tc->armVersion() != static_cast<RvctToolChain::ArmVersion>(m_ui->versionComboBox->currentIndex())
|| tc->environmentChanges() != environmentChanges()
|| tc->debuggerCommand() != debuggerCommand()
|| tc->mkspec() != mkspec();
|| tc->mkspecList() != mkspecList();
}
void RvctToolChainConfigWidget::makeReadOnly()
......
......@@ -468,7 +468,7 @@ UnConfiguredSettings Qt4Manager::unconfiguredSettings() const
version = versions.first();
foreach (ProjectExplorer::ToolChain *tc, ProjectExplorer::ToolChainManager::instance()->toolChains()) {
if (tc->mkspec() == version->mkspec()) {
if (tc->mkspecList().contains(version->mkspec())) {
toolChain = tc;
break;
}
......
......@@ -316,7 +316,7 @@ ProjectExplorer::ToolChain *Qt4BaseTarget::preferredToolChain(ProjectExplorer::B
QList<ProjectExplorer::ToolChain *> tcs = possibleToolChains(bc);
const Utils::FileName mkspec = qtBc->qtVersion()->mkspec();
foreach (ProjectExplorer::ToolChain *tc, tcs)
if (tc->mkspec() == mkspec)
if (tc->mkspecList().contains(mkspec))
return tc;
return tcs.isEmpty() ? 0 : tcs.at(0);
}
......@@ -328,11 +328,14 @@ Utils::FileName Qt4BaseTarget::mkspec(const Qt4BuildConfiguration *bc) const
if (version && version->qtAbis().count() == 1 && version->qtAbis().first().isNull())
return Utils::FileName();
const Utils::FileName tcSpec = bc->toolChain() ? bc->toolChain()->mkspec() : Utils::FileName();
const QList<Utils::FileName> tcSpecList
= bc->toolChain() ? bc->toolChain()->mkspecList() : QList<Utils::FileName>();
if (!version)
return tcSpec;
if (!tcSpec.isEmpty() && version->hasMkspec(tcSpec))
return tcSpec;
return Utils::FileName(); // No Qt version, so no qmake either...
foreach (const Utils::FileName &tcSpec, tcSpecList) {
if (version->hasMkspec(tcSpec))