Remove hardcoded modules in configure and QT_CONFIG

Also,
 - Turn qt3support into gui-qt3support, to support
   turning on/off qt3support-functions in core.
 - Fix QT_BUILD_PARTS for configure.exe
This commit is contained in:
Marius Storm-Olsen 2011-03-21 10:02:39 -05:00 committed by axis
parent 56ec511c6a
commit c681019093

View File

@ -188,7 +188,7 @@ Configure::Configure(int& argc, char** argv)
if (syncqt_bat.open(QFile::WriteOnly)) { if (syncqt_bat.open(QFile::WriteOnly)) {
QTextStream stream(&syncqt_bat); QTextStream stream(&syncqt_bat);
stream << "@echo off" << endl stream << "@echo off" << endl
<< "call " << fixSeparators(sourcePath) << fixSeparators("/bin/syncqt.bat -outdir \"") << fixSeparators(buildPath) << "\" \"" << fixSeparators(sourcePath) << "\"" << endl << "call " << fixSeparators(sourcePath) << fixSeparators("/bin/syncqt.bat -outdir \"") << fixSeparators(buildPath) << "\" \"" << fixSeparators(sourcePath) << "\"" << endl;
syncqt_bat.close(); syncqt_bat.close();
} }
} }
@ -1593,9 +1593,6 @@ void Configure::applySpecSpecifics()
dictionary[ "SQL_SQLITE" ] = "yes"; dictionary[ "SQL_SQLITE" ] = "yes";
dictionary[ "SQL_SQLITE_LIB" ] = "system"; dictionary[ "SQL_SQLITE_LIB" ] = "system";
// Disable building docs and translations for now
disabledBuildParts << "docs" << "translations";
} else if (dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong. } else if (dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong.
//TODO //TODO
dictionary[ "STYLE_WINDOWSXP" ] = "no"; dictionary[ "STYLE_WINDOWSXP" ] = "no";
@ -2682,7 +2679,7 @@ void Configure::generateOutputVars()
qmakeVars += "QT_LFLAGS_SQLITE += " + escapeSeparators(dictionary["QT_LFLAGS_SQLITE"]); qmakeVars += "QT_LFLAGS_SQLITE += " + escapeSeparators(dictionary["QT_LFLAGS_SQLITE"]);
if (dictionary[ "QT3SUPPORT" ] == "yes") if (dictionary[ "QT3SUPPORT" ] == "yes")
qtConfig += "qt3support"; qtConfig += "gui-qt3support";
if (dictionary[ "OPENGL" ] == "yes") if (dictionary[ "OPENGL" ] == "yes")
qtConfig += "opengl"; qtConfig += "opengl";
@ -2727,51 +2724,52 @@ void Configure::generateOutputVars()
if (dictionary[ "CETEST" ] == "yes") if (dictionary[ "CETEST" ] == "yes")
qtConfig += "cetest"; qtConfig += "cetest";
if (dictionary[ "SCRIPT" ] == "yes") // No longer needed after modularization
qtConfig += "script"; // if (dictionary[ "SCRIPT" ] == "yes")
// qtConfig += "script";
if (dictionary[ "SCRIPTTOOLS" ] == "yes") { // No longer needed after modularization
if (dictionary[ "SCRIPT" ] == "no") { // if (dictionary[ "SCRIPTTOOLS" ] == "yes") {
cout << "QtScriptTools was requested, but it can't be built due to QtScript being " // if (dictionary[ "SCRIPT" ] == "no") {
"disabled." << endl; // cout << "QtScriptTools was requested, but it can't be built due to QtScript being "
dictionary[ "DONE" ] = "error"; // "disabled." << endl;
} // dictionary[ "DONE" ] = "error";
qtConfig += "scripttools"; // }
} // qtConfig += "scripttools";
// }
if (dictionary[ "XMLPATTERNS" ] == "yes") // No longer needed after modularization
qtConfig += "xmlpatterns"; // if (dictionary[ "XMLPATTERNS" ] == "yes")
// qtConfig += "xmlpatterns";
if (dictionary["PHONON"] == "yes") { if (dictionary["PHONON"] == "yes") {
qtConfig += "phonon"; // No longer needed after modularization
//qtConfig += "phonon";
if (dictionary["PHONON_BACKEND"] == "yes") if (dictionary["PHONON_BACKEND"] == "yes")
qtConfig += "phonon-backend"; qtConfig += "phonon-backend";
} }
if (dictionary["MULTIMEDIA"] == "yes") { if (dictionary["MULTIMEDIA"] == "yes") {
qtConfig += "multimedia"; // No longer needed after modularization
//qtConfig += "multimedia";
if (dictionary["AUDIO_BACKEND"] == "yes") if (dictionary["AUDIO_BACKEND"] == "yes")
qtConfig += "audio-backend"; qtConfig += "audio-backend";
} }
QString dst = buildPath + "/mkspecs/modules/qt_webkit_version.pri";
QFile::remove(dst);
if (dictionary["WEBKIT"] != "no") { if (dictionary["WEBKIT"] != "no") {
// This include takes care of adding "webkit" to QT_CONFIG.
QString src = sourcePath + "/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri";
QFile::copy(src, dst);
if (dictionary["WEBKIT"] == "debug") if (dictionary["WEBKIT"] == "debug")
qtConfig += "webkit-debug"; qtConfig += "webkit-debug";
} }
if (dictionary["DECLARATIVE"] == "yes") { // No longer needed after modularization
if (dictionary[ "SCRIPT" ] == "no") { // if (dictionary["DECLARATIVE"] == "yes") {
cout << "QtDeclarative was requested, but it can't be built due to QtScript being " // if (dictionary[ "SCRIPT" ] == "no") {
"disabled." << endl; // cout << "QtDeclarative was requested, but it can't be built due to QtScript being "
dictionary[ "DONE" ] = "error"; // "disabled." << endl;
} // dictionary[ "DONE" ] = "error";
qtConfig += "declarative"; // }
} // qtConfig += "declarative";
// }
if (dictionary["DIRECTWRITE"] == "yes") if (dictionary["DIRECTWRITE"] == "yes")
qtConfig += "directwrite"; qtConfig += "directwrite";
@ -2922,81 +2920,81 @@ void Configure::generateCachefile()
} }
// Generate qmodule.pri // Generate qmodule.pri
QFile configFile(dictionary[ "QT_BUILD_TREE" ] + "/mkspecs/qmodule.pri"); QFile moduleFile(dictionary[ "QT_BUILD_TREE" ] + "/mkspecs/qmodule.pri");
if (configFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file. if (moduleFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file.
QTextStream configStream(&configFile); QTextStream moduleStream(&moduleFile);
configStream << "#paths" << endl; moduleStream << "#paths" << endl;
configStream << "QT_BUILD_TREE = " << fixSeparators(dictionary[ "QT_BUILD_TREE" ], true) << endl; moduleStream << "QT_BUILD_TREE = " << fixSeparators(dictionary[ "QT_BUILD_TREE" ], true) << endl;
configStream << "QT_SOURCE_TREE = " << fixSeparators(dictionary[ "QT_SOURCE_TREE" ], true) << endl; moduleStream << "QT_SOURCE_TREE = " << fixSeparators(dictionary[ "QT_SOURCE_TREE" ], true) << endl;
QStringList buildParts; QStringList buildParts;
buildParts << "libs" << "tools" << "examples" << "demos" << "docs" << "translations"; buildParts << "libs" << "examples" << "demos";
foreach (const QString &item, disabledBuildParts) { foreach (const QString &item, disabledBuildParts) {
buildParts.removeAll(item); buildParts.removeAll(item);
} }
configStream << "QT_BUILD_PARTS = " << buildParts.join(" ") << endl << endl; moduleStream << "QT_BUILD_PARTS = " << buildParts.join(" ") << endl << endl;
//so that we can build without an install first (which would be impossible) //so that we can build without an install first (which would be impossible)
configStream << "#local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR" << endl; moduleStream << "#local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR" << endl;
configStream << "QMAKE_MOC = $$QT_BUILD_TREE" << fixSeparators("/bin/moc.exe", true) << endl; moduleStream << "QMAKE_MOC = $$QT_BUILD_TREE" << fixSeparators("/bin/moc.exe", true) << endl;
configStream << "QMAKE_UIC = $$QT_BUILD_TREE" << fixSeparators("/bin/uic.exe", true) << endl; moduleStream << "QMAKE_UIC = $$QT_BUILD_TREE" << fixSeparators("/bin/uic.exe", true) << endl;
configStream << "QMAKE_RCC = $$QT_BUILD_TREE" << fixSeparators("/bin/rcc.exe", true) << endl; moduleStream << "QMAKE_RCC = $$QT_BUILD_TREE" << fixSeparators("/bin/rcc.exe", true) << endl;
configStream << "QMAKE_DUMPCPP = $$QT_BUILD_TREE" << fixSeparators("/bin/dumpcpp.exe", true) << endl; moduleStream << "QMAKE_DUMPCPP = $$QT_BUILD_TREE" << fixSeparators("/bin/dumpcpp.exe", true) << endl;
configStream << "QMAKE_INCDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/include", true) << endl; moduleStream << "QMAKE_INCDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/include", true) << endl;
configStream << "QMAKE_LIBDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/lib", true) << endl; moduleStream << "QMAKE_LIBDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/lib", true) << endl;
QString targetSpec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ]; QString targetSpec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ];
QString mkspec_path = fixSeparators(sourcePath + "/mkspecs/" + targetSpec); QString mkspec_path = fixSeparators(sourcePath + "/mkspecs/" + targetSpec);
if (QFile::exists(mkspec_path)) if (QFile::exists(mkspec_path))
configStream << "QMAKESPEC = " << escapeSeparators(mkspec_path) << endl; moduleStream << "QMAKESPEC = " << escapeSeparators(mkspec_path) << endl;
else else
configStream << "QMAKESPEC = " << fixSeparators(targetSpec, true) << endl; moduleStream << "QMAKESPEC = " << fixSeparators(targetSpec, true) << endl;
configStream << "ARCH = " << dictionary[ "ARCHITECTURE" ] << endl; moduleStream << "ARCH = " << dictionary[ "ARCHITECTURE" ] << endl;
if (dictionary["QT_EDITION"] != "QT_EDITION_OPENSOURCE") if (dictionary["QT_EDITION"] != "QT_EDITION_OPENSOURCE")
configStream << "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" << endl; moduleStream << "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" << endl;
if (dictionary["CETEST"] == "yes") { if (dictionary["CETEST"] == "yes") {
configStream << "QT_CE_RAPI_INC = " << fixSeparators(dictionary[ "QT_CE_RAPI_INC" ], true) << endl; moduleStream << "QT_CE_RAPI_INC = " << fixSeparators(dictionary[ "QT_CE_RAPI_INC" ], true) << endl;
configStream << "QT_CE_RAPI_LIB = " << fixSeparators(dictionary[ "QT_CE_RAPI_LIB" ], true) << endl; moduleStream << "QT_CE_RAPI_LIB = " << fixSeparators(dictionary[ "QT_CE_RAPI_LIB" ], true) << endl;
} }
configStream << "#Qt for Windows CE c-runtime deployment" << endl moduleStream << "#Qt for Windows CE c-runtime deployment" << endl
<< "QT_CE_C_RUNTIME = " << fixSeparators(dictionary[ "CE_CRT" ], true) << endl; << "QT_CE_C_RUNTIME = " << fixSeparators(dictionary[ "CE_CRT" ], true) << endl;
if (dictionary["CE_SIGNATURE"] != QLatin1String("no")) if (dictionary["CE_SIGNATURE"] != QLatin1String("no"))
configStream << "DEFAULT_SIGNATURE=" << dictionary["CE_SIGNATURE"] << endl; moduleStream << "DEFAULT_SIGNATURE=" << dictionary["CE_SIGNATURE"] << endl;
if (!dictionary["QMAKE_RPATHDIR"].isEmpty()) if (!dictionary["QMAKE_RPATHDIR"].isEmpty())
configStream << "QMAKE_RPATHDIR += " << dictionary["QMAKE_RPATHDIR"] << endl; moduleStream << "QMAKE_RPATHDIR += " << dictionary["QMAKE_RPATHDIR"] << endl;
if (!dictionary["QT_LIBINFIX"].isEmpty()) if (!dictionary["QT_LIBINFIX"].isEmpty())
configStream << "QT_LIBINFIX = " << dictionary["QT_LIBINFIX"] << endl; moduleStream << "QT_LIBINFIX = " << dictionary["QT_LIBINFIX"] << endl;
configStream << "#Qt for Symbian FPU settings" << endl; moduleStream << "#Qt for Symbian FPU settings" << endl;
if (!dictionary["ARM_FPU_TYPE"].isEmpty()) { if (!dictionary["ARM_FPU_TYPE"].isEmpty()) {
configStream<<"MMP_RULES += \"ARMFPU "<< dictionary["ARM_FPU_TYPE"]<< "\""; moduleStream<<"MMP_RULES += \"ARMFPU "<< dictionary["ARM_FPU_TYPE"]<< "\"";
} }
if (!dictionary["QT_NAMESPACE"].isEmpty()) { if (!dictionary["QT_NAMESPACE"].isEmpty()) {
configStream << "#namespaces" << endl << "QT_NAMESPACE = " << dictionary["QT_NAMESPACE"] << endl; moduleStream << "#namespaces" << endl << "QT_NAMESPACE = " << dictionary["QT_NAMESPACE"] << endl;
} }
// embedded // embedded
if (!dictionary["KBD_DRIVERS"].isEmpty()) if (!dictionary["KBD_DRIVERS"].isEmpty())
configStream << "kbd-drivers += "<< dictionary["KBD_DRIVERS"]<<endl; moduleStream << "kbd-drivers += "<< dictionary["KBD_DRIVERS"]<<endl;
if (!dictionary["GFX_DRIVERS"].isEmpty()) if (!dictionary["GFX_DRIVERS"].isEmpty())
configStream << "gfx-drivers += "<< dictionary["GFX_DRIVERS"]<<endl; moduleStream << "gfx-drivers += "<< dictionary["GFX_DRIVERS"]<<endl;
if (!dictionary["MOUSE_DRIVERS"].isEmpty()) if (!dictionary["MOUSE_DRIVERS"].isEmpty())
configStream << "mouse-drivers += "<< dictionary["MOUSE_DRIVERS"]<<endl; moduleStream << "mouse-drivers += "<< dictionary["MOUSE_DRIVERS"]<<endl;
if (!dictionary["DECORATIONS"].isEmpty()) if (!dictionary["DECORATIONS"].isEmpty())
configStream << "decorations += "<<dictionary["DECORATIONS"]<<endl; moduleStream << "decorations += "<<dictionary["DECORATIONS"]<<endl;
if (!dictionary["QMAKE_RPATHDIR"].isEmpty()) if (!dictionary["QMAKE_RPATHDIR"].isEmpty())
configStream << "QMAKE_RPATHDIR += "<<dictionary["QMAKE_RPATHDIR"]; moduleStream << "QMAKE_RPATHDIR += "<<dictionary["QMAKE_RPATHDIR"];
configStream.flush(); moduleStream.flush();
configFile.close(); moduleFile.close();
} }
// Generate qconfig.pri // Generate qconfig.pri