diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/configure/configureapp.cpp | 42 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 1 |
2 files changed, 31 insertions, 12 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index f92fad1d69..4e70c11034 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -171,6 +171,8 @@ Configure::Configure(int& argc, char** argv) } defaultBuildParts << QStringLiteral("libs") << QStringLiteral("tools") << QStringLiteral("examples"); + allBuildParts = defaultBuildParts; + allBuildParts << QStringLiteral("tests"); dictionary[ "QT_SOURCE_TREE" ] = sourcePath; dictionary[ "QT_BUILD_TREE" ] = buildPath; dictionary[ "QT_INSTALL_PREFIX" ] = installPath; @@ -387,6 +389,11 @@ QString Configure::firstLicensePath() void Configure::parseCmdLine() { + if (configCmdLine.size() && configCmdLine.at(0) == "-top-level") { + dictionary[ "TOPLEVEL" ] = "yes"; + configCmdLine.removeAt(0); + } + int argCount = configCmdLine.size(); int i = 0; const QStringList imageFormats = QStringList() << "gif" << "png" << "jpeg"; @@ -1001,12 +1008,22 @@ void Configure::parseCmdLine() ++i; if (i == argCount) 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") { ++i; if (i == argCount) 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") { @@ -1570,8 +1587,8 @@ void Configure::desc(const char *mark_option, const char *mark, const char *opti void Configure::applySpecSpecifics() { if (dictionary.contains("XQMAKESPEC")) { - //Disable building tools, docs and translations when cross compiling. - nobuildParts << "docs" << "translations" << "tools"; + //Disable building tools when cross compiling. + nobuildParts << "tools"; } if (dictionary.value("XQMAKESPEC").startsWith("wince")) { @@ -1617,6 +1634,7 @@ void Configure::applySpecSpecifics() } else if ((platform() == QNX) || (platform() == BLACKBERRY)) { dictionary["STACK_PROTECTOR_STRONG"] = "auto"; dictionary["SLOG2"] = "auto"; + dictionary["QT_XKBCOMMON"] = "no"; } else if (platform() == ANDROID) { dictionary[ "REDUCE_EXPORTS" ] = "yes"; dictionary[ "BUILD" ] = "release"; @@ -3946,15 +3964,17 @@ void Configure::generateMakefiles() QString pwd = QDir::currentPath(); { - QString dirName; + QString sourcePathMangled = sourcePath; + QString buildPathMangled = buildPath; + if (dictionary.contains("TOPLEVEL")) { + sourcePathMangled = QFileInfo(sourcePath).path(); + buildPathMangled = QFileInfo(buildPath).path(); + } bool generate = true; bool doDsp = (dictionary["VCPROJFILES"] == "yes" && dictionary["PROCESS"] == "full"); while (generate) { - QString pwd = QDir::currentPath(); - QString dirPath = buildPath + dirName; QStringList args; - args << buildPath + "/bin/qmake"; if (doDsp) { @@ -3969,11 +3989,9 @@ void Configure::generateMakefiles() } if (dictionary[ "PROCESS" ] == "full") args << "-r"; - args << (sourcePath + "/qtbase.pro"); - args << "-o"; - args << buildPath; + args << sourcePathMangled; - QDir::setCurrent(dirPath); + QDir::setCurrent(buildPathMangled); if (int exitCode = Environment::execute(args, QStringList(), QStringList())) { cout << "Qmake failed, return code " << exitCode << endl << endl; dictionary[ "DONE" ] = "error"; diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 3014e409f9..8f95e1fb95 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -104,6 +104,7 @@ private: // Our variable dictionaries QMap<QString,QString> dictionary; + QStringList allBuildParts; QStringList defaultBuildParts; QStringList buildParts; QStringList nobuildParts; |