diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2011-03-17 13:26:59 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2011-03-17 13:26:59 (GMT) |
commit | baa54f601871b2873b09097596428b4292bd7186 (patch) | |
tree | 584b1a0d2106fcd4edefe644e7068fffedc9f44a /qmake | |
parent | e5deaaa6ab843913bdf3ade47611f61f968db130 (diff) | |
parent | fd009286dfcea0a849d85c824f214e640c4d4ce2 (diff) | |
download | Qt-baa54f601871b2873b09097596428b4292bd7186.zip Qt-baa54f601871b2873b09097596428b4292bd7186.tar.gz Qt-baa54f601871b2873b09097596428b4292bd7186.tar.bz2 |
Merge remote branch 'earth-team/master' into master-i18n
Conflicts:
src/corelib/tools/qlocale.cpp
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/cachekeys.h | 48 | ||||
-rw-r--r-- | qmake/generators/makefile.cpp | 12 | ||||
-rw-r--r-- | qmake/generators/symbian/symbiancommon.cpp | 23 | ||||
-rw-r--r-- | qmake/generators/symbian/symbiancommon.h | 1 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake.cpp | 29 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_abld.cpp | 4 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_sbsv2.cpp | 12 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake.cpp | 4 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 11 | ||||
-rw-r--r-- | qmake/option.cpp | 12 | ||||
-rw-r--r-- | qmake/project.cpp | 21 |
11 files changed, 79 insertions, 98 deletions
diff --git a/qmake/cachekeys.h b/qmake/cachekeys.h index 2957d61..b29e4f2 100644 --- a/qmake/cachekeys.h +++ b/qmake/cachekeys.h @@ -118,54 +118,6 @@ struct FileInfoCacheKey inline uint qHash(const FileInfoCacheKey &f) { return f.hashCode(); } // ------------------------------------------------------------------------------------------------- -struct FileFixifyCacheKey -{ - mutable uint hash; - QString in_d, out_d; - QString file, pwd; - uint fixType; - bool canonicalize; - FileFixifyCacheKey(const QString &f, const QString &od, const QString &id, - uint ft, bool c) - { - hash = 0; - pwd = qmake_getpwd(); - file = f; - if(od.isNull()) - out_d = Option::output_dir; - else - out_d = od; - if(id.isNull()) - in_d = qmake_getpwd(); - else - in_d = id; - fixType = ft; - canonicalize = c; - } - QString toString() const { - return file + "--" + in_d + "--" + out_d + "--" + pwd + "--" + - QString::number(fixType) + "--" + QString::number((int)canonicalize); - } - bool operator==(const FileFixifyCacheKey &f) const - { - return (f.canonicalize == canonicalize && - f.fixType == fixType && - f.file == file && - f.in_d == in_d && - f.out_d == out_d && - f.pwd == pwd); - } - inline uint hashCode() const { - if(!hash) - hash = uint(canonicalize) | uint(fixType) | - qHash(file) | qHash(in_d) | qHash(out_d) /*|qHash(pwd)*/; - return hash; - } -}; - -inline uint qHash(const FileFixifyCacheKey &f) { return f.hashCode(); } -// ------------------------------------------------------------------------------------------------- - template <typename T> inline void qmakeDeleteCacheClear(void *i) { delete reinterpret_cast<T*>(i); } diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 595768f..7963976 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2813,17 +2813,6 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q return file; QString ret = unescapeFilePath(file); - //setup the cache - static QHash<FileFixifyCacheKey, QString> *cache = 0; - if(!cache) { - cache = new QHash<FileFixifyCacheKey, QString>; - qmakeAddCacheClear(qmakeDeleteCacheClear<QHash<FileFixifyCacheKey, QString> >, (void**)&cache); - } - FileFixifyCacheKey cacheKey(ret, out_d, in_d, fix, canon); - QString cacheVal = cache->value(cacheKey); - if(!cacheVal.isNull()) - return cacheVal; - //do the fixin' QString pwd = qmake_getpwd(); if (!pwd.endsWith('/')) @@ -2908,7 +2897,6 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q debug_msg(3, "Fixed[%d,%d] %s :: to :: %s [%s::%s] [%s::%s]", fix, canon, orig_file.toLatin1().constData(), ret.toLatin1().constData(), in_d.toLatin1().constData(), out_d.toLatin1().constData(), pwd.toLatin1().constData(), Option::output_dir.toLatin1().constData()); - cache->insert(cacheKey, ret); return ret; } diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index acd55e4..32b465b 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -79,11 +79,7 @@ void SymbianCommonGenerator::init() fixedTarget = project->first("TARGET"); fixedTarget = generator->unescapeFilePath(fixedTarget); fixedTarget = removePathSeparators(fixedTarget); - if (project->first("MAKEFILE_GENERATOR") == "SYMBIAN_ABLD" - || project->first("MAKEFILE_GENERATOR") == "SYMBIAN_SBSV2") - removeEpocSpecialCharacters(fixedTarget); - else - removeSpecialCharacters(fixedTarget); + removeSpecialCharacters(fixedTarget); // This should not be empty since the mkspecs are supposed to set it if missing. uid3 = project->first("TARGET.UID3").trimmed(); @@ -131,18 +127,11 @@ bool SymbianCommonGenerator::containsStartWithItem(const QChar &c, const QString void SymbianCommonGenerator::removeSpecialCharacters(QString& str) { // When modifying this method check also symbianRemoveSpecialCharacters in symbian.conf - str.replace(QString("/"), QString("_")); - str.replace(QString("\\"), QString("_")); - str.replace(QString(" "), QString("_")); -} - -void SymbianCommonGenerator::removeEpocSpecialCharacters(QString& str) -{ - // When modifying this method check also symbianRemoveSpecialCharacters in symbian.conf - str.replace(QString("-"), QString("_")); - str.replace(QString(":"), QString("_")); - str.replace(QString("."), QString("_")); - removeSpecialCharacters(str); + QString underscore = QLatin1String("_"); + str.replace(QLatin1String("/"), underscore); + str.replace(QLatin1String("\\"), underscore); + str.replace(QLatin1String(" "), underscore); + str.replace(QLatin1String(":"), underscore); } QString romPath(const QString& path) diff --git a/qmake/generators/symbian/symbiancommon.h b/qmake/generators/symbian/symbiancommon.h index 0b5f53d..5182021 100644 --- a/qmake/generators/symbian/symbiancommon.h +++ b/qmake/generators/symbian/symbiancommon.h @@ -82,7 +82,6 @@ protected: QString removePathSeparators(QString &file); void removeSpecialCharacters(QString& str); - void removeEpocSpecialCharacters(QString& str); void generatePkgFile(const QString &iconFile, bool epocBuild, const SymbianLocalizationList &symbianLocalizationList); diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index e6c9666..08d3370 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -83,6 +83,8 @@ #define VAR_CFLAGS "QMAKE_CFLAGS" #define VAR_LFLAGS "QMAKE_LFLAGS" +#define DEFINE_REPLACE_REGEXP "[^A-Z0-9_]" + QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const QDir& parentDir) { static QString epocRootStr; @@ -165,11 +167,15 @@ void SymbianMakefileGenerator::writeHeader(QTextStream &t) QString bldinfDefine = shortProFilename; bldinfDefine.append("_"); bldinfDefine.append(generate_uid(project->projectFile())); + bldinfDefine = bldinfDefine.toUpper(); + + // replace anything not alphanumeric with underscore + QRegExp replacementMask(DEFINE_REPLACE_REGEXP); + bldinfDefine.replace(replacementMask, QLatin1String("_")); bldinfDefine.prepend("BLD_INF_"); - removeEpocSpecialCharacters(bldinfDefine); - t << "#define " << bldinfDefine.toUpper() << endl << endl; + t << "#define " << bldinfDefine << endl << endl; } bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) @@ -892,13 +898,17 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy const QStringList &subdirs = project->values("SUBDIRS"); foreach(QString item, subdirs) { + bool fromFile = false; QString fixedItem; if (!project->isEmpty(item + ".file")) { fixedItem = project->first(item + ".file"); + fromFile = true; } else if (!project->isEmpty(item + ".subdir")) { fixedItem = project->first(item + ".subdir"); + fromFile = false; } else { fixedItem = item; + fromFile = item.endsWith(Option::pro_ext); } QString condition; @@ -907,9 +917,15 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy QFileInfo subdir(fileInfo(fixedItem)); QString relativePath = directory.relativeFilePath(fixedItem); - QString subdirFileName = subdir.completeBaseName(); - QString fullProName = subdir.absoluteFilePath();; + QString fullProName = subdir.absoluteFilePath(); QString bldinfFilename; + QString subdirFileName; + + if (fromFile) { + subdirFileName = subdir.completeBaseName(); + } else { + subdirFileName = subdir.fileName(); + } if (subdir.isDir()) { // Subdir is a regular project @@ -931,7 +947,10 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy QString uid = generate_uid(fullProName); QString bldinfDefine = QString("BLD_INF_") + subdirFileName + QString("_") + uid; bldinfDefine = bldinfDefine.toUpper(); - removeEpocSpecialCharacters(bldinfDefine); + + // replace anything not alphanumeric with underscore + QRegExp replacementMask(DEFINE_REPLACE_REGEXP); + bldinfDefine.replace(replacementMask, QLatin1String("_")); if (!condition.isEmpty()) t << "#if defined(" << condition << ")" << endl; diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index 5729e26..b582257 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -190,6 +190,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool t << "QMAKE = " << var("QMAKE_QMAKE") << endl; t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; + t << "DEL_TREE = " << var("QMAKE_DEL_TREE") << endl; t << "MOVE = " << var("QMAKE_MOVE") << endl; t << "CHK_DIR_EXISTS = " << var("QMAKE_CHK_DIR_EXISTS") << endl; t << "MKDIR = " << var("QMAKE_MKDIR") << endl; @@ -329,7 +330,8 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool // Note: EXTENSION_CLEAN will get called many times when doing reallyclean // This is why the "2> NUL" gets appended to generated clean targets in makefile.cpp. t << EXTENSION_CLEAN ": " COMPILER_CLEAN_TARGET << endl; - generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_TREE"), "", "", ""); + generateCleanCommands(t, dirsToClean, "$(DEL_TREE)", "", "", ""); + generateCleanCommands(t, project->values("QMAKE_CLEAN"), "$(DEL_FILE)", "", "", ""); t << endl; t << PRE_TARGETDEPS_TARGET ":" diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp index 9eccd46..f94a63f 100644 --- a/qmake/generators/symbian/symmake_sbsv2.cpp +++ b/qmake/generators/symbian/symmake_sbsv2.cpp @@ -721,6 +721,18 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t t << "END" << endl; t << endl; + // Handle QMAKE_CLEAN + QStringList cleanFiles = project->values("QMAKE_CLEAN"); + if (!cleanFiles.isEmpty()) { + QStringList absoluteCleanFiles; + foreach (QString cleanFile, cleanFiles) { + QFileInfo fi(cleanFile); + absoluteCleanFiles << fi.absoluteFilePath(); + } + t << "START EXTENSION qt/qmake_clean" << endl; + t << "OPTION CLEAN_FILES " << absoluteCleanFiles.join(" ") << endl; + t << "END" << endl; + } t << endl; } diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 29d85f7..e659e62 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -148,6 +148,8 @@ UnixMakefileGenerator::init() project->values("QMAKE_LFLAGS") += var("QMAKE_LFLAGS_RPATH") + libdirs[i]; if (project->isActiveConfig("rvct_linker")) { project->values("QMAKE_LIBDIR_FLAGS") += "--userlibpath " + escapeFilePath(libdirs[i]); + } else if (project->isActiveConfig("armcc_linker")) { + project->values("QMAKE_LIBDIR_FLAGS") += "-L--userlibpath=" + escapeFilePath(libdirs[i]); } else { project->values("QMAKE_LIBDIR_FLAGS") += "-L" + escapeFilePath(libdirs[i]); } @@ -486,7 +488,7 @@ UnixMakefileGenerator::findLibraries() } else if(opt.startsWith("-l")) { if (!project->isEmpty("QMAKE_RVCT_LINKSTYLE")) { (*it) = opt.mid(2); - } else if (project->isActiveConfig("rvct_linker")) { + } else if (project->isActiveConfig("rvct_linker") || project->isActiveConfig("armcc_linker")) { (*it) = "lib" + opt.mid(2) + ".so"; } else { stub = opt.mid(2); diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 0df33d0..8455189 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1072,22 +1072,26 @@ void VcprojGenerator::initPreBuildEventTools() void VcprojGenerator::initPostBuildEventTools() { VCConfiguration &conf = vcProject.Configuration; - if(!project->values("QMAKE_POST_LINK").isEmpty()) { + if (!project->values("QMAKE_POST_LINK").isEmpty()) { QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_POST_LINK")); conf.postBuild.CommandLine = cmdline; conf.postBuild.Description = cmdline.join(QLatin1String("\r\n")); + conf.postBuild.ExcludedFromBuild = _False; } QString signature = !project->isEmpty("SIGNATURE_FILE") ? var("SIGNATURE_FILE") : var("DEFAULT_SIGNATURE"); bool useSignature = !signature.isEmpty() && !project->isActiveConfig("staticlib") && !project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH"); - if(useSignature) + if (useSignature) { conf.postBuild.CommandLine.prepend( QLatin1String("signtool sign /F ") + signature + QLatin1String(" \"$(TargetPath)\"")); + conf.postBuild.ExcludedFromBuild = _False; + } - if(!project->values("MSVCPROJ_COPY_DLL").isEmpty()) { + if (!project->values("MSVCPROJ_COPY_DLL").isEmpty()) { conf.postBuild.Description += var("MSVCPROJ_COPY_DLL_DESC"); conf.postBuild.CommandLine += var("MSVCPROJ_COPY_DLL"); + conf.postBuild.ExcludedFromBuild = _False; } } @@ -1218,6 +1222,7 @@ void VcprojGenerator::initPreLinkEventTools() QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_PRE_LINK")); conf.preLink.CommandLine = cmdline; conf.preLink.Description = cmdline.join(QLatin1String("\r\n")); + conf.preLink.ExcludedFromBuild = _False; } } diff --git a/qmake/option.cpp b/qmake/option.cpp index fcbf5fa..7bee659 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -624,16 +624,18 @@ Option::fixString(QString string, uchar flags) qmakeAddCacheClear(qmakeDeleteCacheClear<QHash<FixStringCacheKey, QString> >, (void**)&cache); } FixStringCacheKey cacheKey(string, flags); - if(cache->contains(cacheKey)) { - const QString ret = cache->value(cacheKey); - //qDebug() << "Fix (cached) " << orig_string << "->" << ret; - return ret; + + QHash<FixStringCacheKey, QString>::const_iterator it = cache->constFind(cacheKey); + + if (it != cache->constEnd()) { + //qDebug() << "Fix (cached) " << orig_string << "->" << it.value(); + return it.value(); } //fix the environment variables if(flags & Option::FixEnvVars) { int rep; - QRegExp reg_var("\\$\\(.*\\)"); + static QRegExp reg_var("\\$\\(.*\\)"); reg_var.setMinimal(true); while((rep = reg_var.indexIn(string)) != -1) string.replace(rep, reg_var.matchedLength(), diff --git a/qmake/project.cpp b/qmake/project.cpp index af8cdf6..7cc1cb6 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -228,7 +228,7 @@ static QString varMap(const QString &x) return ret; } -static QStringList split_arg_list(QString params) +static QStringList split_arg_list(const QString ¶ms) { int quote = 0; QStringList args; @@ -253,6 +253,8 @@ static QStringList split_arg_list(QString params) while(x > last && params_data[x-1].unicode() == SPACE) --x; args << params.mid(last, x - last); + // Could do a check for unmatched parens here, but split_value_list() + // is called on all our output, so mistakes will be caught anyway. return args; } ushort unicode = params_data[x].unicode(); @@ -285,6 +287,7 @@ static QStringList split_value_list(const QString &vals) QString build; QStringList ret; ushort quote = 0; + int parens = 0; const ushort LPAREN = '('; const ushort RPAREN = ')'; @@ -295,7 +298,7 @@ static QStringList split_value_list(const QString &vals) ushort unicode; const QChar *vals_data = vals.data(); const int vals_len = vals.length(); - for(int x = 0, parens = 0; x < vals_len; x++) { + for(int x = 0; x < vals_len; x++) { unicode = vals_data[x].unicode(); if(x != (int)vals_len-1 && unicode == BACKSLASH && (vals_data[x+1].unicode() == SINGLEQUOTE || vals_data[x+1].unicode() == DOUBLEQUOTE)) { @@ -319,6 +322,11 @@ static QStringList split_value_list(const QString &vals) } if(!build.isEmpty()) ret << build; + if (parens) + warn_msg(WarnDeprecated, "%s:%d: Unmatched parentheses are deprecated.", + parser.file.toLatin1().constData(), parser.line_no); + // Could do a check for unmatched quotes here, but doVariableReplaceExpand() + // is called on all our output, so mistakes will be caught anyway. return ret; } @@ -1678,10 +1686,10 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QMap<QString, QStringL } if(format == UnknownFormat) return IncludeNoExist; - if(place["QMAKE_INTERNAL_INCLUDED_FEATURES"].indexOf(file) != -1) - return IncludeFeatureAlreadyLoaded; - place["QMAKE_INTERNAL_INCLUDED_FEATURES"].append(file); } + if(place["QMAKE_INTERNAL_INCLUDED_FEATURES"].indexOf(file) != -1) + return IncludeFeatureAlreadyLoaded; + place["QMAKE_INTERNAL_INCLUDED_FEATURES"].append(file); } if(QDir::isRelativePath(file)) { QStringList include_roots; @@ -2963,6 +2971,9 @@ QMakeProject::doVariableReplaceExpand(const QString &str, QMap<QString, QStringL else if(!current.isEmpty()) ret.append(current); //qDebug() << "REPLACE" << str << ret; + if (quote) + warn_msg(WarnDeprecated, "%s:%d: Unmatched quotes are deprecated.", + parser.file.toLatin1().constData(), parser.line_no); return ret; } |