diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2016-11-15 20:49:43 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2016-12-13 18:55:32 +0000 |
commit | 8ebc7e967c5d245ffab5dcbf666fc01a4df4fe6a (patch) | |
tree | 46fab2186cc4c6946fe3d9da8356a4f5b25a552d /tools/configure | |
parent | 24cb1580e2bdb9eace8a419dcc44bffe13ed1550 (diff) |
move configure -redo handling (mostly) to qmake-based system
the qmake bootstrap uses some of the options, so the configures still
read config.opt for their own purposes, but the general handling is
entirely in the new system now.
Change-Id: I2c6c657d4da01c8d520ac74795454747bb224bdd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tools/configure')
-rw-r--r-- | tools/configure/configureapp.cpp | 52 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 3 |
2 files changed, 4 insertions, 51 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index cfba57272f..49dab2fcd4 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -107,10 +107,6 @@ Configure::Configure(int& argc, char** argv) //Only used when cross compiling. dictionary[ "QT_INSTALL_SETTINGS" ] = "/etc/xdg"; - dictionary[ "REDO" ] = "no"; - - dictionary[ "BUILDTYPE" ] = "none"; - QString tmp = dictionary[ "QMAKESPEC" ]; if (tmp.contains("\\")) { tmp = tmp.mid(tmp.lastIndexOf("\\") + 1); @@ -145,6 +141,7 @@ void Configure::parseCmdLine() sourcePathMangled = QFileInfo(sourcePath).path(); buildPathMangled = QFileInfo(buildPath).path(); } + qmakeCmdLine = configCmdLine; int argCount = configCmdLine.size(); int i = 0; @@ -152,7 +149,6 @@ void Configure::parseCmdLine() // Look first for -redo for (int k = 0 ; k < argCount; ++k) { if (configCmdLine.at(k) == "-redo") { - dictionary["REDO"] = "yes"; configCmdLine.removeAt(k); if (!reloadCmdLine(k)) { dictionary["DONE"] = "error"; @@ -178,13 +174,7 @@ void Configure::parseCmdLine() } for (; i<configCmdLine.size(); ++i) { - if (configCmdLine.at(i) == "-opensource") { - dictionary[ "BUILDTYPE" ] = "opensource"; - } - else if (configCmdLine.at(i) == "-commercial") { - dictionary[ "BUILDTYPE" ] = "commercial"; - } - else if (configCmdLine.at(i) == "-platform") { + if (configCmdLine.at(i) == "-platform") { ++i; if (i == argCount) break; @@ -207,10 +197,6 @@ void Configure::parseCmdLine() else if (configCmdLine.at(i) == "-no-syncqt") dictionary[ "SYNCQT" ] = "no"; - else if (configCmdLine.at(i) == "-confirm-license") { - dictionary["LICENSE_CONFIRMED"] = "yes"; - } - // Directories ---------------------------------------------- else if (configCmdLine.at(i) == "-prefix") { ++i; @@ -871,7 +857,7 @@ void Configure::configure() QStringList args; args << buildPath + "/bin/qmake" << sourcePathMangled - << "--" << configCmdLine; + << "--" << qmakeCmdLine; QString pwd = QDir::currentPath(); QDir::setCurrent(buildPathMangled); @@ -880,9 +866,6 @@ void Configure::configure() dictionary[ "DONE" ] = "error"; } QDir::setCurrent(pwd); - - if ((dictionary["REDO"] != "yes") && (dictionary["DONE"] != "error")) - saveCmdLine(); } bool Configure::reloadCmdLine(int idx) @@ -904,35 +887,6 @@ bool Configure::reloadCmdLine(int idx) return true; } -void Configure::saveCmdLine() -{ - if (dictionary[ "REDO" ] != "yes") { - if (dictionary["BUILDTYPE"] == "none") { - bool openSource = false; - QFile inFile(buildPath + "/mkspecs/qconfig.pri"); - if (inFile.open(QFile::ReadOnly | QFile::Text)) { - QTextStream inStream(&inFile); - while (!inStream.atEnd()) { - if (inStream.readLine() == "QT_EDITION = OpenSource") - openSource = true; - } - } - configCmdLine.append(openSource ? "-opensource" : "-commercial"); - } - if (dictionary["LICENSE_CONFIRMED"] != "yes") - configCmdLine.append("-confirm-license"); - QFile outFile(buildPathMangled + "/config.opt"); - if (outFile.open(QFile::WriteOnly | QFile::Text)) { - QTextStream outStream(&outFile); - for (QStringList::Iterator it = configCmdLine.begin(); it != configCmdLine.end(); ++it) { - outStream << (*it) << endl; - } - outStream.flush(); - outFile.close(); - } - } -} - bool Configure::isDone() { return !dictionary["DONE"].isEmpty(); diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 8d11f07457..755a2e2696 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -63,7 +63,7 @@ private: // Our variable dictionaries QMap<QString,QString> dictionary; - QStringList configCmdLine; + QStringList configCmdLine, qmakeCmdLine; QString outputLine; @@ -80,7 +80,6 @@ private: QString formatPath(const QString &path); bool reloadCmdLine(int idx); - void saveCmdLine(); }; class FileWriter : public QTextStream |