From a3292031295a09e5e959141db78c2310e08562ae Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 1 Oct 2015 16:39:57 +0200 Subject: 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 --- tools/configure/configureapp.cpp | 20 +++++++++++++++++--- tools/configure/configureapp.h | 2 ++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index c54bc9426e..d4ea0f6d04 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -83,7 +83,7 @@ static inline void promptKeyPress() 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 optionIndent = 4; @@ -383,6 +383,7 @@ void Configure::parseCmdLine() configCmdLine.clear(); reloadCmdLine(); } + else if (configCmdLine.at(i) == "-loadconfig") { ++i; if (i != argCount) { @@ -420,6 +421,10 @@ void Configure::parseCmdLine() || configCmdLine.at(i) == "-?") dictionary[ "HELP" ] = "yes"; + else if (configCmdLine.at(i) == "-v" || configCmdLine.at(i) == "-verbose") { + ++verbose; + } + else if (configCmdLine.at(i) == "-qconfig") { ++i; if (i == argCount) @@ -2058,6 +2063,7 @@ bool Configure::displayHelp() desc( "-loadconfig ", "Run configure with the parameters from file configure_.cache."); desc( "-saveconfig ", "Run configure and save the parameters in file configure_.cache."); 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 ----------------------------------------------------------------------------- desc("Qt for Windows CE only:\n\n"); @@ -3377,7 +3383,7 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext } // 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")), QDir::toNativeSeparators(sourcePath + "/config.tests/" + projectPath), extraOptions); @@ -3389,6 +3395,11 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext addSysroot(&command); } + if (verbose) + cout << qPrintable(command) << endl; + else + command += " 2>&1"; + int code = 0; QString output = Environment::execute(command, &code); //cout << output << endl; @@ -3398,7 +3409,10 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext command = dictionary[ "MAKE" ]; if (command.contains("nmake") || command.contains("jom")) command += " /NOLOGO"; - command += " -s 2>&1"; + if (verbose) + cout << qPrintable(command) << endl; + else + command += " -s 2>&1"; output = Environment::execute(command, &code); //cout << output << endl; diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index de8d1a2469..78cc118a9d 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -93,6 +93,8 @@ public: private: bool checkAngleAvailability(QString *errorMessage = 0) const; + int verbose; + // Our variable dictionaries QMap dictionary; QStringList allBuildParts; -- cgit v1.2.3