tools/configure/configureapp.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
child 37 758a864f9613
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
    59 #include <windows.h>
    59 #include <windows.h>
    60 #include <conio.h>
    60 #include <conio.h>
    61 
    61 
    62 QT_BEGIN_NAMESPACE
    62 QT_BEGIN_NAMESPACE
    63 
    63 
    64 std::ostream &operator<<( std::ostream &s, const QString &val ) {
    64 std::ostream &operator<<(std::ostream &s, const QString &val) {
    65     s << val.toLocal8Bit().data();
    65     s << val.toLocal8Bit().data();
    66     return s;
    66     return s;
    67 }
    67 }
    68 
    68 
    69 
    69 
    87     }
    87     }
    88     file.write(symFile);
    88     file.write(symFile);
    89     return true;
    89     return true;
    90 }
    90 }
    91 
    91 
    92 Configure::Configure( int& argc, char** argv )
    92 Configure::Configure(int& argc, char** argv)
    93 {
    93 {
    94     useUnixSeparators = false;
    94     useUnixSeparators = false;
    95     // Default values for indentation
    95     // Default values for indentation
    96     optionIndent = 4;
    96     optionIndent = 4;
    97     descIndent   = 25;
    97     descIndent   = 25;
   109     /*
   109     /*
   110     ** Set up the initial state, the default
   110     ** Set up the initial state, the default
   111     */
   111     */
   112     dictionary[ "CONFIGCMD" ] = argv[ 0 ];
   112     dictionary[ "CONFIGCMD" ] = argv[ 0 ];
   113 
   113 
   114     for ( i = 1; i < argc; i++ )
   114     for (i = 1; i < argc; i++)
   115         configCmdLine += argv[ i ];
   115         configCmdLine += argv[ i ];
   116 
   116 
   117 
   117 
   118     // Get the path to the executable
   118     // Get the path to the executable
   119     wchar_t module_name[MAX_PATH];
   119     wchar_t module_name[MAX_PATH];
   125 #if 0
   125 #if 0
   126     const QString installPath = QString("C:\\Qt\\%1").arg(QT_VERSION_STR);
   126     const QString installPath = QString("C:\\Qt\\%1").arg(QT_VERSION_STR);
   127 #else
   127 #else
   128     const QString installPath = buildPath;
   128     const QString installPath = buildPath;
   129 #endif
   129 #endif
   130     if(sourceDir != buildDir) { //shadow builds!
   130     if (sourceDir != buildDir) { //shadow builds!
   131         if (!findFile("perl") && !findFile("perl.exe")) {
   131         if (!findFile("perl") && !findFile("perl.exe")) {
   132             cout << "Error: Creating a shadow build of Qt requires" << endl
   132             cout << "Error: Creating a shadow build of Qt requires" << endl
   133                  << "perl to be in the PATH environment";
   133                  << "perl to be in the PATH environment";
   134             exit(0); // Exit cleanly for Ctrl+C
   134             exit(0); // Exit cleanly for Ctrl+C
   135         }
   135         }
   138         QDir(buildPath).mkpath("bin");
   138         QDir(buildPath).mkpath("bin");
   139 
   139 
   140         { //duplicate qmake
   140         { //duplicate qmake
   141             QStack<QString> qmake_dirs;
   141             QStack<QString> qmake_dirs;
   142             qmake_dirs.push("qmake");
   142             qmake_dirs.push("qmake");
   143             while(!qmake_dirs.isEmpty()) {
   143             while (!qmake_dirs.isEmpty()) {
   144                 QString dir = qmake_dirs.pop();
   144                 QString dir = qmake_dirs.pop();
   145                 QString od(buildPath + "/" + dir);
   145                 QString od(buildPath + "/" + dir);
   146                 QString id(sourcePath + "/" + dir);
   146                 QString id(sourcePath + "/" + dir);
   147                 QFileInfoList entries = QDir(id).entryInfoList(QDir::NoDotAndDotDot|QDir::AllEntries);
   147                 QFileInfoList entries = QDir(id).entryInfoList(QDir::NoDotAndDotDot|QDir::AllEntries);
   148                 for(int i = 0; i < entries.size(); ++i) {
   148                 for (int i = 0; i < entries.size(); ++i) {
   149                     QFileInfo fi(entries.at(i));
   149                     QFileInfo fi(entries.at(i));
   150                     if(fi.isDir()) {
   150                     if (fi.isDir()) {
   151                         qmake_dirs.push(dir + "/" + fi.fileName());
   151                         qmake_dirs.push(dir + "/" + fi.fileName());
   152                         QDir().mkpath(od + "/" + fi.fileName());
   152                         QDir().mkpath(od + "/" + fi.fileName());
   153                     } else {
   153                     } else {
   154                         QDir().mkpath(od );
   154                         QDir().mkpath(od);
   155                         bool justCopy = true;
   155                         bool justCopy = true;
   156                         const QString fname = fi.fileName();
   156                         const QString fname = fi.fileName();
   157                         const QString outFile(od + "/" + fname), inFile(id + "/" + fname);
   157                         const QString outFile(od + "/" + fname), inFile(id + "/" + fname);
   158                         if(fi.fileName() == "Makefile") { //ignore
   158                         if (fi.fileName() == "Makefile") { //ignore
   159                         } else if(fi.suffix() == "h" || fi.suffix() == "cpp") {
   159                         } else if (fi.suffix() == "h" || fi.suffix() == "cpp") {
   160                             QTemporaryFile tmpFile;
   160                             QTemporaryFile tmpFile;
   161                             if(tmpFile.open()) {
   161                             if (tmpFile.open()) {
   162                                 QTextStream stream(&tmpFile);
   162                                 QTextStream stream(&tmpFile);
   163                                 stream << "#include \"" << inFile << "\"" << endl;
   163                                 stream << "#include \"" << inFile << "\"" << endl;
   164                                 justCopy = false;
   164                                 justCopy = false;
   165                                 stream.flush();
   165                                 stream.flush();
   166                                 tmpFile.flush();
   166                                 tmpFile.flush();
   167                                 if(filesDiffer(tmpFile.fileName(), outFile)) {
   167                                 if (filesDiffer(tmpFile.fileName(), outFile)) {
   168                                     QFile::remove(outFile);
   168                                     QFile::remove(outFile);
   169                                     tmpFile.copy(outFile);
   169                                     tmpFile.copy(outFile);
   170                                 }
   170                                 }
   171                             }
   171                             }
   172                         }
   172                         }
   173                         if(justCopy && filesDiffer(inFile, outFile))
   173                         if (justCopy && filesDiffer(inFile, outFile))
   174                             QFile::copy(inFile, outFile);
   174                             QFile::copy(inFile, outFile);
   175                     }
   175                     }
   176                 }
   176                 }
   177             }
   177             }
   178         }
   178         }
   179 
   179 
   180         { //make a syncqt script(s) that can be used in the shadow
   180         { //make a syncqt script(s) that can be used in the shadow
   181             QFile syncqt(buildPath + "/bin/syncqt");
   181             QFile syncqt(buildPath + "/bin/syncqt");
   182             if(syncqt.open(QFile::WriteOnly)) {
   182             if (syncqt.open(QFile::WriteOnly)) {
   183                 QTextStream stream(&syncqt);
   183                 QTextStream stream(&syncqt);
   184                 stream << "#!/usr/bin/perl -w" << endl
   184                 stream << "#!/usr/bin/perl -w" << endl
   185                        << "require \"" << sourcePath + "/bin/syncqt\";" << endl;
   185                        << "require \"" << sourcePath + "/bin/syncqt\";" << endl;
   186             }
   186             }
   187             QFile syncqt_bat(buildPath + "/bin/syncqt.bat");
   187             QFile syncqt_bat(buildPath + "/bin/syncqt.bat");
   188             if(syncqt_bat.open(QFile::WriteOnly)) {
   188             if (syncqt_bat.open(QFile::WriteOnly)) {
   189                 QTextStream stream(&syncqt_bat);
   189                 QTextStream stream(&syncqt_bat);
   190                 stream << "@echo off" << endl
   190                 stream << "@echo off" << endl
   191                        << "set QTDIR=" << QDir::toNativeSeparators(sourcePath) << endl
   191                        << "set QTDIR=" << QDir::toNativeSeparators(sourcePath) << endl
   192                        << "call " << fixSeparators(sourcePath) << fixSeparators("/bin/syncqt.bat -outdir \"") << fixSeparators(buildPath) << "\"" << endl
   192                        << "call " << fixSeparators(sourcePath) << fixSeparators("/bin/syncqt.bat -outdir \"") << fixSeparators(buildPath) << "\"" << endl
   193                        << "set QTDIR=" << QDir::toNativeSeparators(buildPath) << endl;
   193                        << "set QTDIR=" << QDir::toNativeSeparators(buildPath) << endl;
   195             }
   195             }
   196         }
   196         }
   197 
   197 
   198         // make patch_capabilities and createpackage scripts for Symbian that can be used from the shadow build
   198         // make patch_capabilities and createpackage scripts for Symbian that can be used from the shadow build
   199         QFile patch_capabilities(buildPath + "/bin/patch_capabilities");
   199         QFile patch_capabilities(buildPath + "/bin/patch_capabilities");
   200         if(patch_capabilities.open(QFile::WriteOnly)) {
   200         if (patch_capabilities.open(QFile::WriteOnly)) {
   201             QTextStream stream(&patch_capabilities);
   201             QTextStream stream(&patch_capabilities);
   202             stream << "#!/usr/bin/perl -w" << endl
   202             stream << "#!/usr/bin/perl -w" << endl
   203                    << "require \"" << sourcePath + "/bin/patch_capabilities\";" << endl;
   203                    << "require \"" << sourcePath + "/bin/patch_capabilities\";" << endl;
   204         }
   204         }
   205         QFile patch_capabilities_bat(buildPath + "/bin/patch_capabilities.bat");
   205         QFile patch_capabilities_bat(buildPath + "/bin/patch_capabilities.bat");
   206         if(patch_capabilities_bat.open(QFile::WriteOnly)) {
   206         if (patch_capabilities_bat.open(QFile::WriteOnly)) {
   207             QTextStream stream(&patch_capabilities_bat);
   207             QTextStream stream(&patch_capabilities_bat);
   208             stream << "@echo off" << endl
   208             stream << "@echo off" << endl
   209                    << "call " << fixSeparators(sourcePath) << fixSeparators("/bin/patch_capabilities.bat %*") << endl;
   209                    << "call " << fixSeparators(sourcePath) << fixSeparators("/bin/patch_capabilities.bat %*") << endl;
   210             patch_capabilities_bat.close();
   210             patch_capabilities_bat.close();
   211         }
   211         }
   212         QFile createpackage(buildPath + "/bin/createpackage");
   212         QFile createpackage(buildPath + "/bin/createpackage");
   213         if(createpackage.open(QFile::WriteOnly)) {
   213         if (createpackage.open(QFile::WriteOnly)) {
   214             QTextStream stream(&createpackage);
   214             QTextStream stream(&createpackage);
   215             stream << "#!/usr/bin/perl -w" << endl
   215             stream << "#!/usr/bin/perl -w" << endl
   216                    << "require \"" << sourcePath + "/bin/createpackage\";" << endl;
   216                    << "require \"" << sourcePath + "/bin/createpackage\";" << endl;
   217         }
   217         }
   218         QFile createpackage_bat(buildPath + "/bin/createpackage.bat");
   218         QFile createpackage_bat(buildPath + "/bin/createpackage.bat");
   219         if(createpackage_bat.open(QFile::WriteOnly)) {
   219         if (createpackage_bat.open(QFile::WriteOnly)) {
   220             QTextStream stream(&createpackage_bat);
   220             QTextStream stream(&createpackage_bat);
   221             stream << "@echo off" << endl
   221             stream << "@echo off" << endl
   222                    << "call " << fixSeparators(sourcePath) << fixSeparators("/bin/createpackage.bat %*") << endl;
   222                    << "call " << fixSeparators(sourcePath) << fixSeparators("/bin/createpackage.bat %*") << endl;
   223             createpackage_bat.close();
   223             createpackage_bat.close();
   224         }
   224         }
   226         // For Windows CE and shadow builds we need to copy these to the
   226         // For Windows CE and shadow builds we need to copy these to the
   227         // build directory.
   227         // build directory.
   228         QFile::copy(sourcePath + "/bin/setcepaths.bat" , buildPath + "/bin/setcepaths.bat");
   228         QFile::copy(sourcePath + "/bin/setcepaths.bat" , buildPath + "/bin/setcepaths.bat");
   229         //copy the mkspecs
   229         //copy the mkspecs
   230         buildDir.mkpath("mkspecs");
   230         buildDir.mkpath("mkspecs");
   231         if(!Environment::cpdir(sourcePath + "/mkspecs", buildPath + "/mkspecs")){
   231         if (!Environment::cpdir(sourcePath + "/mkspecs", buildPath + "/mkspecs")){
   232             cout << "Couldn't copy mkspecs!" << sourcePath << " " << buildPath << endl;
   232             cout << "Couldn't copy mkspecs!" << sourcePath << " " << buildPath << endl;
   233             dictionary["DONE"] = "error";
   233             dictionary["DONE"] = "error";
   234             return;
   234             return;
   235         }
   235         }
   236     }
   236     }
   302         version = QString("%1.%2.%3").arg(QT_VERSION>>16).arg(((QT_VERSION>>8)&0xff)).arg(QT_VERSION&0xff);
   302         version = QString("%1.%2.%3").arg(QT_VERSION>>16).arg(((QT_VERSION>>8)&0xff)).arg(QT_VERSION&0xff);
   303 
   303 
   304     dictionary[ "VERSION" ]         = version;
   304     dictionary[ "VERSION" ]         = version;
   305     {
   305     {
   306         QRegExp version_re("([0-9]*)\\.([0-9]*)\\.([0-9]*)(|-.*)");
   306         QRegExp version_re("([0-9]*)\\.([0-9]*)\\.([0-9]*)(|-.*)");
   307         if(version_re.exactMatch(version)) {
   307         if (version_re.exactMatch(version)) {
   308             dictionary[ "VERSION_MAJOR" ] = version_re.cap(1);
   308             dictionary[ "VERSION_MAJOR" ] = version_re.cap(1);
   309             dictionary[ "VERSION_MINOR" ] = version_re.cap(2);
   309             dictionary[ "VERSION_MINOR" ] = version_re.cap(2);
   310             dictionary[ "VERSION_PATCH" ] = version_re.cap(3);
   310             dictionary[ "VERSION_PATCH" ] = version_re.cap(3);
   311         }
   311         }
   312     }
   312     }
   370     dictionary[ "SQL_IBASE" ]       = "no";
   370     dictionary[ "SQL_IBASE" ]       = "no";
   371     dictionary[ "GRAPHICS_SYSTEM" ] = "raster";
   371     dictionary[ "GRAPHICS_SYSTEM" ] = "raster";
   372 
   372 
   373     QString tmp = dictionary[ "QMAKESPEC" ];
   373     QString tmp = dictionary[ "QMAKESPEC" ];
   374     if (tmp.contains("\\")) {
   374     if (tmp.contains("\\")) {
   375         tmp = tmp.mid( tmp.lastIndexOf( "\\" ) + 1 );
   375         tmp = tmp.mid(tmp.lastIndexOf("\\") + 1);
   376     } else {
   376     } else {
   377         tmp = tmp.mid( tmp.lastIndexOf("/") + 1 );
   377         tmp = tmp.mid(tmp.lastIndexOf("/") + 1);
   378     }
   378     }
   379     dictionary[ "QMAKESPEC" ] = tmp;
   379     dictionary[ "QMAKESPEC" ] = tmp;
   380 
   380 
   381     dictionary[ "INCREDIBUILD_XGE" ] = "auto";
   381     dictionary[ "INCREDIBUILD_XGE" ] = "auto";
   382     dictionary[ "LTCG" ]            = "no";
   382     dictionary[ "LTCG" ]            = "no";
   390         for (int j=0; j<items.size(); ++j)
   390         for (int j=0; j<items.size(); ++j)
   391             delete items[j];
   391             delete items[j];
   392     }
   392     }
   393 }
   393 }
   394 
   394 
   395 QString Configure::fixSeparators(QString somePath)
   395 QString Configure::fixSeparators(const QString &somePath, bool escape)
   396 {
   396 {
   397     return useUnixSeparators ?
   397     if (useUnixSeparators)
   398            QDir::fromNativeSeparators(somePath) :
   398         return QDir::fromNativeSeparators(somePath);
   399            QDir::toNativeSeparators(somePath);
   399     QString ret = QDir::toNativeSeparators(somePath);
       
   400     return escape ? escapeSeparators(ret) : ret;
       
   401 }
       
   402 
       
   403 QString Configure::escapeSeparators(const QString &somePath)
       
   404 {
       
   405     QString out = somePath;
       
   406     out.replace(QLatin1Char('\\'), QLatin1String("\\\\"));
       
   407     return out;
   400 }
   408 }
   401 
   409 
   402 // We could use QDir::homePath() + "/.qt-license", but
   410 // We could use QDir::homePath() + "/.qt-license", but
   403 // that will only look in the first of $HOME,$USERPROFILE
   411 // that will only look in the first of $HOME,$USERPROFILE
   404 // or $HOMEDRIVE$HOMEPATH. So, here we try'em all to be
   412 // or $HOMEDRIVE$HOMEPATH. So, here we try'em all to be
   429     int i = 0;
   437     int i = 0;
   430 
   438 
   431 #if !defined(EVAL)
   439 #if !defined(EVAL)
   432     if (argCount < 1) // skip rest if no arguments
   440     if (argCount < 1) // skip rest if no arguments
   433         ;
   441         ;
   434     else if( configCmdLine.at(i) == "-redo" ) {
   442     else if (configCmdLine.at(i) == "-redo") {
   435         dictionary[ "REDO" ] = "yes";
   443         dictionary[ "REDO" ] = "yes";
   436         configCmdLine.clear();
   444         configCmdLine.clear();
   437         reloadCmdLine();
   445         reloadCmdLine();
   438     }
   446     }
   439     else if( configCmdLine.at(i) == "-loadconfig" ) {
   447     else if (configCmdLine.at(i) == "-loadconfig") {
   440         ++i;
   448         ++i;
   441         if (i != argCount) {
   449         if (i != argCount) {
   442             dictionary[ "REDO" ] = "yes";
   450             dictionary[ "REDO" ] = "yes";
   443             dictionary[ "CUSTOMCONFIG" ] = "_" + configCmdLine.at(i);
   451             dictionary[ "CUSTOMCONFIG" ] = "_" + configCmdLine.at(i);
   444             configCmdLine.clear();
   452             configCmdLine.clear();
   450     }
   458     }
   451     argCount = configCmdLine.size();
   459     argCount = configCmdLine.size();
   452 #endif
   460 #endif
   453 
   461 
   454     // Look first for XQMAKESPEC
   462     // Look first for XQMAKESPEC
   455     for(int j = 0 ; j < argCount; ++j)
   463     for (int j = 0 ; j < argCount; ++j)
   456     {
   464     {
   457         if( configCmdLine.at(j) == "-xplatform") {
   465         if (configCmdLine.at(j) == "-xplatform") {
   458             ++j;
   466             ++j;
   459             if (j == argCount)
   467             if (j == argCount)
   460                 break;
   468                 break;
   461             dictionary["XQMAKESPEC"] = configCmdLine.at(j);
   469             dictionary["XQMAKESPEC"] = configCmdLine.at(j);
   462             if (!dictionary[ "XQMAKESPEC" ].isEmpty())
   470             if (!dictionary[ "XQMAKESPEC" ].isEmpty())
   463                 applySpecSpecifics();
   471                 applySpecSpecifics();
   464         }
   472         }
   465     }
   473     }
   466 
   474 
   467     for( ; i<configCmdLine.size(); ++i ) {
   475     for (; i<configCmdLine.size(); ++i) {
   468         bool continueElse[] = {false, false};
   476         bool continueElse[] = {false, false};
   469         if( configCmdLine.at(i) == "-help"
   477         if (configCmdLine.at(i) == "-help"
   470             || configCmdLine.at(i) == "-h"
   478             || configCmdLine.at(i) == "-h"
   471             || configCmdLine.at(i) == "-?" )
   479             || configCmdLine.at(i) == "-?")
   472             dictionary[ "HELP" ] = "yes";
   480             dictionary[ "HELP" ] = "yes";
   473 
   481 
   474 #if !defined(EVAL)
   482 #if !defined(EVAL)
   475         else if( configCmdLine.at(i) == "-qconfig" ) {
   483         else if (configCmdLine.at(i) == "-qconfig") {
   476             ++i;
   484             ++i;
   477             if (i==argCount)
   485             if (i == argCount)
   478                 break;
   486                 break;
   479             dictionary[ "QCONFIG" ] = configCmdLine.at(i);
   487             dictionary[ "QCONFIG" ] = configCmdLine.at(i);
   480         }
   488         }
   481 
   489 
   482         else if ( configCmdLine.at(i) == "-buildkey" ) {
   490         else if (configCmdLine.at(i) == "-buildkey") {
   483             ++i;
   491             ++i;
   484             if (i==argCount)
   492             if (i == argCount)
   485                 break;
   493                 break;
   486             dictionary[ "USER_BUILD_KEY" ] = configCmdLine.at(i);
   494             dictionary[ "USER_BUILD_KEY" ] = configCmdLine.at(i);
   487         }
   495         }
   488 
   496 
   489         else if( configCmdLine.at(i) == "-release" ) {
   497         else if (configCmdLine.at(i) == "-release") {
   490             dictionary[ "BUILD" ] = "release";
   498             dictionary[ "BUILD" ] = "release";
   491             if (dictionary[ "BUILDALL" ] == "auto")
   499             if (dictionary[ "BUILDALL" ] == "auto")
   492                 dictionary[ "BUILDALL" ] = "no";
   500                 dictionary[ "BUILDALL" ] = "no";
   493         } else if( configCmdLine.at(i) == "-debug" ) {
   501         } else if (configCmdLine.at(i) == "-debug") {
   494             dictionary[ "BUILD" ] = "debug";
   502             dictionary[ "BUILD" ] = "debug";
   495             if (dictionary[ "BUILDALL" ] == "auto")
   503             if (dictionary[ "BUILDALL" ] == "auto")
   496                 dictionary[ "BUILDALL" ] = "no";
   504                 dictionary[ "BUILDALL" ] = "no";
   497         } else if( configCmdLine.at(i) == "-debug-and-release" )
   505         } else if (configCmdLine.at(i) == "-debug-and-release")
   498             dictionary[ "BUILDALL" ] = "yes";
   506             dictionary[ "BUILDALL" ] = "yes";
   499 
   507 
   500         else if( configCmdLine.at(i) == "-shared" )
   508         else if (configCmdLine.at(i) == "-shared")
   501             dictionary[ "SHARED" ] = "yes";
   509             dictionary[ "SHARED" ] = "yes";
   502         else if( configCmdLine.at(i) == "-static" )
   510         else if (configCmdLine.at(i) == "-static")
   503             dictionary[ "SHARED" ] = "no";
   511             dictionary[ "SHARED" ] = "no";
   504         else if( configCmdLine.at(i) == "-developer-build" )
   512         else if (configCmdLine.at(i) == "-developer-build")
   505             dictionary[ "BUILDDEV" ] = "yes";
   513             dictionary[ "BUILDDEV" ] = "yes";
   506         else if( configCmdLine.at(i) == "-nokia-developer" ) {
   514         else if (configCmdLine.at(i) == "-nokia-developer") {
   507             cout << "Detected -nokia-developer option" << endl;
   515             cout << "Detected -nokia-developer option" << endl;
   508             cout << "Nokia employees and agents are allowed to use this software under" << endl;
   516             cout << "Nokia employees and agents are allowed to use this software under" << endl;
   509             cout << "the authority of Nokia Corporation and/or its subsidiary(-ies)" << endl;
   517             cout << "the authority of Nokia Corporation and/or its subsidiary(-ies)" << endl;
   510             dictionary[ "BUILDNOKIA" ] = "yes";
   518             dictionary[ "BUILDNOKIA" ] = "yes";
   511             dictionary[ "BUILDDEV" ] = "yes";
   519             dictionary[ "BUILDDEV" ] = "yes";
   512             dictionary["LICENSE_CONFIRMED"] = "yes";
   520             dictionary["LICENSE_CONFIRMED"] = "yes";
   513             if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
   521             if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
   514                 dictionary[ "SYMBIAN_DEFFILES" ] = "no";
   522                 dictionary[ "SYMBIAN_DEFFILES" ] = "no";
   515             }
   523             }
   516         }
   524         }
   517         else if( configCmdLine.at(i) == "-opensource" ) {
   525         else if (configCmdLine.at(i) == "-opensource") {
   518             dictionary[ "BUILDTYPE" ] = "opensource";
   526             dictionary[ "BUILDTYPE" ] = "opensource";
   519         }
   527         }
   520         else if( configCmdLine.at(i) == "-commercial" ) {
   528         else if (configCmdLine.at(i) == "-commercial") {
   521             dictionary[ "BUILDTYPE" ] = "commercial";
   529             dictionary[ "BUILDTYPE" ] = "commercial";
   522         }
   530         }
   523         else if( configCmdLine.at(i) == "-ltcg" ) {
   531         else if (configCmdLine.at(i) == "-ltcg") {
   524             dictionary[ "LTCG" ] = "yes";
   532             dictionary[ "LTCG" ] = "yes";
   525         }
   533         }
   526         else if( configCmdLine.at(i) == "-no-ltcg" ) {
   534         else if (configCmdLine.at(i) == "-no-ltcg") {
   527             dictionary[ "LTCG" ] = "no";
   535             dictionary[ "LTCG" ] = "no";
   528         }
   536         }
   529 #endif
   537 #endif
   530 
   538 
   531         else if( configCmdLine.at(i) == "-platform" ) {
   539         else if (configCmdLine.at(i) == "-platform") {
   532             ++i;
   540             ++i;
   533             if (i==argCount)
   541             if (i == argCount)
   534                 break;
   542                 break;
   535             dictionary[ "QMAKESPEC" ] = configCmdLine.at(i);
   543             dictionary[ "QMAKESPEC" ] = configCmdLine.at(i);
   536         dictionary[ "QMAKESPEC_FROM" ] = "commandline";
   544         dictionary[ "QMAKESPEC_FROM" ] = "commandline";
   537         } else if( configCmdLine.at(i) == "-arch" ) {
   545         } else if (configCmdLine.at(i) == "-arch") {
   538             ++i;
   546             ++i;
   539             if (i==argCount)
   547             if (i == argCount)
   540                 break;
   548                 break;
   541             dictionary[ "ARCHITECTURE" ] = configCmdLine.at(i);
   549             dictionary[ "ARCHITECTURE" ] = configCmdLine.at(i);
   542             if (configCmdLine.at(i) == "boundschecker") {
   550             if (configCmdLine.at(i) == "boundschecker") {
   543                 dictionary[ "ARCHITECTURE" ] = "generic";   // Boundschecker uses the generic arch,
   551                 dictionary[ "ARCHITECTURE" ] = "generic";   // Boundschecker uses the generic arch,
   544                 qtConfig += "boundschecker";                // but also needs this CONFIG option
   552                 qtConfig += "boundschecker";                // but also needs this CONFIG option
   545             }
   553             }
   546         } else if( configCmdLine.at(i) == "-embedded" ) {
   554         } else if (configCmdLine.at(i) == "-embedded") {
   547             dictionary[ "EMBEDDED" ] = "yes";
   555             dictionary[ "EMBEDDED" ] = "yes";
   548         } else if( configCmdLine.at(i) == "-xplatform") {
   556         } else if (configCmdLine.at(i) == "-xplatform") {
   549             ++i;
   557             ++i;
   550             // do nothing
   558             // do nothing
   551         }
   559         }
   552 
   560 
   553 
   561 
   554 #if !defined(EVAL)
   562 #if !defined(EVAL)
   555         else if( configCmdLine.at(i) == "-no-zlib" ) {
   563         else if (configCmdLine.at(i) == "-no-zlib") {
   556             // No longer supported since Qt 4.4.0
   564             // No longer supported since Qt 4.4.0
   557             // But save the information for later so that we can print a warning
   565             // But save the information for later so that we can print a warning
   558             //
   566             //
   559             // If you REALLY really need no zlib support, you can still disable
   567             // If you REALLY really need no zlib support, you can still disable
   560             // it by doing the following:
   568             // it by doing the following:
   562             //   #define QT_NO_COMPRESS (probably by adding to src/corelib/global/qconfig.h)
   570             //   #define QT_NO_COMPRESS (probably by adding to src/corelib/global/qconfig.h)
   563             //
   571             //
   564             // There's no guarantee that Qt will build under those conditions
   572             // There's no guarantee that Qt will build under those conditions
   565 
   573 
   566             dictionary[ "ZLIB_FORCED" ] = "yes";
   574             dictionary[ "ZLIB_FORCED" ] = "yes";
   567         } else if( configCmdLine.at(i) == "-qt-zlib" ) {
   575         } else if (configCmdLine.at(i) == "-qt-zlib") {
   568             dictionary[ "ZLIB" ] = "qt";
   576             dictionary[ "ZLIB" ] = "qt";
   569         } else if( configCmdLine.at(i) == "-system-zlib" ) {
   577         } else if (configCmdLine.at(i) == "-system-zlib") {
   570             dictionary[ "ZLIB" ] = "system";
   578             dictionary[ "ZLIB" ] = "system";
   571         }
   579         }
   572 
   580 
   573         // Image formats --------------------------------------------
   581         // Image formats --------------------------------------------
   574         else if( configCmdLine.at(i) == "-no-gif" )
   582         else if (configCmdLine.at(i) == "-no-gif")
   575             dictionary[ "GIF" ] = "no";
   583             dictionary[ "GIF" ] = "no";
   576         else if( configCmdLine.at(i) == "-qt-gif" )
   584         else if (configCmdLine.at(i) == "-qt-gif")
   577             dictionary[ "GIF" ] = "auto";
   585             dictionary[ "GIF" ] = "plugin";
   578 
   586 
   579         else if( configCmdLine.at(i) == "-no-libtiff" ) {
   587         else if (configCmdLine.at(i) == "-no-libtiff") {
   580               dictionary[ "TIFF"] = "no";
   588             dictionary[ "TIFF"] = "no";
   581               dictionary[ "LIBTIFF" ] = "no";
   589             dictionary[ "LIBTIFF" ] = "no";
   582         } else if( configCmdLine.at(i) == "-qt-libtiff" ) {
   590         } else if (configCmdLine.at(i) == "-qt-libtiff") {
   583             dictionary[ "TIFF" ] = "plugin";
       
   584             dictionary[ "LIBTIFF" ] = "qt";
   591             dictionary[ "LIBTIFF" ] = "qt";
   585         } else if( configCmdLine.at(i) == "-system-libtiff" ) {
   592         } else if (configCmdLine.at(i) == "-system-libtiff") {
   586               dictionary[ "TIFF" ] = "plugin";
   593             dictionary[ "LIBTIFF" ] = "system";
   587               dictionary[ "LIBTIFF" ] = "system";
   594         }
   588         }
   595 
   589 
   596         else if (configCmdLine.at(i) == "-no-libjpeg") {
   590         else if( configCmdLine.at(i) == "-no-libjpeg" ) {
       
   591             dictionary[ "JPEG" ] = "no";
   597             dictionary[ "JPEG" ] = "no";
   592             dictionary[ "LIBJPEG" ] = "no";
   598             dictionary[ "LIBJPEG" ] = "no";
   593         } else if( configCmdLine.at(i) == "-qt-libjpeg" ) {
   599         } else if (configCmdLine.at(i) == "-qt-libjpeg") {
   594             dictionary[ "JPEG" ] = "plugin";
       
   595             dictionary[ "LIBJPEG" ] = "qt";
   600             dictionary[ "LIBJPEG" ] = "qt";
   596         } else if( configCmdLine.at(i) == "-system-libjpeg" ) {
   601         } else if (configCmdLine.at(i) == "-system-libjpeg") {
   597             dictionary[ "JPEG" ] = "plugin";
       
   598             dictionary[ "LIBJPEG" ] = "system";
   602             dictionary[ "LIBJPEG" ] = "system";
   599         }
   603         }
   600 
   604 
   601         else if( configCmdLine.at(i) == "-no-libpng" ) {
   605         else if (configCmdLine.at(i) == "-no-libpng") {
   602             dictionary[ "PNG" ] = "no";
   606             dictionary[ "PNG" ] = "no";
   603             dictionary[ "LIBPNG" ] = "no";
   607             dictionary[ "LIBPNG" ] = "no";
   604         } else if( configCmdLine.at(i) == "-qt-libpng" ) {
   608         } else if (configCmdLine.at(i) == "-qt-libpng") {
   605             dictionary[ "PNG" ] = "qt";
       
   606             dictionary[ "LIBPNG" ] = "qt";
   609             dictionary[ "LIBPNG" ] = "qt";
   607         } else if( configCmdLine.at(i) == "-system-libpng" ) {
   610         } else if (configCmdLine.at(i) == "-system-libpng") {
   608             dictionary[ "PNG" ] = "qt";
       
   609             dictionary[ "LIBPNG" ] = "system";
   611             dictionary[ "LIBPNG" ] = "system";
   610         }
   612         }
   611 
   613 
   612         else if( configCmdLine.at(i) == "-no-libmng" ) {
   614         else if (configCmdLine.at(i) == "-no-libmng") {
   613             dictionary[ "MNG" ] = "no";
   615             dictionary[ "MNG" ] = "no";
   614             dictionary[ "LIBMNG" ] = "no";
   616             dictionary[ "LIBMNG" ] = "no";
   615         } else if( configCmdLine.at(i) == "-qt-libmng" ) {
   617         } else if (configCmdLine.at(i) == "-qt-libmng") {
   616             dictionary[ "MNG" ] = "qt";
       
   617             dictionary[ "LIBMNG" ] = "qt";
   618             dictionary[ "LIBMNG" ] = "qt";
   618         } else if( configCmdLine.at(i) == "-system-libmng" ) {
   619         } else if (configCmdLine.at(i) == "-system-libmng") {
   619             dictionary[ "MNG" ] = "qt";
       
   620             dictionary[ "LIBMNG" ] = "system";
   620             dictionary[ "LIBMNG" ] = "system";
   621         }
   621         }
   622 
   622 
   623         // Text Rendering --------------------------------------------
   623         // Text Rendering --------------------------------------------
   624         else if( configCmdLine.at(i) == "-no-freetype" )
   624         else if (configCmdLine.at(i) == "-no-freetype")
   625             dictionary[ "FREETYPE" ] = "no";
   625             dictionary[ "FREETYPE" ] = "no";
   626         else if( configCmdLine.at(i) == "-qt-freetype" )
   626         else if (configCmdLine.at(i) == "-qt-freetype")
   627             dictionary[ "FREETYPE" ] = "yes";
   627             dictionary[ "FREETYPE" ] = "yes";
   628 
   628 
   629         // CE- C runtime --------------------------------------------
   629         // CE- C runtime --------------------------------------------
   630         else if( configCmdLine.at(i) == "-crt" ) {
   630         else if (configCmdLine.at(i) == "-crt") {
   631             ++i;
   631             ++i;
   632             if (i==argCount)
   632             if (i == argCount)
   633                 break;
   633                 break;
   634             QDir cDir(configCmdLine.at(i));
   634             QDir cDir(configCmdLine.at(i));
   635             if (!cDir.exists())
   635             if (!cDir.exists())
   636                 cout << "WARNING: Could not find directory (" << qPrintable(configCmdLine.at(i)) << ")for C runtime deployment" << endl;
   636                 cout << "WARNING: Could not find directory (" << qPrintable(configCmdLine.at(i)) << ")for C runtime deployment" << endl;
   637             else
   637             else
   651             // we need for crosscompilation; but remember if we asked
   651             // we need for crosscompilation; but remember if we asked
   652             // for it.
   652             // for it.
   653             dictionary[ "CETEST_REQUESTED" ] = "yes";
   653             dictionary[ "CETEST_REQUESTED" ] = "yes";
   654         }
   654         }
   655         // Qt/CE - signing tool -------------------------------------
   655         // Qt/CE - signing tool -------------------------------------
   656         else if( configCmdLine.at(i) == "-signature") {
   656         else if (configCmdLine.at(i) == "-signature") {
   657             ++i;
   657             ++i;
   658             if (i==argCount)
   658             if (i == argCount)
   659                 break;
   659                 break;
   660             QFileInfo info(configCmdLine.at(i));
   660             QFileInfo info(configCmdLine.at(i));
   661             if (!info.exists())
   661             if (!info.exists())
   662                 cout << "WARNING: Could not find signature file (" << qPrintable(configCmdLine.at(i)) << ")" << endl;
   662                 cout << "WARNING: Could not find signature file (" << qPrintable(configCmdLine.at(i)) << ")" << endl;
   663             else
   663             else
   664                 dictionary[ "CE_SIGNATURE" ] = QDir::toNativeSeparators(info.absoluteFilePath());
   664                 dictionary[ "CE_SIGNATURE" ] = QDir::toNativeSeparators(info.absoluteFilePath());
   665         }
   665         }
   666         // Styles ---------------------------------------------------
   666         // Styles ---------------------------------------------------
   667         else if( configCmdLine.at(i) == "-qt-style-windows" )
   667         else if (configCmdLine.at(i) == "-qt-style-windows")
   668             dictionary[ "STYLE_WINDOWS" ] = "yes";
   668             dictionary[ "STYLE_WINDOWS" ] = "yes";
   669         else if( configCmdLine.at(i) == "-no-style-windows" )
   669         else if (configCmdLine.at(i) == "-no-style-windows")
   670             dictionary[ "STYLE_WINDOWS" ] = "no";
   670             dictionary[ "STYLE_WINDOWS" ] = "no";
   671 
   671 
   672         else if( configCmdLine.at(i) == "-qt-style-windowsce" )
   672         else if (configCmdLine.at(i) == "-qt-style-windowsce")
   673             dictionary[ "STYLE_WINDOWSCE" ] = "yes";
   673             dictionary[ "STYLE_WINDOWSCE" ] = "yes";
   674         else if( configCmdLine.at(i) == "-no-style-windowsce" )
   674         else if (configCmdLine.at(i) == "-no-style-windowsce")
   675             dictionary[ "STYLE_WINDOWSCE" ] = "no";
   675             dictionary[ "STYLE_WINDOWSCE" ] = "no";
   676         else if( configCmdLine.at(i) == "-qt-style-windowsmobile" )
   676         else if (configCmdLine.at(i) == "-qt-style-windowsmobile")
   677             dictionary[ "STYLE_WINDOWSMOBILE" ] = "yes";
   677             dictionary[ "STYLE_WINDOWSMOBILE" ] = "yes";
   678         else if( configCmdLine.at(i) == "-no-style-windowsmobile" )
   678         else if (configCmdLine.at(i) == "-no-style-windowsmobile")
   679             dictionary[ "STYLE_WINDOWSMOBILE" ] = "no";
   679             dictionary[ "STYLE_WINDOWSMOBILE" ] = "no";
   680 
   680 
   681         else if( configCmdLine.at(i) == "-qt-style-windowsxp" )
   681         else if (configCmdLine.at(i) == "-qt-style-windowsxp")
   682             dictionary[ "STYLE_WINDOWSXP" ] = "yes";
   682             dictionary[ "STYLE_WINDOWSXP" ] = "yes";
   683         else if( configCmdLine.at(i) == "-no-style-windowsxp" )
   683         else if (configCmdLine.at(i) == "-no-style-windowsxp")
   684             dictionary[ "STYLE_WINDOWSXP" ] = "no";
   684             dictionary[ "STYLE_WINDOWSXP" ] = "no";
   685 
   685 
   686         else if( configCmdLine.at(i) == "-qt-style-windowsvista" )
   686         else if (configCmdLine.at(i) == "-qt-style-windowsvista")
   687             dictionary[ "STYLE_WINDOWSVISTA" ] = "yes";
   687             dictionary[ "STYLE_WINDOWSVISTA" ] = "yes";
   688         else if( configCmdLine.at(i) == "-no-style-windowsvista" )
   688         else if (configCmdLine.at(i) == "-no-style-windowsvista")
   689             dictionary[ "STYLE_WINDOWSVISTA" ] = "no";
   689             dictionary[ "STYLE_WINDOWSVISTA" ] = "no";
   690 
   690 
   691         else if( configCmdLine.at(i) == "-qt-style-plastique" )
   691         else if (configCmdLine.at(i) == "-qt-style-plastique")
   692             dictionary[ "STYLE_PLASTIQUE" ] = "yes";
   692             dictionary[ "STYLE_PLASTIQUE" ] = "yes";
   693         else if( configCmdLine.at(i) == "-no-style-plastique" )
   693         else if (configCmdLine.at(i) == "-no-style-plastique")
   694             dictionary[ "STYLE_PLASTIQUE" ] = "no";
   694             dictionary[ "STYLE_PLASTIQUE" ] = "no";
   695 
   695 
   696         else if( configCmdLine.at(i) == "-qt-style-cleanlooks" )
   696         else if (configCmdLine.at(i) == "-qt-style-cleanlooks")
   697             dictionary[ "STYLE_CLEANLOOKS" ] = "yes";
   697             dictionary[ "STYLE_CLEANLOOKS" ] = "yes";
   698         else if( configCmdLine.at(i) == "-no-style-cleanlooks" )
   698         else if (configCmdLine.at(i) == "-no-style-cleanlooks")
   699             dictionary[ "STYLE_CLEANLOOKS" ] = "no";
   699             dictionary[ "STYLE_CLEANLOOKS" ] = "no";
   700 
   700 
   701         else if( configCmdLine.at(i) == "-qt-style-motif" )
   701         else if (configCmdLine.at(i) == "-qt-style-motif")
   702             dictionary[ "STYLE_MOTIF" ] = "yes";
   702             dictionary[ "STYLE_MOTIF" ] = "yes";
   703         else if( configCmdLine.at(i) == "-no-style-motif" )
   703         else if (configCmdLine.at(i) == "-no-style-motif")
   704             dictionary[ "STYLE_MOTIF" ] = "no";
   704             dictionary[ "STYLE_MOTIF" ] = "no";
   705 
   705 
   706         else if( configCmdLine.at(i) == "-qt-style-cde" )
   706         else if (configCmdLine.at(i) == "-qt-style-cde")
   707             dictionary[ "STYLE_CDE" ] = "yes";
   707             dictionary[ "STYLE_CDE" ] = "yes";
   708         else if( configCmdLine.at(i) == "-no-style-cde" )
   708         else if (configCmdLine.at(i) == "-no-style-cde")
   709             dictionary[ "STYLE_CDE" ] = "no";
   709             dictionary[ "STYLE_CDE" ] = "no";
   710 
   710 
   711         else if( configCmdLine.at(i) == "-qt-style-s60" )
   711         else if (configCmdLine.at(i) == "-qt-style-s60")
   712             dictionary[ "STYLE_S60" ] = "yes";
   712             dictionary[ "STYLE_S60" ] = "yes";
   713         else if( configCmdLine.at(i) == "-no-style-s60" )
   713         else if (configCmdLine.at(i) == "-no-style-s60")
   714             dictionary[ "STYLE_S60" ] = "no";
   714             dictionary[ "STYLE_S60" ] = "no";
   715 
   715 
   716         // Qt 3 Support ---------------------------------------------
   716         // Qt 3 Support ---------------------------------------------
   717         else if( configCmdLine.at(i) == "-no-qt3support" )
   717         else if (configCmdLine.at(i) == "-no-qt3support")
   718             dictionary[ "QT3SUPPORT" ] = "no";
   718             dictionary[ "QT3SUPPORT" ] = "no";
   719 
   719 
   720         // Work around compiler nesting limitation
   720         // Work around compiler nesting limitation
   721         else
   721         else
   722             continueElse[1] = true;
   722             continueElse[1] = true;
   723         if (!continueElse[1]) {
   723         if (!continueElse[1]) {
   724         }
   724         }
   725 
   725 
   726         // OpenGL Support -------------------------------------------
   726         // OpenGL Support -------------------------------------------
   727         else if( configCmdLine.at(i) == "-no-opengl" ) {
   727         else if (configCmdLine.at(i) == "-no-opengl") {
   728             dictionary[ "OPENGL" ]    = "no";
   728             dictionary[ "OPENGL" ]    = "no";
   729         } else if ( configCmdLine.at(i) == "-opengl-es-cm" ) {
   729         } else if (configCmdLine.at(i) == "-opengl-es-cm") {
   730             dictionary[ "OPENGL" ]          = "yes";
   730             dictionary[ "OPENGL" ]          = "yes";
   731             dictionary[ "OPENGL_ES_CM" ]    = "yes";
   731             dictionary[ "OPENGL_ES_CM" ]    = "yes";
   732         } else if ( configCmdLine.at(i) == "-opengl-es-2" ) {
   732         } else if (configCmdLine.at(i) == "-opengl-es-2") {
   733             dictionary[ "OPENGL" ]          = "yes";
   733             dictionary[ "OPENGL" ]          = "yes";
   734             dictionary[ "OPENGL_ES_2" ]     = "yes";
   734             dictionary[ "OPENGL_ES_2" ]     = "yes";
   735         }
   735         }
   736 
   736 
   737         // OpenVG Support -------------------------------------------
   737         // OpenVG Support -------------------------------------------
   738         else if( configCmdLine.at(i) == "-openvg" ) {
   738         else if (configCmdLine.at(i) == "-openvg") {
   739             dictionary[ "OPENVG" ]    = "yes";
   739             dictionary[ "OPENVG" ]    = "yes";
   740         } else if( configCmdLine.at(i) == "-no-openvg" ) {
   740         } else if (configCmdLine.at(i) == "-no-openvg") {
   741             dictionary[ "OPENVG" ]    = "no";
   741             dictionary[ "OPENVG" ]    = "no";
   742         }
   742         }
   743 
   743 
   744         // Databases ------------------------------------------------
   744         // Databases ------------------------------------------------
   745         else if( configCmdLine.at(i) == "-qt-sql-mysql" )
   745         else if (configCmdLine.at(i) == "-qt-sql-mysql")
   746             dictionary[ "SQL_MYSQL" ] = "yes";
   746             dictionary[ "SQL_MYSQL" ] = "yes";
   747         else if( configCmdLine.at(i) == "-plugin-sql-mysql" )
   747         else if (configCmdLine.at(i) == "-plugin-sql-mysql")
   748             dictionary[ "SQL_MYSQL" ] = "plugin";
   748             dictionary[ "SQL_MYSQL" ] = "plugin";
   749         else if( configCmdLine.at(i) == "-no-sql-mysql" )
   749         else if (configCmdLine.at(i) == "-no-sql-mysql")
   750             dictionary[ "SQL_MYSQL" ] = "no";
   750             dictionary[ "SQL_MYSQL" ] = "no";
   751 
   751 
   752         else if( configCmdLine.at(i) == "-qt-sql-odbc" )
   752         else if (configCmdLine.at(i) == "-qt-sql-odbc")
   753             dictionary[ "SQL_ODBC" ] = "yes";
   753             dictionary[ "SQL_ODBC" ] = "yes";
   754         else if( configCmdLine.at(i) == "-plugin-sql-odbc" )
   754         else if (configCmdLine.at(i) == "-plugin-sql-odbc")
   755             dictionary[ "SQL_ODBC" ] = "plugin";
   755             dictionary[ "SQL_ODBC" ] = "plugin";
   756         else if( configCmdLine.at(i) == "-no-sql-odbc" )
   756         else if (configCmdLine.at(i) == "-no-sql-odbc")
   757             dictionary[ "SQL_ODBC" ] = "no";
   757             dictionary[ "SQL_ODBC" ] = "no";
   758 
   758 
   759         else if( configCmdLine.at(i) == "-qt-sql-oci" )
   759         else if (configCmdLine.at(i) == "-qt-sql-oci")
   760             dictionary[ "SQL_OCI" ] = "yes";
   760             dictionary[ "SQL_OCI" ] = "yes";
   761         else if( configCmdLine.at(i) == "-plugin-sql-oci" )
   761         else if (configCmdLine.at(i) == "-plugin-sql-oci")
   762             dictionary[ "SQL_OCI" ] = "plugin";
   762             dictionary[ "SQL_OCI" ] = "plugin";
   763         else if( configCmdLine.at(i) == "-no-sql-oci" )
   763         else if (configCmdLine.at(i) == "-no-sql-oci")
   764             dictionary[ "SQL_OCI" ] = "no";
   764             dictionary[ "SQL_OCI" ] = "no";
   765 
   765 
   766         else if( configCmdLine.at(i) == "-qt-sql-psql" )
   766         else if (configCmdLine.at(i) == "-qt-sql-psql")
   767             dictionary[ "SQL_PSQL" ] = "yes";
   767             dictionary[ "SQL_PSQL" ] = "yes";
   768         else if( configCmdLine.at(i) == "-plugin-sql-psql" )
   768         else if (configCmdLine.at(i) == "-plugin-sql-psql")
   769             dictionary[ "SQL_PSQL" ] = "plugin";
   769             dictionary[ "SQL_PSQL" ] = "plugin";
   770         else if( configCmdLine.at(i) == "-no-sql-psql" )
   770         else if (configCmdLine.at(i) == "-no-sql-psql")
   771             dictionary[ "SQL_PSQL" ] = "no";
   771             dictionary[ "SQL_PSQL" ] = "no";
   772 
   772 
   773         else if( configCmdLine.at(i) == "-qt-sql-tds" )
   773         else if (configCmdLine.at(i) == "-qt-sql-tds")
   774             dictionary[ "SQL_TDS" ] = "yes";
   774             dictionary[ "SQL_TDS" ] = "yes";
   775         else if( configCmdLine.at(i) == "-plugin-sql-tds" )
   775         else if (configCmdLine.at(i) == "-plugin-sql-tds")
   776             dictionary[ "SQL_TDS" ] = "plugin";
   776             dictionary[ "SQL_TDS" ] = "plugin";
   777         else if( configCmdLine.at(i) == "-no-sql-tds" )
   777         else if (configCmdLine.at(i) == "-no-sql-tds")
   778             dictionary[ "SQL_TDS" ] = "no";
   778             dictionary[ "SQL_TDS" ] = "no";
   779 
   779 
   780         else if( configCmdLine.at(i) == "-qt-sql-db2" )
   780         else if (configCmdLine.at(i) == "-qt-sql-db2")
   781             dictionary[ "SQL_DB2" ] = "yes";
   781             dictionary[ "SQL_DB2" ] = "yes";
   782         else if( configCmdLine.at(i) == "-plugin-sql-db2" )
   782         else if (configCmdLine.at(i) == "-plugin-sql-db2")
   783             dictionary[ "SQL_DB2" ] = "plugin";
   783             dictionary[ "SQL_DB2" ] = "plugin";
   784         else if( configCmdLine.at(i) == "-no-sql-db2" )
   784         else if (configCmdLine.at(i) == "-no-sql-db2")
   785             dictionary[ "SQL_DB2" ] = "no";
   785             dictionary[ "SQL_DB2" ] = "no";
   786 
   786 
   787         else if( configCmdLine.at(i) == "-qt-sql-sqlite" )
   787         else if (configCmdLine.at(i) == "-qt-sql-sqlite")
   788             dictionary[ "SQL_SQLITE" ] = "yes";
   788             dictionary[ "SQL_SQLITE" ] = "yes";
   789         else if( configCmdLine.at(i) == "-plugin-sql-sqlite" )
   789         else if (configCmdLine.at(i) == "-plugin-sql-sqlite")
   790             dictionary[ "SQL_SQLITE" ] = "plugin";
   790             dictionary[ "SQL_SQLITE" ] = "plugin";
   791         else if( configCmdLine.at(i) == "-no-sql-sqlite" )
   791         else if (configCmdLine.at(i) == "-no-sql-sqlite")
   792             dictionary[ "SQL_SQLITE" ] = "no";
   792             dictionary[ "SQL_SQLITE" ] = "no";
   793         else if( configCmdLine.at(i) == "-system-sqlite" )
   793         else if (configCmdLine.at(i) == "-system-sqlite")
   794             dictionary[ "SQL_SQLITE_LIB" ] = "system";
   794             dictionary[ "SQL_SQLITE_LIB" ] = "system";
   795         else if( configCmdLine.at(i) == "-qt-sql-sqlite2" )
   795         else if (configCmdLine.at(i) == "-qt-sql-sqlite2")
   796             dictionary[ "SQL_SQLITE2" ] = "yes";
   796             dictionary[ "SQL_SQLITE2" ] = "yes";
   797         else if( configCmdLine.at(i) == "-plugin-sql-sqlite2" )
   797         else if (configCmdLine.at(i) == "-plugin-sql-sqlite2")
   798             dictionary[ "SQL_SQLITE2" ] = "plugin";
   798             dictionary[ "SQL_SQLITE2" ] = "plugin";
   799         else if( configCmdLine.at(i) == "-no-sql-sqlite2" )
   799         else if (configCmdLine.at(i) == "-no-sql-sqlite2")
   800             dictionary[ "SQL_SQLITE2" ] = "no";
   800             dictionary[ "SQL_SQLITE2" ] = "no";
   801 
   801 
   802         else if( configCmdLine.at(i) == "-qt-sql-ibase" )
   802         else if (configCmdLine.at(i) == "-qt-sql-ibase")
   803             dictionary[ "SQL_IBASE" ] = "yes";
   803             dictionary[ "SQL_IBASE" ] = "yes";
   804         else if( configCmdLine.at(i) == "-plugin-sql-ibase" )
   804         else if (configCmdLine.at(i) == "-plugin-sql-ibase")
   805             dictionary[ "SQL_IBASE" ] = "plugin";
   805             dictionary[ "SQL_IBASE" ] = "plugin";
   806         else if( configCmdLine.at(i) == "-no-sql-ibase" )
   806         else if (configCmdLine.at(i) == "-no-sql-ibase")
   807             dictionary[ "SQL_IBASE" ] = "no";
   807             dictionary[ "SQL_IBASE" ] = "no";
   808 #endif
   808 #endif
   809         // IDE project generation -----------------------------------
   809         // IDE project generation -----------------------------------
   810         else if( configCmdLine.at(i) == "-no-dsp" )
   810         else if (configCmdLine.at(i) == "-no-dsp")
   811             dictionary[ "DSPFILES" ] = "no";
   811             dictionary[ "DSPFILES" ] = "no";
   812         else if( configCmdLine.at(i) == "-dsp" )
   812         else if (configCmdLine.at(i) == "-dsp")
   813             dictionary[ "DSPFILES" ] = "yes";
   813             dictionary[ "DSPFILES" ] = "yes";
   814 
   814 
   815         else if( configCmdLine.at(i) == "-no-vcp" )
   815         else if (configCmdLine.at(i) == "-no-vcp")
   816             dictionary[ "VCPFILES" ] = "no";
   816             dictionary[ "VCPFILES" ] = "no";
   817         else if( configCmdLine.at(i) == "-vcp" )
   817         else if (configCmdLine.at(i) == "-vcp")
   818             dictionary[ "VCPFILES" ] = "yes";
   818             dictionary[ "VCPFILES" ] = "yes";
   819 
   819 
   820         else if( configCmdLine.at(i) == "-no-vcproj" )
   820         else if (configCmdLine.at(i) == "-no-vcproj")
   821             dictionary[ "VCPROJFILES" ] = "no";
   821             dictionary[ "VCPROJFILES" ] = "no";
   822         else if( configCmdLine.at(i) == "-vcproj" )
   822         else if (configCmdLine.at(i) == "-vcproj")
   823             dictionary[ "VCPROJFILES" ] = "yes";
   823             dictionary[ "VCPROJFILES" ] = "yes";
   824 
   824 
   825         else if( configCmdLine.at(i) == "-no-incredibuild-xge" )
   825         else if (configCmdLine.at(i) == "-no-incredibuild-xge")
   826             dictionary[ "INCREDIBUILD_XGE" ] = "no";
   826             dictionary[ "INCREDIBUILD_XGE" ] = "no";
   827         else if( configCmdLine.at(i) == "-incredibuild-xge" )
   827         else if (configCmdLine.at(i) == "-incredibuild-xge")
   828             dictionary[ "INCREDIBUILD_XGE" ] = "yes";
   828             dictionary[ "INCREDIBUILD_XGE" ] = "yes";
   829         else if( configCmdLine.at(i) == "-native-gestures" )
   829         else if (configCmdLine.at(i) == "-native-gestures")
   830             dictionary[ "NATIVE_GESTURES" ] = "yes";
   830             dictionary[ "NATIVE_GESTURES" ] = "yes";
   831         else if( configCmdLine.at(i) == "-no-native-gestures" )
   831         else if (configCmdLine.at(i) == "-no-native-gestures")
   832             dictionary[ "NATIVE_GESTURES" ] = "no";
   832             dictionary[ "NATIVE_GESTURES" ] = "no";
   833 #if !defined(EVAL)
   833 #if !defined(EVAL)
   834         // Symbian Support -------------------------------------------
   834         // Symbian Support -------------------------------------------
   835         else if (configCmdLine.at(i) == "-fpu" )
   835         else if (configCmdLine.at(i) == "-fpu")
   836         {
   836         {
   837             ++i;
   837             ++i;
   838             if(i==argCount)
   838             if (i == argCount)
   839                 break;
   839                 break;
   840             dictionary[ "ARM_FPU_TYPE" ] = configCmdLine.at(i);
   840             dictionary[ "ARM_FPU_TYPE" ] = configCmdLine.at(i);
   841         }
   841         }
   842 
   842 
   843         else if( configCmdLine.at(i) == "-s60" )
   843         else if (configCmdLine.at(i) == "-s60")
   844             dictionary[ "S60" ]    = "yes";
   844             dictionary[ "S60" ]    = "yes";
   845         else if( configCmdLine.at(i) == "-no-s60" )
   845         else if (configCmdLine.at(i) == "-no-s60")
   846             dictionary[ "S60" ]    = "no";
   846             dictionary[ "S60" ]    = "no";
   847 
   847 
   848         else if( configCmdLine.at(i) == "-usedeffiles" )
   848         else if (configCmdLine.at(i) == "-usedeffiles")
   849             dictionary[ "SYMBIAN_DEFFILES" ] = "yes";
   849             dictionary[ "SYMBIAN_DEFFILES" ] = "yes";
   850         else if( configCmdLine.at(i) == "-no-usedeffiles" )
   850         else if (configCmdLine.at(i) == "-no-usedeffiles")
   851             dictionary[ "SYMBIAN_DEFFILES" ] = "no";
   851             dictionary[ "SYMBIAN_DEFFILES" ] = "no";
   852 
   852 
   853         // Others ---------------------------------------------------
   853         // Others ---------------------------------------------------
   854         else if (configCmdLine.at(i) == "-fast" )
   854         else if (configCmdLine.at(i) == "-fast")
   855             dictionary[ "FAST" ] = "yes";
   855             dictionary[ "FAST" ] = "yes";
   856         else if (configCmdLine.at(i) == "-no-fast" )
   856         else if (configCmdLine.at(i) == "-no-fast")
   857             dictionary[ "FAST" ] = "no";
   857             dictionary[ "FAST" ] = "no";
   858 
   858 
   859         else if( configCmdLine.at(i) == "-stl" )
   859         else if (configCmdLine.at(i) == "-stl")
   860             dictionary[ "STL" ] = "yes";
   860             dictionary[ "STL" ] = "yes";
   861         else if( configCmdLine.at(i) == "-no-stl" )
   861         else if (configCmdLine.at(i) == "-no-stl")
   862             dictionary[ "STL" ] = "no";
   862             dictionary[ "STL" ] = "no";
   863 
   863 
   864         else if ( configCmdLine.at(i) == "-exceptions" )
   864         else if (configCmdLine.at(i) == "-exceptions")
   865             dictionary[ "EXCEPTIONS" ] = "yes";
   865             dictionary[ "EXCEPTIONS" ] = "yes";
   866         else if ( configCmdLine.at(i) == "-no-exceptions" )
   866         else if (configCmdLine.at(i) == "-no-exceptions")
   867             dictionary[ "EXCEPTIONS" ] = "no";
   867             dictionary[ "EXCEPTIONS" ] = "no";
   868 
   868 
   869         else if ( configCmdLine.at(i) == "-rtti" )
   869         else if (configCmdLine.at(i) == "-rtti")
   870             dictionary[ "RTTI" ] = "yes";
   870             dictionary[ "RTTI" ] = "yes";
   871         else if ( configCmdLine.at(i) == "-no-rtti" )
   871         else if (configCmdLine.at(i) == "-no-rtti")
   872             dictionary[ "RTTI" ] = "no";
   872             dictionary[ "RTTI" ] = "no";
   873 
   873 
   874         else if( configCmdLine.at(i) == "-accessibility" )
   874         else if (configCmdLine.at(i) == "-accessibility")
   875             dictionary[ "ACCESSIBILITY" ] = "yes";
   875             dictionary[ "ACCESSIBILITY" ] = "yes";
   876         else if( configCmdLine.at(i) == "-no-accessibility" ) {
   876         else if (configCmdLine.at(i) == "-no-accessibility") {
   877             dictionary[ "ACCESSIBILITY" ] = "no";
   877             dictionary[ "ACCESSIBILITY" ] = "no";
   878             cout << "Setting accessibility to NO" << endl;
   878             cout << "Setting accessibility to NO" << endl;
   879         }
   879         }
   880 
   880 
   881         else if (configCmdLine.at(i) == "-no-mmx")
   881         else if (configCmdLine.at(i) == "-no-mmx")
   897         else if (configCmdLine.at(i) == "-no-iwmmxt")
   897         else if (configCmdLine.at(i) == "-no-iwmmxt")
   898             dictionary[ "IWMMXT" ] = "no";
   898             dictionary[ "IWMMXT" ] = "no";
   899         else if (configCmdLine.at(i) == "-iwmmxt")
   899         else if (configCmdLine.at(i) == "-iwmmxt")
   900             dictionary[ "IWMMXT" ] = "yes";
   900             dictionary[ "IWMMXT" ] = "yes";
   901 
   901 
   902         else if( configCmdLine.at(i) == "-no-openssl" ) {
   902         else if (configCmdLine.at(i) == "-no-openssl") {
   903               dictionary[ "OPENSSL"] = "no";
   903               dictionary[ "OPENSSL"] = "no";
   904         } else if( configCmdLine.at(i) == "-openssl" ) {
   904         } else if (configCmdLine.at(i) == "-openssl") {
   905               dictionary[ "OPENSSL" ] = "yes";
   905               dictionary[ "OPENSSL" ] = "yes";
   906         } else if( configCmdLine.at(i) == "-openssl-linked" ) {
   906         } else if (configCmdLine.at(i) == "-openssl-linked") {
   907               dictionary[ "OPENSSL" ] = "linked";
   907               dictionary[ "OPENSSL" ] = "linked";
   908         } else if( configCmdLine.at(i) == "-no-qdbus" ) {
   908         } else if (configCmdLine.at(i) == "-no-qdbus") {
   909             dictionary[ "DBUS" ] = "no";
   909             dictionary[ "DBUS" ] = "no";
   910         } else if( configCmdLine.at(i) == "-qdbus" ) {
   910         } else if (configCmdLine.at(i) == "-qdbus") {
   911             dictionary[ "DBUS" ] = "yes";
   911             dictionary[ "DBUS" ] = "yes";
   912         } else if( configCmdLine.at(i) == "-no-dbus" ) {
   912         } else if (configCmdLine.at(i) == "-no-dbus") {
   913             dictionary[ "DBUS" ] = "no";
   913             dictionary[ "DBUS" ] = "no";
   914         } else if( configCmdLine.at(i) == "-dbus" ) {
   914         } else if (configCmdLine.at(i) == "-dbus") {
   915             dictionary[ "DBUS" ] = "yes";
   915             dictionary[ "DBUS" ] = "yes";
   916         } else if( configCmdLine.at(i) == "-dbus-linked" ) {
   916         } else if (configCmdLine.at(i) == "-dbus-linked") {
   917             dictionary[ "DBUS" ] = "linked";
   917             dictionary[ "DBUS" ] = "linked";
   918         } else if( configCmdLine.at(i) == "-no-script" ) {
   918         } else if (configCmdLine.at(i) == "-no-script") {
   919             dictionary[ "SCRIPT" ] = "no";
   919             dictionary[ "SCRIPT" ] = "no";
   920         } else if( configCmdLine.at(i) == "-script" ) {
   920         } else if (configCmdLine.at(i) == "-script") {
   921             dictionary[ "SCRIPT" ] = "yes";
   921             dictionary[ "SCRIPT" ] = "yes";
   922         } else if( configCmdLine.at(i) == "-no-scripttools" ) {
   922         } else if (configCmdLine.at(i) == "-no-scripttools") {
   923             dictionary[ "SCRIPTTOOLS" ] = "no";
   923             dictionary[ "SCRIPTTOOLS" ] = "no";
   924         } else if( configCmdLine.at(i) == "-scripttools" ) {
   924         } else if (configCmdLine.at(i) == "-scripttools") {
   925             dictionary[ "SCRIPTTOOLS" ] = "yes";
   925             dictionary[ "SCRIPTTOOLS" ] = "yes";
   926         } else if( configCmdLine.at(i) == "-no-xmlpatterns" ) {
   926         } else if (configCmdLine.at(i) == "-no-xmlpatterns") {
   927             dictionary[ "XMLPATTERNS" ] = "no";
   927             dictionary[ "XMLPATTERNS" ] = "no";
   928         } else if( configCmdLine.at(i) == "-xmlpatterns" ) {
   928         } else if (configCmdLine.at(i) == "-xmlpatterns") {
   929             dictionary[ "XMLPATTERNS" ] = "yes";
   929             dictionary[ "XMLPATTERNS" ] = "yes";
   930         } else if( configCmdLine.at(i) == "-no-multimedia" ) {
   930         } else if (configCmdLine.at(i) == "-no-multimedia") {
   931             dictionary[ "MULTIMEDIA" ] = "no";
   931             dictionary[ "MULTIMEDIA" ] = "no";
   932         } else if( configCmdLine.at(i) == "-multimedia" ) {
   932         } else if (configCmdLine.at(i) == "-multimedia") {
   933             dictionary[ "MULTIMEDIA" ] = "yes";
   933             dictionary[ "MULTIMEDIA" ] = "yes";
   934         } else if( configCmdLine.at(i) == "-audio-backend" ) {
   934         } else if (configCmdLine.at(i) == "-audio-backend") {
   935             dictionary[ "AUDIO_BACKEND" ] = "yes";
   935             dictionary[ "AUDIO_BACKEND" ] = "yes";
   936         } else if( configCmdLine.at(i) == "-no-audio-backend" ) {
   936         } else if (configCmdLine.at(i) == "-no-audio-backend") {
   937             dictionary[ "AUDIO_BACKEND" ] = "no";
   937             dictionary[ "AUDIO_BACKEND" ] = "no";
   938         } else if( configCmdLine.at(i) == "-no-phonon" ) {
   938         } else if (configCmdLine.at(i) == "-no-phonon") {
   939             dictionary[ "PHONON" ] = "no";
   939             dictionary[ "PHONON" ] = "no";
   940         } else if( configCmdLine.at(i) == "-phonon" ) {
   940         } else if (configCmdLine.at(i) == "-phonon") {
   941             dictionary[ "PHONON" ] = "yes";
   941             dictionary[ "PHONON" ] = "yes";
   942         } else if( configCmdLine.at(i) == "-no-phonon-backend" ) {
   942         } else if (configCmdLine.at(i) == "-no-phonon-backend") {
   943             dictionary[ "PHONON_BACKEND" ] = "no";
   943             dictionary[ "PHONON_BACKEND" ] = "no";
   944         } else if( configCmdLine.at(i) == "-phonon-backend" ) {
   944         } else if (configCmdLine.at(i) == "-phonon-backend") {
   945             dictionary[ "PHONON_BACKEND" ] = "yes";
   945             dictionary[ "PHONON_BACKEND" ] = "yes";
   946         } else if( configCmdLine.at(i) == "-phonon-wince-ds9" ) {
   946         } else if (configCmdLine.at(i) == "-phonon-wince-ds9") {
   947             dictionary[ "DIRECTSHOW" ] = "yes";
   947             dictionary[ "DIRECTSHOW" ] = "yes";
   948         } else if( configCmdLine.at(i) == "-no-webkit" ) {
   948         } else if (configCmdLine.at(i) == "-no-webkit") {
   949             dictionary[ "WEBKIT" ] = "no";
   949             dictionary[ "WEBKIT" ] = "no";
   950         } else if( configCmdLine.at(i) == "-webkit" ) {
   950         } else if (configCmdLine.at(i) == "-webkit") {
   951             dictionary[ "WEBKIT" ] = "yes";
   951             dictionary[ "WEBKIT" ] = "yes";
   952         } else if( configCmdLine.at(i) == "-no-declarative" ) {
   952         } else if (configCmdLine.at(i) == "-no-declarative") {
   953             dictionary[ "DECLARATIVE" ] = "no";
   953             dictionary[ "DECLARATIVE" ] = "no";
   954         } else if( configCmdLine.at(i) == "-declarative" ) {
   954         } else if (configCmdLine.at(i) == "-declarative") {
   955             dictionary[ "DECLARATIVE" ] = "yes";
   955             dictionary[ "DECLARATIVE" ] = "yes";
   956         } else if( configCmdLine.at(i) == "-no-plugin-manifests" ) {
   956         } else if (configCmdLine.at(i) == "-no-plugin-manifests") {
   957             dictionary[ "PLUGIN_MANIFESTS" ] = "no";
   957             dictionary[ "PLUGIN_MANIFESTS" ] = "no";
   958         } else if( configCmdLine.at(i) == "-plugin-manifests" ) {
   958         } else if (configCmdLine.at(i) == "-plugin-manifests") {
   959             dictionary[ "PLUGIN_MANIFESTS" ] = "yes";
   959             dictionary[ "PLUGIN_MANIFESTS" ] = "yes";
   960         }
   960         }
   961 
   961 
   962         // Work around compiler nesting limitation
   962         // Work around compiler nesting limitation
   963         else
   963         else
   964             continueElse[0] = true;
   964             continueElse[0] = true;
   965         if (!continueElse[0]) {
   965         if (!continueElse[0]) {
   966         }
   966         }
   967 
   967 
   968         else if( configCmdLine.at(i) == "-internal" )
   968         else if (configCmdLine.at(i) == "-internal")
   969             dictionary[ "QMAKE_INTERNAL" ] = "yes";
   969             dictionary[ "QMAKE_INTERNAL" ] = "yes";
   970 
   970 
   971         else if( configCmdLine.at(i) == "-no-qmake" )
   971         else if (configCmdLine.at(i) == "-no-qmake")
   972             dictionary[ "BUILD_QMAKE" ] = "no";
   972             dictionary[ "BUILD_QMAKE" ] = "no";
   973         else if( configCmdLine.at(i) == "-qmake" )
   973         else if (configCmdLine.at(i) == "-qmake")
   974             dictionary[ "BUILD_QMAKE" ] = "yes";
   974             dictionary[ "BUILD_QMAKE" ] = "yes";
   975 
   975 
   976         else if( configCmdLine.at(i) == "-dont-process" )
   976         else if (configCmdLine.at(i) == "-dont-process")
   977             dictionary[ "NOPROCESS" ] = "yes";
   977             dictionary[ "NOPROCESS" ] = "yes";
   978         else if( configCmdLine.at(i) == "-process" )
   978         else if (configCmdLine.at(i) == "-process")
   979             dictionary[ "NOPROCESS" ] = "no";
   979             dictionary[ "NOPROCESS" ] = "no";
   980 
   980 
   981         else if( configCmdLine.at(i) == "-no-qmake-deps" )
   981         else if (configCmdLine.at(i) == "-no-qmake-deps")
   982             dictionary[ "DEPENDENCIES" ] = "no";
   982             dictionary[ "DEPENDENCIES" ] = "no";
   983         else if( configCmdLine.at(i) == "-qmake-deps" )
   983         else if (configCmdLine.at(i) == "-qmake-deps")
   984             dictionary[ "DEPENDENCIES" ] = "yes";
   984             dictionary[ "DEPENDENCIES" ] = "yes";
   985 
   985 
   986 
   986 
   987         else if( configCmdLine.at(i) == "-qtnamespace" ) {
   987         else if (configCmdLine.at(i) == "-qtnamespace") {
   988             ++i;
   988             ++i;
   989             if(i==argCount)
   989             if (i == argCount)
   990                 break;
   990                 break;
   991             qmakeDefines += "QT_NAMESPACE="+configCmdLine.at(i);
   991             qmakeDefines += "QT_NAMESPACE="+configCmdLine.at(i);
   992             dictionary[ "QT_NAMESPACE" ] = configCmdLine.at(i);
   992             dictionary[ "QT_NAMESPACE" ] = configCmdLine.at(i);
   993         } else if( configCmdLine.at(i) == "-qtlibinfix" ) {
   993         } else if (configCmdLine.at(i) == "-qtlibinfix") {
   994             ++i;
   994             ++i;
   995             if(i==argCount)
   995             if (i == argCount)
   996                 break;
   996                 break;
   997             dictionary[ "QT_LIBINFIX" ] = configCmdLine.at(i);
   997             dictionary[ "QT_LIBINFIX" ] = configCmdLine.at(i);
   998             if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
   998             if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
   999                 dictionary[ "QT_INSTALL_PLUGINS" ] =
   999                 dictionary[ "QT_INSTALL_PLUGINS" ] =
  1000                     QString("\\resource\\qt%1\\plugins").arg(dictionary[ "QT_LIBINFIX" ]);
  1000                     QString("\\resource\\qt%1\\plugins").arg(dictionary[ "QT_LIBINFIX" ]);
  1001             }
  1001             }
  1002         } else if( configCmdLine.at(i) == "-D" ) {
  1002         } else if (configCmdLine.at(i) == "-D") {
  1003             ++i;
  1003             ++i;
  1004             if (i==argCount)
  1004             if (i == argCount)
  1005                 break;
  1005                 break;
  1006             qmakeDefines += configCmdLine.at(i);
  1006             qmakeDefines += configCmdLine.at(i);
  1007         } else if( configCmdLine.at(i) == "-I" ) {
  1007         } else if (configCmdLine.at(i) == "-I") {
  1008             ++i;
  1008             ++i;
  1009             if (i==argCount)
  1009             if (i == argCount)
  1010                 break;
  1010                 break;
  1011             qmakeIncludes += configCmdLine.at(i);
  1011             qmakeIncludes += configCmdLine.at(i);
  1012         } else if( configCmdLine.at(i) == "-L" ) {
  1012         } else if (configCmdLine.at(i) == "-L") {
  1013             ++i;
  1013             ++i;
  1014             if (i==argCount)
  1014             if (i == argCount)
  1015                 break;
  1015                 break;
  1016             QFileInfo check(configCmdLine.at(i));
  1016             QFileInfo check(configCmdLine.at(i));
  1017             if (!check.isDir()) {
  1017             if (!check.isDir()) {
  1018                 cout << "Argument passed to -L option is not a directory path. Did you mean the -l option?" << endl;
  1018                 cout << "Argument passed to -L option is not a directory path. Did you mean the -l option?" << endl;
  1019                 dictionary[ "DONE" ] = "error";
  1019                 dictionary[ "DONE" ] = "error";
  1020                 break;
  1020                 break;
  1021             }
  1021             }
  1022             qmakeLibs += QString("-L" + configCmdLine.at(i));
  1022             qmakeLibs += QString("-L" + configCmdLine.at(i));
  1023         } else if( configCmdLine.at(i) == "-l" ) {
  1023         } else if (configCmdLine.at(i) == "-l") {
  1024             ++i;
  1024             ++i;
  1025             if (i==argCount)
  1025             if (i == argCount)
  1026                 break;
  1026                 break;
  1027             qmakeLibs += QString("-l" + configCmdLine.at(i));
  1027             qmakeLibs += QString("-l" + configCmdLine.at(i));
  1028         } else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS=")) {
  1028         } else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS=")) {
  1029             opensslLibs = configCmdLine.at(i);
  1029             opensslLibs = configCmdLine.at(i);
  1030         }
  1030         } else if (configCmdLine.at(i).startsWith("PSQL_LIBS=")) {
  1031 
  1031             psqlLibs = configCmdLine.at(i);
  1032         else if( ( configCmdLine.at(i) == "-override-version" ) || ( configCmdLine.at(i) == "-version-override" ) ){
  1032         }
       
  1033 
       
  1034         else if ((configCmdLine.at(i) == "-override-version") || (configCmdLine.at(i) == "-version-override")){
  1033             ++i;
  1035             ++i;
  1034             if (i==argCount)
  1036             if (i == argCount)
  1035                 break;
  1037                 break;
  1036             dictionary[ "VERSION" ] = configCmdLine.at(i);
  1038             dictionary[ "VERSION" ] = configCmdLine.at(i);
  1037         }
  1039         }
  1038 
  1040 
  1039         else if( configCmdLine.at(i) == "-saveconfig" ) {
  1041         else if (configCmdLine.at(i) == "-saveconfig") {
  1040             ++i;
  1042             ++i;
  1041             if (i==argCount)
  1043             if (i == argCount)
  1042                 break;
  1044                 break;
  1043             dictionary[ "CUSTOMCONFIG" ] = "_" + configCmdLine.at(i);
  1045             dictionary[ "CUSTOMCONFIG" ] = "_" + configCmdLine.at(i);
  1044         }
  1046         }
  1045 
  1047 
  1046         else if (configCmdLine.at(i) == "-confirm-license") {
  1048         else if (configCmdLine.at(i) == "-confirm-license") {
  1047             dictionary["LICENSE_CONFIRMED"] = "yes";
  1049             dictionary["LICENSE_CONFIRMED"] = "yes";
  1048         }
  1050         }
  1049 
  1051 
  1050         else if (configCmdLine.at(i) == "-nomake") {
  1052         else if (configCmdLine.at(i) == "-nomake") {
  1051             ++i;
  1053             ++i;
  1052             if (i==argCount)
  1054             if (i == argCount)
  1053                 break;
  1055                 break;
  1054             disabledBuildParts += configCmdLine.at(i);
  1056             disabledBuildParts += configCmdLine.at(i);
  1055         }
  1057         }
  1056 
  1058 
  1057         // Directories ----------------------------------------------
  1059         // Directories ----------------------------------------------
  1058         else if( configCmdLine.at(i) == "-prefix" ) {
  1060         else if (configCmdLine.at(i) == "-prefix") {
  1059             ++i;
  1061             ++i;
  1060             if(i==argCount)
  1062             if (i == argCount)
  1061                 break;
  1063                 break;
  1062             dictionary[ "QT_INSTALL_PREFIX" ] = configCmdLine.at(i);
  1064             dictionary[ "QT_INSTALL_PREFIX" ] = configCmdLine.at(i);
  1063         }
  1065         }
  1064 
  1066 
  1065         else if( configCmdLine.at(i) == "-bindir" ) {
  1067         else if (configCmdLine.at(i) == "-bindir") {
  1066             ++i;
  1068             ++i;
  1067             if(i==argCount)
  1069             if (i == argCount)
  1068                 break;
  1070                 break;
  1069             dictionary[ "QT_INSTALL_BINS" ] = configCmdLine.at(i);
  1071             dictionary[ "QT_INSTALL_BINS" ] = configCmdLine.at(i);
  1070         }
  1072         }
  1071 
  1073 
  1072         else if( configCmdLine.at(i) == "-libdir" ) {
  1074         else if (configCmdLine.at(i) == "-libdir") {
  1073             ++i;
  1075             ++i;
  1074             if(i==argCount)
  1076             if (i == argCount)
  1075                 break;
  1077                 break;
  1076             dictionary[ "QT_INSTALL_LIBS" ] = configCmdLine.at(i);
  1078             dictionary[ "QT_INSTALL_LIBS" ] = configCmdLine.at(i);
  1077         }
  1079         }
  1078 
  1080 
  1079         else if( configCmdLine.at(i) == "-docdir" ) {
  1081         else if (configCmdLine.at(i) == "-docdir") {
  1080             ++i;
  1082             ++i;
  1081             if(i==argCount)
  1083             if (i == argCount)
  1082                 break;
  1084                 break;
  1083             dictionary[ "QT_INSTALL_DOCS" ] = configCmdLine.at(i);
  1085             dictionary[ "QT_INSTALL_DOCS" ] = configCmdLine.at(i);
  1084         }
  1086         }
  1085 
  1087 
  1086         else if( configCmdLine.at(i) == "-headerdir" ) {
  1088         else if (configCmdLine.at(i) == "-headerdir") {
  1087             ++i;
  1089             ++i;
  1088             if(i==argCount)
  1090             if (i == argCount)
  1089                 break;
  1091                 break;
  1090             dictionary[ "QT_INSTALL_HEADERS" ] = configCmdLine.at(i);
  1092             dictionary[ "QT_INSTALL_HEADERS" ] = configCmdLine.at(i);
  1091         }
  1093         }
  1092 
  1094 
  1093         else if( configCmdLine.at(i) == "-plugindir" ) {
  1095         else if (configCmdLine.at(i) == "-plugindir") {
  1094             ++i;
  1096             ++i;
  1095             if(i==argCount)
  1097             if (i == argCount)
  1096                 break;
  1098                 break;
  1097             dictionary[ "QT_INSTALL_PLUGINS" ] = configCmdLine.at(i);
  1099             dictionary[ "QT_INSTALL_PLUGINS" ] = configCmdLine.at(i);
  1098         }
  1100         }
  1099 
  1101 
  1100         else if( configCmdLine.at(i) == "-importdir" ) {
  1102         else if (configCmdLine.at(i) == "-importdir") {
  1101             ++i;
  1103             ++i;
  1102             if(i==argCount)
  1104             if (i == argCount)
  1103                 break;
  1105                 break;
  1104             dictionary[ "QT_INSTALL_IMPORTS" ] = configCmdLine.at(i);
  1106             dictionary[ "QT_INSTALL_IMPORTS" ] = configCmdLine.at(i);
  1105         }
  1107         }
  1106         else if( configCmdLine.at(i) == "-datadir" ) {
  1108         else if (configCmdLine.at(i) == "-datadir") {
  1107             ++i;
  1109             ++i;
  1108             if(i==argCount)
  1110             if (i == argCount)
  1109                 break;
  1111                 break;
  1110             dictionary[ "QT_INSTALL_DATA" ] = configCmdLine.at(i);
  1112             dictionary[ "QT_INSTALL_DATA" ] = configCmdLine.at(i);
  1111         }
  1113         }
  1112 
  1114 
  1113         else if( configCmdLine.at(i) == "-translationdir" ) {
  1115         else if (configCmdLine.at(i) == "-translationdir") {
  1114             ++i;
  1116             ++i;
  1115             if(i==argCount)
  1117             if (i == argCount)
  1116                 break;
  1118                 break;
  1117             dictionary[ "QT_INSTALL_TRANSLATIONS" ] = configCmdLine.at(i);
  1119             dictionary[ "QT_INSTALL_TRANSLATIONS" ] = configCmdLine.at(i);
  1118         }
  1120         }
  1119 
  1121 
  1120         else if( configCmdLine.at(i) == "-examplesdir" ) {
  1122         else if (configCmdLine.at(i) == "-examplesdir") {
  1121             ++i;
  1123             ++i;
  1122             if(i==argCount)
  1124             if (i == argCount)
  1123                 break;
  1125                 break;
  1124             dictionary[ "QT_INSTALL_EXAMPLES" ] = configCmdLine.at(i);
  1126             dictionary[ "QT_INSTALL_EXAMPLES" ] = configCmdLine.at(i);
  1125         }
  1127         }
  1126 
  1128 
  1127         else if( configCmdLine.at(i) == "-demosdir" ) {
  1129         else if (configCmdLine.at(i) == "-demosdir") {
  1128             ++i;
  1130             ++i;
  1129             if(i==argCount)
  1131             if (i == argCount)
  1130                 break;
  1132                 break;
  1131             dictionary[ "QT_INSTALL_DEMOS" ] = configCmdLine.at(i);
  1133             dictionary[ "QT_INSTALL_DEMOS" ] = configCmdLine.at(i);
  1132         }
  1134         }
  1133 
  1135 
  1134         else if( configCmdLine.at(i) == "-hostprefix" ) {
  1136         else if (configCmdLine.at(i) == "-hostprefix") {
  1135             ++i;
  1137             ++i;
  1136             if(i==argCount)
  1138             if (i == argCount)
  1137                 break;
  1139                 break;
  1138             dictionary[ "QT_HOST_PREFIX" ] = configCmdLine.at(i);
  1140             dictionary[ "QT_HOST_PREFIX" ] = configCmdLine.at(i);
  1139         }
  1141         }
  1140 
  1142 
  1141         else if( configCmdLine.at(i) == "-make" ) {
  1143         else if (configCmdLine.at(i) == "-make") {
  1142             ++i;
  1144             ++i;
  1143             if(i==argCount)
  1145             if (i == argCount)
  1144                 break;
  1146                 break;
  1145             dictionary[ "MAKE" ] = configCmdLine.at(i);
  1147             dictionary[ "MAKE" ] = configCmdLine.at(i);
  1146         }
  1148         }
  1147 
  1149 
  1148         else if (configCmdLine.at(i) == "-graphicssystem") {
  1150         else if (configCmdLine.at(i) == "-graphicssystem") {
  1150             if (i == argCount)
  1152             if (i == argCount)
  1151                 break;
  1153                 break;
  1152             QString system = configCmdLine.at(i);
  1154             QString system = configCmdLine.at(i);
  1153             if (system == QLatin1String("raster")
  1155             if (system == QLatin1String("raster")
  1154                 || system == QLatin1String("opengl")
  1156                 || system == QLatin1String("opengl")
  1155                 || system == QLatin1String("openvg"))
  1157                 || system == QLatin1String("openvg")
       
  1158                 || system == QLatin1String("runtime"))
  1156                 dictionary["GRAPHICS_SYSTEM"] = configCmdLine.at(i);
  1159                 dictionary["GRAPHICS_SYSTEM"] = configCmdLine.at(i);
  1157         }
  1160         }
  1158 
  1161 
  1159         else if( configCmdLine.at(i).indexOf( QRegExp( "^-(en|dis)able-" ) ) != -1 ) {
  1162         else if (configCmdLine.at(i).indexOf(QRegExp("^-(en|dis)able-")) != -1) {
  1160             // Scan to see if any specific modules and drivers are enabled or disabled
  1163             // Scan to see if any specific modules and drivers are enabled or disabled
  1161             for( QStringList::Iterator module = modules.begin(); module != modules.end(); ++module ) {
  1164             for (QStringList::Iterator module = modules.begin(); module != modules.end(); ++module) {
  1162                 if( configCmdLine.at(i) == QString( "-enable-" ) + (*module) ) {
  1165                 if (configCmdLine.at(i) == QString("-enable-") + (*module)) {
  1163                     enabledModules += (*module);
  1166                     enabledModules += (*module);
  1164                     break;
  1167                     break;
  1165                 }
  1168                 }
  1166                 else if( configCmdLine.at(i) == QString( "-disable-" ) + (*module) ) {
  1169                 else if (configCmdLine.at(i) == QString("-disable-") + (*module)) {
  1167                     disabledModules += (*module);
  1170                     disabledModules += (*module);
  1168                     break;
  1171                     break;
  1169                 }
  1172                 }
  1170             }
  1173             }
  1171         }
  1174         }
  1195             cout << "Unable to detect the platform from environment. Use -platform command line"
  1198             cout << "Unable to detect the platform from environment. Use -platform command line"
  1196                     "argument or set the QMAKESPEC environment variable and run configure again" << endl;
  1199                     "argument or set the QMAKESPEC environment variable and run configure again" << endl;
  1197         }
  1200         }
  1198         cout << "See the README file for a list of supported operating systems and compilers." << endl;
  1201         cout << "See the README file for a list of supported operating systems and compilers." << endl;
  1199     } else {
  1202     } else {
  1200         if( dictionary[ "QMAKESPEC" ].endsWith( "-icc" ) ||
  1203         if (dictionary[ "QMAKESPEC" ].endsWith("-icc") ||
  1201             dictionary[ "QMAKESPEC" ].endsWith( "-msvc" ) ||
  1204             dictionary[ "QMAKESPEC" ].endsWith("-msvc") ||
  1202             dictionary[ "QMAKESPEC" ].endsWith( "-msvc.net" ) ||
  1205             dictionary[ "QMAKESPEC" ].endsWith("-msvc.net") ||
  1203             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2002" ) ||
  1206             dictionary[ "QMAKESPEC" ].endsWith("-msvc2002") ||
  1204             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2003" ) ||
  1207             dictionary[ "QMAKESPEC" ].endsWith("-msvc2003") ||
  1205             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2005" ) ||
  1208             dictionary[ "QMAKESPEC" ].endsWith("-msvc2005") ||
  1206             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2008" ) ||
  1209             dictionary[ "QMAKESPEC" ].endsWith("-msvc2008") ||
  1207             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2010" )) {
  1210             dictionary[ "QMAKESPEC" ].endsWith("-msvc2010")) {
  1208             if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "nmake";
  1211             if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "nmake";
  1209             dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
  1212             dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
  1210         } else if ( dictionary[ "QMAKESPEC" ] == QString( "win32-g++" ) ) {
  1213         } else if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) {
  1211             if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "mingw32-make";
  1214             if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "mingw32-make";
  1212             if (Environment::detectExecutable("sh.exe")) {
  1215             if (Environment::detectExecutable("sh.exe")) {
  1213                 dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-g++-sh";
  1216                 dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-g++-sh";
  1214             } else {
  1217             } else {
  1215                 dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-g++";
  1218                 dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-g++";
  1216             }
  1219             }
  1217         } else if ( dictionary[ "QMAKESPEC" ] == QString( "win32-g++-symbian" ) ) {
  1220         } else if ( dictionary[ "QMAKESPEC" ] == QString( "win32-g++-symbian" ) ) {
  1218                 dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-g++-symbian";
  1221                 dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-g++-symbian";
  1219                 dictionary[ "MAKE" ] = "make";
  1222                 dictionary[ "MAKE" ] = "make";
  1220         } else {
  1223         } else {
  1221             if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "make";
  1224             if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "make";
  1222             dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
  1225             dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
  1223         }
  1226         }
  1224     }
  1227     }
  1225 
  1228 
  1226     // Tell the user how to proceed building Qt after configure finished its job
  1229     // Tell the user how to proceed building Qt after configure finished its job
  1272     if (dictionary["BUILDDEV"] == "yes")
  1275     if (dictionary["BUILDDEV"] == "yes")
  1273         qtConfig += "private_tests";
  1276         qtConfig += "private_tests";
  1274 
  1277 
  1275 
  1278 
  1276 #if !defined(EVAL)
  1279 #if !defined(EVAL)
  1277     for( QStringList::Iterator dis = disabledModules.begin(); dis != disabledModules.end(); ++dis ) {
  1280     for (QStringList::Iterator dis = disabledModules.begin(); dis != disabledModules.end(); ++dis) {
  1278         modules.removeAll( (*dis) );
  1281         modules.removeAll((*dis));
  1279     }
  1282     }
  1280     for( QStringList::Iterator ena = enabledModules.begin(); ena != enabledModules.end(); ++ena ) {
  1283     for (QStringList::Iterator ena = enabledModules.begin(); ena != enabledModules.end(); ++ena) {
  1281         if( modules.indexOf( (*ena) ) == -1 )
  1284         if (modules.indexOf((*ena)) == -1)
  1282             modules += (*ena);
  1285             modules += (*ena);
  1283     }
  1286     }
  1284     qtConfig += modules;
  1287     qtConfig += modules;
  1285 
  1288 
  1286     for( QStringList::Iterator it = disabledModules.begin(); it != disabledModules.end(); ++it )
  1289     for (QStringList::Iterator it = disabledModules.begin(); it != disabledModules.end(); ++it)
  1287         qtConfig.removeAll(*it);
  1290         qtConfig.removeAll(*it);
  1288 
  1291 
  1289     if( ( dictionary[ "REDO" ] != "yes" ) && ( dictionary[ "HELP" ] != "yes" ) )
  1292     if ((dictionary[ "REDO" ] != "yes") && (dictionary[ "HELP" ] != "yes"))
  1290         saveCmdLine();
  1293         saveCmdLine();
  1291 #endif
  1294 #endif
  1292 }
  1295 }
  1293 
  1296 
  1294 #if !defined(EVAL)
  1297 #if !defined(EVAL)
  1304     dir.setPath(sourcePath + "/src/corelib/global/");
  1307     dir.setPath(sourcePath + "/src/corelib/global/");
  1305 
  1308 
  1306     QStringList stringList =  dir.entryList();
  1309     QStringList stringList =  dir.entryList();
  1307 
  1310 
  1308     QStringList::Iterator it;
  1311     QStringList::Iterator it;
  1309     for( it = stringList.begin(); it != stringList.end(); ++it )
  1312     for (it = stringList.begin(); it != stringList.end(); ++it)
  1310         allConfigs << it->remove("qconfig-").remove(".h");
  1313         allConfigs << it->remove("qconfig-").remove(".h");
  1311     allConfigs << "full";
  1314     allConfigs << "full";
  1312 
  1315 
  1313     // Try internal configurations first.
  1316     // Try internal configurations first.
  1314     QStringList possible_configs = QStringList()
  1317     QStringList possible_configs = QStringList()
  1325         return;
  1328         return;
  1326     }
  1329     }
  1327 
  1330 
  1328     // If the internal configurations failed, try others.
  1331     // If the internal configurations failed, try others.
  1329     QStringList::Iterator config;
  1332     QStringList::Iterator config;
  1330     for( config = allConfigs.begin(); config != allConfigs.end(); ++config ) {
  1333     for (config = allConfigs.begin(); config != allConfigs.end(); ++config) {
  1331         if( (*config) == dictionary[ "QCONFIG" ] )
  1334         if ((*config) == dictionary[ "QCONFIG" ])
  1332             break;
  1335             break;
  1333     }
  1336     }
  1334     if( config == allConfigs.end() ) {
  1337     if (config == allConfigs.end()) {
  1335         dictionary[ "HELP" ] = "yes";
  1338         dictionary[ "HELP" ] = "yes";
  1336         cout << "No such configuration \"" << qPrintable(dictionary[ "QCONFIG" ]) << "\"" << endl ;
  1339         cout << "No such configuration \"" << qPrintable(dictionary[ "QCONFIG" ]) << "\"" << endl ;
  1337     }
  1340     }
  1338     else
  1341     else
  1339         qmakeConfig += (*config) + "-config";
  1342         qmakeConfig += (*config) + "-config";
  1482             dictionary[ "DIRECTSHOW" ] = "yes";
  1485             dictionary[ "DIRECTSHOW" ] = "yes";
  1483         }
  1486         }
  1484         dictionary[ "QT_HOST_PREFIX" ]      = dictionary[ "QT_INSTALL_PREFIX" ];
  1487         dictionary[ "QT_HOST_PREFIX" ]      = dictionary[ "QT_INSTALL_PREFIX" ];
  1485         dictionary[ "QT_INSTALL_PREFIX" ]   = "";
  1488         dictionary[ "QT_INSTALL_PREFIX" ]   = "";
  1486 
  1489 
  1487     } else if(dictionary[ "XQMAKESPEC" ].startsWith("symbian")) {
  1490     } else if (dictionary[ "XQMAKESPEC" ].startsWith("symbian")) {
  1488         dictionary[ "ACCESSIBILITY" ]       = "no";
  1491         dictionary[ "ACCESSIBILITY" ]       = "no";
  1489         dictionary[ "STYLE_WINDOWSXP" ]     = "no";
  1492         dictionary[ "STYLE_WINDOWSXP" ]     = "no";
  1490         dictionary[ "STYLE_WINDOWSVISTA" ]  = "no";
  1493         dictionary[ "STYLE_WINDOWSVISTA" ]  = "no";
  1491         dictionary[ "STYLE_PLASTIQUE" ]     = "no";
  1494         dictionary[ "STYLE_PLASTIQUE" ]     = "no";
  1492         dictionary[ "STYLE_CLEANLOOKS" ]    = "no";
  1495         dictionary[ "STYLE_CLEANLOOKS" ]    = "no";
  1531         dictionary[ "SQL_SQLITE_LIB" ]      = "system";
  1534         dictionary[ "SQL_SQLITE_LIB" ]      = "system";
  1532 
  1535 
  1533         // Disable building docs and translations for now
  1536         // Disable building docs and translations for now
  1534         disabledBuildParts << "docs" << "translations";
  1537         disabledBuildParts << "docs" << "translations";
  1535 
  1538 
  1536     } else if(dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong.
  1539     } else if (dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong.
  1537       //TODO
  1540       //TODO
  1538         dictionary[ "STYLE_WINDOWSXP" ]     = "no";
  1541         dictionary[ "STYLE_WINDOWSXP" ]     = "no";
  1539         dictionary[ "STYLE_WINDOWSVISTA" ]  = "no";
  1542         dictionary[ "STYLE_WINDOWSVISTA" ]  = "no";
  1540         dictionary[ "KBD_DRIVERS" ]         = "tty";
  1543         dictionary[ "KBD_DRIVERS" ]         = "tty";
  1541         dictionary[ "GFX_DRIVERS" ]         = "linuxfb vnc";
  1544         dictionary[ "GFX_DRIVERS" ]         = "linuxfb vnc";
  1557 }
  1560 }
  1558 
  1561 
  1559 QString Configure::locateFileInPaths(const QString &fileName, const QStringList &paths)
  1562 QString Configure::locateFileInPaths(const QString &fileName, const QStringList &paths)
  1560 {
  1563 {
  1561     QDir d;
  1564     QDir d;
  1562     for( QStringList::ConstIterator it = paths.begin(); it != paths.end(); ++it ) {
  1565     for (QStringList::ConstIterator it = paths.begin(); it != paths.end(); ++it) {
  1563         // Remove any leading or trailing ", this is commonly used in the environment
  1566         // Remove any leading or trailing ", this is commonly used in the environment
  1564         // variables
  1567         // variables
  1565         QString path = (*it);
  1568         QString path = (*it);
  1566         if ( path.startsWith( "\"" ) )
  1569         if (path.startsWith("\""))
  1567             path = path.right( path.length() - 1 );
  1570             path = path.right(path.length() - 1);
  1568         if ( path.endsWith( "\"" ) )
  1571         if (path.endsWith("\""))
  1569             path = path.left( path.length() - 1 );
  1572             path = path.left(path.length() - 1);
  1570         if( d.exists(path + QDir::separator() + fileName) ) {
  1573         if (d.exists(path + QDir::separator() + fileName)) {
  1571             return (path);
  1574             return (path);
  1572         }
  1575         }
  1573     }
  1576     }
  1574     return QString();
  1577     return QString();
  1575 }
  1578 }
  1576 
  1579 
  1577 QString Configure::locateFile( const QString &fileName )
  1580 QString Configure::locateFile(const QString &fileName)
  1578 {
  1581 {
  1579     QString file = fileName.toLower();
  1582     QString file = fileName.toLower();
  1580     QStringList paths;
  1583     QStringList paths;
  1581 #if defined(Q_OS_WIN32)
  1584 #if defined(Q_OS_WIN32)
  1582     QRegExp splitReg("[;,]");
  1585     QRegExp splitReg("[;,]");
  1583 #else
  1586 #else
  1584     QRegExp splitReg("[:]");
  1587     QRegExp splitReg("[:]");
  1585 #endif
  1588 #endif
  1586     if (file.endsWith(".h"))
  1589     if (file.endsWith(".h"))
  1587         paths = QString::fromLocal8Bit(getenv("INCLUDE")).split(splitReg, QString::SkipEmptyParts);
  1590         paths = QString::fromLocal8Bit(getenv("INCLUDE")).split(splitReg, QString::SkipEmptyParts);
  1588     else if ( file.endsWith( ".lib" ) )
  1591     else if (file.endsWith(".lib"))
  1589         paths = QString::fromLocal8Bit(getenv("LIB")).split(splitReg, QString::SkipEmptyParts);
  1592         paths = QString::fromLocal8Bit(getenv("LIB")).split(splitReg, QString::SkipEmptyParts);
  1590     else
  1593     else
  1591         paths = QString::fromLocal8Bit(getenv("PATH")).split(splitReg, QString::SkipEmptyParts);
  1594         paths = QString::fromLocal8Bit(getenv("PATH")).split(splitReg, QString::SkipEmptyParts);
  1592     return locateFileInPaths(file, paths);
  1595     return locateFileInPaths(file, paths);
  1593 }
  1596 }
  1595 // Output helper functions ---------------------------------[ Stop ]-
  1598 // Output helper functions ---------------------------------[ Stop ]-
  1596 
  1599 
  1597 
  1600 
  1598 bool Configure::displayHelp()
  1601 bool Configure::displayHelp()
  1599 {
  1602 {
  1600     if( dictionary[ "HELP" ] == "yes" ) {
  1603     if (dictionary[ "HELP" ] == "yes") {
  1601         desc("Usage: configure [-buildkey <key>]\n"
  1604         desc("Usage: configure [-buildkey <key>]\n"
  1602 //      desc("Usage: configure [-prefix dir] [-bindir <dir>] [-libdir <dir>]\n"
  1605 //      desc("Usage: configure [-prefix dir] [-bindir <dir>] [-libdir <dir>]\n"
  1603 //                  "[-docdir <dir>] [-headerdir <dir>] [-plugindir <dir>]\n"
  1606 //                  "[-docdir <dir>] [-headerdir <dir>] [-plugindir <dir>]\n"
  1604 //                  "[-importdir <dir>] [-datadir <dir>] [-translationdir <dir>]\n"
  1607 //                  "[-importdir <dir>] [-datadir <dir>] [-translationdir <dir>]\n"
  1605 //                  "[-examplesdir <dir>] [-demosdir <dir>][-buildkey <key>]\n"
  1608 //                  "[-examplesdir <dir>] [-demosdir <dir>][-buildkey <key>]\n"
  1622                     "[-no-openssl] [-no-dbus] [-dbus] [-dbus-linked] [-platform <spec>]\n"
  1625                     "[-no-openssl] [-no-dbus] [-dbus] [-dbus-linked] [-platform <spec>]\n"
  1623                     "[-qtnamespace <namespace>] [-qtlibinfix <infix>] [-no-phonon]\n"
  1626                     "[-qtnamespace <namespace>] [-qtlibinfix <infix>] [-no-phonon]\n"
  1624                     "[-phonon] [-no-phonon-backend] [-phonon-backend]\n"
  1627                     "[-phonon] [-no-phonon-backend] [-phonon-backend]\n"
  1625                     "[-no-multimedia] [-multimedia] [-no-audio-backend] [-audio-backend]\n"
  1628                     "[-no-multimedia] [-multimedia] [-no-audio-backend] [-audio-backend]\n"
  1626                     "[-no-script] [-script] [-no-scripttools] [-scripttools]\n"
  1629                     "[-no-script] [-script] [-no-scripttools] [-scripttools]\n"
  1627                     "[-no-webkit] [-webkit] [-graphicssystem raster|opengl|openvg]\n\n", 0, 7);
  1630                     "[-no-webkit] [-webkit] [-graphicssystem raster|opengl|openvg|runtime]\n\n", 0, 7);
  1628 
  1631 
  1629         desc("Installation options:\n\n");
  1632         desc("Installation options:\n\n");
  1630 
  1633 
  1631 #if !defined(EVAL)
  1634 #if !defined(EVAL)
  1632 /*
  1635 /*
  1725         desc(                   "-L <librarypath>",     "Add an explicit library path.");
  1728         desc(                   "-L <librarypath>",     "Add an explicit library path.");
  1726         desc(                   "-l <libraryname>",     "Add an explicit library name, residing in a librarypath.\n");
  1729         desc(                   "-l <libraryname>",     "Add an explicit library name, residing in a librarypath.\n");
  1727 #endif
  1730 #endif
  1728         desc(                   "-graphicssystem <sys>",   "Specify which graphicssystem should be used.\n"
  1731         desc(                   "-graphicssystem <sys>",   "Specify which graphicssystem should be used.\n"
  1729                                 "Available values for <sys>:");
  1732                                 "Available values for <sys>:");
  1730         desc("GRAPHICS_SYSTEM", "raster", "", "  raster - Software rasterizer", ' ');
  1733         desc("GRAPHICS_SYSTEM", "raster", "",  "  raster - Software rasterizer", ' ');
  1731         desc("GRAPHICS_SYSTEM", "opengl", "", "  opengl - Using OpenGL acceleration, experimental!", ' ');
  1734         desc("GRAPHICS_SYSTEM", "opengl", "",  "  opengl - Using OpenGL acceleration, experimental!", ' ');
  1732         desc("GRAPHICS_SYSTEM", "openvg", "", "  openvg - Using OpenVG acceleration, experimental!", ' ');
  1735         desc("GRAPHICS_SYSTEM", "openvg", "",  "  openvg - Using OpenVG acceleration, experimental!", ' ');
       
  1736         desc("GRAPHICS_SYSTEM", "runtime", "", "  runtime - Runtime switching of graphics sytems", ' ');
  1733 
  1737 
  1734 
  1738 
  1735         desc(                   "-help, -h, -?",        "Display this information.\n");
  1739         desc(                   "-help, -h, -?",        "Display this information.\n");
  1736 
  1740 
  1737 #if !defined(EVAL)
  1741 #if !defined(EVAL)
  1739         desc("Third Party Libraries:\n\n");
  1743         desc("Third Party Libraries:\n\n");
  1740 
  1744 
  1741         desc("ZLIB", "qt",      "-qt-zlib",             "Use the zlib bundled with Qt.");
  1745         desc("ZLIB", "qt",      "-qt-zlib",             "Use the zlib bundled with Qt.");
  1742         desc("ZLIB", "system",  "-system-zlib",         "Use zlib from the operating system.\nSee http://www.gzip.org/zlib\n");
  1746         desc("ZLIB", "system",  "-system-zlib",         "Use zlib from the operating system.\nSee http://www.gzip.org/zlib\n");
  1743 
  1747 
  1744         desc("GIF", "no",       "-no-gif",              "Do not compile the plugin for GIF reading support.");
  1748         desc("GIF", "no",       "-no-gif",              "Do not compile GIF reading support.");
  1745         desc("GIF", "auto",     "-qt-gif",              "Compile the plugin for GIF reading support.\nSee also src/plugins/imageformats/gif/qgifhandler.h\n");
  1749         desc("GIF", "auto",     "-qt-gif",              "Compile GIF reading support.\nSee also src/gui/image/qgifhandler_p.h\n");
  1746 
  1750 
  1747         desc("LIBPNG", "no",    "-no-libpng",           "Do not compile in PNG support.");
  1751         desc("LIBPNG", "no",    "-no-libpng",           "Do not compile PNG support.");
  1748         desc("LIBPNG", "qt",    "-qt-libpng",           "Use the libpng bundled with Qt.");
  1752         desc("LIBPNG", "qt",    "-qt-libpng",           "Use the libpng bundled with Qt.");
  1749         desc("LIBPNG", "system","-system-libpng",       "Use libpng from the operating system.\nSee http://www.libpng.org/pub/png\n");
  1753         desc("LIBPNG", "system","-system-libpng",       "Use libpng from the operating system.\nSee http://www.libpng.org/pub/png\n");
  1750 
  1754 
  1751         desc("LIBMNG", "no",    "-no-libmng",           "Do not compile in MNG support.");
  1755         desc("LIBMNG", "no",    "-no-libmng",           "Do not compile MNG support.");
  1752         desc("LIBMNG", "qt",    "-qt-libmng",           "Use the libmng bundled with Qt.");
  1756         desc("LIBMNG", "qt",    "-qt-libmng",           "Use the libmng bundled with Qt.");
  1753         desc("LIBMNG", "system","-system-libmng",       "Use libmng from the operating system.\nSee See http://www.libmng.com\n");
  1757         desc("LIBMNG", "system","-system-libmng",       "Use libmng from the operating system.\nSee See http://www.libmng.com\n");
  1754 
  1758 
  1755         desc("LIBTIFF", "no",    "-no-libtiff",         "Do not compile the plugin for TIFF support.");
  1759         desc("LIBTIFF", "no",    "-no-libtiff",         "Do not compile TIFF support.");
  1756         desc("LIBTIFF", "qt",    "-qt-libtiff",         "Use the libtiff bundled with Qt.");
  1760         desc("LIBTIFF", "qt",    "-qt-libtiff",         "Use the libtiff bundled with Qt.");
  1757         desc("LIBTIFF", "system","-system-libtiff",     "Use libtiff from the operating system.\nSee http://www.libtiff.org\n");
  1761         desc("LIBTIFF", "system","-system-libtiff",     "Use libtiff from the operating system.\nSee http://www.libtiff.org\n");
  1758 
  1762 
  1759         desc("LIBJPEG", "no",    "-no-libjpeg",         "Do not compile the plugin for JPEG support.");
  1763         desc("LIBJPEG", "no",    "-no-libjpeg",         "Do not compile JPEG support.");
  1760         desc("LIBJPEG", "qt",    "-qt-libjpeg",         "Use the libjpeg bundled with Qt.");
  1764         desc("LIBJPEG", "qt",    "-qt-libjpeg",         "Use the libjpeg bundled with Qt.");
  1761         desc("LIBJPEG", "system","-system-libjpeg",     "Use libjpeg from the operating system.\nSee http://www.ijg.org\n");
  1765         desc("LIBJPEG", "system","-system-libjpeg",     "Use libjpeg from the operating system.\nSee http://www.ijg.org\n");
  1762 
  1766 
  1763 #endif
  1767 #endif
  1764         // Qt\Windows only options go below here --------------------------------------------------------------------------------
  1768         // Qt\Windows only options go below here --------------------------------------------------------------------------------
  1887 #else
  1891 #else
  1888     QRegExp splitReg("[:]");
  1892     QRegExp splitReg("[:]");
  1889 #endif
  1893 #endif
  1890     QStringList pathList = paths.split(splitReg, QString::SkipEmptyParts);
  1894     QStringList pathList = paths.split(splitReg, QString::SkipEmptyParts);
  1891     QDir d;
  1895     QDir d;
  1892     for( QStringList::ConstIterator it = pathList.begin(); it != pathList.end(); ++it ) {
  1896     for (QStringList::ConstIterator it = pathList.begin(); it != pathList.end(); ++it) {
  1893         // Remove any leading or trailing ", this is commonly used in the environment
  1897         // Remove any leading or trailing ", this is commonly used in the environment
  1894         // variables
  1898         // variables
  1895         QString path = (*it);
  1899         QString path = (*it);
  1896         if ( path.startsWith( '\"' ) )
  1900         if (path.startsWith('\"'))
  1897             path = path.right( path.length() - 1 );
  1901             path = path.right(path.length() - 1);
  1898         if ( path.endsWith( '\"' ) )
  1902         if (path.endsWith('\"'))
  1899             path = path.left( path.length() - 1 );
  1903             path = path.left(path.length() - 1);
  1900         if( d.exists( path + QDir::separator() + fileName ) )
  1904         if (d.exists(path + QDir::separator() + fileName))
  1901             return path;
  1905             return path;
  1902     }
  1906     }
  1903     return QString();
  1907     return QString();
  1904 }
  1908 }
  1905 
  1909 
  1906 bool Configure::findFile( const QString &fileName )
  1910 bool Configure::findFile(const QString &fileName)
  1907 {
  1911 {
  1908     const QString file = fileName.toLower();
  1912     const QString file = fileName.toLower();
  1909     const QString pathEnvVar = QString::fromLocal8Bit(getenv("PATH"));
  1913     const QString pathEnvVar = QString::fromLocal8Bit(getenv("PATH"));
  1910     const QString mingwPath = dictionary["QMAKESPEC"].endsWith("-g++") ?
  1914     const QString mingwPath = dictionary["QMAKESPEC"].endsWith("-g++") ?
  1911         findFileInPaths("g++.exe", pathEnvVar) : QString();
  1915         findFileInPaths("g++.exe", pathEnvVar) : QString();
  1912 
  1916 
  1913     QString paths;
  1917     QString paths;
  1914     if (file.endsWith(".h")) {
  1918     if (file.endsWith(".h")) {
  1915         if (!mingwPath.isNull()) {
  1919         if (!mingwPath.isNull()) {
  1916             if (!findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull())
  1920             if (!findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull())
  1917 		        return true;
  1921                 return true;
  1918             //now let's try the additional compiler path
  1922             //now let's try the additional compiler path
  1919             QDir mingwLibDir = mingwPath + QLatin1String("/../lib/gcc/mingw32");
  1923             QDir mingwLibDir = mingwPath + QLatin1String("/../lib/gcc/mingw32");
  1920             foreach(const QFileInfo &version, mingwLibDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) {
  1924             foreach(const QFileInfo &version, mingwLibDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) {
  1921                 if (!findFileInPaths(file, version.absoluteFilePath() + QLatin1String("/include")).isNull())
  1925                 if (!findFileInPaths(file, version.absoluteFilePath() + QLatin1String("/include")).isNull())
  1922                     return true;
  1926                     return true;
  1923             }
  1927             }
  1924         }
  1928         }
  1925         paths = QString::fromLocal8Bit(getenv("INCLUDE"));
  1929         paths = QString::fromLocal8Bit(getenv("INCLUDE"));
  1926     } else if ( file.endsWith( ".lib" ) ||  file.endsWith( ".a" ) ) {
  1930     } else if (file.endsWith(".lib") ||  file.endsWith(".a")) {
  1927         if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../lib")).isNull())
  1931         if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../lib")).isNull())
  1928 		    return true;
  1932             return true;
  1929         paths = QString::fromLocal8Bit(getenv("LIB"));
  1933         paths = QString::fromLocal8Bit(getenv("LIB"));
  1930     } else {
  1934     } else {
  1931         paths = pathEnvVar;
  1935         paths = pathEnvVar;
  1932     }
  1936     }
  1933     return !findFileInPaths(file, paths).isNull();
  1937     return !findFileInPaths(file, paths).isNull();
  1946         || option == "LIBPNG"
  1950         || option == "LIBPNG"
  1947         || option == "LIBMNG"
  1951         || option == "LIBMNG"
  1948         || option == "LIBTIFF")
  1952         || option == "LIBTIFF")
  1949         return "system";
  1953         return "system";
  1950 
  1954 
  1951     // We want PNG built-in
  1955     // PNG is always built-in, never a plugin
  1952     if (option == "PNG")
  1956     if (option == "PNG")
  1953         return "qt";
  1957         return "yes";
  1954 
  1958 
  1955     // The JPEG image library can only be a plugin
  1959     // These database drivers and image formats can be built-in or plugins.
  1956     if (option == "JPEG"
  1960     // Prefer plugins when Qt is shared.
  1957         || option == "MNG" || option == "TIFF")
  1961     if (dictionary[ "SHARED" ] == "yes") {
  1958         return "plugin";
  1962         if (option == "SQL_MYSQL"
  1959 
  1963             || option == "SQL_MYSQL"
  1960     // GIF off by default
  1964             || option == "SQL_ODBC"
  1961     if (option == "GIF") {
  1965             || option == "SQL_OCI"
  1962         if (dictionary["SHARED"] == "yes")
  1966             || option == "SQL_PSQL"
       
  1967             || option == "SQL_TDS"
       
  1968             || option == "SQL_DB2"
       
  1969             || option == "SQL_SQLITE"
       
  1970             || option == "SQL_SQLITE2"
       
  1971             || option == "SQL_IBASE"
       
  1972             || option == "JPEG"
       
  1973             || option == "MNG"
       
  1974             || option == "TIFF"
       
  1975             || option == "GIF")
  1963             return "plugin";
  1976             return "plugin";
  1964         else
       
  1965             return "yes";
       
  1966     }
  1977     }
  1967 
  1978 
  1968     // By default we do not want to compile OCI driver when compiling with
  1979     // By default we do not want to compile OCI driver when compiling with
  1969     // MinGW, due to lack of such support from Oracle. It prob. wont work.
  1980     // MinGW, due to lack of such support from Oracle. It prob. wont work.
  1970     // (Customer may force the use though)
  1981     // (Customer may force the use though)
  1971     if (dictionary["QMAKESPEC"].endsWith("-g++")
  1982     if (dictionary["QMAKESPEC"].endsWith("-g++")
  1972         && option == "SQL_OCI")
  1983         && option == "SQL_OCI")
  1973         return "no";
  1984         return "no";
  1974 
       
  1975     if (option == "SQL_MYSQL"
       
  1976         || option == "SQL_MYSQL"
       
  1977         || option == "SQL_ODBC"
       
  1978         || option == "SQL_OCI"
       
  1979         || option == "SQL_PSQL"
       
  1980         || option == "SQL_TDS"
       
  1981         || option == "SQL_DB2"
       
  1982         || option == "SQL_SQLITE"
       
  1983         || option == "SQL_SQLITE2"
       
  1984         || option == "SQL_IBASE")
       
  1985         return "plugin";
       
  1986 
  1985 
  1987     if (option == "SYNCQT"
  1986     if (option == "SYNCQT"
  1988         && (!QFile::exists(sourcePath + "/bin/syncqt") ||
  1987         && (!QFile::exists(sourcePath + "/bin/syncqt") ||
  1989             !QFile::exists(sourcePath + "/bin/syncqt.bat")))
  1988             !QFile::exists(sourcePath + "/bin/syncqt.bat")))
  1990         return "no";
  1989         return "no";
  2030             available = false; // In Symbian we only support system sqlite option
  2029             available = false; // In Symbian we only support system sqlite option
  2031         else
  2030         else
  2032             available = true; // Built in, we have a fork
  2031             available = true; // Built in, we have a fork
  2033     else if (part == "SQL_SQLITE_LIB") {
  2032     else if (part == "SQL_SQLITE_LIB") {
  2034         if (dictionary[ "SQL_SQLITE_LIB" ] == "system") {
  2033         if (dictionary[ "SQL_SQLITE_LIB" ] == "system") {
  2035 		    // Symbian has multiple .lib/.dll files we need to find
  2034             // Symbian has multiple .lib/.dll files we need to find
  2036             if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
  2035             if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
  2037 			    available = true; // There is sqlite_symbian plugin which exports the necessary stuff
  2036                 available = true; // There is sqlite_symbian plugin which exports the necessary stuff
  2038 			    dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3";
  2037                 dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3";
  2039 		    } else {
  2038             } else {
  2040 			    available = findFile("sqlite3.h") && findFile("sqlite3.lib");
  2039                 available = findFile("sqlite3.h") && findFile("sqlite3.lib");
  2041 			    if (available)
  2040                 if (available)
  2042 				    dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib";
  2041                     dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib";
  2043 		    }
  2042             }
  2044         } else
  2043         } else
  2045             available = true;
  2044             available = true;
  2046     } else if (part == "SQL_SQLITE2")
  2045     } else if (part == "SQL_SQLITE2")
  2047         available = findFile("sqlite.h") && findFile("sqlite.lib");
  2046         available = findFile("sqlite.h") && findFile("sqlite.lib");
  2048     else if (part == "SQL_IBASE")
  2047     else if (part == "SQL_IBASE")
  2055         available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
  2054         available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
  2056     else if (part == "DIRECTSHOW")
  2055     else if (part == "DIRECTSHOW")
  2057         available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
  2056         available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
  2058     else if (part == "SSE2")
  2057     else if (part == "SSE2")
  2059         available = (dictionary.value("QMAKESPEC") != "win32-msvc");
  2058         available = (dictionary.value("QMAKESPEC") != "win32-msvc");
  2060     else if (part == "3DNOW" )
  2059     else if (part == "3DNOW")
  2061         available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-icc") && findFile("mm3dnow.h");
  2060         available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-icc") && findFile("mm3dnow.h");
  2062     else if (part == "MMX" || part == "SSE")
  2061     else if (part == "MMX" || part == "SSE")
  2063         available = (dictionary.value("QMAKESPEC") != "win32-msvc");
  2062         available = (dictionary.value("QMAKESPEC") != "win32-msvc");
  2064     else if (part == "OPENSSL")
  2063     else if (part == "OPENSSL")
  2065         available = findFile("openssl\\ssl.h");
  2064         available = findFile("openssl\\ssl.h");
  2114         available = findFile("wmsdk.h");
  2113         available = findFile("wmsdk.h");
  2115     } else if (part == "MULTIMEDIA" || part == "SCRIPT" || part == "SCRIPTTOOLS" || part == "DECLARATIVE") {
  2114     } else if (part == "MULTIMEDIA" || part == "SCRIPT" || part == "SCRIPTTOOLS" || part == "DECLARATIVE") {
  2116         available = true;
  2115         available = true;
  2117     } else if (part == "WEBKIT") {
  2116     } else if (part == "WEBKIT") {
  2118         available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-msvc2010") || (dictionary.value("QMAKESPEC") == "win32-g++");
  2117         available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-msvc2010") || (dictionary.value("QMAKESPEC") == "win32-g++");
       
  2118         if (dictionary[ "SHARED" ] == "no") {
       
  2119             cout << endl << "WARNING: Using static linking will disable the WebKit module." << endl
       
  2120                  << endl;
       
  2121             available = false;
       
  2122         }
  2119     } else if (part == "AUDIO_BACKEND") {
  2123     } else if (part == "AUDIO_BACKEND") {
  2120         available = true;
  2124         available = true;
  2121         if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
  2125         if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
  2122             QString epocRoot = Environment::symbianEpocRoot();
  2126             QString epocRoot = Environment::symbianEpocRoot();
  2123             const QDir epocRootDir(epocRoot);
  2127             const QDir epocRootDir(epocRoot);
  2274 {
  2278 {
  2275     if (dictionary["SQL_SQLITE_LIB"] == "no" && dictionary["SQL_SQLITE"] != "no") {
  2279     if (dictionary["SQL_SQLITE_LIB"] == "no" && dictionary["SQL_SQLITE"] != "no") {
  2276         cout << "WARNING: Configure could not detect the presence of a system SQLite3 lib." << endl
  2280         cout << "WARNING: Configure could not detect the presence of a system SQLite3 lib." << endl
  2277              << "Configure will therefore continue with the SQLite3 lib bundled with Qt." << endl
  2281              << "Configure will therefore continue with the SQLite3 lib bundled with Qt." << endl
  2278              << "(Press any key to continue..)";
  2282              << "(Press any key to continue..)";
  2279         if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
  2283         if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
  2280             exit(0);      // Exit cleanly for Ctrl+C
  2284             exit(0);      // Exit cleanly for Ctrl+C
  2281 
  2285 
  2282         dictionary["SQL_SQLITE_LIB"] = "qt"; // Set to Qt's bundled lib an continue
  2286         dictionary["SQL_SQLITE_LIB"] = "qt"; // Set to Qt's bundled lib an continue
  2283     }
  2287     }
  2284     if (dictionary["QMAKESPEC"].endsWith("-g++")
  2288     if (dictionary["QMAKESPEC"].endsWith("-g++")
  2285         && dictionary["SQL_OCI"] != "no") {
  2289         && dictionary["SQL_OCI"] != "no") {
  2286         cout << "WARNING: Qt does not support compiling the Oracle database driver with" << endl
  2290         cout << "WARNING: Qt does not support compiling the Oracle database driver with" << endl
  2287              << "MinGW, due to lack of such support from Oracle. Consider disabling the" << endl
  2291              << "MinGW, due to lack of such support from Oracle. Consider disabling the" << endl
  2288              << "Oracle driver, as the current build will most likely fail." << endl;
  2292              << "Oracle driver, as the current build will most likely fail." << endl;
  2289         cout << "(Press any key to continue..)";
  2293         cout << "(Press any key to continue..)";
  2290         if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
  2294         if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
  2291             exit(0);      // Exit cleanly for Ctrl+C
  2295             exit(0);      // Exit cleanly for Ctrl+C
  2292     }
  2296     }
  2293     if (dictionary["QMAKESPEC"].endsWith("win32-msvc.net")) {
  2297     if (dictionary["QMAKESPEC"].endsWith("win32-msvc.net")) {
  2294         cout << "WARNING: The makespec win32-msvc.net is deprecated. Consider using" << endl
  2298         cout << "WARNING: The makespec win32-msvc.net is deprecated. Consider using" << endl
  2295              << "win32-msvc2002 or win32-msvc2003 instead." << endl;
  2299              << "win32-msvc2002 or win32-msvc2003 instead." << endl;
  2296         cout << "(Press any key to continue..)";
  2300         cout << "(Press any key to continue..)";
  2297         if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
  2301         if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
  2298             exit(0);      // Exit cleanly for Ctrl+C
  2302             exit(0);      // Exit cleanly for Ctrl+C
  2299     }
  2303     }
  2300     if (0 != dictionary["ARM_FPU_TYPE"].size()) {
  2304     if (0 != dictionary["ARM_FPU_TYPE"].size()) {
  2301             QStringList l= QStringList()
  2305             QStringList l= QStringList()
  2302                     << "softvfp"
  2306                     << "softvfp"
  2307     }
  2311     }
  2308     if (dictionary["DECLARATIVE"] == "yes" && dictionary["SCRIPT"] == "no") {
  2312     if (dictionary["DECLARATIVE"] == "yes" && dictionary["SCRIPT"] == "no") {
  2309         cout << "WARNING: To be able to compile QtDeclarative we need to also compile the" << endl
  2313         cout << "WARNING: To be able to compile QtDeclarative we need to also compile the" << endl
  2310              << "QtScript module. If you continue, we will turn on the QtScript module." << endl
  2314              << "QtScript module. If you continue, we will turn on the QtScript module." << endl
  2311              << "(Press any key to continue..)";
  2315              << "(Press any key to continue..)";
  2312         if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
  2316         if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
  2313             exit(0);      // Exit cleanly for Ctrl+C
  2317             exit(0);      // Exit cleanly for Ctrl+C
  2314 
  2318 
  2315         dictionary["SCRIPT"] = "yes";
  2319         dictionary["SCRIPT"] = "yes";
  2316     }
  2320     }
  2317 
  2321 
  2407 
  2411 
  2408 void Configure::generateOutputVars()
  2412 void Configure::generateOutputVars()
  2409 {
  2413 {
  2410     // Generate variables for output
  2414     // Generate variables for output
  2411     // Build key ----------------------------------------------------
  2415     // Build key ----------------------------------------------------
  2412     if ( dictionary.contains("BUILD_KEY") ) {
  2416     if (dictionary.contains("BUILD_KEY")) {
  2413         qmakeVars += dictionary.value("BUILD_KEY");
  2417         qmakeVars += dictionary.value("BUILD_KEY");
  2414     }
  2418     }
  2415 
  2419 
  2416     QString build = dictionary[ "BUILD" ];
  2420     QString build = dictionary[ "BUILD" ];
  2417     bool buildAll = (dictionary[ "BUILDALL" ] == "yes");
  2421     bool buildAll = (dictionary[ "BUILDALL" ] == "yes");
  2418     if ( build == "debug") {
  2422     if (build == "debug") {
  2419         if (buildAll)
  2423         if (buildAll)
  2420             qtConfig += "release";
  2424             qtConfig += "release";
  2421         qtConfig += "debug";
  2425         qtConfig += "debug";
  2422     } else if (build == "release") {
  2426     } else if (build == "release") {
  2423         if (buildAll)
  2427         if (buildAll)
  2424             qtConfig += "debug";
  2428             qtConfig += "debug";
  2425         qtConfig += "release";
  2429         qtConfig += "release";
  2426     }
  2430     }
  2427 
  2431 
  2428     // Compression --------------------------------------------------
  2432     // Compression --------------------------------------------------
  2429     if( dictionary[ "ZLIB" ] == "qt" )
  2433     if (dictionary[ "ZLIB" ] == "qt")
  2430         qtConfig += "zlib";
  2434         qtConfig += "zlib";
  2431     else if( dictionary[ "ZLIB" ] == "system" )
  2435     else if (dictionary[ "ZLIB" ] == "system")
  2432         qtConfig += "system-zlib";
  2436         qtConfig += "system-zlib";
  2433 
  2437 
  2434     // Image formates -----------------------------------------------
  2438     // Image formates -----------------------------------------------
  2435     if( dictionary[ "GIF" ] == "no" )
  2439     if (dictionary[ "GIF" ] == "no")
  2436         qtConfig += "no-gif";
  2440         qtConfig += "no-gif";
  2437     else if( dictionary[ "GIF" ] == "yes" )
  2441     else if (dictionary[ "GIF" ] == "yes")
  2438         qtConfig += "gif";
  2442         qtConfig += "gif";
  2439     else if( dictionary[ "GIF" ] == "plugin" )
  2443     else if (dictionary[ "GIF" ] == "plugin")
  2440         qmakeFormatPlugins += "gif";
  2444         qmakeFormatPlugins += "gif";
  2441 
  2445 
  2442     if( dictionary[ "TIFF" ] == "no" )
  2446     if (dictionary[ "TIFF" ] == "no")
  2443           qtConfig += "no-tiff";
  2447         qtConfig += "no-tiff";
  2444     else if( dictionary[ "TIFF" ] == "plugin" )
  2448     else if (dictionary[ "TIFF" ] == "yes")
       
  2449         qtConfig += "tiff";
       
  2450     else if (dictionary[ "TIFF" ] == "plugin")
  2445         qmakeFormatPlugins += "tiff";
  2451         qmakeFormatPlugins += "tiff";
  2446     if( dictionary[ "LIBTIFF" ] == "system" )
  2452     if (dictionary[ "LIBTIFF" ] == "system")
  2447         qtConfig += "system-tiff";
  2453         qtConfig += "system-tiff";
  2448 
  2454 
  2449     if( dictionary[ "JPEG" ] == "no" )
  2455     if (dictionary[ "JPEG" ] == "no")
  2450         qtConfig += "no-jpeg";
  2456         qtConfig += "no-jpeg";
  2451     else if( dictionary[ "JPEG" ] == "plugin" )
  2457     else if (dictionary[ "JPEG" ] == "yes")
       
  2458         qtConfig += "jpeg";
       
  2459     else if (dictionary[ "JPEG" ] == "plugin")
  2452         qmakeFormatPlugins += "jpeg";
  2460         qmakeFormatPlugins += "jpeg";
  2453     if( dictionary[ "LIBJPEG" ] == "system" )
  2461     if (dictionary[ "LIBJPEG" ] == "system")
  2454         qtConfig += "system-jpeg";
  2462         qtConfig += "system-jpeg";
  2455 
  2463 
  2456     if( dictionary[ "PNG" ] == "no" )
  2464     if (dictionary[ "PNG" ] == "no")
  2457         qtConfig += "no-png";
  2465         qtConfig += "no-png";
  2458     else if( dictionary[ "PNG" ] == "qt" )
  2466     else if (dictionary[ "PNG" ] == "yes")
  2459         qtConfig += "png";
  2467         qtConfig += "png";
  2460     if( dictionary[ "LIBPNG" ] == "system" )
  2468     if (dictionary[ "LIBPNG" ] == "system")
  2461         qtConfig += "system-png";
  2469         qtConfig += "system-png";
  2462 
  2470 
  2463     if( dictionary[ "MNG" ] == "no" )
  2471     if (dictionary[ "MNG" ] == "no")
  2464         qtConfig += "no-mng";
  2472         qtConfig += "no-mng";
  2465     else if( dictionary[ "MNG" ] == "qt" )
  2473     else if (dictionary[ "MNG" ] == "yes")
  2466         qtConfig += "mng";
  2474         qtConfig += "mng";
  2467     if( dictionary[ "LIBMNG" ] == "system" )
  2475     if (dictionary[ "LIBMNG" ] == "system")
  2468         qtConfig += "system-mng";
  2476         qtConfig += "system-mng";
  2469 
  2477 
  2470     // Text rendering --------------------------------------------------
  2478     // Text rendering --------------------------------------------------
  2471     if( dictionary[ "FREETYPE" ] == "yes" )
  2479     if (dictionary[ "FREETYPE" ] == "yes")
  2472         qtConfig += "freetype";
  2480         qtConfig += "freetype";
  2473 
  2481 
  2474     // Styles -------------------------------------------------------
  2482     // Styles -------------------------------------------------------
  2475     if ( dictionary[ "STYLE_WINDOWS" ] == "yes" )
  2483     if (dictionary[ "STYLE_WINDOWS" ] == "yes")
  2476         qmakeStyles += "windows";
  2484         qmakeStyles += "windows";
  2477 
  2485 
  2478     if ( dictionary[ "STYLE_PLASTIQUE" ] == "yes" )
  2486     if (dictionary[ "STYLE_PLASTIQUE" ] == "yes")
  2479         qmakeStyles += "plastique";
  2487         qmakeStyles += "plastique";
  2480 
  2488 
  2481     if ( dictionary[ "STYLE_CLEANLOOKS" ] == "yes" )
  2489     if (dictionary[ "STYLE_CLEANLOOKS" ] == "yes")
  2482         qmakeStyles += "cleanlooks";
  2490         qmakeStyles += "cleanlooks";
  2483 
  2491 
  2484     if ( dictionary[ "STYLE_WINDOWSXP" ] == "yes" )
  2492     if (dictionary[ "STYLE_WINDOWSXP" ] == "yes")
  2485         qmakeStyles += "windowsxp";
  2493         qmakeStyles += "windowsxp";
  2486 
  2494 
  2487     if ( dictionary[ "STYLE_WINDOWSVISTA" ] == "yes" )
  2495     if (dictionary[ "STYLE_WINDOWSVISTA" ] == "yes")
  2488         qmakeStyles += "windowsvista";
  2496         qmakeStyles += "windowsvista";
  2489 
  2497 
  2490     if ( dictionary[ "STYLE_MOTIF" ] == "yes" )
  2498     if (dictionary[ "STYLE_MOTIF" ] == "yes")
  2491         qmakeStyles += "motif";
  2499         qmakeStyles += "motif";
  2492 
  2500 
  2493     if ( dictionary[ "STYLE_SGI" ] == "yes" )
  2501     if (dictionary[ "STYLE_SGI" ] == "yes")
  2494         qmakeStyles += "sgi";
  2502         qmakeStyles += "sgi";
  2495 
  2503 
  2496     if ( dictionary[ "STYLE_WINDOWSCE" ] == "yes" )
  2504     if (dictionary[ "STYLE_WINDOWSCE" ] == "yes")
  2497     qmakeStyles += "windowsce";
  2505     qmakeStyles += "windowsce";
  2498 
  2506 
  2499     if ( dictionary[ "STYLE_WINDOWSMOBILE" ] == "yes" )
  2507     if (dictionary[ "STYLE_WINDOWSMOBILE" ] == "yes")
  2500     qmakeStyles += "windowsmobile";
  2508     qmakeStyles += "windowsmobile";
  2501 
  2509 
  2502     if ( dictionary[ "STYLE_CDE" ] == "yes" )
  2510     if (dictionary[ "STYLE_CDE" ] == "yes")
  2503         qmakeStyles += "cde";
  2511         qmakeStyles += "cde";
  2504 
  2512 
  2505     if ( dictionary[ "STYLE_S60" ] == "yes" )
  2513     if (dictionary[ "STYLE_S60" ] == "yes")
  2506         qmakeStyles += "s60";
  2514         qmakeStyles += "s60";
  2507 
  2515 
  2508     // Databases ----------------------------------------------------
  2516     // Databases ----------------------------------------------------
  2509     if ( dictionary[ "SQL_MYSQL" ] == "yes" )
  2517     if (dictionary[ "SQL_MYSQL" ] == "yes")
  2510         qmakeSql += "mysql";
  2518         qmakeSql += "mysql";
  2511     else if ( dictionary[ "SQL_MYSQL" ] == "plugin" )
  2519     else if (dictionary[ "SQL_MYSQL" ] == "plugin")
  2512         qmakeSqlPlugins += "mysql";
  2520         qmakeSqlPlugins += "mysql";
  2513 
  2521 
  2514     if ( dictionary[ "SQL_ODBC" ] == "yes" )
  2522     if (dictionary[ "SQL_ODBC" ] == "yes")
  2515         qmakeSql += "odbc";
  2523         qmakeSql += "odbc";
  2516     else if ( dictionary[ "SQL_ODBC" ] == "plugin" )
  2524     else if (dictionary[ "SQL_ODBC" ] == "plugin")
  2517         qmakeSqlPlugins += "odbc";
  2525         qmakeSqlPlugins += "odbc";
  2518 
  2526 
  2519     if ( dictionary[ "SQL_OCI" ] == "yes" )
  2527     if (dictionary[ "SQL_OCI" ] == "yes")
  2520         qmakeSql += "oci";
  2528         qmakeSql += "oci";
  2521     else if ( dictionary[ "SQL_OCI" ] == "plugin" )
  2529     else if (dictionary[ "SQL_OCI" ] == "plugin")
  2522         qmakeSqlPlugins += "oci";
  2530         qmakeSqlPlugins += "oci";
  2523 
  2531 
  2524     if ( dictionary[ "SQL_PSQL" ] == "yes" )
  2532     if (dictionary[ "SQL_PSQL" ] == "yes")
  2525         qmakeSql += "psql";
  2533         qmakeSql += "psql";
  2526     else if ( dictionary[ "SQL_PSQL" ] == "plugin" )
  2534     else if (dictionary[ "SQL_PSQL" ] == "plugin")
  2527         qmakeSqlPlugins += "psql";
  2535         qmakeSqlPlugins += "psql";
  2528 
  2536 
  2529     if ( dictionary[ "SQL_TDS" ] == "yes" )
  2537     if (dictionary[ "SQL_TDS" ] == "yes")
  2530         qmakeSql += "tds";
  2538         qmakeSql += "tds";
  2531     else if ( dictionary[ "SQL_TDS" ] == "plugin" )
  2539     else if (dictionary[ "SQL_TDS" ] == "plugin")
  2532         qmakeSqlPlugins += "tds";
  2540         qmakeSqlPlugins += "tds";
  2533 
  2541 
  2534     if ( dictionary[ "SQL_DB2" ] == "yes" )
  2542     if (dictionary[ "SQL_DB2" ] == "yes")
  2535         qmakeSql += "db2";
  2543         qmakeSql += "db2";
  2536     else if ( dictionary[ "SQL_DB2" ] == "plugin" )
  2544     else if (dictionary[ "SQL_DB2" ] == "plugin")
  2537         qmakeSqlPlugins += "db2";
  2545         qmakeSqlPlugins += "db2";
  2538 
  2546 
  2539     if ( dictionary[ "SQL_SQLITE" ] == "yes" )
  2547     if (dictionary[ "SQL_SQLITE" ] == "yes")
  2540         qmakeSql += "sqlite";
  2548         qmakeSql += "sqlite";
  2541     else if ( dictionary[ "SQL_SQLITE" ] == "plugin" )
  2549     else if (dictionary[ "SQL_SQLITE" ] == "plugin")
  2542         qmakeSqlPlugins += "sqlite";
  2550         qmakeSqlPlugins += "sqlite";
  2543 
  2551 
  2544     if ( dictionary[ "SQL_SQLITE_LIB" ] == "system" )
  2552     if (dictionary[ "SQL_SQLITE_LIB" ] == "system")
  2545         qmakeConfig += "system-sqlite";
  2553         qmakeConfig += "system-sqlite";
  2546 
  2554 
  2547     if ( dictionary[ "SQL_SQLITE2" ] == "yes" )
  2555     if (dictionary[ "SQL_SQLITE2" ] == "yes")
  2548         qmakeSql += "sqlite2";
  2556         qmakeSql += "sqlite2";
  2549     else if ( dictionary[ "SQL_SQLITE2" ] == "plugin" )
  2557     else if (dictionary[ "SQL_SQLITE2" ] == "plugin")
  2550         qmakeSqlPlugins += "sqlite2";
  2558         qmakeSqlPlugins += "sqlite2";
  2551 
  2559 
  2552     if ( dictionary[ "SQL_IBASE" ] == "yes" )
  2560     if (dictionary[ "SQL_IBASE" ] == "yes")
  2553         qmakeSql += "ibase";
  2561         qmakeSql += "ibase";
  2554     else if ( dictionary[ "SQL_IBASE" ] == "plugin" )
  2562     else if (dictionary[ "SQL_IBASE" ] == "plugin")
  2555         qmakeSqlPlugins += "ibase";
  2563         qmakeSqlPlugins += "ibase";
  2556 
  2564 
  2557     // Other options ------------------------------------------------
  2565     // Other options ------------------------------------------------
  2558     if( dictionary[ "BUILDALL" ] == "yes" ) {
  2566     if (dictionary[ "BUILDALL" ] == "yes") {
  2559         qmakeConfig += "build_all";
  2567         qmakeConfig += "build_all";
  2560     }
  2568     }
  2561     qmakeConfig += dictionary[ "BUILD" ];
  2569     qmakeConfig += dictionary[ "BUILD" ];
  2562     dictionary[ "QMAKE_OUTDIR" ] = dictionary[ "BUILD" ];
  2570     dictionary[ "QMAKE_OUTDIR" ] = dictionary[ "BUILD" ];
  2563 
  2571 
  2564     if ( dictionary[ "SHARED" ] == "yes" ) {
  2572     if (dictionary[ "SHARED" ] == "yes") {
  2565         QString version = dictionary[ "VERSION" ];
  2573         QString version = dictionary[ "VERSION" ];
  2566         if (!version.isEmpty()) {
  2574         if (!version.isEmpty()) {
  2567             qmakeVars += "QMAKE_QT_VERSION_OVERRIDE = " + version.left(version.indexOf("."));
  2575             qmakeVars += "QMAKE_QT_VERSION_OVERRIDE = " + version.left(version.indexOf("."));
  2568             version.remove(QLatin1Char('.'));
  2576             version.remove(QLatin1Char('.'));
  2569         }
  2577         }
  2570         dictionary[ "QMAKE_OUTDIR" ] += "_shared";
  2578         dictionary[ "QMAKE_OUTDIR" ] += "_shared";
  2571     } else {
  2579     } else {
  2572         dictionary[ "QMAKE_OUTDIR" ] += "_static";
  2580         dictionary[ "QMAKE_OUTDIR" ] += "_static";
  2573     }
  2581     }
  2574 
  2582 
  2575     if( dictionary[ "ACCESSIBILITY" ] == "yes" )
  2583     if (dictionary[ "ACCESSIBILITY" ] == "yes")
  2576         qtConfig += "accessibility";
  2584         qtConfig += "accessibility";
  2577 
  2585 
  2578     if( !qmakeLibs.isEmpty() )
  2586     if (!qmakeLibs.isEmpty())
  2579         qmakeVars += "LIBS           += " + qmakeLibs.join( " " );
  2587         qmakeVars += "LIBS           += " + escapeSeparators(qmakeLibs.join(" "));
  2580 
  2588 
  2581     if( !dictionary["QT_LFLAGS_SQLITE"].isEmpty() )
  2589     if (!dictionary["QT_LFLAGS_SQLITE"].isEmpty())
  2582         qmakeVars += "QT_LFLAGS_SQLITE += " + dictionary["QT_LFLAGS_SQLITE"];
  2590         qmakeVars += "QT_LFLAGS_SQLITE += " + escapeSeparators(dictionary["QT_LFLAGS_SQLITE"]);
  2583 
  2591 
  2584     if (dictionary[ "QT3SUPPORT" ] == "yes")
  2592     if (dictionary[ "QT3SUPPORT" ] == "yes")
  2585         qtConfig += "qt3support";
  2593         qtConfig += "qt3support";
  2586 
  2594 
  2587     if (dictionary[ "OPENGL" ] == "yes")
  2595     if (dictionary[ "OPENGL" ] == "yes")
  2588         qtConfig += "opengl";
  2596         qtConfig += "opengl";
  2589 
  2597 
  2590     if ( dictionary["OPENGL_ES_CM"] == "yes" ) {
  2598     if (dictionary["OPENGL_ES_CM"] == "yes") {
  2591         qtConfig += "opengles1";
  2599         qtConfig += "opengles1";
  2592         qtConfig += "egl";
  2600         qtConfig += "egl";
  2593     }
  2601     }
  2594 
  2602 
  2595     if ( dictionary["OPENGL_ES_2"] == "yes" ) {
  2603     if (dictionary["OPENGL_ES_2"] == "yes") {
  2596         qtConfig += "opengles2";
  2604         qtConfig += "opengles2";
  2597         qtConfig += "egl";
  2605         qtConfig += "egl";
  2598     }
  2606     }
  2599 
  2607 
  2600     if ( dictionary["OPENVG"] == "yes" ) {
  2608     if (dictionary["OPENVG"] == "yes") {
  2601         qtConfig += "openvg";
  2609         qtConfig += "openvg";
  2602         qtConfig += "egl";
  2610         qtConfig += "egl";
  2603     }
  2611     }
  2604 
  2612 
  2605     if ( dictionary["S60"] == "yes" ) {
  2613     if (dictionary["S60"] == "yes") {
  2606         qtConfig += "s60";
  2614         qtConfig += "s60";
  2607     }
  2615     }
  2608 
  2616 
  2609      if ( dictionary["DIRECTSHOW"] == "yes" )
  2617      if (dictionary["DIRECTSHOW"] == "yes")
  2610         qtConfig += "directshow";
  2618         qtConfig += "directshow";
  2611 
  2619 
  2612     if (dictionary[ "OPENSSL" ] == "yes")
  2620     if (dictionary[ "OPENSSL" ] == "yes")
  2613         qtConfig += "openssl";
  2621         qtConfig += "openssl";
  2614     else if (dictionary[ "OPENSSL" ] == "linked")
  2622     else if (dictionary[ "OPENSSL" ] == "linked")
  2664             dictionary[ "DONE" ] = "error";
  2672             dictionary[ "DONE" ] = "error";
  2665         }
  2673         }
  2666         qtConfig += "declarative";
  2674         qtConfig += "declarative";
  2667     }
  2675     }
  2668 
  2676 
  2669     if( dictionary[ "NATIVE_GESTURES" ] == "yes" )
  2677     if (dictionary[ "NATIVE_GESTURES" ] == "yes")
  2670         qtConfig += "native-gestures";
  2678         qtConfig += "native-gestures";
  2671 
  2679 
  2672     // We currently have no switch for QtSvg, so add it unconditionally.
  2680     // We currently have no switch for QtSvg, so add it unconditionally.
  2673     qtConfig += "svg";
  2681     qtConfig += "svg";
  2674 
  2682 
  2687             if (cfg == set_config)
  2695             if (cfg == set_config)
  2688                 break;
  2696                 break;
  2689         }
  2697         }
  2690     }
  2698     }
  2691 
  2699 
  2692     if (dictionary.contains("XQMAKESPEC") && ( dictionary["QMAKESPEC"] != dictionary["XQMAKESPEC"] ) )
  2700     if (dictionary.contains("XQMAKESPEC") && (dictionary["QMAKESPEC"] != dictionary["XQMAKESPEC"]))
  2693             qmakeConfig += "cross_compile";
  2701             qmakeConfig += "cross_compile";
  2694 
  2702 
  2695     // Directories and settings for .qmake.cache --------------------
  2703     // Directories and settings for .qmake.cache --------------------
  2696 
  2704 
  2697     // if QT_INSTALL_* have not been specified on commandline, define them now from QT_INSTALL_PREFIX
  2705     // if QT_INSTALL_* have not been specified on commandline, define them now from QT_INSTALL_PREFIX
  2698     // if prefix is empty (WINCE), make all of them empty, if they aren't set
  2706     // if prefix is empty (WINCE), make all of them empty, if they aren't set
  2699     bool qipempty = false;
  2707     bool qipempty = false;
  2700     if(dictionary[ "QT_INSTALL_PREFIX" ].isEmpty())
  2708     if (dictionary[ "QT_INSTALL_PREFIX" ].isEmpty())
  2701         qipempty = true;
  2709         qipempty = true;
  2702 
  2710 
  2703     if( !dictionary[ "QT_INSTALL_DOCS" ].size() )
  2711     if (!dictionary[ "QT_INSTALL_DOCS" ].size())
  2704         dictionary[ "QT_INSTALL_DOCS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/doc" );
  2712         dictionary[ "QT_INSTALL_DOCS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/doc");
  2705     if( !dictionary[ "QT_INSTALL_HEADERS" ].size() )
  2713     if (!dictionary[ "QT_INSTALL_HEADERS" ].size())
  2706         dictionary[ "QT_INSTALL_HEADERS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/include" );
  2714         dictionary[ "QT_INSTALL_HEADERS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/include");
  2707     if( !dictionary[ "QT_INSTALL_LIBS" ].size() )
  2715     if (!dictionary[ "QT_INSTALL_LIBS" ].size())
  2708         dictionary[ "QT_INSTALL_LIBS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/lib" );
  2716         dictionary[ "QT_INSTALL_LIBS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/lib");
  2709     if( !dictionary[ "QT_INSTALL_BINS" ].size() )
  2717     if (!dictionary[ "QT_INSTALL_BINS" ].size())
  2710         dictionary[ "QT_INSTALL_BINS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/bin" );
  2718         dictionary[ "QT_INSTALL_BINS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/bin");
  2711     if( !dictionary[ "QT_INSTALL_PLUGINS" ].size() )
  2719     if (!dictionary[ "QT_INSTALL_PLUGINS" ].size())
  2712         dictionary[ "QT_INSTALL_PLUGINS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/plugins" );
  2720         dictionary[ "QT_INSTALL_PLUGINS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/plugins");
  2713     if( !dictionary[ "QT_INSTALL_IMPORTS" ].size() )
  2721     if (!dictionary[ "QT_INSTALL_IMPORTS" ].size())
  2714         dictionary[ "QT_INSTALL_IMPORTS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/imports" );
  2722         dictionary[ "QT_INSTALL_IMPORTS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/imports");
  2715     if( !dictionary[ "QT_INSTALL_DATA" ].size() )
  2723     if (!dictionary[ "QT_INSTALL_DATA" ].size())
  2716         dictionary[ "QT_INSTALL_DATA" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] );
  2724         dictionary[ "QT_INSTALL_DATA" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ]);
  2717     if( !dictionary[ "QT_INSTALL_TRANSLATIONS" ].size() )
  2725     if (!dictionary[ "QT_INSTALL_TRANSLATIONS" ].size())
  2718         dictionary[ "QT_INSTALL_TRANSLATIONS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/translations" );
  2726         dictionary[ "QT_INSTALL_TRANSLATIONS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/translations");
  2719     if( !dictionary[ "QT_INSTALL_EXAMPLES" ].size() )
  2727     if (!dictionary[ "QT_INSTALL_EXAMPLES" ].size())
  2720         dictionary[ "QT_INSTALL_EXAMPLES" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/examples");
  2728         dictionary[ "QT_INSTALL_EXAMPLES" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/examples");
  2721     if( !dictionary[ "QT_INSTALL_DEMOS" ].size() )
  2729     if (!dictionary[ "QT_INSTALL_DEMOS" ].size())
  2722         dictionary[ "QT_INSTALL_DEMOS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/demos" );
  2730         dictionary[ "QT_INSTALL_DEMOS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/demos");
  2723 
  2731 
  2724     if(dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux"))
  2732     if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux"))
  2725         dictionary[ "QMAKE_RPATHDIR" ] = dictionary[ "QT_INSTALL_LIBS" ];
  2733         dictionary[ "QMAKE_RPATHDIR" ] = dictionary[ "QT_INSTALL_LIBS" ];
  2726 
  2734 
  2727     qmakeVars += QString("OBJECTS_DIR     = ") + fixSeparators( "tmp/obj/" + dictionary[ "QMAKE_OUTDIR" ] );
  2735     qmakeVars += QString("OBJECTS_DIR     = ") + fixSeparators("tmp/obj/" + dictionary[ "QMAKE_OUTDIR" ], true);
  2728     qmakeVars += QString("MOC_DIR         = ") + fixSeparators( "tmp/moc/" + dictionary[ "QMAKE_OUTDIR" ] );
  2736     qmakeVars += QString("MOC_DIR         = ") + fixSeparators("tmp/moc/" + dictionary[ "QMAKE_OUTDIR" ], true);
  2729     qmakeVars += QString("RCC_DIR         = ") + fixSeparators("tmp/rcc/" + dictionary["QMAKE_OUTDIR"]);
  2737     qmakeVars += QString("RCC_DIR         = ") + fixSeparators("tmp/rcc/" + dictionary["QMAKE_OUTDIR"], true);
  2730 
  2738 
  2731     if (!qmakeDefines.isEmpty())
  2739     if (!qmakeDefines.isEmpty())
  2732         qmakeVars += QString("DEFINES        += ") + qmakeDefines.join( " " );
  2740         qmakeVars += QString("DEFINES        += ") + qmakeDefines.join(" ");
  2733     if (!qmakeIncludes.isEmpty())
  2741     if (!qmakeIncludes.isEmpty())
  2734         qmakeVars += QString("INCLUDEPATH    += ") + qmakeIncludes.join( " " );
  2742         qmakeVars += QString("INCLUDEPATH    += ") + escapeSeparators(qmakeIncludes.join(" "));
  2735     if (!opensslLibs.isEmpty())
  2743     if (!opensslLibs.isEmpty())
  2736         qmakeVars += opensslLibs;
  2744         qmakeVars += opensslLibs;
  2737     else if (dictionary[ "OPENSSL" ] == "linked") {
  2745     else if (dictionary[ "OPENSSL" ] == "linked") {
  2738     	if(dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("symbian") )
  2746         if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("symbian"))
  2739             qmakeVars += QString("OPENSSL_LIBS    = -llibssl -llibcrypto");
  2747             qmakeVars += QString("OPENSSL_LIBS    = -llibssl -llibcrypto");
  2740         else
  2748         else
  2741             qmakeVars += QString("OPENSSL_LIBS    = -lssleay32 -llibeay32");
  2749             qmakeVars += QString("OPENSSL_LIBS    = -lssleay32 -llibeay32");
  2742         }
  2750         }
       
  2751     if (!psqlLibs.isEmpty())
       
  2752         qmakeVars += QString("QT_LFLAGS_PSQL=") + psqlLibs.section("=", 1);
  2743     if (!qmakeSql.isEmpty())
  2753     if (!qmakeSql.isEmpty())
  2744         qmakeVars += QString("sql-drivers    += ") + qmakeSql.join( " " );
  2754         qmakeVars += QString("sql-drivers    += ") + qmakeSql.join(" ");
  2745     if (!qmakeSqlPlugins.isEmpty())
  2755     if (!qmakeSqlPlugins.isEmpty())
  2746         qmakeVars += QString("sql-plugins    += ") + qmakeSqlPlugins.join( " " );
  2756         qmakeVars += QString("sql-plugins    += ") + qmakeSqlPlugins.join(" ");
  2747     if (!qmakeStyles.isEmpty())
  2757     if (!qmakeStyles.isEmpty())
  2748         qmakeVars += QString("styles         += ") + qmakeStyles.join( " " );
  2758         qmakeVars += QString("styles         += ") + qmakeStyles.join(" ");
  2749     if (!qmakeStylePlugins.isEmpty())
  2759     if (!qmakeStylePlugins.isEmpty())
  2750         qmakeVars += QString("style-plugins  += ") + qmakeStylePlugins.join( " " );
  2760         qmakeVars += QString("style-plugins  += ") + qmakeStylePlugins.join(" ");
  2751     if (!qmakeFormatPlugins.isEmpty())
  2761     if (!qmakeFormatPlugins.isEmpty())
  2752         qmakeVars += QString("imageformat-plugins += ") + qmakeFormatPlugins.join( " " );
  2762         qmakeVars += QString("imageformat-plugins += ") + qmakeFormatPlugins.join(" ");
  2753 
  2763 
  2754     if (dictionary["QMAKESPEC"].endsWith("-g++")) {
  2764     if (dictionary["QMAKESPEC"].endsWith("-g++")) {
  2755         QString includepath = qgetenv("INCLUDE");
  2765         QString includepath = qgetenv("INCLUDE");
  2756         bool hasSh = Environment::detectExecutable("sh.exe");
  2766         bool hasSh = Environment::detectExecutable("sh.exe");
  2757         QChar separator = (!includepath.contains(":\\") && hasSh ? QChar(':') : QChar(';'));
  2767         QChar separator = (!includepath.contains(":\\") && hasSh ? QChar(':') : QChar(';'));
  2759         qmakeVars += QString("QMAKE_INCDIR_POST += $$split(TMPPATH,\"%1\")").arg(separator);
  2769         qmakeVars += QString("QMAKE_INCDIR_POST += $$split(TMPPATH,\"%1\")").arg(separator);
  2760         qmakeVars += QString("TMPPATH            = $$quote($$(LIB))");
  2770         qmakeVars += QString("TMPPATH            = $$quote($$(LIB))");
  2761         qmakeVars += QString("QMAKE_LIBDIR_POST += $$split(TMPPATH,\"%1\")").arg(separator);
  2771         qmakeVars += QString("QMAKE_LIBDIR_POST += $$split(TMPPATH,\"%1\")").arg(separator);
  2762     }
  2772     }
  2763 
  2773 
  2764     if( !dictionary[ "QMAKESPEC" ].length() ) {
  2774     if (!dictionary[ "QMAKESPEC" ].length()) {
  2765         cout << "Configure could not detect your compiler. QMAKESPEC must either" << endl
  2775         cout << "Configure could not detect your compiler. QMAKESPEC must either" << endl
  2766              << "be defined as an environment variable, or specified as an" << endl
  2776              << "be defined as an environment variable, or specified as an" << endl
  2767              << "argument with -platform" << endl;
  2777              << "argument with -platform" << endl;
  2768         dictionary[ "HELP" ] = "yes";
  2778         dictionary[ "HELP" ] = "yes";
  2769 
  2779 
  2770         QStringList winPlatforms;
  2780         QStringList winPlatforms;
  2771         QDir mkspecsDir( sourcePath + "/mkspecs" );
  2781         QDir mkspecsDir(sourcePath + "/mkspecs");
  2772         const QFileInfoList &specsList = mkspecsDir.entryInfoList();
  2782         const QFileInfoList &specsList = mkspecsDir.entryInfoList();
  2773         for(int i = 0; i < specsList.size(); ++i) {
  2783         for (int i = 0; i < specsList.size(); ++i) {
  2774             const QFileInfo &fi = specsList.at(i);
  2784             const QFileInfo &fi = specsList.at(i);
  2775             if( fi.fileName().left( 5 ) == "win32" ) {
  2785             if (fi.fileName().left(5) == "win32") {
  2776                 winPlatforms += fi.fileName();
  2786                 winPlatforms += fi.fileName();
  2777             }
  2787             }
  2778         }
  2788         }
  2779         cout << "Available platforms are: " << qPrintable(winPlatforms.join( ", " )) << endl;
  2789         cout << "Available platforms are: " << qPrintable(winPlatforms.join(", ")) << endl;
  2780         dictionary[ "DONE" ] = "error";
  2790         dictionary[ "DONE" ] = "error";
  2781     }
  2791     }
  2782 }
  2792 }
  2783 
  2793 
  2784 #if !defined(EVAL)
  2794 #if !defined(EVAL)
  2785 void Configure::generateCachefile()
  2795 void Configure::generateCachefile()
  2786 {
  2796 {
  2787     // Generate .qmake.cache
  2797     // Generate .qmake.cache
  2788     QFile cacheFile( buildPath + "/.qmake.cache" );
  2798     QFile cacheFile(buildPath + "/.qmake.cache");
  2789     if( cacheFile.open( QFile::WriteOnly | QFile::Text ) ) { // Truncates any existing file.
  2799     if (cacheFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file.
  2790         QTextStream cacheStream( &cacheFile );
  2800         QTextStream cacheStream(&cacheFile);
  2791         for( QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var ) {
  2801         for (QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var) {
  2792             cacheStream << (*var) << endl;
  2802             cacheStream << (*var) << endl;
  2793         }
  2803         }
  2794         cacheStream << "CONFIG         += " << qmakeConfig.join( " " ) << " incremental create_prl link_prl depend_includepath QTDIR_build" << endl;
  2804         cacheStream << "CONFIG         += " << qmakeConfig.join(" ") << " incremental create_prl link_prl depend_includepath QTDIR_build" << endl;
  2795 
  2805 
  2796         QStringList buildParts;
  2806         QStringList buildParts;
  2797         buildParts << "libs" << "tools" << "examples" << "demos" << "docs" << "translations";
  2807         buildParts << "libs" << "tools" << "examples" << "demos" << "docs" << "translations";
  2798         foreach(QString item, disabledBuildParts) {
  2808         foreach(QString item, disabledBuildParts) {
  2799             buildParts.removeAll(item);
  2809             buildParts.removeAll(item);
  2800         }
  2810         }
  2801         cacheStream << "QT_BUILD_PARTS  = " << buildParts.join( " " ) << endl;
  2811         cacheStream << "QT_BUILD_PARTS  = " << buildParts.join(" ") << endl;
  2802 
  2812 
  2803         QString targetSpec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ];
  2813         QString targetSpec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ];
  2804         QString mkspec_path = fixSeparators(sourcePath + "/mkspecs/" + targetSpec);
  2814         QString mkspec_path = fixSeparators(sourcePath + "/mkspecs/" + targetSpec);
  2805         if(QFile::exists(mkspec_path))
  2815         if (QFile::exists(mkspec_path))
  2806             cacheStream << "QMAKESPEC       = " << mkspec_path << endl;
  2816             cacheStream << "QMAKESPEC       = " << escapeSeparators(mkspec_path) << endl;
  2807         else
  2817         else
  2808             cacheStream << "QMAKESPEC       = " << fixSeparators(targetSpec) << endl;
  2818             cacheStream << "QMAKESPEC       = " << fixSeparators(targetSpec, true) << endl;
  2809         cacheStream << "ARCH            = " << fixSeparators(dictionary[ "ARCHITECTURE" ]) << endl;
  2819         cacheStream << "ARCH            = " << dictionary[ "ARCHITECTURE" ] << endl;
  2810         cacheStream << "QT_BUILD_TREE   = " << fixSeparators(dictionary[ "QT_BUILD_TREE" ]) << endl;
  2820         cacheStream << "QT_BUILD_TREE   = " << fixSeparators(dictionary[ "QT_BUILD_TREE" ], true) << endl;
  2811         cacheStream << "QT_SOURCE_TREE  = " << fixSeparators(dictionary[ "QT_SOURCE_TREE" ]) << endl;
  2821         cacheStream << "QT_SOURCE_TREE  = " << fixSeparators(dictionary[ "QT_SOURCE_TREE" ], true) << endl;
  2812 
  2822 
  2813         if (dictionary["QT_EDITION"] != "QT_EDITION_OPENSOURCE")
  2823         if (dictionary["QT_EDITION"] != "QT_EDITION_OPENSOURCE")
  2814             cacheStream << "DEFINES        *= QT_EDITION=QT_EDITION_DESKTOP" << endl;
  2824             cacheStream << "DEFINES        *= QT_EDITION=QT_EDITION_DESKTOP" << endl;
  2815 
  2825 
  2816         //so that we can build without an install first (which would be impossible)
  2826         //so that we can build without an install first (which would be impossible)
  2817         cacheStream << "QMAKE_MOC       = $$QT_BUILD_TREE" << fixSeparators("/bin/moc.exe") << endl;
  2827         cacheStream << "QMAKE_MOC       = $$QT_BUILD_TREE" << fixSeparators("/bin/moc.exe", true) << endl;
  2818         cacheStream << "QMAKE_UIC       = $$QT_BUILD_TREE" << fixSeparators("/bin/uic.exe") << endl;
  2828         cacheStream << "QMAKE_UIC       = $$QT_BUILD_TREE" << fixSeparators("/bin/uic.exe", true) << endl;
  2819         cacheStream << "QMAKE_UIC3      = $$QT_BUILD_TREE" << fixSeparators("/bin/uic3.exe") << endl;
  2829         cacheStream << "QMAKE_UIC3      = $$QT_BUILD_TREE" << fixSeparators("/bin/uic3.exe", true) << endl;
  2820         cacheStream << "QMAKE_RCC       = $$QT_BUILD_TREE" << fixSeparators("/bin/rcc.exe") << endl;
  2830         cacheStream << "QMAKE_RCC       = $$QT_BUILD_TREE" << fixSeparators("/bin/rcc.exe", true) << endl;
  2821         cacheStream << "QMAKE_DUMPCPP   = $$QT_BUILD_TREE" << fixSeparators("/bin/dumpcpp.exe") << endl;
  2831         cacheStream << "QMAKE_DUMPCPP   = $$QT_BUILD_TREE" << fixSeparators("/bin/dumpcpp.exe", true) << endl;
  2822         cacheStream << "QMAKE_INCDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/include") << endl;
  2832         cacheStream << "QMAKE_INCDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/include", true) << endl;
  2823         cacheStream << "QMAKE_LIBDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/lib") << endl;
  2833         cacheStream << "QMAKE_LIBDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/lib", true) << endl;
  2824         if (dictionary["CETEST"] == "yes") {
  2834         if (dictionary["CETEST"] == "yes") {
  2825             cacheStream << "QT_CE_RAPI_INC  = " << fixSeparators(dictionary[ "QT_CE_RAPI_INC" ]) << endl;
  2835             cacheStream << "QT_CE_RAPI_INC  = " << fixSeparators(dictionary[ "QT_CE_RAPI_INC" ], true) << endl;
  2826             cacheStream << "QT_CE_RAPI_LIB  = " << fixSeparators(dictionary[ "QT_CE_RAPI_LIB" ]) << endl;
  2836             cacheStream << "QT_CE_RAPI_LIB  = " << fixSeparators(dictionary[ "QT_CE_RAPI_LIB" ], true) << endl;
  2827         }
  2837         }
  2828 
  2838 
  2829         // embedded
  2839         // embedded
  2830         if( !dictionary["KBD_DRIVERS"].isEmpty())
  2840         if (!dictionary["KBD_DRIVERS"].isEmpty())
  2831             cacheStream << "kbd-drivers += "<< dictionary["KBD_DRIVERS"]<<endl;
  2841             cacheStream << "kbd-drivers += "<< dictionary["KBD_DRIVERS"]<<endl;
  2832         if( !dictionary["GFX_DRIVERS"].isEmpty())
  2842         if (!dictionary["GFX_DRIVERS"].isEmpty())
  2833             cacheStream << "gfx-drivers += "<< dictionary["GFX_DRIVERS"]<<endl;
  2843             cacheStream << "gfx-drivers += "<< dictionary["GFX_DRIVERS"]<<endl;
  2834         if( !dictionary["MOUSE_DRIVERS"].isEmpty())
  2844         if (!dictionary["MOUSE_DRIVERS"].isEmpty())
  2835             cacheStream << "mouse-drivers += "<< dictionary["MOUSE_DRIVERS"]<<endl;
  2845             cacheStream << "mouse-drivers += "<< dictionary["MOUSE_DRIVERS"]<<endl;
  2836         if( !dictionary["DECORATIONS"].isEmpty())
  2846         if (!dictionary["DECORATIONS"].isEmpty())
  2837             cacheStream << "decorations += "<<dictionary["DECORATIONS"]<<endl;
  2847             cacheStream << "decorations += "<<dictionary["DECORATIONS"]<<endl;
  2838 
  2848 
  2839         if( !dictionary["QMAKE_RPATHDIR"].isEmpty() )
  2849         if (!dictionary["QMAKE_RPATHDIR"].isEmpty())
  2840             cacheStream << "QMAKE_RPATHDIR += "<<dictionary["QMAKE_RPATHDIR"];
  2850             cacheStream << "QMAKE_RPATHDIR += "<<dictionary["QMAKE_RPATHDIR"];
  2841 
  2851 
  2842         cacheStream.flush();
  2852         cacheStream.flush();
  2843         cacheFile.close();
  2853         cacheFile.close();
  2844     }
  2854     }
  2845     QFile configFile( dictionary[ "QT_BUILD_TREE" ] + "/mkspecs/qconfig.pri" );
  2855     QFile configFile(dictionary[ "QT_BUILD_TREE" ] + "/mkspecs/qconfig.pri");
  2846     if( configFile.open( QFile::WriteOnly | QFile::Text ) ) { // Truncates any existing file.
  2856     if (configFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file.
  2847         QTextStream configStream( &configFile );
  2857         QTextStream configStream(&configFile);
  2848         configStream << "CONFIG+= ";
  2858         configStream << "CONFIG+= ";
  2849         configStream << dictionary[ "BUILD" ];
  2859         configStream << dictionary[ "BUILD" ];
  2850         if( dictionary[ "SHARED" ] == "yes" )
  2860         if (dictionary[ "SHARED" ] == "yes")
  2851             configStream << " shared";
  2861             configStream << " shared";
  2852         else
  2862         else
  2853             configStream << " static";
  2863             configStream << " static";
  2854 
  2864 
  2855         if( dictionary[ "LTCG" ] == "yes" )
  2865         if (dictionary[ "LTCG" ] == "yes")
  2856             configStream << " ltcg";
  2866             configStream << " ltcg";
  2857         if( dictionary[ "STL" ] == "yes" )
  2867         if (dictionary[ "STL" ] == "yes")
  2858             configStream << " stl";
  2868             configStream << " stl";
  2859         if ( dictionary[ "EXCEPTIONS" ] == "yes" )
  2869         if (dictionary[ "EXCEPTIONS" ] == "yes")
  2860             configStream << " exceptions";
  2870             configStream << " exceptions";
  2861         if ( dictionary[ "EXCEPTIONS" ] == "no" )
  2871         if (dictionary[ "EXCEPTIONS" ] == "no")
  2862             configStream << " exceptions_off";
  2872             configStream << " exceptions_off";
  2863         if ( dictionary[ "RTTI" ] == "yes" )
  2873         if (dictionary[ "RTTI" ] == "yes")
  2864             configStream << " rtti";
  2874             configStream << " rtti";
  2865         if ( dictionary[ "MMX" ] == "yes" )
  2875         if (dictionary[ "MMX" ] == "yes")
  2866             configStream << " mmx";
  2876             configStream << " mmx";
  2867         if ( dictionary[ "3DNOW" ] == "yes" )
  2877         if (dictionary[ "3DNOW" ] == "yes")
  2868             configStream << " 3dnow";
  2878             configStream << " 3dnow";
  2869         if ( dictionary[ "SSE" ] == "yes" )
  2879         if (dictionary[ "SSE" ] == "yes")
  2870             configStream << " sse";
  2880             configStream << " sse";
  2871         if ( dictionary[ "SSE2" ] == "yes" )
  2881         if (dictionary[ "SSE2" ] == "yes")
  2872             configStream << " sse2";
  2882             configStream << " sse2";
  2873         if ( dictionary[ "IWMMXT" ] == "yes" )
  2883         if (dictionary[ "IWMMXT" ] == "yes")
  2874             configStream << " iwmmxt";
  2884             configStream << " iwmmxt";
  2875         if ( dictionary["INCREDIBUILD_XGE"] == "yes" )
  2885         if (dictionary["INCREDIBUILD_XGE"] == "yes")
  2876             configStream << " incredibuild_xge";
  2886             configStream << " incredibuild_xge";
  2877         if ( dictionary["PLUGIN_MANIFESTS"] == "no" )
  2887         if (dictionary["PLUGIN_MANIFESTS"] == "no")
  2878             configStream << " no_plugin_manifest";
  2888             configStream << " no_plugin_manifest";
  2879 
  2889 
  2880         if ( dictionary.contains("SYMBIAN_DEFFILES") ) {
  2890         if (dictionary.contains("SYMBIAN_DEFFILES")) {
  2881             if(dictionary["SYMBIAN_DEFFILES"] == "yes" ) {
  2891             if (dictionary["SYMBIAN_DEFFILES"] == "yes") {
  2882                 configStream << " def_files";
  2892                 configStream << " def_files";
  2883             } else if ( dictionary["SYMBIAN_DEFFILES"] == "no" ) {
  2893             } else if (dictionary["SYMBIAN_DEFFILES"] == "no") {
  2884                 configStream << " def_files_disabled";
  2894                 configStream << " def_files_disabled";
  2885             }
  2895             }
  2886         }
  2896         }
  2887         configStream << endl;
  2897         configStream << endl;
  2888         configStream << "QT_ARCH = " << dictionary[ "ARCHITECTURE" ] << endl;
  2898         configStream << "QT_ARCH = " << dictionary[ "ARCHITECTURE" ] << endl;
  2897                      << "QT_MAJOR_VERSION = " << dictionary["VERSION_MAJOR"] << endl
  2907                      << "QT_MAJOR_VERSION = " << dictionary["VERSION_MAJOR"] << endl
  2898                      << "QT_MINOR_VERSION = " << dictionary["VERSION_MINOR"] << endl
  2908                      << "QT_MINOR_VERSION = " << dictionary["VERSION_MINOR"] << endl
  2899                      << "QT_PATCH_VERSION = " << dictionary["VERSION_PATCH"] << endl;
  2909                      << "QT_PATCH_VERSION = " << dictionary["VERSION_PATCH"] << endl;
  2900 
  2910 
  2901         configStream << "#Qt for Windows CE c-runtime deployment" << endl
  2911         configStream << "#Qt for Windows CE c-runtime deployment" << endl
  2902                      << "QT_CE_C_RUNTIME = " << fixSeparators(dictionary[ "CE_CRT" ]) << endl;
  2912                      << "QT_CE_C_RUNTIME = " << fixSeparators(dictionary[ "CE_CRT" ], true) << endl;
  2903 
  2913 
  2904         if(dictionary["CE_SIGNATURE"] != QLatin1String("no"))
  2914         if (dictionary["CE_SIGNATURE"] != QLatin1String("no"))
  2905             configStream << "DEFAULT_SIGNATURE=" << dictionary["CE_SIGNATURE"] << endl;
  2915             configStream << "DEFAULT_SIGNATURE=" << dictionary["CE_SIGNATURE"] << endl;
  2906 
  2916 
  2907         if(!dictionary["QMAKE_RPATHDIR"].isEmpty())
  2917         if (!dictionary["QMAKE_RPATHDIR"].isEmpty())
  2908             configStream << "QMAKE_RPATHDIR += " << dictionary["QMAKE_RPATHDIR"] << endl;
  2918             configStream << "QMAKE_RPATHDIR += " << dictionary["QMAKE_RPATHDIR"] << endl;
  2909 
  2919 
  2910         if (!dictionary["QT_LIBINFIX"].isEmpty())
  2920         if (!dictionary["QT_LIBINFIX"].isEmpty())
  2911             configStream << "QT_LIBINFIX = " << dictionary["QT_LIBINFIX"] << endl;
  2921             configStream << "QT_LIBINFIX = " << dictionary["QT_LIBINFIX"] << endl;
  2912 
  2922 
  2913         configStream << "#Qt for Symbian FPU settings" << endl;
  2923         configStream << "#Qt for Symbian FPU settings" << endl;
  2914         if(!dictionary["ARM_FPU_TYPE"].isEmpty()) {
  2924         if (!dictionary["ARM_FPU_TYPE"].isEmpty()) {
  2915             configStream<<"MMP_RULES += \"ARMFPU "<< dictionary["ARM_FPU_TYPE"]<< "\"";
  2925             configStream<<"MMP_RULES += \"ARMFPU "<< dictionary["ARM_FPU_TYPE"]<< "\"";
  2916         }
  2926         }
  2917         if (!dictionary["QT_NAMESPACE"].isEmpty()) {
  2927         if (!dictionary["QT_NAMESPACE"].isEmpty()) {
  2918             configStream << "#namespaces" << endl << "QT_NAMESPACE = " << dictionary["QT_NAMESPACE"] << endl;
  2928             configStream << "#namespaces" << endl << "QT_NAMESPACE = " << dictionary["QT_NAMESPACE"] << endl;
  2919         }
  2929         }
  2920 
  2930 
       
  2931         configStream << "#modules" << endl << "for(mod,$$list($$files($$[QMAKE_MKSPECS]/modules/qt_*.pri))):include($$mod)" << endl;
       
  2932 
  2921         configStream.flush();
  2933         configStream.flush();
  2922         configFile.close();
  2934         configFile.close();
  2923     }
  2935     }
  2924 }
  2936 }
  2925 #endif
  2937 #endif
  2929     QString result, defNeg, defD = def;
  2941     QString result, defNeg, defD = def;
  2930 
  2942 
  2931     defD.replace(QRegExp("=.*"), "");
  2943     defD.replace(QRegExp("=.*"), "");
  2932     def.replace(QRegExp("="), " ");
  2944     def.replace(QRegExp("="), " ");
  2933 
  2945 
  2934     if(def.startsWith("QT_NO_")) {
  2946     if (def.startsWith("QT_NO_")) {
  2935         defNeg = defD;
  2947         defNeg = defD;
  2936         defNeg.replace("QT_NO_", "QT_");
  2948         defNeg.replace("QT_NO_", "QT_");
  2937     } else if(def.startsWith("QT_")) {
  2949     } else if (def.startsWith("QT_")) {
  2938         defNeg = defD;
  2950         defNeg = defD;
  2939         defNeg.replace("QT_", "QT_NO_");
  2951         defNeg.replace("QT_", "QT_NO_");
  2940     }
  2952     }
  2941 
  2953 
  2942     if (defNeg.isEmpty()) {
  2954     if (defNeg.isEmpty()) {
  2958 
  2970 
  2959 #if !defined(EVAL)
  2971 #if !defined(EVAL)
  2960 void Configure::generateConfigfiles()
  2972 void Configure::generateConfigfiles()
  2961 {
  2973 {
  2962     QDir(buildPath).mkpath("src/corelib/global");
  2974     QDir(buildPath).mkpath("src/corelib/global");
  2963     QString outName( buildPath + "/src/corelib/global/qconfig.h" );
  2975     QString outName(buildPath + "/src/corelib/global/qconfig.h");
  2964     QTemporaryFile tmpFile;
  2976     QTemporaryFile tmpFile;
  2965     QTextStream tmpStream;
  2977     QTextStream tmpStream;
  2966 
  2978 
  2967     if(tmpFile.open()) {
  2979     if (tmpFile.open()) {
  2968         tmpStream.setDevice(&tmpFile);
  2980         tmpStream.setDevice(&tmpFile);
  2969 
  2981 
  2970         if( dictionary[ "QCONFIG" ] == "full" ) {
  2982         if (dictionary[ "QCONFIG" ] == "full") {
  2971             tmpStream << "/* Everything */" << endl;
  2983             tmpStream << "/* Everything */" << endl;
  2972         } else {
  2984         } else {
  2973             QString configName( "qconfig-" + dictionary[ "QCONFIG" ] + ".h" );
  2985             QString configName("qconfig-" + dictionary[ "QCONFIG" ] + ".h");
  2974             tmpStream << "/* Copied from " << configName << "*/" << endl;
  2986             tmpStream << "/* Copied from " << configName << "*/" << endl;
  2975             tmpStream << "#ifndef QT_BOOTSTRAPPED" << endl;
  2987             tmpStream << "#ifndef QT_BOOTSTRAPPED" << endl;
  2976             QFile inFile( sourcePath + "/src/corelib/global/" + configName );
  2988             QFile inFile(sourcePath + "/src/corelib/global/" + configName);
  2977             if( inFile.open( QFile::ReadOnly ) ) {
  2989             if (inFile.open(QFile::ReadOnly)) {
  2978                 QByteArray buffer = inFile.readAll();
  2990                 QByteArray buffer = inFile.readAll();
  2979                 tmpFile.write( buffer.constData(), buffer.size() );
  2991                 tmpFile.write(buffer.constData(), buffer.size());
  2980                 inFile.close();
  2992                 inFile.close();
  2981             }
  2993             }
  2982             tmpStream << "#endif // QT_BOOTSTRAPPED" << endl;
  2994             tmpStream << "#endif // QT_BOOTSTRAPPED" << endl;
  2983         }
  2995         }
  2984         tmpStream << endl;
  2996         tmpStream << endl;
  2985 
  2997 
  2986         if( dictionary[ "SHARED" ] == "yes" ) {
  2998         if (dictionary[ "SHARED" ] == "yes") {
  2987             tmpStream << "#ifndef QT_DLL" << endl;
  2999             tmpStream << "#ifndef QT_DLL" << endl;
  2988             tmpStream << "#define QT_DLL" << endl;
  3000             tmpStream << "#define QT_DLL" << endl;
  2989             tmpStream << "#endif" << endl;
  3001             tmpStream << "#endif" << endl;
  2990         }
  3002         }
  2991         tmpStream << endl;
  3003         tmpStream << endl;
  3007             tmpStream << endl;
  3019             tmpStream << endl;
  3008         }
  3020         }
  3009         tmpStream << "/* Machine byte-order */" << endl;
  3021         tmpStream << "/* Machine byte-order */" << endl;
  3010         tmpStream << "#define Q_BIG_ENDIAN 4321" << endl;
  3022         tmpStream << "#define Q_BIG_ENDIAN 4321" << endl;
  3011         tmpStream << "#define Q_LITTLE_ENDIAN 1234" << endl;
  3023         tmpStream << "#define Q_LITTLE_ENDIAN 1234" << endl;
  3012         if ( QSysInfo::ByteOrder == QSysInfo::BigEndian )
  3024         if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
  3013             tmpStream << "#define Q_BYTE_ORDER Q_BIG_ENDIAN" << endl;
  3025             tmpStream << "#define Q_BYTE_ORDER Q_BIG_ENDIAN" << endl;
  3014         else
  3026         else
  3015             tmpStream << "#define Q_BYTE_ORDER Q_LITTLE_ENDIAN" << endl;
  3027             tmpStream << "#define Q_BYTE_ORDER Q_LITTLE_ENDIAN" << endl;
  3016 
  3028 
  3017         tmpStream << endl << "// Compile time features" << endl;
  3029         tmpStream << endl << "// Compile time features" << endl;
  3018         tmpStream << "#define QT_ARCH_" << dictionary["ARCHITECTURE"].toUpper() << endl;
  3030         tmpStream << "#define QT_ARCH_" << dictionary["ARCHITECTURE"].toUpper() << endl;
  3019         QStringList qconfigList;
  3031         QStringList qconfigList;
  3020         if(dictionary["STL"] == "no")                qconfigList += "QT_NO_STL";
  3032         if (dictionary["STL"] == "no")                qconfigList += "QT_NO_STL";
  3021         if(dictionary["STYLE_WINDOWS"] != "yes")     qconfigList += "QT_NO_STYLE_WINDOWS";
  3033         if (dictionary["STYLE_WINDOWS"] != "yes")     qconfigList += "QT_NO_STYLE_WINDOWS";
  3022         if(dictionary["STYLE_PLASTIQUE"] != "yes")   qconfigList += "QT_NO_STYLE_PLASTIQUE";
  3034         if (dictionary["STYLE_PLASTIQUE"] != "yes")   qconfigList += "QT_NO_STYLE_PLASTIQUE";
  3023         if(dictionary["STYLE_CLEANLOOKS"] != "yes")   qconfigList += "QT_NO_STYLE_CLEANLOOKS";
  3035         if (dictionary["STYLE_CLEANLOOKS"] != "yes")   qconfigList += "QT_NO_STYLE_CLEANLOOKS";
  3024         if(dictionary["STYLE_WINDOWSXP"] != "yes" && dictionary["STYLE_WINDOWSVISTA"] != "yes")
  3036         if (dictionary["STYLE_WINDOWSXP"] != "yes" && dictionary["STYLE_WINDOWSVISTA"] != "yes")
  3025             qconfigList += "QT_NO_STYLE_WINDOWSXP";
  3037             qconfigList += "QT_NO_STYLE_WINDOWSXP";
  3026         if(dictionary["STYLE_WINDOWSVISTA"] != "yes")   qconfigList += "QT_NO_STYLE_WINDOWSVISTA";
  3038         if (dictionary["STYLE_WINDOWSVISTA"] != "yes")   qconfigList += "QT_NO_STYLE_WINDOWSVISTA";
  3027         if(dictionary["STYLE_MOTIF"] != "yes")       qconfigList += "QT_NO_STYLE_MOTIF";
  3039         if (dictionary["STYLE_MOTIF"] != "yes")       qconfigList += "QT_NO_STYLE_MOTIF";
  3028         if(dictionary["STYLE_CDE"] != "yes")         qconfigList += "QT_NO_STYLE_CDE";
  3040         if (dictionary["STYLE_CDE"] != "yes")         qconfigList += "QT_NO_STYLE_CDE";
  3029         if(dictionary["STYLE_S60"] != "yes")         qconfigList += "QT_NO_STYLE_S60";
  3041         if (dictionary["STYLE_S60"] != "yes")         qconfigList += "QT_NO_STYLE_S60";
  3030         if(dictionary["STYLE_WINDOWSCE"] != "yes")   qconfigList += "QT_NO_STYLE_WINDOWSCE";
  3042         if (dictionary["STYLE_WINDOWSCE"] != "yes")   qconfigList += "QT_NO_STYLE_WINDOWSCE";
  3031         if(dictionary["STYLE_WINDOWSMOBILE"] != "yes")   qconfigList += "QT_NO_STYLE_WINDOWSMOBILE";
  3043         if (dictionary["STYLE_WINDOWSMOBILE"] != "yes")   qconfigList += "QT_NO_STYLE_WINDOWSMOBILE";
  3032         if(dictionary["STYLE_GTK"] != "yes")         qconfigList += "QT_NO_STYLE_GTK";
  3044         if (dictionary["STYLE_GTK"] != "yes")         qconfigList += "QT_NO_STYLE_GTK";
  3033 
  3045 
  3034         if(dictionary["GIF"] == "yes")              qconfigList += "QT_BUILTIN_GIF_READER=1";
  3046         if (dictionary["GIF"] == "yes")              qconfigList += "QT_BUILTIN_GIF_READER=1";
  3035         if(dictionary["PNG"] == "no")               qconfigList += "QT_NO_IMAGEFORMAT_PNG";
  3047         if (dictionary["PNG"] != "yes")              qconfigList += "QT_NO_IMAGEFORMAT_PNG";
  3036         if(dictionary["MNG"] == "no")               qconfigList += "QT_NO_IMAGEFORMAT_MNG";
  3048         if (dictionary["MNG"] != "yes")              qconfigList += "QT_NO_IMAGEFORMAT_MNG";
  3037         if(dictionary["JPEG"] == "no")              qconfigList += "QT_NO_IMAGEFORMAT_JPEG";
  3049         if (dictionary["JPEG"] != "yes")             qconfigList += "QT_NO_IMAGEFORMAT_JPEG";
  3038         if(dictionary["TIFF"] == "no")              qconfigList += "QT_NO_IMAGEFORMAT_TIFF";
  3050         if (dictionary["TIFF"] != "yes")             qconfigList += "QT_NO_IMAGEFORMAT_TIFF";
  3039         if(dictionary["ZLIB"] == "no") {
  3051         if (dictionary["ZLIB"] == "no") {
  3040             qconfigList += "QT_NO_ZLIB";
  3052             qconfigList += "QT_NO_ZLIB";
  3041             qconfigList += "QT_NO_COMPRESS";
  3053             qconfigList += "QT_NO_COMPRESS";
  3042         }
  3054         }
  3043 
  3055 
  3044         if(dictionary["ACCESSIBILITY"] == "no")     qconfigList += "QT_NO_ACCESSIBILITY";
  3056         if (dictionary["ACCESSIBILITY"] == "no")     qconfigList += "QT_NO_ACCESSIBILITY";
  3045         if(dictionary["EXCEPTIONS"] == "no")        qconfigList += "QT_NO_EXCEPTIONS";
  3057         if (dictionary["EXCEPTIONS"] == "no")        qconfigList += "QT_NO_EXCEPTIONS";
  3046         if(dictionary["OPENGL"] == "no")            qconfigList += "QT_NO_OPENGL";
  3058         if (dictionary["OPENGL"] == "no")            qconfigList += "QT_NO_OPENGL";
  3047         if(dictionary["OPENVG"] == "no")            qconfigList += "QT_NO_OPENVG";
  3059         if (dictionary["OPENVG"] == "no")            qconfigList += "QT_NO_OPENVG";
  3048         if(dictionary["OPENSSL"] == "no")           qconfigList += "QT_NO_OPENSSL";
  3060         if (dictionary["OPENSSL"] == "no")           qconfigList += "QT_NO_OPENSSL";
  3049         if(dictionary["OPENSSL"] == "linked")       qconfigList += "QT_LINKED_OPENSSL";
  3061         if (dictionary["OPENSSL"] == "linked")       qconfigList += "QT_LINKED_OPENSSL";
  3050         if(dictionary["DBUS"] == "no")              qconfigList += "QT_NO_DBUS";
  3062         if (dictionary["DBUS"] == "no")              qconfigList += "QT_NO_DBUS";
  3051         if(dictionary["IPV6"] == "no")              qconfigList += "QT_NO_IPV6";
  3063         if (dictionary["IPV6"] == "no")              qconfigList += "QT_NO_IPV6";
  3052         if(dictionary["WEBKIT"] == "no")            qconfigList += "QT_NO_WEBKIT";
  3064         if (dictionary["WEBKIT"] == "no")            qconfigList += "QT_NO_WEBKIT";
  3053         if(dictionary["DECLARATIVE"] == "no")       qconfigList += "QT_NO_DECLARATIVE";
  3065         if (dictionary["DECLARATIVE"] == "no")       qconfigList += "QT_NO_DECLARATIVE";
  3054         if(dictionary["PHONON"] == "no")            qconfigList += "QT_NO_PHONON";
  3066         if (dictionary["PHONON"] == "no")            qconfigList += "QT_NO_PHONON";
  3055         if(dictionary["MULTIMEDIA"] == "no")        qconfigList += "QT_NO_MULTIMEDIA";
  3067         if (dictionary["MULTIMEDIA"] == "no")        qconfigList += "QT_NO_MULTIMEDIA";
  3056         if(dictionary["XMLPATTERNS"] == "no")       qconfigList += "QT_NO_XMLPATTERNS";
  3068         if (dictionary["XMLPATTERNS"] == "no")       qconfigList += "QT_NO_XMLPATTERNS";
  3057         if(dictionary["SCRIPT"] == "no")            qconfigList += "QT_NO_SCRIPT";
  3069         if (dictionary["SCRIPT"] == "no")            qconfigList += "QT_NO_SCRIPT";
  3058         if(dictionary["SCRIPTTOOLS"] == "no")       qconfigList += "QT_NO_SCRIPTTOOLS";
  3070         if (dictionary["SCRIPTTOOLS"] == "no")       qconfigList += "QT_NO_SCRIPTTOOLS";
  3059         if(dictionary["FREETYPE"] == "no")          qconfigList += "QT_NO_FREETYPE";
  3071         if (dictionary["FREETYPE"] == "no")          qconfigList += "QT_NO_FREETYPE";
  3060         if(dictionary["S60"] == "no")               qconfigList += "QT_NO_S60";
  3072         if (dictionary["S60"] == "no")               qconfigList += "QT_NO_S60";
  3061         if(dictionary["NATIVE_GESTURES"] == "no")   qconfigList += "QT_NO_NATIVE_GESTURES";
  3073         if (dictionary["NATIVE_GESTURES"] == "no")   qconfigList += "QT_NO_NATIVE_GESTURES";
  3062 
  3074 
  3063         if(dictionary["OPENGL_ES_CM"] == "no" &&
  3075         if (dictionary["OPENGL_ES_CM"] == "no" &&
  3064            dictionary["OPENGL_ES_2"]  == "no" &&
  3076            dictionary["OPENGL_ES_2"]  == "no" &&
  3065            dictionary["OPENVG"]       == "no")      qconfigList += "QT_NO_EGL";
  3077            dictionary["OPENVG"]       == "no")      qconfigList += "QT_NO_EGL";
  3066 
  3078 
  3067         if(dictionary["OPENGL_ES_CM"] == "yes" ||
  3079         if (dictionary["OPENGL_ES_CM"] == "yes" ||
  3068            dictionary["OPENGL_ES_2"]  == "yes")     qconfigList += "QT_OPENGL_ES";
  3080            dictionary["OPENGL_ES_2"]  == "yes")     qconfigList += "QT_OPENGL_ES";
  3069 
  3081 
  3070         if(dictionary["OPENGL_ES_CM"] == "yes")     qconfigList += "QT_OPENGL_ES_1";
  3082         if (dictionary["OPENGL_ES_CM"] == "yes")     qconfigList += "QT_OPENGL_ES_1";
  3071         if(dictionary["OPENGL_ES_2"]  == "yes")     qconfigList += "QT_OPENGL_ES_2";
  3083         if (dictionary["OPENGL_ES_2"]  == "yes")     qconfigList += "QT_OPENGL_ES_2";
  3072         if(dictionary["SQL_MYSQL"] == "yes")        qconfigList += "QT_SQL_MYSQL";
  3084         if (dictionary["SQL_MYSQL"] == "yes")        qconfigList += "QT_SQL_MYSQL";
  3073         if(dictionary["SQL_ODBC"] == "yes")         qconfigList += "QT_SQL_ODBC";
  3085         if (dictionary["SQL_ODBC"] == "yes")         qconfigList += "QT_SQL_ODBC";
  3074         if(dictionary["SQL_OCI"] == "yes")          qconfigList += "QT_SQL_OCI";
  3086         if (dictionary["SQL_OCI"] == "yes")          qconfigList += "QT_SQL_OCI";
  3075         if(dictionary["SQL_PSQL"] == "yes")         qconfigList += "QT_SQL_PSQL";
  3087         if (dictionary["SQL_PSQL"] == "yes")         qconfigList += "QT_SQL_PSQL";
  3076         if(dictionary["SQL_TDS"] == "yes")          qconfigList += "QT_SQL_TDS";
  3088         if (dictionary["SQL_TDS"] == "yes")          qconfigList += "QT_SQL_TDS";
  3077         if(dictionary["SQL_DB2"] == "yes")          qconfigList += "QT_SQL_DB2";
  3089         if (dictionary["SQL_DB2"] == "yes")          qconfigList += "QT_SQL_DB2";
  3078         if(dictionary["SQL_SQLITE"] == "yes")       qconfigList += "QT_SQL_SQLITE";
  3090         if (dictionary["SQL_SQLITE"] == "yes")       qconfigList += "QT_SQL_SQLITE";
  3079         if(dictionary["SQL_SQLITE2"] == "yes")      qconfigList += "QT_SQL_SQLITE2";
  3091         if (dictionary["SQL_SQLITE2"] == "yes")      qconfigList += "QT_SQL_SQLITE2";
  3080         if(dictionary["SQL_IBASE"] == "yes")        qconfigList += "QT_SQL_IBASE";
  3092         if (dictionary["SQL_IBASE"] == "yes")        qconfigList += "QT_SQL_IBASE";
  3081 
  3093 
  3082         if (dictionary["GRAPHICS_SYSTEM"] == "openvg") qconfigList += "QT_GRAPHICSSYSTEM_OPENVG";
  3094         if (dictionary["GRAPHICS_SYSTEM"] == "openvg")  qconfigList += "QT_GRAPHICSSYSTEM_OPENVG";
  3083         if (dictionary["GRAPHICS_SYSTEM"] == "opengl") qconfigList += "QT_GRAPHICSSYSTEM_OPENGL";
  3095         if (dictionary["GRAPHICS_SYSTEM"] == "opengl")  qconfigList += "QT_GRAPHICSSYSTEM_OPENGL";
  3084         if (dictionary["GRAPHICS_SYSTEM"] == "raster") qconfigList += "QT_GRAPHICSSYSTEM_RASTER";
  3096         if (dictionary["GRAPHICS_SYSTEM"] == "raster")  qconfigList += "QT_GRAPHICSSYSTEM_RASTER";
       
  3097         if (dictionary["GRAPHICS_SYSTEM"] == "runtime") qconfigList += "QT_GRAPHICSSYSTEM_RUNTIME";
  3085 
  3098 
  3086         if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
  3099         if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
  3087             // These features are not ported to Symbian (yet)
  3100             // These features are not ported to Symbian (yet)
  3088             qconfigList += "QT_NO_CONCURRENT";
  3101             qconfigList += "QT_NO_CONCURRENT";
  3089             qconfigList += "QT_NO_QFUTURE";
  3102             qconfigList += "QT_NO_QFUTURE";
  3096 
  3109 
  3097         qconfigList.sort();
  3110         qconfigList.sort();
  3098         for (int i = 0; i < qconfigList.count(); ++i)
  3111         for (int i = 0; i < qconfigList.count(); ++i)
  3099             tmpStream << addDefine(qconfigList.at(i));
  3112             tmpStream << addDefine(qconfigList.at(i));
  3100 
  3113 
  3101         if(dictionary["EMBEDDED"] == "yes")
  3114         if (dictionary["EMBEDDED"] == "yes")
  3102         {
  3115         {
  3103             // Check for keyboard, mouse, gfx.
  3116             // Check for keyboard, mouse, gfx.
  3104             QStringList kbdDrivers = dictionary["KBD_DRIVERS"].split(" ");;
  3117             QStringList kbdDrivers = dictionary["KBD_DRIVERS"].split(" ");;
  3105             QStringList allKbdDrivers;
  3118             QStringList allKbdDrivers;
  3106             allKbdDrivers<<"tty"<<"usb"<<"sl5000"<<"yopy"<<"vr41xx"<<"qvfb"<<"um";
  3119             allKbdDrivers<<"tty"<<"usb"<<"sl5000"<<"yopy"<<"vr41xx"<<"qvfb"<<"um";
  3107             foreach(QString kbd, allKbdDrivers) {
  3120             foreach(QString kbd, allKbdDrivers) {
  3108                 if( !kbdDrivers.contains(kbd))
  3121                 if (!kbdDrivers.contains(kbd))
  3109                     tmpStream<<"#define QT_NO_QWS_KBD_"<<kbd.toUpper()<<endl;
  3122                     tmpStream<<"#define QT_NO_QWS_KBD_"<<kbd.toUpper()<<endl;
  3110             }
  3123             }
  3111 
  3124 
  3112             QStringList mouseDrivers = dictionary["MOUSE_DRIVERS"].split(" ");
  3125             QStringList mouseDrivers = dictionary["MOUSE_DRIVERS"].split(" ");
  3113             QStringList allMouseDrivers;
  3126             QStringList allMouseDrivers;
  3114             allMouseDrivers << "pc"<<"bus"<<"linuxtp"<<"yopy"<<"vr41xx"<<"tslib"<<"qvfb";
  3127             allMouseDrivers << "pc"<<"bus"<<"linuxtp"<<"yopy"<<"vr41xx"<<"tslib"<<"qvfb";
  3115             foreach(QString mouse, allMouseDrivers) {
  3128             foreach(QString mouse, allMouseDrivers) {
  3116                 if( !mouseDrivers.contains(mouse) )
  3129                 if (!mouseDrivers.contains(mouse))
  3117                     tmpStream<<"#define QT_NO_QWS_MOUSE_"<<mouse.toUpper()<<endl;
  3130                     tmpStream<<"#define QT_NO_QWS_MOUSE_"<<mouse.toUpper()<<endl;
  3118             }
  3131             }
  3119 
  3132 
  3120             QStringList gfxDrivers = dictionary["GFX_DRIVERS"].split(" ");
  3133             QStringList gfxDrivers = dictionary["GFX_DRIVERS"].split(" ");
  3121             QStringList allGfxDrivers;
  3134             QStringList allGfxDrivers;
  3122             allGfxDrivers<<"linuxfb"<<"transformed"<<"qvfb"<<"vnc"<<"multiscreen"<<"ahi";
  3135             allGfxDrivers<<"linuxfb"<<"transformed"<<"qvfb"<<"vnc"<<"multiscreen"<<"ahi";
  3123             foreach(QString gfx, allGfxDrivers) {
  3136             foreach(QString gfx, allGfxDrivers) {
  3124                 if( !gfxDrivers.contains(gfx))
  3137                 if (!gfxDrivers.contains(gfx))
  3125                     tmpStream<<"#define QT_NO_QWS_"<<gfx.toUpper()<<endl;
  3138                     tmpStream<<"#define QT_NO_QWS_"<<gfx.toUpper()<<endl;
  3126             }
  3139             }
  3127 
  3140 
  3128             tmpStream<<"#define Q_WS_QWS"<<endl;
  3141             tmpStream<<"#define Q_WS_QWS"<<endl;
  3129 
  3142 
  3130             QStringList depths = dictionary[ "QT_QWS_DEPTH" ].split(" ");
  3143             QStringList depths = dictionary[ "QT_QWS_DEPTH" ].split(" ");
  3131             foreach(QString depth, depths)
  3144             foreach(QString depth, depths)
  3132               tmpStream<<"#define QT_QWS_DEPTH_"+depth<<endl;
  3145               tmpStream<<"#define QT_QWS_DEPTH_"+depth<<endl;
  3133         }
  3146         }
  3134 
  3147 
  3135         if( dictionary[ "QT_CUPS" ] == "no")
  3148         if (dictionary[ "QT_CUPS" ] == "no")
  3136           tmpStream<<"#define QT_NO_CUPS"<<endl;
  3149           tmpStream<<"#define QT_NO_CUPS"<<endl;
  3137 
  3150 
  3138         if( dictionary[ "QT_ICONV" ]  == "no")
  3151         if (dictionary[ "QT_ICONV" ]  == "no")
  3139           tmpStream<<"#define QT_NO_ICONV"<<endl;
  3152           tmpStream<<"#define QT_NO_ICONV"<<endl;
  3140 
  3153 
  3141         if(dictionary[ "QT_GLIB" ] == "no")
  3154         if (dictionary[ "QT_GLIB" ] == "no")
  3142           tmpStream<<"#define QT_NO_GLIB"<<endl;
  3155           tmpStream<<"#define QT_NO_GLIB"<<endl;
  3143 
  3156 
  3144         if(dictionary[ "QT_LPR" ] == "no")
  3157         if (dictionary[ "QT_LPR" ] == "no")
  3145           tmpStream<<"#define QT_NO_LPR"<<endl;
  3158           tmpStream<<"#define QT_NO_LPR"<<endl;
  3146 
  3159 
  3147         if(dictionary[ "QT_INOTIFY" ] == "no" )
  3160         if (dictionary[ "QT_INOTIFY" ] == "no")
  3148           tmpStream<<"#define QT_NO_INOTIFY"<<endl;
  3161           tmpStream<<"#define QT_NO_INOTIFY"<<endl;
  3149 
  3162 
  3150         if(dictionary[ "QT_SXE" ] == "no")
  3163         if (dictionary[ "QT_SXE" ] == "no")
  3151           tmpStream<<"#define QT_NO_SXE"<<endl;
  3164           tmpStream<<"#define QT_NO_SXE"<<endl;
  3152 
  3165 
  3153         tmpStream.flush();
  3166         tmpStream.flush();
  3154         tmpFile.flush();
  3167         tmpFile.flush();
  3155 
  3168 
  3156         // Replace old qconfig.h with new one
  3169         // Replace old qconfig.h with new one
  3157         ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL);
  3170         ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL);
  3158         QFile::remove(outName);
  3171         QFile::remove(outName);
  3159         tmpFile.copy(outName);
  3172         tmpFile.copy(outName);
  3160         tmpFile.close();
  3173         tmpFile.close();
  3161 
       
  3162         if(!QFile::exists(buildPath + "/include/QtCore/qconfig.h")) {
       
  3163             if (!writeToFile("#include \"../../src/corelib/global/qconfig.h\"\n",
       
  3164                              buildPath + "/include/QtCore/qconfig.h")
       
  3165             || !writeToFile("#include \"../../src/corelib/global/qconfig.h\"\n",
       
  3166                             buildPath + "/include/Qt/qconfig.h")) {
       
  3167                 dictionary["DONE"] = "error";
       
  3168                 return;
       
  3169             }
       
  3170         }
       
  3171     }
  3174     }
  3172 
  3175 
  3173     // Copy configured mkspec to default directory, but remove the old one first, if there is any
  3176     // Copy configured mkspec to default directory, but remove the old one first, if there is any
  3174     QString defSpec = buildPath + "/mkspecs/default";
  3177     QString defSpec = buildPath + "/mkspecs/default";
  3175     QFileInfo defSpecInfo(defSpec);
  3178     QFileInfo defSpecInfo(defSpec);
  3188         dictionary["DONE"] = "error";
  3191         dictionary["DONE"] = "error";
  3189         return;
  3192         return;
  3190     }
  3193     }
  3191 
  3194 
  3192     outName = defSpec + "/qmake.conf";
  3195     outName = defSpec + "/qmake.conf";
  3193     ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL );
  3196     ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL);
  3194     QFile qmakeConfFile(outName);
  3197     QFile qmakeConfFile(outName);
  3195     if (qmakeConfFile.open(QFile::Append | QFile::WriteOnly | QFile::Text)) {
  3198     if (qmakeConfFile.open(QFile::Append | QFile::WriteOnly | QFile::Text)) {
  3196         QTextStream qmakeConfStream;
  3199         QTextStream qmakeConfStream;
  3197         qmakeConfStream.setDevice(&qmakeConfFile);
  3200         qmakeConfStream.setDevice(&qmakeConfFile);
  3198         qmakeConfStream << endl << "QMAKESPEC_ORIGINAL=" << pltSpec << endl;
  3201         qmakeConfStream << endl << "QMAKESPEC_ORIGINAL=" << pltSpec << endl;
  3212                   << "static const char qt_configure_licensed_products_str [512 + 12] = \"qt_lcnsprod=" << dictionary["EDITION"] << "\";" << endl
  3215                   << "static const char qt_configure_licensed_products_str [512 + 12] = \"qt_lcnsprod=" << dictionary["EDITION"] << "\";" << endl
  3213                   << endl
  3216                   << endl
  3214                   << "/* Build date */" << endl
  3217                   << "/* Build date */" << endl
  3215                   << "static const char qt_configure_installation          [11  + 12] = \"qt_instdate=" << QDate::currentDate().toString(Qt::ISODate) << "\";" << endl
  3218                   << "static const char qt_configure_installation          [11  + 12] = \"qt_instdate=" << QDate::currentDate().toString(Qt::ISODate) << "\";" << endl
  3216                   << endl;
  3219                   << endl;
  3217         if(!dictionary[ "QT_HOST_PREFIX" ].isNull())
  3220         if (!dictionary[ "QT_HOST_PREFIX" ].isNull())
  3218             tmpStream << "#if !defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE)" << endl;
  3221             tmpStream << "#if !defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE)" << endl;
  3219         tmpStream << "static const char qt_configure_prefix_path_str       [512 + 12] = \"qt_prfxpath=" << QString(dictionary["QT_INSTALL_PREFIX"]).replace( "\\", "\\\\" ) << "\";" << endl
  3222         tmpStream << "static const char qt_configure_prefix_path_str       [512 + 12] = \"qt_prfxpath=" << escapeSeparators(dictionary["QT_INSTALL_PREFIX"]) << "\";" << endl
  3220                   << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << QString(dictionary["QT_INSTALL_DOCS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3223                   << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << escapeSeparators(dictionary["QT_INSTALL_DOCS"]) << "\";"  << endl
  3221                   << "static const char qt_configure_headers_path_str      [512 + 12] = \"qt_hdrspath=" << QString(dictionary["QT_INSTALL_HEADERS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3224                   << "static const char qt_configure_headers_path_str      [512 + 12] = \"qt_hdrspath=" << escapeSeparators(dictionary["QT_INSTALL_HEADERS"]) << "\";"  << endl
  3222                   << "static const char qt_configure_libraries_path_str    [512 + 12] = \"qt_libspath=" << QString(dictionary["QT_INSTALL_LIBS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3225                   << "static const char qt_configure_libraries_path_str    [512 + 12] = \"qt_libspath=" << escapeSeparators(dictionary["QT_INSTALL_LIBS"]) << "\";"  << endl
  3223                   << "static const char qt_configure_binaries_path_str     [512 + 12] = \"qt_binspath=" << QString(dictionary["QT_INSTALL_BINS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3226                   << "static const char qt_configure_binaries_path_str     [512 + 12] = \"qt_binspath=" << escapeSeparators(dictionary["QT_INSTALL_BINS"]) << "\";"  << endl
  3224                   << "static const char qt_configure_plugins_path_str      [512 + 12] = \"qt_plugpath=" << QString(dictionary["QT_INSTALL_PLUGINS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3227                   << "static const char qt_configure_plugins_path_str      [512 + 12] = \"qt_plugpath=" << escapeSeparators(dictionary["QT_INSTALL_PLUGINS"]) << "\";"  << endl
  3225                   << "static const char qt_configure_imports_path_str      [512 + 12] = \"qt_impspath=" << QString(dictionary["QT_INSTALL_IMPORTS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3228                   << "static const char qt_configure_imports_path_str      [512 + 12] = \"qt_impspath=" << escapeSeparators(dictionary["QT_INSTALL_IMPORTS"]) << "\";"  << endl
  3226                   << "static const char qt_configure_data_path_str         [512 + 12] = \"qt_datapath=" << QString(dictionary["QT_INSTALL_DATA"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3229                   << "static const char qt_configure_data_path_str         [512 + 12] = \"qt_datapath=" << escapeSeparators(dictionary["QT_INSTALL_DATA"]) << "\";"  << endl
  3227                   << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << QString(dictionary["QT_INSTALL_TRANSLATIONS"]).replace( "\\", "\\\\" ) << "\";" << endl
  3230                   << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << escapeSeparators(dictionary["QT_INSTALL_TRANSLATIONS"]) << "\";" << endl
  3228                   << "static const char qt_configure_examples_path_str     [512 + 12] = \"qt_xmplpath=" << QString(dictionary["QT_INSTALL_EXAMPLES"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3231                   << "static const char qt_configure_examples_path_str     [512 + 12] = \"qt_xmplpath=" << escapeSeparators(dictionary["QT_INSTALL_EXAMPLES"]) << "\";"  << endl
  3229                   << "static const char qt_configure_demos_path_str        [512 + 12] = \"qt_demopath=" << QString(dictionary["QT_INSTALL_DEMOS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3232                   << "static const char qt_configure_demos_path_str        [512 + 12] = \"qt_demopath=" << escapeSeparators(dictionary["QT_INSTALL_DEMOS"]) << "\";"  << endl
  3230                   //<< "static const char qt_configure_settings_path_str [256] = \"qt_stngpath=" << QString(dictionary["QT_INSTALL_SETTINGS"]).replace( "\\", "\\\\" ) << "\";" << endl
  3233                   //<< "static const char qt_configure_settings_path_str [256] = \"qt_stngpath=" << escapeSeparators(dictionary["QT_INSTALL_SETTINGS"]) << "\";" << endl
  3231                   ;
  3234                   ;
  3232         if(!dictionary[ "QT_HOST_PREFIX" ].isNull()) {
  3235         if (!dictionary[ "QT_HOST_PREFIX" ].isNull()) {
  3233              tmpStream << "#else" << endl
  3236              tmpStream << "#else" << endl
  3234                        << "static const char qt_configure_prefix_path_str       [512 + 12] = \"qt_prfxpath=" << QString(dictionary[ "QT_HOST_PREFIX" ]).replace( "\\", "\\\\" ) << "\";" << endl
  3237                        << "static const char qt_configure_prefix_path_str       [512 + 12] = \"qt_prfxpath=" << escapeSeparators(dictionary[ "QT_HOST_PREFIX" ]) << "\";" << endl
  3235                        << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/doc").replace( "\\", "\\\\" ) <<"\";"  << endl
  3238                        << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/doc", true) <<"\";"  << endl
  3236                        << "static const char qt_configure_headers_path_str      [512 + 12] = \"qt_hdrspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/include").replace( "\\", "\\\\" ) <<"\";"  << endl
  3239                        << "static const char qt_configure_headers_path_str      [512 + 12] = \"qt_hdrspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/include", true) <<"\";"  << endl
  3237                        << "static const char qt_configure_libraries_path_str    [512 + 12] = \"qt_libspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/lib").replace( "\\", "\\\\" ) <<"\";"  << endl
  3240                        << "static const char qt_configure_libraries_path_str    [512 + 12] = \"qt_libspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/lib", true) <<"\";"  << endl
  3238                        << "static const char qt_configure_binaries_path_str     [512 + 12] = \"qt_binspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/bin").replace( "\\", "\\\\" ) <<"\";"  << endl
  3241                        << "static const char qt_configure_binaries_path_str     [512 + 12] = \"qt_binspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/bin", true) <<"\";"  << endl
  3239                        << "static const char qt_configure_plugins_path_str      [512 + 12] = \"qt_plugpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/plugins").replace( "\\", "\\\\" ) <<"\";"  << endl
  3242                        << "static const char qt_configure_plugins_path_str      [512 + 12] = \"qt_plugpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/plugins", true) <<"\";"  << endl
  3240                        << "static const char qt_configure_imports_path_str      [512 + 12] = \"qt_impspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/imports").replace( "\\", "\\\\" ) <<"\";"  << endl
  3243                        << "static const char qt_configure_imports_path_str      [512 + 12] = \"qt_impspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/imports", true) <<"\";"  << endl
  3241                        << "static const char qt_configure_data_path_str         [512 + 12] = \"qt_datapath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ]).replace( "\\", "\\\\" ) <<"\";"  << endl
  3244                        << "static const char qt_configure_data_path_str         [512 + 12] = \"qt_datapath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ], true) <<"\";"  << endl
  3242                        << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/translations").replace( "\\", "\\\\" ) <<"\";" << endl
  3245                        << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/translations", true) <<"\";" << endl
  3243                        << "static const char qt_configure_examples_path_str     [512 + 12] = \"qt_xmplpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/example").replace( "\\", "\\\\" ) <<"\";"  << endl
  3246                        << "static const char qt_configure_examples_path_str     [512 + 12] = \"qt_xmplpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/example", true) <<"\";"  << endl
  3244                        << "static const char qt_configure_demos_path_str        [512 + 12] = \"qt_demopath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/demos").replace( "\\", "\\\\" ) <<"\";"  << endl
  3247                        << "static const char qt_configure_demos_path_str        [512 + 12] = \"qt_demopath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/demos", true) <<"\";"  << endl
  3245                        << "#endif //QT_BOOTSTRAPPED" << endl;
  3248                        << "#endif //QT_BOOTSTRAPPED" << endl;
  3246         }
  3249         }
  3247         tmpStream << "/* strlen( \"qt_lcnsxxxx\" ) == 12 */" << endl
  3250         tmpStream << "/* strlen( \"qt_lcnsxxxx\") == 12 */" << endl
  3248                   << "#define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12;" << endl
  3251                   << "#define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12;" << endl
  3249                   << "#define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12;" << endl
  3252                   << "#define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12;" << endl
  3250                   << "#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12;" << endl
  3253                   << "#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12;" << endl
  3251                   << "#define QT_CONFIGURE_DOCUMENTATION_PATH qt_configure_documentation_path_str + 12;" << endl
  3254                   << "#define QT_CONFIGURE_DOCUMENTATION_PATH qt_configure_documentation_path_str + 12;" << endl
  3252                   << "#define QT_CONFIGURE_HEADERS_PATH qt_configure_headers_path_str + 12;" << endl
  3255                   << "#define QT_CONFIGURE_HEADERS_PATH qt_configure_headers_path_str + 12;" << endl
  3263 
  3266 
  3264         tmpStream.flush();
  3267         tmpStream.flush();
  3265         tmpFile2.flush();
  3268         tmpFile2.flush();
  3266 
  3269 
  3267         // Replace old qconfig.cpp with new one
  3270         // Replace old qconfig.cpp with new one
  3268         ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL );
  3271         ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL);
  3269         QFile::remove( outName );
  3272         QFile::remove(outName);
  3270         tmpFile2.copy(outName);
  3273         tmpFile2.copy(outName);
  3271         tmpFile2.close();
  3274         tmpFile2.close();
  3272     }
  3275     }
  3273 
  3276 
  3274     QTemporaryFile tmpFile3;
  3277     QTemporaryFile tmpFile3;
  3279 
  3282 
  3280         tmpStream.flush();
  3283         tmpStream.flush();
  3281         tmpFile3.flush();
  3284         tmpFile3.flush();
  3282 
  3285 
  3283         outName = buildPath + "/src/corelib/global/qconfig_eval.cpp";
  3286         outName = buildPath + "/src/corelib/global/qconfig_eval.cpp";
  3284         ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL );
  3287         ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL);
  3285         QFile::remove( outName );
  3288         QFile::remove(outName);
  3286 
  3289 
  3287         if (dictionary["EDITION"] == "Evaluation" || qmakeDefines.contains("QT_EVAL"))
  3290         if (dictionary["EDITION"] == "Evaluation" || qmakeDefines.contains("QT_EVAL"))
  3288             tmpFile3.copy(outName);
  3291             tmpFile3.copy(outName);
  3289         tmpFile3.close();
  3292         tmpFile3.close();
  3290     }
  3293     }
  3324         cout << "Product license............." << (l3.isNull() ? "" : l3) << endl;
  3327         cout << "Product license............." << (l3.isNull() ? "" : l3) << endl;
  3325         cout << "Expiry Date................." << (l4.isNull() ? "" : l4) << endl << endl;
  3328         cout << "Expiry Date................." << (l4.isNull() ? "" : l4) << endl << endl;
  3326     }
  3329     }
  3327 
  3330 
  3328     cout << "Configuration:" << endl;
  3331     cout << "Configuration:" << endl;
  3329     cout << "    " << qmakeConfig.join( "\r\n    " ) << endl;
  3332     cout << "    " << qmakeConfig.join("\r\n    ") << endl;
  3330     cout << "Qt Configuration:" << endl;
  3333     cout << "Qt Configuration:" << endl;
  3331     cout << "    " << qtConfig.join( "\r\n    " ) << endl;
  3334     cout << "    " << qtConfig.join("\r\n    ") << endl;
  3332     cout << endl;
  3335     cout << endl;
  3333 
  3336 
  3334     if (dictionary.contains("XQMAKESPEC"))
  3337     if (dictionary.contains("XQMAKESPEC"))
  3335         cout << "QMAKESPEC..................." << dictionary[ "XQMAKESPEC" ] << " (" << dictionary["QMAKESPEC_FROM"] << ")" << endl;
  3338         cout << "QMAKESPEC..................." << dictionary[ "XQMAKESPEC" ] << " (" << dictionary["QMAKESPEC_FROM"] << ")" << endl;
  3336     else
  3339     else
  3418         cout << "Support for S60............." << dictionary[ "S60" ] << endl;
  3421         cout << "Support for S60............." << dictionary[ "S60" ] << endl;
  3419     }
  3422     }
  3420 
  3423 
  3421     if (dictionary.contains("SYMBIAN_DEFFILES")) {
  3424     if (dictionary.contains("SYMBIAN_DEFFILES")) {
  3422         cout << "Symbian DEF files enabled..." << dictionary[ "SYMBIAN_DEFFILES" ] << endl;
  3425         cout << "Symbian DEF files enabled..." << dictionary[ "SYMBIAN_DEFFILES" ] << endl;
  3423         if(dictionary["SYMBIAN_DEFFILES"] == "no") {
  3426         if (dictionary["SYMBIAN_DEFFILES"] == "no") {
  3424             cout << "WARNING: Disabling DEF files will mean that Qt is NOT binary compatible with previous versions." << endl;
  3427             cout << "WARNING: Disabling DEF files will mean that Qt is NOT binary compatible with previous versions." << endl;
  3425             cout << "         This feature is only intended for use during development, NEVER for release builds." << endl;
  3428             cout << "         This feature is only intended for use during development, NEVER for release builds." << endl;
  3426         }
  3429         }
  3427     }
  3430     }
  3428 
  3431 
  3429     if(dictionary["ASSISTANT_WEBKIT"] == "yes")
  3432     if (dictionary["ASSISTANT_WEBKIT"] == "yes")
  3430         cout << "Using WebKit as html rendering engine in Qt Assistant." << endl;
  3433         cout << "Using WebKit as html rendering engine in Qt Assistant." << endl;
  3431 
  3434 
  3432     if(checkAvailability("INCREDIBUILD_XGE"))
  3435     if (checkAvailability("INCREDIBUILD_XGE"))
  3433         cout << "Using IncrediBuild XGE......" << dictionary["INCREDIBUILD_XGE"] << endl;
  3436         cout << "Using IncrediBuild XGE......" << dictionary["INCREDIBUILD_XGE"] << endl;
  3434     if( !qmakeDefines.isEmpty() ) {
  3437     if (!qmakeDefines.isEmpty()) {
  3435         cout << "Defines.....................";
  3438         cout << "Defines.....................";
  3436         for( QStringList::Iterator defs = qmakeDefines.begin(); defs != qmakeDefines.end(); ++defs )
  3439         for (QStringList::Iterator defs = qmakeDefines.begin(); defs != qmakeDefines.end(); ++defs)
  3437             cout << (*defs) << " ";
  3440             cout << (*defs) << " ";
  3438         cout << endl;
  3441         cout << endl;
  3439     }
  3442     }
  3440     if( !qmakeIncludes.isEmpty() ) {
  3443     if (!qmakeIncludes.isEmpty()) {
  3441         cout << "Include paths...............";
  3444         cout << "Include paths...............";
  3442         for( QStringList::Iterator incs = qmakeIncludes.begin(); incs != qmakeIncludes.end(); ++incs )
  3445         for (QStringList::Iterator incs = qmakeIncludes.begin(); incs != qmakeIncludes.end(); ++incs)
  3443             cout << (*incs) << " ";
  3446             cout << (*incs) << " ";
  3444         cout << endl;
  3447         cout << endl;
  3445     }
  3448     }
  3446     if( !qmakeLibs.isEmpty() ) {
  3449     if (!qmakeLibs.isEmpty()) {
  3447         cout << "Additional libraries........";
  3450         cout << "Additional libraries........";
  3448         for( QStringList::Iterator libs = qmakeLibs.begin(); libs != qmakeLibs.end(); ++libs )
  3451         for (QStringList::Iterator libs = qmakeLibs.begin(); libs != qmakeLibs.end(); ++libs)
  3449             cout << (*libs) << " ";
  3452             cout << (*libs) << " ";
  3450         cout << endl;
  3453         cout << endl;
  3451     }
  3454     }
  3452     if( dictionary[ "QMAKE_INTERNAL" ] == "yes" ) {
  3455     if (dictionary[ "QMAKE_INTERNAL" ] == "yes") {
  3453         cout << "Using internal configuration." << endl;
  3456         cout << "Using internal configuration." << endl;
  3454     }
  3457     }
  3455     if( dictionary[ "SHARED" ] == "no" ) {
  3458     if (dictionary[ "SHARED" ] == "no") {
  3456         cout << "WARNING: Using static linking will disable the use of plugins." << endl;
  3459         cout << "WARNING: Using static linking will disable the use of plugins." << endl;
  3457         cout << "         Make sure you compile ALL needed modules into the library." << endl;
  3460         cout << "         Make sure you compile ALL needed modules into the library." << endl;
  3458     }
  3461     }
  3459     if( dictionary[ "OPENSSL" ] == "linked" && opensslLibs.isEmpty() ) {
  3462     if (dictionary[ "OPENSSL" ] == "linked" && opensslLibs.isEmpty()) {
  3460         cout << "NOTE: When linking against OpenSSL, you can override the default" << endl;
  3463         cout << "NOTE: When linking against OpenSSL, you can override the default" << endl;
  3461         cout << "library names through OPENSSL_LIBS." << endl;
  3464         cout << "library names through OPENSSL_LIBS." << endl;
  3462         cout << "For example:" << endl;
  3465         cout << "For example:" << endl;
  3463         cout << "    configure -openssl-linked OPENSSL_LIBS=\"-lssleay32 -llibeay32\"" << endl;
  3466         cout << "    configure -openssl-linked OPENSSL_LIBS=\"-lssleay32 -llibeay32\"" << endl;
  3464     }
  3467     }
  3465     if( dictionary[ "ZLIB_FORCED" ] == "yes" ) {
  3468     if (dictionary[ "ZLIB_FORCED" ] == "yes") {
  3466         QString which_zlib = "supplied";
  3469         QString which_zlib = "supplied";
  3467         if( dictionary[ "ZLIB" ] == "system")
  3470         if (dictionary[ "ZLIB" ] == "system")
  3468             which_zlib = "system";
  3471             which_zlib = "system";
  3469 
  3472 
  3470         cout << "NOTE: The -no-zlib option was supplied but is no longer supported." << endl
  3473         cout << "NOTE: The -no-zlib option was supplied but is no longer supported." << endl
  3471              << endl
  3474              << endl
  3472              << "Qt now requires zlib support in all builds, so the -no-zlib" << endl
  3475              << "Qt now requires zlib support in all builds, so the -no-zlib" << endl
  3491     }
  3494     }
  3492 }
  3495 }
  3493 
  3496 
  3494 void Configure::buildQmake()
  3497 void Configure::buildQmake()
  3495 {
  3498 {
  3496     if( dictionary[ "BUILD_QMAKE" ] == "yes" ) {
  3499     if (dictionary[ "BUILD_QMAKE" ] == "yes") {
  3497         QStringList args;
  3500         QStringList args;
  3498 
  3501 
  3499         // Build qmake
  3502         // Build qmake
  3500         QString pwd = QDir::currentPath();
  3503         QString pwd = QDir::currentPath();
  3501         QDir::setCurrent(buildPath + "/qmake" );
  3504         QDir::setCurrent(buildPath + "/qmake");
  3502 
  3505 
  3503         QString makefile = "Makefile";
  3506         QString makefile = "Makefile";
  3504         {
  3507         {
  3505             QFile out(makefile);
  3508             QFile out(makefile);
  3506             if(out.open(QFile::WriteOnly | QFile::Text)) {
  3509             if (out.open(QFile::WriteOnly | QFile::Text)) {
  3507                 QTextStream stream(&out);
  3510                 QTextStream stream(&out);
  3508                 stream << "#AutoGenerated by configure.exe" << endl
  3511                 stream << "#AutoGenerated by configure.exe" << endl
  3509                     << "BUILD_PATH = " << QDir::convertSeparators(buildPath) << endl
  3512                     << "BUILD_PATH = " << QDir::convertSeparators(buildPath) << endl
  3510                     << "SOURCE_PATH = " << QDir::convertSeparators(sourcePath) << endl;
  3513                     << "SOURCE_PATH = " << QDir::convertSeparators(sourcePath) << endl;
  3511                 stream << "QMAKESPEC = " << dictionary["QMAKESPEC"] << endl;
  3514                 stream << "QMAKESPEC = " << dictionary["QMAKESPEC"] << endl;
  3514                     dictionary["QT_EDITION"].contains("OPENSOURCE"))
  3517                     dictionary["QT_EDITION"].contains("OPENSOURCE"))
  3515                     stream << "QMAKE_OPENSOURCE_EDITION = yes" << endl;
  3518                     stream << "QMAKE_OPENSOURCE_EDITION = yes" << endl;
  3516                 stream << "\n\n";
  3519                 stream << "\n\n";
  3517 
  3520 
  3518                 QFile in(sourcePath + "/qmake/" + dictionary["QMAKEMAKEFILE"]);
  3521                 QFile in(sourcePath + "/qmake/" + dictionary["QMAKEMAKEFILE"]);
  3519                 if(in.open(QFile::ReadOnly | QFile::Text)) {
  3522                 if (in.open(QFile::ReadOnly | QFile::Text)) {
  3520                     QString d = in.readAll();
  3523                     QString d = in.readAll();
  3521                     //### need replaces (like configure.sh)? --Sam
  3524                     //### need replaces (like configure.sh)? --Sam
  3522                     stream << d << endl;
  3525                     stream << d << endl;
  3523                 }
  3526                 }
  3524                 stream.flush();
  3527                 stream.flush();
  3530         args += "-f";
  3533         args += "-f";
  3531         args += makefile;
  3534         args += makefile;
  3532 
  3535 
  3533         cout << "Creating qmake..." << endl;
  3536         cout << "Creating qmake..." << endl;
  3534         int exitCode = Environment::execute(args, QStringList(), QStringList());
  3537         int exitCode = Environment::execute(args, QStringList(), QStringList());
  3535         if( exitCode ) {
  3538         if (exitCode) {
  3536             args.clear();
  3539             args.clear();
  3537             args += dictionary[ "MAKE" ];
  3540             args += dictionary[ "MAKE" ];
  3538             args += "-f";
  3541             args += "-f";
  3539             args += makefile;
  3542             args += makefile;
  3540             args += "clean";
  3543             args += "clean";
  3541             exitCode = Environment::execute(args, QStringList(), QStringList());
  3544             exitCode = Environment::execute(args, QStringList(), QStringList());
  3542             if(exitCode) {
  3545             if (exitCode) {
  3543                 cout << "Cleaning qmake failed, return code " << exitCode << endl << endl;
  3546                 cout << "Cleaning qmake failed, return code " << exitCode << endl << endl;
  3544                 dictionary[ "DONE" ] = "error";
  3547                 dictionary[ "DONE" ] = "error";
  3545             } else {
  3548             } else {
  3546                 args.clear();
  3549                 args.clear();
  3547                 args += dictionary[ "MAKE" ];
  3550                 args += dictionary[ "MAKE" ];
  3552                     cout << "Building qmake failed, return code " << exitCode << endl << endl;
  3555                     cout << "Building qmake failed, return code " << exitCode << endl << endl;
  3553                     dictionary[ "DONE" ] = "error";
  3556                     dictionary[ "DONE" ] = "error";
  3554                 }
  3557                 }
  3555             }
  3558             }
  3556         }
  3559         }
  3557         QDir::setCurrent( pwd );
  3560         QDir::setCurrent(pwd);
  3558     }
  3561     }
  3559 }
  3562 }
  3560 #endif
  3563 #endif
  3561 
  3564 
  3562 void Configure::buildHostTools()
  3565 void Configure::buildHostTools()
  3571     QStringList hostToolsDirs;
  3574     QStringList hostToolsDirs;
  3572     hostToolsDirs
  3575     hostToolsDirs
  3573         << "src/tools"
  3576         << "src/tools"
  3574         << "tools/linguist/lrelease";
  3577         << "tools/linguist/lrelease";
  3575 
  3578 
  3576     if(dictionary["XQMAKESPEC"].startsWith("wince"))
  3579     if (dictionary["XQMAKESPEC"].startsWith("wince"))
  3577         hostToolsDirs << "tools/checksdk";
  3580         hostToolsDirs << "tools/checksdk";
  3578 
  3581 
  3579     if (dictionary[ "CETEST" ] == "yes")
  3582     if (dictionary[ "CETEST" ] == "yes")
  3580         hostToolsDirs << "tools/qtestlib/wince/cetest";
  3583         hostToolsDirs << "tools/qtestlib/wince/cetest";
  3581 
  3584 
  3607         if (exitCode) {
  3610         if (exitCode) {
  3608             args.clear();
  3611             args.clear();
  3609             args += dictionary["MAKE"];
  3612             args += dictionary["MAKE"];
  3610             args += "clean";
  3613             args += "clean";
  3611             exitCode = Environment::execute(args, QStringList(), QStringList());
  3614             exitCode = Environment::execute(args, QStringList(), QStringList());
  3612             if(exitCode) {
  3615             if (exitCode) {
  3613                 cout << "Cleaning " << hostToolsDirs.at(i) << " failed, return code " << exitCode << endl << endl;
  3616                 cout << "Cleaning " << hostToolsDirs.at(i) << " failed, return code " << exitCode << endl << endl;
  3614                 dictionary["DONE"] = "error";
  3617                 dictionary["DONE"] = "error";
  3615                 break;
  3618                 break;
  3616             } else {
  3619             } else {
  3617                 args.clear();
  3620                 args.clear();
  3626         }
  3629         }
  3627     }
  3630     }
  3628     QDir::setCurrent(pwd);
  3631     QDir::setCurrent(pwd);
  3629 }
  3632 }
  3630 
  3633 
  3631 void Configure::findProjects( const QString& dirName )
  3634 void Configure::findProjects(const QString& dirName)
  3632 {
  3635 {
  3633     if( dictionary[ "NOPROCESS" ] == "no" ) {
  3636     if (dictionary[ "NOPROCESS" ] == "no") {
  3634         QDir dir( dirName );
  3637         QDir dir(dirName);
  3635         QString entryName;
  3638         QString entryName;
  3636         int makeListNumber;
  3639         int makeListNumber;
  3637         ProjectType qmakeTemplate;
  3640         ProjectType qmakeTemplate;
  3638         const QFileInfoList &list = dir.entryInfoList(QStringList(QLatin1String("*.pro")),
  3641         const QFileInfoList &list = dir.entryInfoList(QStringList(QLatin1String("*.pro")),
  3639                                                       QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot);
  3642                                                       QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot);
  3640         for(int i = 0; i < list.size(); ++i) {
  3643         for (int i = 0; i < list.size(); ++i) {
  3641             const QFileInfo &fi = list.at(i);
  3644             const QFileInfo &fi = list.at(i);
  3642             if(fi.fileName() != "qmake.pro") {
  3645             if (fi.fileName() != "qmake.pro") {
  3643                 entryName = dirName + "/" + fi.fileName();
  3646                 entryName = dirName + "/" + fi.fileName();
  3644                 if(fi.isDir()) {
  3647                 if (fi.isDir()) {
  3645                     findProjects( entryName );
  3648                     findProjects(entryName);
  3646                 } else {
  3649                 } else {
  3647                     qmakeTemplate = projectType( fi.absoluteFilePath() );
  3650                     qmakeTemplate = projectType(fi.absoluteFilePath());
  3648                     switch ( qmakeTemplate ) {
  3651                     switch (qmakeTemplate) {
  3649                     case Lib:
  3652                     case Lib:
  3650                     case Subdirs:
  3653                     case Subdirs:
  3651                         makeListNumber = 1;
  3654                         makeListNumber = 1;
  3652                         break;
  3655                         break;
  3653                     default:
  3656                     default:
  3670     QString dir;
  3673     QString dir;
  3671     if (item != "src")
  3674     if (item != "src")
  3672         dir = "/" + item;
  3675         dir = "/" + item;
  3673     dir.prepend("/src");
  3676     dir.prepend("/src");
  3674     makeList[inList].append(new MakeItem(sourcePath + dir,
  3677     makeList[inList].append(new MakeItem(sourcePath + dir,
  3675         item + ".pro", buildPath + dir + "/Makefile", Lib ) );
  3678         item + ".pro", buildPath + dir + "/Makefile", Lib));
  3676     if( dictionary[ "DSPFILES" ] == "yes" ) {
  3679     if (dictionary[ "DSPFILES" ] == "yes") {
  3677         makeList[inList].append( new MakeItem(sourcePath + dir,
  3680         makeList[inList].append(new MakeItem(sourcePath + dir,
  3678             item + ".pro", buildPath + dir + "/" + item + ".dsp", Lib ) );
  3681             item + ".pro", buildPath + dir + "/" + item + ".dsp", Lib));
  3679     }
  3682     }
  3680     if( dictionary[ "VCPFILES" ] == "yes" ) {
  3683     if (dictionary[ "VCPFILES" ] == "yes") {
  3681         makeList[inList].append( new MakeItem(sourcePath + dir,
  3684         makeList[inList].append(new MakeItem(sourcePath + dir,
  3682             item + ".pro", buildPath + dir + "/" + item + ".vcp", Lib ) );
  3685             item + ".pro", buildPath + dir + "/" + item + ".vcp", Lib));
  3683     }
  3686     }
  3684     if( dictionary[ "VCPROJFILES" ] == "yes" ) {
  3687     if (dictionary[ "VCPROJFILES" ] == "yes") {
  3685         makeList[inList].append( new MakeItem(sourcePath + dir,
  3688         makeList[inList].append(new MakeItem(sourcePath + dir,
  3686             item + ".pro", buildPath + dir + "/" + item + ".vcproj", Lib ) );
  3689             item + ".pro", buildPath + dir + "/" + item + ".vcproj", Lib));
  3687     }
  3690     }
  3688 }
  3691 }
  3689 
  3692 
  3690 void Configure::generateMakefiles()
  3693 void Configure::generateMakefiles()
  3691 {
  3694 {
  3692     if( dictionary[ "NOPROCESS" ] == "no" ) {
  3695     if (dictionary[ "NOPROCESS" ] == "no") {
  3693 #if !defined(EVAL)
  3696 #if !defined(EVAL)
  3694         cout << "Creating makefiles in src..." << endl;
  3697         cout << "Creating makefiles in src..." << endl;
  3695 #endif
  3698 #endif
  3696 
  3699 
  3697         QString spec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ];
  3700         QString spec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ];
  3698         if( spec != "win32-msvc" )
  3701         if (spec != "win32-msvc")
  3699             dictionary[ "DSPFILES" ] = "no";
  3702             dictionary[ "DSPFILES" ] = "no";
  3700 
  3703 
  3701         if( spec != "win32-msvc.net" && !spec.startsWith("win32-msvc2") && !spec.startsWith(QLatin1String("wince")))
  3704         if (spec != "win32-msvc.net" && !spec.startsWith("win32-msvc2") && !spec.startsWith(QLatin1String("wince")))
  3702             dictionary[ "VCPROJFILES" ] = "no";
  3705             dictionary[ "VCPROJFILES" ] = "no";
  3703 
  3706 
  3704         int i = 0;
  3707         int i = 0;
  3705         QString pwd = QDir::currentPath();
  3708         QString pwd = QDir::currentPath();
  3706         if (dictionary["FAST"] != "yes") {
  3709         if (dictionary["FAST"] != "yes") {
  3711             while (generate) {
  3714             while (generate) {
  3712                 QString pwd = QDir::currentPath();
  3715                 QString pwd = QDir::currentPath();
  3713                 QString dirPath = fixSeparators(buildPath + dirName);
  3716                 QString dirPath = fixSeparators(buildPath + dirName);
  3714                 QStringList args;
  3717                 QStringList args;
  3715 
  3718 
  3716                 args << fixSeparators( buildPath + "/bin/qmake" );
  3719                 args << fixSeparators(buildPath + "/bin/qmake");
  3717 
  3720 
  3718                 if (doDsp) {
  3721                 if (doDsp) {
  3719                     if( dictionary[ "DEPENDENCIES" ] == "no" )
  3722                     if (dictionary[ "DEPENDENCIES" ] == "no")
  3720                         args << "-nodepend";
  3723                         args << "-nodepend";
  3721                     args << "-tp" <<  "vc";
  3724                     args << "-tp" <<  "vc";
  3722                     doDsp = false; // DSP files will be done
  3725                     doDsp = false; // DSP files will be done
  3723                     printf("Generating Visual Studio project files...\n");
  3726                     printf("Generating Visual Studio project files...\n");
  3724                 } else {
  3727                 } else {
  3729                 args << spec;
  3732                 args << spec;
  3730                 args << "-r";
  3733                 args << "-r";
  3731                 args << (sourcePath + "/projects.pro");
  3734                 args << (sourcePath + "/projects.pro");
  3732                 args << "-o";
  3735                 args << "-o";
  3733                 args << buildPath;
  3736                 args << buildPath;
  3734                 if(!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty())
  3737                 if (!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty())
  3735                     args << dictionary[ "QMAKEADDITIONALARGS" ];
  3738                     args << dictionary[ "QMAKEADDITIONALARGS" ];
  3736 
  3739 
  3737                 QDir::setCurrent( fixSeparators( dirPath ) );
  3740                 QDir::setCurrent(fixSeparators(dirPath));
  3738                 if( int exitCode = Environment::execute(args, QStringList(), QStringList()) ) {
  3741                 if (int exitCode = Environment::execute(args, QStringList(), QStringList())) {
  3739                     cout << "Qmake failed, return code " << exitCode  << endl << endl;
  3742                     cout << "Qmake failed, return code " << exitCode  << endl << endl;
  3740                     dictionary[ "DONE" ] = "error";
  3743                     dictionary[ "DONE" ] = "error";
  3741                 }
  3744                 }
  3742             }
  3745             }
  3743         } else {
  3746         } else {
  3744             findProjects(sourcePath);
  3747             findProjects(sourcePath);
  3745             for ( i=0; i<3; i++ ) {
  3748             for (i=0; i<3; i++) {
  3746                 for ( int j=0; j<makeList[i].size(); ++j) {
  3749                 for (int j=0; j<makeList[i].size(); ++j) {
  3747                     MakeItem *it=makeList[i][j];
  3750                     MakeItem *it=makeList[i][j];
  3748                     QString dirPath = fixSeparators( it->directory + "/" );
  3751                     QString dirPath = fixSeparators(it->directory + "/");
  3749                     QString projectName = it->proFile;
  3752                     QString projectName = it->proFile;
  3750                     QString makefileName = buildPath + "/" + dirPath + it->target;
  3753                     QString makefileName = buildPath + "/" + dirPath + it->target;
  3751 
  3754 
  3752                     // For shadowbuilds, we need to create the path first
  3755                     // For shadowbuilds, we need to create the path first
  3753                     QDir buildPathDir(buildPath);
  3756                     QDir buildPathDir(buildPath);
  3754                     if (sourcePath != buildPath && !buildPathDir.exists(dirPath))
  3757                     if (sourcePath != buildPath && !buildPathDir.exists(dirPath))
  3755                         buildPathDir.mkpath(dirPath);
  3758                         buildPathDir.mkpath(dirPath);
  3756 
  3759 
  3757                     QStringList args;
  3760                     QStringList args;
  3758 
  3761 
  3759                     args << fixSeparators( buildPath + "/bin/qmake" );
  3762                     args << fixSeparators(buildPath + "/bin/qmake");
  3760                     args << sourcePath + "/" + dirPath + projectName;
  3763                     args << sourcePath + "/" + dirPath + projectName;
  3761                     args << dictionary[ "QMAKE_ALL_ARGS" ];
  3764                     args << dictionary[ "QMAKE_ALL_ARGS" ];
  3762 
  3765 
  3763                     cout << "For " << qPrintable(dirPath + projectName) << endl;
  3766                     cout << "For " << qPrintable(dirPath + projectName) << endl;
  3764                     args << "-o";
  3767                     args << "-o";
  3765                     args << it->target;
  3768                     args << it->target;
  3766                     args << "-spec";
  3769                     args << "-spec";
  3767                     args << spec;
  3770                     args << spec;
  3768                     if(!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty())
  3771                     if (!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty())
  3769                         args << dictionary[ "QMAKEADDITIONALARGS" ];
  3772                         args << dictionary[ "QMAKEADDITIONALARGS" ];
  3770 
  3773 
  3771                     QDir::setCurrent( fixSeparators( dirPath ) );
  3774                     QDir::setCurrent(fixSeparators(dirPath));
  3772 
  3775 
  3773                     QFile file(makefileName);
  3776                     QFile file(makefileName);
  3774                     if (!file.open(QFile::WriteOnly)) {
  3777                     if (!file.open(QFile::WriteOnly)) {
  3775                         printf("failed on dirPath=%s, makefile=%s\n",
  3778                         printf("failed on dirPath=%s, makefile=%s\n",
  3776                             qPrintable(dirPath), qPrintable(makefileName));
  3779                             qPrintable(dirPath), qPrintable(makefileName));
  3784                     txt << "qmake:\n";
  3787                     txt << "qmake:\n";
  3785                     txt << "\t" << args.join(" ") << "\n";
  3788                     txt << "\t" << args.join(" ") << "\n";
  3786                 }
  3789                 }
  3787             }
  3790             }
  3788         }
  3791         }
  3789         QDir::setCurrent( pwd );
  3792         QDir::setCurrent(pwd);
  3790     } else {
  3793     } else {
  3791         cout << "Processing of project files have been disabled." << endl;
  3794         cout << "Processing of project files have been disabled." << endl;
  3792         cout << "Only use this option if you really know what you're doing." << endl << endl;
  3795         cout << "Only use this option if you really know what you're doing." << endl << endl;
  3793         return;
  3796         return;
  3794     }
  3797     }
  3798 {
  3801 {
  3799     QString make = dictionary[ "MAKE" ];
  3802     QString make = dictionary[ "MAKE" ];
  3800     if (!dictionary.contains("XQMAKESPEC")) {
  3803     if (!dictionary.contains("XQMAKESPEC")) {
  3801         cout << endl << endl << "Qt is now configured for building. Just run " << qPrintable(make) << "." << endl;
  3804         cout << endl << endl << "Qt is now configured for building. Just run " << qPrintable(make) << "." << endl;
  3802         cout << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl;
  3805         cout << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl;
  3803     } else if(dictionary.value("QMAKESPEC").startsWith("wince")) {
  3806     } else if (dictionary.value("QMAKESPEC").startsWith("wince")) {
  3804         // we are cross compiling for Windows CE
  3807         // we are cross compiling for Windows CE
  3805         cout << endl << endl << "Qt is now configured for building. To start the build run:" << endl
  3808         cout << endl << endl << "Qt is now configured for building. To start the build run:" << endl
  3806              << "\tsetcepaths " << dictionary.value("XQMAKESPEC") << endl
  3809              << "\tsetcepaths " << dictionary.value("XQMAKESPEC") << endl
  3807              << "\t" << qPrintable(make) << endl
  3810              << "\t" << qPrintable(make) << endl
  3808              << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl;
  3811              << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl;
  3810         cout << endl << endl << "Qt is now configured for building. To start the build run:" << qPrintable(dictionary["QTBUILDINSTRUCTION"]) << "." << endl
  3813         cout << endl << endl << "Qt is now configured for building. To start the build run:" << qPrintable(dictionary["QTBUILDINSTRUCTION"]) << "." << endl
  3811         << "To reconfigure, run '" << qPrintable(dictionary["CONFCLEANINSTRUCTION"]) << "' and configure." << endl;
  3814         << "To reconfigure, run '" << qPrintable(dictionary["CONFCLEANINSTRUCTION"]) << "' and configure." << endl;
  3812     }
  3815     }
  3813 }
  3816 }
  3814 
  3817 
  3815 Configure::ProjectType Configure::projectType( const QString& proFileName )
  3818 Configure::ProjectType Configure::projectType(const QString& proFileName)
  3816 {
  3819 {
  3817     QFile proFile( proFileName );
  3820     QFile proFile(proFileName);
  3818     if( proFile.open( QFile::ReadOnly ) ) {
  3821     if (proFile.open(QFile::ReadOnly)) {
  3819         QString buffer = proFile.readLine(1024);
  3822         QString buffer = proFile.readLine(1024);
  3820         while (!buffer.isEmpty()) {
  3823         while (!buffer.isEmpty()) {
  3821             QStringList segments = buffer.split(QRegExp( "\\s" ));
  3824             QStringList segments = buffer.split(QRegExp("\\s"));
  3822             QStringList::Iterator it = segments.begin();
  3825             QStringList::Iterator it = segments.begin();
  3823 
  3826 
  3824             if(segments.size() >= 3) {
  3827             if (segments.size() >= 3) {
  3825                 QString keyword = (*it++);
  3828                 QString keyword = (*it++);
  3826                 QString operation = (*it++);
  3829                 QString operation = (*it++);
  3827                 QString value = (*it++);
  3830                 QString value = (*it++);
  3828 
  3831 
  3829                 if( keyword == "TEMPLATE" ) {
  3832                 if (keyword == "TEMPLATE") {
  3830                     if( value == "lib" )
  3833                     if (value == "lib")
  3831                         return Lib;
  3834                         return Lib;
  3832                     else if( value == "subdirs" )
  3835                     else if (value == "subdirs")
  3833                         return Subdirs;
  3836                         return Subdirs;
  3834                 }
  3837                 }
  3835             }
  3838             }
  3836             // read next line
  3839             // read next line
  3837             buffer = proFile.readLine(1024);
  3840             buffer = proFile.readLine(1024);
  3913             if (!file.open(QFile::ReadOnly)) {
  3916             if (!file.open(QFile::ReadOnly)) {
  3914                 cout << "Failed to load LICENSE file" << licenseFile << endl;
  3917                 cout << "Failed to load LICENSE file" << licenseFile << endl;
  3915                 return false;
  3918                 return false;
  3916             }
  3919             }
  3917             QStringList licenseContent = QString(file.readAll()).split('\n');
  3920             QStringList licenseContent = QString(file.readAll()).split('\n');
  3918             while(i < licenseContent.size()) {
  3921             while (i < licenseContent.size()) {
  3919                 cout << licenseContent.at(i) << endl;
  3922                 cout << licenseContent.at(i) << endl;
  3920                 if (++i % screenHeight == 0) {
  3923                 if (++i % screenHeight == 0) {
  3921                     cout << "(Press any key for more..)";
  3924                     cout << "(Press any key for more..)";
  3922                     if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
  3925                     if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
  3923                         exit(0);      // Exit cleanly for Ctrl+C
  3926                         exit(0);      // Exit cleanly for Ctrl+C
  3924                     cout << "\r";     // Overwrite text above
  3927                     cout << "\r";     // Overwrite text above
  3925                 }
  3928                 }
  3926             }
  3929             }
  3927         }
  3930         }
  3999 #endif
  4002 #endif
  4000 }
  4003 }
  4001 
  4004 
  4002 void Configure::reloadCmdLine()
  4005 void Configure::reloadCmdLine()
  4003 {
  4006 {
  4004     if( dictionary[ "REDO" ] == "yes" ) {
  4007     if (dictionary[ "REDO" ] == "yes") {
  4005         QFile inFile( buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache" );
  4008         QFile inFile(buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache");
  4006         if( inFile.open( QFile::ReadOnly ) ) {
  4009         if (inFile.open(QFile::ReadOnly)) {
  4007             QTextStream inStream( &inFile );
  4010             QTextStream inStream(&inFile);
  4008             QString buffer;
  4011             QString buffer;
  4009             inStream >> buffer;
  4012             inStream >> buffer;
  4010             while( buffer.length() ) {
  4013             while (buffer.length()) {
  4011                 configCmdLine += buffer;
  4014                 configCmdLine += buffer;
  4012                 inStream >> buffer;
  4015                 inStream >> buffer;
  4013             }
  4016             }
  4014             inFile.close();
  4017             inFile.close();
  4015         }
  4018         }
  4016     }
  4019     }
  4017 }
  4020 }
  4018 
  4021 
  4019 void Configure::saveCmdLine()
  4022 void Configure::saveCmdLine()
  4020 {
  4023 {
  4021     if( dictionary[ "REDO" ] != "yes" ) {
  4024     if (dictionary[ "REDO" ] != "yes") {
  4022         QFile outFile( buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache" );
  4025         QFile outFile(buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache");
  4023         if( outFile.open( QFile::WriteOnly | QFile::Text ) ) {
  4026         if (outFile.open(QFile::WriteOnly | QFile::Text)) {
  4024             QTextStream outStream( &outFile );
  4027             QTextStream outStream(&outFile);
  4025             for( QStringList::Iterator it = configCmdLine.begin(); it != configCmdLine.end(); ++it ) {
  4028             for (QStringList::Iterator it = configCmdLine.begin(); it != configCmdLine.end(); ++it) {
  4026                 outStream << (*it) << " " << endl;
  4029                 outStream << (*it) << " " << endl;
  4027             }
  4030             }
  4028             outStream.flush();
  4031             outStream.flush();
  4029             outFile.close();
  4032             outFile.close();
  4030         }
  4033         }
  4044 
  4047 
  4045 bool
  4048 bool
  4046 Configure::filesDiffer(const QString &fn1, const QString &fn2)
  4049 Configure::filesDiffer(const QString &fn1, const QString &fn2)
  4047 {
  4050 {
  4048     QFile file1(fn1), file2(fn2);
  4051     QFile file1(fn1), file2(fn2);
  4049     if(!file1.open(QFile::ReadOnly) || !file2.open(QFile::ReadOnly))
  4052     if (!file1.open(QFile::ReadOnly) || !file2.open(QFile::ReadOnly))
  4050         return true;
  4053         return true;
  4051     const int chunk = 2048;
  4054     const int chunk = 2048;
  4052     int used1 = 0, used2 = 0;
  4055     int used1 = 0, used2 = 0;
  4053     char b1[chunk], b2[chunk];
  4056     char b1[chunk], b2[chunk];
  4054     while(!file1.atEnd() && !file2.atEnd()) {
  4057     while (!file1.atEnd() && !file2.atEnd()) {
  4055         if(!used1)
  4058         if (!used1)
  4056             used1 = file1.read(b1, chunk);
  4059             used1 = file1.read(b1, chunk);
  4057         if(!used2)
  4060         if (!used2)
  4058             used2 = file2.read(b2, chunk);
  4061             used2 = file2.read(b2, chunk);
  4059         if(used1 > 0 && used2 > 0) {
  4062         if (used1 > 0 && used2 > 0) {
  4060             const int cmp = qMin(used1, used2);
  4063             const int cmp = qMin(used1, used2);
  4061             if(memcmp(b1, b2, cmp))
  4064             if (memcmp(b1, b2, cmp))
  4062                 return true;
  4065                 return true;
  4063             if((used1 -= cmp))
  4066             if ((used1 -= cmp))
  4064                 memcpy(b1, b1+cmp, used1);
  4067                 memcpy(b1, b1+cmp, used1);
  4065             if((used2 -= cmp))
  4068             if ((used2 -= cmp))
  4066                 memcpy(b2, b2+cmp, used2);
  4069                 memcpy(b2, b2+cmp, used2);
  4067         }
  4070         }
  4068     }
  4071     }
  4069     return !file1.atEnd() || !file2.atEnd();
  4072     return !file1.atEnd() || !file2.atEnd();
  4070 }
  4073 }