From 29bdcb6008a58203efc62ee58e57d266e60be095 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Tue, 18 Sep 2012 09:32:46 +0200
Subject: [PATCH] resolve only one level of symlinks, and only for the default
 specs

otherwise we end up in the source tree, which is counterproductive.

Task-number: QTBUG-26869
Change-Id: Id44a94f827dc285c75b9b243c8ef6478e668e3ff
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/04cd23428a4f2cfa5ee02b70f2086ff832aae925)
---
 src/linguist/shared/qmakeevaluator.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/linguist/shared/qmakeevaluator.cpp b/src/linguist/shared/qmakeevaluator.cpp
index 40cd1744d..8643f1696 100644
--- a/src/linguist/shared/qmakeevaluator.cpp
+++ b/src/linguist/shared/qmakeevaluator.cpp
@@ -1113,7 +1113,12 @@ bool QMakeEvaluator::loadSpecInternal()
         return false;
     }
 #ifdef Q_OS_UNIX
-    m_qmakespec = QFileInfo(m_qmakespec).canonicalFilePath();
+    if (m_qmakespec.endsWith(QLatin1String("/default-host"))
+        || m_qmakespec.endsWith(QLatin1String("/default"))) {
+        QString rspec = QFileInfo(m_qmakespec).readLink();
+        if (!rspec.isEmpty())
+            m_qmakespec = QDir::cleanPath(QDir(m_qmakespec).absoluteFilePath(rspec));
+    }
 #else
     // 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
-- 
GitLab