complain about bad arguments to -make/-nomake

Task-number: QTBUG-5366
Change-Id: I461a6c85fcee4a0216571d294171652b05ee6a34
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Oswald Buddenhagen 2013-06-17 11:21:40 +02:00 committed by The Qt Project
parent 0343b92660
commit 1aaeb9538b
3 changed files with 24 additions and 2 deletions

9
configure vendored
View File

@ -876,6 +876,7 @@ CFG_SSE=auto
CFG_FONTCONFIG=auto CFG_FONTCONFIG=auto
CFG_LIBFREETYPE=auto CFG_LIBFREETYPE=auto
CFG_SQL_AVAILABLE= CFG_SQL_AVAILABLE=
QT_ALL_BUILD_PARTS=" libs tools examples tests "
QT_DEFAULT_BUILD_PARTS="libs tools examples" QT_DEFAULT_BUILD_PARTS="libs tools examples"
CFG_BUILD_PARTS="" CFG_BUILD_PARTS=""
CFG_NOBUILD_PARTS="" CFG_NOBUILD_PARTS=""
@ -1430,9 +1431,17 @@ while [ "$#" -gt 0 ]; do
fi fi
;; ;;
nomake) nomake)
if [ -n "${QT_ALL_BUILD_PARTS%%* $VAL *}" ]; then
echo "Unknown part $VAL passed to -nomake." >&2
exit 1
fi
CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS $VAL" CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS $VAL"
;; ;;
make) make)
if [ -n "${QT_ALL_BUILD_PARTS%%* $VAL *}" ]; then
echo "Unknown part $VAL passed to -make." >&2
exit 1
fi
CFG_BUILD_PARTS="$CFG_BUILD_PARTS $VAL" CFG_BUILD_PARTS="$CFG_BUILD_PARTS $VAL"
;; ;;
skip) skip)

View File

@ -171,6 +171,8 @@ Configure::Configure(int& argc, char** argv)
} }
defaultBuildParts << QStringLiteral("libs") << QStringLiteral("tools") << QStringLiteral("examples"); defaultBuildParts << QStringLiteral("libs") << QStringLiteral("tools") << QStringLiteral("examples");
allBuildParts = defaultBuildParts;
allBuildParts << QStringLiteral("tests");
dictionary[ "QT_SOURCE_TREE" ] = sourcePath; dictionary[ "QT_SOURCE_TREE" ] = sourcePath;
dictionary[ "QT_BUILD_TREE" ] = buildPath; dictionary[ "QT_BUILD_TREE" ] = buildPath;
dictionary[ "QT_INSTALL_PREFIX" ] = installPath; dictionary[ "QT_INSTALL_PREFIX" ] = installPath;
@ -1001,12 +1003,22 @@ void Configure::parseCmdLine()
++i; ++i;
if (i == argCount) if (i == argCount)
break; break;
buildParts += configCmdLine.at(i); QString part = configCmdLine.at(i);
if (!allBuildParts.contains(part)) {
cout << "Unknown part " << part << " passed to -make." << endl;
dictionary["DONE"] = "error";
}
buildParts += part;
} else if (configCmdLine.at(i) == "-nomake") { } else if (configCmdLine.at(i) == "-nomake") {
++i; ++i;
if (i == argCount) if (i == argCount)
break; break;
nobuildParts.append(configCmdLine.at(i)); QString part = configCmdLine.at(i);
if (!allBuildParts.contains(part)) {
cout << "Unknown part " << part << " passed to -nomake." << endl;
dictionary["DONE"] = "error";
}
nobuildParts += part;
} }
else if (configCmdLine.at(i) == "-skip") { else if (configCmdLine.at(i) == "-skip") {

View File

@ -104,6 +104,7 @@ private:
// Our variable dictionaries // Our variable dictionaries
QMap<QString,QString> dictionary; QMap<QString,QString> dictionary;
QStringList allBuildParts;
QStringList defaultBuildParts; QStringList defaultBuildParts;
QStringList buildParts; QStringList buildParts;
QStringList nobuildParts; QStringList nobuildParts;