From 13b00abc9316cdbd2ebc1cd3311ea210a9176b6e Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 20 Jan 2010 11:50:26 +0200 Subject: Generic solution for plugin stub exports for IBY usage Previous s60installs specific fix was flawed in that it failed to generate exports when doing clean build. Replaced that with a more generic solution that exports plugin stubs under \epoc32\data\z always. Task-number: QTBUG-6972 Reviewed-by: Janne Anttila --- .../symbian/initprojectdeploy_symbian.cpp | 1 - .../generators/symbian/initprojectdeploy_symbian.h | 2 ++ qmake/generators/symbian/symmake.cpp | 32 ++++++++++++++++++---- qmake/generators/symbian/symmake.h | 5 ++-- src/s60installs/qt.iby | 26 +++++++++--------- src/s60installs/s60installs.pro | 5 ---- 6 files changed, 44 insertions(+), 27 deletions(-) diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index 755f73f..f3e3c3a 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -46,7 +46,6 @@ #include #include -#define PLUGIN_STUB_DIR "qmakepluginstubs" #define SYSBIN_DIR "\\sys\\bin" #define SUFFIX_DLL "dll" diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.h b/qmake/generators/symbian/initprojectdeploy_symbian.h index 2f43818..e23e6a9 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.h +++ b/qmake/generators/symbian/initprojectdeploy_symbian.h @@ -52,6 +52,8 @@ #include "epocroot.h" +#define PLUGIN_STUB_DIR "qmakepluginstubs" + struct CopyItem { CopyItem(const QString& f, const QString& t) : from(f) , to(t) { } diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 6e76c9e..20e2d0e 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -40,7 +40,6 @@ ****************************************************************************/ #include "symmake.h" -#include "initprojectdeploy_symbian.h" #include #include @@ -62,6 +61,7 @@ #define BLD_INF_TAG_MMPFILES "prj_mmpfiles" #define BLD_INF_TAG_TESTMMPFILES "prj_testmmpfiles" #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." @@ -202,6 +202,8 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) // Generate pkg files if there are any actual files to deploy bool generatePkg = false; + DeploymentList depList; + if (targetType == TypeExe) { generatePkg = true; } else { @@ -214,10 +216,10 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) } if (generatePkg) { - generatePkgFile(iconFile); + generatePkgFile(iconFile, depList); } - writeBldInfContent(t, generatePkg, iconFile); + writeBldInfContent(t, generatePkg, iconFile, depList); // Generate empty wrapper makefile here, because wrapper makefile must exist before writeMkFile, // but all required data is not yet available. @@ -272,7 +274,7 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) return true; } -void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile) +void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, DeploymentList &depList) { QString pkgFilename = QString("%1_template.%2") .arg(fixedTarget) @@ -396,7 +398,6 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile) } // deploy any additional DEPLOYMENT files - DeploymentList depList; QString remoteTestPath; remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid); @@ -1171,7 +1172,7 @@ void SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t) } } -void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension, const QString &iconFile) +void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension, const QString &iconFile, DeploymentList &depList) { // Read user defined bld inf rules @@ -1300,6 +1301,25 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy t << item << endl; userBldInfRules.remove(BLD_INF_TAG_EXTENSIONS); + t << endl << BLD_INF_TAG_EXPORTS << endl << endl; + + // Generate export rules + + // Export any deployed plugin stubs under /epoc32/data/z to support ROM builds + for (int i = 0; i < depList.size(); ++i) { + int index = depList.at(i).from.indexOf(PLUGIN_STUB_DIR); + if (index != -1) { + t << QString("%1 /epoc32/data/z%2") + .arg(QString(depList.at(i).from).mid(index).replace('\\','/')) + .arg(QString(depList.at(i).to).mid(2).replace('\\','/')) << endl; + } + } + + userItems = userBldInfRules.value(BLD_INF_TAG_EXPORTS); + foreach(QString item, userItems) + t << item << endl; + userBldInfRules.remove(BLD_INF_TAG_EXPORTS); + // Add rest of the user defined content for (QMap::iterator it = userBldInfRules.begin(); it != userBldInfRules.end(); ++it) { diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h index 45209d1..77d61da 100644 --- a/qmake/generators/symbian/symmake.h +++ b/qmake/generators/symbian/symmake.h @@ -42,6 +42,7 @@ #ifndef SYMMAKEFILE_H #define SYMMAKEFILE_H +#include "initprojectdeploy_symbian.h" #include QT_BEGIN_NAMESPACE @@ -86,7 +87,7 @@ protected: QString canonizePath(const QString& origPath); virtual bool writeMakefile(QTextStream &t); - void generatePkgFile(const QString &iconFile); + void generatePkgFile(const QString &iconFile, DeploymentList &depList); bool containsStartWithItem(const QChar &c, const QStringList& src); virtual void init(); @@ -106,7 +107,7 @@ protected: QString &checkString); void writeHeader(QTextStream &t); - void writeBldInfContent(QTextStream& t, bool addDeploymentExtension, const QString &iconFile); + void writeBldInfContent(QTextStream& t, bool addDeploymentExtension, const QString &iconFile, DeploymentList &depList); static bool removeDuplicatedStrings(QStringList& stringList); diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby index f24ac4b..bdd668c 100644 --- a/src/s60installs/qt.iby +++ b/src/s60installs/qt.iby @@ -90,27 +90,27 @@ file=ABI_DIR\BUILD_DIR\qts60plugin_5_0.dll SHARED_LIB_DIR\qts60plugin_5_0.dll S60_APP_RESOURCE(s60main) // imageformats stubs -data=\epoc32\data\qt\qtlibspluginstubs\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin // codecs stubs -data=\epoc32\data\qt\qtlibspluginstubs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin +data=\epoc32\data\z\resource\qt\plugins\codecs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin +data=\epoc32\data\z\resource\qt\plugins\codecs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin +data=\epoc32\data\z\resource\qt\plugins\codecs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin +data=\epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin // iconengines stubs -data=\epoc32\data\qt\qtlibspluginstubs\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin +data=\epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin // Phonon MMF backend -data=\epoc32\data\qt\qtlibspluginstubs\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin +data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin // graphicssystems -data=\epoc32\data\qt\qtlibspluginstubs\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin +data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin // Stub sis file data=ZSYSTEM\install\qt.sis System\Install\qt.sis diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index bbc758b..55eaee1 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -112,9 +112,4 @@ symbian: { BLD_INF_RULES.prj_exports += "qt.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qt.iby)" BLD_INF_RULES.prj_exports += "qtdemoapps.iby $$CORE_APP_LAYER_IBY_EXPORT_PATH(qtdemoapps.iby)" - PLUGIN_STUBS = $$files(qmakepluginstubs/*) - for(STUB, PLUGIN_STUBS) { - STUB_FILENAME = $$basename(STUB) - BLD_INF_RULES.prj_exports += "qmakepluginstubs/$${STUB_FILENAME} /epoc32/data/qt/qtlibspluginstubs/$${STUB_FILENAME}" - } } -- cgit v0.12