From 6a508ee5b21dca0ae4e49ab5f5604345106ed0a9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 25 Oct 2013 17:51:28 +0200 Subject: bring the windows configure -qconfig handling in line with the unix one on the way, this significantly simplifies the code. Change-Id: I24f0a517e62cc4b913ffef5cab096e721653c013 Reviewed-by: Joerg Bornemann Reviewed-by: Thiago Macieira --- tools/configure/configureapp.cpp | 69 ++++++++++------------------------------ tools/configure/configureapp.h | 1 - 2 files changed, 16 insertions(+), 54 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 0fd35dd2fa..5d4ce84941 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1432,20 +1432,7 @@ void Configure::parseCmdLine() void Configure::validateArgs() { // Validate the specified config - - // Get all possible configurations from the file system. - QDir dir; - QStringList filters; - filters << "qconfig-*.h"; - dir.setNameFilters(filters); - dir.setPath(sourcePath + "/src/corelib/global/"); - - QStringList stringList = dir.entryList(); - - QStringList::Iterator it; - for (it = stringList.begin(); it != stringList.end(); ++it) - allConfigs << it->remove("qconfig-").remove(".h"); - allConfigs << "full"; + QString cfgpath = sourcePath + "/src/corelib/global/qconfig-" + dictionary["QCONFIG"] + ".h"; // Try internal configurations first. QStringList possible_configs = QStringList() @@ -1457,23 +1444,22 @@ void Configure::validateArgs() int index = possible_configs.indexOf(dictionary["QCONFIG"]); if (index >= 0) { for (int c = 0; c <= index; c++) { - qmakeConfig += possible_configs[c] + "-config"; + qtConfig += possible_configs[c] + "-config"; } + if (dictionary["QCONFIG"] != "full") + dictionary["QCONFIG_PATH"] = cfgpath; return; } - // If the internal configurations failed, try others. - QStringList::Iterator config; - for (config = allConfigs.begin(); config != allConfigs.end(); ++config) { - if ((*config) == dictionary[ "QCONFIG" ]) - break; - } - if (config == allConfigs.end()) { - dictionary[ "HELP" ] = "yes"; - cout << "No such configuration \"" << qPrintable(dictionary[ "QCONFIG" ]) << "\"" << endl ; + if (!QFileInfo::exists(cfgpath)) { + cfgpath = QFileInfo(dictionary["QCONFIG"]).absoluteFilePath(); + if (!QFileInfo::exists(cfgpath)) { + dictionary[ "HELP" ] = "yes"; + cout << "No such configuration \"" << qPrintable(dictionary["QCONFIG"]) << "\"" << endl ; + return; + } } - else - qmakeConfig += (*config) + "-config"; + dictionary["QCONFIG_PATH"] = cfgpath; } // Output helper functions --------------------------------[ Start ]- @@ -1784,6 +1770,9 @@ bool Configure::displayHelp() desc( "-sysroot ", "Sets as the target compiler's and qmake's sysroot and also sets pkg-config paths."); desc( "-no-gcc-sysroot", "When using -sysroot, it disables the passing of --sysroot to the compiler.\n"); + desc( "-qconfig ", "Use src/corelib/global/qconfig-.h rather than the\n" + "default 'full'.\n"); + desc("NIS", "no", "-no-nis", "Do not compile NIS support."); desc("NIS", "yes", "-nis", "Compile NIS support.\n"); @@ -1935,13 +1924,6 @@ bool Configure::displayHelp() desc("MSVC_MP", "no", "-no-mp", "Do not use multiple processors for compiling with MSVC"); desc("MSVC_MP", "yes", "-mp", "Use multiple processors for compiling with MSVC (-MP).\n"); -/* We do not support -qconfig on Windows yet - - desc( "-qconfig ", "Use src/tools/qconfig-local.h rather than the default.\nPossible values for local:"); - for (int i=0; i", "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"); @@ -2740,23 +2722,6 @@ void Configure::generateOutputVars() if (dictionary[ "SYSTEM_PROXIES" ] == "yes") qtConfig += "system-proxies"; - // Add config levels -------------------------------------------- - QStringList possible_configs = QStringList() - << "minimal" - << "small" - << "medium" - << "large" - << "full"; - - QString set_config = dictionary["QCONFIG"]; - if (possible_configs.contains(set_config)) { - foreach (const QString &cfg, possible_configs) { - qtConfig += (cfg + "-config"); - if (cfg == set_config) - break; - } - } - if (dictionary.contains("XQMAKESPEC") && (dictionary["QMAKESPEC"] != dictionary["XQMAKESPEC"])) { qmakeConfig += "cross_compile"; dictionary["CROSS_COMPILE"] = "yes"; @@ -3280,10 +3245,8 @@ void Configure::generateConfigfiles() if (dictionary[ "QCONFIG" ] == "full") { tmpStream << "/* Everything */" << endl; } else { - QString configName("qconfig-" + dictionary[ "QCONFIG" ] + ".h"); - tmpStream << "/* Copied from " << configName << "*/" << endl; tmpStream << "#ifndef QT_BOOTSTRAPPED" << endl; - QFile inFile(sourcePath + "/src/corelib/global/" + configName); + QFile inFile(dictionary["QCONFIG_PATH"]); if (inFile.open(QFile::ReadOnly)) { tmpStream << QTextStream(&inFile).readAll(); inFile.close(); diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 8a22cea6ec..bf0f61639f 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -113,7 +113,6 @@ private: QStringList skipModules; QStringList licensedModules; QStringList allSqlDrivers; - QStringList allConfigs; QStringList disabledModules; QStringList enabledModules; QStringList modules; -- cgit v1.2.3