summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMehdi Fekari <mfekari@blackberry.com>2013-10-12 19:20:37 +0200
committerMehdi Fekari <mfekari@blackberry.com>2013-10-21 10:24:48 +0200
commitab4207acf2f111f44d16ae5d63752ac59b312c1c (patch)
tree4e9a3e318f5616d3ff105e89ac0fc9c9c60fa863 /src
parent295c68846955efd4ba0c02ac3e8b6d72a07da157 (diff)
downloadqt-creator-ab4207acf2f111f44d16ae5d63752ac59b312c1c.tar.gz
Qnx: Use Utils::Environment for qnx environment
Change-Id: I499ca9be0abc15fc0c57847ff288e80612a536fe Reviewed-by: Tobias Nätterlund <tobias.naetterlund@kdab.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/qnx/blackberrycertificate.cpp14
-rw-r--r--src/plugins/qnx/blackberryconfiguration.cpp17
-rw-r--r--src/plugins/qnx/blackberryconfiguration.h4
-rw-r--r--src/plugins/qnx/blackberryconfigurationmanager.cpp8
-rw-r--r--src/plugins/qnx/blackberryconfigurationmanager.h2
-rw-r--r--src/plugins/qnx/blackberrydeviceconnection.cpp6
-rw-r--r--src/plugins/qnx/blackberryndkprocess.cpp16
-rw-r--r--src/plugins/qnx/blackberryqtversion.cpp15
-rw-r--r--src/plugins/qnx/blackberryqtversion.h2
-rw-r--r--src/plugins/qnx/qnxabstractqtversion.cpp21
-rw-r--r--src/plugins/qnx/qnxabstractqtversion.h6
-rw-r--r--src/plugins/qnx/qnxqtversion.cpp34
-rw-r--r--src/plugins/qnx/qnxqtversion.h2
-rw-r--r--src/plugins/qnx/qnxutils.cpp68
-rw-r--r--src/plugins/qnx/qnxutils.h4
15 files changed, 114 insertions, 105 deletions
diff --git a/src/plugins/qnx/blackberrycertificate.cpp b/src/plugins/qnx/blackberrycertificate.cpp
index ef80841a89..b964bd5b14 100644
--- a/src/plugins/qnx/blackberrycertificate.cpp
+++ b/src/plugins/qnx/blackberrycertificate.cpp
@@ -32,6 +32,7 @@
#include "blackberrycertificate.h"
#include "blackberryconfiguration.h"
#include "blackberryconfigurationmanager.h"
+#include "blackberryndkprocess.h"
#include <utils/hostosinfo.h>
@@ -182,18 +183,7 @@ void BlackBerryCertificate::processError()
QString BlackBerryCertificate::command() const
{
- QString command;
- // TOOD: Give user choice to select NDK from where to get commands
- QMultiMap<QString, QString> qnxEnv = BlackBerryConfigurationManager::instance().defaultQnxEnv();
- if (!qnxEnv.isEmpty()) {
- command = qnxEnv.value(QLatin1String("QNX_HOST"))
- + QLatin1String("/usr/bin/blackberry-keytool");
-
- if (Utils::HostOsInfo::isWindowsHost())
- command += QLatin1String(".bat");
- }
-
- return command;
+ return BlackBerryNdkProcess::resolveNdkToolPath(QLatin1String("blackberry-keytool"));
}
} // namespace Internal
diff --git a/src/plugins/qnx/blackberryconfiguration.cpp b/src/plugins/qnx/blackberryconfiguration.cpp
index 2e4cfd1f9a..81f5ed0469 100644
--- a/src/plugins/qnx/blackberryconfiguration.cpp
+++ b/src/plugins/qnx/blackberryconfiguration.cpp
@@ -67,16 +67,25 @@ BlackBerryConfiguration::BlackBerryConfiguration(const FileName &ndkEnvFile, boo
m_isAutoDetected = isAutoDetected;
QString ndkPath = ndkEnvFile.parentDir().toString();
m_displayName = displayName.isEmpty() ? ndkPath.split(QDir::separator()).last() : displayName;
- m_qnxEnv = QnxUtils::parseEnvironmentFile(m_ndkEnvFile.toString());
+ m_qnxEnv = QnxUtils::qnxEnvironmentFromNdkFile(m_ndkEnvFile.toString());
+
+ QString ndkTarget;
+ QString qnxHost;
+ foreach (const Utils::EnvironmentItem &item, m_qnxEnv) {
+ if (item.name == QLatin1String("QNX_TARGET"))
+ ndkTarget = item.value;
+
+ else if (item.name == QLatin1String("QNX_HOST"))
+ qnxHost = item.value;
+
+ }
- QString ndkTarget = m_qnxEnv.value(QLatin1String("QNX_TARGET"));
QString sep = QString::fromLatin1("%1qnx6").arg(QDir::separator());
m_targetName = ndkTarget.split(sep).first().split(QDir::separator()).last();
if (QDir(ndkTarget).exists())
m_sysRoot = FileName::fromString(ndkTarget);
- QString qnxHost = m_qnxEnv.value(QLatin1String("QNX_HOST"));
FileName qmake4Path = QnxUtils::executableWithExtension(FileName::fromString(qnxHost + QLatin1String("/usr/bin/qmake")));
FileName qmake5Path = QnxUtils::executableWithExtension(FileName::fromString(qnxHost + QLatin1String("/usr/bin/qt5/qmake")));
FileName gccPath = QnxUtils::executableWithExtension(FileName::fromString(qnxHost + QLatin1String("/usr/bin/qcc")));
@@ -165,7 +174,7 @@ FileName BlackBerryConfiguration::sysRoot() const
return m_sysRoot;
}
-QMultiMap<QString, QString> BlackBerryConfiguration::qnxEnv() const
+QList<Utils::EnvironmentItem> BlackBerryConfiguration::qnxEnv() const
{
return m_qnxEnv;
}
diff --git a/src/plugins/qnx/blackberryconfiguration.h b/src/plugins/qnx/blackberryconfiguration.h
index 60d1284e01..a2f8f31e82 100644
--- a/src/plugins/qnx/blackberryconfiguration.h
+++ b/src/plugins/qnx/blackberryconfiguration.h
@@ -72,7 +72,7 @@ public:
Utils::FileName deviceDebuger() const;
Utils::FileName simulatorDebuger() const;
Utils::FileName sysRoot() const;
- QMultiMap<QString, QString> qnxEnv() const;
+ QList<Utils::EnvironmentItem> qnxEnv() const;
private:
QString m_displayName;
@@ -85,7 +85,7 @@ private:
Utils::FileName m_deviceDebugger;
Utils::FileName m_simulatorDebugger;
Utils::FileName m_sysRoot;
- QMultiMap<QString, QString> m_qnxEnv;
+ QList<Utils::EnvironmentItem> m_qnxEnv;
void createConfigurationPerQtVersion(
const Utils::FileName &qmakePath, Qnx::QnxArchitecture arch);
diff --git a/src/plugins/qnx/blackberryconfigurationmanager.cpp b/src/plugins/qnx/blackberryconfigurationmanager.cpp
index c8a99e844d..c5136172be 100644
--- a/src/plugins/qnx/blackberryconfigurationmanager.cpp
+++ b/src/plugins/qnx/blackberryconfigurationmanager.cpp
@@ -281,16 +281,16 @@ BlackBerryConfiguration *BlackBerryConfigurationManager::configurationFromEnvFil
return 0;
}
-// Returns a valid qnxEnv map from a valid configuration;
+// Returns a valid qnxEnv from a valid configuration;
// Needed by other classes to get blackberry process path (keys registration, debug token...)
-QMultiMap<QString, QString> BlackBerryConfigurationManager::defaultQnxEnv()
+QList<Utils::EnvironmentItem> BlackBerryConfigurationManager::defaultQnxEnv()
{
foreach (BlackBerryConfiguration *config, m_configs) {
- if (config->isActive() && !config->qnxEnv().isEmpty())
+ if (config->isActive() && config->qnxEnv().size())
return config->qnxEnv();
}
- return QMultiMap<QString, QString>();
+ return QList<Utils::EnvironmentItem>();
}
void BlackBerryConfigurationManager::loadSettings()
diff --git a/src/plugins/qnx/blackberryconfigurationmanager.h b/src/plugins/qnx/blackberryconfigurationmanager.h
index 97603ee81a..35e2325d18 100644
--- a/src/plugins/qnx/blackberryconfigurationmanager.h
+++ b/src/plugins/qnx/blackberryconfigurationmanager.h
@@ -63,7 +63,7 @@ public:
QString defaultDebugTokenPath() const;
void clearConfigurationSettings(BlackBerryConfiguration *config);
- QMultiMap<QString, QString> defaultQnxEnv();
+ QList<Utils::EnvironmentItem> defaultQnxEnv();
void loadAutoDetectedConfigurations();
diff --git a/src/plugins/qnx/blackberrydeviceconnection.cpp b/src/plugins/qnx/blackberrydeviceconnection.cpp
index a4638fddac..9b80986370 100644
--- a/src/plugins/qnx/blackberrydeviceconnection.cpp
+++ b/src/plugins/qnx/blackberrydeviceconnection.cpp
@@ -62,10 +62,8 @@ BlackBerryDeviceConnection::BlackBerryDeviceConnection() :
void BlackBerryDeviceConnection::connectDevice(const ProjectExplorer::IDevice::ConstPtr &device)
{
Utils::Environment env = Utils::Environment::systemEnvironment();
-
- QMultiMap<QString, QString> qnxEnv = BlackBerryConfigurationManager::instance().defaultQnxEnv();
- if (!qnxEnv.isEmpty())
- QnxUtils::prependQnxMapToEnvironment(qnxEnv, env);
+ foreach (const Utils::EnvironmentItem &item, BlackBerryConfigurationManager::instance().defaultQnxEnv())
+ env.appendOrSet(item.name, item.value);
m_process->setEnvironment(env.toStringList());
diff --git a/src/plugins/qnx/blackberryndkprocess.cpp b/src/plugins/qnx/blackberryndkprocess.cpp
index d863032033..56f52fbee3 100644
--- a/src/plugins/qnx/blackberryndkprocess.cpp
+++ b/src/plugins/qnx/blackberryndkprocess.cpp
@@ -56,13 +56,17 @@ BlackBerryNdkProcess::BlackBerryNdkProcess(const QString &command, QObject *pare
const QString BlackBerryNdkProcess::resolveNdkToolPath(const QString &tool)
{
QString toolPath;
- QMultiMap<QString, QString> qnxEnv = BlackBerryConfigurationManager::instance().defaultQnxEnv();
- if (!qnxEnv.isEmpty()) {
- toolPath = qnxEnv.value(QLatin1String("QNX_HOST"))
- + (QLatin1String("/usr/bin/")) + tool;
+ QList<Utils::EnvironmentItem> qnxEnv = BlackBerryConfigurationManager::instance().defaultQnxEnv();
+ foreach (const Utils::EnvironmentItem &item, qnxEnv) {
+ if (item.name == QLatin1String("QNX_HOST") && !item.value.isEmpty()) {
+ toolPath = item.value
+ + (QLatin1String("/usr/bin/")) + tool;
- if (Utils::HostOsInfo::isWindowsHost())
- toolPath += QLatin1String(".bat");
+ if (Utils::HostOsInfo::isWindowsHost())
+ toolPath += QLatin1String(".bat");
+
+ break;
+ }
}
return toolPath;
diff --git a/src/plugins/qnx/blackberryqtversion.cpp b/src/plugins/qnx/blackberryqtversion.cpp
index 180cdc8858..208a71b148 100644
--- a/src/plugins/qnx/blackberryqtversion.cpp
+++ b/src/plugins/qnx/blackberryqtversion.cpp
@@ -103,14 +103,15 @@ void BlackBerryQtVersion::fromMap(const QVariantMap &map)
m_ndkEnvFile = map.value(NndkEnvFile).toString();
}
-QMultiMap<QString, QString> BlackBerryQtVersion::environment() const
+QList<Utils::EnvironmentItem> BlackBerryQtVersion::environment() const
{
QTC_CHECK(!sdkPath().isEmpty());
if (sdkPath().isEmpty())
- return QMultiMap<QString, QString>();
+ return QList<Utils::EnvironmentItem>();
QString envFile = m_ndkEnvFile.isEmpty() ? QnxUtils::envFilePath(sdkPath()) : m_ndkEnvFile;
- QMultiMap<QString,QString> result = QnxUtils::parseEnvironmentFile(envFile);
+ QList<Utils::EnvironmentItem> env = QnxUtils::qnxEnvironmentFromNdkFile(envFile);
+
// BB NDK Host is having qmake executable which is using qt.conf file to specify
// base information. The qt.conf file is using 'CPUVARDIR' environment variable
// to provide correct information for both x86 and armle-v7 architectures.
@@ -119,9 +120,11 @@ QMultiMap<QString, QString> BlackBerryQtVersion::environment() const
// CPUVARDIR to match expected architecture() otherwise qmake environment is
// always resolved to be for armle-v7 architecture only as it is specified
// BB NDK environment file.
- result.replace(QLatin1String("CPUVARDIR"),
- architecture() == X86 ? QLatin1String("x86") : QLatin1String("armle-v7"));
- return result;
+
+ env.append(Utils::EnvironmentItem(QLatin1String("CPUVARDIR"),
+ architecture() == X86 ? QLatin1String("x86") : QLatin1String("armle-v7")));
+
+ return env;
}
void BlackBerryQtVersion::setDefaultSdkPath()
diff --git a/src/plugins/qnx/blackberryqtversion.h b/src/plugins/qnx/blackberryqtversion.h
index 61cc78364e..622cc72bf2 100644
--- a/src/plugins/qnx/blackberryqtversion.h
+++ b/src/plugins/qnx/blackberryqtversion.h
@@ -64,7 +64,7 @@ public:
QString sdkDescription() const;
private:
- QMultiMap<QString, QString> environment() const;
+ QList<Utils::EnvironmentItem> environment() const;
void setDefaultSdkPath();
QString m_ndkEnvFile;
diff --git a/src/plugins/qnx/qnxabstractqtversion.cpp b/src/plugins/qnx/qnxabstractqtversion.cpp
index 68af96606a..b9b40d0e9c 100644
--- a/src/plugins/qnx/qnxabstractqtversion.cpp
+++ b/src/plugins/qnx/qnxabstractqtversion.cpp
@@ -97,7 +97,8 @@ void QnxAbstractQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils
{
QtSupport::BaseQtVersion::addToEnvironment(k, env);
updateEnvironment();
- QnxUtils::prependQnxMapToEnvironment(m_envMap, env);
+ env.modify(m_qnxEnv);
+
env.prependOrSetLibrarySearchPath(versionInfo().value(QLatin1String("QT_INSTALL_LIBS")));
}
@@ -107,7 +108,7 @@ Utils::Environment QnxAbstractQtVersion::qmakeRunEnvironment() const
updateEnvironment();
Utils::Environment env = Utils::Environment::systemEnvironment();
- QnxUtils::prependQnxMapToEnvironment(m_envMap, env);
+ env.modify(m_qnxEnv);
return env;
}
@@ -129,7 +130,7 @@ void QnxAbstractQtVersion::setSdkPath(const QString &sdkPath)
void QnxAbstractQtVersion::updateEnvironment() const
{
if (!m_environmentUpToDate) {
- m_envMap = environment();
+ m_qnxEnv = environment();
m_environmentUpToDate = true;
}
}
@@ -139,7 +140,12 @@ QString QnxAbstractQtVersion::qnxHost() const
if (!m_environmentUpToDate)
updateEnvironment();
- return m_envMap.value(QLatin1String(Constants::QNX_HOST_KEY));
+ foreach (const Utils::EnvironmentItem &item, m_qnxEnv) {
+ if (item.name == QLatin1String(Constants::QNX_HOST_KEY))
+ return item.value;
+ }
+
+ return QString();
}
QString QnxAbstractQtVersion::qnxTarget() const
@@ -147,7 +153,12 @@ QString QnxAbstractQtVersion::qnxTarget() const
if (!m_environmentUpToDate)
updateEnvironment();
- return m_envMap.value(QLatin1String(Constants::QNX_TARGET_KEY));
+ foreach (const Utils::EnvironmentItem &item, m_qnxEnv) {
+ if (item.name == QLatin1String(Constants::QNX_TARGET_KEY))
+ return item.value;
+ }
+
+ return QString();
}
QtSupport::QtConfigWidget *QnxAbstractQtVersion::createConfigurationWidget() const
diff --git a/src/plugins/qnx/qnxabstractqtversion.h b/src/plugins/qnx/qnxabstractqtversion.h
index 3f98c0e29b..4236d9d9a3 100644
--- a/src/plugins/qnx/qnxabstractqtversion.h
+++ b/src/plugins/qnx/qnxabstractqtversion.h
@@ -36,6 +36,8 @@
#include <qtsupport/baseqtversion.h>
+#include <utils/environment.h>
+
#include <QCoreApplication>
namespace Qnx {
@@ -78,13 +80,13 @@ protected:
private:
void updateEnvironment() const;
- virtual QMultiMap<QString, QString> environment() const = 0;
+ virtual QList<Utils::EnvironmentItem> environment() const = 0;
QnxArchitecture m_arch;
QString m_sdkPath;
mutable bool m_environmentUpToDate;
- mutable QMultiMap<QString, QString> m_envMap;
+ mutable QList<Utils::EnvironmentItem> m_qnxEnv;
};
} // namespace Internal
diff --git a/src/plugins/qnx/qnxqtversion.cpp b/src/plugins/qnx/qnxqtversion.cpp
index 9ac03c81fa..e134123088 100644
--- a/src/plugins/qnx/qnxqtversion.cpp
+++ b/src/plugins/qnx/qnxqtversion.cpp
@@ -33,6 +33,8 @@
#include "qnxconstants.h"
+#include "qnxutils.h"
+
#include <coreplugin/featureprovider.h>
#include <utils/hostosinfo.h>
@@ -92,35 +94,7 @@ QString QnxQtVersion::sdkDescription() const
return tr("QNX Software Development Platform:");
}
-QMultiMap<QString, QString> QnxQtVersion::environment() const
+QList<Utils::EnvironmentItem> QnxQtVersion::environment() const
{
- // Mimic what the SDP installer puts into the system environment
-
- QMultiMap<QString, QString> environment;
-
- if (Utils::HostOsInfo::isWindowsHost()) {
- // TODO:
- //environment.insert(QLatin1String("QNX_CONFIGURATION"), QLatin1String("/etc/qnx"));
- environment.insert(QLatin1String(Constants::QNX_TARGET_KEY), sdkPath() + QLatin1String("/target/qnx6"));
- environment.insert(QLatin1String(Constants::QNX_HOST_KEY), sdkPath() + QLatin1String("/host/win32/x86"));
-
- environment.insert(QLatin1String("PATH"), sdkPath() + QLatin1String("/host/win32/x86/usr/bin"));
-
- // TODO:
- //environment.insert(QLatin1String("PATH"), QLatin1String("/etc/qnx/bin"));
- } else if (Utils::HostOsInfo::isAnyUnixHost()) {
- environment.insert(QLatin1String("QNX_CONFIGURATION"), QLatin1String("/etc/qnx"));
- environment.insert(QLatin1String(Constants::QNX_TARGET_KEY), sdkPath() + QLatin1String("/target/qnx6"));
- environment.insert(QLatin1String(Constants::QNX_HOST_KEY), sdkPath() + QLatin1String("/host/linux/x86"));
-
- environment.insert(QLatin1String("PATH"), sdkPath() + QLatin1String("/host/linux/x86/usr/bin"));
- environment.insert(QLatin1String("PATH"), QLatin1String("/etc/qnx/bin"));
-
- environment.insert(QLatin1String("LD_LIBRARY_PATH"), sdkPath() + QLatin1String("/host/linux/x86/usr/lib"));
- }
-
- environment.insert(QLatin1String("QNX_JAVAHOME"), sdkPath() + QLatin1String("/_jvm"));
- environment.insert(QLatin1String("MAKEFLAGS"), QLatin1String("-I") + sdkPath() + QLatin1String("/target/qnx6/usr/include"));
-
- return environment;
+ return QnxUtils::qnxEnvironment(sdkPath());
}
diff --git a/src/plugins/qnx/qnxqtversion.h b/src/plugins/qnx/qnxqtversion.h
index 058375a031..16f4862ead 100644
--- a/src/plugins/qnx/qnxqtversion.h
+++ b/src/plugins/qnx/qnxqtversion.h
@@ -60,7 +60,7 @@ public:
QString sdkDescription() const;
private:
- QMultiMap<QString, QString> environment() const;
+ QList<Utils::EnvironmentItem> environment() const;
};
} // namespace Internal
diff --git a/src/plugins/qnx/qnxutils.cpp b/src/plugins/qnx/qnxutils.cpp
index 65099e61e3..60f38e62ad 100644
--- a/src/plugins/qnx/qnxutils.cpp
+++ b/src/plugins/qnx/qnxutils.cpp
@@ -77,13 +77,13 @@ QStringList QnxUtils::searchPaths(QnxAbstractQtVersion *qtVersion)
return searchPaths;
}
-QMultiMap<QString, QString> QnxUtils::parseEnvironmentFile(const QString &fileName)
+QList<Utils::EnvironmentItem> QnxUtils::qnxEnvironmentFromNdkFile(const QString &fileName)
{
- QMultiMap<QString, QString> result;
+ QList <Utils::EnvironmentItem> items;
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly))
- return result;
+ return items;
QTextStream str(&file);
QMap<QString, QString> fileContent;
@@ -171,15 +171,17 @@ QMultiMap<QString, QString> QnxUtils::parseEnvironmentFile(const QString &fileNa
val.replace(keyAsUnixVar, replaceIt.value());
}
}
- result.insert(key, val);
+
+ // This variable will be properly set based on the qt version architecture
+ if (key == QLatin1String("CPUVARDIR"))
+ continue;
+
+ items.append(Utils::EnvironmentItem(key, val));
}
}
}
- if (!result.contains(QLatin1String("CPUVARDIR")))
- result.insert(QLatin1String("CPUVARDIR"), QLatin1String("armle-v7"));
-
- return result;
+ return items;
}
bool QnxUtils::isValidNdkPath(const QString &ndkPath)
@@ -206,23 +208,6 @@ QString QnxUtils::envFilePath(const QString &ndkPath, const QString &targetVersi
return envFile;
}
-void QnxUtils::prependQnxMapToEnvironment(const QMultiMap<QString, QString> &qnxMap, Utils::Environment &env)
-{
- QMultiMap<QString, QString>::const_iterator it;
- QMultiMap<QString, QString>::const_iterator end(qnxMap.constEnd());
- for (it = qnxMap.constBegin(); it != end; ++it) {
- const QString key = it.key();
- const QString value = it.value();
-
- if (key == QLatin1String("PATH"))
- env.prependOrSetPath(value);
- else if (key == QLatin1String("LD_LIBRARY_PATH"))
- env.prependOrSetLibrarySearchPath(value);
- else
- env.set(key, value);
- }
-}
-
Utils::FileName QnxUtils::executableWithExtension(const Utils::FileName &fileName)
{
Utils::FileName result = fileName;
@@ -336,3 +321,36 @@ QString QnxUtils::qdeInstallProcess(const QString &ndkPath, const QString &optio
return QString::fromLatin1("%1 -nosplash -application com.qnx.tools.ide.sdk.manager.core.SDKInstallerApplication "
"%2 %3 -vmargs -Dosgi.console=:none").arg(installerPath, option, version);
}
+
+QList<Utils::EnvironmentItem> QnxUtils::qnxEnvironment(const QString &sdkPath)
+{
+ // Mimic what the SDP installer puts into the system environment
+
+ QList<Utils::EnvironmentItem> environmentItems;
+
+ if (Utils::HostOsInfo::isWindowsHost()) {
+ // TODO:
+ //environment.insert(QLatin1String("QNX_CONFIGURATION"), QLatin1String("/etc/qnx"));
+ environmentItems.append(Utils::EnvironmentItem(QLatin1String(Constants::QNX_TARGET_KEY), sdkPath + QLatin1String("/target/qnx6")));
+ environmentItems.append(Utils::EnvironmentItem(QLatin1String(Constants::QNX_HOST_KEY), sdkPath + QLatin1String("/host/win32/x86")));
+
+ environmentItems.append(Utils::EnvironmentItem(QLatin1String("PATH"), sdkPath + QLatin1String("/host/win32/x86/usr/bin")));
+
+ // TODO:
+ //environment.insert(QLatin1String("PATH"), QLatin1String("/etc/qnx/bin"));
+ } else if (Utils::HostOsInfo::isAnyUnixHost()) {
+ environmentItems.append(Utils::EnvironmentItem(QLatin1String("QNX_CONFIGURATION"), QLatin1String("/etc/qnx")));
+ environmentItems.append(Utils::EnvironmentItem(QLatin1String(Constants::QNX_TARGET_KEY), sdkPath + QLatin1String("/target/qnx6")));
+ environmentItems.append(Utils::EnvironmentItem(QLatin1String(Constants::QNX_HOST_KEY), sdkPath + QLatin1String("/host/linux/x86")));
+
+ environmentItems.append(Utils::EnvironmentItem(QLatin1String("PATH"), sdkPath + QLatin1String("/host/linux/x86/usr/bin")));
+ environmentItems.append(Utils::EnvironmentItem(QLatin1String("PATH"), QLatin1String("/etc/qnx/bin")));
+
+ environmentItems.append(Utils::EnvironmentItem(QLatin1String("LD_LIBRARY_PATH"), sdkPath + QLatin1String("/host/linux/x86/usr/lib")));
+ }
+
+ environmentItems.append(Utils::EnvironmentItem(QLatin1String("QNX_JAVAHOME"), sdkPath + QLatin1String("/_jvm")));
+ environmentItems.append(Utils::EnvironmentItem(QLatin1String("MAKEFLAGS"), QLatin1String("-I") + sdkPath + QLatin1String("/target/qnx6/usr/include")));
+
+ return environmentItems;
+}
diff --git a/src/plugins/qnx/qnxutils.h b/src/plugins/qnx/qnxutils.h
index 7198a31c96..b483bfac42 100644
--- a/src/plugins/qnx/qnxutils.h
+++ b/src/plugins/qnx/qnxutils.h
@@ -62,10 +62,9 @@ public:
static QString addQuotes(const QString &string);
static Qnx::QnxArchitecture cpudirToArch(const QString &cpuDir);
static QStringList searchPaths(QnxAbstractQtVersion *qtVersion);
- static QMultiMap<QString, QString> parseEnvironmentFile(const QString &fileName);
+ static QList<Utils::EnvironmentItem> qnxEnvironmentFromNdkFile(const QString &fileName);
static bool isValidNdkPath(const QString & ndkPath);
static QString envFilePath(const QString & ndkPath, const QString& targetVersion = QString());
- static void prependQnxMapToEnvironment(const QMultiMap<QString, QString> &qnxMap, Utils::Environment &env);
static Utils::FileName executableWithExtension(const Utils::FileName &fileName);
static QString dataDirPath();
static QString qConfigPath();
@@ -73,6 +72,7 @@ public:
static QList<NdkInstallInformation> installedNdks();
static QString sdkInstallerPath(const QString& ndkPath);
static QString qdeInstallProcess(const QString& ndkPath, const QString &option, const QString &version = QString());
+ static QList<Utils::EnvironmentItem> qnxEnvironment(const QString &ndk);
};
} // namespace Internal