diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-01-25 18:56:33 +0100 |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-01-25 18:56:33 +0100 |
commit | 5422e929cad04633a06c156cba96cfcd69262522 (patch) | |
tree | afb3c9b76c05d80238a1ff76f4e8f4019fac1651 /qmake | |
parent | ac798c5d77c59ea8dfe29c9d1896fb6604e3a628 (diff) | |
parent | a0e0a9378d10db9c8ab3ba4d59f5c576ee4cbc40 (diff) | |
download | qt4-tools-5422e929cad04633a06c156cba96cfcd69262522.tar.gz |
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts:
configure
src/network/bearer/bearer.pri
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/symbian/symbiancommon.cpp | 1 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_sbsv2.cpp | 64 | ||||
-rw-r--r-- | qmake/project.cpp | 2 |
3 files changed, 42 insertions, 25 deletions
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index 2b8d5b773e..c54fac7c3b 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -629,6 +629,7 @@ void SymbianCommonGenerator::writeRssFile(QString &numberOfIcons, QString &iconF t << "// * user." << endl; t << "// ============================================================================" << endl; t << endl; + t << "CHARACTER_SET UTF8" << endl; t << "#include <appinfo.rh>" << endl; t << "#include \"" << fixedTarget << ".loc\"" << endl; t << endl; diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp index f6f2e7870a..6d0152336c 100644 --- a/qmake/generators/symbian/symmake_sbsv2.cpp +++ b/qmake/generators/symbian/symmake_sbsv2.cpp @@ -72,6 +72,35 @@ static QString sbsRvctPrefix; extern char **environ; #endif +static void fixFlmCmd(QString *cmdLine, const QMap<QString, QString> &commandsToReplace) +{ + // If commandItem starts with any $$QMAKE_* commands, do a replace for SBS equivalent. + // Command replacement is done only for the start of the command or right after + // concatenation operators (&& and ||), as otherwise unwanted replacements might occur. + static QString cmdFind(QLatin1String("(^|&&\\s*|\\|\\|\\s*)%1")); + static QString cmdReplace(QLatin1String("\\1%1")); + + // $$escape_expand(\\n\\t) doesn't work for bld.inf files, but is often used as command + // separator, so replace it with "&&" command concatenator. + cmdLine->replace("\n\t", "&&"); + + // Iterate command replacements in reverse alphabetical order of keys so + // that keys which are starts of other longer keys are iterated after longer keys. + QMapIterator<QString, QString> cmdIter(commandsToReplace); + cmdIter.toBack(); + while (cmdIter.hasPrevious()) { + cmdIter.previous(); + if (cmdLine->contains(cmdIter.key())) + cmdLine->replace(QRegExp(cmdFind.arg(cmdIter.key())), cmdReplace.arg(cmdIter.value())); + } + + // Sbsv2 toolchain strips all backslashes (even double ones) from option parameters, so just + // assume all backslashes are directory separators and replace them with slashes. + // Problem: If some command actually needs backslashes for something else than dir separator, + // we are out of luck. + cmdLine->replace("\\", "/"); +} + // Copies Qt FLMs to correct location under epocroot. // This is not done by configure as it is possible to change epocroot after configure. void SymbianSbsv2MakefileGenerator::exportFlm() @@ -386,7 +415,7 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo } t << endl; t << "clean-debug: " << BLD_INF_FILENAME << endl; - t << "\t$(SBS) reallyclean"; + t << "\t$(SBS) reallyclean --toolcheck=off"; foreach(QString clause, debugClauses) { t << clause; } @@ -406,7 +435,7 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo } t << endl; t << "clean-release: " << BLD_INF_FILENAME << endl; - t << "\t$(SBS) reallyclean"; + t << "\t$(SBS) reallyclean --toolcheck=off"; foreach(QString clause, releaseClauses) { t << clause; } @@ -516,8 +545,10 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo generateDistcleanTargets(t); + // Do not check for tools when doing generic clean, as most tools are not actually needed for + // cleaning. Mainly this is relevant for environments that do not have winscw compiler. t << "clean: " << BLD_INF_FILENAME << endl; - t << "\t-$(SBS) reallyclean"; + t << "\t-$(SBS) reallyclean --toolcheck=off"; foreach(QString clause, allClauses) { t << clause; } @@ -561,12 +592,6 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t commandsToReplace.insert(project->values("QMAKE_DEL_TREE").join(" "), project->values("QMAKE_SBSV2_DEL_TREE").join(" ")); - // If commandItem starts with any $$QMAKE_* commands, do a replace for SBS equivalent - // Command replacement is done only for the start of the command or right after - // concatenation operators (&& and ||), as otherwise unwanted replacements might occur. - static QString cmdFind("(^|&&\\s*|\\|\\|\\s*)%1"); - static QString cmdReplace("\\1%1"); - // Write extra compilers and targets to initialize QMAKE_ET_* variables // Cache results to avoid duplicate calls when creating wrapper makefile QTextStream extraCompilerStream(&extraCompilersCache); @@ -621,26 +646,13 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t t << "OPTION PREDEP_TARGET " << absoluteTarget << endl; t << "OPTION DEPS " << absoluteDeps << endl; - // Iterate command replacements in reverse alphabetical order of keys so - // that keys which are starts of other longer keys are iterated after longer keys. - QMapIterator<QString, QString> cmdIter(commandsToReplace); - cmdIter.toBack(); - while (cmdIter.hasPrevious()) { - cmdIter.previous(); - if (commandItem.contains(cmdIter.key())) { - commandItem.replace(QRegExp(cmdFind.arg(cmdIter.key())), - cmdReplace.arg(cmdIter.value())); - } - } - if (commandItem.indexOf("$(INCPATH)") != -1) commandItem.replace("$(INCPATH)", incPath.join(" ")); if (commandItem.indexOf("$(DEFINES)") != -1) commandItem.replace("$(DEFINES)", defines.join(" ")); - // Sbsv2 strips all backslashes (even doubles ones) from option parameters, so just replace them with slashes - // Problem: If some command actually needs backslashes for something else than dir separator, we are out of luck... - commandItem.replace("\\", "/"); + fixFlmCmd(&commandItem, commandsToReplace); + t << "OPTION COMMAND " << commandItem << endl; t << "END" << endl; } @@ -670,8 +682,10 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t // Write post link rules if (!project->isEmpty("QMAKE_POST_LINK")) { + QString postLinkCmd = var("QMAKE_POST_LINK"); + fixFlmCmd(&postLinkCmd, commandsToReplace); t << "START EXTENSION qt/qmake_post_link" << endl; - t << "OPTION POST_LINK_CMD " << var("QMAKE_POST_LINK") << endl; + t << "OPTION POST_LINK_CMD " << postLinkCmd << endl; t << "OPTION LINK_TARGET " << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".").append(getTargetExtension())) << endl; t << "END" << endl; t << endl; diff --git a/qmake/project.cpp b/qmake/project.cpp index f314b8b777..fa322d97d0 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -1642,6 +1642,7 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QMap<QString, QStringL if(flags & IncludeFlagFeature) { if(!file.endsWith(Option::prf_ext)) file += Option::prf_ext; + validateModes(); // init dir_sep if(file.indexOf(Option::dir_sep) == -1 || !QFile::exists(file)) { static QStringList *feature_roots = 0; if(!feature_roots) { @@ -2988,6 +2989,7 @@ QStringList &QMakeProject::values(const QString &_var, QMap<QString, QStringList var = ".BUILTIN." + var; place[var] = QStringList(qmake_getpwd()); } else if(var == QLatin1String("DIR_SEPARATOR")) { + validateModes(); var = ".BUILTIN." + var; place[var] = QStringList(Option::dir_sep); } else if(var == QLatin1String("DIRLIST_SEPARATOR")) { |