Remove hardcoded modules in configure and QT_CONFIG
authorMarius Storm-Olsen <marius.storm-olsen@nokia.com>
Mon, 21 Mar 2011 15:02:39 +0000 (10:02 -0500)
committeraxis <qt-info@nokia.com>
Wed, 27 Apr 2011 10:05:53 +0000 (12:05 +0200)
Also,
 - Turn qt3support into gui-qt3support, to support
   turning on/off qt3support-functions in core.
 - Fix QT_BUILD_PARTS for configure.exe

tools/configure/configureapp.cpp

index 2d84ad5..9c2ce2c 100644 (file)
@@ -188,7 +188,7 @@ Configure::Configure(int& argc, char** argv)
             if (syncqt_bat.open(QFile::WriteOnly)) {
                 QTextStream stream(&syncqt_bat);
                 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();
             }
         }
@@ -1593,9 +1593,6 @@ void Configure::applySpecSpecifics()
         dictionary[ "SQL_SQLITE" ]          = "yes";
         dictionary[ "SQL_SQLITE_LIB" ]      = "system";
 
-        // Disable building docs and translations for now
-        disabledBuildParts << "docs" << "translations";
-
     } else if (dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong.
       //TODO
         dictionary[ "STYLE_WINDOWSXP" ]     = "no";
@@ -2682,7 +2679,7 @@ void Configure::generateOutputVars()
         qmakeVars += "QT_LFLAGS_SQLITE += " + escapeSeparators(dictionary["QT_LFLAGS_SQLITE"]);
 
     if (dictionary[ "QT3SUPPORT" ] == "yes")
-        qtConfig += "qt3support";
+        qtConfig += "gui-qt3support";
 
     if (dictionary[ "OPENGL" ] == "yes")
         qtConfig += "opengl";
@@ -2727,51 +2724,52 @@ void Configure::generateOutputVars()
     if (dictionary[ "CETEST" ] == "yes")
         qtConfig += "cetest";
 
-    if (dictionary[ "SCRIPT" ] == "yes")
-        qtConfig += "script";
+// No longer needed after modularization
+//    if (dictionary[ "SCRIPT" ] == "yes")
+//        qtConfig += "script";
 
-    if (dictionary[ "SCRIPTTOOLS" ] == "yes") {
-        if (dictionary[ "SCRIPT" ] == "no") {
-            cout << "QtScriptTools was requested, but it can't be built due to QtScript being "
-                    "disabled." << endl;
-            dictionary[ "DONE" ] = "error";
-        }
-        qtConfig += "scripttools";
-    }
+// No longer needed after modularization
+//    if (dictionary[ "SCRIPTTOOLS" ] == "yes") {
+//        if (dictionary[ "SCRIPT" ] == "no") {
+//            cout << "QtScriptTools was requested, but it can't be built due to QtScript being "
+//                    "disabled." << endl;
+//            dictionary[ "DONE" ] = "error";
+//        }
+//        qtConfig += "scripttools";
+//    }
 
-    if (dictionary[ "XMLPATTERNS" ] == "yes")
-        qtConfig += "xmlpatterns";
+// No longer needed after modularization
+//    if (dictionary[ "XMLPATTERNS" ] == "yes")
+//        qtConfig += "xmlpatterns";
 
     if (dictionary["PHONON"] == "yes") {
-        qtConfig += "phonon";
+        // No longer needed after modularization
+        //qtConfig += "phonon";
         if (dictionary["PHONON_BACKEND"] == "yes")
             qtConfig += "phonon-backend";
     }
 
     if (dictionary["MULTIMEDIA"] == "yes") {
-        qtConfig += "multimedia";
+        // No longer needed after modularization
+        //qtConfig += "multimedia";
         if (dictionary["AUDIO_BACKEND"] == "yes")
             qtConfig += "audio-backend";
     }
 
-    QString dst = buildPath + "/mkspecs/modules/qt_webkit_version.pri";
-    QFile::remove(dst);
     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")
             qtConfig += "webkit-debug";
     }
 
-    if (dictionary["DECLARATIVE"] == "yes") {
-        if (dictionary[ "SCRIPT" ] == "no") {
-            cout << "QtDeclarative was requested, but it can't be built due to QtScript being "
-                    "disabled." << endl;
-            dictionary[ "DONE" ] = "error";
-        }
-        qtConfig += "declarative";
-    }
+// No longer needed after modularization
+//    if (dictionary["DECLARATIVE"] == "yes") {
+//        if (dictionary[ "SCRIPT" ] == "no") {
+//            cout << "QtDeclarative was requested, but it can't be built due to QtScript being "
+//                    "disabled." << endl;
+//            dictionary[ "DONE" ] = "error";
+//        }
+//        qtConfig += "declarative";
+//    }
 
     if (dictionary["DIRECTWRITE"] == "yes")
         qtConfig += "directwrite";
@@ -2922,81 +2920,81 @@ void Configure::generateCachefile()
     }
 
     // Generate qmodule.pri
