diff options
Diffstat (limited to 'tools/configure/configureapp.cpp')
-rw-r--r-- | tools/configure/configureapp.cpp | 164 |
1 files changed, 46 insertions, 118 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 90981f6624..63f85791a4 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -157,9 +157,7 @@ Configure::Configure(int& argc, char** argv) dictionary[ "QCONFIG" ] = "full"; dictionary[ "EMBEDDED" ] = "no"; dictionary[ "BUILD_QMAKE" ] = "yes"; - dictionary[ "VCPROJFILES" ] = "yes"; dictionary[ "QMAKE_INTERNAL" ] = "no"; - dictionary[ "PROCESS" ] = "partial"; dictionary[ "WIDGETS" ] = "yes"; dictionary[ "GUI" ] = "yes"; dictionary[ "RTTI" ] = "yes"; @@ -172,7 +170,6 @@ Configure::Configure(int& argc, char** argv) dictionary[ "SSE4_2" ] = "auto"; dictionary[ "AVX" ] = "auto"; dictionary[ "AVX2" ] = "auto"; - dictionary[ "IWMMXT" ] = "auto"; dictionary[ "SYNCQT" ] = "auto"; dictionary[ "CE_CRT" ] = "no"; dictionary[ "CETEST" ] = "auto"; @@ -239,7 +236,6 @@ Configure::Configure(int& argc, char** argv) } dictionary[ "REDO" ] = "no"; - dictionary[ "DEPENDENCIES" ] = "no"; dictionary[ "BUILD" ] = "debug"; dictionary[ "BUILDALL" ] = "auto"; // Means yes, but not explicitly @@ -253,13 +249,15 @@ Configure::Configure(int& argc, char** argv) dictionary[ "C++11" ] = "auto"; + dictionary[ "USE_GOLD_LINKER" ] = "no"; + dictionary[ "SHARED" ] = "yes"; dictionary[ "ZLIB" ] = "auto"; dictionary[ "PCRE" ] = "auto"; - dictionary[ "ICU" ] = "auto"; + dictionary[ "ICU" ] = "no"; dictionary[ "ANGLE" ] = "auto"; dictionary[ "DYNAMICGL" ] = "auto"; @@ -314,11 +312,6 @@ Configure::Configure(int& argc, char** argv) Configure::~Configure() { - for (int i=0; i<3; ++i) { - QList<MakeItem*> items = makeList[i]; - for (int j=0; j<items.size(); ++j) - delete items[j]; - } } QString Configure::formatPath(const QString &path) @@ -431,7 +424,15 @@ void Configure::parseCmdLine() ++i; if (i == argCount) break; - dictionary[ "QREAL" ] = configCmdLine.at(i); + QString s = dictionary[ "QREAL" ] = configCmdLine.at(i); + if (s == "float") { + dictionary[ "QREAL_STRING" ] = "\"float\""; + } else { + // escape + s = s.simplified(); + s = '"' + s.toLatin1().toPercentEncoding(QByteArray(), "-._~", '_') + '"'; + dictionary[ "QREAL_STRING" ] = s; + } } else if (configCmdLine.at(i) == "-release") { @@ -461,6 +462,10 @@ void Configure::parseCmdLine() dictionary[ "C++11" ] = "yes"; else if (configCmdLine.at(i) == "-no-c++11") dictionary[ "C++11" ] = "no"; + else if (configCmdLine.at(i) == "-use-gold-linker") + dictionary[ "USE_GOLD_LINKER" ] = "yes"; + else if (configCmdLine.at(i) == "-no-use-gold-linker") + dictionary[ "USE_GOLD_LINKER" ] = "no"; else if (configCmdLine.at(i) == "-shared") dictionary[ "SHARED" ] = "yes"; else if (configCmdLine.at(i) == "-static") @@ -788,12 +793,6 @@ void Configure::parseCmdLine() imageFormats.contains(configCmdLine.at(i).section('-', 3))) dictionary[ configCmdLine.at(i).section('-', 3).toUpper() ] = "no"; - // IDE project generation ----------------------------------- - else if (configCmdLine.at(i) == "-no-vcproj") - dictionary[ "VCPROJFILES" ] = "no"; - else if (configCmdLine.at(i) == "-vcproj") - dictionary[ "VCPROJFILES" ] = "yes"; - else if (configCmdLine.at(i) == "-no-incredibuild-xge") dictionary[ "INCREDIBUILD_XGE" ] = "no"; else if (configCmdLine.at(i) == "-incredibuild-xge") @@ -858,10 +857,6 @@ void Configure::parseCmdLine() dictionary[ "AVX2" ] = "no"; else if (configCmdLine.at(i) == "-avx2") dictionary[ "AVX2" ] = "yes"; - else if (configCmdLine.at(i) == "-no-iwmmxt") - dictionary[ "IWMMXT" ] = "no"; - else if (configCmdLine.at(i) == "-iwmmxt") - dictionary[ "IWMMXT" ] = "yes"; else if (configCmdLine.at(i) == "-no-openssl") { dictionary[ "OPENSSL"] = "no"; @@ -943,19 +938,6 @@ void Configure::parseCmdLine() else if (configCmdLine.at(i) == "-qmake") dictionary[ "BUILD_QMAKE" ] = "yes"; - else if (configCmdLine.at(i) == "-dont-process") - dictionary[ "PROCESS" ] = "no"; - else if (configCmdLine.at(i) == "-process") - dictionary[ "PROCESS" ] = "partial"; - else if (configCmdLine.at(i) == "-fully-process") - dictionary[ "PROCESS" ] = "full"; - - else if (configCmdLine.at(i) == "-no-qmake-deps") - dictionary[ "DEPENDENCIES" ] = "no"; - else if (configCmdLine.at(i) == "-qmake-deps") - dictionary[ "DEPENDENCIES" ] = "yes"; - - else if (configCmdLine.at(i) == "-qtnamespace") { ++i; if (i == argCount) @@ -1654,8 +1636,6 @@ void Configure::applySpecSpecifics() dictionary[ "LARGE_FILE" ] = "no"; dictionary[ "ANGLE" ] = "d3d11"; dictionary[ "DYNAMICGL" ] = "no"; - if (dictionary.value("XQMAKESPEC").startsWith("winphone")) - dictionary[ "SQL_SQLITE" ] = "no"; } else if (dictionary.value("XQMAKESPEC").startsWith("wince")) { dictionary[ "STYLE_WINDOWSXP" ] = "no"; dictionary[ "STYLE_WINDOWSVISTA" ] = "no"; @@ -1672,15 +1652,12 @@ void Configure::applySpecSpecifics() dictionary[ "SSE4_2" ] = "no"; dictionary[ "AVX" ] = "no"; dictionary[ "AVX2" ] = "no"; - dictionary[ "IWMMXT" ] = "no"; dictionary[ "CE_CRT" ] = "yes"; dictionary[ "LARGE_FILE" ] = "no"; dictionary[ "ANGLE" ] = "no"; dictionary[ "DYNAMICGL" ] = "no"; - // We only apply MMX/IWMMXT for mkspecs we know they work if (dictionary[ "XQMAKESPEC" ].startsWith("wincewm")) { dictionary[ "MMX" ] = "yes"; - dictionary[ "IWMMXT" ] = "yes"; } } else if (dictionary.value("XQMAKESPEC").startsWith("linux")) { //TODO actually wrong. //TODO @@ -1783,6 +1760,9 @@ bool Configure::displayHelp() desc("C++11", "yes", "-c++11", "Compile Qt with C++11 support enabled."); desc("C++11", "no", "-no-c++11", "Do not compile Qt with C++11 support enabled.\n"); + desc("USE_GOLD_LINKER", "yes", "-use-gold-linker", "Link using the GNU gold linker (gcc only)."); + desc("USE_GOLD_LINKER", "no", "-no-use-gold-linker", "Do not link using the GNU gold linker.\n"); + desc("SHARED", "yes", "-shared", "Create and use shared Qt libraries."); desc("SHARED", "no", "-static", "Create and use static Qt libraries.\n"); @@ -1948,9 +1928,6 @@ bool Configure::displayHelp() // Qt\Windows only options go below here -------------------------------------------------------------------------------- desc("\nQt for Windows only:\n\n"); - desc("VCPROJFILES", "no", "-no-vcproj", "Do not generate VC++ .vcproj files."); - desc("VCPROJFILES", "yes", "-vcproj", "Generate VC++ .vcproj files, only if platform \"win32-msvc.net\".\n"); - desc("INCREDIBUILD_XGE", "no", "-no-incredibuild-xge", "Do not add IncrediBuild XGE distribution commands to custom build steps."); desc("INCREDIBUILD_XGE", "yes", "-incredibuild-xge", "Add IncrediBuild XGE distribution commands to custom build steps. This will distribute MOC and UIC steps, and other custom buildsteps which are added to the INCREDIBUILD_XGE variable.\n(The IncrediBuild distribution commands are only added to Visual Studio projects)\n"); @@ -1959,10 +1936,6 @@ bool Configure::displayHelp() desc("BUILD_QMAKE", "no", "-no-qmake", "Do not compile qmake."); desc("BUILD_QMAKE", "yes", "-qmake", "Compile qmake.\n"); - desc("PROCESS", "partial", "-process", "Generate only top-level Makefile."); - desc("PROCESS", "full", "-fully-process", "Generate Makefiles/Project files for the entire Qt\ntree."); - desc("PROCESS", "no", "-dont-process", "Do not generate Makefiles/Project files.\n"); - desc( "-qreal [double|float]", "typedef qreal to the specified type. The default is double.\n" "Note that changing this flag affects binary compatibility.\n"); @@ -2025,8 +1998,6 @@ bool Configure::displayHelp() // Qt\Windows CE only options go below here ----------------------------------------------------------------------------- desc("Qt for Windows CE only:\n\n"); - desc("IWMMXT", "no", "-no-iwmmxt", "Do not compile with use of IWMMXT instructions."); - desc("IWMMXT", "yes", "-iwmmxt", "Do compile with use of IWMMXT instructions. (Qt for Windows CE on Arm only)\n"); desc("CE_CRT", "no", "-no-crt" , "Do not add the C runtime to default deployment rules."); desc("CE_CRT", "yes", "-qt-crt", "Qt identifies C runtime during project generation."); desc( "-crt <path>", "Specify path to C runtime used for project generation.\n"); @@ -2227,8 +2198,6 @@ bool Configure::checkAvailability(const QString &part) available = findFile("sqlite.h") && findFile("sqlite.lib"); else if (part == "SQL_IBASE") available = findFile("ibase.h") && (findFile("gds32_ms.lib") || findFile("gds32.lib")); - else if (part == "IWMMXT") - available = (dictionary.value("XQMAKESPEC").startsWith("wince")); else if (part == "OPENGL_ES_2") available = (dictionary.value("XQMAKESPEC").startsWith("wince")); else if (part == "SSE2") @@ -2299,7 +2268,7 @@ bool Configure::checkAvailability(const QString &part) available = (platform() == QNX || platform() == BLACKBERRY) && tryCompileProject("unix/lgmon"); } else if (part == "NEON") { - available = (dictionary["QT_ARCH"] == "arm") && tryCompileProject("unix/neon"); + available = dictionary["QT_CPU_FEATURES"].contains("neon"); } else if (part == "FONT_CONFIG") { available = tryCompileProject("unix/fontconfig"); } @@ -2402,8 +2371,6 @@ void Configure::autoDetection() dictionary["AVX"] = checkAvailability("AVX") ? "yes" : "no"; if (dictionary["AVX2"] == "auto") dictionary["AVX2"] = checkAvailability("AVX2") ? "yes" : "no"; - if (dictionary["IWMMXT"] == "auto") - dictionary["IWMMXT"] = checkAvailability("IWMMXT") ? "yes" : "no"; if (dictionary["NEON"] == "auto") dictionary["NEON"] = checkAvailability("NEON") ? "yes" : "no"; if (dictionary["OPENSSL"] == "auto") @@ -2588,8 +2555,9 @@ bool Configure::verifyConfiguration() } if (dictionary["DYNAMICGL"] == "yes") { - if (dictionary["OPENGL_ES_2"] == "yes" || dictionary["ANGLE"] != "no") { - cout << "ERROR: Dynamic OpenGL cannot be used together with native Angle (GLES2) builds." << endl; + // Note that d3d11 is still allowed for ANGLE, hence the check for == "yes". + if (dictionary["OPENGL_ES_2"] == "yes" || dictionary["ANGLE"] == "yes") { + cout << "ERROR: Dynamic OpenGL cannot be used with -angle." << endl; dictionary[ "DONE" ] = "error"; } } @@ -2637,6 +2605,9 @@ void Configure::generateOutputVars() if (dictionary[ "C++11" ] == "yes") qtConfig += "c++11"; + if (dictionary[ "USE_GOLD_LINKER" ] == "yes") + qmakeConfig += "use_gold_linker"; + if (dictionary[ "SHARED" ] == "no") qtConfig += "static"; else @@ -2672,8 +2643,11 @@ void Configure::generateOutputVars() } // Dynamic OpenGL loading --------------------------------------- - if (dictionary[ "DYNAMICGL" ] != "no") + if (dictionary[ "DYNAMICGL" ] != "no") { qtConfig += "dynamicgl"; + if (dictionary[ "ANGLE" ] == "d3d11") + qmakeConfig += "angle_d3d11"; + } // Image formates ----------------------------------------------- if (dictionary[ "GIF" ] == "no") @@ -3071,8 +3045,6 @@ void Configure::generateCachefile() moduleStream << " avx"; if (dictionary[ "AVX2" ] == "yes") moduleStream << " avx2"; - if (dictionary[ "IWMMXT" ] == "yes") - moduleStream << " iwmmxt"; if (dictionary[ "NEON" ] == "yes") moduleStream << " neon"; if (dictionary[ "LARGE_FILE" ] == "yes") @@ -3499,24 +3471,24 @@ void Configure::generateConfigfiles() tmpStream << endl << "// Compiler sub-arch support" << endl; if (dictionary[ "SSE2" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_SSE2" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_SSE2 1" << endl; if (dictionary[ "SSE3" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_SSE3" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_SSE3 1" << endl; if (dictionary[ "SSSE3" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_SSSE3" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_SSSE3 1" << endl; if (dictionary[ "SSE4_1" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_SSE4_1" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_SSE4_1 1" << endl; if (dictionary[ "SSE4_2" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_SSE4_2" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_SSE4_2 1" << endl; if (dictionary[ "AVX" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_AVX" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_AVX 1" << endl; if (dictionary[ "AVX2" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_AVX2" << endl; - if (dictionary[ "IWMMXT" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_IWMMXT" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_AVX2 1" << endl; - if (dictionary["QREAL"] != "double") + if (dictionary["QREAL"] != "double") { tmpStream << "#define QT_COORD_TYPE " << dictionary["QREAL"] << endl; + tmpStream << "#define QT_COORD_TYPE_STRING " << dictionary["QREAL_STRING"] << endl; + } tmpStream << endl << "// Compile time features" << endl; @@ -3673,7 +3645,6 @@ void Configure::displayConfig() sout << "AVX support................." << dictionary[ "AVX" ] << endl; sout << "AVX2 support................" << dictionary[ "AVX2" ] << endl; sout << "NEON support................" << dictionary[ "NEON" ] << endl; - sout << "IWMMXT support.............." << dictionary[ "IWMMXT" ] << endl; sout << "OpenGL support.............." << dictionary[ "OPENGL" ] << endl; sout << "Large File support.........." << dictionary[ "LARGE_FILE" ] << endl; sout << "NIS support................." << dictionary[ "NIS" ] << endl; @@ -4175,27 +4146,8 @@ void Configure::buildQmake() } -void Configure::appendMakeItem(int inList, const QString &item) -{ - QString dir; - if (item != "src") - dir = "/" + item; - dir.prepend("/src"); - makeList[inList].append(new MakeItem(sourcePath + dir, - item + ".pro", buildPath + dir + "/Makefile", Lib)); - if (dictionary[ "VCPROJFILES" ] == "yes") { - makeList[inList].append(new MakeItem(sourcePath + dir, - item + ".pro", buildPath + dir + "/" + item + ".vcproj", Lib)); - } -} - void Configure::generateMakefiles() { - if (dictionary[ "PROCESS" ] != "no") { - QString spec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ]; - if (spec != "win32-msvc.net" && !spec.startsWith("win32-msvc2") && !spec.startsWith(QLatin1String("wince")) && !spec.startsWith("winphone") && !spec.startsWith("winrt") ) - dictionary[ "VCPROJFILES" ] = "no"; - QString pwd = QDir::currentPath(); { QString sourcePathMangled = sourcePath; @@ -4204,40 +4156,16 @@ void Configure::generateMakefiles() sourcePathMangled = QFileInfo(sourcePath).path(); buildPathMangled = QFileInfo(buildPath).path(); } - bool generate = true; - bool doDsp = (dictionary["VCPROJFILES"] == "yes" - && dictionary["PROCESS"] == "full"); - while (generate) { - QStringList args; - args << buildPath + "/bin/qmake"; - - if (doDsp) { - if (dictionary[ "DEPENDENCIES" ] == "no") - args << "-nodepend"; - args << "-tp" << "vc"; - doDsp = false; // DSP files will be done - printf("Generating Visual Studio project files...\n"); - } else { - printf("Generating Makefiles...\n"); - generate = false; // Now Makefiles will be done - } - if (dictionary[ "PROCESS" ] == "full") - args << "-r"; - args << sourcePathMangled; + QStringList args; + args << buildPath + "/bin/qmake" << sourcePathMangled; - QDir::setCurrent(buildPathMangled); - if (int exitCode = Environment::execute(args, QStringList(), QStringList())) { - cout << "Qmake failed, return code " << exitCode << endl << endl; - dictionary[ "DONE" ] = "error"; - } + QDir::setCurrent(buildPathMangled); + if (int exitCode = Environment::execute(args, QStringList(), QStringList())) { + cout << "Qmake failed, return code " << exitCode << endl << endl; + dictionary[ "DONE" ] = "error"; } } QDir::setCurrent(pwd); - } else { - cout << "Processing of project files have been disabled." << endl; - cout << "Only use this option if you really know what you're doing." << endl << endl; - return; - } } void Configure::showSummary() |