make "realification" of default specs less convoluted

Change-Id: I8586d8114c8711a18f477039a56d6d8bfc31c88b
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
Oswald Buddenhagen
2012-06-11 18:50:45 +02:00
parent 9cef89e691
commit ca2816db1a

View File

@@ -891,25 +891,16 @@ bool QMakeEvaluator::loadSpec()
fL1S("Could not read qmake configuration file %1").arg(spec)); fL1S("Could not read qmake configuration file %1").arg(spec));
return false; return false;
} }
m_option->qmakespec_name = IoUtils::fileName(m_option->qmakespec).toString();
if (m_option->qmakespec_name == QLatin1String("default")) {
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
char buffer[1024]; QString real_spec = QFileInfo(m_option->qmakespec).canonicalFilePath();
int l = ::readlink(m_option->qmakespec.toLocal8Bit().constData(), buffer, 1024);
if (l != -1)
m_option->qmakespec_name =
IoUtils::fileName(QString::fromLocal8Bit(buffer, l)).toString();
#else #else
// We can't resolve symlinks as they do on Unix, so configure.exe puts // We can't resolve symlinks as they do on Unix, so configure.exe puts
// the source of the qmake.conf at the end of the default/qmake.conf in // the source of the qmake.conf at the end of the default/qmake.conf in
// the QMAKESPEC_ORG variable. // the QMAKESPEC_ORIGINAL variable.
const ProStringList &spec_org = const ProString &orig_spec = first(ProString("QMAKESPEC_ORIGINAL"));
m_option->base_valuemap.value(ProString("QMAKESPEC_ORIGINAL")); QString real_spec = orig_spec.isEmpty() ? m_option->qmakespec : orig_spec.toQString();
if (!spec_org.isEmpty())
m_option->qmakespec_name =
IoUtils::fileName(spec_org.first().toQString()).toString();
#endif #endif
} m_option->qmakespec_name = IoUtils::fileName(real_spec).toString();
if (!m_option->cachefile.isEmpty() if (!m_option->cachefile.isEmpty()
&& !evaluateFileDirect(m_option->cachefile, QMakeHandler::EvalConfigFile, LoadProOnly)) { && !evaluateFileDirect(m_option->cachefile, QMakeHandler::EvalConfigFile, LoadProOnly)) {
return false; return false;