Commit 667d6456 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Maemo: By default, strip release binaries.

But never strip debug binaries.

Task-number: QTCREATORBUG-2981
parent 22f03cbd
......@@ -159,8 +159,8 @@ bool MaemoPackageCreationStep::createPackage(QProcess *buildProc)
emit addOutput(tr("Creating package file ..."), MessageOutput);
checkProjectName();
QString error;
if (!preparePackagingProcess(buildProc, maemoToolChain(), buildDirectory(),
&error)) {
if (!preparePackagingProcess(buildProc, qt4BuildConfiguration(),
buildDirectory(), &error)) {
raiseError(error);
return false;
}
......@@ -488,8 +488,14 @@ void MaemoPackageCreationStep::raiseError(const QString &shortMsg,
}
bool MaemoPackageCreationStep::preparePackagingProcess(QProcess *proc,
const MaemoToolChain *tc, const QString &workingDir, QString *error)
const Qt4BuildConfiguration *bc, const QString &workingDir, QString *error)
{
const MaemoToolChain * const tc
= dynamic_cast<const MaemoToolChain *>(bc->toolChain());
if (!tc) {
*error = tr("Build configuration has no Maemo toolchain.");
return false;
}
QFile configFile(tc->targetRoot() % QLatin1String("/config.sh"));
if (!configFile.open(QIODevice::ReadOnly)) {
*error = tr("Cannot open MADDE config file '%1'.")
......@@ -511,6 +517,15 @@ bool MaemoPackageCreationStep::preparePackagingProcess(QProcess *proc,
env.insert(key, tc->targetRoot() % "/bin" % colon % env.value(key));
env.insert(key, path % QLatin1String("madbin") % colon % env.value(key));
if (bc->qmakeBuildConfiguration() & QtVersion::DebugBuild) {
const QLatin1String debOptionsKey("DEB_BUILD_OPTIONS");
QString debOptions = env.value(debOptionsKey);
if (!debOptions.isEmpty())
debOptions += QLatin1Char(' ');
debOptions += QLatin1String("nostrip");
env.insert(debOptionsKey, debOptions);
}
QString perlLib
= QDir::fromNativeSeparators(path % QLatin1String("madlib/perl5"));
#ifdef Q_OS_WIN
......
......@@ -75,8 +75,9 @@ public:
const MaemoToolChain *maemoToolChain() const;
static bool preparePackagingProcess(QProcess *proc, const MaemoToolChain *tc,
const QString &workingDir, QString *error);
static bool preparePackagingProcess(QProcess *proc,
const Qt4BuildConfiguration *bc, const QString &workingDir,
QString *error);
static QString packagingCommand(const MaemoToolChain *tc,
const QString &commandName);
static QString packageName(const ProjectExplorer::Project *project);
......
......@@ -155,13 +155,15 @@ bool MaemoTemplatesManager::createDebianTemplatesIfNecessary(const ProjectExplor
QString error;
const Qt4Target * const qt4Target = qobject_cast<const Qt4Target *>(target);
Q_ASSERT_X(qt4Target, Q_FUNC_INFO, "Target ID does not match actual type.");
const Qt4BuildConfiguration * const bc
= qt4Target->activeBuildConfiguration();
const MaemoToolChain * const tc
= dynamic_cast<MaemoToolChain *>(qt4Target->activeBuildConfiguration()->toolChain());
= dynamic_cast<MaemoToolChain *>(bc->toolChain());
if (!tc) {
qDebug("Maemo target has no Maemo toolchain.");
return false;
}
if (!MaemoPackageCreationStep::preparePackagingProcess(&dh_makeProc, tc,
if (!MaemoPackageCreationStep::preparePackagingProcess(&dh_makeProc, bc,
projectDir.path() + QLatin1Char('/') + PackagingDirName, &error)) {
raiseError(error);
return false;
......@@ -221,7 +223,6 @@ bool MaemoTemplatesManager::adaptRulesFile(const Project *project)
QByteArray rulesContents = rulesFile.readAll();
rulesContents.replace("DESTDIR", "INSTALL_ROOT");
rulesContents.replace("dh_shlibdeps", "# dh_shlibdeps");
rulesContents.replace("dh_strip", "# dh_strip");
// rulesContents.replace("$(MAKE) clean", "# $(MAKE) clean");
// const Qt4Project * const qt4Project
// = static_cast<const Qt4Project *>(project);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment