diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp
index 82aa6987a768826fa74b11494205e639b1c32675..1e346e6f5e88ac18f6db06fc0a1b83a9ed4a4888 100644
--- a/src/plugins/qtsupport/baseqtversion.cpp
+++ b/src/plugins/qtsupport/baseqtversion.cpp
@@ -1292,7 +1292,8 @@ Utils::FileName BaseQtVersion::mkspecFromVersionInfo(const QHash<QString, QStrin
         }
         f2.close();
     }
-#elif defined(Q_OS_MAC)
+#else
+#  ifdef Q_OS_MAC
     QFile f2(mkspecFullPath.toString() + QLatin1String("/qmake.conf"));
     if (f2.exists() && f2.open(QIODevice::ReadOnly)) {
         while (!f2.atEnd()) {
@@ -1306,15 +1307,14 @@ Utils::FileName BaseQtVersion::mkspecFromVersionInfo(const QHash<QString, QStrin
 //                      qDebug() << "default mkspec is xcode, falling back to g++";
                         mkspecFullPath = baseMkspecDir.appendPath(QLatin1String("macx-g++"));
                     }
-                    //resolve mkspec link
-                    mkspecFullPath = Utils::FileName::fromString(mkspecFullPath.toFileInfo().canonicalFilePath());
                 }
                 break;
             }
         }
         f2.close();
     }
-#else
+#  endif
+    //resolve mkspec link
     mkspecFullPath = Utils::FileName::fromString(mkspecFullPath.toFileInfo().canonicalFilePath());
 #endif