summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
Diffstat (limited to 'qmake')
-rw-r--r--qmake/Makefile.unix9
-rw-r--r--qmake/Makefile.win328
-rw-r--r--qmake/Makefile.win32-g++7
-rw-r--r--qmake/Makefile.win32-g++-sh7
-rw-r--r--qmake/generators/makefile.h33
-rw-r--r--qmake/generators/metamakefile.cpp3
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.cpp68
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.h1
-rw-r--r--qmake/generators/symbian/symbian_makefile.h85
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp794
-rw-r--r--qmake/generators/symbian/symbiancommon.h94
-rw-r--r--qmake/generators/symbian/symmake.cpp720
-rw-r--r--qmake/generators/symbian/symmake.h32
-rw-r--r--qmake/generators/symbian/symmake_abld.cpp2
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp2
-rw-r--r--qmake/generators/unix/unixmake.cpp41
-rw-r--r--qmake/generators/unix/unixmake.h2
-rw-r--r--qmake/generators/unix/unixmake2.cpp40
-rw-r--r--qmake/option.cpp1
-rw-r--r--qmake/project.cpp19
20 files changed, 1159 insertions, 809 deletions
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index 5e3190d..f4df43d 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -10,7 +10,8 @@ OBJS=project.o property.o main.o makefile.o unixmake2.o unixmake.o \
mingw_make.o option.o winmakefile.o projectgenerator.o \
meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
borland_bmake.o msvc_vcproj.o msvc_nmake.o msvc_objectmodel.o \
- symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o
+ symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o \
+ symbiancommon.o
#qt code
QOBJS=qtextcodec.o qutfcodec.o qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o \
@@ -33,6 +34,7 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge
generators/win32/msvc_objectmodel.cpp generators/win32/msvc_nmake.cpp generators/win32/borland_bmake.cpp \
generators/symbian/symmake.cpp generators/symbian/initprojectdeploy_symbian.cpp \
generators/symbian/symmake_abld.cpp generators/symbian/symmake_sbsv2.cpp \
+ generaters/symbian/symbiancommon.cpp \
$(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp \
$(SOURCE_PATH)/src/corelib/tools/qstring.cpp $(SOURCE_PATH)/src/corelib/io/qfile.cpp \
$(SOURCE_PATH)/src/corelib/io/qtextstream.cpp $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp \
@@ -230,7 +232,7 @@ option.o: option.cpp option.h $(BUILD_PATH)/src/corelib/global/qconfig.cpp
qcryptographichash.o: $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp
-metamakefile.o: generators/metamakefile.cpp
+metamakefile.o: generators/metamakefile.cpp generators/symbian/symbian_makefile.h
$(CXX) -c -o $@ $(CXXFLAGS) generators/metamakefile.cpp
xmloutput.o: generators/xmloutput.cpp
@@ -275,6 +277,9 @@ symmake_abld.o: generators/symbian/symmake_abld.cpp
symmake_sbsv2.o: generators/symbian/symmake_sbsv2.cpp
$(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp
+symbiancommon.o: generators/symbian/symbiancommon.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/symbiancommon.cpp
+
initprojectdeploy_symbian.o: generators/symbian/initprojectdeploy_symbian.cpp
$(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 1f3092a..eaa1fae 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -75,7 +75,7 @@ OBJS = project.obj main.obj makefile.obj unixmake.obj unixmake2.obj mingw
makefiledeps.obj metamakefile.obj xmloutput.obj pbuilder_pbx.obj \
borland_bmake.obj msvc_nmake.obj msvc_vcproj.obj \
msvc_objectmodel.obj symmake.obj initprojectdeploy_symbian.obj \
- symmake_abld.obj symmake_sbsv2.obj
+ symmake_abld.obj symmake_sbsv2.obj symbiancommon.obj
!IFDEF QMAKE_OPENSOURCE_EDITION
CFLAGS = $(CFLAGS) -DQMAKE_OPENSOURCE_EDITION
@@ -196,6 +196,7 @@ clean::
-del symmake.obj
-del symmake_abld.obj
-del symmake_sbsv2.obj
+ -del symbiancommon.obj
-del initprojectdeploy_symbian.obj
-del pbuilder_pbx.obj
-del qxmlstream.obj
@@ -390,6 +391,9 @@ symmake_abld.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp
symmake_sbsv2.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp
$(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp
+symbiancommon.obj: $(SOURCE_PATH)/qmake/generators/symbian/symbiancommon.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symbiancommon.cpp
+
initprojectdeploy_symbian.obj: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp
$(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp
@@ -420,7 +424,7 @@ pbuilder_pbx.obj: $(SOURCE_PATH)/qmake/generators/mac/pbuilder_pbx.cpp
makefiledeps.obj: $(SOURCE_PATH)/qmake/generators/makefiledeps.cpp
$(CXX) $(CXXFLAGS) generators/makefiledeps.cpp
-metamakefile.obj: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp
+metamakefile.obj: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp $(SOURCE_PATH)/qmake/generators/symbian/symbiancommon.obj
$(CXX) $(CXXFLAGS) generators/metamakefile.cpp
xmloutput.obj: $(SOURCE_PATH)/qmake/generators/xmloutput.cpp
diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++
index 41a1d8c..7ed32be 100644
--- a/qmake/Makefile.win32-g++
+++ b/qmake/Makefile.win32-g++
@@ -38,7 +38,7 @@ OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \
makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
borland_bmake.o msvc_nmake.o msvc_vcproj.o \
msvc_objectmodel.o symmake.o initprojectdeploy_symbian.o \
- symmake_abld.o symmake_sbsv2.o
+ symmake_abld.o symmake_sbsv2.o symbiancommon.o
ifdef QMAKE_OPENSOURCE_EDITION
CFLAGS += -DQMAKE_OPENSOURCE_EDITION
@@ -272,6 +272,9 @@ symmake_abld.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp
symmake_sbsv2.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp
$(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp
+symbiancommon.o: $(SOURCE_PATH)/qmake/generators/symbian/symbiancommon.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symbiancommon.cpp
+
initprojectdeploy_symbian.o: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp
$(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp
@@ -299,7 +302,7 @@ pbuilder_pbx.o: $(SOURCE_PATH)/qmake/generators/mac/pbuilder_pbx.cpp
makefiledeps.o: $(SOURCE_PATH)/qmake/generators/makefiledeps.cpp
$(CXX) $(CXXFLAGS) generators/makefiledeps.cpp
-metamakefile.o: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp
+metamakefile.o: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp $(SOURCE_PATH)/qmake/generators/symbian/symbian_makefile.h
$(CXX) $(CXXFLAGS) generators/metamakefile.cpp
xmloutput.o: $(SOURCE_PATH)/qmake/generators/xmloutput.cpp
diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh
index 0b08320..7f33b0f 100644
--- a/qmake/Makefile.win32-g++-sh
+++ b/qmake/Makefile.win32-g++-sh
@@ -38,7 +38,7 @@ OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \
makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
borland_bmake.o msvc_nmake.o msvc_vcproj.o \
msvc_objectmodel.o symmake.o initprojectdeploy_symbian.o \
- symmake_abld.o symmake_sbsv2.o
+ symmake_abld.o symmake_sbsv2.o symbiancommon.o
ifdef QMAKE_OPENSOURCE_EDITION
CFLAGS += -DQMAKE_OPENSOURCE_EDITION
@@ -271,6 +271,9 @@ symmake_abld.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp
symmake_sbsv2.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp
$(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp
+symbiancommon.o: $(SOURCE_PATH)/qmake/generators/symbian/symbiancommon.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symbiancommon.cpp
+
initprojectdeploy_symbian.o: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp
$(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp
@@ -298,7 +301,7 @@ pbuilder_pbx.o: $(SOURCE_PATH)/qmake/generators/mac/pbuilder_pbx.cpp
makefiledeps.o: $(SOURCE_PATH)/qmake/generators/makefiledeps.cpp
$(CXX) $(CXXFLAGS) generators/makefiledeps.cpp
-metamakefile.o: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp
+metamakefile.o: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp $(SOURCE_PATH)/qmake/generators/symbian/symbian_makefile.h
$(CXX) $(CXXFLAGS) generators/metamakefile.cpp
xmloutput.o: $(SOURCE_PATH)/qmake/generators/xmloutput.cpp
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index d89c3b1..85510ea 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -248,6 +248,39 @@ public:
virtual bool mergeBuildProject(MakefileGenerator * /*other*/) { return false; }
virtual bool openOutput(QFile &, const QString &build) const;
virtual bool isWindowsShell() const { return Option::target_mode == Option::TARG_WIN_MODE; }
+
+ /* The next one is to avoid having SymbianCommonGenerator as a virtually
+ inherited class of this class. Instead it is without a base class
+ (avoiding the virtual inheritance problem), and is allowed to use
+ functions defined in here.
+
+ To illustrate:
+ +-------------------+
+ | MakefileGenerator |
+ +-------------------+
+ ^ ^
+ | |
+ | X <-- Avoid this inheritance
+ | |
+ +------------------------+ +------------------------+
+ | UnixMakefileGenerator | | SymbianCommonGenerator |
+ | or | | |
+ | NmakeMakefileGenerator | | |
+ +------------------------+ +------------------------+
+ ^ ^
+ | |
+ | |
+ | |
+ +-----------------------------+
+ | SymbianMakefileTemplate<> |
+ +-----------------------------+
+
+ We want to avoid the famous diamond problem, because if we have that, we need
+ virtual inheritance, which not all compilers like. Therefore, we break the
+ link as illustrated. Instead, we have a pointer to MakefileGenerator inside
+ SymbianCommonGenerator, and allows full access by making it a friend here.
+ */
+ friend class SymbianCommonGenerator;
};
inline void MakefileGenerator::setNoIO(bool o)
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index f48491c..dc3bbc7 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -435,6 +435,7 @@ QT_BEGIN_INCLUDE_NAMESPACE
#include "msvc_vcproj.h"
#include "symmake_abld.h"
#include "symmake_sbsv2.h"
+#include "symbian_makefile.h"
QT_END_INCLUDE_NAMESPACE
MakefileGenerator *
@@ -468,6 +469,8 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO)
mkfile = new SymbianAbldMakefileGenerator;
} else if(gen == "SYMBIAN_SBSV2") {
mkfile = new SymbianSbsv2MakefileGenerator;
+ } else if(gen == "SYMBIAN_UNIX") {
+ mkfile = new SymbianMakefileTemplate<UnixMakefileGenerator>;
} else {
fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData());
}
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
index 7279a4c..6a7f128 100644
--- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
@@ -46,12 +46,18 @@
#include <qsettings.h>
#include <qdebug.h>
-#define SYSBIN_DIR "\\sys\\bin"
+#define SYSBIN_DIR "/sys/bin"
#define SUFFIX_DLL "dll"
#define SUFFIX_EXE "exe"
#define SUFFIX_QTPLUGIN "qtplugin"
+static QString fixPathToEpocOS(const QString &src)
+{
+ QString ret = Option::fixPathToTargetOS(src);
+ return ret.replace('/', '\\');
+}
+
static void fixEpocRootStr(QString& path)
{
path.replace("\\", "/");
@@ -175,12 +181,12 @@ static void createPluginStub(const QFileInfo& info,
QStringList& generatedDirs,
QStringList& generatedFiles)
{
- QDir().mkpath(PLUGIN_STUB_DIR);
+ QDir().mkpath(QLatin1String(PLUGIN_STUB_DIR));
if (!generatedDirs.contains(PLUGIN_STUB_DIR))
generatedDirs << PLUGIN_STUB_DIR;
// Plugin stubs must have different name from the actual plugins, because
// the toolchain for creating ROM images cannot handle non-binary .dll files properly.
- QFile stubFile(QDir(PLUGIN_STUB_DIR).filePath(info.completeBaseName() + "." SUFFIX_QTPLUGIN));
+ QFile stubFile(QDir::toNativeSeparators(QLatin1String(PLUGIN_STUB_DIR "/") + info.completeBaseName() + "." SUFFIX_QTPLUGIN));
if (stubFile.open(QIODevice::WriteOnly)) {
if (!generatedFiles.contains(stubFile.fileName()))
generatedFiles << stubFile.fileName();
@@ -194,7 +200,7 @@ static void createPluginStub(const QFileInfo& info,
}
QFileInfo stubInfo(stubFile);
deploymentList.append(CopyItem(Option::fixPathToLocalOS(stubInfo.absoluteFilePath()),
- Option::fixPathToLocalOS(devicePath + "\\" + stubInfo.fileName())));
+ fixPathToEpocOS(devicePath + "/" + stubInfo.fileName())));
}
QString generate_uid(const QString& target)
@@ -239,6 +245,7 @@ void initProjectDeploySymbian(QMakeProject* project,
DeploymentList &deploymentList,
const QString &testPath,
bool deployBinaries,
+ bool epocBuild,
const QString &platform,
const QString &build,
QStringList& generatedDirs,
@@ -281,13 +288,13 @@ void initProjectDeploySymbian(QMakeProject* project,
|| devicePath.at(0) == QLatin1Char('\\')
|| devicePathHasDriveLetter)) {
// create output path
- devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char('\\') + devicePath));
+ devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char('/') + devicePath));
} else {
if (0 == platform.compare(QLatin1String("winscw"), Qt::CaseInsensitive)) {
if (devicePathHasDriveLetter) {
- devicePath = epocRoot() + "epoc32\\winscw\\" + devicePath.remove(1, 1);
+ devicePath = epocRoot() + "epoc32/winscw/" + devicePath.remove(1, 1);
} else {
- devicePath = epocRoot() + "epoc32\\winscw\\c" + devicePath;
+ devicePath = epocRoot() + "epoc32/winscw/c" + devicePath;
}
} else {
// Drive letter needed if targetpath contains one and it is not already in
@@ -297,7 +304,7 @@ void initProjectDeploySymbian(QMakeProject* project,
}
}
- devicePath.replace(QLatin1String("/"), QLatin1String("\\"));
+ devicePath.replace(QLatin1String("\\"), QLatin1String("/"));
if (!deployBinaries &&
0 == devicePath.right(8).compare(QLatin1String(SYSBIN_DIR), Qt::CaseInsensitive)) {
@@ -321,7 +328,7 @@ void initProjectDeploySymbian(QMakeProject* project,
dirSearch = true;
} else {
if (info.exists() || source.indexOf('*') != -1) {
- nameFilter = source.split('\\').last();
+ nameFilter = source.split(QDir::separator()).last();
searchPath = info.absolutePath();
} else {
// Entry was not found. That is ok if it is a binary, since those do not necessarily yet exist.
@@ -329,13 +336,23 @@ void initProjectDeploySymbian(QMakeProject* project,
if (isBinary(info)) {
if (deployBinaries) {
// Executables and libraries are deployed to \sys\bin
- QFileInfo releasePath(epocRoot() + QDir::toNativeSeparators("epoc32/release/" + platform + "/" + build + "/"));
+ QFileInfo targetPath;
+ if (epocBuild)
+ targetPath.setFile(epocRoot() + "epoc32/release/" + platform + "/" + build + "/");
+ else
+ targetPath.setFile(info.path() + QDir::separator());
if(devicePathHasDriveLetter) {
- deploymentList.append(CopyItem(Option::fixPathToLocalOS(QDir(releasePath.absolutePath()).filePath(info.fileName()), false, true),
- Option::fixPathToLocalOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "\\") + info.fileName())));
+ deploymentList.append(CopyItem(
+ Option::fixPathToLocalOS(targetPath.absolutePath() + "/" + info.fileName(),
+ false, true),
+ fixPathToEpocOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "/")
+ + info.fileName())));
} else {
- deploymentList.append(CopyItem(Option::fixPathToLocalOS(QDir(releasePath.absolutePath()).filePath(info.fileName()), false, true),
- Option::fixPathToLocalOS(deploymentDrive + QLatin1String(SYSBIN_DIR "\\") + info.fileName())));
+ deploymentList.append(CopyItem(
+ Option::fixPathToLocalOS(targetPath.absolutePath() + "/" + info.fileName(),
+ false, true),
+ fixPathToEpocOS(deploymentDrive + QLatin1String(SYSBIN_DIR "/")
+ + info.fileName())));
}
}
if (isPlugin(info, devicePath)) {
@@ -346,7 +363,7 @@ void initProjectDeploySymbian(QMakeProject* project,
// Generate deployment even if file doesn't exist, as this may be the case
// when generating .pkg files.
deploymentList.append(CopyItem(Option::fixPathToLocalOS(info.absoluteFilePath()),
- Option::fixPathToLocalOS(devicePath + "\\" + info.fileName())));
+ fixPathToEpocOS(devicePath + "/" + info.fileName())));
continue;
}
}
@@ -368,14 +385,25 @@ void initProjectDeploySymbian(QMakeProject* project,
// This deploys pre-built plugins. Other pre-built binaries will deploy normally,
// as they have SYSBIN_DIR target path.
if (deployBinaries) {
- deploymentList.append(CopyItem(Option::fixPathToLocalOS(absoluteItemPath + "\\" + iterator.fileName()),
- Option::fixPathToLocalOS(deploymentDrive + QLatin1String(SYSBIN_DIR "\\") + iterator.fileName())));
+ if (devicePathHasDriveLetter) {
+ deploymentList.append(CopyItem(
+ Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()),
+ fixPathToEpocOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "/")
+ + iterator.fileName())));
+ } else {
+ deploymentList.append(CopyItem(
+ Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()),
+ fixPathToEpocOS(deploymentDrive + QLatin1String(SYSBIN_DIR "/")
+ + iterator.fileName())));
+ }
}
- createPluginStub(info, devicePath + "\\" + absoluteItemPath.right(diffSize), deploymentList, generatedDirs, generatedFiles);
+ createPluginStub(info, devicePath + "/" + absoluteItemPath.right(diffSize), deploymentList, generatedDirs, generatedFiles);
continue;
} else {
- deploymentList.append(CopyItem(Option::fixPathToLocalOS(absoluteItemPath + "\\" + iterator.fileName()),
- Option::fixPathToLocalOS(devicePath + "\\" + absoluteItemPath.right(diffSize) + "\\" + iterator.fileName())));
+ deploymentList.append(CopyItem(
+ Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()),
+ fixPathToEpocOS(devicePath + "/" + absoluteItemPath.right(diffSize)
+ + "/" + iterator.fileName())));
}
}
}
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.h b/qmake/generators/symbian/initprojectdeploy_symbian.h
index e23e6a9..3c515d6 100644
--- a/qmake/generators/symbian/initprojectdeploy_symbian.h
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.h
@@ -69,6 +69,7 @@ extern void initProjectDeploySymbian(QMakeProject* project,
DeploymentList &deploymentList,
const QString &testPath,
bool deployBinaries,
+ bool epocBuild,
const QString &platform,
const QString &build,
QStringList& generatedDirs,
diff --git a/qmake/generators/symbian/symbian_makefile.h b/qmake/generators/symbian/symbian_makefile.h
new file mode 100644
index 0000000..532ab89
--- /dev/null
+++ b/qmake/generators/symbian/symbian_makefile.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the qmake application of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SYMBIAN_MAKEFILE_H
+#define SYMBIAN_MAKEFILE_H
+
+#include "symbiancommon.h"
+
+// This allows us to reuse the code for both win32 and unix makefile generators.
+template <class T>
+class SymbianMakefileTemplate : public T, public SymbianCommonGenerator
+{
+public:
+ SymbianMakefileTemplate() : SymbianCommonGenerator(this) {}
+
+ void init()
+ {
+ T::init();
+ SymbianCommonGenerator::init();
+ }
+
+ bool writeMakefile(QTextStream &t)
+ {
+ QString numberOfIcons;
+ QString iconFile;
+ QStringList userRssRules;
+ readRssRules(numberOfIcons, iconFile, userRssRules);
+
+ DeploymentList depList;
+ generatePkgFile(iconFile, depList, false);
+
+ // Get the application translations and convert to symbian OS lang code, i.e. decical number
+ QStringList symbianLangCodes = symbianLangCodesFromTsFiles();
+
+ if (targetType == TypeExe) {
+ if (!this->project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {
+ writeRegRssFile(userRssRules);
+ writeRssFile(numberOfIcons, iconFile);
+ writeLocFile(symbianLangCodes);
+ }
+ }
+
+ return T::writeMakefile(t);
+ }
+};
+
+#endif // SYMBIAN_MAKEFILE_H
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
new file mode 100644
index 0000000..4c8253f
--- /dev/null
+++ b/qmake/generators/symbian/symbiancommon.cpp
@@ -0,0 +1,794 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the qmake application of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "symbiancommon.h"
+#include <qdebug.h>
+
+#define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\"
+
+#define RSS_RULES "RSS_RULES"
+#define RSS_RULES_BASE "RSS_RULES."
+#define RSS_TAG_NBROFICONS "number_of_icons"
+#define RSS_TAG_ICONFILE "icon_file"
+
+#define MANUFACTURER_NOTE_FILE "manufacturer_note.txt"
+#define DEFAULT_MANUFACTURER_NOTE \
+ "The package is not supported for devices from this manufacturer. Please try the selfsigned " \
+ "version of the package instead."
+
+SymbianCommonGenerator::SymbianCommonGenerator(MakefileGenerator *generator)
+ : generator(generator)
+{
+}
+
+void SymbianCommonGenerator::init()
+{
+ QMakeProject *project = generator->project;
+ fixedTarget = generator->escapeFilePath(project->first("TARGET"));
+ fixedTarget = removePathSeparators(fixedTarget);
+ removeSpecialCharacters(fixedTarget);
+
+ // This should not be empty since the mkspecs are supposed to set it if missing.
+ uid3 = project->first("TARGET.UID3").trimmed();
+
+ if ((project->values("TEMPLATE")).contains("app"))
+ targetType = TypeExe;
+ else if ((project->values("TEMPLATE")).contains("lib")) {
+ // Check CONFIG to see if we are to build staticlib or dll
+ if (project->isActiveConfig("staticlib") || project->isActiveConfig("static"))
+ targetType = TypeLib;
+ else if (project->isActiveConfig("plugin"))
+ targetType = TypePlugin;
+ else
+ targetType = TypeDll;
+ } else {
+ targetType = TypeSubdirs;
+ }
+
+ // UID is valid as either hex or decimal, so just convert it to number and back to hex
+ // to get proper string for private dir
+ bool conversionOk = false;
+ uint uidNum = uid3.toUInt(&conversionOk, 0);
+
+ if (!conversionOk) {
+ fprintf(stderr, "Error: Invalid UID \"%s\".\n", uid3.toUtf8().constData());
+ } else {
+ privateDirUid.setNum(uidNum, 16);
+ while (privateDirUid.length() < 8)
+ privateDirUid.insert(0, QLatin1Char('0'));
+ }
+}
+
+bool SymbianCommonGenerator::containsStartWithItem(const QChar &c, const QStringList& src)
+{
+ bool result = false;
+ foreach(QString str, src) {
+ if (str.startsWith(c)) {
+ result = true;
+ break;
+ }
+ }
+ return result;
+}
+
+void SymbianCommonGenerator::removeSpecialCharacters(QString& str)
+{
+ // When modifying this method check also application_icon.prf
+ str.replace(QString("/"), QString("_"));
+ str.replace(QString("\\"), QString("_"));
+ str.replace(QString("-"), QString("_"));
+ str.replace(QString(":"), QString("_"));
+ str.replace(QString("."), QString("_"));
+ str.replace(QString(" "), QString("_"));
+}
+
+void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, DeploymentList &depList, bool epocBuild)
+{
+ QMakeProject *project = generator->project;
+ QString pkgFilename = QString("%1_template.%2").arg(fixedTarget).arg("pkg");
+ if (!Option::output_dir.isEmpty())
+ pkgFilename = Option::output_dir + '/' + pkgFilename;
+
+ QFile pkgFile(pkgFilename);
+ if (!pkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ PRINT_FILE_CREATE_ERROR(pkgFilename);
+ return;
+ }
+
+ generatedFiles << pkgFile.fileName();
+ QTextStream t(&pkgFile);
+
+ QString installerSisHeader = project->values("DEPLOYMENT.installer_header").join("\n");
+ QString wrapperStreamBuffer;
+ QTextStream tw(&wrapperStreamBuffer);
+
+ QString dateStr = QDateTime::currentDateTime().toString(Qt::ISODate);
+
+ // Header info
+ QString wrapperPkgFilename = QString("%1_installer.%2")
+ .arg(fixedTarget)
+ .arg("pkg");
+ QString headerComment = "; %1 generated by qmake at %2\n"
+ "; This file is generated by qmake and should not be modified by the user\n"
+ ";\n\n";
+ t << headerComment.arg(pkgFilename).arg(dateStr);
+ tw << headerComment.arg(wrapperPkgFilename).arg(dateStr);
+
+ // Construct QStringList from pkg_prerules since we need search it before printed to file
+ QStringList rawPkgPreRules;
+ foreach(QString deploymentItem, project->values("DEPLOYMENT")) {
+ foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_prerules")) {
+ QStringList pkgrulesValue = project->values(pkgrulesItem);
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line mmp statements
+ if (pkgrulesValue.isEmpty()) {
+ rawPkgPreRules << pkgrulesItem;
+ } else {
+ foreach(QString pkgrule, pkgrulesValue) {
+ rawPkgPreRules << pkgrule;
+ }
+ }
+ }
+ }
+
+ // Apply some defaults if specific data does not exist in PKG pre-rules
+
+ if (!containsStartWithItem('&', rawPkgPreRules)) {
+ // language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS)
+ QString languageCode = "; Language\n&EN\n\n";
+ t << languageCode;
+ tw << languageCode;
+ } else {
+ // In case user defines langs, he must take care also about SIS header
+ if (!containsStartWithItem('#', rawPkgPreRules))
+ fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n");
+ }
+
+ // name of application, UID and version
+ QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ',');
+ QString sisHeader = "; SIS header: name, uid, version\n#{\"%1\"},(%2),%3\n\n";
+ QString visualTarget = generator->escapeFilePath(generator->fileFixify(project->first("TARGET")));
+ visualTarget = removePathSeparators(visualTarget);
+ QString wrapperTarget = visualTarget + " installer";
+
+ if (installerSisHeader.startsWith("0x", Qt::CaseInsensitive)) {
+ tw << sisHeader.arg(wrapperTarget).arg(installerSisHeader).arg(applicationVersion);
+ } else {
+ tw << installerSisHeader << endl;
+ }
+ if (!containsStartWithItem('#', rawPkgPreRules)) {
+ t << sisHeader.arg(visualTarget).arg(uid3).arg(applicationVersion);
+ }
+
+ // Localized vendor name
+ QString vendorName;
+ if (!containsStartWithItem('%', rawPkgPreRules)) {
+ vendorName += "; Localised Vendor name\n%{\"Vendor\"}\n\n";
+ }
+
+ // Unique vendor name
+ if (!containsStartWithItem(':', rawPkgPreRules)) {
+ vendorName += "; Unique Vendor name\n:\"Vendor\"\n\n";
+ }
+
+ t << vendorName;
+ tw << vendorName;
+
+ // PKG pre-rules - these are added before actual file installations i.e. SIS package body
+ if (rawPkgPreRules.size()) {
+ QString comment = "\n; Manual PKG pre-rules from PRO files\n";
+ t << comment;
+ tw << comment;
+
+ foreach(QString item, rawPkgPreRules) {
+ // Only regular pkg file should have package dependencies or pkg header if that is
+ // defined using prerules.
+ if (!item.startsWith("(") && !item.startsWith("#")) {
+ tw << item << endl;
+ }
+ t << item << endl;
+ }
+ t << endl;
+ tw << endl;
+ }
+
+ // Begin Manufacturer block
+ if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) {
+ QString manufacturerStr("IF ");
+ foreach(QString manufacturer, project->values("DEPLOYMENT.manufacturers")) {
+ manufacturerStr.append(QString("(MANUFACTURER)=(%1) OR \n ").arg(manufacturer));
+ }
+ // Remove the final OR
+ manufacturerStr.chop(8);
+ t << manufacturerStr << endl;
+ }
+
+ // Install paths on the phone *** should be dynamic at some point
+ QString installPathBin = "!:\\sys\\bin";
+ QString installPathResource = "!:\\resource\\apps";
+ QString installPathRegResource = "!:\\private\\10003a3f\\import\\apps";
+
+ // Find location of builds
+ QString destDirBin;
+ QString destDirResource;
+ QString destDirRegResource;
+ if (epocBuild) {
+ destDirBin = QString("%1epoc32/release/$(PLATFORM)/$(TARGET)").arg(epocRoot());
+ destDirResource = QString("%1epoc32/data/z/resource/apps").arg(epocRoot());
+ destDirRegResource = QString("%1epoc32/data/z/private/10003a3f/import/apps").arg(epocRoot());
+ } else {
+ destDirBin = project->first("DESTDIR");
+ if (destDirBin.isEmpty())
+ destDirBin = ".";
+ else if (destDirBin.endsWith('/') || destDirBin.endsWith('\\'))
+ destDirBin.chop(1);
+ destDirResource = destDirBin;
+ destDirRegResource = destDirBin;
+ }
+
+ if (targetType == TypeExe) {
+ // deploy .exe file
+ t << "; Executable and default resource files" << endl;
+ QString exeFile = fixedTarget + ".exe";
+ t << QString("\"%1/%2\" - \"%3\\%4\"")
+ .arg(destDirBin)
+ .arg(exeFile)
+ .arg(installPathBin)
+ .arg(exeFile) << endl;
+
+ // deploy rsc & reg_rsc file
+ if (!project->isActiveConfig("no_icon")) {
+ t << QString("\"%1/%2\" - \"%3\\%4\"")
+ .arg(destDirResource)
+ .arg(fixedTarget + ".rsc")
+ .arg(installPathResource)
+ .arg(fixedTarget + ".rsc") << endl;
+
+ t << QString("\"%1/%2\" - \"%3\\%4\"")
+ .arg(destDirRegResource)
+ .arg(fixedTarget + "_reg.rsc")
+ .arg(installPathRegResource)
+ .arg(fixedTarget + "_reg.rsc") << endl;
+
+ if (!iconFile.isEmpty()) {
+ if (epocBuild) {
+ t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"")
+ .arg(epocRoot())
+ .arg(iconFile)
+ .arg(QDir::toNativeSeparators(iconFile)) << endl << endl;
+ } else {
+ QDir mifIconDir(project->first("DESTDIR"));
+ QFileInfo mifIcon(mifIconDir.relativeFilePath(project->first("TARGET")));
+ QString mifIconFileName = mifIcon.fileName();
+ mifIconFileName.replace(QRegExp("[-: .]"), "_");
+ mifIconFileName.append(".mif");
+ t << QString("\"%1/%2\" - \"!:%3\"")
+ .arg(mifIcon.path())
+ .arg(mifIconFileName)
+ .arg(QDir::toNativeSeparators(iconFile)) << endl << endl;
+ }
+ }
+ }
+ }
+
+ // deploy any additional DEPLOYMENT files
+ QString remoteTestPath;
+ remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid);
+
+ initProjectDeploySymbian(project, depList, remoteTestPath, true, epocBuild, "$(PLATFORM)", "$(TARGET)", generatedDirs, generatedFiles);
+ if (depList.size())
+ t << "; DEPLOYMENT" << endl;
+ for (int i = 0; i < depList.size(); ++i) {
+ t << QString("\"%1\" - \"%2\"")
+ .arg(depList.at(i).from)
+ .arg(depList.at(i).to) << endl;
+ }
+ t << endl;
+
+ // PKG post-rules - these are added after actual file installations i.e. SIS package body
+ t << "; Manual PKG post-rules from PRO files" << endl;
+ foreach(QString deploymentItem, project->values("DEPLOYMENT")) {
+ foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_postrules")) {
+ QStringList pkgrulesValue = project->values(pkgrulesItem);
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line statements
+ if (pkgrulesValue.isEmpty()) {
+ t << pkgrulesItem << endl;
+ } else {
+ foreach(QString pkgrule, pkgrulesValue) {
+ t << pkgrule << endl;
+ }
+ }
+ t << endl;
+ }
+ }
+
+ // Close Manufacturer block
+ if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) {
+ QString manufacturerFailNoteFile;
+ if (project->values("DEPLOYMENT.manufacturers.fail_note").isEmpty()) {
+ manufacturerFailNoteFile = QString("%1_" MANUFACTURER_NOTE_FILE).arg(uid3);
+ QFile ft(manufacturerFailNoteFile);
+ if (ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t2(&ft);
+
+ t2 << QString(DEFAULT_MANUFACTURER_NOTE) << endl;
+ } else {
+ PRINT_FILE_CREATE_ERROR(manufacturerFailNoteFile)
+ }
+ } else {
+ manufacturerFailNoteFile = project->values("DEPLOYMENT.manufacturers.fail_note").join("");
+ }
+
+ t << "ELSEIF NOT(0) ; MANUFACTURER" << endl
+ << "\"" << generator->fileInfo(manufacturerFailNoteFile).absoluteFilePath() << "\""
+ << " - \"\", FILETEXT, TEXTEXIT" << endl
+ << "ENDIF ; MANUFACTURER" << endl;
+ }
+
+ // Write wrapper pkg
+ if (!installerSisHeader.isEmpty()) {
+ QFile wrapperPkgFile(wrapperPkgFilename);
+ if (!wrapperPkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ PRINT_FILE_CREATE_ERROR(wrapperPkgFilename);
+ return;
+ }
+
+ generatedFiles << wrapperPkgFile.fileName();
+ QTextStream twf(&wrapperPkgFile);
+
+ twf << wrapperStreamBuffer << endl;
+
+ // Wrapped files deployment
+ QString currentPath = qmake_getpwd();
+ QString sisName = QString("%1.sis").arg(fixedTarget);
+ twf << "\"" << currentPath << "/" << sisName << "\" - \"c:\\adm\\" << sisName << "\"" << endl;
+
+ QString bootStrapPath = QLibraryInfo::location(QLibraryInfo::PrefixPath);
+ bootStrapPath.append("/bootstrap.sis");
+ QFileInfo fi(generator->fileInfo(bootStrapPath));
+ twf << "@\"" << fi.absoluteFilePath() << "\",(0x2002CCCD)" << endl;
+ }
+}
+
+QString SymbianCommonGenerator::removePathSeparators(QString &file)
+{
+ QString ret = file;
+ while (ret.indexOf(QDir::separator()) > 0) {
+ ret.remove(0, ret.indexOf(QDir::separator()) + 1);
+ }
+
+ return ret;
+}
+
+void SymbianCommonGenerator::writeRegRssFile(QStringList &userItems)
+{
+ QString filename(fixedTarget);
+ filename.append("_reg.rss");
+ if (!Option::output_dir.isEmpty())
+ filename = Option::output_dir + '/' + filename;
+ QFile ft(filename);
+ if (ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t(&ft);
+ t << "// ============================================================================" << endl;
+ t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "// * This file is generated by qmake and should not be modified by the" << endl;
+ t << "// * user." << endl;
+ t << "// ============================================================================" << endl;
+ t << endl;
+ t << "#include <" << fixedTarget << ".rsg>" << endl;
+ t << "#include <appinfo.rh>" << endl;
+ t << endl;
+ t << "UID2 KUidAppRegistrationResourceFile" << endl;
+ t << "UID3 " << uid3 << endl << endl;
+ t << "RESOURCE APP_REGISTRATION_INFO" << endl;
+ t << "\t{" << endl;
+ t << "\tapp_file=\"" << fixedTarget << "\";" << endl;
+ t << "\tlocalisable_resource_file=\"" RESOURCE_DIRECTORY_RESOURCE << fixedTarget << "\";" << endl;
+ t << endl;
+
+ foreach(QString item, userItems)
+ t << "\t" << item << endl;
+ t << "\t}" << endl;
+ } else {
+ PRINT_FILE_CREATE_ERROR(filename)
+ }
+}
+
+void SymbianCommonGenerator::writeRssFile(QString &numberOfIcons, QString &iconFile)
+{
+ QString filename(fixedTarget);
+ if (!Option::output_dir.isEmpty())
+ filename = Option::output_dir + '/' + filename;
+ filename.append(".rss");
+ QFile ft(filename);
+ if (ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t(&ft);
+ t << "// ============================================================================" << endl;
+ t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "// * This file is generated by qmake and should not be modified by the" << endl;
+ t << "// * user." << endl;
+ t << "// ============================================================================" << endl;
+ t << endl;
+ t << "#include <appinfo.rh>" << endl;
+ t << "#include \"" << fixedTarget << ".loc\"" << endl;
+ t << endl;
+ t << "RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info" << endl;
+ t << "\t{" << endl;
+ t << "\tshort_caption = STRING_r_short_caption;" << endl;
+ t << "\tcaption_and_icon =" << endl;
+ t << "\tCAPTION_AND_ICON_INFO" << endl;
+ t << "\t\t{" << endl;
+ t << "\t\tcaption = STRING_r_caption;" << endl;
+
+ QString rssIconFile = iconFile;
+ rssIconFile = rssIconFile.replace("/", "\\\\");
+
+ if (numberOfIcons.isEmpty() || rssIconFile.isEmpty()) {
+ // There can be maximum one item in this tag, validated when parsed
+ t << "\t\tnumber_of_icons = 0;" << endl;
+ t << "\t\ticon_file = \"\";" << endl;
+ } else {
+ // There can be maximum one item in this tag, validated when parsed
+ t << "\t\tnumber_of_icons = " << numberOfIcons << ";" << endl;
+ t << "\t\ticon_file = \"" << rssIconFile << "\";" << endl;
+ }
+ t << "\t\t};" << endl;
+ t << "\t}" << endl;
+ t << endl;
+ } else {
+ PRINT_FILE_CREATE_ERROR(filename);
+ }
+}
+
+void SymbianCommonGenerator::writeLocFile(QStringList &symbianLangCodes)
+{
+ QString filename(fixedTarget);
+ if (!Option::output_dir.isEmpty())
+ filename = Option::output_dir + '/' + filename;
+ filename.append(".loc");
+ QFile ft(filename);
+ if (ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t(&ft);
+ t << "// ============================================================================" << endl;
+ t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "// * This file is generated by qmake and should not be modified by the" << endl;
+ t << "// * user." << endl;
+ t << "// ============================================================================" << endl;
+ t << endl;
+ t << "#ifdef LANGUAGE_SC" << endl;
+ t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl;
+ t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl;
+ foreach(QString lang, symbianLangCodes) {
+ t << "#elif defined LANGUAGE_" << lang << endl;
+ t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl;
+ t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl;
+ }
+ t << "#else" << endl;
+ t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl;
+ t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl;
+ t << "#endif" << endl;
+ } else {
+ PRINT_FILE_CREATE_ERROR(filename);
+ }
+}
+
+void SymbianCommonGenerator::readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules)
+{
+ QMakeProject *project = generator->project;
+ for (QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) {
+ if (it.key().startsWith(RSS_RULES_BASE)) {
+ QString newKey = it.key().mid(sizeof(RSS_RULES_BASE) - 1);
+ if (newKey.isEmpty()) {
+ fprintf(stderr, "Warning: Empty RSS_RULES_BASE key encountered\n");
+ continue;
+ }
+ QStringList newValues;
+ QStringList values = it.value();
+ foreach(QString item, values) {
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line statements
+ if (project->values(item).isEmpty()) {
+ newValues << item;
+ } else {
+ foreach(QString itemRow, project->values(item)) {
+ newValues << itemRow;
+ }
+ }
+ }
+ // Verify thet there is exactly one value in RSS_TAG_NBROFICONS
+ if (newKey == RSS_TAG_NBROFICONS) {
+ if (newValues.count() == 1) {
+ numberOfIcons = newValues[0];
+ } else {
+ fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n",
+ RSS_RULES_BASE, RSS_TAG_NBROFICONS);
+ continue;
+ }
+ // Verify thet there is exactly one value in RSS_TAG_ICONFILE
+ } else if (newKey == RSS_TAG_ICONFILE) {
+ if (newValues.count() == 1) {
+ iconFile = newValues[0];
+ } else {
+ fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n",
+ RSS_RULES_BASE, RSS_TAG_ICONFILE);
+ continue;
+ }
+ } else {
+ fprintf(stderr, "Warning: Unsupported key:'%s%s'\n",
+ RSS_RULES_BASE, newKey.toLatin1().constData());
+ continue;
+ }
+ }
+ }
+
+ foreach(QString item, project->values(RSS_RULES)) {
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line mmp statements
+ if (project->values(item).isEmpty()) {
+ userRssRules << item;
+ } else {
+ userRssRules << project->values(item);
+ }
+ }
+
+ // Validate that either both RSS_TAG_NBROFICONS and RSS_TAG_ICONFILE keys exist
+ // or neither of them exist
+ if (!((numberOfIcons.isEmpty() && iconFile.isEmpty()) ||
+ (!numberOfIcons.isEmpty() && !iconFile.isEmpty()))) {
+ numberOfIcons.clear();
+ iconFile.clear();
+ fprintf(stderr, "Warning: Both or neither of '%s%s' and '%s%s' keys must exist.\n",
+ RSS_RULES_BASE, RSS_TAG_NBROFICONS, RSS_RULES_BASE, RSS_TAG_ICONFILE);
+ }
+
+ // Validate that RSS_TAG_NBROFICONS contains only numbers
+ if (!numberOfIcons.isEmpty()) {
+ bool ok;
+ numberOfIcons = numberOfIcons.simplified();
+ numberOfIcons.toInt(&ok);
+ if (!ok) {
+ numberOfIcons.clear();
+ iconFile.clear();
+ fprintf(stderr, "Warning: '%s%s' must be integer in decimal format.\n",
+ RSS_RULES_BASE, RSS_TAG_NBROFICONS);
+ }
+ }
+}
+
+QStringList SymbianCommonGenerator::symbianLangCodesFromTsFiles()
+{
+ QStringList tsfiles;
+ QStringList symbianLangCodes;
+ tsfiles << generator->project->values("TRANSLATIONS");
+
+ fillQt2S60LangMapTable();
+
+ foreach(QString file, tsfiles) {
+ int extIndex = file.lastIndexOf(".");
+ int langIndex = file.lastIndexOf("_", (extIndex - file.length()));
+ langIndex += 1;
+ QString qtlang = file.mid(langIndex, extIndex - langIndex);
+ QString s60lang = qt2S60LangMapTable.value(qtlang, QString("SC"));
+
+ if (!symbianLangCodes.contains(s60lang) && s60lang != "SC")
+ symbianLangCodes += s60lang;
+ }
+
+ return symbianLangCodes;
+}
+
+void SymbianCommonGenerator::fillQt2S60LangMapTable()
+{
+ qt2S60LangMapTable.reserve(170); // 165 items at time of writing.
+ qt2S60LangMapTable.insert("ab", "SC"); //Abkhazian //
+ qt2S60LangMapTable.insert("om", "SC"); //Afan //
+ qt2S60LangMapTable.insert("aa", "SC"); //Afar //
+ qt2S60LangMapTable.insert("af", "34"); //Afrikaans //Afrikaans
+ qt2S60LangMapTable.insert("sq", "35"); //Albanian //Albanian
+ qt2S60LangMapTable.insert("am", "36"); //Amharic //Amharic
+ qt2S60LangMapTable.insert("ar", "37"); //Arabic //Arabic
+ qt2S60LangMapTable.insert("hy", "38"); //Armenian //Armenian
+ qt2S60LangMapTable.insert("as", "SC"); //Assamese //
+ qt2S60LangMapTable.insert("ay", "SC"); //Aymara //
+ qt2S60LangMapTable.insert("az", "SC"); //Azerbaijani //
+ qt2S60LangMapTable.insert("ba", "SC"); //Bashkir //
+ qt2S60LangMapTable.insert("eu", "SC"); //Basque //
+ qt2S60LangMapTable.insert("bn", "41"); //Bengali //Bengali
+ qt2S60LangMapTable.insert("dz", "SC"); //Bhutani //
+ qt2S60LangMapTable.insert("bh", "SC"); //Bihari //
+ qt2S60LangMapTable.insert("bi", "SC"); //Bislama //
+ qt2S60LangMapTable.insert("br", "SC"); //Breton //
+ qt2S60LangMapTable.insert("bg", "42"); //Bulgarian //Bulgarian
+ qt2S60LangMapTable.insert("my", "43"); //Burmese //Burmese
+ qt2S60LangMapTable.insert("be", "40"); //Byelorussian //Belarussian
+ qt2S60LangMapTable.insert("km", "SC"); //Cambodian //
+ qt2S60LangMapTable.insert("ca", "44"); //Catalan //Catalan
+ qt2S60LangMapTable.insert("zh", "SC"); //Chinese //
+ qt2S60LangMapTable.insert("co", "SC"); //Corsican //
+ qt2S60LangMapTable.insert("hr", "45"); //Croatian //Croatian
+ qt2S60LangMapTable.insert("cs", "25"); //Czech //Czech
+ qt2S60LangMapTable.insert("da", "07"); //Danish //Danish
+ qt2S60LangMapTable.insert("nl", "18"); //Dutch //Dutch
+ qt2S60LangMapTable.insert("en", "01"); //English //English(UK)
+ qt2S60LangMapTable.insert("eo", "SC"); //Esperanto //
+ qt2S60LangMapTable.insert("et", "49"); //Estonian //Estonian
+ qt2S60LangMapTable.insert("fo", "SC"); //Faroese //
+ qt2S60LangMapTable.insert("fj", "SC"); //Fiji //
+ qt2S60LangMapTable.insert("fi", "09"); //Finnish //Finnish
+ qt2S60LangMapTable.insert("fr", "02"); //French //French
+ qt2S60LangMapTable.insert("fy", "SC"); //Frisian //
+ qt2S60LangMapTable.insert("gd", "52"); //Gaelic //Gaelic
+ qt2S60LangMapTable.insert("gl", "SC"); //Galician //
+ qt2S60LangMapTable.insert("ka", "53"); //Georgian //Georgian
+ qt2S60LangMapTable.insert("de", "03"); //German //German
+ qt2S60LangMapTable.insert("el", "54"); //Greek //Greek
+ qt2S60LangMapTable.insert("kl", "SC"); //Greenlandic //
+ qt2S60LangMapTable.insert("gn", "SC"); //Guarani //
+ qt2S60LangMapTable.insert("gu", "56"); //Gujarati //Gujarati
+ qt2S60LangMapTable.insert("ha", "SC"); //Hausa //
+ qt2S60LangMapTable.insert("he", "57"); //Hebrew //Hebrew
+ qt2S60LangMapTable.insert("hi", "58"); //Hindi //Hindi
+ qt2S60LangMapTable.insert("hu", "17"); //Hungarian //Hungarian
+ qt2S60LangMapTable.insert("is", "15"); //Icelandic //Icelandic
+ qt2S60LangMapTable.insert("id", "59"); //Indonesian //Indonesian
+ qt2S60LangMapTable.insert("ia", "SC"); //Interlingua //
+ qt2S60LangMapTable.insert("ie", "SC"); //Interlingue //
+ qt2S60LangMapTable.insert("iu", "SC"); //Inuktitut //
+ qt2S60LangMapTable.insert("ik", "SC"); //Inupiak //
+ qt2S60LangMapTable.insert("ga", "60"); //Irish //Irish
+ qt2S60LangMapTable.insert("it", "05"); //Italian //Italian
+ qt2S60LangMapTable.insert("ja", "32"); //Japanese //Japanese
+ qt2S60LangMapTable.insert("jv", "SC"); //Javanese //
+ qt2S60LangMapTable.insert("kn", "62"); //Kannada //Kannada
+ qt2S60LangMapTable.insert("ks", "SC"); //Kashmiri //
+ qt2S60LangMapTable.insert("kk", "63"); //Kazakh //Kazakh
+ qt2S60LangMapTable.insert("rw", "SC"); //Kinyarwanda //
+ qt2S60LangMapTable.insert("ky", "SC"); //Kirghiz //
+ qt2S60LangMapTable.insert("ko", "65"); //Korean //Korean
+ qt2S60LangMapTable.insert("ku", "SC"); //Kurdish //
+ qt2S60LangMapTable.insert("rn", "SC"); //Kurundi //
+ qt2S60LangMapTable.insert("lo", "66"); //Laothian //Laothian
+ qt2S60LangMapTable.insert("la", "SC"); //Latin //
+ qt2S60LangMapTable.insert("lv", "67"); //Latvian //Latvian
+ qt2S60LangMapTable.insert("ln", "SC"); //Lingala //
+ qt2S60LangMapTable.insert("lt", "68"); //Lithuanian //Lithuanian
+ qt2S60LangMapTable.insert("mk", "69"); //Macedonian //Macedonian
+ qt2S60LangMapTable.insert("mg", "SC"); //Malagasy //
+ qt2S60LangMapTable.insert("ms", "70"); //Malay //Malay
+ qt2S60LangMapTable.insert("ml", "71"); //Malayalam //Malayalam
+ qt2S60LangMapTable.insert("mt", "SC"); //Maltese //
+ qt2S60LangMapTable.insert("mi", "SC"); //Maori //
+ qt2S60LangMapTable.insert("mr", "72"); //Marathi //Marathi
+ qt2S60LangMapTable.insert("mo", "73"); //Moldavian //Moldovian
+ qt2S60LangMapTable.insert("mn", "74"); //Mongolian //Mongolian
+ qt2S60LangMapTable.insert("na", "SC"); //Nauru //
+ qt2S60LangMapTable.insert("ne", "SC"); //Nepali //
+ qt2S60LangMapTable.insert("nb", "08"); //Norwegian //Norwegian
+ qt2S60LangMapTable.insert("oc", "SC"); //Occitan //
+ qt2S60LangMapTable.insert("or", "SC"); //Oriya //
+ qt2S60LangMapTable.insert("ps", "SC"); //Pashto //
+ qt2S60LangMapTable.insert("fa", "SC"); //Persian //
+ qt2S60LangMapTable.insert("pl", "27"); //Polish //Polish
+ qt2S60LangMapTable.insert("pt", "13"); //Portuguese //Portuguese
+ qt2S60LangMapTable.insert("pa", "77"); //Punjabi //Punjabi
+ qt2S60LangMapTable.insert("qu", "SC"); //Quechua //
+ qt2S60LangMapTable.insert("rm", "SC"); //RhaetoRomance //
+ qt2S60LangMapTable.insert("ro", "78"); //Romanian //Romanian
+ qt2S60LangMapTable.insert("ru", "16"); //Russian //Russian
+ qt2S60LangMapTable.insert("sm", "SC"); //Samoan //
+ qt2S60LangMapTable.insert("sg", "SC"); //Sangho //
+ qt2S60LangMapTable.insert("sa", "SC"); //Sanskrit //
+ qt2S60LangMapTable.insert("sr", "79"); //Serbian //Serbian
+ qt2S60LangMapTable.insert("sh", "SC"); //SerboCroatian //
+ qt2S60LangMapTable.insert("st", "SC"); //Sesotho //
+ qt2S60LangMapTable.insert("tn", "SC"); //Setswana //
+ qt2S60LangMapTable.insert("sn", "SC"); //Shona //
+ qt2S60LangMapTable.insert("sd", "SC"); //Sindhi //
+ qt2S60LangMapTable.insert("si", "80"); //Singhalese //Sinhalese
+ qt2S60LangMapTable.insert("ss", "SC"); //Siswati //
+ qt2S60LangMapTable.insert("sk", "26"); //Slovak //Slovak
+ qt2S60LangMapTable.insert("sl", "28"); //Slovenian //Slovenian
+ qt2S60LangMapTable.insert("so", "81"); //Somali //Somali
+ qt2S60LangMapTable.insert("es", "04"); //Spanish //Spanish
+ qt2S60LangMapTable.insert("su", "SC"); //Sundanese //
+ qt2S60LangMapTable.insert("sw", "84"); //Swahili //Swahili
+ qt2S60LangMapTable.insert("sv", "06"); //Swedish //Swedish
+ qt2S60LangMapTable.insert("tl", "39"); //Tagalog //Tagalog
+ qt2S60LangMapTable.insert("tg", "SC"); //Tajik //
+ qt2S60LangMapTable.insert("ta", "87"); //Tamil //Tamil
+ qt2S60LangMapTable.insert("tt", "SC"); //Tatar //
+ qt2S60LangMapTable.insert("te", "88"); //Telugu //Telugu
+ qt2S60LangMapTable.insert("th", "33"); //Thai //Thai
+ qt2S60LangMapTable.insert("bo", "89"); //Tibetan //Tibetan
+ qt2S60LangMapTable.insert("ti", "90"); //Tigrinya //Tigrinya
+ qt2S60LangMapTable.insert("to", "SC"); //Tonga //
+ qt2S60LangMapTable.insert("ts", "SC"); //Tsonga //
+ qt2S60LangMapTable.insert("tr", "14"); //Turkish //Turkish
+ qt2S60LangMapTable.insert("tk", "92"); //Turkmen //Turkmen
+ qt2S60LangMapTable.insert("tw", "SC"); //Twi //
+ qt2S60LangMapTable.insert("ug", "SC"); //Uigur //
+ qt2S60LangMapTable.insert("uk", "93"); //Ukrainian //Ukrainian
+ qt2S60LangMapTable.insert("ur", "94"); //Urdu //Urdu
+ qt2S60LangMapTable.insert("uz", "SC"); //Uzbek //
+ qt2S60LangMapTable.insert("vi", "96"); //Vietnamese //Vietnamese
+ qt2S60LangMapTable.insert("vo", "SC"); //Volapuk //
+ qt2S60LangMapTable.insert("cy", "97"); //Welsh //Welsh
+ qt2S60LangMapTable.insert("wo", "SC"); //Wolof //
+ qt2S60LangMapTable.insert("xh", "SC"); //Xhosa //
+ qt2S60LangMapTable.insert("yi", "SC"); //Yiddish //
+ qt2S60LangMapTable.insert("yo", "SC"); //Yoruba //
+ qt2S60LangMapTable.insert("za", "SC"); //Zhuang //
+ qt2S60LangMapTable.insert("zu", "98"); //Zulu //Zulu
+ qt2S60LangMapTable.insert("nn", "75"); //Nynorsk //NorwegianNynorsk
+ qt2S60LangMapTable.insert("bs", "SC"); //Bosnian //
+ qt2S60LangMapTable.insert("dv", "SC"); //Divehi //
+ qt2S60LangMapTable.insert("gv", "SC"); //Manx //
+ qt2S60LangMapTable.insert("kw", "SC"); //Cornish //
+ qt2S60LangMapTable.insert("ak", "SC"); //Akan //
+ qt2S60LangMapTable.insert("kok", "SC"); //Konkani //
+ qt2S60LangMapTable.insert("gaa", "SC"); //Ga //
+ qt2S60LangMapTable.insert("ig", "SC"); //Igbo //
+ qt2S60LangMapTable.insert("kam", "SC"); //Kamba //
+ qt2S60LangMapTable.insert("syr", "SC"); //Syriac //
+ qt2S60LangMapTable.insert("byn", "SC"); //Blin //
+ qt2S60LangMapTable.insert("gez", "SC"); //Geez //
+ qt2S60LangMapTable.insert("kfo", "SC"); //Koro //
+ qt2S60LangMapTable.insert("sid", "SC"); //Sidamo //
+ qt2S60LangMapTable.insert("cch", "SC"); //Atsam //
+ qt2S60LangMapTable.insert("tig", "SC"); //Tigre //
+ qt2S60LangMapTable.insert("kaj", "SC"); //Jju //
+ qt2S60LangMapTable.insert("fur", "SC"); //Friulian //
+ qt2S60LangMapTable.insert("ve", "SC"); //Venda //
+ qt2S60LangMapTable.insert("ee", "SC"); //Ewe //
+ qt2S60LangMapTable.insert("wa", "SC"); //Walamo //
+ qt2S60LangMapTable.insert("haw", "SC"); //Hawaiian //
+ qt2S60LangMapTable.insert("kcg", "SC"); //Tyap //
+ qt2S60LangMapTable.insert("ny", "SC"); //Chewa //
+}
+
diff --git a/qmake/generators/symbian/symbiancommon.h b/qmake/generators/symbian/symbiancommon.h
new file mode 100644
index 0000000..32f9483
--- /dev/null
+++ b/qmake/generators/symbian/symbiancommon.h
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the qmake application of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SYMBIANCOMMON_H
+#define SYMBIANCOMMON_H
+
+#include <project.h>
+#include <makefile.h>
+#include "initprojectdeploy_symbian.h"
+
+#define PRINT_FILE_CREATE_ERROR(filename) fprintf(stderr, "Error: Could not create '%s'\n", qPrintable(filename));
+
+class SymbianCommonGenerator
+{
+public:
+ enum TargetType {
+ TypeExe,
+ TypeDll,
+ TypeLib,
+ TypePlugin,
+ TypeSubdirs
+ };
+
+ SymbianCommonGenerator(MakefileGenerator *generator);
+
+ virtual void init();
+
+protected:
+
+ QString removePathSeparators(QString &file);
+ void removeSpecialCharacters(QString& str);
+ void generatePkgFile(const QString &iconFile, DeploymentList &depList, bool epocBuild);
+ bool containsStartWithItem(const QChar &c, const QStringList& src);
+
+ void writeRegRssFile(QStringList &useritems);
+ void writeRssFile(QString &numberOfIcons, QString &iconfile);
+ void writeLocFile(QStringList &symbianLangCodes);
+ void readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules);
+
+ QStringList symbianLangCodesFromTsFiles();
+ void fillQt2S60LangMapTable();
+
+protected:
+ MakefileGenerator *generator;
+
+ QStringList generatedFiles;
+ QStringList generatedDirs;
+ QString fixedTarget;
+ QString privateDirUid;
+ QString uid3;
+ TargetType targetType;
+
+ QHash<QString, QString> qt2S60LangMapTable;
+};
+
+#endif // SYMBIANCOMMON_H
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index 5ebc8a2..503e443 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -56,7 +56,6 @@
#endif
#define RESOURCE_DIRECTORY_MMP "/resource/apps"
-#define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\"
#define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps"
#define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def"
#define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonu.def"
@@ -69,11 +68,6 @@
#define BLD_INF_TAG_EXTENSIONS "prj_extensions"
#define BLD_INF_TAG_EXPORTS "prj_exports"
-#define RSS_RULES "RSS_RULES"
-#define RSS_RULES_BASE "RSS_RULES."
-#define RSS_TAG_NBROFICONS "number_of_icons"
-#define RSS_TAG_ICONFILE "icon_file"
-
#define MMP_TARGET "TARGET"
#define MMP_TARGETTYPE "TARGETTYPE"
#define MMP_SECUREID "SECUREID"
@@ -102,13 +96,6 @@
#define FAIL_SIS_NOPKG_TARGET "fail_sis_nopkg"
#define FAIL_SIS_NOCACHE_TARGET "fail_sis_nocache"
-#define PRINT_FILE_CREATE_ERROR(filename) fprintf(stderr, "Error: Could not create '%s'\n", qPrintable(filename));
-
-#define MANUFACTURER_NOTE_FILE "manufacturer_note.txt"
-#define DEFAULT_MANUFACTURER_NOTE \
- "The package is not supported for devices from this manufacturer. Please try the selfsigned " \
- "version of the package instead."
-
QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const QDir& parentDir)
{
static QString epocRootStr;
@@ -171,7 +158,7 @@ QString SymbianMakefileGenerator::canonizePath(const QString& origPath)
return resultPath;
}
-SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator() { }
+SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator(), SymbianCommonGenerator(this) { }
SymbianMakefileGenerator::~SymbianMakefileGenerator() { }
void SymbianMakefileGenerator::writeHeader(QTextStream &t)
@@ -231,7 +218,7 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
}
if (generatePkg) {
- generatePkgFile(iconFile, depList);
+ generatePkgFile(iconFile, depList, true);
}
writeBldInfContent(t, generatePkg, iconFile, depList);
@@ -291,264 +278,6 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
return true;
}
-void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, DeploymentList &depList)
-{
- QString pkgFilename = QString("%1_template.%2")
- .arg(fixedTarget)
- .arg("pkg");
- QFile pkgFile(pkgFilename);
- if (!pkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
- PRINT_FILE_CREATE_ERROR(pkgFilename);
- return;
- }
-
- generatedFiles << pkgFile.fileName();
- QTextStream t(&pkgFile);
-
- QString installerSisHeader = project->values("DEPLOYMENT.installer_header").join("\n");
- if (installerSisHeader.isEmpty())
- installerSisHeader = "0xA000D7CE"; // Use default self-signable UID if not defined
-
- QString wrapperStreamBuffer;
- QTextStream tw(&wrapperStreamBuffer);
-
- QString dateStr = QDateTime::currentDateTime().toString(Qt::ISODate);
-
- // Header info
- QString wrapperPkgFilename = QString("%1_installer.%2")
- .arg(fixedTarget)
- .arg("pkg");
- QString headerComment = "; %1 generated by qmake at %2\n"
- "; This file is generated by qmake and should not be modified by the user\n"
- ";\n\n";
- t << headerComment.arg(pkgFilename).arg(dateStr);
- tw << headerComment.arg(wrapperPkgFilename).arg(dateStr);
-
- // Construct QStringList from pkg_prerules since we need search it before printed to file
- QStringList rawPkgPreRules;
- foreach(QString deploymentItem, project->values("DEPLOYMENT")) {
- foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_prerules")) {
- QStringList pkgrulesValue = project->values(pkgrulesItem);
- // If there is no stringlist defined for a rule, use rule name directly
- // This is convenience for defining single line mmp statements
- if (pkgrulesValue.isEmpty()) {
- rawPkgPreRules << pkgrulesItem;
- } else {
- foreach(QString pkgrule, pkgrulesValue) {
- rawPkgPreRules << pkgrule;
- }
- }
- }
- }
-
- // Apply some defaults if specific data does not exist in PKG pre-rules
-
- if (!containsStartWithItem('&', rawPkgPreRules)) {
- // language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS)
- QString languageCode = "; Language\n&EN\n\n";
- t << languageCode;
- tw << languageCode;
- } else {
- // In case user defines langs, he must take care also about SIS header
- if (!containsStartWithItem('#', rawPkgPreRules))
- fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n");
- }
-
- // name of application, UID and version
- QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ',');
- QString sisHeader = "; SIS header: name, uid, version\n#{\"%1\"},(%2),%3\n\n";
- QString visualTarget = escapeFilePath(fileFixify(project->first("TARGET")));
- visualTarget = removePathSeparators(visualTarget);
- QString wrapperTarget = visualTarget + " installer";
-
- if (installerSisHeader.startsWith("0x", Qt::CaseInsensitive)) {
- tw << sisHeader.arg(wrapperTarget).arg(installerSisHeader).arg(applicationVersion);
- } else {
- tw << installerSisHeader << endl;
- }
-
- if (!containsStartWithItem('#', rawPkgPreRules)) {
- t << sisHeader.arg(visualTarget).arg(uid3).arg(applicationVersion);
- }
-
- // Localized vendor name
- QString vendorName;
- if (!containsStartWithItem('%', rawPkgPreRules)) {
- vendorName += "; Localised Vendor name\n%{\"Vendor\"}\n\n";
- }
-
- // Unique vendor name
- if (!containsStartWithItem(':', rawPkgPreRules)) {
- vendorName += "; Unique Vendor name\n:\"Vendor\"\n\n";
- }
-
- t << vendorName;
- tw << vendorName;
-
- // PKG pre-rules - these are added before actual file installations i.e. SIS package body
- if (rawPkgPreRules.size()) {
- QString comment = "\n; Manual PKG pre-rules from PRO files\n";
- t << comment;
- tw << comment;
-
- foreach(QString item, rawPkgPreRules) {
- // Only regular pkg file should have package dependencies or pkg header if that is
- // defined using prerules.
- if (!item.startsWith("(") && !item.startsWith("#")) {
- tw << item << endl;
- }
- t << item << endl;
- }
- t << endl;
- tw << endl;
- }
-
- // Begin Manufacturer block
- if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) {
- QString manufacturerStr("IF ");
- foreach(QString manufacturer, project->values("DEPLOYMENT.manufacturers")) {
- manufacturerStr.append(QString("(MANUFACTURER)=(%1) OR \n ").arg(manufacturer));
- }
- // Remove the final OR
- manufacturerStr.chop(8);
- t << manufacturerStr << endl;
- }
-
- // Install paths on the phone *** should be dynamic at some point
- QString installPathBin = "!:\\sys\\bin";
- QString installPathResource = "!:\\resource\\apps";
- QString installPathRegResource = "!:\\private\\10003a3f\\import\\apps";
-
- // Find location of builds
- QString epocReleasePath = QString("%1epoc32/release/$(PLATFORM)/$(TARGET)")
- .arg(epocRoot());
-
- if (targetType == TypeExe) {
- // deploy .exe file
- t << "; Executable and default resource files" << endl;
- QString exeFile = fixedTarget + ".exe";
- t << QString("\"%1/%2\" - \"%3\\%4\"")
- .arg(epocReleasePath)
- .arg(exeFile)
- .arg(installPathBin)
- .arg(exeFile) << endl;
-
- // deploy rsc & reg_rsc file
- if (!project->isActiveConfig("no_icon")) {
- t << QString("\"%1epoc32/data/z/resource/apps/%2\" - \"%3\\%4\"")
- .arg(epocRoot())
- .arg(fixedTarget + ".rsc")
- .arg(installPathResource)
- .arg(fixedTarget + ".rsc") << endl;
-
- t << QString("\"%1epoc32/data/z/private/10003a3f/import/apps/%2\" - \"%3\\%4\"")
- .arg(epocRoot())
- .arg(fixedTarget + "_reg.rsc")
- .arg(installPathRegResource)
- .arg(fixedTarget + "_reg.rsc") << endl;
-
- if (!iconFile.isEmpty()) {
- t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"")
- .arg(epocRoot())
- .arg(iconFile)
- .arg(QDir::toNativeSeparators(iconFile)) << endl << endl;
- }
- }
- }
-
- // deploy any additional DEPLOYMENT files
- QString remoteTestPath;
- remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid);
-
- initProjectDeploySymbian(project, depList, remoteTestPath, true, "$(PLATFORM)", "$(TARGET)", generatedDirs, generatedFiles);
- if (depList.size())
- t << "; DEPLOYMENT" << endl;
- for (int i = 0; i < depList.size(); ++i) {
- t << QString("\"%1\" - \"%2\"")
- .arg(QString(depList.at(i).from).replace('\\','/'))
- .arg(QString(depList.at(i).to).replace('/','\\')) << endl;
- }
- t << endl;
-
- // PKG post-rules - these are added after actual file installations i.e. SIS package body
- t << "; Manual PKG post-rules from PRO files" << endl;
- foreach(QString deploymentItem, project->values("DEPLOYMENT")) {
- foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_postrules")) {
- QStringList pkgrulesValue = project->values(pkgrulesItem);
- // If there is no stringlist defined for a rule, use rule name directly
- // This is convenience for defining single line statements
- if (pkgrulesValue.isEmpty()) {
- t << pkgrulesItem << endl;
- } else {
- foreach(QString pkgrule, pkgrulesValue) {
- t << pkgrule << endl;
- }
- }
- t << endl;
- }
- }
-
- // Close Manufacturer block
- if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) {
- QString manufacturerFailNoteFile;
- if (project->values("DEPLOYMENT.manufacturers.fail_note").isEmpty()) {
- manufacturerFailNoteFile = QString("%1_" MANUFACTURER_NOTE_FILE).arg(uid3);
- QFile ft(manufacturerFailNoteFile);
- if (ft.open(QIODevice::WriteOnly)) {
- generatedFiles << ft.fileName();
- QTextStream t2(&ft);
-
- t2 << QString(DEFAULT_MANUFACTURER_NOTE) << endl;
- } else {
- PRINT_FILE_CREATE_ERROR(manufacturerFailNoteFile)
- }
- } else {
- manufacturerFailNoteFile = project->values("DEPLOYMENT.manufacturers.fail_note").join("");
- }
-
- t << "ELSEIF NOT(0) ; MANUFACTURER" << endl
- << "\"" << fileInfo(manufacturerFailNoteFile).absoluteFilePath() << "\""
- << " - \"\", FILETEXT, TEXTEXIT" << endl
- << "ENDIF ; MANUFACTURER" << endl;
- }
-
- // Write wrapper pkg
- if (!installerSisHeader.isEmpty()) {
- QFile wrapperPkgFile(wrapperPkgFilename);
- if (!wrapperPkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
- PRINT_FILE_CREATE_ERROR(wrapperPkgFilename);
- return;
- }
-
- generatedFiles << wrapperPkgFile.fileName();
- QTextStream twf(&wrapperPkgFile);
-
- twf << wrapperStreamBuffer << endl;
-
- // Wrapped files deployment
- QString currentPath = qmake_getpwd();
- QString sisName = QString("%1.sis").arg(fixedTarget);
- twf << "\"" << currentPath << "/" << sisName << "\" - \"c:\\adm\\" << sisName << "\"" << endl;
-
- QString bootStrapPath = QLibraryInfo::location(QLibraryInfo::PrefixPath);
- bootStrapPath.append("/smartinstaller.sis");
- QFileInfo fi(fileInfo(bootStrapPath));
- twf << "@\"" << fi.absoluteFilePath() << "\",(0x2002CCCD)" << endl;
- }
-}
-
-bool SymbianMakefileGenerator::containsStartWithItem(const QChar &c, const QStringList& src)
-{
- bool result = false;
- foreach(QString str, src) {
- if (str.startsWith(c)) {
- result = true;
- break;
- }
- }
- return result;
-}
-
void SymbianMakefileGenerator::writeCustomDefFile()
{
if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) {
@@ -586,9 +315,7 @@ void SymbianMakefileGenerator::writeCustomDefFile()
void SymbianMakefileGenerator::init()
{
MakefileGenerator::init();
- fixedTarget = escapeFilePath(fileFixify(project->first("TARGET")));
- fixedTarget = removePathSeparators(fixedTarget);
- removeSpecialCharacters(fixedTarget);
+ SymbianCommonGenerator::init();
if (0 != project->values("QMAKE_PLATFORM").size())
platform = varGlue("QMAKE_PLATFORM", "", " ", "");
@@ -605,27 +332,6 @@ void SymbianMakefileGenerator::init()
// .mmp
initMmpVariables();
- // Check TARGET.UID3 presence
- if (0 != project->values("TARGET.UID3").size()) {
- uid3 = project->first("TARGET.UID3");
- } else {
- uid3 = generateUID3();
- }
-
- if ((project->values("TEMPLATE")).contains("app"))
- targetType = TypeExe;
- else if ((project->values("TEMPLATE")).contains("lib")) {
- // Check CONFIG to see if we are to build staticlib or dll
- if (project->isActiveConfig("staticlib") || project->isActiveConfig("static"))
- targetType = TypeLib;
- else if (project->isActiveConfig("plugin"))
- targetType = TypePlugin;
- else
- targetType = TypeDll;
- } else {
- targetType = TypeSubdirs;
- }
-
if (0 != project->values("TARGET.UID2").size()) {
uid2 = project->first("TARGET.UID2");
} else if (project->isActiveConfig("stdbinary")) {
@@ -645,20 +351,6 @@ void SymbianMakefileGenerator::init()
}
uid2 = uid2.trimmed();
- uid3 = uid3.trimmed();
-
- // UID is valid as either hex or decimal, so just convert it to number and back to hex
- // to get proper string for private dir
- bool conversionOk = false;
- uint uidNum = uid3.toUInt(&conversionOk, 0);
-
- if (!conversionOk) {
- fprintf(stderr, "Error: Invalid UID \"%s\".\n", uid3.toUtf8().constData());
- } else {
- privateDirUid.setNum(uidNum, 16);
- while (privateDirUid.length() < 8)
- privateDirUid.insert(0, QLatin1Char('0'));
- }
}
QString SymbianMakefileGenerator::getTargetExtension()
@@ -1437,391 +1129,6 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy
}
}
-void SymbianMakefileGenerator::writeRegRssFile(QStringList &userItems)
-{
- QString filename(fixedTarget);
- filename.append("_reg.rss");
- QFile ft(filename);
- if (ft.open(QIODevice::WriteOnly)) {
- generatedFiles << ft.fileName();
- QTextStream t(&ft);
- t << "// ============================================================================" << endl;
- t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: ";
- t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
- t << "// * This file is generated by qmake and should not be modified by the" << endl;
- t << "// * user." << endl;
- t << "// ============================================================================" << endl;
- t << endl;
- t << "#include <" << fixedTarget << ".rsg>" << endl;
- t << "#include <appinfo.rh>" << endl;
- t << endl;
- t << "UID2 KUidAppRegistrationResourceFile" << endl;
- t << "UID3 " << uid3 << endl << endl;
- t << "RESOURCE APP_REGISTRATION_INFO" << endl;
- t << "\t{" << endl;
- t << "\tapp_file=\"" << fixedTarget << "\";" << endl;
- t << "\tlocalisable_resource_file=\"" RESOURCE_DIRECTORY_RESOURCE << fixedTarget << "\";" << endl;
- t << endl;
-
- foreach(QString item, userItems)
- t << "\t" << item << endl;
- t << "\t}" << endl;
- } else {
- PRINT_FILE_CREATE_ERROR(filename)
- }
-}
-
-void SymbianMakefileGenerator::writeRssFile(QString &numberOfIcons, QString &iconFile)
-{
- QString filename(fixedTarget);
- filename.append(".rss");
- QFile ft(filename);
- if (ft.open(QIODevice::WriteOnly)) {
- generatedFiles << ft.fileName();
- QTextStream t(&ft);
- t << "// ============================================================================" << endl;
- t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: ";
- t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
- t << "// * This file is generated by qmake and should not be modified by the" << endl;
- t << "// * user." << endl;
- t << "// ============================================================================" << endl;
- t << endl;
- t << "#include <appinfo.rh>" << endl;
- t << "#include \"" << fixedTarget << ".loc\"" << endl;
- t << endl;
- t << "RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info" << endl;
- t << "\t{" << endl;
- t << "\tshort_caption = STRING_r_short_caption;" << endl;
- t << "\tcaption_and_icon =" << endl;
- t << "\tCAPTION_AND_ICON_INFO" << endl;
- t << "\t\t{" << endl;
- t << "\t\tcaption = STRING_r_caption;" << endl;
-
- QString rssIconFile = iconFile;
- rssIconFile = rssIconFile.replace("/", "\\\\");
-
- if (numberOfIcons.isEmpty() || rssIconFile.isEmpty()) {
- // There can be maximum one item in this tag, validated when parsed
- t << "\t\tnumber_of_icons = 0;" << endl;
- t << "\t\ticon_file = \"\";" << endl;
- } else {
- // There can be maximum one item in this tag, validated when parsed
- t << "\t\tnumber_of_icons = " << numberOfIcons << ";" << endl;
- t << "\t\ticon_file = \"" << rssIconFile << "\";" << endl;
- }
- t << "\t\t};" << endl;
- t << "\t}" << endl;
- t << endl;
- } else {
- PRINT_FILE_CREATE_ERROR(filename);
- }
-}
-
-void SymbianMakefileGenerator::writeLocFile(QStringList &symbianLangCodes)
-{
- QString filename(fixedTarget);
- filename.append(".loc");
- QFile ft(filename);
- if (ft.open(QIODevice::WriteOnly)) {
- generatedFiles << ft.fileName();
- QTextStream t(&ft);
- t << "// ============================================================================" << endl;
- t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: ";
- t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
- t << "// * This file is generated by qmake and should not be modified by the" << endl;
- t << "// * user." << endl;
- t << "// ============================================================================" << endl;
- t << endl;
- t << "#ifdef LANGUAGE_SC" << endl;
- t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl;
- t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl;
- foreach(QString lang, symbianLangCodes) {
- t << "#elif defined LANGUAGE_" << lang << endl;
- t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl;
- t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl;
- }
- t << "#else" << endl;
- t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl;
- t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl;
- t << "#endif" << endl;
- } else {
- PRINT_FILE_CREATE_ERROR(filename);
- }
-}
-
-void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules)
-{
- for (QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) {
- if (it.key().startsWith(RSS_RULES_BASE)) {
- QString newKey = it.key().mid(sizeof(RSS_RULES_BASE) - 1);
- if (newKey.isEmpty()) {
- fprintf(stderr, "Warning: Empty RSS_RULES_BASE key encountered\n");
- continue;
- }
- QStringList newValues;
- QStringList values = it.value();
- foreach(QString item, values) {
- // If there is no stringlist defined for a rule, use rule name directly
- // This is convenience for defining single line statements
- if (project->values(item).isEmpty()) {
- newValues << item;
- } else {
- foreach(QString itemRow, project->values(item)) {
- newValues << itemRow;
- }
- }
- }
- // Verify thet there is exactly one value in RSS_TAG_NBROFICONS
- if (newKey == RSS_TAG_NBROFICONS) {
- if (newValues.count() == 1) {
- numberOfIcons = newValues[0];
- } else {
- fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n",
- RSS_RULES_BASE, RSS_TAG_NBROFICONS);
- continue;
- }
- // Verify thet there is exactly one value in RSS_TAG_ICONFILE
- } else if (newKey == RSS_TAG_ICONFILE) {
- if (newValues.count() == 1) {
- iconFile = newValues[0];
- } else {
- fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n",
- RSS_RULES_BASE, RSS_TAG_ICONFILE);
- continue;
- }
- } else {
- fprintf(stderr, "Warning: Unsupported key:'%s%s'\n",
- RSS_RULES_BASE, newKey.toLatin1().constData());
- continue;
- }
- }
- }
-
- foreach(QString item, project->values(RSS_RULES)) {
- // If there is no stringlist defined for a rule, use rule name directly
- // This is convenience for defining single line mmp statements
- if (project->values(item).isEmpty()) {
- userRssRules << item;
- } else {
- userRssRules << project->values(item);
- }
- }
-
- // Validate that either both RSS_TAG_NBROFICONS and RSS_TAG_ICONFILE keys exist
- // or neither of them exist
- if (!((numberOfIcons.isEmpty() && iconFile.isEmpty()) ||
- (!numberOfIcons.isEmpty() && !iconFile.isEmpty()))) {
- numberOfIcons.clear();
- iconFile.clear();
- fprintf(stderr, "Warning: Both or neither of '%s%s' and '%s%s' keys must exist.\n",
- RSS_RULES_BASE, RSS_TAG_NBROFICONS, RSS_RULES_BASE, RSS_TAG_ICONFILE);
- }
-
- // Validate that RSS_TAG_NBROFICONS contains only numbers
- if (!numberOfIcons.isEmpty()) {
- bool ok;
- numberOfIcons = numberOfIcons.simplified();
- numberOfIcons.toInt(&ok);
- if (!ok) {
- numberOfIcons.clear();
- iconFile.clear();
- fprintf(stderr, "Warning: '%s%s' must be integer in decimal format.\n",
- RSS_RULES_BASE, RSS_TAG_NBROFICONS);
- }
- }
-}
-
-QStringList SymbianMakefileGenerator::symbianLangCodesFromTsFiles()
-{
- QStringList tsfiles;
- QStringList symbianLangCodes;
- tsfiles << project->values("TRANSLATIONS");
-
- fillQt2S60LangMapTable();
-
- foreach(QString file, tsfiles) {
- int extIndex = file.lastIndexOf(".");
- int langIndex = file.lastIndexOf("_", (extIndex - file.length()));
- langIndex += 1;
- QString qtlang = file.mid(langIndex, extIndex - langIndex);
- QString s60lang = qt2S60LangMapTable.value(qtlang, QString("SC"));
-
- if (!symbianLangCodes.contains(s60lang) && s60lang != "SC")
- symbianLangCodes += s60lang;
- }
-
- return symbianLangCodes;
-}
-
-void SymbianMakefileGenerator::fillQt2S60LangMapTable()
-{
- qt2S60LangMapTable.reserve(170); // 165 items at time of writing.
- qt2S60LangMapTable.insert("ab", "SC"); //Abkhazian //
- qt2S60LangMapTable.insert("om", "SC"); //Afan //
- qt2S60LangMapTable.insert("aa", "SC"); //Afar //
- qt2S60LangMapTable.insert("af", "34"); //Afrikaans //Afrikaans
- qt2S60LangMapTable.insert("sq", "35"); //Albanian //Albanian
- qt2S60LangMapTable.insert("am", "36"); //Amharic //Amharic
- qt2S60LangMapTable.insert("ar", "37"); //Arabic //Arabic
- qt2S60LangMapTable.insert("hy", "38"); //Armenian //Armenian
- qt2S60LangMapTable.insert("as", "SC"); //Assamese //
- qt2S60LangMapTable.insert("ay", "SC"); //Aymara //
- qt2S60LangMapTable.insert("az", "SC"); //Azerbaijani //
- qt2S60LangMapTable.insert("ba", "SC"); //Bashkir //
- qt2S60LangMapTable.insert("eu", "SC"); //Basque //
- qt2S60LangMapTable.insert("bn", "41"); //Bengali //Bengali
- qt2S60LangMapTable.insert("dz", "SC"); //Bhutani //
- qt2S60LangMapTable.insert("bh", "SC"); //Bihari //
- qt2S60LangMapTable.insert("bi", "SC"); //Bislama //
- qt2S60LangMapTable.insert("br", "SC"); //Breton //
- qt2S60LangMapTable.insert("bg", "42"); //Bulgarian //Bulgarian
- qt2S60LangMapTable.insert("my", "43"); //Burmese //Burmese
- qt2S60LangMapTable.insert("be", "40"); //Byelorussian //Belarussian
- qt2S60LangMapTable.insert("km", "SC"); //Cambodian //
- qt2S60LangMapTable.insert("ca", "44"); //Catalan //Catalan
- qt2S60LangMapTable.insert("zh", "SC"); //Chinese //
- qt2S60LangMapTable.insert("co", "SC"); //Corsican //
- qt2S60LangMapTable.insert("hr", "45"); //Croatian //Croatian
- qt2S60LangMapTable.insert("cs", "25"); //Czech //Czech
- qt2S60LangMapTable.insert("da", "07"); //Danish //Danish
- qt2S60LangMapTable.insert("nl", "18"); //Dutch //Dutch
- qt2S60LangMapTable.insert("en", "01"); //English //English(UK)
- qt2S60LangMapTable.insert("eo", "SC"); //Esperanto //
- qt2S60LangMapTable.insert("et", "49"); //Estonian //Estonian
- qt2S60LangMapTable.insert("fo", "SC"); //Faroese //
- qt2S60LangMapTable.insert("fj", "SC"); //Fiji //
- qt2S60LangMapTable.insert("fi", "09"); //Finnish //Finnish
- qt2S60LangMapTable.insert("fr", "02"); //French //French
- qt2S60LangMapTable.insert("fy", "SC"); //Frisian //
- qt2S60LangMapTable.insert("gd", "52"); //Gaelic //Gaelic
- qt2S60LangMapTable.insert("gl", "SC"); //Galician //
- qt2S60LangMapTable.insert("ka", "53"); //Georgian //Georgian
- qt2S60LangMapTable.insert("de", "03"); //German //German
- qt2S60LangMapTable.insert("el", "54"); //Greek //Greek
- qt2S60LangMapTable.insert("kl", "SC"); //Greenlandic //
- qt2S60LangMapTable.insert("gn", "SC"); //Guarani //
- qt2S60LangMapTable.insert("gu", "56"); //Gujarati //Gujarati
- qt2S60LangMapTable.insert("ha", "SC"); //Hausa //
- qt2S60LangMapTable.insert("he", "57"); //Hebrew //Hebrew
- qt2S60LangMapTable.insert("hi", "58"); //Hindi //Hindi
- qt2S60LangMapTable.insert("hu", "17"); //Hungarian //Hungarian
- qt2S60LangMapTable.insert("is", "15"); //Icelandic //Icelandic
- qt2S60LangMapTable.insert("id", "59"); //Indonesian //Indonesian
- qt2S60LangMapTable.insert("ia", "SC"); //Interlingua //
- qt2S60LangMapTable.insert("ie", "SC"); //Interlingue //
- qt2S60LangMapTable.insert("iu", "SC"); //Inuktitut //
- qt2S60LangMapTable.insert("ik", "SC"); //Inupiak //
- qt2S60LangMapTable.insert("ga", "60"); //Irish //Irish
- qt2S60LangMapTable.insert("it", "05"); //Italian //Italian
- qt2S60LangMapTable.insert("ja", "32"); //Japanese //Japanese
- qt2S60LangMapTable.insert("jv", "SC"); //Javanese //
- qt2S60LangMapTable.insert("kn", "62"); //Kannada //Kannada
- qt2S60LangMapTable.insert("ks", "SC"); //Kashmiri //
- qt2S60LangMapTable.insert("kk", "63"); //Kazakh //Kazakh
- qt2S60LangMapTable.insert("rw", "SC"); //Kinyarwanda //
- qt2S60LangMapTable.insert("ky", "SC"); //Kirghiz //
- qt2S60LangMapTable.insert("ko", "65"); //Korean //Korean
- qt2S60LangMapTable.insert("ku", "SC"); //Kurdish //
- qt2S60LangMapTable.insert("rn", "SC"); //Kurundi //
- qt2S60LangMapTable.insert("lo", "66"); //Laothian //Laothian
- qt2S60LangMapTable.insert("la", "SC"); //Latin //
- qt2S60LangMapTable.insert("lv", "67"); //Latvian //Latvian
- qt2S60LangMapTable.insert("ln", "SC"); //Lingala //
- qt2S60LangMapTable.insert("lt", "68"); //Lithuanian //Lithuanian
- qt2S60LangMapTable.insert("mk", "69"); //Macedonian //Macedonian
- qt2S60LangMapTable.insert("mg", "SC"); //Malagasy //
- qt2S60LangMapTable.insert("ms", "70"); //Malay //Malay
- qt2S60LangMapTable.insert("ml", "71"); //Malayalam //Malayalam
- qt2S60LangMapTable.insert("mt", "SC"); //Maltese //
- qt2S60LangMapTable.insert("mi", "SC"); //Maori //
- qt2S60LangMapTable.insert("mr", "72"); //Marathi //Marathi
- qt2S60LangMapTable.insert("mo", "73"); //Moldavian //Moldovian
- qt2S60LangMapTable.insert("mn", "74"); //Mongolian //Mongolian
- qt2S60LangMapTable.insert("na", "SC"); //Nauru //
- qt2S60LangMapTable.insert("ne", "SC"); //Nepali //
- qt2S60LangMapTable.insert("nb", "08"); //Norwegian //Norwegian
- qt2S60LangMapTable.insert("oc", "SC"); //Occitan //
- qt2S60LangMapTable.insert("or", "SC"); //Oriya //
- qt2S60LangMapTable.insert("ps", "SC"); //Pashto //
- qt2S60LangMapTable.insert("fa", "SC"); //Persian //
- qt2S60LangMapTable.insert("pl", "27"); //Polish //Polish
- qt2S60LangMapTable.insert("pt", "13"); //Portuguese //Portuguese
- qt2S60LangMapTable.insert("pa", "77"); //Punjabi //Punjabi
- qt2S60LangMapTable.insert("qu", "SC"); //Quechua //
- qt2S60LangMapTable.insert("rm", "SC"); //RhaetoRomance //
- qt2S60LangMapTable.insert("ro", "78"); //Romanian //Romanian
- qt2S60LangMapTable.insert("ru", "16"); //Russian //Russian
- qt2S60LangMapTable.insert("sm", "SC"); //Samoan //
- qt2S60LangMapTable.insert("sg", "SC"); //Sangho //
- qt2S60LangMapTable.insert("sa", "SC"); //Sanskrit //
- qt2S60LangMapTable.insert("sr", "79"); //Serbian //Serbian
- qt2S60LangMapTable.insert("sh", "SC"); //SerboCroatian //
- qt2S60LangMapTable.insert("st", "SC"); //Sesotho //
- qt2S60LangMapTable.insert("tn", "SC"); //Setswana //
- qt2S60LangMapTable.insert("sn", "SC"); //Shona //
- qt2S60LangMapTable.insert("sd", "SC"); //Sindhi //
- qt2S60LangMapTable.insert("si", "80"); //Singhalese //Sinhalese
- qt2S60LangMapTable.insert("ss", "SC"); //Siswati //
- qt2S60LangMapTable.insert("sk", "26"); //Slovak //Slovak
- qt2S60LangMapTable.insert("sl", "28"); //Slovenian //Slovenian
- qt2S60LangMapTable.insert("so", "81"); //Somali //Somali
- qt2S60LangMapTable.insert("es", "04"); //Spanish //Spanish
- qt2S60LangMapTable.insert("su", "SC"); //Sundanese //
- qt2S60LangMapTable.insert("sw", "84"); //Swahili //Swahili
- qt2S60LangMapTable.insert("sv", "06"); //Swedish //Swedish
- qt2S60LangMapTable.insert("tl", "39"); //Tagalog //Tagalog
- qt2S60LangMapTable.insert("tg", "SC"); //Tajik //
- qt2S60LangMapTable.insert("ta", "87"); //Tamil //Tamil
- qt2S60LangMapTable.insert("tt", "SC"); //Tatar //
- qt2S60LangMapTable.insert("te", "88"); //Telugu //Telugu
- qt2S60LangMapTable.insert("th", "33"); //Thai //Thai
- qt2S60LangMapTable.insert("bo", "89"); //Tibetan //Tibetan
- qt2S60LangMapTable.insert("ti", "90"); //Tigrinya //Tigrinya
- qt2S60LangMapTable.insert("to", "SC"); //Tonga //
- qt2S60LangMapTable.insert("ts", "SC"); //Tsonga //
- qt2S60LangMapTable.insert("tr", "14"); //Turkish //Turkish
- qt2S60LangMapTable.insert("tk", "92"); //Turkmen //Turkmen
- qt2S60LangMapTable.insert("tw", "SC"); //Twi //
- qt2S60LangMapTable.insert("ug", "SC"); //Uigur //
- qt2S60LangMapTable.insert("uk", "93"); //Ukrainian //Ukrainian
- qt2S60LangMapTable.insert("ur", "94"); //Urdu //Urdu
- qt2S60LangMapTable.insert("uz", "SC"); //Uzbek //
- qt2S60LangMapTable.insert("vi", "96"); //Vietnamese //Vietnamese
- qt2S60LangMapTable.insert("vo", "SC"); //Volapuk //
- qt2S60LangMapTable.insert("cy", "97"); //Welsh //Welsh
- qt2S60LangMapTable.insert("wo", "SC"); //Wolof //
- qt2S60LangMapTable.insert("xh", "SC"); //Xhosa //
- qt2S60LangMapTable.insert("yi", "SC"); //Yiddish //
- qt2S60LangMapTable.insert("yo", "SC"); //Yoruba //
- qt2S60LangMapTable.insert("za", "SC"); //Zhuang //
- qt2S60LangMapTable.insert("zu", "98"); //Zulu //Zulu
- qt2S60LangMapTable.insert("nn", "75"); //Nynorsk //NorwegianNynorsk
- qt2S60LangMapTable.insert("bs", "SC"); //Bosnian //
- qt2S60LangMapTable.insert("dv", "SC"); //Divehi //
- qt2S60LangMapTable.insert("gv", "SC"); //Manx //
- qt2S60LangMapTable.insert("kw", "SC"); //Cornish //
- qt2S60LangMapTable.insert("ak", "SC"); //Akan //
- qt2S60LangMapTable.insert("kok", "SC"); //Konkani //
- qt2S60LangMapTable.insert("gaa", "SC"); //Ga //
- qt2S60LangMapTable.insert("ig", "SC"); //Igbo //
- qt2S60LangMapTable.insert("kam", "SC"); //Kamba //
- qt2S60LangMapTable.insert("syr", "SC"); //Syriac //
- qt2S60LangMapTable.insert("byn", "SC"); //Blin //
- qt2S60LangMapTable.insert("gez", "SC"); //Geez //
- qt2S60LangMapTable.insert("kfo", "SC"); //Koro //
- qt2S60LangMapTable.insert("sid", "SC"); //Sidamo //
- qt2S60LangMapTable.insert("cch", "SC"); //Atsam //
- qt2S60LangMapTable.insert("tig", "SC"); //Tigre //
- qt2S60LangMapTable.insert("kaj", "SC"); //Jju //
- qt2S60LangMapTable.insert("fur", "SC"); //Friulian //
- qt2S60LangMapTable.insert("ve", "SC"); //Venda //
- qt2S60LangMapTable.insert("ee", "SC"); //Ewe //
- qt2S60LangMapTable.insert("wa", "SC"); //Walamo //
- qt2S60LangMapTable.insert("haw", "SC"); //Hawaiian //
- qt2S60LangMapTable.insert("kcg", "SC"); //Tyap //
- qt2S60LangMapTable.insert("ny", "SC"); //Chewa //
-}
-
void SymbianMakefileGenerator::appendIfnotExist(QStringList &list, QString value)
{
if (!list.contains(value))
@@ -1834,16 +1141,6 @@ void SymbianMakefileGenerator::appendIfnotExist(QStringList &list, QStringList v
appendIfnotExist(list, item);
}
-QString SymbianMakefileGenerator::removePathSeparators(QString &file)
-{
- QString ret = file;
- while (ret.indexOf(QDir::separator()) > 0) {
- ret.remove(0, ret.indexOf(QDir::separator()) + 1);
- }
-
- return ret;
-}
-
QString SymbianMakefileGenerator::removeTrailingPathSeparators(QString &file)
{
@@ -1875,17 +1172,6 @@ void SymbianMakefileGenerator::generateCleanCommands(QTextStream& t,
}
}
-void SymbianMakefileGenerator::removeSpecialCharacters(QString& str)
-{
- // When modifying this method check also application_icon.prf
- str.replace(QString("/"), QString("_"));
- str.replace(QString("\\"), QString("_"));
- str.replace(QString("-"), QString("_"));
- str.replace(QString(":"), QString("_"));
- str.replace(QString("."), QString("_"));
- str.replace(QString(" "), QString("_"));
-}
-
void SymbianMakefileGenerator::writeSisTargets(QTextStream &t)
{
t << "-include " MAKE_CACHE_NAME << endl;
diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h
index 77d61da..7ff1ce9 100644
--- a/qmake/generators/symbian/symmake.h
+++ b/qmake/generators/symbian/symmake.h
@@ -43,6 +43,7 @@
#define SYMMAKEFILE_H
#include "initprojectdeploy_symbian.h"
+#include "symbiancommon.h"
#include <makefile.h>
QT_BEGIN_NAMESPACE
@@ -53,22 +54,11 @@ QT_BEGIN_NAMESPACE
#define QT_EXTRA_INCLUDE_DIR "tmp"
#define MAKE_CACHE_NAME ".make.cache"
-class SymbianMakefileGenerator : public MakefileGenerator
+class SymbianMakefileGenerator : public MakefileGenerator, public SymbianCommonGenerator
{
protected:
- enum TargetType {
- TypeExe,
- TypeDll,
- TypeLib,
- TypePlugin,
- TypeSubdirs
- };
-
QString platform;
QString uid2;
- QString uid3;
- QString privateDirUid;
- TargetType targetType;
QMap<QString, QStringList> sources;
QMap<QString, QStringList> systeminclude;
QMap<QString, QStringList> library;
@@ -76,19 +66,10 @@ protected:
QMap<QString, QStringList> makmakeCommands;
QStringList overriddenMmpKeywords;
- QStringList generatedFiles;
- QStringList generatedDirs;
- QHash<QString, QString> qt2S60LangMapTable;
-
- QString fixedTarget;
-
- void removeSpecialCharacters(QString& str);
QString fixPathForMmp(const QString& origPath, const QDir& parentDir);
QString canonizePath(const QString& origPath);
virtual bool writeMakefile(QTextStream &t);
- void generatePkgFile(const QString &iconFile, DeploymentList &depList);
- bool containsStartWithItem(const QChar &c, const QStringList& src);
virtual void init();
@@ -127,18 +108,9 @@ protected:
void writeCustomDefFile();
- void writeRegRssFile(QStringList &useritems);
- void writeRssFile(QString &numberOfIcons, QString &iconfile);
- void writeLocFile(QStringList &symbianLangCodes);
- void readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules);
-
- QStringList symbianLangCodesFromTsFiles();
- void fillQt2S60LangMapTable();
-
void appendIfnotExist(QStringList &list, QString value);
void appendIfnotExist(QStringList &list, QStringList values);
- QString removePathSeparators(QString &file);
QString removeTrailingPathSeparators(QString &file);
void generateCleanCommands(QTextStream& t,
const QStringList& toClean,
diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp
index a3a504f..10c201c 100644
--- a/qmake/generators/symbian/symmake_abld.cpp
+++ b/qmake/generators/symbian/symmake_abld.cpp
@@ -417,7 +417,7 @@ bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t)
QString remoteTestPath = epocRoot() + QLatin1String("epoc32\\winscw\\c\\private\\") + privateDirUid; // default 4 OpenC; 4 all Symbian too
DeploymentList depList;
- initProjectDeploySymbian(project, depList, remoteTestPath, false, QLatin1String("winscw"), QLatin1String("udeb"), generatedDirs, generatedFiles);
+ initProjectDeploySymbian(project, depList, remoteTestPath, false, true, QLatin1String("winscw"), QLatin1String("udeb"), generatedDirs, generatedFiles);
if (depList.size())
t << "\t-echo Deploying changed files..." << endl;
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index e081b19..7ab46e2 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -365,7 +365,7 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
// Write winscw deployment rules
QString remoteTestPath = epocRoot() + QLatin1String("epoc32/winscw/c/private/") + privateDirUid;
DeploymentList depList;
- initProjectDeploySymbian(project, depList, remoteTestPath, false, QLatin1String("winscw"), QLatin1String("udeb"), generatedDirs, generatedFiles);
+ initProjectDeploySymbian(project, depList, remoteTestPath, false, true, QLatin1String("winscw"), QLatin1String("udeb"), generatedDirs, generatedFiles);
t << "#if defined(WINSCW)" << endl;
for (int i = 0; i < depList.size(); ++i) {
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index b2f0db1..346663a 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -65,6 +65,10 @@ UnixMakefileGenerator::init()
}
}
+ if (project->isEmpty("QMAKE_PREFIX_SHLIB"))
+ // Prevent crash when using the empty variable.
+ project->values("QMAKE_PREFIX_SHLIB").append("");
+
if(!project->isEmpty("QMAKE_FAILED_REQUIREMENTS")) /* no point */
return;
@@ -451,7 +455,9 @@ UnixMakefileGenerator::findLibraries()
if(!libdirs.contains(f))
libdirs.append(f);
} else if(opt.startsWith("-l")) {
- if (project->isActiveConfig("rvct_linker")) {
+ if (!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) {
+ (*it) = opt.mid(2);
+ } else if (project->isActiveConfig("rvct_linker")) {
(*it) = "lib" + opt.mid(2) + ".so";
} else {
stub = opt.mid(2);
@@ -491,26 +497,29 @@ UnixMakefileGenerator::findLibraries()
QStringList extens;
if(!extn.isNull())
extens << extn;
+ else if (!project->isEmpty("QMAKE_SYMBIAN_SHLIB"))
+ // In Symbian you link to the stub .lib file, but run with the .dll file.
+ extens << "lib";
else
extens << project->values("QMAKE_EXTENSION_SHLIB").first() << "a";
for(QStringList::Iterator extit = extens.begin(); extit != extens.end(); ++extit) {
if(dir.isNull()) {
- QString lib_stub;
for(QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin(); dep_it != libdirs.end(); ++dep_it) {
- if(exists((*dep_it).local() + Option::dir_sep + "lib" + stub +
- "." + (*extit))) {
- lib_stub = stub;
+ QString pathToLib = ((*dep_it).local() + Option::dir_sep
+ + project->values("QMAKE_PREFIX_SHLIB").first()
+ + stub + "." + (*extit));
+ if(exists(pathToLib)) {
+ if (!project->isEmpty("QMAKE_SYMBIAN_SHLIB"))
+ (*it) = pathToLib;
+ else
+ (*it) = "-l" + stub;
+ found = true;
break;
}
}
- if(!lib_stub.isNull()) {
- (*it) = "-l" + lib_stub;
- found = true;
- break;
- }
} else {
- if(exists("lib" + stub + "." + (*extit))) {
- (*it) = "lib" + stub + "." + (*extit);
+ if(exists(project->values("QMAKE_PREFIX_SHLIB").first() + stub + "." + (*extit))) {
+ (*it) = project->values("QMAKE_PREFIX_SHLIB").first() + stub + "." + (*extit);
found = true;
break;
}
@@ -518,8 +527,8 @@ UnixMakefileGenerator::findLibraries()
}
if(!found && project->isActiveConfig("compile_libtool")) {
for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) {
- if(exists(libdirs[dep_i].local() + Option::dir_sep + "lib" + stub + Option::libtool_ext)) {
- (*it) = libdirs[dep_i].real() + Option::dir_sep + "lib" + stub + Option::libtool_ext;
+ if(exists(libdirs[dep_i].local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + stub + Option::libtool_ext)) {
+ (*it) = libdirs[dep_i].real() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + stub + Option::libtool_ext;
found = true;
break;
}
@@ -559,7 +568,7 @@ UnixMakefileGenerator::processPrlFiles()
for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) {
const QMakeLocalFileName &lfn = libdirs[dep_i];
if(!project->isActiveConfig("compile_libtool")) { //give them the .libs..
- QString la = lfn.local() + Option::dir_sep + "lib" + lib + Option::libtool_ext;
+ QString la = lfn.local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + lib + Option::libtool_ext;
if(exists(la) && QFile::exists(lfn.local() + Option::dir_sep + ".libs")) {
QString dot_libs = lfn.real() + Option::dir_sep + ".libs";
l.append("-L" + dot_libs);
@@ -567,7 +576,7 @@ UnixMakefileGenerator::processPrlFiles()
}
}
- QString prl = lfn.local() + Option::dir_sep + "lib" + lib;
+ QString prl = lfn.local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + lib;
if(!project->isEmpty("QMAKE_" + lib.toUpper() + "_SUFFIX"))
prl += project->first("QMAKE_" + lib.toUpper() + "_SUFFIX");
if(processPrlFile(prl)) {
diff --git a/qmake/generators/unix/unixmake.h b/qmake/generators/unix/unixmake.h
index 77bdd01..0ea3350 100644
--- a/qmake/generators/unix/unixmake.h
+++ b/qmake/generators/unix/unixmake.h
@@ -49,7 +49,6 @@ QT_BEGIN_NAMESPACE
class UnixMakefileGenerator : public MakefileGenerator
{
bool init_flag, include_deps;
- bool writeMakefile(QTextStream &);
QString libtoolFileName(bool fixify=true);
void writeLibtoolFile(); // for libtool
QString pkgConfigPrefix() const;
@@ -75,6 +74,7 @@ protected:
virtual void init();
void writeMakeParts(QTextStream &);
+ bool writeMakefile(QTextStream &);
private:
void init2();
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 025882e..6516786 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -233,6 +233,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("QMAKE_BUNDLE")) {
t << "TARGETD = " << escapeFilePath(var("TARGET_x.y")) << endl;
t << "TARGET0 = " << escapeFilePath(var("TARGET_")) << endl;
+ } else if(!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) {
+ t << "TARGETD = " << escapeFilePath(var("TARGET")) << endl;
} else if(project->isEmpty("QMAKE_HPUX_SHLIB")) {
t << "TARGETD = " << escapeFilePath(var("TARGET_x.y.z")) << endl;
t << "TARGET0 = " << escapeFilePath(var("TARGET_")) << endl;
@@ -332,7 +334,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "SUBLIBS = ";
QStringList &l = project->values("SUBLIBS");
for(QStringList::Iterator it = l.begin(); it != l.end(); ++it)
- t << libdir << "lib" << (*it) << ".a ";
+ t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "."
+ << project->first("QMAKE_EXTENSION_STATICLIB") << " ";
t << endl << endl;
}
if(project->isActiveConfig("depend_prl") && !project->isEmpty("QMAKE_PRL_INTERNAL_FILES")) {
@@ -545,6 +548,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
t << endl << endl;
+ } else if(!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) {
+ t << "\n\t"
+ << "-$(DEL_FILE) $(TARGET)" << "\n\t"
+ << var("QMAKE_LINK_SHLIB_CMD");
+ if(!destdir.isEmpty())
+ t << "\n\t"
+ << "-$(DEL_FILE) " << destdir << "$(TARGET)\n\t"
+ << "-$(MOVE) $(TARGET) " << destdir;
+ if(!project->isEmpty("QMAKE_POST_LINK"))
+ t << "\n\t" << var("QMAKE_POST_LINK");
+ t << endl << endl;
} else if(project->isEmpty("QMAKE_HPUX_SHLIB")) {
t << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)" << "\n\t"
@@ -860,7 +874,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
libdir = project->first("SUBLIBS_DIR");
QStringList &l = project->values("SUBLIBS");
for(it = l.begin(); it != l.end(); ++it)
- t << libdir << "lib" << (*it) << ".a" << ":\n\t"
+ t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "."
+ << project->first("QMAKE_EXTENSION_STATICLIB") << ":\n\t"
<< var(QString("MAKELIB") + (*it)) << endl << endl;
}
@@ -875,9 +890,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t-$(LIBTOOL) --mode=clean $(DEL_FILE) " << "$(TARGET)" << endl;
} else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty() &&
!project->isActiveConfig("plugin")) {
- t << "\t-$(DEL_FILE) " << destdir << "$(TARGET)" << " " << endl
- << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) "
- << destdir << "$(TARGET2) $(TARGETA)" << endl;
+ t << "\t-$(DEL_FILE) " << destdir << "$(TARGET)" << " " << endl;
+ if (project->values("QMAKE_SYMBIAN_SHLIB").isEmpty())
+ t << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) "
+ << destdir << "$(TARGET2) $(TARGETA)" << endl;
} else {
t << "\t-$(DEL_FILE) " << "$(TARGET)" << " " << endl;
}
@@ -992,12 +1008,13 @@ void UnixMakefileGenerator::init2()
if (!project->values("QMAKE_CYGWIN_EXE").isEmpty())
project->values("TARGET_EXT").append(".exe");
} else if (project->isActiveConfig("staticlib")) {
- project->values("TARGET").first().prepend("lib");
- project->values("TARGET").first() += ".a";
+ project->values("TARGET").first().prepend(project->first("QMAKE_PREFIX_STATICLIB"));
+ project->values("TARGET").first() += "." + project->first("QMAKE_EXTENSION_STATICLIB");
if(project->values("QMAKE_AR_CMD").isEmpty())
project->values("QMAKE_AR_CMD").append("$(AR) $(TARGET) $(OBJECTS)");
} else {
- project->values("TARGETA").append(project->first("DESTDIR") + "lib" + project->first("TARGET") + ".a");
+ project->values("TARGETA").append(project->first("DESTDIR") + project->first("QMAKE_PREFIX_STATICLIB")
+ + project->first("TARGET") + "." + project->first("QMAKE_EXTENSION_STATICLIB"));
if(project->isActiveConfig("compile_libtool"))
project->values("TARGET_la") = QStringList(project->first("DESTDIR") + "lib" + project->first("TARGET") + Option::libtool_ext);
@@ -1045,7 +1062,8 @@ void UnixMakefileGenerator::init2()
project->first("VER_MAJ"));
project->values("TARGET") = project->values("TARGET_x");
} else if (!project->isEmpty("QMAKE_AIX_SHLIB")) {
- project->values("TARGET_").append("lib" + project->first("TARGET") + ".a");
+ project->values("TARGET_").append(project->first("QMAKE_PREFIX_STATICLIB") + project->first("TARGET")
+ + "." + project->first("QMAKE_EXTENSION_STATICLIB"));
if(project->isActiveConfig("lib_version_first")) {
project->values("TARGET_x").append("lib" + project->first("TARGET") + "." +
project->first("VER_MAJ") + "." +
@@ -1074,6 +1092,10 @@ void UnixMakefileGenerator::init2()
project->first("VER_PAT"));
}
project->values("TARGET") = project->values("TARGET_x.y.z");
+ } else if (!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) {
+ project->values("TARGET_").append(project->first("TARGET") + "." +
+ project->first("QMAKE_EXTENSION_SHLIB"));
+ project->values("TARGET") = project->values("TARGET_");
} else {
project->values("TARGET_").append("lib" + project->first("TARGET") + "." +
project->first("QMAKE_EXTENSION_SHLIB"));
diff --git a/qmake/option.cpp b/qmake/option.cpp
index 18f0541..f775617 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -407,6 +407,7 @@ Option::init(int argc, char **argv)
Option::shellPath = detectShellPath();
#else
Option::dirlist_sep = ":";
+ Option::shellPath = QStringList("sh");
#endif
Option::sysenv_mod = "QMAKE_ENV_";
Option::field_sep = ' ';
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 8871152..b28ed9c 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -511,6 +511,7 @@ enum isForSymbian_enum {
isForSymbian_FALSE = 0,
isForSymbian_ABLD = 1,
isForSymbian_SBSV2 = 2,
+ isForSymbian_MAKEFILE = 3,
};
static isForSymbian_enum isForSymbian_value = isForSymbian_NOT_SET;
@@ -523,11 +524,16 @@ static void init_symbian(const QMap<QString, QStringList>& vars)
if (isForSymbian_value != isForSymbian_NOT_SET)
return;
- QString spec = QFileInfo(Option::mkfile::qmakespec).fileName();
- if (spec.startsWith("symbian-abld", Qt::CaseInsensitive)) {
+ QString spec = QDir::fromNativeSeparators(QFileInfo(Option::mkfile::qmakespec).canonicalFilePath());
+ int pos = spec.lastIndexOf('/');
+ pos = spec.lastIndexOf('/', pos - 1);
+ spec = spec.mid(pos + 1);
+ if (spec.endsWith("symbian-abld", Qt::CaseInsensitive)) {
isForSymbian_value = isForSymbian_ABLD;
- } else if (spec.startsWith("symbian-sbsv2", Qt::CaseInsensitive)) {
+ } else if (spec.endsWith("symbian-sbsv2", Qt::CaseInsensitive)) {
isForSymbian_value = isForSymbian_SBSV2;
+ } else if (spec.startsWith("symbian/", Qt::CaseInsensitive)) {
+ isForSymbian_value = isForSymbian_MAKEFILE;
} else {
QStringList generatorList = vars["MAKEFILE_GENERATOR"];
@@ -544,8 +550,9 @@ static void init_symbian(const QMap<QString, QStringList>& vars)
}
}
- // Force recursive on Symbian, as non-recursive is not really a viable option there
- if (isForSymbian_value != isForSymbian_FALSE)
+ // Force recursive on Symbian native build system, as non-recursive is not really
+ // a viable option there
+ if (isForSymbian_value != isForSymbian_FALSE && isForSymbian_value != isForSymbian_MAKEFILE)
Option::recursive = true;
}
@@ -556,7 +563,7 @@ bool isForSymbian()
if (isForSymbian_value == isForSymbian_NOT_SET)
init_symbian(QMap<QString, QStringList>());
- return (isForSymbian_value != isForSymbian_FALSE);
+ return (isForSymbian_value != isForSymbian_NOT_SET && isForSymbian_value != isForSymbian_FALSE);
}
bool isForSymbianSbsv2()