Changeset 846 for trunk/tools/configure


Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tools/configure/configure.pro

    r769 r846  
    11TARGET    = configure
    2 DESTDIR   = ../..
     2DESTDIR   = $$PWD/../..  # build directly in source dir
    33
    44CONFIG   += console flat
     
    99win32 : LIBS += -lole32 -ladvapi32
    1010win32-msvc.net | win32-msvc2* : QMAKE_CXXFLAGS += /EHsc
    11 win32-g++ : LIBS += -luuid
     11win32-g++* : LIBS += -luuid
    1212
    1313win32-msvc* {
     
    2424PRECOMPILED_HEADER = configure_pch.h
    2525
    26 INCPATH += $$QT_SOURCE_TREE/src/corelib/arch/generic \
     26INCLUDEPATH += \
     27           $$QT_SOURCE_TREE/src/corelib/arch/generic \
    2728           $$QT_SOURCE_TREE/src/corelib/global \
    2829           $$QT_BUILD_TREE/include \
    2930           $$QT_BUILD_TREE/include/QtCore \
    30            $$QT_BUILD_TREE/tools/shared
     31           $$QT_SOURCE_TREE/tools/shared
    3132
    3233HEADERS  = configureapp.h environment.h tools.h\
     
    6364           $$QT_SOURCE_TREE/src/corelib/xml/qxmlstream.h \
    6465           $$QT_SOURCE_TREE/src/corelib/xml/qxmlutils_p.h \
    65            $$QT_SOURCE_TREE/tools/shared/symbian/epocroot.h \
    66            $$QT_SOURCE_TREE/tools/shared/windows/registry.h
     66           $$QT_SOURCE_TREE/tools/shared/symbian/epocroot_p.h \
     67           $$QT_SOURCE_TREE/tools/shared/windows/registry_p.h
    6768
    6869
     
    9293           $$QT_SOURCE_TREE/src/corelib/io/qtextstream.cpp \
    9394           $$QT_SOURCE_TREE/src/corelib/io/qtemporaryfile.cpp \
     95           $$QT_SOURCE_TREE/src/corelib/plugin/qsystemlibrary.cpp \
    9496           $$QT_SOURCE_TREE/src/corelib/tools/qbitarray.cpp \
    9597           $$QT_SOURCE_TREE/src/corelib/tools/qdatetime.cpp \
     
    120122INCLUDEPATH += $$QT_SOURCE_TREE/src/corelib/arch/generic \
    121123               $$QT_SOURCE_TREE/include/QtCore \
     124               $$QT_SOURCE_TREE/tools/shared
  • trunk/tools/configure/configure_pch.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/configure/configureapp.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    6262QT_BEGIN_NAMESPACE
    6363
    64 std::ostream &operator<<( std::ostream &s, const QString &val ) {
     64std::ostream &operator<<(std::ostream &s, const QString &val) {
    6565    s << val.toLocal8Bit().data();
    6666    return s;
     
    9090}
    9191
    92 Configure::Configure( int& argc, char** argv )
     92Configure::Configure(int& argc, char** argv)
    9393{
    9494    useUnixSeparators = false;
     
    112112    dictionary[ "CONFIGCMD" ] = argv[ 0 ];
    113113
    114     for ( i = 1; i < argc; i++ )
     114    for (i = 1; i < argc; i++)
    115115        configCmdLine += argv[ i ];
    116116
     
    128128    const QString installPath = buildPath;
    129129#endif
    130     if(sourceDir != buildDir) { //shadow builds!
     130    if (sourceDir != buildDir) { //shadow builds!
    131131        if (!findFile("perl") && !findFile("perl.exe")) {
    132132            cout << "Error: Creating a shadow build of Qt requires" << endl
     
    141141            QStack<QString> qmake_dirs;
    142142            qmake_dirs.push("qmake");
    143             while(!qmake_dirs.isEmpty()) {
     143            while (!qmake_dirs.isEmpty()) {
    144144                QString dir = qmake_dirs.pop();
    145145                QString od(buildPath + "/" + dir);
    146146                QString id(sourcePath + "/" + dir);
    147147                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) {
    149149                    QFileInfo fi(entries.at(i));
    150                     if(fi.isDir()) {
     150                    if (fi.isDir()) {
    151151                        qmake_dirs.push(dir + "/" + fi.fileName());
    152152                        QDir().mkpath(od + "/" + fi.fileName());
    153153                    } else {
    154                         QDir().mkpath(od );
     154                        QDir().mkpath(od);
    155155                        bool justCopy = true;
    156156                        const QString fname = fi.fileName();
    157157                        const QString outFile(od + "/" + fname), inFile(id + "/" + fname);
    158                         if(fi.fileName() == "Makefile") { //ignore
    159                         } else if(fi.suffix() == "h" || fi.suffix() == "cpp") {
     158                        if (fi.fileName() == "Makefile") { //ignore
     159                        } else if (fi.suffix() == "h" || fi.suffix() == "cpp") {
    160160                            QTemporaryFile tmpFile;
    161                             if(tmpFile.open()) {
     161                            if (tmpFile.open()) {
    162162                                QTextStream stream(&tmpFile);
    163163                                stream << "#include \"" << inFile << "\"" << endl;
     
    165165                                stream.flush();
    166166                                tmpFile.flush();
    167                                 if(filesDiffer(tmpFile.fileName(), outFile)) {
     167                                if (filesDiffer(tmpFile.fileName(), outFile)) {
    168168                                    QFile::remove(outFile);
    169169                                    tmpFile.copy(outFile);
     
    171171                            }
    172172                        }
    173                         if(justCopy && filesDiffer(inFile, outFile))
     173                        if (justCopy && filesDiffer(inFile, outFile))
    174174                            QFile::copy(inFile, outFile);
    175175                    }
     
    180180        { //make a syncqt script(s) that can be used in the shadow
    181181            QFile syncqt(buildPath + "/bin/syncqt");
    182             if(syncqt.open(QFile::WriteOnly)) {
     182            if (syncqt.open(QFile::WriteOnly)) {
    183183                QTextStream stream(&syncqt);
    184184                stream << "#!/usr/bin/perl -w" << endl
     
    186186            }
    187187            QFile syncqt_bat(buildPath + "/bin/syncqt.bat");
    188             if(syncqt_bat.open(QFile::WriteOnly)) {
     188            if (syncqt_bat.open(QFile::WriteOnly)) {
    189189                QTextStream stream(&syncqt_bat);
    190190                stream << "@echo off" << endl
     
    196196        }
    197197
     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");
     200        if (patch_capabilities.open(QFile::WriteOnly)) {
     201            QTextStream stream(&patch_capabilities);
     202            stream << "#!/usr/bin/perl -w" << endl
     203                   << "require \"" << sourcePath + "/bin/patch_capabilities\";" << endl;
     204        }
     205        QFile patch_capabilities_bat(buildPath + "/bin/patch_capabilities.bat");
     206        if (patch_capabilities_bat.open(QFile::WriteOnly)) {
     207            QTextStream stream(&patch_capabilities_bat);
     208            stream << "@echo off" << endl
     209                   << "call " << fixSeparators(sourcePath) << fixSeparators("/bin/patch_capabilities.bat %*") << endl;
     210            patch_capabilities_bat.close();
     211        }
     212        QFile createpackage(buildPath + "/bin/createpackage");
     213        if (createpackage.open(QFile::WriteOnly)) {
     214            QTextStream stream(&createpackage);
     215            stream << "#!/usr/bin/perl -w" << endl
     216                   << "require \"" << sourcePath + "/bin/createpackage\";" << endl;
     217        }
     218        QFile createpackage_bat(buildPath + "/bin/createpackage.bat");
     219        if (createpackage_bat.open(QFile::WriteOnly)) {
     220            QTextStream stream(&createpackage_bat);
     221            stream << "@echo off" << endl
     222                   << "call " << fixSeparators(sourcePath) << fixSeparators("/bin/createpackage.bat %*") << endl;
     223            createpackage_bat.close();
     224        }
     225
    198226        // For Windows CE and shadow builds we need to copy these to the
    199227        // build directory.
    200228        QFile::copy(sourcePath + "/bin/setcepaths.bat" , buildPath + "/bin/setcepaths.bat");
    201 
    202229        //copy the mkspecs
    203230        buildDir.mkpath("mkspecs");
    204         if(!Environment::cpdir(sourcePath + "/mkspecs", buildPath + "/mkspecs")){
     231        if (!Environment::cpdir(sourcePath + "/mkspecs", buildPath + "/mkspecs")){
    205232            cout << "Couldn't copy mkspecs!" << sourcePath << " " << buildPath << endl;
    206233            dictionary["DONE"] = "error";
     
    249276    dictionary[ "MULTIMEDIA" ]      = "yes";
    250277    dictionary[ "AUDIO_BACKEND" ]   = "auto";
     278    dictionary[ "WMSDK" ]           = "auto";
    251279    dictionary[ "DIRECTSHOW" ]      = "no";
    252280    dictionary[ "WEBKIT" ]          = "auto";
    253281    dictionary[ "DECLARATIVE" ]     = "auto";
     282    dictionary[ "DECLARATIVE_DEBUG" ]= "yes";
    254283    dictionary[ "PLUGIN_MANIFESTS" ] = "yes";
    255284
     
    277306    {
    278307        QRegExp version_re("([0-9]*)\\.([0-9]*)\\.([0-9]*)(|-.*)");
    279         if(version_re.exactMatch(version)) {
     308        if (version_re.exactMatch(version)) {
    280309            dictionary[ "VERSION_MAJOR" ] = version_re.cap(1);
    281310            dictionary[ "VERSION_MINOR" ] = version_re.cap(2);
     
    314343    dictionary[ "OPENGL" ]          = "yes";
    315344    dictionary[ "OPENVG" ]          = "no";
    316     dictionary[ "IPV6" ]            = "yes"; // Always, dynamicly loaded
     345    dictionary[ "IPV6" ]            = "yes"; // Always, dynamically loaded
    317346    dictionary[ "OPENSSL" ]         = "auto";
    318347    dictionary[ "DBUS" ]            = "auto";
     
    345374    QString tmp = dictionary[ "QMAKESPEC" ];
    346375    if (tmp.contains("\\")) {
    347         tmp = tmp.mid( tmp.lastIndexOf( "\\" ) + 1 );
     376        tmp = tmp.mid(tmp.lastIndexOf("\\") + 1);
    348377    } else {
    349         tmp = tmp.mid( tmp.lastIndexOf("/") + 1 );
     378        tmp = tmp.mid(tmp.lastIndexOf("/") + 1);
    350379    }
    351380    dictionary[ "QMAKESPEC" ] = tmp;
     
    354383    dictionary[ "LTCG" ]            = "no";
    355384    dictionary[ "NATIVE_GESTURES" ] = "yes";
     385    dictionary[ "MSVC_MP" ] = "no";
    356386}
    357387
     
    365395}
    366396
    367 QString Configure::fixSeparators(QString somePath)
    368 {
    369     return useUnixSeparators ?
    370            QDir::fromNativeSeparators(somePath) :
    371            QDir::toNativeSeparators(somePath);
     397QString Configure::fixSeparators(const QString &somePath, bool escape)
     398{
     399    if (useUnixSeparators)
     400        return QDir::fromNativeSeparators(somePath);
     401    QString ret = QDir::toNativeSeparators(somePath);
     402    return escape ? escapeSeparators(ret) : ret;
     403}
     404
     405QString Configure::escapeSeparators(const QString &somePath)
     406{
     407    QString out = somePath;
     408    out.replace(QLatin1Char('\\'), QLatin1String("\\\\"));
     409    return out;
    372410}
    373411
     
    404442    if (argCount < 1) // skip rest if no arguments
    405443        ;
    406     else if( configCmdLine.at(i) == "-redo" ) {
     444    else if (configCmdLine.at(i) == "-redo") {
    407445        dictionary[ "REDO" ] = "yes";
    408446        configCmdLine.clear();
    409447        reloadCmdLine();
    410448    }
    411     else if( configCmdLine.at(i) == "-loadconfig" ) {
     449    else if (configCmdLine.at(i) == "-loadconfig") {
    412450        ++i;
    413451        if (i != argCount) {
     
    425463
    426464    // Look first for XQMAKESPEC
    427     for(int j = 0 ; j < argCount; ++j)
     465    for (int j = 0 ; j < argCount; ++j)
    428466    {
    429         if( configCmdLine.at(j) == "-xplatform") {
     467        if (configCmdLine.at(j) == "-xplatform") {
    430468            ++j;
    431469            if (j == argCount)
     
    437475    }
    438476
    439     for( ; i<configCmdLine.size(); ++i ) {
     477    for (; i<configCmdLine.size(); ++i) {
    440478        bool continueElse[] = {false, false};
    441         if( configCmdLine.at(i) == "-help"
     479        if (configCmdLine.at(i) == "-help"
    442480            || configCmdLine.at(i) == "-h"
    443             || configCmdLine.at(i) == "-?" )
     481            || configCmdLine.at(i) == "-?")
    444482            dictionary[ "HELP" ] = "yes";
    445483
    446484#if !defined(EVAL)
    447         else if( configCmdLine.at(i) == "-qconfig" ) {
     485        else if (configCmdLine.at(i) == "-qconfig") {
    448486            ++i;
    449             if (i==argCount)
     487            if (i == argCount)
    450488                break;
    451489            dictionary[ "QCONFIG" ] = configCmdLine.at(i);
    452490        }
    453491
    454         else if ( configCmdLine.at(i) == "-buildkey" ) {
     492        else if (configCmdLine.at(i) == "-buildkey") {
    455493            ++i;
    456             if (i==argCount)
     494            if (i == argCount)
    457495                break;
    458496            dictionary[ "USER_BUILD_KEY" ] = configCmdLine.at(i);
    459497        }
    460498
    461         else if( configCmdLine.at(i) == "-release" ) {
     499        else if (configCmdLine.at(i) == "-release") {
    462500            dictionary[ "BUILD" ] = "release";
    463501            if (dictionary[ "BUILDALL" ] == "auto")
    464502                dictionary[ "BUILDALL" ] = "no";
    465         } else if( configCmdLine.at(i) == "-debug" ) {
     503        } else if (configCmdLine.at(i) == "-debug") {
    466504            dictionary[ "BUILD" ] = "debug";
    467505            if (dictionary[ "BUILDALL" ] == "auto")
    468506                dictionary[ "BUILDALL" ] = "no";
    469         } else if( configCmdLine.at(i) == "-debug-and-release" )
     507        } else if (configCmdLine.at(i) == "-debug-and-release")
    470508            dictionary[ "BUILDALL" ] = "yes";
    471509
    472         else if( configCmdLine.at(i) == "-shared" )
     510        else if (configCmdLine.at(i) == "-shared")
    473511            dictionary[ "SHARED" ] = "yes";
    474         else if( configCmdLine.at(i) == "-static" )
     512        else if (configCmdLine.at(i) == "-static")
    475513            dictionary[ "SHARED" ] = "no";
    476         else if( configCmdLine.at(i) == "-developer-build" )
     514        else if (configCmdLine.at(i) == "-developer-build")
    477515            dictionary[ "BUILDDEV" ] = "yes";
    478         else if( configCmdLine.at(i) == "-nokia-developer" ) {
     516        else if (configCmdLine.at(i) == "-nokia-developer") {
    479517            cout << "Detected -nokia-developer option" << endl;
    480518            cout << "Nokia employees and agents are allowed to use this software under" << endl;
     
    487525            }
    488526        }
    489         else if( configCmdLine.at(i) == "-opensource" ) {
     527        else if (configCmdLine.at(i) == "-opensource") {
    490528            dictionary[ "BUILDTYPE" ] = "opensource";
    491529        }
    492         else if( configCmdLine.at(i) == "-commercial" ) {
     530        else if (configCmdLine.at(i) == "-commercial") {
    493531            dictionary[ "BUILDTYPE" ] = "commercial";
    494532        }
    495         else if( configCmdLine.at(i) == "-ltcg" ) {
     533        else if (configCmdLine.at(i) == "-ltcg") {
    496534            dictionary[ "LTCG" ] = "yes";
    497535        }
    498         else if( configCmdLine.at(i) == "-no-ltcg" ) {
     536        else if (configCmdLine.at(i) == "-no-ltcg") {
    499537            dictionary[ "LTCG" ] = "no";
    500538        }
     539        else if (configCmdLine.at(i) == "-mp") {
     540            dictionary[ "MSVC_MP" ] = "yes";
     541        }
     542        else if (configCmdLine.at(i) == "-no-mp") {
     543            dictionary[ "MSVC_MP" ] = "no";
     544        }
     545
    501546#endif
    502547
    503         else if( configCmdLine.at(i) == "-platform" ) {
     548        else if (configCmdLine.at(i) == "-platform") {
    504549            ++i;
    505             if (i==argCount)
     550            if (i == argCount)
    506551                break;
    507552            dictionary[ "QMAKESPEC" ] = configCmdLine.at(i);
    508553        dictionary[ "QMAKESPEC_FROM" ] = "commandline";
    509         } else if( configCmdLine.at(i) == "-arch" ) {
     554        } else if (configCmdLine.at(i) == "-arch") {
    510555            ++i;
    511             if (i==argCount)
     556            if (i == argCount)
    512557                break;
    513558            dictionary[ "ARCHITECTURE" ] = configCmdLine.at(i);
     
    516561                qtConfig += "boundschecker";                // but also needs this CONFIG option
    517562            }
    518         } else if( configCmdLine.at(i) == "-embedded" ) {
     563        } else if (configCmdLine.at(i) == "-embedded") {
    519564            dictionary[ "EMBEDDED" ] = "yes";
    520         } else if( configCmdLine.at(i) == "-xplatform") {
     565        } else if (configCmdLine.at(i) == "-xplatform") {
    521566            ++i;
    522567            // do nothing
     
    525570
    526571#if !defined(EVAL)
    527         else if( configCmdLine.at(i) == "-no-zlib" ) {
     572        else if (configCmdLine.at(i) == "-no-zlib") {
    528573            // No longer supported since Qt 4.4.0
    529574            // But save the information for later so that we can print a warning
     
    537582
    538583            dictionary[ "ZLIB_FORCED" ] = "yes";
    539         } else if( configCmdLine.at(i) == "-qt-zlib" ) {
     584        } else if (configCmdLine.at(i) == "-qt-zlib") {
    540585            dictionary[ "ZLIB" ] = "qt";
    541         } else if( configCmdLine.at(i) == "-system-zlib" ) {
     586        } else if (configCmdLine.at(i) == "-system-zlib") {
    542587            dictionary[ "ZLIB" ] = "system";
    543588        }
    544589
    545590        // Image formats --------------------------------------------
    546         else if( configCmdLine.at(i) == "-no-gif" )
     591        else if (configCmdLine.at(i) == "-no-gif")
    547592            dictionary[ "GIF" ] = "no";
    548         else if( configCmdLine.at(i) == "-qt-gif" )
    549             dictionary[ "GIF" ] = "auto";
    550 
    551         else if( configCmdLine.at(i) == "-no-libtiff" ) {
    552               dictionary[ "TIFF"] = "no";
    553               dictionary[ "LIBTIFF" ] = "no";
    554         } else if( configCmdLine.at(i) == "-qt-libtiff" ) {
    555             dictionary[ "TIFF" ] = "plugin";
     593        else if (configCmdLine.at(i) == "-qt-gif")
     594            dictionary[ "GIF" ] = "plugin";
     595
     596        else if (configCmdLine.at(i) == "-no-libtiff") {
     597            dictionary[ "TIFF"] = "no";
     598            dictionary[ "LIBTIFF" ] = "no";
     599        } else if (configCmdLine.at(i) == "-qt-libtiff") {
    556600            dictionary[ "LIBTIFF" ] = "qt";
    557         } else if( configCmdLine.at(i) == "-system-libtiff" ) {
    558               dictionary[ "TIFF" ] = "plugin";
    559               dictionary[ "LIBTIFF" ] = "system";
    560         }
    561 
    562         else if( configCmdLine.at(i) == "-no-libjpeg" ) {
     601        } else if (configCmdLine.at(i) == "-system-libtiff") {
     602            dictionary[ "LIBTIFF" ] = "system";
     603        }
     604
     605        else if (configCmdLine.at(i) == "-no-libjpeg") {
    563606            dictionary[ "JPEG" ] = "no";
    564607            dictionary[ "LIBJPEG" ] = "no";
    565         } else if( configCmdLine.at(i) == "-qt-libjpeg" ) {
    566             dictionary[ "JPEG" ] = "plugin";
     608        } else if (configCmdLine.at(i) == "-qt-libjpeg") {
    567609            dictionary[ "LIBJPEG" ] = "qt";
    568         } else if( configCmdLine.at(i) == "-system-libjpeg" ) {
    569             dictionary[ "JPEG" ] = "plugin";
     610        } else if (configCmdLine.at(i) == "-system-libjpeg") {
    570611            dictionary[ "LIBJPEG" ] = "system";
    571612        }
    572613
    573         else if( configCmdLine.at(i) == "-no-libpng" ) {
     614        else if (configCmdLine.at(i) == "-no-libpng") {
    574615            dictionary[ "PNG" ] = "no";
    575616            dictionary[ "LIBPNG" ] = "no";
    576         } else if( configCmdLine.at(i) == "-qt-libpng" ) {
    577             dictionary[ "PNG" ] = "qt";
     617        } else if (configCmdLine.at(i) == "-qt-libpng") {
    578618            dictionary[ "LIBPNG" ] = "qt";
    579         } else if( configCmdLine.at(i) == "-system-libpng" ) {
    580             dictionary[ "PNG" ] = "qt";
     619        } else if (configCmdLine.at(i) == "-system-libpng") {
    581620            dictionary[ "LIBPNG" ] = "system";
    582621        }
    583622
    584         else if( configCmdLine.at(i) == "-no-libmng" ) {
     623        else if (configCmdLine.at(i) == "-no-libmng") {
    585624            dictionary[ "MNG" ] = "no";
    586625            dictionary[ "LIBMNG" ] = "no";
    587         } else if( configCmdLine.at(i) == "-qt-libmng" ) {
    588             dictionary[ "MNG" ] = "qt";
     626        } else if (configCmdLine.at(i) == "-qt-libmng") {
    589627            dictionary[ "LIBMNG" ] = "qt";
    590         } else if( configCmdLine.at(i) == "-system-libmng" ) {
    591             dictionary[ "MNG" ] = "qt";
     628        } else if (configCmdLine.at(i) == "-system-libmng") {
    592629            dictionary[ "LIBMNG" ] = "system";
    593630        }
    594631
    595632        // Text Rendering --------------------------------------------
    596         else if( configCmdLine.at(i) == "-no-freetype" )
     633        else if (configCmdLine.at(i) == "-no-freetype")
    597634            dictionary[ "FREETYPE" ] = "no";
    598         else if( configCmdLine.at(i) == "-qt-freetype" )
     635        else if (configCmdLine.at(i) == "-qt-freetype")
    599636            dictionary[ "FREETYPE" ] = "yes";
    600637
    601638        // CE- C runtime --------------------------------------------
    602         else if( configCmdLine.at(i) == "-crt" ) {
     639        else if (configCmdLine.at(i) == "-crt") {
    603640            ++i;
    604             if (i==argCount)
     641            if (i == argCount)
    605642                break;
    606643            QDir cDir(configCmdLine.at(i));
     
    626663        }
    627664        // Qt/CE - signing tool -------------------------------------
    628         else if( configCmdLine.at(i) == "-signature") {
     665        else if (configCmdLine.at(i) == "-signature") {
    629666            ++i;
    630             if (i==argCount)
     667            if (i == argCount)
    631668                break;
    632669            QFileInfo info(configCmdLine.at(i));
     
    637674        }
    638675        // Styles ---------------------------------------------------
    639         else if( configCmdLine.at(i) == "-qt-style-windows" )
     676        else if (configCmdLine.at(i) == "-qt-style-windows")
    640677            dictionary[ "STYLE_WINDOWS" ] = "yes";
    641         else if( configCmdLine.at(i) == "-no-style-windows" )
     678        else if (configCmdLine.at(i) == "-no-style-windows")
    642679            dictionary[ "STYLE_WINDOWS" ] = "no";
    643680
    644         else if( configCmdLine.at(i) == "-qt-style-windowsce" )
     681        else if (configCmdLine.at(i) == "-qt-style-windowsce")
    645682            dictionary[ "STYLE_WINDOWSCE" ] = "yes";
    646         else if( configCmdLine.at(i) == "-no-style-windowsce" )
     683        else if (configCmdLine.at(i) == "-no-style-windowsce")
    647684            dictionary[ "STYLE_WINDOWSCE" ] = "no";
    648         else if( configCmdLine.at(i) == "-qt-style-windowsmobile" )
     685        else if (configCmdLine.at(i) == "-qt-style-windowsmobile")
    649686            dictionary[ "STYLE_WINDOWSMOBILE" ] = "yes";
    650         else if( configCmdLine.at(i) == "-no-style-windowsmobile" )
     687        else if (configCmdLine.at(i) == "-no-style-windowsmobile")
    651688            dictionary[ "STYLE_WINDOWSMOBILE" ] = "no";
    652689
    653         else if( configCmdLine.at(i) == "-qt-style-windowsxp" )
     690        else if (configCmdLine.at(i) == "-qt-style-windowsxp")
    654691            dictionary[ "STYLE_WINDOWSXP" ] = "yes";
    655         else if( configCmdLine.at(i) == "-no-style-windowsxp" )
     692        else if (configCmdLine.at(i) == "-no-style-windowsxp")
    656693            dictionary[ "STYLE_WINDOWSXP" ] = "no";
    657694
    658         else if( configCmdLine.at(i) == "-qt-style-windowsvista" )
     695        else if (configCmdLine.at(i) == "-qt-style-windowsvista")
    659696            dictionary[ "STYLE_WINDOWSVISTA" ] = "yes";
    660         else if( configCmdLine.at(i) == "-no-style-windowsvista" )
     697        else if (configCmdLine.at(i) == "-no-style-windowsvista")
    661698            dictionary[ "STYLE_WINDOWSVISTA" ] = "no";
    662699
    663         else if( configCmdLine.at(i) == "-qt-style-plastique" )
     700        else if (configCmdLine.at(i) == "-qt-style-plastique")
    664701            dictionary[ "STYLE_PLASTIQUE" ] = "yes";
    665         else if( configCmdLine.at(i) == "-no-style-plastique" )
     702        else if (configCmdLine.at(i) == "-no-style-plastique")
    666703            dictionary[ "STYLE_PLASTIQUE" ] = "no";
    667704
    668         else if( configCmdLine.at(i) == "-qt-style-cleanlooks" )
     705        else if (configCmdLine.at(i) == "-qt-style-cleanlooks")
    669706            dictionary[ "STYLE_CLEANLOOKS" ] = "yes";
    670         else if( configCmdLine.at(i) == "-no-style-cleanlooks" )
     707        else if (configCmdLine.at(i) == "-no-style-cleanlooks")
    671708            dictionary[ "STYLE_CLEANLOOKS" ] = "no";
    672709
    673         else if( configCmdLine.at(i) == "-qt-style-motif" )
     710        else if (configCmdLine.at(i) == "-qt-style-motif")
    674711            dictionary[ "STYLE_MOTIF" ] = "yes";
    675         else if( configCmdLine.at(i) == "-no-style-motif" )
     712        else if (configCmdLine.at(i) == "-no-style-motif")
    676713            dictionary[ "STYLE_MOTIF" ] = "no";
    677714
    678         else if( configCmdLine.at(i) == "-qt-style-cde" )
     715        else if (configCmdLine.at(i) == "-qt-style-cde")
    679716            dictionary[ "STYLE_CDE" ] = "yes";
    680         else if( configCmdLine.at(i) == "-no-style-cde" )
     717        else if (configCmdLine.at(i) == "-no-style-cde")
    681718            dictionary[ "STYLE_CDE" ] = "no";
    682719
    683         else if( configCmdLine.at(i) == "-qt-style-s60" )
     720        else if (configCmdLine.at(i) == "-qt-style-s60")
    684721            dictionary[ "STYLE_S60" ] = "yes";
    685         else if( configCmdLine.at(i) == "-no-style-s60" )
     722        else if (configCmdLine.at(i) == "-no-style-s60")
    686723            dictionary[ "STYLE_S60" ] = "no";
    687724
    688725        // Qt 3 Support ---------------------------------------------
    689         else if( configCmdLine.at(i) == "-no-qt3support" )
     726        else if (configCmdLine.at(i) == "-no-qt3support")
    690727            dictionary[ "QT3SUPPORT" ] = "no";
    691728
     
    697734
    698735        // OpenGL Support -------------------------------------------
    699         else if( configCmdLine.at(i) == "-no-opengl" ) {
     736        else if (configCmdLine.at(i) == "-no-opengl") {
    700737            dictionary[ "OPENGL" ]    = "no";
    701         } else if ( configCmdLine.at(i) == "-opengl-es-cm" ) {
     738        } else if (configCmdLine.at(i) == "-opengl-es-cm") {
    702739            dictionary[ "OPENGL" ]          = "yes";
    703740            dictionary[ "OPENGL_ES_CM" ]    = "yes";
    704         } else if ( configCmdLine.at(i) == "-opengl-es-cl" ) {
    705             dictionary[ "OPENGL" ]          = "yes";
    706             dictionary[ "OPENGL_ES_CL" ]    = "yes";
    707         } else if ( configCmdLine.at(i) == "-opengl-es-2" ) {
     741        } else if (configCmdLine.at(i) == "-opengl-es-2") {
    708742            dictionary[ "OPENGL" ]          = "yes";
    709743            dictionary[ "OPENGL_ES_2" ]     = "yes";
     744        } else if (configCmdLine.at(i) == "-opengl") {
     745            dictionary[ "OPENGL" ]          = "yes";
     746            i++;
     747            if (i == argCount)
     748                break;
     749
     750            if (configCmdLine.at(i) == "es1") {
     751                dictionary[ "OPENGL_ES_CM" ]    = "yes";
     752            } else if ( configCmdLine.at(i) == "es2" ) {
     753                dictionary[ "OPENGL_ES_2" ]     = "yes";
     754            } else if ( configCmdLine.at(i) == "desktop" ) {
     755                dictionary[ "OPENGL_ES_2" ]     = "yes";
     756            } else {
     757                cout << "Argument passed to -opengl option is not valid." << endl;
     758                dictionary[ "DONE" ] = "error";
     759                break;
     760            }
    710761        }
    711762
    712763        // OpenVG Support -------------------------------------------
    713         else if( configCmdLine.at(i) == "-openvg" ) {
     764        else if (configCmdLine.at(i) == "-openvg") {
    714765            dictionary[ "OPENVG" ]    = "yes";
    715         } else if( configCmdLine.at(i) == "-no-openvg" ) {
     766        } else if (configCmdLine.at(i) == "-no-openvg") {
    716767            dictionary[ "OPENVG" ]    = "no";
    717768        }
    718769
    719770        // Databases ------------------------------------------------
    720         else if( configCmdLine.at(i) == "-qt-sql-mysql" )
     771        else if (configCmdLine.at(i) == "-qt-sql-mysql")
    721772            dictionary[ "SQL_MYSQL" ] = "yes";
    722         else if( configCmdLine.at(i) == "-plugin-sql-mysql" )
     773        else if (configCmdLine.at(i) == "-plugin-sql-mysql")
    723774            dictionary[ "SQL_MYSQL" ] = "plugin";
    724         else if( configCmdLine.at(i) == "-no-sql-mysql" )
     775        else if (configCmdLine.at(i) == "-no-sql-mysql")
    725776            dictionary[ "SQL_MYSQL" ] = "no";
    726777
    727         else if( configCmdLine.at(i) == "-qt-sql-odbc" )
     778        else if (configCmdLine.at(i) == "-qt-sql-odbc")
    728779            dictionary[ "SQL_ODBC" ] = "yes";
    729         else if( configCmdLine.at(i) == "-plugin-sql-odbc" )
     780        else if (configCmdLine.at(i) == "-plugin-sql-odbc")
    730781            dictionary[ "SQL_ODBC" ] = "plugin";
    731         else if( configCmdLine.at(i) == "-no-sql-odbc" )
     782        else if (configCmdLine.at(i) == "-no-sql-odbc")
    732783            dictionary[ "SQL_ODBC" ] = "no";
    733784
    734         else if( configCmdLine.at(i) == "-qt-sql-oci" )
     785        else if (configCmdLine.at(i) == "-qt-sql-oci")
    735786            dictionary[ "SQL_OCI" ] = "yes";
    736         else if( configCmdLine.at(i) == "-plugin-sql-oci" )
     787        else if (configCmdLine.at(i) == "-plugin-sql-oci")
    737788            dictionary[ "SQL_OCI" ] = "plugin";
    738         else if( configCmdLine.at(i) == "-no-sql-oci" )
     789        else if (configCmdLine.at(i) == "-no-sql-oci")
    739790            dictionary[ "SQL_OCI" ] = "no";
    740791
    741         else if( configCmdLine.at(i) == "-qt-sql-psql" )
     792        else if (configCmdLine.at(i) == "-qt-sql-psql")
    742793            dictionary[ "SQL_PSQL" ] = "yes";
    743         else if( configCmdLine.at(i) == "-plugin-sql-psql" )
     794        else if (configCmdLine.at(i) == "-plugin-sql-psql")
    744795            dictionary[ "SQL_PSQL" ] = "plugin";
    745         else if( configCmdLine.at(i) == "-no-sql-psql" )
     796        else if (configCmdLine.at(i) == "-no-sql-psql")
    746797            dictionary[ "SQL_PSQL" ] = "no";
    747798
    748         else if( configCmdLine.at(i) == "-qt-sql-tds" )
     799        else if (configCmdLine.at(i) == "-qt-sql-tds")
    749800            dictionary[ "SQL_TDS" ] = "yes";
    750         else if( configCmdLine.at(i) == "-plugin-sql-tds" )
     801        else if (configCmdLine.at(i) == "-plugin-sql-tds")
    751802            dictionary[ "SQL_TDS" ] = "plugin";
    752         else if( configCmdLine.at(i) == "-no-sql-tds" )
     803        else if (configCmdLine.at(i) == "-no-sql-tds")
    753804            dictionary[ "SQL_TDS" ] = "no";
    754805
    755         else if( configCmdLine.at(i) == "-qt-sql-db2" )
     806        else if (configCmdLine.at(i) == "-qt-sql-db2")
    756807            dictionary[ "SQL_DB2" ] = "yes";
    757         else if( configCmdLine.at(i) == "-plugin-sql-db2" )
     808        else if (configCmdLine.at(i) == "-plugin-sql-db2")
    758809            dictionary[ "SQL_DB2" ] = "plugin";
    759         else if( configCmdLine.at(i) == "-no-sql-db2" )
     810        else if (configCmdLine.at(i) == "-no-sql-db2")
    760811            dictionary[ "SQL_DB2" ] = "no";
    761812
    762         else if( configCmdLine.at(i) == "-qt-sql-sqlite" )
     813        else if (configCmdLine.at(i) == "-qt-sql-sqlite")
    763814            dictionary[ "SQL_SQLITE" ] = "yes";
    764         else if( configCmdLine.at(i) == "-plugin-sql-sqlite" )
     815        else if (configCmdLine.at(i) == "-plugin-sql-sqlite")
    765816            dictionary[ "SQL_SQLITE" ] = "plugin";
    766         else if( configCmdLine.at(i) == "-no-sql-sqlite" )
     817        else if (configCmdLine.at(i) == "-no-sql-sqlite")
    767818            dictionary[ "SQL_SQLITE" ] = "no";
    768         else if( configCmdLine.at(i) == "-system-sqlite" )
     819        else if (configCmdLine.at(i) == "-system-sqlite")
    769820            dictionary[ "SQL_SQLITE_LIB" ] = "system";
    770         else if( configCmdLine.at(i) == "-qt-sql-sqlite2" )
     821        else if (configCmdLine.at(i) == "-qt-sql-sqlite2")
    771822            dictionary[ "SQL_SQLITE2" ] = "yes";
    772         else if( configCmdLine.at(i) == "-plugin-sql-sqlite2" )
     823        else if (configCmdLine.at(i) == "-plugin-sql-sqlite2")
    773824            dictionary[ "SQL_SQLITE2" ] = "plugin";
    774         else if( configCmdLine.at(i) == "-no-sql-sqlite2" )
     825        else if (configCmdLine.at(i) == "-no-sql-sqlite2")
    775826            dictionary[ "SQL_SQLITE2" ] = "no";
    776827
    777         else if( configCmdLine.at(i) == "-qt-sql-ibase" )
     828        else if (configCmdLine.at(i) == "-qt-sql-ibase")
    778829            dictionary[ "SQL_IBASE" ] = "yes";
    779         else if( configCmdLine.at(i) == "-plugin-sql-ibase" )
     830        else if (configCmdLine.at(i) == "-plugin-sql-ibase")
    780831            dictionary[ "SQL_IBASE" ] = "plugin";
    781         else if( configCmdLine.at(i) == "-no-sql-ibase" )
     832        else if (configCmdLine.at(i) == "-no-sql-ibase")
    782833            dictionary[ "SQL_IBASE" ] = "no";
    783834#endif
    784835        // IDE project generation -----------------------------------
    785         else if( configCmdLine.at(i) == "-no-dsp" )
     836        else if (configCmdLine.at(i) == "-no-dsp")
    786837            dictionary[ "DSPFILES" ] = "no";
    787         else if( configCmdLine.at(i) == "-dsp" )
     838        else if (configCmdLine.at(i) == "-dsp")
    788839            dictionary[ "DSPFILES" ] = "yes";
    789840
    790         else if( configCmdLine.at(i) == "-no-vcp" )
     841        else if (configCmdLine.at(i) == "-no-vcp")
    791842            dictionary[ "VCPFILES" ] = "no";
    792         else if( configCmdLine.at(i) == "-vcp" )
     843        else if (configCmdLine.at(i) == "-vcp")
    793844            dictionary[ "VCPFILES" ] = "yes";
    794845
    795         else if( configCmdLine.at(i) == "-no-vcproj" )
     846        else if (configCmdLine.at(i) == "-no-vcproj")
    796847            dictionary[ "VCPROJFILES" ] = "no";
    797         else if( configCmdLine.at(i) == "-vcproj" )
     848        else if (configCmdLine.at(i) == "-vcproj")
    798849            dictionary[ "VCPROJFILES" ] = "yes";
    799850
    800         else if( configCmdLine.at(i) == "-no-incredibuild-xge" )
     851        else if (configCmdLine.at(i) == "-no-incredibuild-xge")
    801852            dictionary[ "INCREDIBUILD_XGE" ] = "no";
    802         else if( configCmdLine.at(i) == "-incredibuild-xge" )
     853        else if (configCmdLine.at(i) == "-incredibuild-xge")
    803854            dictionary[ "INCREDIBUILD_XGE" ] = "yes";
    804         else if( configCmdLine.at(i) == "-native-gestures" )
     855        else if (configCmdLine.at(i) == "-native-gestures")
    805856            dictionary[ "NATIVE_GESTURES" ] = "yes";
    806         else if( configCmdLine.at(i) == "-no-native-gestures" )
     857        else if (configCmdLine.at(i) == "-no-native-gestures")
    807858            dictionary[ "NATIVE_GESTURES" ] = "no";
    808859#if !defined(EVAL)
    809860        // Symbian Support -------------------------------------------
    810         else if (configCmdLine.at(i) == "-fpu" )
     861        else if (configCmdLine.at(i) == "-fpu")
    811862        {
    812863            ++i;
    813             if(i==argCount)
     864            if (i == argCount)
    814865                break;
    815866            dictionary[ "ARM_FPU_TYPE" ] = configCmdLine.at(i);
    816867        }
    817868
    818         else if( configCmdLine.at(i) == "-s60" )
     869        else if (configCmdLine.at(i) == "-s60")
    819870            dictionary[ "S60" ]    = "yes";
    820         else if( configCmdLine.at(i) == "-no-s60" )
     871        else if (configCmdLine.at(i) == "-no-s60")
    821872            dictionary[ "S60" ]    = "no";
    822873
    823         else if( configCmdLine.at(i) == "-usedeffiles" )
     874        else if (configCmdLine.at(i) == "-usedeffiles")
    824875            dictionary[ "SYMBIAN_DEFFILES" ] = "yes";
    825         else if( configCmdLine.at(i) == "-no-usedeffiles" )
     876        else if (configCmdLine.at(i) == "-no-usedeffiles")
    826877            dictionary[ "SYMBIAN_DEFFILES" ] = "no";
    827878
    828879        // Others ---------------------------------------------------
    829         else if (configCmdLine.at(i) == "-fast" )
     880        else if (configCmdLine.at(i) == "-fast")
    830881            dictionary[ "FAST" ] = "yes";
    831         else if (configCmdLine.at(i) == "-no-fast" )
     882        else if (configCmdLine.at(i) == "-no-fast")
    832883            dictionary[ "FAST" ] = "no";
    833884
    834         else if( configCmdLine.at(i) == "-stl" )
     885        else if (configCmdLine.at(i) == "-stl")
    835886            dictionary[ "STL" ] = "yes";
    836         else if( configCmdLine.at(i) == "-no-stl" )
     887        else if (configCmdLine.at(i) == "-no-stl")
    837888            dictionary[ "STL" ] = "no";
    838889
    839         else if ( configCmdLine.at(i) == "-exceptions" )
     890        else if (configCmdLine.at(i) == "-exceptions")
    840891            dictionary[ "EXCEPTIONS" ] = "yes";
    841         else if ( configCmdLine.at(i) == "-no-exceptions" )
     892        else if (configCmdLine.at(i) == "-no-exceptions")
    842893            dictionary[ "EXCEPTIONS" ] = "no";
    843894
    844         else if ( configCmdLine.at(i) == "-rtti" )
     895        else if (configCmdLine.at(i) == "-rtti")
    845896            dictionary[ "RTTI" ] = "yes";
    846         else if ( configCmdLine.at(i) == "-no-rtti" )
     897        else if (configCmdLine.at(i) == "-no-rtti")
    847898            dictionary[ "RTTI" ] = "no";
    848899
    849         else if( configCmdLine.at(i) == "-accessibility" )
     900        else if (configCmdLine.at(i) == "-accessibility")
    850901            dictionary[ "ACCESSIBILITY" ] = "yes";
    851         else if( configCmdLine.at(i) == "-no-accessibility" ) {
     902        else if (configCmdLine.at(i) == "-no-accessibility") {
    852903            dictionary[ "ACCESSIBILITY" ] = "no";
    853904            cout << "Setting accessibility to NO" << endl;
     
    875926            dictionary[ "IWMMXT" ] = "yes";
    876927
    877         else if( configCmdLine.at(i) == "-no-openssl" ) {
     928        else if (configCmdLine.at(i) == "-no-openssl") {
    878929              dictionary[ "OPENSSL"] = "no";
    879         } else if( configCmdLine.at(i) == "-openssl" ) {
     930        } else if (configCmdLine.at(i) == "-openssl") {
    880931              dictionary[ "OPENSSL" ] = "yes";
    881         } else if( configCmdLine.at(i) == "-openssl-linked" ) {
     932        } else if (configCmdLine.at(i) == "-openssl-linked") {
    882933              dictionary[ "OPENSSL" ] = "linked";
    883         } else if( configCmdLine.at(i) == "-no-qdbus" ) {
     934        } else if (configCmdLine.at(i) == "-no-qdbus") {
    884935            dictionary[ "DBUS" ] = "no";
    885         } else if( configCmdLine.at(i) == "-qdbus" ) {
     936        } else if (configCmdLine.at(i) == "-qdbus") {
    886937            dictionary[ "DBUS" ] = "yes";
    887         } else if( configCmdLine.at(i) == "-no-dbus" ) {
     938        } else if (configCmdLine.at(i) == "-no-dbus") {
    888939            dictionary[ "DBUS" ] = "no";
    889         } else if( configCmdLine.at(i) == "-dbus" ) {
     940        } else if (configCmdLine.at(i) == "-dbus") {
    890941            dictionary[ "DBUS" ] = "yes";
    891         } else if( configCmdLine.at(i) == "-dbus-linked" ) {
     942        } else if (configCmdLine.at(i) == "-dbus-linked") {
    892943            dictionary[ "DBUS" ] = "linked";
    893         } else if( configCmdLine.at(i) == "-no-script" ) {
     944        } else if (configCmdLine.at(i) == "-no-script") {
    894945            dictionary[ "SCRIPT" ] = "no";
    895         } else if( configCmdLine.at(i) == "-script" ) {
     946        } else if (configCmdLine.at(i) == "-script") {
    896947            dictionary[ "SCRIPT" ] = "yes";
    897         } else if( configCmdLine.at(i) == "-no-scripttools" ) {
     948        } else if (configCmdLine.at(i) == "-no-scripttools") {
    898949            dictionary[ "SCRIPTTOOLS" ] = "no";
    899         } else if( configCmdLine.at(i) == "-scripttools" ) {
     950        } else if (configCmdLine.at(i) == "-scripttools") {
    900951            dictionary[ "SCRIPTTOOLS" ] = "yes";
    901         } else if( configCmdLine.at(i) == "-no-xmlpatterns" ) {
     952        } else if (configCmdLine.at(i) == "-no-xmlpatterns") {
    902953            dictionary[ "XMLPATTERNS" ] = "no";
    903         } else if( configCmdLine.at(i) == "-xmlpatterns" ) {
     954        } else if (configCmdLine.at(i) == "-xmlpatterns") {
    904955            dictionary[ "XMLPATTERNS" ] = "yes";
    905         } else if( configCmdLine.at(i) == "-no-multimedia" ) {
     956        } else if (configCmdLine.at(i) == "-no-multimedia") {
    906957            dictionary[ "MULTIMEDIA" ] = "no";
    907         } else if( configCmdLine.at(i) == "-multimedia" ) {
     958        } else if (configCmdLine.at(i) == "-multimedia") {
    908959            dictionary[ "MULTIMEDIA" ] = "yes";
    909         } else if( configCmdLine.at(i) == "-audio-backend" ) {
     960        } else if (configCmdLine.at(i) == "-audio-backend") {
    910961            dictionary[ "AUDIO_BACKEND" ] = "yes";
    911         } else if( configCmdLine.at(i) == "-no-audio-backend" ) {
     962        } else if (configCmdLine.at(i) == "-no-audio-backend") {
    912963            dictionary[ "AUDIO_BACKEND" ] = "no";
    913         } else if( configCmdLine.at(i) == "-no-phonon" ) {
     964        } else if (configCmdLine.at(i) == "-no-phonon") {
    914965            dictionary[ "PHONON" ] = "no";
    915         } else if( configCmdLine.at(i) == "-phonon" ) {
     966        } else if (configCmdLine.at(i) == "-phonon") {
    916967            dictionary[ "PHONON" ] = "yes";
    917         } else if( configCmdLine.at(i) == "-no-phonon-backend" ) {
     968        } else if (configCmdLine.at(i) == "-no-phonon-backend") {
    918969            dictionary[ "PHONON_BACKEND" ] = "no";
    919         } else if( configCmdLine.at(i) == "-phonon-backend" ) {
     970        } else if (configCmdLine.at(i) == "-phonon-backend") {
    920971            dictionary[ "PHONON_BACKEND" ] = "yes";
    921         } else if( configCmdLine.at(i) == "-phonon-wince-ds9" ) {
     972        } else if (configCmdLine.at(i) == "-phonon-wince-ds9") {
    922973            dictionary[ "DIRECTSHOW" ] = "yes";
    923         } else if( configCmdLine.at(i) == "-no-webkit" ) {
     974        } else if (configCmdLine.at(i) == "-no-webkit") {
    924975            dictionary[ "WEBKIT" ] = "no";
    925         } else if( configCmdLine.at(i) == "-webkit" ) {
     976        } else if (configCmdLine.at(i) == "-webkit") {
    926977            dictionary[ "WEBKIT" ] = "yes";
    927         } else if( configCmdLine.at(i) == "-no-declarative" ) {
     978        } else if (configCmdLine.at(i) == "-webkit-debug") {
     979            dictionary[ "WEBKIT" ] = "debug";
     980        } else if (configCmdLine.at(i) == "-no-declarative") {
    928981            dictionary[ "DECLARATIVE" ] = "no";
    929         } else if( configCmdLine.at(i) == "-declarative" ) {
     982        } else if (configCmdLine.at(i) == "-declarative") {
    930983            dictionary[ "DECLARATIVE" ] = "yes";
    931         } else if( configCmdLine.at(i) == "-no-plugin-manifests" ) {
     984        } else if (configCmdLine.at(i) == "-no-declarative-debug") {
     985            dictionary[ "DECLARATIVE_DEBUG" ] = "no";
     986        } else if (configCmdLine.at(i) == "-declarative-debug") {
     987            dictionary[ "DECLARATIVE_DEBUG" ] = "yes";
     988        } else if (configCmdLine.at(i) == "-no-plugin-manifests") {
    932989            dictionary[ "PLUGIN_MANIFESTS" ] = "no";
    933         } else if( configCmdLine.at(i) == "-plugin-manifests" ) {
     990        } else if (configCmdLine.at(i) == "-plugin-manifests") {
    934991            dictionary[ "PLUGIN_MANIFESTS" ] = "yes";
    935992        }
     
    941998        }
    942999
    943         else if( configCmdLine.at(i) == "-internal" )
     1000        else if (configCmdLine.at(i) == "-internal")
    9441001            dictionary[ "QMAKE_INTERNAL" ] = "yes";
    9451002
    946         else if( configCmdLine.at(i) == "-no-qmake" )
     1003        else if (configCmdLine.at(i) == "-no-qmake")
    9471004            dictionary[ "BUILD_QMAKE" ] = "no";
    948         else if( configCmdLine.at(i) == "-qmake" )
     1005        else if (configCmdLine.at(i) == "-qmake")
    9491006            dictionary[ "BUILD_QMAKE" ] = "yes";
    9501007
    951         else if( configCmdLine.at(i) == "-dont-process" )
     1008        else if (configCmdLine.at(i) == "-dont-process")
    9521009            dictionary[ "NOPROCESS" ] = "yes";
    953         else if( configCmdLine.at(i) == "-process" )
     1010        else if (configCmdLine.at(i) == "-process")
    9541011            dictionary[ "NOPROCESS" ] = "no";
    9551012
    956         else if( configCmdLine.at(i) == "-no-qmake-deps" )
     1013        else if (configCmdLine.at(i) == "-no-qmake-deps")
    9571014            dictionary[ "DEPENDENCIES" ] = "no";
    958         else if( configCmdLine.at(i) == "-qmake-deps" )
     1015        else if (configCmdLine.at(i) == "-qmake-deps")
    9591016            dictionary[ "DEPENDENCIES" ] = "yes";
    9601017
    9611018
    962         else if( configCmdLine.at(i) == "-qtnamespace" ) {
     1019        else if (configCmdLine.at(i) == "-qtnamespace") {
    9631020            ++i;
    964             if(i==argCount)
     1021            if (i == argCount)
    9651022                break;
    966             qmakeDefines += "QT_NAMESPACE="+configCmdLine.at(i);
    967         } else if( configCmdLine.at(i) == "-qtlibinfix" ) {
     1023            dictionary[ "QT_NAMESPACE" ] = configCmdLine.at(i);
     1024        } else if (configCmdLine.at(i) == "-qtlibinfix") {
    9681025            ++i;
    969             if(i==argCount)
     1026            if (i == argCount)
    9701027                break;
    9711028            dictionary[ "QT_LIBINFIX" ] = configCmdLine.at(i);
     
    9731030                dictionary[ "QT_INSTALL_PLUGINS" ] =
    9741031                    QString("\\resource\\qt%1\\plugins").arg(dictionary[ "QT_LIBINFIX" ]);
     1032                dictionary[ "QT_INSTALL_IMPORTS" ] =
     1033                    QString("\\resource\\qt%1\\imports").arg(dictionary[ "QT_LIBINFIX" ]);
    9751034            }
    976         } else if( configCmdLine.at(i) == "-D" ) {
     1035        } else if (configCmdLine.at(i) == "-D") {
    9771036            ++i;
    978             if (i==argCount)
     1037            if (i == argCount)
    9791038                break;
    9801039            qmakeDefines += configCmdLine.at(i);
    981         } else if( configCmdLine.at(i) == "-I" ) {
     1040        } else if (configCmdLine.at(i) == "-I") {
    9821041            ++i;
    983             if (i==argCount)
     1042            if (i == argCount)
    9841043                break;
    9851044            qmakeIncludes += configCmdLine.at(i);
    986         } else if( configCmdLine.at(i) == "-L" ) {
     1045        } else if (configCmdLine.at(i) == "-L") {
    9871046            ++i;
    988             if (i==argCount)
     1047            if (i == argCount)
    9891048                break;
    9901049            QFileInfo check(configCmdLine.at(i));
     
    9951054            }
    9961055            qmakeLibs += QString("-L" + configCmdLine.at(i));
    997         } else if( configCmdLine.at(i) == "-l" ) {
     1056        } else if (configCmdLine.at(i) == "-l") {
    9981057            ++i;
    999             if (i==argCount)
     1058            if (i == argCount)
    10001059                break;
    10011060            qmakeLibs += QString("-l" + configCmdLine.at(i));
    10021061        } else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS=")) {
    10031062            opensslLibs = configCmdLine.at(i);
    1004         }
    1005 
    1006         else if( ( configCmdLine.at(i) == "-override-version" ) || ( configCmdLine.at(i) == "-version-override" ) ){
     1063        } else if (configCmdLine.at(i).startsWith("PSQL_LIBS=")) {
     1064            psqlLibs = configCmdLine.at(i);
     1065        } else if (configCmdLine.at(i).startsWith("SYBASE=")) {
     1066            sybase = configCmdLine.at(i);
     1067        } else if (configCmdLine.at(i).startsWith("SYBASE_LIBS=")) {
     1068            sybaseLibs = configCmdLine.at(i);
     1069        }
     1070
     1071        else if ((configCmdLine.at(i) == "-override-version") || (configCmdLine.at(i) == "-version-override")){
    10071072            ++i;
    1008             if (i==argCount)
     1073            if (i == argCount)
    10091074                break;
    10101075            dictionary[ "VERSION" ] = configCmdLine.at(i);
    10111076        }
    10121077
    1013         else if( configCmdLine.at(i) == "-saveconfig" ) {
     1078        else if (configCmdLine.at(i) == "-saveconfig") {
    10141079            ++i;
    1015             if (i==argCount)
     1080            if (i == argCount)
    10161081                break;
    10171082            dictionary[ "CUSTOMCONFIG" ] = "_" + configCmdLine.at(i);
     
    10241089        else if (configCmdLine.at(i) == "-nomake") {
    10251090            ++i;
    1026             if (i==argCount)
     1091            if (i == argCount)
    10271092                break;
    10281093            disabledBuildParts += configCmdLine.at(i);
     
    10301095
    10311096        // Directories ----------------------------------------------
    1032         else if( configCmdLine.at(i) == "-prefix" ) {
     1097        else if (configCmdLine.at(i) == "-prefix") {
    10331098            ++i;
    1034             if(i==argCount)
     1099            if (i == argCount)
    10351100                break;
    10361101            dictionary[ "QT_INSTALL_PREFIX" ] = configCmdLine.at(i);
    10371102        }
    10381103
    1039         else if( configCmdLine.at(i) == "-bindir" ) {
     1104        else if (configCmdLine.at(i) == "-bindir") {
    10401105            ++i;
    1041             if(i==argCount)
     1106            if (i == argCount)
    10421107                break;
    10431108            dictionary[ "QT_INSTALL_BINS" ] = configCmdLine.at(i);
    10441109        }
    10451110
    1046         else if( configCmdLine.at(i) == "-libdir" ) {
     1111        else if (configCmdLine.at(i) == "-libdir") {
    10471112            ++i;
    1048             if(i==argCount)
     1113            if (i == argCount)
    10491114                break;
    10501115            dictionary[ "QT_INSTALL_LIBS" ] = configCmdLine.at(i);
    10511116        }
    10521117
    1053         else if( configCmdLine.at(i) == "-docdir" ) {
     1118        else if (configCmdLine.at(i) == "-docdir") {
    10541119            ++i;
    1055             if(i==argCount)
     1120            if (i == argCount)
    10561121                break;
    10571122            dictionary[ "QT_INSTALL_DOCS" ] = configCmdLine.at(i);
    10581123        }
    10591124
    1060         else if( configCmdLine.at(i) == "-headerdir" ) {
     1125        else if (configCmdLine.at(i) == "-headerdir") {
    10611126            ++i;
    1062             if(i==argCount)
     1127            if (i == argCount)
    10631128                break;
    10641129            dictionary[ "QT_INSTALL_HEADERS" ] = configCmdLine.at(i);
    10651130        }
    10661131
    1067         else if( configCmdLine.at(i) == "-plugindir" ) {
     1132        else if (configCmdLine.at(i) == "-plugindir") {
    10681133            ++i;
    1069             if(i==argCount)
     1134            if (i == argCount)
    10701135                break;
    10711136            dictionary[ "QT_INSTALL_PLUGINS" ] = configCmdLine.at(i);
    10721137        }
    10731138
    1074         else if( configCmdLine.at(i) == "-datadir" ) {
     1139        else if (configCmdLine.at(i) == "-importdir") {
    10751140            ++i;
    1076             if(i==argCount)
     1141            if (i == argCount)
     1142                break;
     1143            dictionary[ "QT_INSTALL_IMPORTS" ] = configCmdLine.at(i);
     1144        }
     1145        else if (configCmdLine.at(i) == "-datadir") {
     1146            ++i;
     1147            if (i == argCount)
    10771148                break;
    10781149            dictionary[ "QT_INSTALL_DATA" ] = configCmdLine.at(i);
    10791150        }
    10801151
    1081         else if( configCmdLine.at(i) == "-translationdir" ) {
     1152        else if (configCmdLine.at(i) == "-translationdir") {
    10821153            ++i;
    1083             if(i==argCount)
     1154            if (i == argCount)
    10841155                break;
    10851156            dictionary[ "QT_INSTALL_TRANSLATIONS" ] = configCmdLine.at(i);
    10861157        }
    10871158
    1088         else if( configCmdLine.at(i) == "-examplesdir" ) {
     1159        else if (configCmdLine.at(i) == "-examplesdir") {
    10891160            ++i;
    1090             if(i==argCount)
     1161            if (i == argCount)
    10911162                break;
    10921163            dictionary[ "QT_INSTALL_EXAMPLES" ] = configCmdLine.at(i);
    10931164        }
    10941165
    1095         else if( configCmdLine.at(i) == "-demosdir" ) {
     1166        else if (configCmdLine.at(i) == "-demosdir") {
    10961167            ++i;
    1097             if(i==argCount)
     1168            if (i == argCount)
    10981169                break;
    10991170            dictionary[ "QT_INSTALL_DEMOS" ] = configCmdLine.at(i);
    11001171        }
    11011172
    1102         else if( configCmdLine.at(i) == "-hostprefix" ) {
     1173        else if (configCmdLine.at(i) == "-hostprefix") {
    11031174            ++i;
    1104             if(i==argCount)
     1175            if (i == argCount)
    11051176                break;
    11061177            dictionary[ "QT_HOST_PREFIX" ] = configCmdLine.at(i);
    11071178        }
    11081179
    1109         else if( configCmdLine.at(i) == "-make" ) {
     1180        else if (configCmdLine.at(i) == "-make") {
    11101181            ++i;
    1111             if(i==argCount)
     1182            if (i == argCount)
    11121183                break;
    11131184            dictionary[ "MAKE" ] = configCmdLine.at(i);
     
    11211192            if (system == QLatin1String("raster")
    11221193                || system == QLatin1String("opengl")
    1123                 || system == QLatin1String("openvg"))
     1194                || system == QLatin1String("openvg")
     1195                || system == QLatin1String("runtime"))
    11241196                dictionary["GRAPHICS_SYSTEM"] = configCmdLine.at(i);
    11251197        }
    11261198
    1127         else if( configCmdLine.at(i).indexOf( QRegExp( "^-(en|dis)able-" ) ) != -1 ) {
     1199        else if (configCmdLine.at(i) == "-runtimegraphicssystem") {
     1200            ++i;
     1201            if (i == argCount)
     1202                break;
     1203            dictionary["RUNTIME_SYSTEM"] = configCmdLine.at(i);
     1204        }
     1205
     1206        else if (configCmdLine.at(i).indexOf(QRegExp("^-(en|dis)able-")) != -1) {
    11281207            // Scan to see if any specific modules and drivers are enabled or disabled
    1129             for( QStringList::Iterator module = modules.begin(); module != modules.end(); ++module ) {
    1130                 if( configCmdLine.at(i) == QString( "-enable-" ) + (*module) ) {
     1208            for (QStringList::Iterator module = modules.begin(); module != modules.end(); ++module) {
     1209                if (configCmdLine.at(i) == QString("-enable-") + (*module)) {
    11311210                    enabledModules += (*module);
    11321211                    break;
    11331212                }
    1134                 else if( configCmdLine.at(i) == QString( "-disable-" ) + (*module) ) {
     1213                else if (configCmdLine.at(i) == QString("-disable-") + (*module)) {
    11351214                    disabledModules += (*module);
    11361215                    break;
     
    11661245        cout << "See the README file for a list of supported operating systems and compilers." << endl;
    11671246    } else {
    1168         if( dictionary[ "QMAKESPEC" ].endsWith( "-icc" ) ||
    1169             dictionary[ "QMAKESPEC" ].endsWith( "-msvc" ) ||
    1170             dictionary[ "QMAKESPEC" ].endsWith( "-msvc.net" ) ||
    1171             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2002" ) ||
    1172             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2003" ) ||
    1173             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2005" ) ||
    1174             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2008" )) {
    1175             if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "nmake";
     1247        if (dictionary[ "QMAKESPEC" ].endsWith("-icc") ||
     1248            dictionary[ "QMAKESPEC" ].endsWith("-msvc") ||
     1249            dictionary[ "QMAKESPEC" ].endsWith("-msvc.net") ||
     1250            dictionary[ "QMAKESPEC" ].endsWith("-msvc2002") ||
     1251            dictionary[ "QMAKESPEC" ].endsWith("-msvc2003") ||
     1252            dictionary[ "QMAKESPEC" ].endsWith("-msvc2005") ||
     1253            dictionary[ "QMAKESPEC" ].endsWith("-msvc2008") ||
     1254            dictionary[ "QMAKESPEC" ].endsWith("-msvc2010")) {
     1255            if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "nmake";
    11761256            dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
    1177         } else if ( dictionary[ "QMAKESPEC" ] == QString( "win32-g++" ) ) {
    1178             if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "mingw32-make";
     1257        } else if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) {
     1258            if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "mingw32-make";
    11791259            if (Environment::detectExecutable("sh.exe")) {
    11801260                dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-g++-sh";
     
    11831263            }
    11841264        } else {
    1185             if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "make";
     1265            if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "make";
    11861266            dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
    11871267        }
     
    12391319
    12401320#if !defined(EVAL)
    1241     for( QStringList::Iterator dis = disabledModules.begin(); dis != disabledModules.end(); ++dis ) {
    1242         modules.removeAll( (*dis) );
    1243     }
    1244     for( QStringList::Iterator ena = enabledModules.begin(); ena != enabledModules.end(); ++ena ) {
    1245         if( modules.indexOf( (*ena) ) == -1 )
     1321    for (QStringList::Iterator dis = disabledModules.begin(); dis != disabledModules.end(); ++dis) {
     1322        modules.removeAll((*dis));
     1323    }
     1324    for (QStringList::Iterator ena = enabledModules.begin(); ena != enabledModules.end(); ++ena) {
     1325        if (modules.indexOf((*ena)) == -1)
    12461326            modules += (*ena);
    12471327    }
    12481328    qtConfig += modules;
    12491329
    1250     for( QStringList::Iterator it = disabledModules.begin(); it != disabledModules.end(); ++it )
     1330    for (QStringList::Iterator it = disabledModules.begin(); it != disabledModules.end(); ++it)
    12511331        qtConfig.removeAll(*it);
    12521332
    1253     if( ( dictionary[ "REDO" ] != "yes" ) && ( dictionary[ "HELP" ] != "yes" ) )
     1333    if ((dictionary[ "REDO" ] != "yes") && (dictionary[ "HELP" ] != "yes"))
    12541334        saveCmdLine();
    12551335#endif
     
    12711351
    12721352    QStringList::Iterator it;
    1273     for( it = stringList.begin(); it != stringList.end(); ++it )
     1353    for (it = stringList.begin(); it != stringList.end(); ++it)
    12741354        allConfigs << it->remove("qconfig-").remove(".h");
    12751355    allConfigs << "full";
     
    12921372    // If the internal configurations failed, try others.
    12931373    QStringList::Iterator config;
    1294     for( config = allConfigs.begin(); config != allConfigs.end(); ++config ) {
    1295         if( (*config) == dictionary[ "QCONFIG" ] )
     1374    for (config = allConfigs.begin(); config != allConfigs.end(); ++config) {
     1375        if ((*config) == dictionary[ "QCONFIG" ])
    12961376            break;
    12971377    }
    1298     if( config == allConfigs.end() ) {
     1378    if (config == allConfigs.end()) {
    12991379        dictionary[ "HELP" ] = "yes";
    13001380        cout << "No such configuration \"" << qPrintable(dictionary[ "QCONFIG" ]) << "\"" << endl ;
     
    14491529        dictionary[ "QT_INSTALL_PREFIX" ]   = "";
    14501530
    1451     } else if(dictionary[ "XQMAKESPEC" ].startsWith("symbian")) {
     1531    } else if (dictionary[ "XQMAKESPEC" ].startsWith("symbian")) {
    14521532        dictionary[ "ACCESSIBILITY" ]       = "no";
    14531533        dictionary[ "STYLE_WINDOWSXP" ]     = "no";
     
    14641544        dictionary[ "OPENGL" ]              = "no";
    14651545        dictionary[ "OPENSSL" ]             = "yes";
     1546        // We accidently enabled IPv6 for Qt Symbian in 4.6.x. However the underlying OpenC does not fully support IPV6.
     1547        // Therefore for 4.7.1 and following we disable it until OpenC either supports it or we have the native Qt
     1548        // symbian socket engine.
     1549        dictionary[ "IPV6" ]                = "no";
    14661550        dictionary[ "STL" ]                 = "yes";
    14671551        dictionary[ "EXCEPTIONS" ]          = "yes";
     
    14891573        dictionary[ "QT_INSTALL_PREFIX" ]   = "";
    14901574        dictionary[ "QT_INSTALL_PLUGINS" ]  = "\\resource\\qt\\plugins";
     1575        dictionary[ "QT_INSTALL_IMPORTS" ]  = "\\resource\\qt\\imports";
    14911576        dictionary[ "QT_INSTALL_TRANSLATIONS" ]  = "\\resource\\qt\\translations";
    14921577        dictionary[ "ARM_FPU_TYPE" ]        = "softvfp";
     
    14971582        disabledBuildParts << "docs" << "translations";
    14981583
    1499     } else if(dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong.
     1584    } else if (dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong.
    15001585      //TODO
    15011586        dictionary[ "STYLE_WINDOWSXP" ]     = "no";
     
    15171602
    15181603        dictionary["DECORATIONS"]           = "default windows styled";
    1519         dictionary[ "QMAKEADDITIONALARGS" ] = "-unix";
    15201604    }
    15211605}
     
    15241608{
    15251609    QDir d;
    1526     for( QStringList::ConstIterator it = paths.begin(); it != paths.end(); ++it ) {
     1610    for (QStringList::ConstIterator it = paths.begin(); it != paths.end(); ++it) {
    15271611        // Remove any leading or trailing ", this is commonly used in the environment
    15281612        // variables
    15291613        QString path = (*it);
    1530         if ( path.startsWith( "\"" ) )
    1531             path = path.right( path.length() - 1 );
    1532         if ( path.endsWith( "\"" ) )
    1533             path = path.left( path.length() - 1 );
    1534         if( d.exists(path + QDir::separator() + fileName) ) {
     1614        if (path.startsWith("\""))
     1615            path = path.right(path.length() - 1);
     1616        if (path.endsWith("\""))
     1617            path = path.left(path.length() - 1);
     1618        if (d.exists(path + QDir::separator() + fileName)) {
    15351619            return (path);
    15361620        }
     
    15391623}
    15401624
    1541 QString Configure::locateFile( const QString &fileName )
     1625QString Configure::locateFile(const QString &fileName)
    15421626{
    15431627    QString file = fileName.toLower();
     
    15501634    if (file.endsWith(".h"))
    15511635        paths = QString::fromLocal8Bit(getenv("INCLUDE")).split(splitReg, QString::SkipEmptyParts);
    1552     else if ( file.endsWith( ".lib" ) )
     1636    else if (file.endsWith(".lib"))
    15531637        paths = QString::fromLocal8Bit(getenv("LIB")).split(splitReg, QString::SkipEmptyParts);
    15541638    else
     
    15621646bool Configure::displayHelp()
    15631647{
    1564     if( dictionary[ "HELP" ] == "yes" ) {
     1648    if (dictionary[ "HELP" ] == "yes") {
    15651649        desc("Usage: configure [-buildkey <key>]\n"
    15661650//      desc("Usage: configure [-prefix dir] [-bindir <dir>] [-libdir <dir>]\n"
    15671651//                  "[-docdir <dir>] [-headerdir <dir>] [-plugindir <dir>]\n"
    1568 //                  "[-datadir <dir>] [-translationdir <dir>]\n"
     1652//                  "[-importdir <dir>] [-datadir <dir>] [-translationdir <dir>]\n"
    15691653//                  "[-examplesdir <dir>] [-demosdir <dir>][-buildkey <key>]\n"
    15701654                    "[-release] [-debug] [-debug-and-release] [-shared] [-static]\n"
     
    15891673                    "[-no-multimedia] [-multimedia] [-no-audio-backend] [-audio-backend]\n"
    15901674                    "[-no-script] [-script] [-no-scripttools] [-scripttools]\n"
    1591                     "[-no-webkit] [-webkit] [-graphicssystem raster|opengl|openvg]\n\n", 0, 7);
     1675                    "[-no-webkit] [-webkit] [-webkit-debug] [-graphicssystem raster|opengl|openvg]\n\n", 0, 7);
    15921676
    15931677        desc("Installation options:\n\n");
     
    16061690        desc(                   "-headerdir <dir>",     "Headers will be installed to dir\n(default PREFIX/include)");
    16071691        desc(                   "-plugindir <dir>",     "Plugins will be installed to dir\n(default PREFIX/plugins)");
     1692        desc(                   "-importdir <dir>",     "Imports for QML will be installed to dir\n(default PREFIX/imports)");
    16081693        desc(                   "-datadir <dir>",       "Data used by Qt programs will be installed to dir\n(default PREFIX)");
    16091694        desc(                   "-translationdir <dir>","Translations of Qt programs will be installed to dir\n(default PREFIX/translations)\n");
     
    16701755        desc("QT3SUPPORT", "no","-no-qt3support",       "Disables the Qt 3 support functionality.\n");
    16711756        desc("OPENGL", "no","-no-opengl",               "Disables OpenGL functionality\n");
     1757        desc("OPENGL", "no","-opengl <api>",            "Enable OpenGL support with specified API version.\n"
     1758                                                        "Available values for <api>:");
     1759        desc("", "", "",                                "  desktop - Enable support for Desktop OpenGL", ' ');
     1760        desc("OPENGL_ES_CM", "no", "",                  "  es1 - Enable support for OpenGL ES Common Profile", ' ');
     1761        desc("OPENGL_ES_2",  "no", "",                  "  es2 - Enable support for OpenGL ES 2.0", ' ');
    16721762
    16731763        desc("OPENVG", "no","-no-openvg",               "Disables OpenVG functionality\n");
     
    16911781        desc(                   "-graphicssystem <sys>",   "Specify which graphicssystem should be used.\n"
    16921782                                "Available values for <sys>:");
    1693         desc("GRAPHICS_SYSTEM", "raster", "", "  raster - Software rasterizer", ' ');
    1694         desc("GRAPHICS_SYSTEM", "opengl", "", "  opengl - Using OpenGL acceleration, experimental!", ' ');
    1695         desc("GRAPHICS_SYSTEM", "openvg", "", "  openvg - Using OpenVG acceleration, experimental!", ' ');
    1696 
     1783        desc("GRAPHICS_SYSTEM", "raster", "",  "  raster - Software rasterizer", ' ');
     1784        desc("GRAPHICS_SYSTEM", "opengl", "",  "  opengl - Using OpenGL acceleration, experimental!", ' ');
     1785        desc("GRAPHICS_SYSTEM", "openvg", "",  "  openvg - Using OpenVG acceleration, experimental!\n", ' ');
    16971786
    16981787        desc(                   "-help, -h, -?",        "Display this information.\n");
     
    17051794        desc("ZLIB", "system",  "-system-zlib",         "Use zlib from the operating system.\nSee http://www.gzip.org/zlib\n");
    17061795
    1707         desc("GIF", "no",       "-no-gif",              "Do not compile the plugin for GIF reading support.");
    1708         desc("GIF", "auto",     "-qt-gif",              "Compile the plugin for GIF reading support.\nSee also src/plugins/imageformats/gif/qgifhandler.h\n");
    1709 
    1710         desc("LIBPNG", "no",    "-no-libpng",           "Do not compile in PNG support.");
     1796        desc("GIF", "no",       "-no-gif",              "Do not compile GIF reading support.");
     1797        desc("GIF", "auto",     "-qt-gif",              "Compile GIF reading support.\nSee also src/gui/image/qgifhandler_p.h\n");
     1798
     1799        desc("LIBPNG", "no",    "-no-libpng",           "Do not compile PNG support.");
    17111800        desc("LIBPNG", "qt",    "-qt-libpng",           "Use the libpng bundled with Qt.");
    17121801        desc("LIBPNG", "system","-system-libpng",       "Use libpng from the operating system.\nSee http://www.libpng.org/pub/png\n");
    17131802
    1714         desc("LIBMNG", "no",    "-no-libmng",           "Do not compile in MNG support.");
     1803        desc("LIBMNG", "no",    "-no-libmng",           "Do not compile MNG support.");
    17151804        desc("LIBMNG", "qt",    "-qt-libmng",           "Use the libmng bundled with Qt.");
    17161805        desc("LIBMNG", "system","-system-libmng",       "Use libmng from the operating system.\nSee See http://www.libmng.com\n");
    17171806
    1718         desc("LIBTIFF", "no",    "-no-libtiff",         "Do not compile the plugin for TIFF support.");
     1807        desc("LIBTIFF", "no",    "-no-libtiff",         "Do not compile TIFF support.");
    17191808        desc("LIBTIFF", "qt",    "-qt-libtiff",         "Use the libtiff bundled with Qt.");
    17201809        desc("LIBTIFF", "system","-system-libtiff",     "Use libtiff from the operating system.\nSee http://www.libtiff.org\n");
    17211810
    1722         desc("LIBJPEG", "no",    "-no-libjpeg",         "Do not compile the plugin for JPEG support.");
     1811        desc("LIBJPEG", "no",    "-no-libjpeg",         "Do not compile JPEG support.");
    17231812        desc("LIBJPEG", "qt",    "-qt-libjpeg",         "Use the libjpeg bundled with Qt.");
    17241813        desc("LIBJPEG", "system","-system-libjpeg",     "Use libjpeg from the operating system.\nSee http://www.ijg.org\n");
     
    17731862        desc("WEBKIT", "no",    "-no-webkit",           "Do not compile in the WebKit module");
    17741863        desc("WEBKIT", "yes",   "-webkit",              "Compile in the WebKit module (WebKit is built if a decent C++ compiler is used.)");
     1864        desc("WEBKIT", "debug", "-webkit-debug",        "Compile in the WebKit module with debug symbols.");
    17751865        desc("SCRIPT", "no",    "-no-script",           "Do not build the QtScript module.");
    17761866        desc("SCRIPT", "yes",   "-script",              "Build the QtScript module.");
     
    17791869        desc("DECLARATIVE", "no",    "-no-declarative", "Do not build the declarative module");
    17801870        desc("DECLARATIVE", "yes",   "-declarative",    "Build the declarative module");
     1871        desc("DECLARATIVE_DEBUG", "no",    "-no-declarative-debug", "Do not build the declarative debugging support");
     1872        desc("DECLARATIVE_DEBUG", "yes",   "-declarative-debug",    "Build the declarative debugging support");
    17811873
    17821874        desc(                   "-arch <arch>",         "Specify an architecture.\n"
     
    18031895        desc("NATIVE_GESTURES", "no", "-no-native-gestures", "Do not use native gestures on Windows 7.");
    18041896        desc("NATIVE_GESTURES", "yes", "-native-gestures", "Use native gestures on Windows 7.");
     1897        desc("MSVC_MP", "no", "-no-mp",                 "Do not use multiple processors for compiling with MSVC");
     1898        desc("MSVC_MP", "yes", "-mp",                   "Use multiple processors for compiling with MSVC (-MP)");
    18051899
    18061900/*      We do not support -qconfig on Windows yet
     
    18261920        desc("CETEST", "yes",      "-cetest",              "Compile Windows CE remote test application");
    18271921        desc(                      "-signature <file>",    "Use file for signing the target project");
    1828         desc("OPENGL_ES_CM", "no", "-opengl-es-cm",        "Enable support for OpenGL ES Common");
    1829         desc("OPENGL_ES_CL", "no", "-opengl-es-cl",        "Enable support for OpenGL ES Common Lite");
    1830         desc("OPENGL_ES_2",  "no", "-opengl-es-2",         "Enable support for OpenGL ES 2.0");
     1922
    18311923        desc("DIRECTSHOW", "no",   "-phonon-wince-ds9",    "Enable Phonon Direct Show 9 backend for Windows CE");
    18321924
     
    18541946    QStringList pathList = paths.split(splitReg, QString::SkipEmptyParts);
    18551947    QDir d;
    1856     for( QStringList::ConstIterator it = pathList.begin(); it != pathList.end(); ++it ) {
     1948    for (QStringList::ConstIterator it = pathList.begin(); it != pathList.end(); ++it) {
    18571949        // Remove any leading or trailing ", this is commonly used in the environment
    18581950        // variables
    18591951        QString path = (*it);
    1860         if ( path.startsWith( '\"' ) )
    1861             path = path.right( path.length() - 1 );
    1862         if ( path.endsWith( '\"' ) )
    1863             path = path.left( path.length() - 1 );
    1864         if( d.exists( path + QDir::separator() + fileName ) )
     1952        if (path.startsWith('\"'))
     1953            path = path.right(path.length() - 1);
     1954        if (path.endsWith('\"'))
     1955            path = path.left(path.length() - 1);
     1956        if (d.exists(path + QDir::separator() + fileName))
    18651957            return path;
    18661958    }
     
    18681960}
    18691961
    1870 bool Configure::findFile( const QString &fileName )
     1962bool Configure::findFile(const QString &fileName)
    18711963{
    18721964    const QString file = fileName.toLower();
    18731965    const QString pathEnvVar = QString::fromLocal8Bit(getenv("PATH"));
    18741966    const QString mingwPath = dictionary["QMAKESPEC"].endsWith("-g++") ?
    1875         findFileInPaths("mingw32-g++.exe", pathEnvVar) : QString();
     1967        findFileInPaths("g++.exe", pathEnvVar) : QString();
    18761968
    18771969    QString paths;
    18781970    if (file.endsWith(".h")) {
    1879         if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull())
    1880                     return true;
     1971        if (!mingwPath.isNull()) {
     1972            if (!findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull())
     1973                return true;
     1974            //now let's try the additional compiler path
     1975            QDir mingwLibDir = mingwPath + QLatin1String("/../lib/gcc/mingw32");
     1976            foreach(const QFileInfo &version, mingwLibDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) {
     1977                if (!findFileInPaths(file, version.absoluteFilePath() + QLatin1String("/include")).isNull())
     1978                    return true;
     1979            }
     1980        }
    18811981        paths = QString::fromLocal8Bit(getenv("INCLUDE"));
    1882     } else if ( file.endsWith( ".lib" ) ||  file.endsWith( ".a" ) ) {
     1982    } else if (file.endsWith(".lib") ||  file.endsWith(".a")) {
    18831983        if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../lib")).isNull())
    1884                     return true;
     1984            return true;
    18851985        paths = QString::fromLocal8Bit(getenv("LIB"));
    18861986    } else {
     
    19052005        return "system";
    19062006
    1907     // We want PNG built-in
     2007    // PNG is always built-in, never a plugin
    19082008    if (option == "PNG")
    1909         return "qt";
    1910 
    1911     // The JPEG image library can only be a plugin
    1912     if (option == "JPEG"
    1913         || option == "MNG" || option == "TIFF")
    1914         return "plugin";
    1915 
    1916     // GIF off by default
    1917     if (option == "GIF") {
    1918         if (dictionary["SHARED"] == "yes")
     2009        return "yes";
     2010
     2011    // These database drivers and image formats can be built-in or plugins.
     2012    // Prefer plugins when Qt is shared.
     2013    if (dictionary[ "SHARED" ] == "yes") {
     2014        if (option == "SQL_MYSQL"
     2015            || option == "SQL_MYSQL"
     2016            || option == "SQL_ODBC"
     2017            || option == "SQL_OCI"
     2018            || option == "SQL_PSQL"
     2019            || option == "SQL_TDS"
     2020            || option == "SQL_DB2"
     2021            || option == "SQL_SQLITE"
     2022            || option == "SQL_SQLITE2"
     2023            || option == "SQL_IBASE"
     2024            || option == "JPEG"
     2025            || option == "MNG"
     2026            || option == "TIFF"
     2027            || option == "GIF")
    19192028            return "plugin";
    1920         else
    1921             return "yes";
    19222029    }
    19232030
     
    19292036        return "no";
    19302037
    1931     if (option == "SQL_MYSQL"
    1932         || option == "SQL_MYSQL"
    1933         || option == "SQL_ODBC"
    1934         || option == "SQL_OCI"
    1935         || option == "SQL_PSQL"
    1936         || option == "SQL_TDS"
    1937         || option == "SQL_DB2"
    1938         || option == "SQL_SQLITE"
    1939         || option == "SQL_SQLITE2"
    1940         || option == "SQL_IBASE")
    1941         return "plugin";
    1942 
    19432038    if (option == "SYNCQT"
    19442039        && (!QFile::exists(sourcePath + "/bin/syncqt") ||
     
    19572052    bool available = false;
    19582053    if (part == "STYLE_WINDOWSXP")
    1959         available = (findFile("uxtheme.h"));
     2054        available = findFile("uxtheme.h");
    19602055
    19612056    else if (part == "ZLIB")
     
    19892084    else if (part == "SQL_SQLITE_LIB") {
    19902085        if (dictionary[ "SQL_SQLITE_LIB" ] == "system") {
    1991                     // Symbian has multiple .lib/.dll files we need to find
     2086            // Symbian has multiple .lib/.dll files we need to find
    19922087            if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
    1993                             available = true; // There is sqlite_symbian plugin which exports the necessary stuff
    1994                             dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3";
    1995                     } else {
    1996                             available = findFile("sqlite3.h") && findFile("sqlite3.lib");
    1997                             if (available)
    1998                                     dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib";
    1999                     }
     2088                available = true; // There is sqlite_symbian plugin which exports the necessary stuff
     2089                dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3";
     2090            } else {
     2091                available = findFile("sqlite3.h") && findFile("sqlite3.lib");
     2092                if (available)
     2093                    dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib";
     2094            }
    20002095        } else
    20012096            available = true;
     
    20082103    else if (part == "OPENGL_ES_CM")
    20092104        available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
    2010     else if (part == "OPENGL_ES_CL")
    2011         available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
    20122105    else if (part == "OPENGL_ES_2")
    20132106        available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
     
    20152108        available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
    20162109    else if (part == "SSE2")
    2017         available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-g++");
    2018     else if (part == "3DNOW" )
    2019         available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-icc") && findFile("mm3dnow.h") && (dictionary.value("QMAKESPEC") != "win32-g++");
     2110        available = (dictionary.value("QMAKESPEC") != "win32-msvc");
     2111    else if (part == "3DNOW")
     2112        available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-icc") && findFile("mm3dnow.h");
    20202113    else if (part == "MMX" || part == "SSE")
    2021         available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-g++");
     2114        available = (dictionary.value("QMAKESPEC") != "win32-msvc");
    20222115    else if (part == "OPENSSL")
    20232116        available = findFile("openssl\\ssl.h");
     
    20482141               && dictionary.value("EXCEPTIONS") == "yes";
    20492142    } else if (part == "PHONON") {
    2050         available = findFile("vmr9.h") && findFile("dshow.h") && findFile("dmo.h") && findFile("dmodshow.h")
    2051             && (findFile("strmiids.lib") || findFile("libstrmiids.a"))
    2052             && (findFile("dmoguids.lib") || findFile("libdmoguids.a"))
    2053             && (findFile("msdmo.lib") || findFile("libmsdmo.a"))
    2054             && findFile("d3d9.h");
    2055 
    2056         if (!available) {
    2057             cout << "All the required DirectShow/Direct3D files couldn't be found." << endl
    2058                  << "Make sure you have either the platform SDK AND the DirectShow SDK or the Windows SDK installed." << endl
    2059                  << "If you have the DirectShow SDK installed, please make sure that you have run the <path to SDK>\\SetEnv.Cmd script." << endl;
    2060             if (!findFile("vmr9.h"))  cout << "vmr9.h not found" << endl;
    2061             if (!findFile("dshow.h")) cout << "dshow.h not found" << endl;
    2062             if (!findFile("strmiids.lib")) cout << "strmiids.lib not found" << endl;
    2063             if (!findFile("dmoguids.lib")) cout << "dmoguids.lib not found" << endl;
    2064             if (!findFile("msdmo.lib")) cout << "msdmo.lib not found" << endl;
    2065             if (!findFile("d3d9.h")) cout << "d3d9.h not found" << endl;
    2066         }
    2067     } else if (part == "MULTIMEDIA" || part == "SCRIPT" || part == "SCRIPTTOOLS") {
     2143        if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
     2144            available = true;
     2145        } else {
     2146            available = findFile("vmr9.h") && findFile("dshow.h") && findFile("dmo.h") && findFile("dmodshow.h")
     2147                && (findFile("strmiids.lib") || findFile("libstrmiids.a"))
     2148                && (findFile("dmoguids.lib") || findFile("libdmoguids.a"))
     2149                && (findFile("msdmo.lib") || findFile("libmsdmo.a"))
     2150                && findFile("d3d9.h");
     2151
     2152            if (!available) {
     2153                cout << "All the required DirectShow/Direct3D files couldn't be found." << endl
     2154                     << "Make sure you have either the platform SDK AND the DirectShow SDK or the Windows SDK installed." << endl
     2155                     << "If you have the DirectShow SDK installed, please make sure that you have run the <path to SDK>\\SetEnv.Cmd script." << endl;
     2156                if (!findFile("vmr9.h"))  cout << "vmr9.h not found" << endl;
     2157                if (!findFile("dshow.h")) cout << "dshow.h not found" << endl;
     2158                if (!findFile("strmiids.lib")) cout << "strmiids.lib not found" << endl;
     2159                if (!findFile("dmoguids.lib")) cout << "dmoguids.lib not found" << endl;
     2160                if (!findFile("msdmo.lib")) cout << "msdmo.lib not found" << endl;
     2161                if (!findFile("d3d9.h")) cout << "d3d9.h not found" << endl;
     2162            }
     2163        }
     2164    } else if (part == "WMSDK") {
     2165        available = findFile("wmsdk.h");
     2166    } else if (part == "MULTIMEDIA" || part == "SCRIPT" || part == "SCRIPTTOOLS" || part == "DECLARATIVE") {
    20682167        available = true;
    20692168    } else if (part == "WEBKIT") {
    2070         available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-g++");
    2071     } else if (part == "DECLARATIVE") {
    2072         available = QFile::exists(sourcePath + "/src/declarative/qml/qmlcomponent.h");
     2169        available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-msvc2010") || (dictionary.value("QMAKESPEC") == "win32-g++");
     2170        if (dictionary[ "SHARED" ] == "no") {
     2171            cout << endl << "WARNING: Using static linking will disable the WebKit module." << endl
     2172                 << endl;
     2173            available = false;
     2174        }
    20732175    } else if (part == "AUDIO_BACKEND") {
    20742176        available = true;
     
    20952197                available = (paths.size() == 0);
    20962198                if (!available) {
    2097                     if (epocRoot.isNull() || epocRoot == "")
     2199                    if (epocRoot.isEmpty())
    20982200                        epocRoot = "<empty string>";
    20992201                    cout << endl
     
    21962298        dictionary["SCRIPT"] = checkAvailability("SCRIPT") ? "yes" : "no";
    21972299    if (dictionary["SCRIPTTOOLS"] == "auto")
    2198         dictionary["SCRIPTTOOLS"] = checkAvailability("SCRIPTTOOLS") ? "yes" : "no";
     2300        dictionary["SCRIPTTOOLS"] = dictionary["SCRIPT"] == "yes" ? "yes" : "no";
    21992301    if (dictionary["XMLPATTERNS"] == "auto")
    22002302        dictionary["XMLPATTERNS"] = checkAvailability("XMLPATTERNS") ? "yes" : "no";
     
    22042306        dictionary["WEBKIT"] = checkAvailability("WEBKIT") ? "yes" : "no";
    22052307    if (dictionary["DECLARATIVE"] == "auto")
    2206         dictionary["DECLARATIVE"] = checkAvailability("DECLARATIVE") ? "yes" : "no";
     2308        dictionary["DECLARATIVE"] = dictionary["SCRIPT"] == "yes" ? "yes" : "no";
     2309    if (dictionary["DECLARATIVE_DEBUG"] == "auto")
     2310        dictionary["DECLARATIVE_DEBUG"] = dictionary["DECLARATIVE"] == "yes" ? "yes" : "no";
    22072311    if (dictionary["AUDIO_BACKEND"] == "auto")
    22082312        dictionary["AUDIO_BACKEND"] = checkAvailability("AUDIO_BACKEND") ? "yes" : "no";
     2313    if (dictionary["WMSDK"] == "auto")
     2314        dictionary["WMSDK"] = checkAvailability("WMSDK") ? "yes" : "no";
    22092315
    22102316    // Qt/WinCE remote test application
     
    22292335             << "Configure will therefore continue with the SQLite3 lib bundled with Qt." << endl
    22302336             << "(Press any key to continue..)";
    2231         if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
     2337        if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
    22322338            exit(0);      // Exit cleanly for Ctrl+C
    22332339
     
    22402346             << "Oracle driver, as the current build will most likely fail." << endl;
    22412347        cout << "(Press any key to continue..)";
    2242         if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
     2348        if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
    22432349            exit(0);      // Exit cleanly for Ctrl+C
    22442350    }
     
    22472353             << "win32-msvc2002 or win32-msvc2003 instead." << endl;
    22482354        cout << "(Press any key to continue..)";
    2249         if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
     2355        if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
    22502356            exit(0);      // Exit cleanly for Ctrl+C
    22512357    }
    2252         if (0 != dictionary["ARM_FPU_TYPE"].size())
    2253         {
    2254                 QStringList l= QStringList()
    2255                         << "softvfp"
    2256                         << "softvfp+vfpv2"
    2257                         << "vfpv2";
    2258                 if (!(l.contains(dictionary["ARM_FPU_TYPE"])))
    2259                         cout << QString("WARNING: Using unsupported fpu flag: %1").arg(dictionary["ARM_FPU_TYPE"]) << endl;
    2260         }
     2358    if (0 != dictionary["ARM_FPU_TYPE"].size()) {
     2359            QStringList l= QStringList()
     2360                    << "softvfp"
     2361                    << "softvfp+vfpv2"
     2362                    << "vfpv2";
     2363            if (!(l.contains(dictionary["ARM_FPU_TYPE"])))
     2364                    cout << QString("WARNING: Using unsupported fpu flag: %1").arg(dictionary["ARM_FPU_TYPE"]) << endl;
     2365    }
     2366    if (dictionary["DECLARATIVE"] == "yes" && dictionary["SCRIPT"] == "no") {
     2367        cout << "WARNING: To be able to compile QtDeclarative we need to also compile the" << endl
     2368             << "QtScript module. If you continue, we will turn on the QtScript module." << endl
     2369             << "(Press any key to continue..)";
     2370        if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
     2371            exit(0);      // Exit cleanly for Ctrl+C
     2372
     2373        dictionary["SCRIPT"] = "yes";
     2374    }
    22612375
    22622376    return true;
     
    23312445                       "#else\n"
    23322446                       // Debug builds
    2333                        "# if (defined(_DEBUG) || defined(DEBUG))\n"
     2447                       "# if !defined(QT_NO_DEBUG)\n"
    23342448                       "#  if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n"
    23352449                       + build64Key.arg("debug") + "\"\n"
     
    23542468    // Generate variables for output
    23552469    // Build key ----------------------------------------------------
    2356     if ( dictionary.contains("BUILD_KEY") ) {
     2470    if (dictionary.contains("BUILD_KEY")) {
    23572471        qmakeVars += dictionary.value("BUILD_KEY");
    23582472    }
     
    23602474    QString build = dictionary[ "BUILD" ];
    23612475    bool buildAll = (dictionary[ "BUILDALL" ] == "yes");
    2362     if ( build == "debug") {
     2476    if (build == "debug") {
    23632477        if (buildAll)
    23642478            qtConfig += "release";
     
    23712485
    23722486    // Compression --------------------------------------------------
    2373     if( dictionary[ "ZLIB" ] == "qt" )
     2487    if (dictionary[ "ZLIB" ] == "qt")
    23742488        qtConfig += "zlib";
    2375     else if( dictionary[ "ZLIB" ] == "system" )
     2489    else if (dictionary[ "ZLIB" ] == "system")
    23762490        qtConfig += "system-zlib";
    23772491
    23782492    // Image formates -----------------------------------------------
    2379     if( dictionary[ "GIF" ] == "no" )
     2493    if (dictionary[ "GIF" ] == "no")
    23802494        qtConfig += "no-gif";
    2381     else if( dictionary[ "GIF" ] == "yes" )
     2495    else if (dictionary[ "GIF" ] == "yes")
    23822496        qtConfig += "gif";
    2383     else if( dictionary[ "GIF" ] == "plugin" )
    2384         qmakeFormatPlugins += "gif";
    2385 
    2386     if( dictionary[ "TIFF" ] == "no" )
    2387           qtConfig += "no-tiff";
    2388     else if( dictionary[ "TIFF" ] == "plugin" )
    2389         qmakeFormatPlugins += "tiff";
    2390     if( dictionary[ "LIBTIFF" ] == "system" )
     2497
     2498    if (dictionary[ "TIFF" ] == "no")
     2499        qtConfig += "no-tiff";
     2500    else if (dictionary[ "TIFF" ] == "yes")
     2501        qtConfig += "tiff";
     2502    if (dictionary[ "LIBTIFF" ] == "system")
    23912503        qtConfig += "system-tiff";
    23922504
    2393     if( dictionary[ "JPEG" ] == "no" )
     2505    if (dictionary[ "JPEG" ] == "no")
    23942506        qtConfig += "no-jpeg";
    2395     else if( dictionary[ "JPEG" ] == "plugin" )
    2396         qmakeFormatPlugins += "jpeg";
    2397     if( dictionary[ "LIBJPEG" ] == "system" )
     2507    else if (dictionary[ "JPEG" ] == "yes")
     2508        qtConfig += "jpeg";
     2509    if (dictionary[ "LIBJPEG" ] == "system")
    23982510        qtConfig += "system-jpeg";
    23992511
    2400     if( dictionary[ "PNG" ] == "no" )
     2512    if (dictionary[ "PNG" ] == "no")
    24012513        qtConfig += "no-png";
    2402     else if( dictionary[ "PNG" ] == "qt" )
     2514    else if (dictionary[ "PNG" ] == "yes")
    24032515        qtConfig += "png";
    2404     if( dictionary[ "LIBPNG" ] == "system" )
     2516    if (dictionary[ "LIBPNG" ] == "system")
    24052517        qtConfig += "system-png";
    24062518
    2407     if( dictionary[ "MNG" ] == "no" )
     2519    if (dictionary[ "MNG" ] == "no")
    24082520        qtConfig += "no-mng";
    2409     else if( dictionary[ "MNG" ] == "qt" )
     2521    else if (dictionary[ "MNG" ] == "yes")
    24102522        qtConfig += "mng";
    2411     if( dictionary[ "LIBMNG" ] == "system" )
     2523    if (dictionary[ "LIBMNG" ] == "system")
    24122524        qtConfig += "system-mng";
    24132525
    24142526    // Text rendering --------------------------------------------------
    2415     if( dictionary[ "FREETYPE" ] == "yes" )
     2527    if (dictionary[ "FREETYPE" ] == "yes")
    24162528        qtConfig += "freetype";
    24172529
    24182530    // Styles -------------------------------------------------------
    2419     if ( dictionary[ "STYLE_WINDOWS" ] == "yes" )
     2531    if (dictionary[ "STYLE_WINDOWS" ] == "yes")
    24202532        qmakeStyles += "windows";
    24212533
    2422     if ( dictionary[ "STYLE_PLASTIQUE" ] == "yes" )
     2534    if (dictionary[ "STYLE_PLASTIQUE" ] == "yes")
    24232535        qmakeStyles += "plastique";
    24242536
    2425     if ( dictionary[ "STYLE_CLEANLOOKS" ] == "yes" )
     2537    if (dictionary[ "STYLE_CLEANLOOKS" ] == "yes")
    24262538        qmakeStyles += "cleanlooks";
    24272539
    2428     if ( dictionary[ "STYLE_WINDOWSXP" ] == "yes" )
     2540    if (dictionary[ "STYLE_WINDOWSXP" ] == "yes")
    24292541        qmakeStyles += "windowsxp";
    24302542
    2431     if ( dictionary[ "STYLE_WINDOWSVISTA" ] == "yes" )
     2543    if (dictionary[ "STYLE_WINDOWSVISTA" ] == "yes")
    24322544        qmakeStyles += "windowsvista";
    24332545
    2434     if ( dictionary[ "STYLE_MOTIF" ] == "yes" )
     2546    if (dictionary[ "STYLE_MOTIF" ] == "yes")
    24352547        qmakeStyles += "motif";
    24362548
    2437     if ( dictionary[ "STYLE_SGI" ] == "yes" )
     2549    if (dictionary[ "STYLE_SGI" ] == "yes")
    24382550        qmakeStyles += "sgi";
    24392551
    2440     if ( dictionary[ "STYLE_WINDOWSCE" ] == "yes" )
     2552    if (dictionary[ "STYLE_WINDOWSCE" ] == "yes")
    24412553    qmakeStyles += "windowsce";
    24422554
    2443     if ( dictionary[ "STYLE_WINDOWSMOBILE" ] == "yes" )
     2555    if (dictionary[ "STYLE_WINDOWSMOBILE" ] == "yes")
    24442556    qmakeStyles += "windowsmobile";
    24452557
    2446     if ( dictionary[ "STYLE_CDE" ] == "yes" )
     2558    if (dictionary[ "STYLE_CDE" ] == "yes")
    24472559        qmakeStyles += "cde";
    24482560
    2449     if ( dictionary[ "STYLE_S60" ] == "yes" )
     2561    if (dictionary[ "STYLE_S60" ] == "yes")
    24502562        qmakeStyles += "s60";
    24512563
    24522564    // Databases ----------------------------------------------------
    2453     if ( dictionary[ "SQL_MYSQL" ] == "yes" )
     2565    if (dictionary[ "SQL_MYSQL" ] == "yes")
    24542566        qmakeSql += "mysql";
    2455     else if ( dictionary[ "SQL_MYSQL" ] == "plugin" )
     2567    else if (dictionary[ "SQL_MYSQL" ] == "plugin")
    24562568        qmakeSqlPlugins += "mysql";
    24572569
    2458     if ( dictionary[ "SQL_ODBC" ] == "yes" )
     2570    if (dictionary[ "SQL_ODBC" ] == "yes")
    24592571        qmakeSql += "odbc";
    2460     else if ( dictionary[ "SQL_ODBC" ] == "plugin" )
     2572    else if (dictionary[ "SQL_ODBC" ] == "plugin")
    24612573        qmakeSqlPlugins += "odbc";
    24622574
    2463     if ( dictionary[ "SQL_OCI" ] == "yes" )
     2575    if (dictionary[ "SQL_OCI" ] == "yes")
    24642576        qmakeSql += "oci";
    2465     else if ( dictionary[ "SQL_OCI" ] == "plugin" )
     2577    else if (dictionary[ "SQL_OCI" ] == "plugin")
    24662578        qmakeSqlPlugins += "oci";
    24672579
    2468     if ( dictionary[ "SQL_PSQL" ] == "yes" )
     2580    if (dictionary[ "SQL_PSQL" ] == "yes")
    24692581        qmakeSql += "psql";
    2470     else if ( dictionary[ "SQL_PSQL" ] == "plugin" )
     2582    else if (dictionary[ "SQL_PSQL" ] == "plugin")
    24712583        qmakeSqlPlugins += "psql";
    24722584
    2473     if ( dictionary[ "SQL_TDS" ] == "yes" )
     2585    if (dictionary[ "SQL_TDS" ] == "yes")
    24742586        qmakeSql += "tds";
    2475     else if ( dictionary[ "SQL_TDS" ] == "plugin" )
     2587    else if (dictionary[ "SQL_TDS" ] == "plugin")
    24762588        qmakeSqlPlugins += "tds";
    24772589
    2478     if ( dictionary[ "SQL_DB2" ] == "yes" )
     2590    if (dictionary[ "SQL_DB2" ] == "yes")
    24792591        qmakeSql += "db2";
    2480     else if ( dictionary[ "SQL_DB2" ] == "plugin" )
     2592    else if (dictionary[ "SQL_DB2" ] == "plugin")
    24812593        qmakeSqlPlugins += "db2";
    24822594
    2483     if ( dictionary[ "SQL_SQLITE" ] == "yes" )
     2595    if (dictionary[ "SQL_SQLITE" ] == "yes")
    24842596        qmakeSql += "sqlite";
    2485     else if ( dictionary[ "SQL_SQLITE" ] == "plugin" )
     2597    else if (dictionary[ "SQL_SQLITE" ] == "plugin")
    24862598        qmakeSqlPlugins += "sqlite";
    24872599
    2488     if ( dictionary[ "SQL_SQLITE_LIB" ] == "system" )
     2600    if (dictionary[ "SQL_SQLITE_LIB" ] == "system")
    24892601        qmakeConfig += "system-sqlite";
    24902602
    2491     if ( dictionary[ "SQL_SQLITE2" ] == "yes" )
     2603    if (dictionary[ "SQL_SQLITE2" ] == "yes")
    24922604        qmakeSql += "sqlite2";
    2493     else if ( dictionary[ "SQL_SQLITE2" ] == "plugin" )
     2605    else if (dictionary[ "SQL_SQLITE2" ] == "plugin")
    24942606        qmakeSqlPlugins += "sqlite2";
    24952607
    2496     if ( dictionary[ "SQL_IBASE" ] == "yes" )
     2608    if (dictionary[ "SQL_IBASE" ] == "yes")
    24972609        qmakeSql += "ibase";
    2498     else if ( dictionary[ "SQL_IBASE" ] == "plugin" )
     2610    else if (dictionary[ "SQL_IBASE" ] == "plugin")
    24992611        qmakeSqlPlugins += "ibase";
    25002612
    25012613    // Other options ------------------------------------------------
    2502     if( dictionary[ "BUILDALL" ] == "yes" ) {
     2614    if (dictionary[ "BUILDALL" ] == "yes") {
    25032615        qmakeConfig += "build_all";
    25042616    }
     
    25062618    dictionary[ "QMAKE_OUTDIR" ] = dictionary[ "BUILD" ];
    25072619
    2508     if ( dictionary[ "SHARED" ] == "yes" ) {
     2620    if (dictionary[ "SHARED" ] == "yes") {
    25092621        QString version = dictionary[ "VERSION" ];
    25102622        if (!version.isEmpty()) {
     
    25172629    }
    25182630
    2519     if( dictionary[ "ACCESSIBILITY" ] == "yes" )
     2631    if (dictionary[ "ACCESSIBILITY" ] == "yes")
    25202632        qtConfig += "accessibility";
    25212633
    2522     if( !qmakeLibs.isEmpty() )
    2523         qmakeVars += "LIBS           += " + qmakeLibs.join( " " );
    2524 
    2525     if( !dictionary["QT_LFLAGS_SQLITE"].isEmpty() )
    2526         qmakeVars += "QT_LFLAGS_SQLITE += " + dictionary["QT_LFLAGS_SQLITE"];
     2634    if (!qmakeLibs.isEmpty())
     2635        qmakeVars += "LIBS           += " + escapeSeparators(qmakeLibs.join(" "));
     2636
     2637    if (!dictionary["QT_LFLAGS_SQLITE"].isEmpty())
     2638        qmakeVars += "QT_LFLAGS_SQLITE += " + escapeSeparators(dictionary["QT_LFLAGS_SQLITE"]);
    25272639
    25282640    if (dictionary[ "QT3SUPPORT" ] == "yes")
     
    25322644        qtConfig += "opengl";
    25332645
    2534     if ( dictionary["OPENGL_ES_CM"] == "yes" ) {
     2646    if (dictionary["OPENGL_ES_CM"] == "yes") {
    25352647        qtConfig += "opengles1";
    25362648        qtConfig += "egl";
    25372649    }
    25382650
    2539     if ( dictionary["OPENGL_ES_2"] == "yes" ) {
     2651    if (dictionary["OPENGL_ES_2"] == "yes") {
    25402652        qtConfig += "opengles2";
    25412653        qtConfig += "egl";
    25422654    }
    25432655
    2544     if ( dictionary["OPENGL_ES_CL"] == "yes" ) {
    2545         qtConfig += "opengles1cl";
    2546         qtConfig += "egl";
    2547     }
    2548 
    2549     if ( dictionary["OPENVG"] == "yes" ) {
     2656    if (dictionary["OPENVG"] == "yes") {
    25502657        qtConfig += "openvg";
    25512658        qtConfig += "egl";
    25522659    }
    25532660
    2554     if ( dictionary["S60"] == "yes" ) {
     2661    if (dictionary["S60"] == "yes") {
    25552662        qtConfig += "s60";
    25562663    }
    25572664
    2558      if ( dictionary["DIRECTSHOW"] == "yes" )
     2665     if (dictionary["DIRECTSHOW"] == "yes")
    25592666        qtConfig += "directshow";
    25602667
     
    26042711    }
    26052712
    2606     if (dictionary["WEBKIT"] == "yes")
    2607         qtConfig += "webkit";
    2608 
    2609     if (dictionary["DECLARATIVE"] == "yes")
     2713    QString dst = buildPath + "/mkspecs/modules/qt_webkit_version.pri";
     2714    QFile::remove(dst);
     2715    if (dictionary["WEBKIT"] != "no") {
     2716        // This include takes care of adding "webkit" to QT_CONFIG.
     2717        QString src = sourcePath + "/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri";
     2718        QFile::copy(src, dst);
     2719        if (dictionary["WEBKIT"] == "debug")
     2720            qtConfig += "webkit-debug";
     2721    }
     2722
     2723    if (dictionary["DECLARATIVE"] == "yes") {
     2724        if (dictionary[ "SCRIPT" ] == "no") {
     2725            cout << "QtDeclarative was requested, but it can't be built due to QtScript being "
     2726                    "disabled." << endl;
     2727            dictionary[ "DONE" ] = "error";
     2728        }
    26102729        qtConfig += "declarative";
    2611 
    2612     if( dictionary[ "NATIVE_GESTURES" ] == "yes" )
     2730    }
     2731
     2732    if (dictionary[ "NATIVE_GESTURES" ] == "yes")
    26132733        qtConfig += "native-gestures";
    26142734
     
    26262746    QString set_config = dictionary["QCONFIG"];
    26272747    if (possible_configs.contains(set_config)) {
    2628         foreach(QString cfg, possible_configs) {
     2748        foreach (const QString &cfg, possible_configs) {
    26292749            qtConfig += (cfg + "-config");
    26302750            if (cfg == set_config)
     
    26332753    }
    26342754
    2635     if (dictionary.contains("XQMAKESPEC") && ( dictionary["QMAKESPEC"] != dictionary["XQMAKESPEC"] ) )
     2755    if (dictionary.contains("XQMAKESPEC") && (dictionary["QMAKESPEC"] != dictionary["XQMAKESPEC"]))
    26362756            qmakeConfig += "cross_compile";
    26372757
     
    26412761    // if prefix is empty (WINCE), make all of them empty, if they aren't set
    26422762    bool qipempty = false;
    2643     if(dictionary[ "QT_INSTALL_PREFIX" ].isEmpty())
     2763    if (dictionary[ "QT_INSTALL_PREFIX" ].isEmpty())
    26442764        qipempty = true;
    26452765
    2646     if( !dictionary[ "QT_INSTALL_DOCS" ].size() )
    2647         dictionary[ "QT_INSTALL_DOCS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/doc" );
    2648     if( !dictionary[ "QT_INSTALL_HEADERS" ].size() )
    2649         dictionary[ "QT_INSTALL_HEADERS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/include" );
    2650     if( !dictionary[ "QT_INSTALL_LIBS" ].size() )
    2651         dictionary[ "QT_INSTALL_LIBS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/lib" );
    2652     if( !dictionary[ "QT_INSTALL_BINS" ].size() )
    2653         dictionary[ "QT_INSTALL_BINS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/bin" );
    2654     if( !dictionary[ "QT_INSTALL_PLUGINS" ].size() )
    2655         dictionary[ "QT_INSTALL_PLUGINS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/plugins" );
    2656     if( !dictionary[ "QT_INSTALL_DATA" ].size() )
    2657         dictionary[ "QT_INSTALL_DATA" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] );
    2658     if( !dictionary[ "QT_INSTALL_TRANSLATIONS" ].size() )
    2659         dictionary[ "QT_INSTALL_TRANSLATIONS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/translations" );
    2660     if( !dictionary[ "QT_INSTALL_EXAMPLES" ].size() )
    2661         dictionary[ "QT_INSTALL_EXAMPLES" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/examples");
    2662     if( !dictionary[ "QT_INSTALL_DEMOS" ].size() )
    2663         dictionary[ "QT_INSTALL_DEMOS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/demos" );
    2664 
    2665     if(dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux"))
     2766    if (!dictionary[ "QT_INSTALL_DOCS" ].size())
     2767        dictionary[ "QT_INSTALL_DOCS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/doc");
     2768    if (!dictionary[ "QT_INSTALL_HEADERS" ].size())
     2769        dictionary[ "QT_INSTALL_HEADERS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/include");
     2770    if (!dictionary[ "QT_INSTALL_LIBS" ].size())
     2771        dictionary[ "QT_INSTALL_LIBS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/lib");
     2772    if (!dictionary[ "QT_INSTALL_BINS" ].size())
     2773        dictionary[ "QT_INSTALL_BINS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/bin");
     2774    if (!dictionary[ "QT_INSTALL_PLUGINS" ].size())
     2775        dictionary[ "QT_INSTALL_PLUGINS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/plugins");
     2776    if (!dictionary[ "QT_INSTALL_IMPORTS" ].size())
     2777        dictionary[ "QT_INSTALL_IMPORTS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/imports");
     2778    if (!dictionary[ "QT_INSTALL_DATA" ].size())
     2779        dictionary[ "QT_INSTALL_DATA" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ]);
     2780    if (!dictionary[ "QT_INSTALL_TRANSLATIONS" ].size())
     2781        dictionary[ "QT_INSTALL_TRANSLATIONS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/translations");
     2782    if (!dictionary[ "QT_INSTALL_EXAMPLES" ].size())
     2783        dictionary[ "QT_INSTALL_EXAMPLES" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/examples");
     2784    if (!dictionary[ "QT_INSTALL_DEMOS" ].size())
     2785        dictionary[ "QT_INSTALL_DEMOS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/demos");
     2786
     2787    if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux"))
    26662788        dictionary[ "QMAKE_RPATHDIR" ] = dictionary[ "QT_INSTALL_LIBS" ];
    26672789
    2668     qmakeVars += QString("OBJECTS_DIR     = ") + fixSeparators( "tmp/obj/" + dictionary[ "QMAKE_OUTDIR" ] );
    2669     qmakeVars += QString("MOC_DIR         = ") + fixSeparators( "tmp/moc/" + dictionary[ "QMAKE_OUTDIR" ] );
    2670     qmakeVars += QString("RCC_DIR         = ") + fixSeparators("tmp/rcc/" + dictionary["QMAKE_OUTDIR"]);
     2790    qmakeVars += QString("OBJECTS_DIR     = ") + fixSeparators("tmp/obj/" + dictionary[ "QMAKE_OUTDIR" ], true);
     2791    qmakeVars += QString("MOC_DIR         = ") + fixSeparators("tmp/moc/" + dictionary[ "QMAKE_OUTDIR" ], true);
     2792    qmakeVars += QString("RCC_DIR         = ") + fixSeparators("tmp/rcc/" + dictionary["QMAKE_OUTDIR"], true);
    26712793
    26722794    if (!qmakeDefines.isEmpty())
    2673         qmakeVars += QString("DEFINES        += ") + qmakeDefines.join( " " );
     2795        qmakeVars += QString("DEFINES        += ") + qmakeDefines.join(" ");
    26742796    if (!qmakeIncludes.isEmpty())
    2675         qmakeVars += QString("INCLUDEPATH    += ") + qmakeIncludes.join( " " );
     2797        qmakeVars += QString("INCLUDEPATH    += ") + escapeSeparators(qmakeIncludes.join(" "));
    26762798    if (!opensslLibs.isEmpty())
    26772799        qmakeVars += opensslLibs;
    26782800    else if (dictionary[ "OPENSSL" ] == "linked") {
    2679         if(dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("symbian") )
     2801        if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("symbian"))
    26802802            qmakeVars += QString("OPENSSL_LIBS    = -llibssl -llibcrypto");
    26812803        else
    26822804            qmakeVars += QString("OPENSSL_LIBS    = -lssleay32 -llibeay32");
    26832805        }
     2806    if (!psqlLibs.isEmpty())
     2807        qmakeVars += QString("QT_LFLAGS_PSQL=") + psqlLibs.section("=", 1);
     2808
     2809    {
     2810        QStringList lflagsTDS;
     2811        if (!sybase.isEmpty())
     2812            lflagsTDS += QString("-L") + fixSeparators(sybase.section("=", 1) + "/lib");
     2813        if (!sybaseLibs.isEmpty())
     2814            lflagsTDS += sybaseLibs.section("=", 1);
     2815        if (!lflagsTDS.isEmpty())
     2816            qmakeVars += QString("QT_LFLAGS_TDS=") + lflagsTDS.join(" ");
     2817    }
     2818
    26842819    if (!qmakeSql.isEmpty())
    2685         qmakeVars += QString("sql-drivers    += ") + qmakeSql.join( " " );
     2820        qmakeVars += QString("sql-drivers    += ") + qmakeSql.join(" ");
    26862821    if (!qmakeSqlPlugins.isEmpty())
    2687         qmakeVars += QString("sql-plugins    += ") + qmakeSqlPlugins.join( " " );
     2822        qmakeVars += QString("sql-plugins    += ") + qmakeSqlPlugins.join(" ");
    26882823    if (!qmakeStyles.isEmpty())
    2689         qmakeVars += QString("styles         += ") + qmakeStyles.join( " " );
     2824        qmakeVars += QString("styles         += ") + qmakeStyles.join(" ");
    26902825    if (!qmakeStylePlugins.isEmpty())
    2691         qmakeVars += QString("style-plugins  += ") + qmakeStylePlugins.join( " " );
    2692     if (!qmakeFormatPlugins.isEmpty())
    2693         qmakeVars += QString("imageformat-plugins += ") + qmakeFormatPlugins.join( " " );
     2826        qmakeVars += QString("style-plugins  += ") + qmakeStylePlugins.join(" ");
    26942827
    26952828    if (dictionary["QMAKESPEC"].endsWith("-g++")) {
     
    27032836    }
    27042837
    2705     if( !dictionary[ "QMAKESPEC" ].length() ) {
     2838    if (!dictionary[ "QMAKESPEC" ].length()) {
    27062839        cout << "Configure could not detect your compiler. QMAKESPEC must either" << endl
    27072840             << "be defined as an environment variable, or specified as an" << endl
     
    27102843
    27112844        QStringList winPlatforms;
    2712         QDir mkspecsDir( sourcePath + "/mkspecs" );
     2845        QDir mkspecsDir(sourcePath + "/mkspecs");
    27132846        const QFileInfoList &specsList = mkspecsDir.entryInfoList();
    2714         for(int i = 0; i < specsList.size(); ++i) {
     2847        for (int i = 0; i < specsList.size(); ++i) {
    27152848            const QFileInfo &fi = specsList.at(i);
    2716             if( fi.fileName().left( 5 ) == "win32" ) {
     2849            if (fi.fileName().left(5) == "win32") {
    27172850                winPlatforms += fi.fileName();
    27182851            }
    27192852        }
    2720         cout << "Available platforms are: " << qPrintable(winPlatforms.join( ", " )) << endl;
     2853        cout << "Available platforms are: " << qPrintable(winPlatforms.join(", ")) << endl;
    27212854        dictionary[ "DONE" ] = "error";
    27222855    }
     
    27272860{
    27282861    // Generate .qmake.cache
    2729     QFile cacheFile( buildPath + "/.qmake.cache" );
    2730     if( cacheFile.open( QFile::WriteOnly | QFile::Text ) ) { // Truncates any existing file.
    2731         QTextStream cacheStream( &cacheFile );
    2732         for( QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var ) {
     2862    QFile cacheFile(buildPath + "/.qmake.cache");
     2863    if (cacheFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file.
     2864        QTextStream cacheStream(&cacheFile);
     2865        for (QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var) {
    27332866            cacheStream << (*var) << endl;
    27342867        }
    2735         cacheStream << "CONFIG         += " << qmakeConfig.join( " " ) << " incremental create_prl link_prl depend_includepath QTDIR_build" << endl;
     2868        cacheStream << "CONFIG         += " << qmakeConfig.join(" ") << " incremental msvc_mp create_prl link_prl depend_includepath QTDIR_build" << endl;
    27362869
    27372870        QStringList buildParts;
    27382871        buildParts << "libs" << "tools" << "examples" << "demos" << "docs" << "translations";
    2739         foreach(QString item, disabledBuildParts) {
     2872        foreach (const QString &item, disabledBuildParts) {
    27402873            buildParts.removeAll(item);
    27412874        }
    2742         cacheStream << "QT_BUILD_PARTS  = " << buildParts.join( " " ) << endl;
     2875        cacheStream << "QT_BUILD_PARTS  = " << buildParts.join(" ") << endl;
    27432876
    27442877        QString targetSpec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ];
    27452878        QString mkspec_path = fixSeparators(sourcePath + "/mkspecs/" + targetSpec);
    2746         if(QFile::exists(mkspec_path))
    2747             cacheStream << "QMAKESPEC       = " << mkspec_path << endl;
     2879        if (QFile::exists(mkspec_path))
     2880            cacheStream << "QMAKESPEC       = " << escapeSeparators(mkspec_path) << endl;
    27482881        else
    2749             cacheStream << "QMAKESPEC       = " << fixSeparators(targetSpec) << endl;
    2750         cacheStream << "ARCH            = " << fixSeparators(dictionary[ "ARCHITECTURE" ]) << endl;
    2751         cacheStream << "QT_BUILD_TREE   = " << fixSeparators(dictionary[ "QT_BUILD_TREE" ]) << endl;
    2752         cacheStream << "QT_SOURCE_TREE  = " << fixSeparators(dictionary[ "QT_SOURCE_TREE" ]) << endl;
     2882            cacheStream << "QMAKESPEC       = " << fixSeparators(targetSpec, true) << endl;
     2883        cacheStream << "ARCH            = " << dictionary[ "ARCHITECTURE" ] << endl;
     2884        cacheStream << "QT_BUILD_TREE   = " << fixSeparators(dictionary[ "QT_BUILD_TREE" ], true) << endl;
     2885        cacheStream << "QT_SOURCE_TREE  = " << fixSeparators(dictionary[ "QT_SOURCE_TREE" ], true) << endl;
    27532886
    27542887        if (dictionary["QT_EDITION"] != "QT_EDITION_OPENSOURCE")
     
    27562889
    27572890        //so that we can build without an install first (which would be impossible)
    2758         cacheStream << "QMAKE_MOC       = $$QT_BUILD_TREE" << fixSeparators("/bin/moc.exe") << endl;
    2759         cacheStream << "QMAKE_UIC       = $$QT_BUILD_TREE" << fixSeparators("/bin/uic.exe") << endl;
    2760         cacheStream << "QMAKE_UIC3      = $$QT_BUILD_TREE" << fixSeparators("/bin/uic3.exe") << endl;
    2761         cacheStream << "QMAKE_RCC       = $$QT_BUILD_TREE" << fixSeparators("/bin/rcc.exe") << endl;
    2762         cacheStream << "QMAKE_DUMPCPP   = $$QT_BUILD_TREE" << fixSeparators("/bin/dumpcpp.exe") << endl;
    2763         cacheStream << "QMAKE_INCDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/include") << endl;
    2764         cacheStream << "QMAKE_LIBDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/lib") << endl;
     2891        cacheStream << "QMAKE_MOC       = $$QT_BUILD_TREE" << fixSeparators("/bin/moc.exe", true) << endl;
     2892        cacheStream << "QMAKE_UIC       = $$QT_BUILD_TREE" << fixSeparators("/bin/uic.exe", true) << endl;
     2893        cacheStream << "QMAKE_UIC3      = $$QT_BUILD_TREE" << fixSeparators("/bin/uic3.exe", true) << endl;
     2894        cacheStream << "QMAKE_RCC       = $$QT_BUILD_TREE" << fixSeparators("/bin/rcc.exe", true) << endl;
     2895        cacheStream << "QMAKE_DUMPCPP   = $$QT_BUILD_TREE" << fixSeparators("/bin/dumpcpp.exe", true) << endl;
     2896        cacheStream << "QMAKE_INCDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/include", true) << endl;
     2897        cacheStream << "QMAKE_LIBDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/lib", true) << endl;
    27652898        if (dictionary["CETEST"] == "yes") {
    2766             cacheStream << "QT_CE_RAPI_INC  = " << fixSeparators(dictionary[ "QT_CE_RAPI_INC" ]) << endl;
    2767             cacheStream << "QT_CE_RAPI_LIB  = " << fixSeparators(dictionary[ "QT_CE_RAPI_LIB" ]) << endl;
     2899            cacheStream << "QT_CE_RAPI_INC  = " << fixSeparators(dictionary[ "QT_CE_RAPI_INC" ], true) << endl;
     2900            cacheStream << "QT_CE_RAPI_LIB  = " << fixSeparators(dictionary[ "QT_CE_RAPI_LIB" ], true) << endl;
    27682901        }
    27692902
    27702903        // embedded
    2771         if( !dictionary["KBD_DRIVERS"].isEmpty())
     2904        if (!dictionary["KBD_DRIVERS"].isEmpty())
    27722905            cacheStream << "kbd-drivers += "<< dictionary["KBD_DRIVERS"]<<endl;
    2773         if( !dictionary["GFX_DRIVERS"].isEmpty())
     2906        if (!dictionary["GFX_DRIVERS"].isEmpty())
    27742907            cacheStream << "gfx-drivers += "<< dictionary["GFX_DRIVERS"]<<endl;
    2775         if( !dictionary["MOUSE_DRIVERS"].isEmpty())
     2908        if (!dictionary["MOUSE_DRIVERS"].isEmpty())
    27762909            cacheStream << "mouse-drivers += "<< dictionary["MOUSE_DRIVERS"]<<endl;
    2777         if( !dictionary["DECORATIONS"].isEmpty())
     2910        if (!dictionary["DECORATIONS"].isEmpty())
    27782911            cacheStream << "decorations += "<<dictionary["DECORATIONS"]<<endl;
    27792912
    2780         if( !dictionary["QMAKE_RPATHDIR"].isEmpty() )
     2913        if (!dictionary["QMAKE_RPATHDIR"].isEmpty())
    27812914            cacheStream << "QMAKE_RPATHDIR += "<<dictionary["QMAKE_RPATHDIR"];
    27822915
     
    27842917        cacheFile.close();
    27852918    }
    2786     QFile configFile( dictionary[ "QT_BUILD_TREE" ] + "/mkspecs/qconfig.pri" );
    2787     if( configFile.open( QFile::WriteOnly | QFile::Text ) ) { // Truncates any existing file.
    2788         QTextStream configStream( &configFile );
     2919    QFile configFile(dictionary[ "QT_BUILD_TREE" ] + "/mkspecs/qconfig.pri");
     2920    if (configFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file.
     2921        QTextStream configStream(&configFile);
    27892922        configStream << "CONFIG+= ";
    27902923        configStream << dictionary[ "BUILD" ];
    2791         if( dictionary[ "SHARED" ] == "yes" )
     2924        if (dictionary[ "SHARED" ] == "yes")
    27922925            configStream << " shared";
    27932926        else
    27942927            configStream << " static";
    27952928
    2796         if( dictionary[ "LTCG" ] == "yes" )
     2929        if (dictionary[ "LTCG" ] == "yes")
    27972930            configStream << " ltcg";
    2798         if( dictionary[ "STL" ] == "yes" )
     2931        if (dictionary[ "MSVC_MP" ] == "yes")
     2932            configStream << " msvc_mp";
     2933        if (dictionary[ "STL" ] == "yes")
    27992934            configStream << " stl";
    2800         if ( dictionary[ "EXCEPTIONS" ] == "yes" )
     2935        if (dictionary[ "EXCEPTIONS" ] == "yes")
    28012936            configStream << " exceptions";
    2802         if ( dictionary[ "EXCEPTIONS" ] == "no" )
     2937        if (dictionary[ "EXCEPTIONS" ] == "no")
    28032938            configStream << " exceptions_off";
    2804         if ( dictionary[ "RTTI" ] == "yes" )
     2939        if (dictionary[ "RTTI" ] == "yes")
    28052940            configStream << " rtti";
    2806         if ( dictionary[ "MMX" ] == "yes" )
     2941        if (dictionary[ "MMX" ] == "yes")
    28072942            configStream << " mmx";
    2808         if ( dictionary[ "3DNOW" ] == "yes" )
     2943        if (dictionary[ "3DNOW" ] == "yes")
    28092944            configStream << " 3dnow";
    2810         if ( dictionary[ "SSE" ] == "yes" )
     2945        if (dictionary[ "SSE" ] == "yes")
    28112946            configStream << " sse";
    2812         if ( dictionary[ "SSE2" ] == "yes" )
     2947        if (dictionary[ "SSE2" ] == "yes")
    28132948            configStream << " sse2";
    2814         if ( dictionary[ "IWMMXT" ] == "yes" )
     2949        if (dictionary[ "IWMMXT" ] == "yes")
    28152950            configStream << " iwmmxt";
    2816         if ( dictionary["INCREDIBUILD_XGE"] == "yes" )
     2951        if (dictionary["INCREDIBUILD_XGE"] == "yes")
    28172952            configStream << " incredibuild_xge";
    2818         if ( dictionary["PLUGIN_MANIFESTS"] == "no" )
     2953        if (dictionary["PLUGIN_MANIFESTS"] == "no")
    28192954            configStream << " no_plugin_manifest";
    28202955
    2821         if ( dictionary.contains("SYMBIAN_DEFFILES") ) {
    2822             if(dictionary["SYMBIAN_DEFFILES"] == "yes" ) {
     2956        if (dictionary.contains("SYMBIAN_DEFFILES")) {
     2957            if (dictionary["SYMBIAN_DEFFILES"] == "yes") {
    28232958                configStream << " def_files";
    2824             } else if ( dictionary["SYMBIAN_DEFFILES"] == "no" ) {
     2959            } else if (dictionary["SYMBIAN_DEFFILES"] == "no") {
    28252960                configStream << " def_files_disabled";
    28262961            }
     
    28412976
    28422977        configStream << "#Qt for Windows CE c-runtime deployment" << endl
    2843                      << "QT_CE_C_RUNTIME = " << fixSeparators(dictionary[ "CE_CRT" ]) << endl;
    2844 
    2845         if(dictionary["CE_SIGNATURE"] != QLatin1String("no"))
     2978                     << "QT_CE_C_RUNTIME = " << fixSeparators(dictionary[ "CE_CRT" ], true) << endl;
     2979
     2980        if (dictionary["CE_SIGNATURE"] != QLatin1String("no"))
    28462981            configStream << "DEFAULT_SIGNATURE=" << dictionary["CE_SIGNATURE"] << endl;
    28472982
    2848         if(!dictionary["QMAKE_RPATHDIR"].isEmpty())
     2983        if (!dictionary["QMAKE_RPATHDIR"].isEmpty())
    28492984            configStream << "QMAKE_RPATHDIR += " << dictionary["QMAKE_RPATHDIR"] << endl;
    28502985
     
    28532988
    28542989        configStream << "#Qt for Symbian FPU settings" << endl;
    2855         if(!dictionary["ARM_FPU_TYPE"].isEmpty()) {
     2990        if (!dictionary["ARM_FPU_TYPE"].isEmpty()) {
    28562991            configStream<<"MMP_RULES += \"ARMFPU "<< dictionary["ARM_FPU_TYPE"]<< "\"";
     2992        }
     2993        if (!dictionary["QT_NAMESPACE"].isEmpty()) {
     2994            configStream << "#namespaces" << endl << "QT_NAMESPACE = " << dictionary["QT_NAMESPACE"] << endl;
    28572995        }
    28582996
     
    28703008    def.replace(QRegExp("="), " ");
    28713009
    2872     if(def.startsWith("QT_NO_")) {
     3010    if (def.startsWith("QT_NO_")) {
    28733011        defNeg = defD;
    28743012        defNeg.replace("QT_NO_", "QT_");
    2875     } else if(def.startsWith("QT_")) {
     3013    } else if (def.startsWith("QT_")) {
    28763014        defNeg = defD;
    28773015        defNeg.replace("QT_", "QT_NO_");
     
    28993037{
    29003038    QDir(buildPath).mkpath("src/corelib/global");
    2901     QString outName( buildPath + "/src/corelib/global/qconfig.h" );
     3039    QString outName(buildPath + "/src/corelib/global/qconfig.h");
    29023040    QTemporaryFile tmpFile;
    29033041    QTextStream tmpStream;
    29043042
    2905     if(tmpFile.open()) {
     3043    if (tmpFile.open()) {
    29063044        tmpStream.setDevice(&tmpFile);
    29073045
    2908         if( dictionary[ "QCONFIG" ] == "full" ) {
     3046        if (dictionary[ "QCONFIG" ] == "full") {
    29093047            tmpStream << "/* Everything */" << endl;
    29103048        } else {
    2911             QString configName( "qconfig-" + dictionary[ "QCONFIG" ] + ".h" );
     3049            QString configName("qconfig-" + dictionary[ "QCONFIG" ] + ".h");
    29123050            tmpStream << "/* Copied from " << configName << "*/" << endl;
    29133051            tmpStream << "#ifndef QT_BOOTSTRAPPED" << endl;
    2914             QFile inFile( sourcePath + "/src/corelib/global/" + configName );
    2915             if( inFile.open( QFile::ReadOnly ) ) {
     3052            QFile inFile(sourcePath + "/src/corelib/global/" + configName);
     3053            if (inFile.open(QFile::ReadOnly)) {
    29163054                QByteArray buffer = inFile.readAll();
    2917                 tmpFile.write( buffer.constData(), buffer.size() );
     3055                tmpFile.write(buffer.constData(), buffer.size());
    29183056                inFile.close();
    29193057            }
     
    29223060        tmpStream << endl;
    29233061
    2924         if( dictionary[ "SHARED" ] == "yes" ) {
     3062        if (dictionary[ "SHARED" ] == "yes") {
    29253063            tmpStream << "#ifndef QT_DLL" << endl;
    29263064            tmpStream << "#define QT_DLL" << endl;
     
    29483086        tmpStream << "#define Q_BIG_ENDIAN 4321" << endl;
    29493087        tmpStream << "#define Q_LITTLE_ENDIAN 1234" << endl;
    2950         if ( QSysInfo::ByteOrder == QSysInfo::BigEndian )
     3088        if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
    29513089            tmpStream << "#define Q_BYTE_ORDER Q_BIG_ENDIAN" << endl;
    29523090        else
     
    29553093        tmpStream << endl << "// Compile time features" << endl;
    29563094        tmpStream << "#define QT_ARCH_" << dictionary["ARCHITECTURE"].toUpper() << endl;
     3095        if (dictionary["GRAPHICS_SYSTEM"] == "runtime" && dictionary["RUNTIME_SYSTEM"] != "runtime")
     3096            tmpStream << "#define QT_DEFAULT_RUNTIME_SYSTEM \"" << dictionary["RUNTIME_SYSTEM"] << "\"" << endl;
     3097
    29573098        QStringList qconfigList;
    2958         if(dictionary["STL"] == "no")                qconfigList += "QT_NO_STL";
    2959         if(dictionary["STYLE_WINDOWS"] != "yes")     qconfigList += "QT_NO_STYLE_WINDOWS";
    2960         if(dictionary["STYLE_PLASTIQUE"] != "yes")   qconfigList += "QT_NO_STYLE_PLASTIQUE";
    2961         if(dictionary["STYLE_CLEANLOOKS"] != "yes")   qconfigList += "QT_NO_STYLE_CLEANLOOKS";
    2962         if(dictionary["STYLE_WINDOWSXP"] != "yes" && dictionary["STYLE_WINDOWSVISTA"] != "yes")
     3099        if (dictionary["STL"] == "no")                qconfigList += "QT_NO_STL";
     3100        if (dictionary["STYLE_WINDOWS"] != "yes")     qconfigList += "QT_NO_STYLE_WINDOWS";
     3101        if (dictionary["STYLE_PLASTIQUE"] != "yes")   qconfigList += "QT_NO_STYLE_PLASTIQUE";
     3102        if (dictionary["STYLE_CLEANLOOKS"] != "yes")   qconfigList += "QT_NO_STYLE_CLEANLOOKS";
     3103        if (dictionary["STYLE_WINDOWSXP"] != "yes" && dictionary["STYLE_WINDOWSVISTA"] != "yes")
    29633104            qconfigList += "QT_NO_STYLE_WINDOWSXP";
    2964         if(dictionary["STYLE_WINDOWSVISTA"] != "yes")   qconfigList += "QT_NO_STYLE_WINDOWSVISTA";
    2965         if(dictionary["STYLE_MOTIF"] != "yes")       qconfigList += "QT_NO_STYLE_MOTIF";
    2966         if(dictionary["STYLE_CDE"] != "yes")         qconfigList += "QT_NO_STYLE_CDE";
    2967         if(dictionary["STYLE_S60"] != "yes")         qconfigList += "QT_NO_STYLE_S60";
    2968         if(dictionary["STYLE_WINDOWSCE"] != "yes")   qconfigList += "QT_NO_STYLE_WINDOWSCE";
    2969         if(dictionary["STYLE_WINDOWSMOBILE"] != "yes")   qconfigList += "QT_NO_STYLE_WINDOWSMOBILE";
    2970         if(dictionary["STYLE_GTK"] != "yes")         qconfigList += "QT_NO_STYLE_GTK";
    2971 
    2972         if(dictionary["GIF"] == "yes")              qconfigList += "QT_BUILTIN_GIF_READER=1";
    2973         if(dictionary["PNG"] == "no")               qconfigList += "QT_NO_IMAGEFORMAT_PNG";
    2974         if(dictionary["MNG"] == "no")               qconfigList += "QT_NO_IMAGEFORMAT_MNG";
    2975         if(dictionary["JPEG"] == "no")              qconfigList += "QT_NO_IMAGEFORMAT_JPEG";
    2976         if(dictionary["TIFF"] == "no")              qconfigList += "QT_NO_IMAGEFORMAT_TIFF";
    2977         if(dictionary["ZLIB"] == "no") {
     3105        if (dictionary["STYLE_WINDOWSVISTA"] != "yes")   qconfigList += "QT_NO_STYLE_WINDOWSVISTA";
     3106        if (dictionary["STYLE_MOTIF"] != "yes")       qconfigList += "QT_NO_STYLE_MOTIF";
     3107        if (dictionary["STYLE_CDE"] != "yes")         qconfigList += "QT_NO_STYLE_CDE";
     3108        if (dictionary["STYLE_S60"] != "yes")         qconfigList += "QT_NO_STYLE_S60";
     3109        if (dictionary["STYLE_WINDOWSCE"] != "yes")   qconfigList += "QT_NO_STYLE_WINDOWSCE";
     3110        if (dictionary["STYLE_WINDOWSMOBILE"] != "yes")   qconfigList += "QT_NO_STYLE_WINDOWSMOBILE";
     3111        if (dictionary["STYLE_GTK"] != "yes")         qconfigList += "QT_NO_STYLE_GTK";
     3112
     3113        if (dictionary["GIF"] == "yes")              qconfigList += "QT_BUILTIN_GIF_READER=1";
     3114        if (dictionary["PNG"] != "yes")              qconfigList += "QT_NO_IMAGEFORMAT_PNG";
     3115        if (dictionary["MNG"] != "yes")              qconfigList += "QT_NO_IMAGEFORMAT_MNG";
     3116        if (dictionary["JPEG"] != "yes")             qconfigList += "QT_NO_IMAGEFORMAT_JPEG";
     3117        if (dictionary["TIFF"] != "yes")             qconfigList += "QT_NO_IMAGEFORMAT_TIFF";
     3118        if (dictionary["ZLIB"] == "no") {
    29783119            qconfigList += "QT_NO_ZLIB";
    29793120            qconfigList += "QT_NO_COMPRESS";
    29803121        }
    29813122
    2982         if(dictionary["ACCESSIBILITY"] == "no")     qconfigList += "QT_NO_ACCESSIBILITY";
    2983         if(dictionary["EXCEPTIONS"] == "no")        qconfigList += "QT_NO_EXCEPTIONS";
    2984         if(dictionary["OPENGL"] == "no")            qconfigList += "QT_NO_OPENGL";
    2985         if(dictionary["OPENVG"] == "no")            qconfigList += "QT_NO_OPENVG";
    2986         if(dictionary["OPENSSL"] == "no")           qconfigList += "QT_NO_OPENSSL";
    2987         if(dictionary["OPENSSL"] == "linked")       qconfigList += "QT_LINKED_OPENSSL";
    2988         if(dictionary["DBUS"] == "no")              qconfigList += "QT_NO_DBUS";
    2989         if(dictionary["IPV6"] == "no")              qconfigList += "QT_NO_IPV6";
    2990         if(dictionary["WEBKIT"] == "no")            qconfigList += "QT_NO_WEBKIT";
    2991         if(dictionary["DECLARATIVE"] == "no")       qconfigList += "QT_NO_DECLARATIVE";
    2992         if(dictionary["PHONON"] == "no")            qconfigList += "QT_NO_PHONON";
    2993         if(dictionary["MULTIMEDIA"] == "no")        qconfigList += "QT_NO_MULTIMEDIA";
    2994         if(dictionary["XMLPATTERNS"] == "no")       qconfigList += "QT_NO_XMLPATTERNS";
    2995         if(dictionary["SCRIPT"] == "no")            qconfigList += "QT_NO_SCRIPT";
    2996         if(dictionary["SCRIPTTOOLS"] == "no")       qconfigList += "QT_NO_SCRIPTTOOLS";
    2997         if(dictionary["FREETYPE"] == "no")          qconfigList += "QT_NO_FREETYPE";
    2998         if(dictionary["S60"] == "no")               qconfigList += "QT_NO_S60";
    2999         if(dictionary["NATIVE_GESTURES"] == "no")   qconfigList += "QT_NO_NATIVE_GESTURES";
    3000 
    3001         if(dictionary["OPENGL_ES_CM"] == "yes" ||
    3002            dictionary["OPENGL_ES_CL"] == "yes" ||
     3123        if (dictionary["ACCESSIBILITY"] == "no")     qconfigList += "QT_NO_ACCESSIBILITY";
     3124        if (dictionary["EXCEPTIONS"] == "no")        qconfigList += "QT_NO_EXCEPTIONS";
     3125        if (dictionary["OPENGL"] == "no")            qconfigList += "QT_NO_OPENGL";
     3126        if (dictionary["OPENVG"] == "no")            qconfigList += "QT_NO_OPENVG";
     3127        if (dictionary["OPENSSL"] == "no")           qconfigList += "QT_NO_OPENSSL";
     3128        if (dictionary["OPENSSL"] == "linked")       qconfigList += "QT_LINKED_OPENSSL";
     3129        if (dictionary["DBUS"] == "no")              qconfigList += "QT_NO_DBUS";
     3130        if (dictionary["IPV6"] == "no")              qconfigList += "QT_NO_IPV6";
     3131        if (dictionary["WEBKIT"] == "no")            qconfigList += "QT_NO_WEBKIT";
     3132        if (dictionary["DECLARATIVE"] == "no")       qconfigList += "QT_NO_DECLARATIVE";
     3133        if (dictionary["DECLARATIVE_DEBUG"] == "no") qconfigList += "QDECLARATIVE_NO_DEBUG_PROTOCOL";
     3134        if (dictionary["PHONON"] == "no")            qconfigList += "QT_NO_PHONON";
     3135        if (dictionary["MULTIMEDIA"] == "no")        qconfigList += "QT_NO_MULTIMEDIA";
     3136        if (dictionary["XMLPATTERNS"] == "no")       qconfigList += "QT_NO_XMLPATTERNS";
     3137        if (dictionary["SCRIPT"] == "no")            qconfigList += "QT_NO_SCRIPT";
     3138        if (dictionary["SCRIPTTOOLS"] == "no")       qconfigList += "QT_NO_SCRIPTTOOLS";
     3139        if (dictionary["FREETYPE"] == "no")          qconfigList += "QT_NO_FREETYPE";
     3140        if (dictionary["S60"] == "no")               qconfigList += "QT_NO_S60";
     3141        if (dictionary["NATIVE_GESTURES"] == "no")   qconfigList += "QT_NO_NATIVE_GESTURES";
     3142
     3143        if (dictionary["OPENGL_ES_CM"] == "no" &&
     3144           dictionary["OPENGL_ES_2"]  == "no" &&
     3145           dictionary["OPENVG"]       == "no")      qconfigList += "QT_NO_EGL";
     3146
     3147        if (dictionary["OPENGL_ES_CM"] == "yes" ||
    30033148           dictionary["OPENGL_ES_2"]  == "yes")     qconfigList += "QT_OPENGL_ES";
    30043149
    3005         if(dictionary["OPENGL_ES_CM"] == "yes")     qconfigList += "QT_OPENGL_ES_1";
    3006         if(dictionary["OPENGL_ES_2"]  == "yes")     qconfigList += "QT_OPENGL_ES_2";
    3007         if(dictionary["OPENGL_ES_CL"] == "yes")     qconfigList += "QT_OPENGL_ES_1_CL";
    3008 
    3009         if(dictionary["SQL_MYSQL"] == "yes")        qconfigList += "QT_SQL_MYSQL";
    3010         if(dictionary["SQL_ODBC"] == "yes")         qconfigList += "QT_SQL_ODBC";
    3011         if(dictionary["SQL_OCI"] == "yes")          qconfigList += "QT_SQL_OCI";
    3012         if(dictionary["SQL_PSQL"] == "yes")         qconfigList += "QT_SQL_PSQL";
    3013         if(dictionary["SQL_TDS"] == "yes")          qconfigList += "QT_SQL_TDS";
    3014         if(dictionary["SQL_DB2"] == "yes")          qconfigList += "QT_SQL_DB2";
    3015         if(dictionary["SQL_SQLITE"] == "yes")       qconfigList += "QT_SQL_SQLITE";
    3016         if(dictionary["SQL_SQLITE2"] == "yes")      qconfigList += "QT_SQL_SQLITE2";
    3017         if(dictionary["SQL_IBASE"] == "yes")        qconfigList += "QT_SQL_IBASE";
    3018 
    3019         if (dictionary["GRAPHICS_SYSTEM"] == "openvg") qconfigList += "QT_GRAPHICSSYSTEM_OPENVG";
    3020         if (dictionary["GRAPHICS_SYSTEM"] == "opengl") qconfigList += "QT_GRAPHICSSYSTEM_OPENGL";
    3021         if (dictionary["GRAPHICS_SYSTEM"] == "raster") qconfigList += "QT_GRAPHICSSYSTEM_RASTER";
     3150        if (dictionary["OPENGL_ES_CM"] == "yes")     qconfigList += "QT_OPENGL_ES_1";
     3151        if (dictionary["OPENGL_ES_2"]  == "yes")     qconfigList += "QT_OPENGL_ES_2";
     3152        if (dictionary["SQL_MYSQL"] == "yes")        qconfigList += "QT_SQL_MYSQL";
     3153        if (dictionary["SQL_ODBC"] == "yes")         qconfigList += "QT_SQL_ODBC";
     3154        if (dictionary["SQL_OCI"] == "yes")          qconfigList += "QT_SQL_OCI";
     3155        if (dictionary["SQL_PSQL"] == "yes")         qconfigList += "QT_SQL_PSQL";
     3156        if (dictionary["SQL_TDS"] == "yes")          qconfigList += "QT_SQL_TDS";
     3157        if (dictionary["SQL_DB2"] == "yes")          qconfigList += "QT_SQL_DB2";
     3158        if (dictionary["SQL_SQLITE"] == "yes")       qconfigList += "QT_SQL_SQLITE";
     3159        if (dictionary["SQL_SQLITE2"] == "yes")      qconfigList += "QT_SQL_SQLITE2";
     3160        if (dictionary["SQL_IBASE"] == "yes")        qconfigList += "QT_SQL_IBASE";
     3161
     3162        if (dictionary["GRAPHICS_SYSTEM"] == "openvg")  qconfigList += "QT_GRAPHICSSYSTEM_OPENVG";
     3163        if (dictionary["GRAPHICS_SYSTEM"] == "opengl")  qconfigList += "QT_GRAPHICSSYSTEM_OPENGL";
     3164        if (dictionary["GRAPHICS_SYSTEM"] == "raster")  qconfigList += "QT_GRAPHICSSYSTEM_RASTER";
     3165        if (dictionary["GRAPHICS_SYSTEM"] == "runtime") qconfigList += "QT_GRAPHICSSYSTEM_RUNTIME";
    30223166
    30233167        if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
     
    30363180            tmpStream << addDefine(qconfigList.at(i));
    30373181
    3038         if(dictionary["EMBEDDED"] == "yes")
     3182        if (dictionary["EMBEDDED"] == "yes")
    30393183        {
    30403184            // Check for keyboard, mouse, gfx.
     
    30423186            QStringList allKbdDrivers;
    30433187            allKbdDrivers<<"tty"<<"usb"<<"sl5000"<<"yopy"<<"vr41xx"<<"qvfb"<<"um";
    3044             foreach(QString kbd, allKbdDrivers) {
    3045                 if( !kbdDrivers.contains(kbd))
     3188            foreach (const QString &kbd, allKbdDrivers) {
     3189                if (!kbdDrivers.contains(kbd))
    30463190                    tmpStream<<"#define QT_NO_QWS_KBD_"<<kbd.toUpper()<<endl;
    30473191            }
     
    30503194            QStringList allMouseDrivers;
    30513195            allMouseDrivers << "pc"<<"bus"<<"linuxtp"<<"yopy"<<"vr41xx"<<"tslib"<<"qvfb";
    3052             foreach(QString mouse, allMouseDrivers) {
    3053                 if( !mouseDrivers.contains(mouse) )
     3196            foreach (const QString &mouse, allMouseDrivers) {
     3197                if (!mouseDrivers.contains(mouse))
    30543198                    tmpStream<<"#define QT_NO_QWS_MOUSE_"<<mouse.toUpper()<<endl;
    30553199            }
     
    30583202            QStringList allGfxDrivers;
    30593203            allGfxDrivers<<"linuxfb"<<"transformed"<<"qvfb"<<"vnc"<<"multiscreen"<<"ahi";
    3060             foreach(QString gfx, allGfxDrivers) {
    3061                 if( !gfxDrivers.contains(gfx))
     3204            foreach (const QString &gfx, allGfxDrivers) {
     3205                if (!gfxDrivers.contains(gfx))
    30623206                    tmpStream<<"#define QT_NO_QWS_"<<gfx.toUpper()<<endl;
    30633207            }
     
    30663210
    30673211            QStringList depths = dictionary[ "QT_QWS_DEPTH" ].split(" ");
    3068             foreach(QString depth, depths)
     3212            foreach (const QString &depth, depths)
    30693213              tmpStream<<"#define QT_QWS_DEPTH_"+depth<<endl;
    30703214        }
    30713215
    3072         if( dictionary[ "QT_CUPS" ] == "no")
     3216        if (dictionary[ "QT_CUPS" ] == "no")
    30733217          tmpStream<<"#define QT_NO_CUPS"<<endl;
    30743218
    3075         if( dictionary[ "QT_ICONV" ]  == "no")
     3219        if (dictionary[ "QT_ICONV" ]  == "no")
    30763220          tmpStream<<"#define QT_NO_ICONV"<<endl;
    30773221
    3078         if(dictionary[ "QT_GLIB" ] == "no")
     3222        if (dictionary[ "QT_GLIB" ] == "no")
    30793223          tmpStream<<"#define QT_NO_GLIB"<<endl;
    30803224
    3081         if(dictionary[ "QT_LPR" ] == "no")
     3225        if (dictionary[ "QT_LPR" ] == "no")
    30823226          tmpStream<<"#define QT_NO_LPR"<<endl;
    30833227
    3084         if(dictionary[ "QT_INOTIFY" ] == "no" )
     3228        if (dictionary[ "QT_INOTIFY" ] == "no")
    30853229          tmpStream<<"#define QT_NO_INOTIFY"<<endl;
    30863230
    3087         if(dictionary[ "QT_SXE" ] == "no")
     3231        if (dictionary[ "QT_SXE" ] == "no")
    30883232          tmpStream<<"#define QT_NO_SXE"<<endl;
    30893233
     
    30963240        tmpFile.copy(outName);
    30973241        tmpFile.close();
    3098 
    3099         if(!QFile::exists(buildPath + "/include/QtCore/qconfig.h")) {
    3100             if (!writeToFile("#include \"../../src/corelib/global/qconfig.h\"\n",
    3101                              buildPath + "/include/QtCore/qconfig.h")
    3102             || !writeToFile("#include \"../../src/corelib/global/qconfig.h\"\n",
    3103                             buildPath + "/include/Qt/qconfig.h")) {
    3104                 dictionary["DONE"] = "error";
    3105                 return;
    3106             }
    3107         }
    31083242    }
    31093243
     
    31213255    QString spec = dictionary.contains("XQMAKESPEC") ? dictionary["XQMAKESPEC"] : dictionary["QMAKESPEC"];
    31223256    QString pltSpec = sourcePath + "/mkspecs/" + spec;
    3123     if (!Environment::cpdir(pltSpec, defSpec)) {
     3257    QString includeSpec = buildPath + "/mkspecs/" + spec;
     3258    if (!Environment::cpdir(pltSpec, defSpec, includeSpec)) {
    31243259        cout << "Couldn't update default mkspec! Does " << qPrintable(pltSpec) << " exist?" << endl;
    31253260        dictionary["DONE"] = "error";
    31263261        return;
    3127     }
    3128 
    3129     outName = defSpec + "/qmake.conf";
    3130     ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL );
    3131     QFile qmakeConfFile(outName);
    3132     if (qmakeConfFile.open(QFile::Append | QFile::WriteOnly | QFile::Text)) {
    3133         QTextStream qmakeConfStream;
    3134         qmakeConfStream.setDevice(&qmakeConfFile);
    3135         qmakeConfStream << endl << "QMAKESPEC_ORIGINAL=" << pltSpec << endl;
    3136         qmakeConfStream.flush();
    3137         qmakeConfFile.close();
    31383262    }
    31393263
     
    31523276                  << "static const char qt_configure_installation          [11  + 12] = \"qt_instdate=" << QDate::currentDate().toString(Qt::ISODate) << "\";" << endl
    31533277                  << endl;
    3154         if(!dictionary[ "QT_HOST_PREFIX" ].isNull())
     3278        if (!dictionary[ "QT_HOST_PREFIX" ].isNull())
    31553279            tmpStream << "#if !defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE)" << endl;
    3156         tmpStream << "static const char qt_configure_prefix_path_str       [512 + 12] = \"qt_prfxpath=" << QString(dictionary["QT_INSTALL_PREFIX"]).replace( "\\", "\\\\" ) << "\";" << endl
    3157                   << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << QString(dictionary["QT_INSTALL_DOCS"]).replace( "\\", "\\\\" ) << "\";"  << endl
    3158                   << "static const char qt_configure_headers_path_str      [512 + 12] = \"qt_hdrspath=" << QString(dictionary["QT_INSTALL_HEADERS"]).replace( "\\", "\\\\" ) << "\";"  << endl
    3159                   << "static const char qt_configure_libraries_path_str    [512 + 12] = \"qt_libspath=" << QString(dictionary["QT_INSTALL_LIBS"]).replace( "\\", "\\\\" ) << "\";"  << endl
    3160                   << "static const char qt_configure_binaries_path_str     [512 + 12] = \"qt_binspath=" << QString(dictionary["QT_INSTALL_BINS"]).replace( "\\", "\\\\" ) << "\";"  << endl
    3161                   << "static const char qt_configure_plugins_path_str      [512 + 12] = \"qt_plugpath=" << QString(dictionary["QT_INSTALL_PLUGINS"]).replace( "\\", "\\\\" ) << "\";"  << endl
    3162                   << "static const char qt_configure_data_path_str         [512 + 12] = \"qt_datapath=" << QString(dictionary["QT_INSTALL_DATA"]).replace( "\\", "\\\\" ) << "\";"  << endl
    3163                   << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << QString(dictionary["QT_INSTALL_TRANSLATIONS"]).replace( "\\", "\\\\" ) << "\";" << endl
    3164                   << "static const char qt_configure_examples_path_str     [512 + 12] = \"qt_xmplpath=" << QString(dictionary["QT_INSTALL_EXAMPLES"]).replace( "\\", "\\\\" ) << "\";"  << endl
    3165                   << "static const char qt_configure_demos_path_str        [512 + 12] = \"qt_demopath=" << QString(dictionary["QT_INSTALL_DEMOS"]).replace( "\\", "\\\\" ) << "\";"  << endl
    3166                   //<< "static const char qt_configure_settings_path_str [256] = \"qt_stngpath=" << QString(dictionary["QT_INSTALL_SETTINGS"]).replace( "\\", "\\\\" ) << "\";" << endl
     3280        tmpStream << "static const char qt_configure_prefix_path_str       [512 + 12] = \"qt_prfxpath=" << escapeSeparators(dictionary["QT_INSTALL_PREFIX"]) << "\";" << endl
     3281                  << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << escapeSeparators(dictionary["QT_INSTALL_DOCS"]) << "\";"  << endl
     3282                  << "static const char qt_configure_headers_path_str      [512 + 12] = \"qt_hdrspath=" << escapeSeparators(dictionary["QT_INSTALL_HEADERS"]) << "\";"  << endl
     3283                  << "static const char qt_configure_libraries_path_str    [512 + 12] = \"qt_libspath=" << escapeSeparators(dictionary["QT_INSTALL_LIBS"]) << "\";"  << endl
     3284                  << "static const char qt_configure_binaries_path_str     [512 + 12] = \"qt_binspath=" << escapeSeparators(dictionary["QT_INSTALL_BINS"]) << "\";"  << endl
     3285                  << "static const char qt_configure_plugins_path_str      [512 + 12] = \"qt_plugpath=" << escapeSeparators(dictionary["QT_INSTALL_PLUGINS"]) << "\";"  << endl
     3286                  << "static const char qt_configure_imports_path_str      [512 + 12] = \"qt_impspath=" << escapeSeparators(dictionary["QT_INSTALL_IMPORTS"]) << "\";"  << endl
     3287                  << "static const char qt_configure_data_path_str         [512 + 12] = \"qt_datapath=" << escapeSeparators(dictionary["QT_INSTALL_DATA"]) << "\";"  << endl
     3288                  << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << escapeSeparators(dictionary["QT_INSTALL_TRANSLATIONS"]) << "\";" << endl
     3289                  << "static const char qt_configure_examples_path_str     [512 + 12] = \"qt_xmplpath=" << escapeSeparators(dictionary["QT_INSTALL_EXAMPLES"]) << "\";"  << endl
     3290                  << "static const char qt_configure_demos_path_str        [512 + 12] = \"qt_demopath=" << escapeSeparators(dictionary["QT_INSTALL_DEMOS"]) << "\";"  << endl
     3291                  //<< "static const char qt_configure_settings_path_str [256] = \"qt_stngpath=" << escapeSeparators(dictionary["QT_INSTALL_SETTINGS"]) << "\";" << endl
    31673292                  ;
    3168         if(!dictionary[ "QT_HOST_PREFIX" ].isNull()) {
     3293        if (!dictionary[ "QT_HOST_PREFIX" ].isNull()) {
    31693294             tmpStream << "#else" << endl
    3170                        << "static const char qt_configure_prefix_path_str       [512 + 12] = \"qt_prfxpath=" << QString(dictionary[ "QT_HOST_PREFIX" ]).replace( "\\", "\\\\" ) << "\";" << endl
    3171                        << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/doc").replace( "\\", "\\\\" ) <<"\";"  << endl
    3172                        << "static const char qt_configure_headers_path_str      [512 + 12] = \"qt_hdrspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/include").replace( "\\", "\\\\" ) <<"\";"  << endl
    3173                        << "static const char qt_configure_libraries_path_str    [512 + 12] = \"qt_libspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/lib").replace( "\\", "\\\\" ) <<"\";"  << endl
    3174                        << "static const char qt_configure_binaries_path_str     [512 + 12] = \"qt_binspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/bin").replace( "\\", "\\\\" ) <<"\";"  << endl
    3175                        << "static const char qt_configure_plugins_path_str      [512 + 12] = \"qt_plugpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/plugins").replace( "\\", "\\\\" ) <<"\";"  << endl
    3176                        << "static const char qt_configure_data_path_str         [512 + 12] = \"qt_datapath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ]).replace( "\\", "\\\\" ) <<"\";"  << endl
    3177                        << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/translations").replace( "\\", "\\\\" ) <<"\";" << endl
    3178                        << "static const char qt_configure_examples_path_str     [512 + 12] = \"qt_xmplpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/example").replace( "\\", "\\\\" ) <<"\";"  << endl
    3179                        << "static const char qt_configure_demos_path_str        [512 + 12] = \"qt_demopath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/demos").replace( "\\", "\\\\" ) <<"\";"  << endl
     3295                       << "static const char qt_configure_prefix_path_str       [512 + 12] = \"qt_prfxpath=" << escapeSeparators(dictionary[ "QT_HOST_PREFIX" ]) << "\";" << endl
     3296                       << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/doc", true) <<"\";"  << endl
     3297                       << "static const char qt_configure_headers_path_str      [512 + 12] = \"qt_hdrspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/include", true) <<"\";"  << endl
     3298                       << "static const char qt_configure_libraries_path_str    [512 + 12] = \"qt_libspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/lib", true) <<"\";"  << endl
     3299                       << "static const char qt_configure_binaries_path_str     [512 + 12] = \"qt_binspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/bin", true) <<"\";"  << endl
     3300                       << "static const char qt_configure_plugins_path_str      [512 + 12] = \"qt_plugpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/plugins", true) <<"\";"  << endl
     3301                       << "static const char qt_configure_imports_path_str      [512 + 12] = \"qt_impspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/imports", true) <<"\";"  << endl
     3302                       << "static const char qt_configure_data_path_str         [512 + 12] = \"qt_datapath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ], true) <<"\";"  << endl
     3303                       << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/translations", true) <<"\";" << endl
     3304                       << "static const char qt_configure_examples_path_str     [512 + 12] = \"qt_xmplpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/example", true) <<"\";"  << endl
     3305                       << "static const char qt_configure_demos_path_str        [512 + 12] = \"qt_demopath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/demos", true) <<"\";"  << endl
    31803306                       << "#endif //QT_BOOTSTRAPPED" << endl;
    31813307        }
    3182         tmpStream << "/* strlen( \"qt_lcnsxxxx\" ) == 12 */" << endl
     3308        tmpStream << "/* strlen( \"qt_lcnsxxxx\") == 12 */" << endl
    31833309                  << "#define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12;" << endl
    31843310                  << "#define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12;" << endl
     
    31893315                  << "#define QT_CONFIGURE_BINARIES_PATH qt_configure_binaries_path_str + 12;" << endl
    31903316                  << "#define QT_CONFIGURE_PLUGINS_PATH qt_configure_plugins_path_str + 12;" << endl
     3317                  << "#define QT_CONFIGURE_IMPORTS_PATH qt_configure_imports_path_str + 12;" << endl
    31913318                  << "#define QT_CONFIGURE_DATA_PATH qt_configure_data_path_str + 12;" << endl
    31923319                  << "#define QT_CONFIGURE_TRANSLATIONS_PATH qt_configure_translations_path_str + 12;" << endl
     
    32003327
    32013328        // Replace old qconfig.cpp with new one
    3202         ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL );
    3203         QFile::remove( outName );
     3329        ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL);
     3330        QFile::remove(outName);
    32043331        tmpFile2.copy(outName);
    32053332        tmpFile2.close();
     
    32103337        tmpStream.setDevice(&tmpFile3);
    32113338        tmpStream << "/* Evaluation license key */" << endl
    3212                   << "static const char qt_eval_key_data              [512 + 12] = \"qt_qevalkey=" << licenseInfo["LICENSEKEYEXT"] << "\";" << endl;
     3339                  << "static const volatile char qt_eval_key_data              [512 + 12] = \"qt_qevalkey=" << licenseInfo["LICENSEKEYEXT"] << "\";" << endl;
    32133340
    32143341        tmpStream.flush();
     
    32163343
    32173344        outName = buildPath + "/src/corelib/global/qconfig_eval.cpp";
    3218         ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL );
    3219         QFile::remove( outName );
     3345        ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL);
     3346        QFile::remove(outName);
    32203347
    32213348        if (dictionary["EDITION"] == "Evaluation" || qmakeDefines.contains("QT_EVAL"))
     
    32613388
    32623389    cout << "Configuration:" << endl;
    3263     cout << "    " << qmakeConfig.join( "\r\n    " ) << endl;
     3390    cout << "    " << qmakeConfig.join("\r\n    ") << endl;
    32643391    cout << "Qt Configuration:" << endl;
    3265     cout << "    " << qtConfig.join( "\r\n    " ) << endl;
     3392    cout << "    " << qtConfig.join("\r\n    ") << endl;
    32663393    cout << endl;
    32673394
     
    32903417    cout << "Phonon support.............." << dictionary[ "PHONON" ] << endl;
    32913418    cout << "QtMultimedia support........" << dictionary[ "MULTIMEDIA" ] << endl;
    3292     cout << "WebKit support.............." << dictionary[ "WEBKIT" ] << endl;
     3419    {
     3420        QString webkit = dictionary[ "WEBKIT" ];
     3421        if (webkit == "debug")
     3422            webkit = "yes (debug)";
     3423        cout << "WebKit support.............." << webkit << endl;
     3424    }
    32933425    cout << "Declarative support........." << dictionary[ "DECLARATIVE" ] << endl;
     3426    cout << "Declarative debugging......." << dictionary[ "DECLARATIVE_DEBUG" ] << endl;
    32943427    cout << "QtScript support............" << dictionary[ "SCRIPT" ] << endl;
    32953428    cout << "QtScriptTools support......." << dictionary[ "SCRIPTTOOLS" ] << endl;
     
    33353468    cout << "Libraries installed to......" << dictionary[ "QT_INSTALL_LIBS" ] << endl;
    33363469    cout << "Plugins installed to........" << dictionary[ "QT_INSTALL_PLUGINS" ] << endl;
     3470    cout << "Imports installed to........" << dictionary[ "QT_INSTALL_IMPORTS" ] << endl;
    33373471    cout << "Binaries installed to......." << dictionary[ "QT_INSTALL_BINS" ] << endl;
    33383472    cout << "Docs installed to..........." << dictionary[ "QT_INSTALL_DOCS" ] << endl;
     
    33543488    if (dictionary.contains("SYMBIAN_DEFFILES")) {
    33553489        cout << "Symbian DEF files enabled..." << dictionary[ "SYMBIAN_DEFFILES" ] << endl;
    3356         if(dictionary["SYMBIAN_DEFFILES"] == "no") {
     3490        if (dictionary["SYMBIAN_DEFFILES"] == "no") {
    33573491            cout << "WARNING: Disabling DEF files will mean that Qt is NOT binary compatible with previous versions." << endl;
    33583492            cout << "         This feature is only intended for use during development, NEVER for release builds." << endl;
     
    33603494    }
    33613495
    3362     if(dictionary["ASSISTANT_WEBKIT"] == "yes")
     3496    if (dictionary["ASSISTANT_WEBKIT"] == "yes")
    33633497        cout << "Using WebKit as html rendering engine in Qt Assistant." << endl;
    33643498
    3365     if(checkAvailability("INCREDIBUILD_XGE"))
     3499    if (checkAvailability("INCREDIBUILD_XGE"))
    33663500        cout << "Using IncrediBuild XGE......" << dictionary["INCREDIBUILD_XGE"] << endl;
    3367     if( !qmakeDefines.isEmpty() ) {
     3501    if (!qmakeDefines.isEmpty()) {
    33683502        cout << "Defines.....................";
    3369         for( QStringList::Iterator defs = qmakeDefines.begin(); defs != qmakeDefines.end(); ++defs )
     3503        for (QStringList::Iterator defs = qmakeDefines.begin(); defs != qmakeDefines.end(); ++defs)
    33703504            cout << (*defs) << " ";
    33713505        cout << endl;
    33723506    }
    3373     if( !qmakeIncludes.isEmpty() ) {
     3507    if (!qmakeIncludes.isEmpty()) {
    33743508        cout << "Include paths...............";
    3375         for( QStringList::Iterator incs = qmakeIncludes.begin(); incs != qmakeIncludes.end(); ++incs )
     3509        for (QStringList::Iterator incs = qmakeIncludes.begin(); incs != qmakeIncludes.end(); ++incs)
    33763510            cout << (*incs) << " ";
    33773511        cout << endl;
    33783512    }
    3379     if( !qmakeLibs.isEmpty() ) {
     3513    if (!qmakeLibs.isEmpty()) {
    33803514        cout << "Additional libraries........";
    3381         for( QStringList::Iterator libs = qmakeLibs.begin(); libs != qmakeLibs.end(); ++libs )
     3515        for (QStringList::Iterator libs = qmakeLibs.begin(); libs != qmakeLibs.end(); ++libs)
    33823516            cout << (*libs) << " ";
    33833517        cout << endl;
    33843518    }
    3385     if( dictionary[ "QMAKE_INTERNAL" ] == "yes" ) {
     3519    if (dictionary[ "QMAKE_INTERNAL" ] == "yes") {
    33863520        cout << "Using internal configuration." << endl;
    33873521    }
    3388     if( dictionary[ "SHARED" ] == "no" ) {
     3522    if (dictionary[ "SHARED" ] == "no") {
    33893523        cout << "WARNING: Using static linking will disable the use of plugins." << endl;
    33903524        cout << "         Make sure you compile ALL needed modules into the library." << endl;
    33913525    }
    3392     if( dictionary[ "OPENSSL" ] == "linked" && opensslLibs.isEmpty() ) {
     3526    if (dictionary[ "OPENSSL" ] == "linked" && opensslLibs.isEmpty()) {
    33933527        cout << "NOTE: When linking against OpenSSL, you can override the default" << endl;
    33943528        cout << "library names through OPENSSL_LIBS." << endl;
    33953529        cout << "For example:" << endl;
    3396         cout << "    configure -openssl-linked OPENSSL_LIBS='-lssleay32 -llibeay32'" << endl;
    3397     }
    3398     if( dictionary[ "ZLIB_FORCED" ] == "yes" ) {
     3530        cout << "    configure -openssl-linked OPENSSL_LIBS=\"-lssleay32 -llibeay32\"" << endl;
     3531    }
     3532    if (dictionary[ "ZLIB_FORCED" ] == "yes") {
    33993533        QString which_zlib = "supplied";
    3400         if( dictionary[ "ZLIB" ] == "system")
     3534        if (dictionary[ "ZLIB" ] == "system")
    34013535            which_zlib = "system";
    34023536
     
    34273561void Configure::buildQmake()
    34283562{
    3429     if( dictionary[ "BUILD_QMAKE" ] == "yes" ) {
     3563    if (dictionary[ "BUILD_QMAKE" ] == "yes") {
    34303564        QStringList args;
    34313565
    34323566        // Build qmake
    34333567        QString pwd = QDir::currentPath();
    3434         QDir::setCurrent(buildPath + "/qmake" );
     3568        QDir::setCurrent(buildPath + "/qmake");
    34353569
    34363570        QString makefile = "Makefile";
    34373571        {
    34383572            QFile out(makefile);
    3439             if(out.open(QFile::WriteOnly | QFile::Text)) {
     3573            if (out.open(QFile::WriteOnly | QFile::Text)) {
    34403574                QTextStream stream(&out);
    34413575                stream << "#AutoGenerated by configure.exe" << endl
     
    34503584
    34513585                QFile in(sourcePath + "/qmake/" + dictionary["QMAKEMAKEFILE"]);
    3452                 if(in.open(QFile::ReadOnly | QFile::Text)) {
     3586                if (in.open(QFile::ReadOnly | QFile::Text)) {
    34533587                    QString d = in.readAll();
    34543588                    //### need replaces (like configure.sh)? --Sam
     
    34653599
    34663600        cout << "Creating qmake..." << endl;
    3467         int exitCode = 0;
    3468         if( exitCode = Environment::execute(args, QStringList(), QStringList()) ) {
     3601        int exitCode = Environment::execute(args, QStringList(), QStringList());
     3602        if (exitCode) {
    34693603            args.clear();
    34703604            args += dictionary[ "MAKE" ];
     
    34723606            args += makefile;
    34733607            args += "clean";
    3474             if( exitCode = Environment::execute(args, QStringList(), QStringList())) {
     3608            exitCode = Environment::execute(args, QStringList(), QStringList());
     3609            if (exitCode) {
    34753610                cout << "Cleaning qmake failed, return code " << exitCode << endl << endl;
    34763611                dictionary[ "DONE" ] = "error";
     
    34803615                args += "-f";
    34813616                args += makefile;
    3482                 if (exitCode = Environment::execute(args, QStringList(), QStringList())) {
     3617                exitCode = Environment::execute(args, QStringList(), QStringList());
     3618                if (exitCode) {
    34833619                    cout << "Building qmake failed, return code " << exitCode << endl << endl;
    34843620                    dictionary[ "DONE" ] = "error";
     
    34863622            }
    34873623        }
    3488         QDir::setCurrent( pwd );
     3624        QDir::setCurrent(pwd);
    34893625    }
    34903626}
     
    35053641        << "tools/linguist/lrelease";
    35063642
    3507     if(dictionary["XQMAKESPEC"].startsWith("wince"))
     3643    if (dictionary["XQMAKESPEC"].startsWith("wince"))
    35083644        hostToolsDirs << "tools/checksdk";
    35093645
     
    35193655        QStringList args;
    35203656        args << QDir::toNativeSeparators(buildPath + "/bin/qmake");
    3521         args << "-spec" << dictionary["QMAKESPEC"] << "-r";
     3657        // override .qmake.cache because we are not cross-building these.
     3658        // we need a full path so that a build with -prefix will still find it.
     3659        args << "-spec" << QDir::toNativeSeparators(buildPath + "/mkspecs/" + dictionary["QMAKESPEC"]);
     3660        args << "-r";
    35223661        args << "-o" << QDir::toNativeSeparators(toolBuildPath + "/Makefile");
    35233662
    35243663        QDir().mkpath(toolBuildPath);
    35253664        QDir::setCurrent(toolSourcePath);
    3526         int exitCode = 0;
    3527         if (exitCode = Environment::execute(args, QStringList(), QStringList())) {
     3665        int exitCode = Environment::execute(args, QStringList(), QStringList());
     3666        if (exitCode) {
    35283667            cout << "qmake failed, return code " << exitCode << endl << endl;
    35293668            dictionary["DONE"] = "error";
     
    35353674        args += dictionary["MAKE"];
    35363675        QDir::setCurrent(toolBuildPath);
    3537         if (exitCode = Environment::execute(args, QStringList(), QStringList())) {
     3676        exitCode = Environment::execute(args, QStringList(), QStringList());
     3677        if (exitCode) {
    35383678            args.clear();
    35393679            args += dictionary["MAKE"];
    35403680            args += "clean";
    3541             if(exitCode = Environment::execute(args, QStringList(), QStringList())) {
     3681            exitCode = Environment::execute(args, QStringList(), QStringList());
     3682            if (exitCode) {
    35423683                cout << "Cleaning " << hostToolsDirs.at(i) << " failed, return code " << exitCode << endl << endl;
    35433684                dictionary["DONE"] = "error";
     
    35463687                args.clear();
    35473688                args += dictionary["MAKE"];
    3548                 if (exitCode = Environment::execute(args, QStringList(), QStringList())) {
     3689                exitCode = Environment::execute(args, QStringList(), QStringList());
     3690                if (exitCode) {
    35493691                    cout << "Building " << hostToolsDirs.at(i) << " failed, return code " << exitCode << endl << endl;
    35503692                    dictionary["DONE"] = "error";
     
    35573699}
    35583700
    3559 void Configure::findProjects( const QString& dirName )
    3560 {
    3561     if( dictionary[ "NOPROCESS" ] == "no" ) {
    3562         QDir dir( dirName );
     3701void Configure::findProjects(const QString& dirName)
     3702{
     3703    if (dictionary[ "NOPROCESS" ] == "no") {
     3704        QDir dir(dirName);
    35633705        QString entryName;
    35643706        int makeListNumber;
     
    35663708        const QFileInfoList &list = dir.entryInfoList(QStringList(QLatin1String("*.pro")),
    35673709                                                      QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot);
    3568         for(int i = 0; i < list.size(); ++i) {
     3710        for (int i = 0; i < list.size(); ++i) {
    35693711            const QFileInfo &fi = list.at(i);
    3570             if(fi.fileName() != "qmake.pro") {
     3712            if (fi.fileName() != "qmake.pro") {
    35713713                entryName = dirName + "/" + fi.fileName();
    3572                 if(fi.isDir()) {
    3573                     findProjects( entryName );
     3714                if (fi.isDir()) {
     3715                    findProjects(entryName);
    35743716                } else {
    3575                     qmakeTemplate = projectType( fi.absoluteFilePath() );
    3576                     switch ( qmakeTemplate ) {
     3717                    qmakeTemplate = projectType(fi.absoluteFilePath());
     3718                    switch (qmakeTemplate) {
    35773719                    case Lib:
    35783720                    case Subdirs:
     
    36013743    dir.prepend("/src");
    36023744    makeList[inList].append(new MakeItem(sourcePath + dir,
    3603         item + ".pro", buildPath + dir + "/Makefile", Lib ) );
    3604     if( dictionary[ "DSPFILES" ] == "yes" ) {
    3605         makeList[inList].append( new MakeItem(sourcePath + dir,
    3606             item + ".pro", buildPath + dir + "/" + item + ".dsp", Lib ) );
    3607     }
    3608     if( dictionary[ "VCPFILES" ] == "yes" ) {
    3609         makeList[inList].append( new MakeItem(sourcePath + dir,
    3610             item + ".pro", buildPath + dir + "/" + item + ".vcp", Lib ) );
    3611     }
    3612     if( dictionary[ "VCPROJFILES" ] == "yes" ) {
    3613         makeList[inList].append( new MakeItem(sourcePath + dir,
    3614             item + ".pro", buildPath + dir + "/" + item + ".vcproj", Lib ) );
     3745        item + ".pro", buildPath + dir + "/Makefile", Lib));
     3746    if (dictionary[ "DSPFILES" ] == "yes") {
     3747        makeList[inList].append(new MakeItem(sourcePath + dir,
     3748            item + ".pro", buildPath + dir + "/" + item + ".dsp", Lib));
     3749    }
     3750    if (dictionary[ "VCPFILES" ] == "yes") {
     3751        makeList[inList].append(new MakeItem(sourcePath + dir,
     3752            item + ".pro", buildPath + dir + "/" + item + ".vcp", Lib));
     3753    }
     3754    if (dictionary[ "VCPROJFILES" ] == "yes") {
     3755        makeList[inList].append(new MakeItem(sourcePath + dir,
     3756            item + ".pro", buildPath + dir + "/" + item + ".vcproj", Lib));
    36153757    }
    36163758}
     
    36183760void Configure::generateMakefiles()
    36193761{
    3620     if( dictionary[ "NOPROCESS" ] == "no" ) {
     3762    if (dictionary[ "NOPROCESS" ] == "no") {
    36213763#if !defined(EVAL)
    36223764        cout << "Creating makefiles in src..." << endl;
     
    36243766
    36253767        QString spec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ];
    3626         if( spec != "win32-msvc" )
     3768        if (spec != "win32-msvc")
    36273769            dictionary[ "DSPFILES" ] = "no";
    36283770
    3629         if( spec != "win32-msvc.net" && !spec.startsWith("win32-msvc2") && !spec.startsWith(QLatin1String("wince")))
     3771        if (spec != "win32-msvc.net" && !spec.startsWith("win32-msvc2") && !spec.startsWith(QLatin1String("wince")))
    36303772            dictionary[ "VCPROJFILES" ] = "no";
    36313773
     
    36423784                QStringList args;
    36433785
    3644                 args << fixSeparators( buildPath + "/bin/qmake" );
     3786                args << fixSeparators(buildPath + "/bin/qmake");
    36453787
    36463788                if (doDsp) {
    3647                     if( dictionary[ "DEPENDENCIES" ] == "no" )
     3789                    if (dictionary[ "DEPENDENCIES" ] == "no")
    36483790                        args << "-nodepend";
    36493791                    args << "-tp" <<  "vc";
     
    36543796                    generate = false; // Now Makefiles will be done
    36553797                }
    3656                 args << "-spec";
    3657                 args << spec;
     3798                // don't pass -spec - .qmake.cache has it already
    36583799                args << "-r";
    36593800                args << (sourcePath + "/projects.pro");
    36603801                args << "-o";
    36613802                args << buildPath;
    3662                 if(!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty())
     3803                if (!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty())
    36633804                    args << dictionary[ "QMAKEADDITIONALARGS" ];
    36643805
    3665                 QDir::setCurrent( fixSeparators( dirPath ) );
    3666                 if( int exitCode = Environment::execute(args, QStringList(), QStringList()) ) {
     3806                QDir::setCurrent(fixSeparators(dirPath));
     3807                if (int exitCode = Environment::execute(args, QStringList(), QStringList())) {
    36673808                    cout << "Qmake failed, return code " << exitCode  << endl << endl;
    36683809                    dictionary[ "DONE" ] = "error";
     
    36713812        } else {
    36723813            findProjects(sourcePath);
    3673             for ( i=0; i<3; i++ ) {
    3674                 for ( int j=0; j<makeList[i].size(); ++j) {
     3814            for (i=0; i<3; i++) {
     3815                for (int j=0; j<makeList[i].size(); ++j) {
    36753816                    MakeItem *it=makeList[i][j];
    3676                     QString dirPath = fixSeparators( it->directory + "/" );
     3817                    QString dirPath = fixSeparators(it->directory + "/");
    36773818                    QString projectName = it->proFile;
    36783819                    QString makefileName = buildPath + "/" + dirPath + it->target;
     
    36853826                    QStringList args;
    36863827
    3687                     args << fixSeparators( buildPath + "/bin/qmake" );
     3828                    args << fixSeparators(buildPath + "/bin/qmake");
    36883829                    args << sourcePath + "/" + dirPath + projectName;
    36893830                    args << dictionary[ "QMAKE_ALL_ARGS" ];
     
    36943835                    args << "-spec";
    36953836                    args << spec;
    3696                     if(!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty())
     3837                    if (!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty())
    36973838                        args << dictionary[ "QMAKEADDITIONALARGS" ];
    36983839
    3699                     QDir::setCurrent( fixSeparators( dirPath ) );
     3840                    QDir::setCurrent(fixSeparators(dirPath));
    37003841
    37013842                    QFile file(makefileName);
     
    37153856            }
    37163857        }
    3717         QDir::setCurrent( pwd );
     3858        QDir::setCurrent(pwd);
    37183859    } else {
    37193860        cout << "Processing of project files have been disabled." << endl;
     
    37293870        cout << endl << endl << "Qt is now configured for building. Just run " << qPrintable(make) << "." << endl;
    37303871        cout << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl;
    3731     } else if(dictionary.value("QMAKESPEC").startsWith("wince")) {
     3872    } else if (dictionary.value("QMAKESPEC").startsWith("wince")) {
    37323873        // we are cross compiling for Windows CE
    37333874        cout << endl << endl << "Qt is now configured for building. To start the build run:" << endl
     
    37413882}
    37423883
    3743 Configure::ProjectType Configure::projectType( const QString& proFileName )
    3744 {
    3745     QFile proFile( proFileName );
    3746     if( proFile.open( QFile::ReadOnly ) ) {
     3884Configure::ProjectType Configure::projectType(const QString& proFileName)
     3885{
     3886    QFile proFile(proFileName);
     3887    if (proFile.open(QFile::ReadOnly)) {
    37473888        QString buffer = proFile.readLine(1024);
    37483889        while (!buffer.isEmpty()) {
    3749             QStringList segments = buffer.split(QRegExp( "\\s" ));
     3890            QStringList segments = buffer.split(QRegExp("\\s"));
    37503891            QStringList::Iterator it = segments.begin();
    37513892
    3752             if(segments.size() >= 3) {
     3893            if (segments.size() >= 3) {
    37533894                QString keyword = (*it++);
    37543895                QString operation = (*it++);
    37553896                QString value = (*it++);
    37563897
    3757                 if( keyword == "TEMPLATE" ) {
    3758                     if( value == "lib" )
     3898                if (keyword == "TEMPLATE") {
     3899                    if (value == "lib")
    37593900                        return Lib;
    3760                     else if( value == "subdirs" )
     3901                    else if (value == "subdirs")
    37613902                        return Subdirs;
    37623903                }
     
    38443985            }
    38453986            QStringList licenseContent = QString(file.readAll()).split('\n');
    3846             while(i < licenseContent.size()) {
     3987            while (i < licenseContent.size()) {
    38473988                cout << licenseContent.at(i) << endl;
    38483989                if (++i % screenHeight == 0) {
    38493990                    cout << "(Press any key for more..)";
    3850                     if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
     3991                    if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
    38513992                        exit(0);      // Exit cleanly for Ctrl+C
    38523993                    cout << "\r";     // Overwrite text above
     
    39304071void Configure::reloadCmdLine()
    39314072{
    3932     if( dictionary[ "REDO" ] == "yes" ) {
    3933         QFile inFile( buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache" );
    3934         if( inFile.open( QFile::ReadOnly ) ) {
    3935             QTextStream inStream( &inFile );
     4073    if (dictionary[ "REDO" ] == "yes") {
     4074        QFile inFile(buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache");
     4075        if (inFile.open(QFile::ReadOnly)) {
     4076            QTextStream inStream(&inFile);
    39364077            QString buffer;
    39374078            inStream >> buffer;
    3938             while( buffer.length() ) {
     4079            while (buffer.length()) {
    39394080                configCmdLine += buffer;
    39404081                inStream >> buffer;
     
    39474088void Configure::saveCmdLine()
    39484089{
    3949     if( dictionary[ "REDO" ] != "yes" ) {
    3950         QFile outFile( buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache" );
    3951         if( outFile.open( QFile::WriteOnly | QFile::Text ) ) {
    3952             QTextStream outStream( &outFile );
    3953             for( QStringList::Iterator it = configCmdLine.begin(); it != configCmdLine.end(); ++it ) {
     4090    if (dictionary[ "REDO" ] != "yes") {
     4091        QFile outFile(buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache");
     4092        if (outFile.open(QFile::WriteOnly | QFile::Text)) {
     4093            QTextStream outStream(&outFile);
     4094            for (QStringList::Iterator it = configCmdLine.begin(); it != configCmdLine.end(); ++it) {
    39544095                outStream << (*it) << " " << endl;
    39554096            }
     
    39754116{
    39764117    QFile file1(fn1), file2(fn2);
    3977     if(!file1.open(QFile::ReadOnly) || !file2.open(QFile::ReadOnly))
     4118    if (!file1.open(QFile::ReadOnly) || !file2.open(QFile::ReadOnly))
    39784119        return true;
    39794120    const int chunk = 2048;
    39804121    int used1 = 0, used2 = 0;
    39814122    char b1[chunk], b2[chunk];
    3982     while(!file1.atEnd() && !file2.atEnd()) {
    3983         if(!used1)
     4123    while (!file1.atEnd() && !file2.atEnd()) {
     4124        if (!used1)
    39844125            used1 = file1.read(b1, chunk);
    3985         if(!used2)
     4126        if (!used2)
    39864127            used2 = file2.read(b2, chunk);
    3987         if(used1 > 0 && used2 > 0) {
     4128        if (used1 > 0 && used2 > 0) {
    39884129            const int cmp = qMin(used1, used2);
    3989             if(memcmp(b1, b2, cmp))
     4130            if (memcmp(b1, b2, cmp))
    39904131                return true;
    3991             if((used1 -= cmp))
     4132            if ((used1 -= cmp))
    39924133                memcpy(b1, b1+cmp, used1);
    3993             if((used2 -= cmp))
     4134            if ((used2 -= cmp))
    39944135                memcpy(b2, b2+cmp, used2);
    39954136        }
  • trunk/tools/configure/configureapp.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    123123    QStringList qmakeStylePlugins;
    124124
    125     QStringList qmakeFormatPlugins;
    126 
    127125    QStringList qmakeVars;
    128126    QStringList qmakeDefines;
     
    134132    QStringList qmakeLibs;
    135133    QString opensslLibs;
     134    QString psqlLibs;
     135    QString sybase;
     136    QString sybaseLibs;
    136137
    137138    QMap<QString,QString> licenseInfo;
     
    148149
    149150    bool useUnixSeparators;
    150     QString fixSeparators(QString somePath);
     151    QString fixSeparators(const QString &somePath, bool escape = false);
     152    QString escapeSeparators(const QString &somePath);
    151153    bool filesDiffer(const QString &file1, const QString &file2);
    152154
  • trunk/tools/configure/environment.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    6161#endif
    6262
    63 #include <symbian/epocroot.h> // from tools/shared
    64 #include <windows/registry.h> // from tools/shared
     63#include <symbian/epocroot_p.h> // from tools/shared
     64#include <windows/registry_p.h> // from tools/shared
    6565
    6666QT_BEGIN_NAMESPACE
     
    7474    // The compilers here are sorted in a reversed-preferred order
    7575    {CC_BORLAND, "Borland C++",                                                    0, "bcc32.exe"},
    76     {CC_MINGW,   "MinGW (Minimalist GNU for Windows)",                             0, "mingw32-gcc.exe"},
     76    {CC_MINGW,   "MinGW (Minimalist GNU for Windows)",                             0, "g++.exe"},
    7777    {CC_INTEL,   "Intel(R) C++ Compiler for 32-bit applications",                  0, "icl.exe"}, // xilink.exe, xilink5.exe, xilink6.exe, xilib.exe
    7878    {CC_MSVC6,   "Microsoft (R) 32-bit C/C++ Optimizing Compiler (6.x)",           "Software\\Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual C++\\ProductDir", "cl.exe"}, // link.exe, lib.exe
     
    8181    {CC_NET2005, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2005 (8.0)",  "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\8.0", "cl.exe"}, // link.exe, lib.exe
    8282    {CC_NET2008, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2008 (9.0)",  "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\9.0", "cl.exe"}, // link.exe, lib.exe
     83    {CC_NET2010, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2010 (10.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\10.0", "cl.exe"}, // link.exe, lib.exe
    8384    {CC_UNKNOWN, "Unknown", 0, 0},
    8485};
     
    106107    QString spec;
    107108    switch (detectCompiler()) {
     109    case CC_NET2010:
     110        spec = "win32-msvc2010";
     111        break;
    108112    case CC_NET2008:
    109113        spec = "win32-msvc2008";
     
    160164    QStringList pathlist = paths.toLower().split(";");
    161165    for(int i = 0; compiler_info[i].compiler; ++i) {
    162         QString productPath = readRegistryKey(HKEY_LOCAL_MACHINE, compiler_info[i].regKey).toLower();
     166        QString productPath = qt_readRegistryKey(HKEY_LOCAL_MACHINE, compiler_info[i].regKey).toLower();
    163167        if (productPath.length()) {
    164168            QStringList::iterator it;
     
    278282    }
    279283    // add the user environment
    280     for (QStringList::ConstIterator it = environment.begin(); it != environment.end(); it++ ) {
    281             QString tmp = *it;
     284    foreach (const QString &tmp, environment) {
    282285            uint tmpSize = sizeof(wchar_t) * (tmp.length() + 1);
    283286            envlist.resize(envlist.size() + tmpSize);
     
    358361    QByteArray envlist = qt_create_environment(fullEnv);
    359362
    360     DWORD exitCode = -1;
     363    DWORD exitCode = DWORD(-1);
    361364    PROCESS_INFORMATION procInfo;
    362365    memset(&procInfo, 0, sizeof(procInfo));
     
    379382
    380383
    381     if (exitCode == -1) {
     384    if (exitCode == DWORD(-1)) {
    382385        switch(GetLastError()) {
    383386        case E2BIG:
    384387            cerr << "execute: Argument list exceeds 1024 bytes" << endl;
    385             foreach(QString arg, arguments)
     388            foreach (const QString &arg, arguments)
    386389                cerr << "   (" << arg.toLocal8Bit().constData() << ")" << endl;
    387390            break;
     
    397400        default:
    398401            cerr << "execute: Unknown error" << endl;
    399             foreach(QString arg, arguments)
     402            foreach (const QString &arg, arguments)
    400403                cerr << "   (" << arg.toLocal8Bit().constData() << ")" << endl;
    401404            break;
     
    405408}
    406409
    407 bool Environment::cpdir(const QString &srcDir, const QString &destDir)
     410/*!
     411    Copies the \a srcDir contents into \a destDir.
     412
     413    If \a includeSrcDir is not empty, any files with 'h', 'prf', or 'conf' suffixes
     414    will not be copied over from \a srcDir. Instead a new file will be created
     415    in \a destDir with the same name and that file will include a file with the
     416    same name from the \a includeSrcDir using relative path and appropriate
     417    syntax for the file type.
     418
     419    Returns true if copying was successful.
     420*/
     421bool Environment::cpdir(const QString &srcDir,
     422                        const QString &destDir,
     423                        const QString &includeSrcDir)
    408424{
    409425    QString cleanSrcName = QDir::cleanPath(srcDir);
    410426    QString cleanDstName = QDir::cleanPath(destDir);
     427    QString cleanIncludeName = QDir::cleanPath(includeSrcDir);
     428
    411429#ifdef CONFIGURE_DEBUG_CP_DIR
    412430    qDebug() << "Attempt to cpdir " << cleanSrcName << "->" << cleanDstName;
     
    419437    bool result = true;
    420438    QDir dir = QDir(cleanSrcName);
     439    QDir destinationDir = QDir(cleanDstName);
    421440    QFileInfoList allEntries = dir.entryInfoList(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot);
    422441    for (int i = 0; result && (i < allEntries.count()); ++i) {
     
    424443        bool intermediate = true;
    425444        if (entry.isDir()) {
     445            QString newIncSrcDir;
     446            if (!includeSrcDir.isEmpty())
     447                newIncSrcDir = QString("%1/%2").arg(cleanIncludeName).arg(entry.fileName());
     448
    426449            intermediate = cpdir(QString("%1/%2").arg(cleanSrcName).arg(entry.fileName()),
    427                             QString("%1/%2").arg(cleanDstName).arg(entry.fileName()));
     450                                 QString("%1/%2").arg(cleanDstName).arg(entry.fileName()),
     451                                 newIncSrcDir);
    428452        } else {
    429453            QString destFile = QString("%1/%2").arg(cleanDstName).arg(entry.fileName());
     
    432456#endif
    433457            QFile::remove(destFile);
    434             intermediate = QFile::copy(entry.absoluteFilePath(), destFile);
    435             SetFileAttributes((wchar_t*)destFile.utf16(), FILE_ATTRIBUTE_NORMAL);
     458            QString suffix = entry.suffix();
     459            if (!includeSrcDir.isEmpty() && (suffix == "prf" || suffix == "conf" || suffix == "h")) {
     460                QString relativeIncludeFilePath = QString("%1/%2").arg(cleanIncludeName).arg(entry.fileName());
     461                relativeIncludeFilePath = destinationDir.relativeFilePath(relativeIncludeFilePath);
     462#ifdef CONFIGURE_DEBUG_CP_DIR
     463                qDebug() << "...instead generate relative include to" << relativeIncludeFilePath;
     464#endif
     465                QFile currentFile(destFile);
     466                if (currentFile.open(QFile::WriteOnly | QFile::Text)) {
     467                    QTextStream fileStream;
     468                    fileStream.setDevice(&currentFile);
     469
     470                    if (suffix == "prf" || suffix == "conf") {
     471                        if (entry.fileName() == "qmake.conf") {
     472                            // While QMAKESPEC_ORIGINAL being relative or absolute doesn't matter for the
     473                            // primary use of this variable by qmake to identify the original mkspec, the
     474                            // variable is also used for few special cases where the absolute path is required.
     475                            // Conversely, the include of the original qmake.conf must be done using relative path,
     476                            // as some Qt binary deployments are done in a manner that doesn't allow for patching
     477                            // the paths at the installation time.
     478                            fileStream << "QMAKESPEC_ORIGINAL=" << cleanSrcName << endl << endl;
     479                        }
     480                        fileStream << "include(" << relativeIncludeFilePath << ")" << endl << endl;
     481                    } else if (suffix == "h") {
     482                        fileStream << "#include \"" << relativeIncludeFilePath << "\"" << endl << endl;
     483                    }
     484
     485                    fileStream.flush();
     486                    currentFile.close();
     487                }
     488            } else {
     489                intermediate = QFile::copy(entry.absoluteFilePath(), destFile);
     490                SetFileAttributes((wchar_t*)destFile.utf16(), FILE_ATTRIBUTE_NORMAL);
     491            }
    436492        }
    437493        if(!intermediate) {
     
    464520QString Environment::symbianEpocRoot()
    465521{
    466     // Call function defined in tools/shared/symbian/epocroot.h
    467     return ::epocRoot();
     522    // Call function defined in tools/shared/symbian/epocroot_p.h
     523    return ::qt_epocRoot();
    468524}
    469525
  • trunk/tools/configure/environment.h

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5757    CC_NET2003 = 0x71,
    5858    CC_NET2005 = 0x80,
    59     CC_NET2008 = 0x90
     59    CC_NET2008 = 0x90,
     60    CC_NET2010 = 0x91
    6061};
    6162
     
    6970
    7071    static int execute(QStringList arguments, const QStringList &additionalEnv, const QStringList &removeEnv);
    71     static bool cpdir(const QString &srcDir, const QString &destDir);
     72    static bool cpdir(const QString &srcDir,
     73                      const QString &destDir,
     74                      const QString &includeSrcDir = QString());
    7275    static bool rmdir(const QString &name);
    7376
  • trunk/tools/configure/main.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/configure/tools.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    9292                if ( components.size() >= 2 ) {
    9393                    QStringList::Iterator it = components.begin();
    94                     QString key = (*it++).trimmed().replace( "\"", QString() ).toUpper();
    95                     QString value = (*it++).trimmed().replace( "\"", QString() );
     94                    QString key = (*it++).trimmed().remove('"').toUpper();
     95                    QString value = (*it++).trimmed().remove('"');
    9696                    licenseInfo[ key ] = value;
    9797                }
     
    112112    QString licenseKey = licenseInfo["LICENSEKEYEXT"];
    113113    QByteArray clicenseKey = licenseKey.toLatin1();
    114     //We check the licence
     114    //We check the license
    115115    static const char * const SEP = "-";
    116116    char *licenseParts[NUMBER_OF_PARTS];
     
    219219    if (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/.LICENSE")) {
    220220        // Generic, no-suffix license
    221         dictionary["LICENSE_EXTENSION"] = QString();
     221        dictionary["LICENSE_EXTENSION"].clear();
    222222    } else if (dictionary["LICENSE_EXTENSION"].isEmpty()) {
    223223        cout << "License file does not contain proper license key." << endl;
     
    240240
    241241    if (!CopyFile((wchar_t*)QDir::toNativeSeparators(fromLicenseFile).utf16(),
    242         (wchar_t*)QDir::toNativeSeparators(toLicenseFile).utf16(), FALSE)) {
     242        (wchar_t*)QDir::toNativeSeparators(toLicenseFile).utf16(), false)) {
    243243        cout << "Failed to copy license file (" << fromLicenseFile << ")";
    244244        dictionary["DONE"] = "error";
  • trunk/tools/configure/tools.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
Note: See TracChangeset for help on using the changeset viewer.