aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2019-07-14 14:10:28 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2019-07-15 14:47:37 +0000
commit7e0bd8554c175a0c11f45d5d3a987696127f6dda (patch)
treed431071ca5d067e62e517043afe9428e3f0f64ff
parent6845a8f9cadae8c5bcb1bb3e62af720b12437b3d (diff)
Move GCC/MinGW/Clang stuff to separate gccProbe module
... that simplifies a code bit. Change-Id: I4688e7b28986687d7cca5ad5fc8ab333cb50d8d2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--src/app/qbs-setup-toolchains/gccprobe.cpp251
-rw-r--r--src/app/qbs-setup-toolchains/gccprobe.h62
-rw-r--r--src/app/qbs-setup-toolchains/probe.cpp187
-rw-r--r--src/app/qbs-setup-toolchains/probe.h2
-rw-r--r--src/app/qbs-setup-toolchains/qbs-setup-toolchains.pro2
-rw-r--r--src/app/qbs-setup-toolchains/qbs-setup-toolchains.qbs2
6 files changed, 321 insertions, 185 deletions
diff --git a/src/app/qbs-setup-toolchains/gccprobe.cpp b/src/app/qbs-setup-toolchains/gccprobe.cpp
new file mode 100644
index 000000000..9dd31b41b
--- /dev/null
+++ b/src/app/qbs-setup-toolchains/gccprobe.cpp
@@ -0,0 +1,251 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qbs.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "probe.h"
+#include "gccprobe.h"
+
+#include "../shared/logging/consolelogger.h"
+
+#include <logging/translator.h>
+
+#include <tools/hostosinfo.h>
+#include <tools/profile.h>
+#include <tools/toolchains.h>
+
+#include <QtCore/qdir.h>
+#include <QtCore/qprocess.h>
+
+using namespace qbs;
+using Internal::HostOsInfo;
+using Internal::Tr;
+
+static QString qsystem(const QString &exe, const QStringList &args = QStringList())
+{
+ QProcess p;
+ p.setProcessChannelMode(QProcess::MergedChannels);
+ p.start(exe, args);
+ if (!p.waitForStarted()) {
+ throw qbs::ErrorInfo(Tr::tr("Failed to start compiler '%1': %2")
+ .arg(exe, p.errorString()));
+ }
+ if (!p.waitForFinished(-1) || p.exitCode() != 0)
+ throw qbs::ErrorInfo(Tr::tr("Failed to run compiler '%1': %2")
+ .arg(exe, p.errorString()));
+ return QString::fromLocal8Bit(p.readAll());
+}
+
+static QStringList validMinGWMachines()
+{
+ // List of MinGW machine names (gcc -dumpmachine) recognized by Qbs
+ return {QStringLiteral("mingw32"),
+ QStringLiteral("mingw64"),
+ QStringLiteral("i686-w64-mingw32"),
+ QStringLiteral("x86_64-w64-mingw32"),
+ QStringLiteral("i686-w64-mingw32.shared"),
+ QStringLiteral("x86_64-w64-mingw32.shared"),
+ QStringLiteral("i686-w64-mingw32.static"),
+ QStringLiteral("x86_64-w64-mingw32.static"),
+ QStringLiteral("i586-mingw32msvc"),
+ QStringLiteral("amd64-mingw32msvc")};
+}
+
+static QString gccMachineName(const QString &compilerFilePath)
+{
+ return qsystem(compilerFilePath, QStringList()
+ << QStringLiteral("-dumpmachine")).trimmed();
+}
+
+static QStringList standardCompilerFileNames()
+{
+ return {HostOsInfo::appendExecutableSuffix(QStringLiteral("gcc")),
+ HostOsInfo::appendExecutableSuffix(QStringLiteral("g++")),
+ HostOsInfo::appendExecutableSuffix(QStringLiteral("clang")),
+ HostOsInfo::appendExecutableSuffix(QStringLiteral("clang++"))};
+}
+
+static void setCommonProperties(Profile &profile, const QString &compilerFilePath,
+ const QStringList &toolchainTypes)
+{
+ const QFileInfo cfi(compilerFilePath);
+ const QString compilerName = cfi.fileName();
+
+ if (toolchainTypes.contains(QStringLiteral("mingw")))
+ profile.setValue(QStringLiteral("qbs.targetPlatform"),
+ QStringLiteral("windows"));
+
+ const QString prefix = compilerName.left(
+ compilerName.lastIndexOf(QLatin1Char('-')) + 1);
+ if (!prefix.isEmpty())
+ profile.setValue(QStringLiteral("cpp.toolchainPrefix"), prefix);
+
+ profile.setValue(QStringLiteral("cpp.toolchainInstallPath"),
+ cfi.absolutePath());
+ profile.setValue(QStringLiteral("qbs.toolchain"), toolchainTypes);
+
+ const QString suffix = compilerName.right(compilerName.size() - prefix.size());
+ if (!standardCompilerFileNames().contains(suffix))
+ qWarning("%s", qPrintable(
+ QStringLiteral("'%1' is not a standard compiler file name; "
+ "you must set the cpp.cCompilerName and "
+ "cpp.cxxCompilerName properties of this profile "
+ "manually").arg(compilerName)));
+}
+
+class ToolPathSetup
+{
+public:
+ explicit ToolPathSetup(Profile *profile, QString path, QString toolchainPrefix)
+ : m_profile(profile),
+ m_compilerDirPath(std::move(path)),
+ m_toolchainPrefix(std::move(toolchainPrefix))
+ {
+ }
+
+ void apply(const QString &toolName, const QString &propertyName) const
+ {
+ QString toolFileName = m_toolchainPrefix
+ + HostOsInfo::appendExecutableSuffix(toolName);
+ if (QFile::exists(m_compilerDirPath + QLatin1Char('/') + toolFileName))
+ return;
+ const QString toolFilePath = findExecutable(toolFileName);
+ if (toolFilePath.isEmpty()) {
+ qWarning("%s", qPrintable(
+ QStringLiteral("'%1' exists neither in '%2' nor in PATH.")
+ .arg(toolFileName, m_compilerDirPath)));
+ }
+ m_profile->setValue(propertyName, toolFilePath);
+ }
+
+private:
+ Profile * const m_profile;
+ QString m_compilerDirPath;
+ QString m_toolchainPrefix;
+};
+
+static bool doesProfileTargetOS(const Profile &profile, const QString &os)
+{
+ const auto target = profile.value(QStringLiteral("qbs.targetPlatform"));
+ if (target.isValid()) {
+ return Internal::contains(HostOsInfo::canonicalOSIdentifiers(
+ target.toString().toStdString()),
+ os.toStdString());
+ }
+ return Internal::contains(HostOsInfo::hostOSIdentifiers(), os.toStdString());
+}
+
+Profile createGccProfile(const QString &compilerFilePath, Settings *settings,
+ const QStringList &toolchainTypes,
+ const QString &profileName)
+{
+ const QString machineName = gccMachineName(compilerFilePath);
+
+ if (toolchainTypes.contains(QLatin1String("mingw"))) {
+ if (!validMinGWMachines().contains(machineName)) {
+ throw ErrorInfo(Tr::tr("Detected gcc platform '%1' is not supported.")
+ .arg(machineName));
+ }
+ }
+
+ Profile profile(!profileName.isEmpty() ? profileName : machineName, settings);
+ profile.removeProfile();
+ setCommonProperties(profile, compilerFilePath, toolchainTypes);
+
+ // Check whether auxiliary tools reside within the toolchain's install path.
+ // This might not be the case when using icecc or another compiler wrapper.
+ const QString compilerDirPath = QFileInfo(compilerFilePath).absolutePath();
+ const ToolPathSetup toolPathSetup(
+ &profile, compilerDirPath,
+ profile.value(QStringLiteral("cpp.toolchainPrefix"))
+ .toString());
+ toolPathSetup.apply(QStringLiteral("ar"), QStringLiteral("cpp.archiverPath"));
+ toolPathSetup.apply(QStringLiteral("as"), QStringLiteral("cpp.assemblerPath"));
+ toolPathSetup.apply(QStringLiteral("nm"), QStringLiteral("cpp.nmPath"));
+ if (doesProfileTargetOS(profile, QStringLiteral("darwin")))
+ toolPathSetup.apply(QStringLiteral("dsymutil"),
+ QStringLiteral("cpp.dsymutilPath"));
+ else
+ toolPathSetup.apply(QStringLiteral("objcopy"),
+ QStringLiteral("cpp.objcopyPath"));
+ toolPathSetup.apply(QStringLiteral("strip"),
+ QStringLiteral("cpp.stripPath"));
+
+ qbsInfo() << Tr::tr("Profile '%1' created for '%2'.")
+ .arg(profile.name(), compilerFilePath);
+ return profile;
+}
+
+void gccProbe(Settings *settings, QList<Profile> &profiles, const QString &compilerName)
+{
+ qbsInfo() << Tr::tr("Trying to detect %1...").arg(compilerName);
+
+ const QString crossCompilePrefix = QString::fromLocal8Bit(qgetenv("CROSS_COMPILE"));
+ const QString compilerFilePath = findExecutable(crossCompilePrefix + compilerName);
+ const QFileInfo cfi(compilerFilePath);
+ if (!cfi.exists()) {
+ qbsError() << Tr::tr("%1 not found.").arg(compilerName);
+ return;
+ }
+ const QString profileName = cfi.completeBaseName();
+ const QStringList toolchainTypes = toolchainTypeFromCompilerName(compilerName);
+ profiles.push_back(createGccProfile(compilerFilePath, settings,
+ toolchainTypes, profileName));
+}
+
+void mingwProbe(Settings *settings, QList<Profile> &profiles)
+{
+ // List of possible compiler binary names for this platform
+ QStringList compilerNames;
+ if (HostOsInfo::isWindowsHost()) {
+ compilerNames << QStringLiteral("gcc");
+ } else {
+ const auto machineNames = validMinGWMachines();
+ for (const QString &machineName : machineNames) {
+ compilerNames << machineName + QLatin1String("-gcc");
+ }
+ }
+
+ for (const QString &compilerName : qAsConst(compilerNames)) {
+ const QString gccPath
+ = findExecutable(HostOsInfo::appendExecutableSuffix(compilerName));
+ if (!gccPath.isEmpty())
+ profiles.push_back(createGccProfile(
+ gccPath, settings,
+ canonicalToolchain(QStringLiteral("mingw"))));
+ }
+}
diff --git a/src/app/qbs-setup-toolchains/gccprobe.h b/src/app/qbs-setup-toolchains/gccprobe.h
new file mode 100644
index 000000000..c39507741
--- /dev/null
+++ b/src/app/qbs-setup-toolchains/gccprobe.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qbs.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef GCCPROBE_H
+#define GCCPROBE_H
+
+#include <QtCore/qlist.h>
+
+QT_BEGIN_NAMESPACE
+class QFileInfo;
+QT_END_NAMESPACE
+
+namespace qbs {
+class Profile;
+class Settings;
+}
+
+qbs::Profile createGccProfile(const QString &compilerFilePath,
+ qbs::Settings *settings,
+ const QStringList &toolchainTypes,
+ const QString &profileName = QString());
+
+void gccProbe(qbs::Settings *settings, QList<qbs::Profile> &profiles,
+ const QString &compilerName);
+void mingwProbe(qbs::Settings *settings, QList<qbs::Profile> &profiles);
+
+#endif // Header guard
diff --git a/src/app/qbs-setup-toolchains/probe.cpp b/src/app/qbs-setup-toolchains/probe.cpp
index 852c053b2..3ea28a9ab 100644
--- a/src/app/qbs-setup-toolchains/probe.cpp
+++ b/src/app/qbs-setup-toolchains/probe.cpp
@@ -39,6 +39,7 @@
#include "probe.h"
#include "clangclprobe.h"
+#include "gccprobe.h"
#include "iarewprobe.h"
#include "keilprobe.h"
#include "msvcprobe.h"
@@ -46,23 +47,15 @@
#include "xcodeprobe.h"
#include <logging/translator.h>
-#include <tools/architectures.h>
#include <tools/error.h>
#include <tools/hostosinfo.h>
#include <tools/profile.h>
-#include <tools/qttools.h>
#include <tools/settings.h>
#include <tools/toolchains.h>
-#include <tools/stlutils.h>
#include <QtCore/qdir.h>
-#include <QtCore/qfileinfo.h>
-#include <QtCore/qprocess.h>
-#include <QtCore/qstringlist.h>
#include <QtCore/qtextstream.h>
-#include <cstdio>
-
using namespace qbs;
using Internal::HostOsInfo;
using Internal::Tr;
@@ -87,31 +80,7 @@ QString findExecutable(const QString &fileName)
return {};
}
-static QString qsystem(const QString &exe, const QStringList &args = QStringList())
-{
- QProcess p;
- p.setProcessChannelMode(QProcess::MergedChannels);
- p.start(exe, args);
- if (!p.waitForStarted()) {
- throw qbs::ErrorInfo(Tr::tr("Failed to start compiler '%1': %2")
- .arg(exe, p.errorString()));
- }
- if (!p.waitForFinished(-1) || p.exitCode() != 0)
- throw qbs::ErrorInfo(Tr::tr("Failed to run compiler '%1': %2").arg(exe, p.errorString()));
- return QString::fromLocal8Bit(p.readAll());
-}
-
-static QStringList validMinGWMachines()
-{
- // List of MinGW machine names (gcc -dumpmachine) recognized by Qbs
- return {QStringLiteral("mingw32"), QStringLiteral("mingw64"),
- QStringLiteral("i686-w64-mingw32"), QStringLiteral("x86_64-w64-mingw32"),
- QStringLiteral("i686-w64-mingw32.shared"), QStringLiteral("x86_64-w64-mingw32.shared"),
- QStringLiteral("i686-w64-mingw32.static"), QStringLiteral("x86_64-w64-mingw32.static"),
- QStringLiteral("i586-mingw32msvc"), QStringLiteral("amd64-mingw32msvc")};
-}
-
-static QStringList toolchainTypeFromCompilerName(const QString &compilerName)
+QStringList toolchainTypeFromCompilerName(const QString &compilerName)
{
if (compilerName == QLatin1String("cl.exe"))
return canonicalToolchain(QStringLiteral("msvc"));
@@ -134,158 +103,6 @@ static QStringList toolchainTypeFromCompilerName(const QString &compilerName)
return {};
}
-static QString gccMachineName(const QString &compilerFilePath)
-{
- return qsystem(compilerFilePath, QStringList() << QStringLiteral("-dumpmachine")).trimmed();
-}
-
-static QStringList standardCompilerFileNames()
-{
- return {HostOsInfo::appendExecutableSuffix(QStringLiteral("gcc")),
- HostOsInfo::appendExecutableSuffix(QStringLiteral("g++")),
- HostOsInfo::appendExecutableSuffix(QStringLiteral("clang")),
- HostOsInfo::appendExecutableSuffix(QStringLiteral("clang++"))};
-}
-
-static void setCommonProperties(Profile &profile, const QString &compilerFilePath,
- const QStringList &toolchainTypes)
-{
- const QFileInfo cfi(compilerFilePath);
- const QString compilerName = cfi.fileName();
-
- if (toolchainTypes.contains(QStringLiteral("mingw")))
- profile.setValue(QStringLiteral("qbs.targetPlatform"), QStringLiteral("windows"));
-
- const QString prefix = compilerName.left(compilerName.lastIndexOf(QLatin1Char('-')) + 1);
- if (!prefix.isEmpty())
- profile.setValue(QStringLiteral("cpp.toolchainPrefix"), prefix);
-
- profile.setValue(QStringLiteral("cpp.toolchainInstallPath"), cfi.absolutePath());
- profile.setValue(QStringLiteral("qbs.toolchain"), toolchainTypes);
-
- const QString suffix = compilerName.right(compilerName.size() - prefix.size());
- if (!standardCompilerFileNames().contains(suffix))
- qWarning("%s", qPrintable(
- QStringLiteral("'%1' is not a standard compiler file name; "
- "you must set the cpp.cCompilerName and "
- "cpp.cxxCompilerName properties of this profile "
- "manually").arg(compilerName)));
-}
-
-class ToolPathSetup
-{
-public:
- ToolPathSetup(Profile *profile, QString path, QString toolchainPrefix)
- : m_profile(profile),
- m_compilerDirPath(std::move(path)),
- m_toolchainPrefix(std::move(toolchainPrefix))
- {
- }
-
- void apply(const QString &toolName, const QString &propertyName) const
- {
- QString toolFileName = m_toolchainPrefix + HostOsInfo::appendExecutableSuffix(toolName);
- if (QFile::exists(m_compilerDirPath + QLatin1Char('/') + toolFileName))
- return;
- const QString toolFilePath = findExecutable(toolFileName);
- if (toolFilePath.isEmpty()) {
- qWarning("%s", qPrintable(QStringLiteral("'%1' exists neither in '%2' nor in PATH.")
- .arg(toolFileName, m_compilerDirPath)));
- }
- m_profile->setValue(propertyName, toolFilePath);
- }
-
-private:
- Profile * const m_profile;
- QString m_compilerDirPath;
- QString m_toolchainPrefix;
-};
-
-static bool doesProfileTargetOS(const Profile &profile, const QString &os)
-{
- const auto target = profile.value(QStringLiteral("qbs.targetPlatform"));
- if (target.isValid()) {
- return Internal::contains(HostOsInfo::canonicalOSIdentifiers(
- target.toString().toStdString()), os.toStdString());
- }
- return Internal::contains(HostOsInfo::hostOSIdentifiers(), os.toStdString());
-}
-
-static Profile createGccProfile(const QString &compilerFilePath, Settings *settings,
- const QStringList &toolchainTypes,
- const QString &profileName = QString())
-{
- const QString machineName = gccMachineName(compilerFilePath);
-
- if (toolchainTypes.contains(QLatin1String("mingw"))) {
- if (!validMinGWMachines().contains(machineName)) {
- throw ErrorInfo(Tr::tr("Detected gcc platform '%1' is not supported.")
- .arg(machineName));
- }
- }
-
- Profile profile(!profileName.isEmpty() ? profileName : machineName, settings);
- profile.removeProfile();
- setCommonProperties(profile, compilerFilePath, toolchainTypes);
-
- // Check whether auxiliary tools reside within the toolchain's install path.
- // This might not be the case when using icecc or another compiler wrapper.
- const QString compilerDirPath = QFileInfo(compilerFilePath).absolutePath();
- const ToolPathSetup toolPathSetup(&profile, compilerDirPath,
- profile.value(QStringLiteral("cpp.toolchainPrefix"))
- .toString());
- toolPathSetup.apply(QStringLiteral("ar"), QStringLiteral("cpp.archiverPath"));
- toolPathSetup.apply(QStringLiteral("as"), QStringLiteral("cpp.assemblerPath"));
- toolPathSetup.apply(QStringLiteral("nm"), QStringLiteral("cpp.nmPath"));
- if (doesProfileTargetOS(profile, QStringLiteral("darwin")))
- toolPathSetup.apply(QStringLiteral("dsymutil"), QStringLiteral("cpp.dsymutilPath"));
- else
- toolPathSetup.apply(QStringLiteral("objcopy"), QStringLiteral("cpp.objcopyPath"));
- toolPathSetup.apply(QStringLiteral("strip"), QStringLiteral("cpp.stripPath"));
-
- qStdout << Tr::tr("Profile '%1' created for '%2'.").arg(profile.name(), compilerFilePath)
- << endl;
- return profile;
-}
-
-static void gccProbe(Settings *settings, QList<Profile> &profiles, const QString &compilerName)
-{
- qStdout << Tr::tr("Trying to detect %1...").arg(compilerName) << endl;
-
- const QString crossCompilePrefix = QString::fromLocal8Bit(qgetenv("CROSS_COMPILE"));
- const QString compilerFilePath = findExecutable(crossCompilePrefix + compilerName);
- QFileInfo cfi(compilerFilePath);
- if (!cfi.exists()) {
- qStderr << Tr::tr("%1 not found.").arg(compilerName) << endl;
- return;
- }
- const QString profileName = cfi.completeBaseName();
- const QStringList toolchainTypes = toolchainTypeFromCompilerName(compilerName);
- profiles.push_back(createGccProfile(compilerFilePath, settings, toolchainTypes, profileName));
-}
-
-static void mingwProbe(Settings *settings, QList<Profile> &profiles)
-{
- // List of possible compiler binary names for this platform
- QStringList compilerNames;
- if (HostOsInfo::isWindowsHost()) {
- compilerNames << QStringLiteral("gcc");
- } else {
- const auto machineNames = validMinGWMachines();
- for (const QString &machineName : machineNames) {
- compilerNames << machineName + QLatin1String("-gcc");
- }
- }
-
- for (const QString &compilerName : qAsConst(compilerNames)) {
- const QString gccPath
- = findExecutable(HostOsInfo::appendExecutableSuffix(compilerName));
- if (!gccPath.isEmpty())
- profiles.push_back(createGccProfile(gccPath, settings,
- canonicalToolchain(QStringLiteral("mingw"))));
- }
-}
-
void probe(Settings *settings)
{
QList<Profile> profiles;
diff --git a/src/app/qbs-setup-toolchains/probe.h b/src/app/qbs-setup-toolchains/probe.h
index 0cac295d8..1149b0f8c 100644
--- a/src/app/qbs-setup-toolchains/probe.h
+++ b/src/app/qbs-setup-toolchains/probe.h
@@ -54,6 +54,8 @@ namespace qbs { class Settings; }
QString findExecutable(const QString &fileName);
+QStringList toolchainTypeFromCompilerName(const QString &compilerName);
+
void createProfile(const QString &profileName, const QString &toolchainType,
const QString &compilerFilePath, qbs::Settings *settings);
diff --git a/src/app/qbs-setup-toolchains/qbs-setup-toolchains.pro b/src/app/qbs-setup-toolchains/qbs-setup-toolchains.pro
index e83a9c716..6581bec63 100644
--- a/src/app/qbs-setup-toolchains/qbs-setup-toolchains.pro
+++ b/src/app/qbs-setup-toolchains/qbs-setup-toolchains.pro
@@ -5,6 +5,7 @@ TARGET = qbs-setup-toolchains
HEADERS += \
clangclprobe.h \
commandlineparser.h \
+ gccprobe.h \
iarewprobe.h \
keilprobe.h \
msvcprobe.h \
@@ -15,6 +16,7 @@ HEADERS += \
SOURCES += \
clangclprobe.cpp \
commandlineparser.cpp \
+ gccprobe.cpp \
iarewprobe.cpp \
keilprobe.cpp \
main.cpp \
diff --git a/src/app/qbs-setup-toolchains/qbs-setup-toolchains.qbs b/src/app/qbs-setup-toolchains/qbs-setup-toolchains.qbs
index fd3043a28..554891fc4 100644
--- a/src/app/qbs-setup-toolchains/qbs-setup-toolchains.qbs
+++ b/src/app/qbs-setup-toolchains/qbs-setup-toolchains.qbs
@@ -8,6 +8,8 @@ QbsApp {
"clangclprobe.h",
"commandlineparser.cpp",
"commandlineparser.h",
+ "gccprobe.cpp",
+ "gccprobe.h",
"iarewprobe.cpp",
"iarewprobe.h",
"keilprobe.cpp",