-    QFile configFile(dictionary[ "QT_BUILD_TREE" ] + "/mkspecs/qmodule.pri");
-    if (configFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file.
-        QTextStream configStream(&configFile);
+    QFile moduleFile(dictionary[ "QT_BUILD_TREE" ] + "/mkspecs/qmodule.pri");
+    if (moduleFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file.
+        QTextStream moduleStream(&moduleFile);
 
-        configStream << "#paths" << endl;
-        configStream << "QT_BUILD_TREE   = " << fixSeparators(dictionary[ "QT_BUILD_TREE" ], true) << endl;
-        configStream << "QT_SOURCE_TREE  = " << fixSeparators(dictionary[ "QT_SOURCE_TREE" ], true) << endl;
+        moduleStream << "#paths" << endl;
+        moduleStream << "QT_BUILD_TREE   = " << fixSeparators(dictionary[ "QT_BUILD_TREE" ], true) << endl;
+        moduleStream << "QT_SOURCE_TREE  = " << fixSeparators(dictionary[ "QT_SOURCE_TREE" ], true) << endl;
         QStringList buildParts;
-        buildParts << "libs" << "tools" << "examples" << "demos" << "docs" << "translations";
+        buildParts << "libs" << "examples" << "demos";
         foreach (const QString &item, disabledBuildParts) {
             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)
-        configStream << "#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;
-        configStream << "QMAKE_UIC       = $$QT_BUILD_TREE" << fixSeparators("/bin/uic.exe", true) << endl;
-        configStream << "QMAKE_RCC       = $$QT_BUILD_TREE" << fixSeparators("/bin/rcc.exe", true) << endl;
-        configStream << "QMAKE_DUMPCPP   = $$QT_BUILD_TREE" << fixSeparators("/bin/dumpcpp.exe", true) << endl;
-        configStream << "QMAKE_INCDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/include", true) << endl;
-        configStream << "QMAKE_LIBDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/lib", true) << endl;
+        moduleStream << "#local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR" << endl;
+        moduleStream << "QMAKE_MOC       = $$QT_BUILD_TREE" << fixSeparators("/bin/moc.exe", true) << endl;
+        moduleStream << "QMAKE_UIC       = $$QT_BUILD_TREE" << fixSeparators("/bin/uic.exe", true) << endl;
+        moduleStream << "QMAKE_RCC       = $$QT_BUILD_TREE" << fixSeparators("/bin/rcc.exe", true) << endl;
+        moduleStream << "QMAKE_DUMPCPP   = $$QT_BUILD_TREE" << fixSeparators("/bin/dumpcpp.exe", true) << endl;
+        moduleStream << "QMAKE_INCDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/include", true) << endl;
+        moduleStream << "QMAKE_LIBDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/lib", true) << endl;
 
 
         QString targetSpec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ];
         QString mkspec_path = fixSeparators(sourcePath + "/mkspecs/" + targetSpec);
         if (QFile::exists(mkspec_path))
-            configStream << "QMAKESPEC       = " << escapeSeparators(mkspec_path) << endl;
+            moduleStream << "QMAKESPEC       = " << escapeSeparators(mkspec_path) << endl;
         else
-            configStream << "QMAKESPEC       = " << fixSeparators(targetSpec, true) << endl;
-        configStream << "ARCH            = " << dictionary[ "ARCHITECTURE" ] << endl;
+            moduleStream << "QMAKESPEC       = " << fixSeparators(targetSpec, true) << endl;
+        moduleStream << "ARCH            = " << dictionary[ "ARCHITECTURE" ] << endl;
 
         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") {
-            configStream << "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_INC  = " << fixSeparators(dictionary[ "QT_CE_RAPI_INC" ], 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;
 
         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())
-            configStream << "QMAKE_RPATHDIR += " << dictionary["QMAKE_RPATHDIR"] << endl;
+            moduleStream << "QMAKE_RPATHDIR += " << dictionary["QMAKE_RPATHDIR"] << endl;
 
         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()) {
-            configStream<<"MMP_RULES += \"ARMFPU "<< dictionary["ARM_FPU_TYPE"]<< "\"";
+            moduleStream<<"MMP_RULES += \"ARMFPU "<< dictionary["ARM_FPU_TYPE"]<< "\"";
         }
         if (!dictionary["QT_NAMESPACE"].isEmpty()) {
-            configStream << "#namespaces" << endl << "QT_NAMESPACE = " << dictionary["QT_NAMESPACE"] << endl;
+            moduleStream << "#namespaces" << endl << "QT_NAMESPACE = " << dictionary["QT_NAMESPACE"] << endl;
         }
 
         // embedded
         if (!dictionary["KBD_DRIVERS"].isEmpty())
-            configStream << "kbd-drivers += "<< dictionary["KBD_DRIVERS"]<<endl;
+            moduleStream << "kbd-drivers += "<< dictionary["KBD_DRIVERS"]<<endl;
         if (!dictionary["GFX_DRIVERS"].isEmpty())
-            configStream << "gfx-drivers += "<< dictionary["GFX_DRIVERS"]<<endl;
+            moduleStream << "gfx-drivers += "<< dictionary["GFX_DRIVERS"]<<endl;
         if (!dictionary["MOUSE_DRIVERS"].isEmpty())
-            configStream << "mouse-drivers += "<< dictionary["MOUSE_DRIVERS"]<<endl;
+            moduleStream << "mouse-drivers += "<< dictionary["MOUSE_DRIVERS"]<<endl;
         if (!dictionary["DECORATIONS"].isEmpty())
-            configStream << "decorations += "<<dictionary["DECORATIONS"]<<endl;
+            moduleStream << "decorations += "<<dictionary["DECORATIONS"]<<endl;
 
         if (!dictionary["QMAKE_RPATHDIR"].isEmpty())
-            configStream << "QMAKE_RPATHDIR += "<<dictionary["QMAKE_RPATHDIR"];
+            moduleStream << "QMAKE_RPATHDIR += "<<dictionary["QMAKE_RPATHDIR"];
 
-        configStream.flush();
-        configFile.close();
+        moduleStream.flush();
+        moduleFile.close();
     }
 
     // Generate qconfig.pri