configure.exe: Add -verbose option.

Make it possible to inspect the output of the configure tests.

Task-number: QTBUG-48525
Change-Id: If93d597679ae1b189dfdaa485852d34cad52593b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
Friedemann Kleint 2015-10-01 16:39:57 +02:00
parent 8be1c3fae8
commit a329203129
2 changed files with 19 additions and 3 deletions

View File

@ -83,7 +83,7 @@ static inline void promptKeyPress()
exit(0); // Exit cleanly for Ctrl+C exit(0); // Exit cleanly for Ctrl+C
} }
Configure::Configure(int& argc, char** argv) Configure::Configure(int& argc, char** argv) : verbose(0)
{ {
// Default values for indentation // Default values for indentation
optionIndent = 4; optionIndent = 4;
@ -383,6 +383,7 @@ void Configure::parseCmdLine()
configCmdLine.clear(); configCmdLine.clear();
reloadCmdLine(); reloadCmdLine();
} }
else if (configCmdLine.at(i) == "-loadconfig") { else if (configCmdLine.at(i) == "-loadconfig") {
++i; ++i;
if (i != argCount) { if (i != argCount) {
@ -420,6 +421,10 @@ void Configure::parseCmdLine()
|| configCmdLine.at(i) == "-?") || configCmdLine.at(i) == "-?")
dictionary[ "HELP" ] = "yes"; dictionary[ "HELP" ] = "yes";
else if (configCmdLine.at(i) == "-v" || configCmdLine.at(i) == "-verbose") {
++verbose;
}
else if (configCmdLine.at(i) == "-qconfig") { else if (configCmdLine.at(i) == "-qconfig") {
++i; ++i;
if (i == argCount) if (i == argCount)
@ -2058,6 +2063,7 @@ bool Configure::displayHelp()
desc( "-loadconfig <config>", "Run configure with the parameters from file configure_<config>.cache."); desc( "-loadconfig <config>", "Run configure with the parameters from file configure_<config>.cache.");
desc( "-saveconfig <config>", "Run configure and save the parameters in file configure_<config>.cache."); desc( "-saveconfig <config>", "Run configure and save the parameters in file configure_<config>.cache.");
desc( "-redo", "Run configure with the same parameters as last time.\n"); desc( "-redo", "Run configure with the same parameters as last time.\n");
desc( "-v, -verbose", "Run configure tests with verbose output.\n");
// Qt\Windows CE only options go below here ----------------------------------------------------------------------------- // Qt\Windows CE only options go below here -----------------------------------------------------------------------------
desc("Qt for Windows CE only:\n\n"); desc("Qt for Windows CE only:\n\n");
@ -3377,7 +3383,7 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext
} }
// run qmake // run qmake
QString command = QString("%1 %2 %3 2>&1") QString command = QString("%1 %2 %3")
.arg(QDir::toNativeSeparators(QDir(newpwd).relativeFilePath(buildPath + "/bin/qmake.exe")), .arg(QDir::toNativeSeparators(QDir(newpwd).relativeFilePath(buildPath + "/bin/qmake.exe")),
QDir::toNativeSeparators(sourcePath + "/config.tests/" + projectPath), QDir::toNativeSeparators(sourcePath + "/config.tests/" + projectPath),
extraOptions); extraOptions);
@ -3389,6 +3395,11 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext
addSysroot(&command); addSysroot(&command);
} }
if (verbose)
cout << qPrintable(command) << endl;
else
command += " 2>&1";
int code = 0; int code = 0;
QString output = Environment::execute(command, &code); QString output = Environment::execute(command, &code);
//cout << output << endl; //cout << output << endl;
@ -3398,7 +3409,10 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext
command = dictionary[ "MAKE" ]; command = dictionary[ "MAKE" ];
if (command.contains("nmake") || command.contains("jom")) if (command.contains("nmake") || command.contains("jom"))
command += " /NOLOGO"; command += " /NOLOGO";
command += " -s 2>&1"; if (verbose)
cout << qPrintable(command) << endl;
else
command += " -s 2>&1";
output = Environment::execute(command, &code); output = Environment::execute(command, &code);
//cout << output << endl; //cout << output << endl;

View File

@ -93,6 +93,8 @@ public:
private: private:
bool checkAngleAvailability(QString *errorMessage = 0) const; bool checkAngleAvailability(QString *errorMessage = 0) const;
int verbose;
// Our variable dictionaries // Our variable dictionaries
QMap<QString,QString> dictionary; QMap<QString,QString> dictionary;
QStringList allBuildParts; QStringList allBuildParts;