summaryrefslogtreecommitdiff
path: root/qmake
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2010-12-02 13:13:07 +0100
committerJoão Abecasis <joao.abecasis@nokia.com>2010-12-02 13:13:07 +0100
commit655bae506d4d2743ed016c78a767afa2150057a9 (patch)
tree9ccc2b4a56792616a2c48045faa9bd7081126167 /qmake
parent16252a59afa58b0cb4b0ffb02a330dcf002c9750 (diff)
parentf6f8ba94d5f82b8df723a217a3d0ecb50e570cbc (diff)
downloadqt4-tools-655bae506d4d2743ed016c78a767afa2150057a9.tar.gz
Merge remote branch 'origin/master' into file-engine-refactor
master's version of conflicting def files picked. Conflicts: src/s60installs/bwins/QtCoreu.def src/s60installs/bwins/QtGuiu.def src/s60installs/bwins/QtNetworku.def src/s60installs/eabi/QtCoreu.def src/s60installs/eabi/QtGuiu.def
Diffstat (limited to 'qmake')
-rw-r--r--qmake/Makefile.unix2
-rw-r--r--qmake/Makefile.win323
-rw-r--r--qmake/Makefile.win32-g++2
-rw-r--r--qmake/Makefile.win32-g++-sh2
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.cpp12
-rw-r--r--qmake/generators/symbian/symbian_makefile.h10
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp471
-rw-r--r--qmake/generators/symbian/symbiancommon.h35
-rw-r--r--qmake/generators/symbian/symmake.cpp45
-rw-r--r--qmake/generators/symbian/symmake.h5
-rw-r--r--qmake/generators/symbian/symmake_abld.cpp25
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp33
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp39
-rw-r--r--qmake/generators/win32/msvc_nmake.h2
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp6
-rw-r--r--qmake/generators/win32/winmakefile.cpp27
-rw-r--r--qmake/generators/win32/winmakefile.h1
-rw-r--r--qmake/project.cpp4
-rw-r--r--qmake/qmake.pri6
19 files changed, 427 insertions, 303 deletions
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index f1697a96c9..a24076e610 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -73,7 +73,7 @@ CPPFLAGS = -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/ma
-I$(BUILD_PATH)/src/corelib/global -I$(BUILD_PATH)/src/corelib/xml \
-I$(SOURCE_PATH)/tools/shared \
-DQT_NO_PCRE \
- -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED \
+ -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL \
-DQT_NO_COMPRESS -I$(QMAKESPEC) -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT \
-DQT_NO_GEOM_VARIANT -DQT_NO_DEPRECATED $(OPENSOURCE_CXXFLAGS)
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index c9e623de4d..4d2953743d 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -40,7 +40,8 @@ CFLAGS_BARE = -c -Fo./ \
-I$(SOURCE_PATH)\tools\shared \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NODLL -DQT_NO_STL \
-DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD \
- -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_NO_PCRE -DQT_BOOTSTRAPPED
+ -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_NO_PCRE -DQT_BOOTSTRAPPED \
+ -DQLIBRARYINFO_EPOCROOT
CFLAGS = -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch $(CFLAGS_BARE) $(CFLAGS)
CXXFLAGS_BARE = $(CFLAGS_BARE)
diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++
index 1a20d719ca..59ac8c25c5 100644
--- a/qmake/Makefile.win32-g++
+++ b/qmake/Makefile.win32-g++
@@ -25,7 +25,7 @@ CFLAGS = -c -o$@ -O \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \
-DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \
-DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
- -DQT_BOOTSTRAPPED
+ -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT
CXXFLAGS = $(CFLAGS)
LFLAGS = -static-libgcc -static-libstdc++ -s
LIBS = -lole32 -luuid
diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh
index aad4a9e42d..a84b3f6f16 100644
--- a/qmake/Makefile.win32-g++-sh
+++ b/qmake/Makefile.win32-g++-sh
@@ -25,7 +25,7 @@ CFLAGS = -c -o$@ -O \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \
-DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \
-DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
- -DQT_BOOTSTRAPPED
+ -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT
CXXFLAGS = $(CFLAGS)
LFLAGS = -static-libgcc -static-libstdc++ -s
LIBS = -lole32 -luuid
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
index eb45b10487..2349c11c76 100644
--- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
@@ -47,7 +47,7 @@
#include <qdebug.h>
// Included from tools/shared
-#include <symbian/epocroot.h>
+#include <symbian/epocroot_p.h>
#define SYSBIN_DIR "/sys/bin"
#define HW_Z_DIR "epoc32/data/z"
@@ -75,7 +75,7 @@ static bool isPlugin(const QFileInfo& info, const QString& devicePath)
&& (devicePath.size() < 8
|| (0 != devicePath.compare(QLatin1String(SYSBIN_DIR), Qt::CaseInsensitive)
&& 0 != devicePath.mid(1).compare(QLatin1String(":" SYSBIN_DIR), Qt::CaseInsensitive)
- && 0 != devicePath.compare(epocRoot() + QLatin1String(HW_Z_DIR SYSBIN_DIR))))) {
+ && 0 != devicePath.compare(qt_epocRoot() + QLatin1String(HW_Z_DIR SYSBIN_DIR))))) {
return true;
} else {
return false;
@@ -182,7 +182,7 @@ void initProjectDeploySymbian(QMakeProject* project,
QString deploymentDrive;
if (0 == platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM))) {
- deploymentDrive = epocRoot() + HW_Z_DIR;
+ deploymentDrive = qt_epocRoot() + HW_Z_DIR;
} else {
deploymentDrive = targetPathHasDriveLetter ? targetPath.left(2) : QLatin1String("c:");
}
@@ -225,9 +225,9 @@ void initProjectDeploySymbian(QMakeProject* project,
} else {
if (0 == platform.compare(QLatin1String(EMULATOR_DEPLOYMENT_PLATFORM))) {
if (devicePathHasDriveLetter) {
- devicePath = epocRoot() + "epoc32/winscw/" + devicePath.remove(1, 1);
+ devicePath = qt_epocRoot() + "epoc32/winscw/" + devicePath.remove(1, 1);
} else {
- devicePath = epocRoot() + "epoc32/winscw/c" + devicePath;
+ devicePath = qt_epocRoot() + "epoc32/winscw/c" + devicePath;
}
} else {
if (devicePathHasDriveLetter
@@ -279,7 +279,7 @@ void initProjectDeploySymbian(QMakeProject* project,
// Executables and libraries are deployed to \sys\bin
QFileInfo targetPath;
if (epocBuild)
- targetPath.setFile(epocRoot() + "epoc32/release/" + platform + "/" + build + "/");
+ targetPath.setFile(qt_epocRoot() + "epoc32/release/" + platform + "/" + build + "/");
else
targetPath.setFile(info.path() + QDir::separator());
if(devicePathHasDriveLetter) {
diff --git a/qmake/generators/symbian/symbian_makefile.h b/qmake/generators/symbian/symbian_makefile.h
index 63cede2763..9339223978 100644
--- a/qmake/generators/symbian/symbian_makefile.h
+++ b/qmake/generators/symbian/symbian_makefile.h
@@ -81,18 +81,18 @@ public:
}
}
+ SymbianLocalizationList symbianLocalizationList;
+ parseTsFiles(&symbianLocalizationList);
+
if (generatePkg) {
- generatePkgFile(iconFile, false);
+ generatePkgFile(iconFile, false, symbianLocalizationList);
}
- // 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);
+ writeLocFile(symbianLocalizationList);
}
}
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
index 9d4f27e124..602bcc29df 100644
--- a/qmake/generators/symbian/symbiancommon.cpp
+++ b/qmake/generators/symbian/symbiancommon.cpp
@@ -41,9 +41,10 @@
#include "symbiancommon.h"
#include <qdebug.h>
+#include <qxmlstream.h>
// Included from tools/shared
-#include <symbian/epocroot.h>
+#include <symbian/epocroot_p.h>
#define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\"
@@ -151,7 +152,9 @@ QString romPath(const QString& path)
return QLatin1String("z:") + path;
}
-void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocBuild)
+void SymbianCommonGenerator::generatePkgFile(const QString &iconFile,
+ bool epocBuild,
+ const SymbianLocalizationList &symbianLocalizationList)
{
QMakeProject *project = generator->project;
QString pkgFilename = Option::output_dir + QLatin1Char('/') +
@@ -270,8 +273,17 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
// Apply some defaults if specific data does not exist in PKG pre-rules
if (languageRules.isEmpty()) {
- // language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS)
- languageRules << "; Language\n&EN\n\n";
+ if (symbianLocalizationList.isEmpty()) {
+ languageRules << "; Language\n&EN\n\n";
+ } else {
+ QStringList langCodes;
+ SymbianLocalizationListIterator iter(symbianLocalizationList);
+ while (iter.hasNext()) {
+ const SymbianLocalization &loc = iter.next();
+ langCodes << loc.symbianLanguageCode;
+ }
+ languageRules << QString("; Languages\n&%1\n\n").arg(langCodes.join(","));
+ }
} else if (headerRules.isEmpty()) {
// In case user defines langs, he must take care also about SIS header
fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n");
@@ -320,12 +332,14 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
// Package header
QString sisHeader = "; SIS header: name, uid, version\n#{\"%1\"},(%2),%3\n\n";
- QString visualTarget = project->values("DEPLOYMENT.display_name").join(" ");
- if (visualTarget.isEmpty())
- visualTarget = generator->escapeFilePath(project->first("TARGET"));
- visualTarget = removePathSeparators(visualTarget);
- QString wrapperTarget = visualTarget + " installer";
+ QString defaultVisualTarget = project->values("DEPLOYMENT.display_name").join(" ");
+ if (defaultVisualTarget.isEmpty())
+ defaultVisualTarget = generator->escapeFilePath(project->first("TARGET"));
+ defaultVisualTarget = removePathSeparators(defaultVisualTarget);
+
+ QString visualTarget = generatePkgNameForHeader(symbianLocalizationList, defaultVisualTarget, false);
+ QString wrapperTarget = generatePkgNameForHeader(symbianLocalizationList, defaultVisualTarget, true);
if (installerSisHeader.startsWith("0x", Qt::CaseInsensitive)) {
tw << sisHeader.arg(wrapperTarget).arg(installerSisHeader).arg(applicationVersion);
@@ -344,7 +358,13 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
// Vendor name
if (!containsStartWithItem('%', vendorRules)) {
- vendorRules << "; Default localized vendor name\n%{\"Vendor\"}\n\n";
+ QString vendorStr = QLatin1String("\"Vendor\",");
+ QString locVendors = vendorStr;
+ for (int i = 1; i < symbianLocalizationList.size(); i++) {
+ locVendors.append(vendorStr);
+ }
+ locVendors.chop(1);
+ vendorRules << QString("; Default localized vendor name\n%{%1}\n\n").arg(locVendors);
}
if (!containsStartWithItem(':', vendorRules)) {
vendorRules << "; Default unique vendor name\n:\"Vendor\"\n\n";
@@ -385,12 +405,19 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
t << manufacturerStr << endl;
}
+ // ### FIXME: remove epocBuild check once makefile based mkspecs support localized resource generation
+ if (epocBuild && symbianLocalizationList.size()) {
+ // Add localized resources to DEPLOYMENT if default resource deployment is done
+ addLocalizedResourcesToDeployment("default_resource_deployment.sources", symbianLocalizationList);
+ addLocalizedResourcesToDeployment("default_reg_deployment.sources", symbianLocalizationList);
+ }
+
// deploy files specified by DEPLOYMENT variable
QString remoteTestPath;
QString zDir;
remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid);
if (epocBuild)
- zDir = epocRoot() + QLatin1String("epoc32/data/z");
+ zDir = qt_epocRoot() + QLatin1String("epoc32/data/z");
DeploymentList depList;
initProjectDeploySymbian(project, depList, remoteTestPath, true, epocBuild, "$(PLATFORM)", "$(TARGET)", generatedDirs, generatedFiles);
@@ -633,12 +660,9 @@ void SymbianCommonGenerator::writeRssFile(QString &numberOfIcons, QString &iconF
}
}
-void SymbianCommonGenerator::writeLocFile(QStringList &symbianLangCodes)
+void SymbianCommonGenerator::writeLocFile(const SymbianLocalizationList &symbianLocalizationList)
{
- QString filename(fixedTarget);
- if (!Option::output_dir.isEmpty())
- filename = Option::output_dir + '/' + filename;
- filename.append(".loc");
+ QString filename = generateLocFileName();
QFile ft(filename);
if (ft.open(QIODevice::WriteOnly)) {
generatedFiles << ft.fileName();
@@ -658,11 +682,22 @@ void SymbianCommonGenerator::writeLocFile(QStringList &symbianLangCodes)
t << "#ifdef LANGUAGE_SC" << endl;
t << "#define STRING_r_short_caption \"" << displayName << "\"" << endl;
t << "#define STRING_r_caption \"" << displayName << "\"" << endl;
- foreach(QString lang, symbianLangCodes) {
- t << "#elif defined LANGUAGE_" << lang << endl;
- t << "#define STRING_r_short_caption \"" << displayName << "\"" << endl;
- t << "#define STRING_r_caption \"" << displayName << "\"" << endl;
+
+ SymbianLocalizationListIterator iter(symbianLocalizationList);
+ while (iter.hasNext()) {
+ const SymbianLocalization &loc = iter.next();
+ QString shortCaption = loc.shortCaption;
+ QString longCaption = loc.longCaption;
+ if (shortCaption.isEmpty())
+ shortCaption = displayName;
+ if (longCaption.isEmpty())
+ longCaption = displayName;
+
+ t << "#elif defined LANGUAGE_" << loc.symbianLanguageCode << endl;
+ t << "#define STRING_r_short_caption \"" << shortCaption << "\"" << endl;
+ t << "#define STRING_r_caption \"" << longCaption << "\"" << endl;
}
+
t << "#else" << endl;
t << "#define STRING_r_short_caption \"" << displayName << "\"" << endl;
t << "#define STRING_r_caption \"" << displayName << "\"" << endl;
@@ -803,195 +838,49 @@ void SymbianCommonGenerator::writeCustomDefFile()
}
}
-QStringList SymbianCommonGenerator::symbianLangCodesFromTsFiles()
+void SymbianCommonGenerator::parseTsFiles(SymbianLocalizationList *symbianLocalizationList)
{
- QStringList tsfiles;
- QStringList symbianLangCodes;
- tsfiles << generator->project->values("TRANSLATIONS");
+ if (!generator->project->isActiveConfig("localize_deployment")) {
+ return;
+ }
- fillQt2S60LangMapTable();
+ QStringList symbianTsFiles;
- 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"));
+ symbianTsFiles << generator->project->values("SYMBIAN_MATCHED_TRANSLATIONS");
- if (!symbianLangCodes.contains(s60lang) && s60lang != "SC")
- symbianLangCodes += s60lang;
- }
+ if (!symbianTsFiles.isEmpty()) {
+ fillQt2SymbianLocalizationList(symbianLocalizationList);
- return symbianLangCodes;
+ QMutableListIterator<SymbianLocalization> iter(*symbianLocalizationList);
+ while (iter.hasNext()) {
+ SymbianLocalization &loc = iter.next();
+ static QString matchStrTemplate = QLatin1String(".*_%1\\.ts");
+ QString matchStr = matchStrTemplate.arg(loc.qtLanguageCode);
+
+ foreach (QString file, symbianTsFiles) {
+ QRegExp matcher(matchStr);
+ if (matcher.exactMatch(file) && parseTsContent(file, &loc))
+ break;
+ }
+ }
+ }
}
-void SymbianCommonGenerator::fillQt2S60LangMapTable()
+void SymbianCommonGenerator::fillQt2SymbianLocalizationList(SymbianLocalizationList *symbianLocalizationList)
{
- 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 //
+ static QString symbianCodePrefix = QLatin1String("SYMBIAN_LANG.");
+
+ QStringList symbianLanguages = generator->project->values("SYMBIAN_MATCHED_LANGUAGES");
+
+ foreach (QString qtCode, symbianLanguages) {
+ SymbianLocalization newLoc;
+ QString symbianCodeVariable = symbianCodePrefix + qtCode;
+ newLoc.symbianLanguageCode = generator->project->first(symbianCodeVariable);
+ if (!newLoc.symbianLanguageCode.isEmpty()) {
+ newLoc.qtLanguageCode = qtCode;
+ symbianLocalizationList->append(newLoc);
+ }
+ }
}
void SymbianCommonGenerator::parsePreRules(const QString &deploymentVariable,
@@ -1057,3 +946,183 @@ void SymbianCommonGenerator::parsePostRules(const QString &deploymentVariable,
}
}
+bool SymbianCommonGenerator::parseTsContent(const QString &tsFilename, SymbianLocalization *loc)
+{
+ bool retval = true;
+ QMakeProject *project = generator->project;
+ QFile tsFile(tsFilename);
+
+ if (tsFile.exists()) {
+ if (tsFile.open(QIODevice::ReadOnly)) {
+ static QString applicationCaptionsContext = QLatin1String("QtApplicationCaptions");
+ static QString pkgNameContext = QLatin1String("QtPackageNames");
+ static QString tsElement = QLatin1String("TS");
+ static QString contextElement = QLatin1String("context");
+ static QString nameElement = QLatin1String("name");
+ static QString messageElement = QLatin1String("message");
+ static QString sourceElement = QLatin1String("source");
+ static QString translationElement = QLatin1String("translation");
+ static QString shortCaptionId = QLatin1String("Application short caption");
+ static QString longCaptionId = QLatin1String("Application long caption");
+ static QString pkgDisplayNameId = QLatin1String("Package name");
+ static QString installerPkgDisplayNameId = QLatin1String("Smart installer package name");
+ static QString languageAttribute = QLatin1String("language");
+ static QChar underscoreChar = QLatin1Char('_');
+
+ enum CurrentContext {
+ ContextUnknown,
+ ContextUninteresting,
+ ContextInteresting
+ };
+
+ QXmlStreamReader xml(&tsFile);
+
+ while (xml.name() != tsElement)
+ xml.readNextStartElement();
+
+ while (xml.readNextStartElement()) {
+ if (xml.name() == contextElement) {
+ CurrentContext currentContext = ContextUnknown;
+ while (xml.readNextStartElement()) {
+ if (currentContext == ContextUnknown) {
+ // Expect name element before message elements
+ if (xml.name() == nameElement) {
+ QString nameText = xml.readElementText();
+ if (nameText == applicationCaptionsContext || nameText == pkgNameContext) {
+ currentContext = ContextInteresting;
+ } else {
+ currentContext = ContextUninteresting;
+ }
+ } else {
+ xml.skipCurrentElement();
+ }
+ } else if (currentContext == ContextInteresting) {
+ if (xml.name() == messageElement) {
+ QString source;
+ QString translation;
+ while (xml.readNextStartElement()) {
+ if (xml.name() == sourceElement) {
+ source = xml.readElementText();
+ } else if (xml.name() == translationElement) {
+ translation = xml.readElementText();
+ } else {
+ xml.skipCurrentElement();
+ }
+ }
+
+ if (source == shortCaptionId) {
+ if (loc->shortCaption.isEmpty()) {
+ loc->shortCaption = translation;
+ } else {
+ fprintf(stderr, "Warning: Duplicate application short caption defined in (%s).\n",
+ qPrintable(tsFilename));
+ }
+ } else if (source == longCaptionId) {
+ if (loc->longCaption.isEmpty()) {
+ loc->longCaption = translation;
+ } else {
+ fprintf(stderr, "Warning: Duplicate application long caption defined in (%s).\n",
+ qPrintable(tsFilename));
+ }
+ } else if (source == pkgDisplayNameId) {
+ if (loc->pkgDisplayName.isEmpty()) {
+ loc->pkgDisplayName = translation;
+ } else {
+ fprintf(stderr, "Warning: Duplicate package display name defined in (%s).\n",
+ qPrintable(tsFilename));
+ }
+ } else if (source == installerPkgDisplayNameId) {
+ if (loc->installerPkgDisplayName.isEmpty()) {
+ loc->installerPkgDisplayName = translation;
+ } else {
+ fprintf(stderr, "Warning: Duplicate smart installer package display name defined in (%s).\n",
+ qPrintable(tsFilename));
+ }
+ }
+ } else {
+ xml.skipCurrentElement();
+ }
+ } else {
+ xml.skipCurrentElement();
+ }
+ }
+ } else {
+ xml.skipCurrentElement();
+ }
+ }
+ if (xml.hasError()) {
+ retval = false;
+ fprintf(stderr, "ERROR: Encountered error \"%s\" when parsing ts file (%s).\n",
+ qPrintable(xml.errorString()), qPrintable(tsFilename));
+ }
+ } else {
+ retval = false;
+ fprintf(stderr, "Warning: Could not open ts file (%s).\n", qPrintable(tsFilename));
+ }
+ } else {
+ retval = false;
+ fprintf(stderr, "Warning: ts file does not exist: (%s), unable to parse it.\n",
+ qPrintable(tsFilename));
+ }
+
+ return retval;
+}
+
+QString SymbianCommonGenerator::generatePkgNameForHeader(const SymbianLocalizationList &symbianLocalizationList,
+ const QString &defaultName,
+ bool isForSmartInstaller)
+{
+ QStringList allNames;
+ QString noTranslation = defaultName;
+
+ if (isForSmartInstaller)
+ noTranslation += QLatin1String(" installer");
+
+ SymbianLocalizationListIterator iter(symbianLocalizationList);
+ while (iter.hasNext()) {
+ const SymbianLocalization &loc = iter.next();
+ QString currentName;
+ if (isForSmartInstaller) {
+ currentName = loc.installerPkgDisplayName;
+ } else {
+ currentName = loc.pkgDisplayName;
+ }
+
+ if (currentName.isEmpty())
+ currentName = noTranslation;
+
+ allNames << currentName;
+ }
+
+ if (!allNames.size())
+ allNames << noTranslation;
+
+ return allNames.join("\",\"");
+
+}
+
+void SymbianCommonGenerator::addLocalizedResourcesToDeployment(const QString &deploymentFilesVar,
+ const SymbianLocalizationList &symbianLocalizationList)
+{
+ QStringList locResources;
+ foreach (QString defaultResource, generator->project->values(deploymentFilesVar)) {
+ if (defaultResource.endsWith(".rsc")) {
+ defaultResource.chop(2);
+ SymbianLocalizationListIterator iter(symbianLocalizationList);
+ while (iter.hasNext()) {
+ const SymbianLocalization &loc = iter.next();
+ locResources << QString(defaultResource + loc.symbianLanguageCode);
+ }
+ }
+ }
+ generator->project->values(deploymentFilesVar) << locResources;
+}
+
+QString SymbianCommonGenerator::generateLocFileName()
+{
+ QString fileName(fixedTarget);
+ if (!Option::output_dir.isEmpty())
+ fileName = Option::output_dir + QLatin1Char('/') + fileName;
+ fileName.append(".loc");
+ return fileName;
+}
diff --git a/qmake/generators/symbian/symbiancommon.h b/qmake/generators/symbian/symbiancommon.h
index 80f2079e0d..1db5890448 100644
--- a/qmake/generators/symbian/symbiancommon.h
+++ b/qmake/generators/symbian/symbiancommon.h
@@ -48,6 +48,20 @@
#define PRINT_FILE_CREATE_ERROR(filename) fprintf(stderr, "Error: Could not create '%s'\n", qPrintable(filename));
+class SymbianLocalization
+{
+public:
+ QString qtLanguageCode;
+ QString symbianLanguageCode;
+ QString shortCaption;
+ QString longCaption;
+ QString pkgDisplayName;
+ QString installerPkgDisplayName;
+};
+
+typedef QList<SymbianLocalization> SymbianLocalizationList;
+typedef QListIterator<SymbianLocalization> SymbianLocalizationListIterator;
+
class SymbianCommonGenerator
{
public:
@@ -59,6 +73,7 @@ public:
TypeSubdirs
};
+
SymbianCommonGenerator(MakefileGenerator *generator);
virtual void init();
@@ -68,7 +83,9 @@ protected:
QString removePathSeparators(QString &file);
void removeSpecialCharacters(QString& str);
void removeEpocSpecialCharacters(QString& str);
- void generatePkgFile(const QString &iconFile, bool epocBuild);
+ void generatePkgFile(const QString &iconFile,
+ bool epocBuild,
+ const SymbianLocalizationList &symbianLocalizationList);
bool containsStartWithItem(const QChar &c, const QStringList& src);
void writeRegRssFile(QMap<QString, QStringList> &useritems);
@@ -76,15 +93,15 @@ protected:
const QString &listTag,
const QString &listItem);
void writeRssFile(QString &numberOfIcons, QString &iconfile);
- void writeLocFile(QStringList &symbianLangCodes);
+ void writeLocFile(const SymbianLocalizationList &symbianLocalizationList);
void readRssRules(QString &numberOfIcons,
QString &iconFile,
QMap<QString, QStringList> &userRssRules);
void writeCustomDefFile();
- QStringList symbianLangCodesFromTsFiles();
- void fillQt2S60LangMapTable();
+ void parseTsFiles(SymbianLocalizationList *symbianLocalizationList);
+ void fillQt2SymbianLocalizationList(SymbianLocalizationList *symbianLocalizationList);
void parsePreRules(const QString &deploymentVariable,
const QString &variableSuffix,
@@ -95,7 +112,13 @@ protected:
void parsePostRules(const QString &deploymentVariable,
const QString &variableSuffix,
QStringList *rawRuleList);
-
+ bool parseTsContent(const QString &tsFilename, SymbianLocalization *loc);
+ QString generatePkgNameForHeader(const SymbianLocalizationList &symbianLocalizationList,
+ const QString &defaultName,
+ bool isForSmartInstaller);
+ void addLocalizedResourcesToDeployment(const QString &deploymentFilesVar,
+ const SymbianLocalizationList &symbianLocalizationList);
+ QString generateLocFileName();
protected:
MakefileGenerator *generator;
@@ -106,8 +129,6 @@ protected:
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 0d63cdfff6..7a5a33636b 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -50,7 +50,7 @@
#include <qdebug.h>
// Included from tools/shared
-#include <symbian/epocroot.h>
+#include <symbian/epocroot_p.h>
#define RESOURCE_DIRECTORY_MMP "/resource/apps"
#define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps"
@@ -87,10 +87,10 @@ QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const Q
{
static QString epocRootStr;
if (epocRootStr.isEmpty()) {
- epocRootStr = epocRoot();
+ epocRootStr = qt_epocRoot();
QFileInfo efi(epocRootStr);
if (!efi.exists() || epocRootStr.isEmpty()) {
- fprintf(stderr, "Unable to resolve epocRoot '%s' to real dir on current drive, defaulting to '/' for mmp paths\n", qPrintable(epocRoot()));
+ fprintf(stderr, "Unable to resolve epocRoot '%s' to real dir on current drive, defaulting to '/' for mmp paths\n", qPrintable(qt_epocRoot()));
epocRootStr = "/";
} else {
epocRootStr = efi.absoluteFilePath();
@@ -122,7 +122,7 @@ QString SymbianMakefileGenerator::absolutizePath(const QString& origPath)
// Prepend epocroot to any paths beginning with "/epoc32/"
QString resultPath = QDir::fromNativeSeparators(origPath);
if (resultPath.startsWith("/epoc32/", Qt::CaseInsensitive))
- resultPath = QDir::fromNativeSeparators(epocRoot()) + resultPath.mid(1);
+ resultPath = QDir::fromNativeSeparators(qt_epocRoot()) + resultPath.mid(1);
QFileInfo fi(fileInfo(resultPath));
@@ -187,8 +187,8 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
QMap<QString, QStringList> userRssRules;
readRssRules(numberOfIcons, iconFile, userRssRules);
- // Get the application translations and convert to symbian OS lang code, i.e. decical number
- QStringList symbianLangCodes = symbianLangCodesFromTsFiles();
+ SymbianLocalizationList symbianLocalizationList;
+ parseTsFiles(&symbianLocalizationList);
// Generate pkg files if there are any actual files to deploy
bool generatePkg = false;
@@ -207,7 +207,7 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
}
if (generatePkg) {
- generatePkgFile(iconFile, true);
+ generatePkgFile(iconFile, true, symbianLocalizationList);
}
writeBldInfContent(t, generatePkg, iconFile);
@@ -244,13 +244,13 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
writeMkFile(wrapperFileName, false);
QString absoluteMmpFileName = Option::output_dir + QLatin1Char('/') + mmpFileName;
- writeMmpFile(absoluteMmpFileName, symbianLangCodes);
+ writeMmpFile(absoluteMmpFileName, symbianLocalizationList);
if (targetType == TypeExe) {
if (!project->isActiveConfig("no_icon")) {
writeRegRssFile(userRssRules);
writeRssFile(numberOfIcons, iconFile);
- writeLocFile(symbianLangCodes);
+ writeLocFile(symbianLocalizationList);
}
}
@@ -491,7 +491,7 @@ void SymbianMakefileGenerator::writeMmpFileHeader(QTextStream &t)
t << "// ==============================================================================" << endl << endl;
}
-void SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symbianLangCodes)
+void SymbianMakefileGenerator::writeMmpFile(QString &filename, const SymbianLocalizationList &symbianLocalizationList)
{
QFile ft(filename);
if (ft.open(QIODevice::WriteOnly)) {
@@ -503,7 +503,7 @@ void SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symb
writeMmpFileTargetPart(t);
- writeMmpFileResourcePart(t, symbianLangCodes);
+ writeMmpFileResourcePart(t, symbianLocalizationList);
writeMmpFileMacrosPart(t);
@@ -645,7 +645,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t)
Application registration resource files should be installed to the
\private\10003a3f\import\apps directory.
*/
-void SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes)
+void SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, const SymbianLocalizationList &symbianLocalizationList)
{
if ((targetType == TypeExe) &&
!project->isActiveConfig("no_icon")) {
@@ -655,8 +655,10 @@ void SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringL
t << "SOURCEPATH\t\t\t. " << endl;
t << "LANG SC "; // no endl
- foreach(QString lang, symbianLangCodes) {
- t << lang << " "; // no endl
+ SymbianLocalizationListIterator iter(symbianLocalizationList);
+ while (iter.hasNext()) {
+ const SymbianLocalization &loc = iter.next();
+ t << loc.symbianLanguageCode << " "; // no endl
}
t << endl;
t << MMP_START_RESOURCE "\t\t" << locTarget << endl;
@@ -1098,3 +1100,18 @@ void SymbianMakefileGenerator::generateDistcleanTargets(QTextStream& t)
t << "distclean: clean dodistclean" << endl;
t << endl;
}
+
+// Returns a string that can be used as a dependency to loc file on other targets
+QString SymbianMakefileGenerator::generateLocFileTarget(QTextStream& t, const QString& locCmd)
+{
+ QString locFile;
+ if (targetType == TypeExe && !project->isActiveConfig("no_icon")) {
+ locFile = Option::fixPathToLocalOS(generateLocFileName());
+ t << locFile << QLatin1String(": ") << project->values("SYMBIAN_MATCHED_TRANSLATIONS").join(" ") << endl;
+ t << locCmd << endl;
+ t << endl;
+ locFile += QLatin1Char(' ');
+ }
+
+ return locFile;
+}
diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h
index a1a8e887c1..aba11dea12 100644
--- a/qmake/generators/symbian/symmake.h
+++ b/qmake/generators/symbian/symmake.h
@@ -97,11 +97,11 @@ protected:
static bool removeDuplicatedStrings(QStringList& stringList);
void writeMmpFileHeader(QTextStream &t);
- void writeMmpFile(QString &filename, QStringList &symbianLangCodes);
+ void writeMmpFile(QString &filename, const SymbianLocalizationList &symbianLocalizationList);
void writeMmpFileMacrosPart(QTextStream& t);
void addMacro(QTextStream& t, const QString& value);
void writeMmpFileTargetPart(QTextStream& t);
- void writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes);
+ void writeMmpFileResourcePart(QTextStream& t, const SymbianLocalizationList &symbianLocalizationList);
void writeMmpFileSystemIncludePart(QTextStream& t);
void writeMmpFileIncludePart(QTextStream& t);
void writeMmpFileLibraryPart(QTextStream& t);
@@ -131,6 +131,7 @@ protected:
const QString& itemSuffix);
void generateDistcleanTargets(QTextStream& t);
+ QString generateLocFileTarget(QTextStream& t, const QString& locCmd);
// Subclass implements
virtual void writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile) = 0;
diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp
index f8951098a1..eb39d36170 100644
--- a/qmake/generators/symbian/symmake_abld.cpp
+++ b/qmake/generators/symbian/symmake_abld.cpp
@@ -49,7 +49,7 @@
#include <qdebug.h>
// Included from tools/shared
-#include <symbian/epocroot.h>
+#include <symbian/epocroot_p.h>
#define DO_NOTHING_TARGET "do_nothing"
#define CREATE_TEMPS_TARGET "create_temps"
@@ -184,16 +184,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
QTextStream t(&wrapperFile);
- t << "# ==============================================================================" << endl;
- t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
- t << QDateTime::currentDateTime().toString() << endl;
- t << "# This file is generated by qmake and should not be modified by the" << endl;
- t << "# user." << endl;
- t << "# Name : " << wrapperFile.fileName() << endl;
- t << "# Description : Wrapper Makefile for calling Symbian build tools" << endl;
- t << "#" << endl;
- t << "# ==============================================================================" << "\n" << endl;
- t << endl;
+ MakefileGenerator::writeHeader(t);
t << "MAKEFILE = " << fileInfo(wrapperFile.fileName()).fileName() << endl;
t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
@@ -267,12 +258,14 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
t << "\tbldmake bldfiles" << endl;
t << endl;
- t << "debug: $(ABLD)" << endl;
+ QString locFileDep = generateLocFileTarget(t, qmakeCmd);
+
+ t << "debug: " << locFileDep << "$(ABLD)" << endl;
foreach(QString item, debugPlatforms) {
t << "\t$(ABLD)" << testClause << " build " << item << " udeb" << endl;
}
t << endl;
- t << "release: $(ABLD)" << endl;
+ t << "release: " << locFileDep << "$(ABLD)" << endl;
foreach(QString item, releasePlatforms) {
t << "\t$(ABLD)" << testClause << " build " << item << " urel" << endl;
}
@@ -280,12 +273,12 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
// For more specific builds, targets are in this form: build-platform, e.g. release-armv5
foreach(QString item, debugPlatforms) {
- t << "debug-" << item << ": $(ABLD)" << endl;
+ t << "debug-" << item << ": " << locFileDep << "$(ABLD)" << endl;
t << "\t$(ABLD)" << testClause << " build " << item << " udeb" << endl;
}
foreach(QString item, releasePlatforms) {
- t << "release-" << item << ": $(ABLD)" << endl;
+ t << "release-" << item << ": " << locFileDep << "$(ABLD)" << endl;
t << "\t$(ABLD)" << testClause << " build " << item << " urel" << endl;
}
@@ -429,7 +422,7 @@ bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t, bool i
else
t << WINSCW_DEPLOYMENT_TARGET ":" << endl;
- QString remoteTestPath = epocRoot()
+ QString remoteTestPath = qt_epocRoot()
+ QDir::toNativeSeparators(QLatin1String(isRom ? "epoc32/data/z/private/"
: "epoc32/winscw/c/private/"))
+ privateDirUid;
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index d650e083bc..c4b51f227a 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -49,7 +49,7 @@
#include <qdebug.h>
// Included from tools/shared
-#include <symbian/epocroot.h>
+#include <symbian/epocroot_p.h>
SymbianSbsv2MakefileGenerator::SymbianSbsv2MakefileGenerator() : SymbianMakefileGenerator() { }
SymbianSbsv2MakefileGenerator::~SymbianSbsv2MakefileGenerator() { }
@@ -82,7 +82,7 @@ void SymbianSbsv2MakefileGenerator::exportFlm()
QDir sourceDir = QDir(QLibraryInfo::location(QLibraryInfo::PrefixPath) + FLM_SOURCE_DIR);
QFileInfoList sourceInfos = sourceDir.entryInfoList(QDir::Files);
- QDir destDir(epocRoot() + FLM_DEST_DIR);
+ QDir destDir(qt_epocRoot() + FLM_DEST_DIR);
if (!destDir.exists()) {
if (destDir.mkpath(destDir.absolutePath()))
generatedDirs << destDir.absolutePath();
@@ -324,16 +324,8 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
QTextStream t(&wrapperFile);
- t << "# ==============================================================================" << endl;
- t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
- t << QDateTime::currentDateTime().toString() << endl;
- t << "# This file is generated by qmake and should not be modified by the" << endl;
- t << "# user." << endl;
- t << "# Name : " << wrapperFile.fileName() << endl;
- t << "# Description : Wrapper Makefile for calling Symbian build tools" << endl;
- t << "#" << endl;
- t << "# ==============================================================================" << "\n" << endl;
- t << endl;
+ MakefileGenerator::writeHeader(t);
+
t << "MAKEFILE = " << fileInfo(wrapperFile.fileName()).fileName() << endl;
t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
@@ -386,8 +378,9 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
t << endl;
QString currentClause;
+ QString locFileDep = generateLocFileTarget(t, qmakeCmd);
- t << "debug: " << BLD_INF_FILENAME << endl;
+ t << "debug: " << locFileDep << BLD_INF_FILENAME << endl;
t << "\t$(SBS)";
foreach(QString clause, debugClauses) {
t << clause;
@@ -399,7 +392,7 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
t << clause;
}
t << endl;
- t << "release: " << BLD_INF_FILENAME << endl;
+ t << "release: " << locFileDep << BLD_INF_FILENAME << endl;
t << "\t$(SBS)";
foreach(QString clause, releaseClauses) {
t << clause;
@@ -431,7 +424,7 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
else // use generic arm clause
clause = configClause(item, debugBuild, defaultRvctCompilerVersion, genericArmClause);
- t << "debug-" << item << ": " << BLD_INF_FILENAME << endl;
+ t << "debug-" << item << ": " << locFileDep << BLD_INF_FILENAME << endl;
t << "\t$(SBS)" << clause << endl;
t << "clean-debug-" << item << ": " << BLD_INF_FILENAME << endl;
t << "\t$(SBS) reallyclean" << clause << endl;
@@ -444,7 +437,7 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
else // use generic arm clause
clause = configClause(item, releaseBuild, defaultRvctCompilerVersion, genericArmClause);
- t << "release-" << item << ": " << BLD_INF_FILENAME << endl;
+ t << "release-" << item << ": " << locFileDep << BLD_INF_FILENAME << endl;
t << "\t$(SBS)" << clause << endl;
t << "clean-release-" << item << ": " << BLD_INF_FILENAME << endl;
t << "\t$(SBS) reallyclean" << clause << endl;
@@ -454,11 +447,11 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
foreach(QString compilerVersion, allArmCompilerVersions) {
QString debugClause = configClause(item, debugBuild, compilerVersion, armClause);
QString releaseClause = configClause(item, releaseBuild, compilerVersion, armClause);
- t << "debug-" << item << "-" << compilerVersion << ": " << BLD_INF_FILENAME << endl;
+ t << "debug-" << item << "-" << compilerVersion << ": " << locFileDep << BLD_INF_FILENAME << endl;
t << "\t$(SBS)" << debugClause << endl;
t << "clean-debug-" << item << "-" << compilerVersion << ": " << BLD_INF_FILENAME << endl;
t << "\t$(SBS) reallyclean" << debugClause << endl;
- t << "release-" << item << "-" << compilerVersion << ": " << BLD_INF_FILENAME << endl;
+ t << "release-" << item << "-" << compilerVersion << ": " << locFileDep << BLD_INF_FILENAME << endl;
t << "\t$(SBS)" << releaseClause << endl;
t << "clean-release-" << item << "-" << compilerVersion << ": " << BLD_INF_FILENAME << endl;
t << "\t$(SBS) reallyclean" << releaseClause << endl;
@@ -629,7 +622,7 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
t << endl;
// Write deployment rules
- QString remoteTestPath = epocRoot() + QLatin1String("epoc32/winscw/c/private/") + privateDirUid;
+ QString remoteTestPath = qt_epocRoot() + QLatin1String("epoc32/winscw/c/private/") + privateDirUid;
DeploymentList depList;
//write emulator deployment
@@ -640,7 +633,7 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
t << "#endif" << endl;
//write ROM deployment
- remoteTestPath = epocRoot() + QLatin1String("epoc32/data/z/private/") + privateDirUid;
+ remoteTestPath = qt_epocRoot() + QLatin1String("epoc32/data/z/private/") + privateDirUid;
depList.clear();
initProjectDeploySymbian(project, depList, remoteTestPath, false, true,
QLatin1String(ROM_DEPLOYMENT_PLATFORM), QString(), generatedDirs, generatedFiles);
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index 0678d86bca..b72a8dfd0b 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -85,6 +85,45 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
return false;
}
+QString NmakeMakefileGenerator::getPdbTarget()
+{
+ return QString(project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".pdb");
+}
+
+QString NmakeMakefileGenerator::defaultInstall(const QString &t)
+{
+ if((t != "target" && t != "dlltarget") ||
+ (t == "dlltarget" && (project->first("TEMPLATE") != "lib" || !project->isActiveConfig("shared"))) ||
+ project->first("TEMPLATE") == "subdirs")
+ return QString();
+
+ QString ret = Win32MakefileGenerator::defaultInstall(t);
+
+ const QString root = "$(INSTALL_ROOT)";
+ QStringList &uninst = project->values(t + ".uninstall");
+ QString targetdir = Option::fixPathToTargetOS(project->first(t + ".path"), false);
+ targetdir = fileFixify(targetdir, FileFixifyAbsolute);
+ if(targetdir.right(1) != Option::dir_sep)
+ targetdir += Option::dir_sep;
+
+ if(t == "target" && project->first("TEMPLATE") == "lib") {
+ if(project->isActiveConfig("shared") && project->isActiveConfig("debug")) {
+ QString pdb_target = getPdbTarget();
+ pdb_target.remove('"');
+ QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target;
+ QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + pdb_target, FileFixifyAbsolute));
+ if(!ret.isEmpty())
+ ret += "\n\t";
+ ret += QString("-$(INSTALL_FILE)") + " \"" + src_targ + "\" \"" + dst_targ + "\"";
+ if(!uninst.isEmpty())
+ uninst.append("\n\t");
+ uninst.append("-$(DEL_FILE) \"" + dst_targ + "\"");
+ }
+ }
+
+ return ret;
+}
+
QStringList &NmakeMakefileGenerator::findDependencies(const QString &file)
{
QStringList &aList = MakefileGenerator::findDependencies(file);
diff --git a/qmake/generators/win32/msvc_nmake.h b/qmake/generators/win32/msvc_nmake.h
index a751e454fc..b3fcb82dd1 100644
--- a/qmake/generators/win32/msvc_nmake.h
+++ b/qmake/generators/win32/msvc_nmake.h
@@ -57,6 +57,8 @@ class NmakeMakefileGenerator : public Win32MakefileGenerator
void init();
protected:
+ virtual QString getPdbTarget();
+ virtual QString defaultInstall(const QString &t);
virtual QStringList &findDependencies(const QString &file);
QString var(const QString &value);
QString precompH, precompObj, precompPch;
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index fbaa6c2876..8719045a2f 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -66,7 +66,7 @@ QT_END_NAMESPACE
#ifdef Q_OS_WIN32
#include <qt_windows.h>
-#include <windows/registry.h>
+#include <windows/registry_p.h>
QT_BEGIN_NAMESPACE
@@ -118,7 +118,7 @@ DotNET which_dotnet_version()
int installed = 0;
int i = 0;
for(; dotNetCombo[i].version; ++i) {
- QString path = readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey);
+ QString path = qt_readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey);
if(!path.isEmpty()) {
++installed;
current_version = dotNetCombo[i].version;
@@ -135,7 +135,7 @@ DotNET which_dotnet_version()
i = installed = 0;
for(; dotNetCombo[i].version; ++i) {
- QString productPath = readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey).toLower();
+ QString productPath = qt_readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey).toLower();
if (productPath.isEmpty())
continue;
QStringList::iterator it;
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index ddfe399bc0..8cf970efe2 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -78,8 +78,14 @@ Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem
int biggest=-1;
if(!project->isActiveConfig("no_versionlink")) {
- QDir dir(bd);
- QStringList entries = dir.entryList();
+ static QHash<QString, QStringList> dirEntryListCache;
+ QStringList entries = dirEntryListCache.value(bd);
+ if (entries.isEmpty()) {
+ QDir dir(bd);
+ entries = dir.entryList();
+ dirEntryListCache.insert(bd, entries);
+ }
+
QRegExp regx(QString("((lib)?%1([0-9]*)).(%2|prl)$").arg(dllStem).arg(ext), Qt::CaseInsensitive);
for(QStringList::Iterator it = entries.begin(); it != entries.end(); ++it) {
if(regx.exactMatch((*it))) {
@@ -775,11 +781,6 @@ QString Win32MakefileGenerator::getLibTarget()
return QString(project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".lib");
}
-QString Win32MakefileGenerator::getPdbTarget()
-{
- return QString(project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".pdb");
-}
-
QString Win32MakefileGenerator::defaultInstall(const QString &t)
{
if((t != "target" && t != "dlltarget") ||
@@ -820,18 +821,6 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) \"" + dst_targ + "\"");
}
- if(project->isActiveConfig("shared") && project->isActiveConfig("debug")) {
- QString pdb_target = getPdbTarget();
- pdb_target.remove('"');
- QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target;
- QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + pdb_target, FileFixifyAbsolute));
- if(!ret.isEmpty())
- ret += "\n\t";
- ret += QString("-$(INSTALL_FILE)") + " \"" + src_targ + "\" \"" + dst_targ + "\"";
- if(!uninst.isEmpty())
- uninst.append("\n\t");
- uninst.append("-$(DEL_FILE) \"" + dst_targ + "\"");
- }
}
if(t == "dlltarget" || project->values(t + ".CONFIG").indexOf("no_dll") == -1) {
diff --git a/qmake/generators/win32/winmakefile.h b/qmake/generators/win32/winmakefile.h
index 3a2e3a1ee8..5437524495 100644
--- a/qmake/generators/win32/winmakefile.h
+++ b/qmake/generators/win32/winmakefile.h
@@ -83,7 +83,6 @@ protected:
virtual void processRcFileVar();
virtual void processFileTagsVar();
virtual QString getLibTarget();
- virtual QString getPdbTarget();
};
inline Win32MakefileGenerator::~Win32MakefileGenerator()
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 5f5745ac04..38b47e0813 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -64,7 +64,7 @@
#include <stdlib.h>
// Included from tools/shared
-#include <symbian/epocroot.h>
+#include <symbian/epocroot_p.h>
#ifdef Q_OS_WIN32
#define QT_POPEN _popen
@@ -3118,7 +3118,7 @@ QStringList &QMakeProject::values(const QString &_var, QMap<QString, QStringList
false));
} else if (var == QLatin1String("EPOCROOT")) {
if (place[var].isEmpty())
- place[var] = QStringList(epocRoot());
+ place[var] = QStringList(qt_epocRoot());
}
#if defined(Q_OS_WIN32) && defined(Q_CC_MSVC)
else if(var.startsWith(QLatin1String("QMAKE_TARGET."))) {
diff --git a/qmake/qmake.pri b/qmake/qmake.pri
index 83a53561c9..bc7ddb86ad 100644
--- a/qmake/qmake.pri
+++ b/qmake/qmake.pri
@@ -3,7 +3,7 @@ CONFIG += depend_includepath
QMAKE_INCREMENTAL =
SKIP_DEPENDS += qconfig.h qmodules.h
DEFINES += QT_NO_TEXTCODEC QT_NO_LIBRARY QT_NO_STL QT_NO_COMPRESS QT_NO_UNICODETABLES \
- QT_NO_GEOM_VARIANT QT_NO_DATASTREAM
+ QT_NO_GEOM_VARIANT QT_NO_DATASTREAM QLIBRARYINFO_EPOCROOT
#qmake code
SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \
@@ -36,8 +36,8 @@ HEADERS += project.h property.h generators/makefile.h \
generators/symbian/symmake_abld.h \
generators/symbian/symmake_sbsv2.h \
generators/symbian/initprojectdeploy_symbian.h \
- windows/registry.h \
- symbian/epocroot.h
+ windows/registry_p.h \
+ symbian/epocroot_p.h
contains(QT_EDITION, OpenSource) {
DEFINES += QMAKE_OPENSOURCE_EDITION