diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-02 03:12:14 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-02 03:12:14 (GMT) |
commit | f101d46ccd4795fc672b5b6c9e24151df319d725 (patch) | |
tree | 82d67c71ad3ea8659c8e1277a4960e788c55c4d8 /qmake | |
parent | 5fa83d8e2ad78272a1013c45387adffb5e551357 (diff) | |
parent | 0da9aa430240cefc7486efb3a68421423bc4fb76 (diff) | |
download | Qt-f101d46ccd4795fc672b5b6c9e24151df319d725.zip Qt-f101d46ccd4795fc672b5b6c9e24151df319d725.tar.gz Qt-f101d46ccd4795fc672b5b6c9e24151df319d725.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (29 commits)
bye bye QMakeProjectEnv
short-cut evaluation inside if() tests
eliminate special splitting of INCLUDEPATH and DEPENDPATH
do not env-expand cache file path
s/QMAKE_FRAMEWORKDIR_FLAGS/QMAKE_FRAMEWORKPATH_FLAGS/
s/INCPATH/INCLUDEPATH/
s/QMAKE_RPATH/QMAKE_LFLAGS_RPATH/
teach configure QMAKE_LFLAGS_RPATH (in addition to obsolete QMAKE_RPATH)
warn about usage of deprecated variables
warn about using non-lowercased replace $$function()s
add -Wdeprecated option (on by default)
make QMakeProject::isEmpty() consider legacy mappings
document some functions' scope
fix $$size() not using function-scoped variables
doc: Fixed some qdoc errors.
qdoc: Added breadcrumbs for namespaces.
Autotest: check that we receive key events on toplevel widgets
Cocoa: key events stopped working
Update Polish translations
qdoc: Added "All namespaces" to the API Lookup box.
...
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 2 | ||||
-rw-r--r-- | qmake/option.cpp | 10 | ||||
-rw-r--r-- | qmake/option.h | 1 | ||||
-rw-r--r-- | qmake/project.cpp | 85 | ||||
-rw-r--r-- | qmake/project.h | 13 | ||||
-rw-r--r-- | qmake/qmake.pro | 4 |
6 files changed, 45 insertions, 70 deletions
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 3e731a1..d16cd6b 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -148,7 +148,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(!project->isActiveConfig("staticlib")) { t << "LINK = " << var("QMAKE_LINK") << endl; t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; - t << "LIBS = " << "$(SUBLIBS) " << var("QMAKE_FRAMEWORKDIR_FLAGS") << " " + t << "LIBS = " << "$(SUBLIBS) " << var("QMAKE_FRAMEWORKPATH_FLAGS") << " " << var("QMAKE_LIBDIR_FLAGS") << " " << var("QMAKE_LIBS") << " " << var("QMAKE_LIBS_PRIVATE") << endl; } diff --git a/qmake/option.cpp b/qmake/option.cpp index 49030c3..13e855c 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -84,7 +84,7 @@ Option::QMAKE_MODE Option::qmake_mode = Option::QMAKE_GENERATE_NOTHING; //all modes QString Option::qmake_abslocation; -int Option::warn_level = WarnLogic; +int Option::warn_level = WarnLogic | WarnDeprecated; int Option::debug_level = 0; QFile Option::output; QString Option::output_dir; @@ -170,10 +170,12 @@ bool usage(const char *a0) " file in your current working directory\n" "\n" "Warnings Options:\n" - " -Wnone Turn off all warnings\n" + " -Wnone Turn off all warnings; specific ones may be re-enabled by\n" + " later -W options\n" " -Wall Turn on all warnings\n" " -Wparser Turn on parser warnings\n" - " -Wlogic Turn on logic warnings\n" + " -Wlogic Turn on logic warnings (on by default)\n" + " -Wdeprecated Turn on deprecation warnings (on by default)\n" "\n" "Options:\n" " * You can place any variable assignment in options and it will be *\n" @@ -278,6 +280,8 @@ Option::parseCommandLine(int argc, char **argv, int skip) Option::warn_level |= WarnParser; } else if(opt == "Wlogic") { Option::warn_level |= WarnLogic; + } else if(opt == "Wdeprecated") { + Option::warn_level |= WarnDeprecated; } else if(opt == "Wnone") { Option::warn_level = WarnNone; } else if(opt == "r" || opt == "recursive") { diff --git a/qmake/option.h b/qmake/option.h index 9bfdaed..b09ead2 100644 --- a/qmake/option.h +++ b/qmake/option.h @@ -63,6 +63,7 @@ enum QMakeWarn { WarnNone = 0x00, WarnParser = 0x01, WarnLogic = 0x02, + WarnDeprecated = 0x04, WarnAll = 0xFF }; void warn_msg(QMakeWarn t, const char *fmt, ...); diff --git a/qmake/project.cpp b/qmake/project.cpp index 3c56272..998d173 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -220,6 +220,11 @@ static QString varMap(const QString &x) ret = "QMAKE_FRAMEWORKPATH"; else if(ret == "QMAKE_FRAMEWORKDIR_FLAGS") ret = "QMAKE_FRAMEWORKPATH_FLAGS"; + else + return ret; + warn_msg(WarnDeprecated, "%s:%d: Variable %s is deprecated; use %s instead.", + parser.file.toLatin1().constData(), parser.line_no, + x.toLatin1().constData(), ret.toLatin1().constData()); return ret; } @@ -278,7 +283,7 @@ static QStringList split_arg_list(QString params) return args; } -static QStringList split_value_list(const QString &vals, bool do_semicolon=false) +static QStringList split_value_list(const QString &vals) { QString build; QStringList ret; @@ -289,7 +294,6 @@ static QStringList split_value_list(const QString &vals, bool do_semicolon=false const ushort SINGLEQUOTE = '\''; const ushort DOUBLEQUOTE = '"'; const ushort BACKSLASH = '\\'; - const ushort SEMICOLON = ';'; ushort unicode; const QChar *vals_data = vals.data(); @@ -309,8 +313,7 @@ static QStringList split_value_list(const QString &vals, bool do_semicolon=false ++parens; } - if(!parens && quote.isEmpty() && ((do_semicolon && unicode == SEMICOLON) || - vals_data[x] == Option::field_sep)) { + if(!parens && quote.isEmpty() && (vals_data[x] == Option::field_sep)) { ret << build; build.clear(); } else { @@ -558,7 +561,7 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0) QString path; int last_slash = Option::mkfile::cachefile.lastIndexOf(QDir::separator()); if(last_slash != -1) - path = Option::fixPathToLocalOS(Option::mkfile::cachefile.left(last_slash)); + path = Option::fixPathToLocalOS(Option::mkfile::cachefile.left(last_slash), false); for(QStringList::Iterator concat_it = concat.begin(); concat_it != concat.end(); ++concat_it) feature_roots << (path + (*concat_it)); @@ -614,38 +617,6 @@ QStringList qmake_mkspec_paths() return ret; } -class QMakeProjectEnv -{ - QStringList envs; -public: - QMakeProjectEnv() { } - QMakeProjectEnv(QMakeProject *p) { execute(p->variables()); } - QMakeProjectEnv(const QMap<QString, QStringList> &values) { execute(values); } - - void execute(QMakeProject *p) { execute(p->variables()); } - void execute(const QMap<QString, QStringList> &values) { -#ifdef Q_OS_UNIX - for(QMap<QString, QStringList>::ConstIterator it = values.begin(); it != values.end(); ++it) { - const QString var = it.key(), val = it.value().join(" "); - if(!var.startsWith(".")) { - const QString env_var = Option::sysenv_mod + var; - if(!putenv(strdup(QString(env_var + "=" + val).toAscii().data()))) - envs.append(env_var); - } - } -#else - Q_UNUSED(values); -#endif - } - ~QMakeProjectEnv() { -#ifdef Q_OS_UNIX - for(QStringList::ConstIterator it = envs.begin();it != envs.end(); ++it) { - putenv(strdup(QString(*it + "=").toAscii().data())); - } -#endif - } -}; - QMakeProject::~QMakeProject() { if(own_prop) @@ -1155,7 +1126,7 @@ QMakeProject::parse(const QString &t, QMap<QString, QStringList> &place, int num QStringList vallist; { //doVariableReplace(vals, place); - QStringList tmp = split_value_list(vals, (var == "DEPENDPATH" || var == "INCLUDEPATH")); + QStringList tmp = split_value_list(vals); for(int i = 0; i < tmp.size(); ++i) vallist += doVariableReplaceExpand(tmp[i], place); } @@ -1836,7 +1807,11 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list, for(int i = 0; i < args_list.size(); ++i) args += args_list[i].join(QString(Option::field_sep)); - ExpandFunc func_t = qmake_expandFunctions().value(func.toLower()); + QString lfunc = func.toLower(); + if (!lfunc.isSharedWith(func)) + warn_msg(WarnDeprecated, "%s:%d: Using uppercased builtin functions is deprecated.", + parser.file.toLatin1().constData(), parser.line_no); + ExpandFunc func_t = qmake_expandFunctions().value(lfunc); debug_msg(1, "Running project expand: %s(%s) [%d]", func.toLatin1().constData(), args.join("::").toLatin1().constData(), func_t); @@ -2090,7 +2065,6 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list, fprintf(stderr, "%s:%d system(execut) requires one argument.\n", parser.file.toLatin1().constData(), parser.line_no); } else { - QMakeProjectEnv env(place); char buff[256]; bool singleLine = true; if(args.count() > 1) @@ -2250,8 +2224,7 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list, fprintf(stderr, "%s:%d: size(var) requires one argument.\n", parser.file.toLatin1().constData(), parser.line_no); } else { - //QString target = args[0]; - int size = values(args[0]).size(); + int size = values(args[0], place).size(); ret += QString::number(size); } break; } @@ -2377,12 +2350,9 @@ QMakeProject::doProjectTest(QString func, QList<QStringList> args_list, QMap<QSt if(d_off == d_len-1) test += *(d+d_off); if(!test.isEmpty()) { - const bool success = doProjectTest(test, place); - test = ""; - if(or_op) - ret = ret || success; - else - ret = ret && success; + if (or_op != ret) + ret = doProjectTest(test, place); + test.clear(); } if(*(d+d_off) == QLatin1Char(':')) { or_op = false; @@ -2485,8 +2455,7 @@ QMakeProject::doProjectTest(QString func, QList<QStringList> args_list, QMap<QSt } } return false; } - case T_SYSTEM: { - bool setup_env = true; + case T_SYSTEM: if(args.count() < 1 || args.count() > 2) { fprintf(stderr, "%s:%d: system(exec) requires one argument.\n", parser.file.toLatin1().constData(), parser.line_no); @@ -2494,13 +2463,11 @@ QMakeProject::doProjectTest(QString func, QList<QStringList> args_list, QMap<QSt } if(args.count() == 2) { const QString sarg = args[1]; - setup_env = (sarg.toLower() == "true" || sarg.toInt()); + if (sarg.toLower() == "true" || sarg.toInt()) + warn_msg(WarnParser, "%s:%d: system()'s second argument is now hard-wired to false.\n", + parser.file.toLatin1().constData(), parser.line_no); } - QMakeProjectEnv env; - if(setup_env) - env.execute(place); - bool ret = system(args[0].toLatin1().constData()) == 0; - return ret; } + return system(args[0].toLatin1().constData()) == 0; case T_RETURN: if(function_blocks.isEmpty()) { fprintf(stderr, "%s:%d unexpected return()\n", @@ -3162,4 +3129,10 @@ QStringList &QMakeProject::values(const QString &_var, QMap<QString, QStringList return place[var]; } +bool QMakeProject::isEmpty(const QString &v) +{ + QMap<QString, QStringList>::ConstIterator it = vars.constFind(varMap(v)); + return it == vars.constEnd() || it->isEmpty(); +} + QT_END_NAMESPACE diff --git a/qmake/project.h b/qmake/project.h index bfebed0..0c542db 100644 --- a/qmake/project.h +++ b/qmake/project.h @@ -150,11 +150,11 @@ public: bool isActiveConfig(const QString &x, bool regex=false, QMap<QString, QStringList> *place=NULL); - bool isSet(const QString &v); - bool isEmpty(const QString &v); - QStringList &values(const QString &v); - QString first(const QString &v); - QMap<QString, QStringList> &variables(); + bool isSet(const QString &v); // No compat mapping, no magic variables + bool isEmpty(const QString &v); // With compat mapping, but no magic variables + QStringList &values(const QString &v); // With compat mapping and magic variables + QString first(const QString &v); // ditto + QMap<QString, QStringList> &variables(); // No compat mapping and magic, obviously bool isRecursive() const { return recursive; } @@ -179,9 +179,6 @@ inline QString QMakeProject::configFile() inline QStringList &QMakeProject::values(const QString &v) { return values(v, vars); } -inline bool QMakeProject::isEmpty(const QString &v) -{ return !isSet(v) || values(v).isEmpty(); } - inline bool QMakeProject::isSet(const QString &v) { return vars.contains(v); } diff --git a/qmake/qmake.pro b/qmake/qmake.pro index 4213253..b602afa 100644 --- a/qmake/qmake.pro +++ b/qmake/qmake.pro @@ -19,7 +19,7 @@ VPATH += $$QT_SOURCE_TREE/src/corelib/global \ $$QT_SOURCE_TREE/src/corelib/plugin \ $$QT_SOURCE_TREE/src/corelib/xml \ $$QT_SOURCE_TREE/src/corelib/io -INCPATH += . \ +INCLUDEPATH += . \ generators \ generators/unix \ generators/win32 \ @@ -30,7 +30,7 @@ INCPATH += . \ $$QT_SOURCE_TREE/qmake VPATH += $$QT_SOURCE_TREE/tools/shared -INCPATH += $$QT_SOURCE_TREE/tools/shared +INCLUDEPATH += $$QT_SOURCE_TREE/tools/shared include(qmake.pri) |