Changeset 561 for trunk/tools/configure


Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tools/configure/configure.pro

    r2 r561  
    44CONFIG   += console flat
    55CONFIG   -= moc qt
    6 DEFINES  = QT_NODLL QT_NO_CODECS QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_LITE_COMPONENT QT_NO_STL QT_NO_COMPRESS QT_BUILD_QMAKE QT_NO_THREAD QT_NO_QOBJECT _CRT_SECURE_NO_DEPRECATE
     6DEFINES  = QT_NODLL QT_NO_CODECS QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_LITE_COMPONENT QT_NO_STL QT_NO_COMPRESS QT_BUILD_QMAKE QT_NO_THREAD QT_NO_QOBJECT _CRT_SECURE_NO_DEPRECATE
    77
    88
     
    1313win32-msvc* {
    1414    QMAKE_CFLAGS_RELEASE -= -MD
     15
    1516    QMAKE_CFLAGS_DEBUG -= -MDd
     17
    1618    QMAKE_CXXFLAGS_RELEASE -= -MD
     19
    1720    QMAKE_CXXFLAGS_DEBUG -= -MDd
     21
    1822}
    1923
     
    3337           $$QT_SOURCE_TREE/src/corelib/tools/qlocale.h \
    3438           $$QT_SOURCE_TREE/src/corelib/tools/qvector.h \
     39
    3540           $$QT_SOURCE_TREE/src/corelib/codecs/qtextcodec.h \
    3641           $$QT_SOURCE_TREE/src/corelib/global/qglobal.h \
     
    6267           $$QT_SOURCE_TREE/src/corelib/tools/qchar.cpp \
    6368           $$QT_SOURCE_TREE/src/corelib/tools/qhash.cpp \
    64            $$QT_SOURCE_TREE/src/corelib/tools/qlistdata.cpp \
     69           $$QT_SOURCE_TREE/src/corelib/tools/qlist.cpp \
    6570           $$QT_SOURCE_TREE/src/corelib/tools/qlocale.cpp \
    6671           $$QT_SOURCE_TREE/src/corelib/tools/qvector.cpp \
     72
    6773           $$QT_SOURCE_TREE/src/corelib/codecs/qtextcodec.cpp \
    6874           $$QT_SOURCE_TREE/src/corelib/global/qglobal.cpp \
  • trunk/tools/configure/configure_pch.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the tools applications of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/configure/configureapp.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the tools applications of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    117117
    118118    // Get the path to the executable
    119     QFileInfo sourcePathInfo;
    120     QT_WA({
    121         unsigned short module_name[256];
    122         GetModuleFileNameW(0, reinterpret_cast<wchar_t *>(module_name), sizeof(module_name));
    123         sourcePathInfo = QString::fromUtf16(module_name);
    124     }, {
    125         char module_name[256];
    126         GetModuleFileNameA(0, module_name, sizeof(module_name));
    127         sourcePathInfo = QString::fromLocal8Bit(module_name);
    128     });
     119    wchar_t module_name[MAX_PATH];
     120    GetModuleFileName(0, module_name, sizeof(module_name) / sizeof(wchar_t));
     121    QFileInfo sourcePathInfo = QString::fromWCharArray(module_name);
    129122    sourcePath = sourcePathInfo.absolutePath();
    130123    sourceDir = sourcePathInfo.dir();
     
    249242    dictionary[ "CETEST" ]          = "auto";
    250243    dictionary[ "CE_SIGNATURE" ]    = "no";
    251     dictionary[ "SCRIPTTOOLS" ]     = "yes";
     244    dictionary[ "SCRIPT" ]          = "auto";
     245    dictionary[ "SCRIPTTOOLS" ]     = "auto";
    252246    dictionary[ "XMLPATTERNS" ]     = "auto";
    253247    dictionary[ "PHONON" ]          = "auto";
    254248    dictionary[ "PHONON_BACKEND" ]  = "yes";
     249
     250
    255251    dictionary[ "DIRECTSHOW" ]      = "no";
    256252    dictionary[ "WEBKIT" ]          = "auto";
     253
    257254    dictionary[ "PLUGIN_MANIFESTS" ] = "yes";
    258255
     
    311308    dictionary[ "LIBPNG" ]          = "auto";
    312309    dictionary[ "LIBMNG" ]          = "auto";
     310
    313311
    314312    dictionary[ "QT3SUPPORT" ]      = "yes";
    315313    dictionary[ "ACCESSIBILITY" ]   = "yes";
    316314    dictionary[ "OPENGL" ]          = "yes";
    317     dictionary[ "DIRECT3D" ]        = "auto";
     315    dictionary[ "o";
    318316    dictionary[ "IPV6" ]            = "yes"; // Always, dynamicly loaded
    319317    dictionary[ "OPENSSL" ]         = "auto";
    320318    dictionary[ "DBUS" ]            = "auto";
     319
    321320
    322321    dictionary[ "STYLE_WINDOWS" ]   = "yes";
     
    329328    dictionary[ "STYLE_MOTIF" ]     = "yes";
    330329    dictionary[ "STYLE_CDE" ]       = "yes";
     330
    331331    dictionary[ "STYLE_GTK" ]       = "no";
    332332
     
    352352
    353353    dictionary[ "INCREDIBUILD_XGE" ] = "auto";
     354
     355
    354356}
    355357
     
    436438
    437439    for( ; i<configCmdLine.size(); ++i ) {
    438         bool continueElse = false;
     440        bool continueElse;
    439441        if( configCmdLine.at(i) == "-help"
    440442            || configCmdLine.at(i) == "-h"
     
    475477            dictionary[ "BUILDDEV" ] = "yes";
    476478        else if( configCmdLine.at(i) == "-nokia-developer" ) {
     479
     480
     481
    477482            dictionary[ "BUILDNOKIA" ] = "yes";
    478483            dictionary[ "BUILDDEV" ] = "yes";
     
    484489        else if( configCmdLine.at(i) == "-commercial" ) {
    485490            dictionary[ "BUILDTYPE" ] = "commercial";
     491
     492
     493
     494
     495
     496
    486497        }
    487498#endif
     
    578589            dictionary[ "LIBMNG" ] = "system";
    579590        }
     591
     592
     593
     594
     595
     596
     597
    580598        // CE- C runtime --------------------------------------------
    581599        else if( configCmdLine.at(i) == "-crt" ) {
     
    596614        else if (configCmdLine.at(i) == "-no-cetest") {
    597615            dictionary[ "CETEST" ] = "no";
     616
    598617        } else if (configCmdLine.at(i) == "-cetest") {
    599618            // although specified to use it, we stay at "auto" state
    600619            // this is because checkAvailability() adds variables
    601             // we need for crosscompilation
     620            // we need for crosscompilation; but remember if we asked
     621            // for it.
     622            dictionary[ "CETEST_REQUESTED" ] = "yes";
    602623        }
    603624        // Qt/CE - signing tool -------------------------------------
     
    657678            dictionary[ "STYLE_CDE" ] = "no";
    658679
     680
     681
     682
     683
     684
    659685        // Qt 3 Support ---------------------------------------------
    660686        else if( configCmdLine.at(i) == "-no-qt3support" )
     
    663689        // Work around compiler nesting limitation
    664690        else
    665             continueElse = true;
    666         if (!continueElse) {
     691            continueElse = true;
     692        if (!continueElse) {
    667693        }
    668694
     
    676702            dictionary[ "OPENGL" ]          = "yes";
    677703            dictionary[ "OPENGL_ES_CL" ]    = "yes";
    678         }
     704        } else if ( configCmdLine.at(i) == "-opengl-es-2" ) {
     705            dictionary[ "OPENGL" ]          = "yes";
     706            dictionary[ "OPENGL_ES_2" ]     = "yes";
     707        }
     708
     709        // OpenVG Support -------------------------------------------
     710        else if( configCmdLine.at(i) == "-openvg" ) {
     711            dictionary[ "OPENVG" ]    = "yes";
     712        } else if( configCmdLine.at(i) == "-no-openvg" ) {
     713            dictionary[ "OPENVG" ]    = "no";
     714        }
     715
    679716        // Databases ------------------------------------------------
    680717        else if( configCmdLine.at(i) == "-qt-sql-mysql" )
     
    762799        else if( configCmdLine.at(i) == "-incredibuild-xge" )
    763800            dictionary[ "INCREDIBUILD_XGE" ] = "yes";
     801
     802
     803
     804
    764805#if !defined(EVAL)
    765806        // Others ---------------------------------------------------
     807
     808
     809
     810
     811
     812
     813
     814
     815
     816
     817
     818
     819
     820
    766821        else if (configCmdLine.at(i) == "-fast" )
    767822            dictionary[ "FAST" ] = "yes";
     
    812867            dictionary[ "IWMMXT" ] = "yes";
    813868
    814         else if (configCmdLine.at(i) == "-no-direct3d") {
    815             dictionary["DIRECT3D"] = "no";
    816         }else if (configCmdLine.at(i) == "-direct3d") {
    817             dictionary["DIRECT3D"] = "auto"; // have to pass auto detection to enable Direct3D
    818         } else if( configCmdLine.at(i) == "-no-openssl" ) {
     869        else if( configCmdLine.at(i) == "-no-openssl" ) {
    819870              dictionary[ "OPENSSL"] = "no";
    820871        } else if( configCmdLine.at(i) == "-openssl" ) {
     
    832883        } else if( configCmdLine.at(i) == "-dbus-linked" ) {
    833884            dictionary[ "DBUS" ] = "linked";
     885
     886
     887
     888
    834889        } else if( configCmdLine.at(i) == "-no-scripttools" ) {
    835890            dictionary[ "SCRIPTTOOLS" ] = "no";
     
    840895        } else if( configCmdLine.at(i) == "-xmlpatterns" ) {
    841896            dictionary[ "XMLPATTERNS" ] = "yes";
     897
     898
     899
     900
     901
     902
     903
     904
    842905        } else if( configCmdLine.at(i) == "-no-phonon" ) {
    843906            dictionary[ "PHONON" ] = "no";
     
    854917        } else if( configCmdLine.at(i) == "-webkit" ) {
    855918            dictionary[ "WEBKIT" ] = "yes";
     919
     920
     921
     922
    856923        } else if( configCmdLine.at(i) == "-no-plugin-manifests" ) {
    857924            dictionary[ "PLUGIN_MANIFESTS" ] = "no";
    858925        } else if( configCmdLine.at(i) == "-plugin-manifests" ) {
    859926            dictionary[ "PLUGIN_MANIFESTS" ] = "yes";
     927
     928
     929
     930
     931
     932
    860933        }
    861934
     
    884957                break;
    885958            qmakeDefines += "QT_NAMESPACE="+configCmdLine.at(i);
     959
     960
     961
     962
     963
    886964        } else if( configCmdLine.at(i) == "-D" ) {
    887965            ++i;
     
    10291107                break;
    10301108            QString system = configCmdLine.at(i);
    1031             if (system == QLatin1String("raster") || system == QLatin1String("opengl"))
     1109            if (system == QLatin1String("raster")
     1110                || system == QLatin1String("opengl")
     1111                || system == QLatin1String("openvg"))
    10321112                dictionary["GRAPHICS_SYSTEM"] = configCmdLine.at(i);
    10331113        }
     
    10961176    }
    10971177
     1178
     1179
     1180
     1181
     1182
     1183
     1184
     1185
     1186
     1187
     1188
     1189
     1190
     1191
    10981192    // Ensure that -spec (XQMAKESPEC) exists in the mkspecs folder as well
    10991193    if (dictionary.contains("XQMAKESPEC") &&
     
    11271221    useUnixSeparators = (dictionary["QMAKESPEC"] == "win32-g++");
    11281222
     1223
     1224
     1225
     1226
    11291227
    11301228#if !defined(EVAL)
     
    11491247void Configure::validateArgs()
    11501248{
    1151     QStringList configs;
    11521249    // Validate the specified config
    11531250
     1251
    11541252    QDir dir;
    11551253    QStringList filters;
     
    11651263    allConfigs << "full";
    11661264
     1265
     1266
     1267
     1268
     1269
     1270
     1271
     1272
     1273
     1274
     1275
     1276
     1277
     1278
     1279
     1280
    11671281    QStringList::Iterator config;
    11681282    for( config = allConfigs.begin(); config != allConfigs.end(); ++config ) {
    1169         configs += (*config) + "-config";
    11701283        if( (*config) == dictionary[ "QCONFIG" ] )
    11711284            break;
     
    11761289    }
    11771290    else
    1178         qmakeConfig += configs;
     1291        qmakeConfig += ;
    11791292}
    11801293#endif
     
    12971410        dictionary[ "STYLE_MOTIF" ]         = "no";
    12981411        dictionary[ "STYLE_CDE" ]           = "no";
     1412
     1413
    12991414        dictionary[ "QT3SUPPORT" ]          = "no";
    13001415        dictionary[ "OPENGL" ]              = "no";
     
    13101425        dictionary[ "IWMMXT" ]              = "no";
    13111426        dictionary[ "CE_CRT" ]              = "yes";
    1312         dictionary[ "DIRECT3D" ]            = "no";
    13131427        dictionary[ "WEBKIT" ]              = "no";
    13141428        dictionary[ "PHONON" ]              = "yes";
     
    13221436        dictionary[ "QT_HOST_PREFIX" ]      = dictionary[ "QT_INSTALL_PREFIX" ];
    13231437        dictionary[ "QT_INSTALL_PREFIX" ]   = "";
     1438
     1439
     1440
     1441
     1442
     1443
     1444
     1445
     1446
     1447
     1448
     1449
     1450
     1451
     1452
     1453
     1454
     1455
     1456
     1457
     1458
     1459
     1460
     1461
     1462
     1463
     1464
     1465
     1466
     1467
     1468
     1469
     1470
     1471
     1472
     1473
     1474
     1475
     1476
     1477
     1478
     1479
     1480
     1481
     1482
     1483
    13241484
    13251485    } else if(dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong.
     
    14091569                    "[-no-libmng] [-qt-libmng] [-system-libmng] [-no-qt3support] [-mmx]\n"
    14101570                    "[-no-mmx] [-3dnow] [-no-3dnow] [-sse] [-no-sse] [-sse2] [-no-sse2]\n"
    1411                     "[-no-iwmmxt] [-iwmmxt] [-direct3d] [-openssl] [-openssl-linked]\n"
     1571                    "[-no-iwmmxt] [-iwmmxt] [-openssl] [-openssl-linked]\n"
    14121572                    "[-no-openssl] [-no-dbus] [-dbus] [-dbus-linked] [-platform <spec>]\n"
    1413                     "[-qtnamespace <namespace>] [-no-phonon] [-phonon]\n"
    1414                     "[-no-phonon-backend] [-phonon-backend]\n"
    1415                     "[-no-webkit] [-webkit]\n"
    1416                     "[-no-scripttools] [-scripttools]\n"
    1417                     "[-graphicssystem raster|opengl]\n\n", 0, 7);
     1573                    "[-qtnamespace <namespace>] [--phonon]\n"
     1574                    "[-no-phonon-backend] [-phonon-backend]\n"
     1575                    "[-no-]\n"
     1576                    "[-no-scripttools] [-scripttools]\n"
     1577                    "[-]\n\n", 0, 7);
    14181578
    14191579        desc("Installation options:\n\n");
     
    14591619        desc("SHARED", "yes",   "-shared",              "Create and use shared Qt libraries.");
    14601620        desc("SHARED", "no",    "-static",              "Create and use static Qt libraries.\n");
     1621
     1622
     1623
    14611624
    14621625        desc("FAST", "no",      "-no-fast",             "Configure Qt normally by generating Makefiles for all project files.");
     
    14941657        desc("OPENGL", "no","-no-opengl",               "Disables OpenGL functionality\n");
    14951658
     1659
     1660
     1661
     1662
     1663
    14961664#endif
    14971665        desc(                   "-platform <spec>",     "The operating system and compiler you are building on.\n(default %QMAKESPEC%)\n");
     
    15001668
    15011669#if !defined(EVAL)
    1502         desc(                   "-qtnamespace <namespace>", "Wraps all Qt library code in 'namespace name {...}\n");
     1670        desc(                   "-qtnamespace <namespace>", "Wraps all Qt library code in 'namespace name {...}");
     1671        desc(                   "-qtlibinfix <infix>",  "Renames all Qt* libs to Qt*<infix>\n");
    15031672        desc(                   "-D <define>",          "Add an explicit define to the preprocessor.");
    15041673        desc(                   "-I <includepath>",     "Add an explicit include path.");
     
    15091678                                "Available values for <sys>:");
    15101679        desc("GRAPHICS_SYSTEM", "raster", "", "  raster - Software rasterizer", ' ');
    1511         desc("GRAPHICS_SYSTEM", "opengl", "", "  opengl - Using OpenGL accelleration, experimental!", ' ');
     1680        desc("GRAPHICS_SYSTEM", "opengl", "", "  opengl - Using OpenGL acceleration, experimental!", ' ');
     1681        desc("GRAPHICS_SYSTEM", "openvg", "", "  openvg - Using OpenVG acceleration, experimental!", ' ');
    15121682
    15131683
     
    15731743        desc("SSE2", "no",      "-no-sse2",             "Do not compile with use of SSE2 instructions");
    15741744        desc("SSE2", "yes",      "-sse2",               "Compile with use of SSE2 instructions");
    1575         desc("DIRECT3D", "yes",  "-direct3d",           "Compile in Direct3D support (experimental - see INSTALL for more info)");
    15761745        desc("OPENSSL", "no",    "-no-openssl",         "Do not compile in OpenSSL support");
    15771746        desc("OPENSSL", "yes",   "-openssl",            "Compile in run-time OpenSSL support");
     
    15841753        desc("PHONON_BACKEND","no", "-no-phonon-backend","Do not compile the platform-specific Phonon backend-plugin");
    15851754        desc("PHONON_BACKEND","yes","-phonon-backend",  "Compile in the platform-specific Phonon backend-plugin");
     1755
     1756
     1757
     1758
    15861759        desc("WEBKIT", "no",    "-no-webkit",           "Do not compile in the WebKit module");
    15871760        desc("WEBKIT", "yes",   "-webkit",              "Compile in the WebKit module (WebKit is built if a decent C++ compiler is used.)");
     1761
     1762
    15881763        desc("SCRIPTTOOLS", "no", "-no-scripttools",    "Do not build the QtScriptTools module.");
    15891764        desc("SCRIPTTOOLS", "yes", "-scripttools",      "Build the QtScriptTools module.");
     1765
     1766
    15901767
    15911768        desc(                   "-arch <arch>",         "Specify an architecture.\n"
     
    15931770        desc("ARCHITECTURE","windows",       "",        "  windows", ' ');
    15941771        desc("ARCHITECTURE","windowsce",     "",        "  windowsce", ' ');
     1772
    15951773        desc("ARCHITECTURE","boundschecker",     "",    "  boundschecker", ' ');
    15961774        desc("ARCHITECTURE","generic", "",              "  generic\n", ' ');
     
    16071785        desc("STYLE_CDE", "yes", "",                    "  cde", ' ');
    16081786        desc("STYLE_WINDOWSCE", "yes", "",              "  windowsce", ' ');
    1609         desc("STYLE_WINDOWSMOBILE" , "yes", "",         "  windowsmobile\n", ' ');
     1787        desc("STYLE_WINDOWSMOBILE" , "yes", "",         "  windowsmobile", ' ');
     1788        desc("STYLE_S60" , "yes", "",                   "  s60\n", ' ');
     1789        desc("NATIVE_GESTURES", "no", "-no-native-gestures", "Do not use native gestures on Windows 7.");
     1790        desc("NATIVE_GESTURES", "yes", "-native-gestures", "Use native gestures on Windows 7.");
    16101791
    16111792/*      We do not support -qconfig on Windows yet
     
    16331814        desc("OPENGL_ES_CM", "no", "-opengl-es-cm",        "Enable support for OpenGL ES Common");
    16341815        desc("OPENGL_ES_CL", "no", "-opengl-es-cl",        "Enable support for OpenGL ES Common Lite");
     1816
    16351817        desc("DIRECTSHOW", "no",   "-phonon-wince-ds9",    "Enable Phonon Direct Show 9 backend for Windows CE");
    16361818
     1819
     1820
     1821
     1822
     1823
     1824
     1825
    16371826        return true;
    16381827    }
     
    16401829}
    16411830
    1642 bool Configure::findFileInPaths(const QString &fileName, const QStringList &paths)
    1643 {
    1644     QDir d;
    1645     for( QStringList::ConstIterator it = paths.begin(); it != paths.end(); ++it ) {
    1646         // Remove any leading or trailing ", this is commonly used in the environment
    1647         // variables
    1648         QString path = (*it);
    1649         if ( path.startsWith( "\"" ) )
    1650             path = path.right( path.length() - 1 );
    1651         if ( path.endsWith( "\"" ) )
    1652             path = path.left( path.length() - 1 );
    1653         if( d.exists( path + QDir::separator() + fileName ) )
    1654             return true;
    1655     }
    1656     return false;
    1657 }
    1658 
    1659 bool Configure::findFile( const QString &fileName )
    1660 {
    1661     QString file = fileName.toLower();
    1662     QStringList paths;
     1831QString Configure::findFileInPaths(const QString &fileName, const QString &paths)
     1832{
    16631833#if defined(Q_OS_WIN32)
    16641834    QRegExp splitReg("[;,]");
     
    16661836    QRegExp splitReg("[:]");
    16671837#endif
    1668     if (file.endsWith(".h"))
    1669         paths = QString::fromLocal8Bit(getenv("INCLUDE")).split(splitReg, QString::SkipEmptyParts);
    1670     else if ( file.endsWith( ".lib" ) )
    1671         paths = QString::fromLocal8Bit(getenv("LIB")).split(splitReg, QString::SkipEmptyParts);
    1672     else
    1673         paths = QString::fromLocal8Bit(getenv("PATH")).split(splitReg, QString::SkipEmptyParts);
    1674     return findFileInPaths(file, paths);
     1838    QStringList pathList = paths.split(splitReg, QString::SkipEmptyParts);
     1839    QDir d;
     1840    for( QStringList::ConstIterator it = pathList.begin(); it != pathList.end(); ++it ) {
     1841        // Remove any leading or trailing ", this is commonly used in the environment
     1842        // variables
     1843        QString path = (*it);
     1844        if ( path.startsWith( '\"' ) )
     1845            path = path.right( path.length() - 1 );
     1846        if ( path.endsWith( '\"' ) )
     1847            path = path.left( path.length() - 1 );
     1848        if( d.exists( path + QDir::separator() + fileName ) )
     1849            return path;
     1850    }
     1851    return QString();
     1852}
     1853
     1854bool Configure::findFile( const QString &fileName )
     1855{
     1856    const QString file = fileName.toLower();
     1857    const QString pathEnvVar = QString::fromLocal8Bit(getenv("PATH"));
     1858    const QString mingwPath = dictionary["QMAKESPEC"].endsWith("-g++") ?
     1859        findFileInPaths("mingw32-g++.exe", pathEnvVar) : QString();
     1860
     1861    QString paths;
     1862    if (file.endsWith(".h")) {
     1863        if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull())
     1864                    return true;
     1865        paths = QString::fromLocal8Bit(getenv("INCLUDE"));
     1866    } else if ( file.endsWith( ".lib" ) ||  file.endsWith( ".a" ) ) {
     1867        if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../lib")).isNull())
     1868                    return true;
     1869        paths = QString::fromLocal8Bit(getenv("LIB"));
     1870    } else {
     1871        paths = pathEnvVar;
     1872    }
     1873    return !findFileInPaths(file, paths).isNull();
    16751874}
    16761875
     
    17421941    bool available = false;
    17431942    if (part == "STYLE_WINDOWSXP")
    1744         available = (dictionary.value("QMAKESPEC") == "win32-g++" || findFile("uxtheme.h"));
     1943        available = (findFile("uxtheme.h"));
    17451944
    17461945    else if (part == "ZLIB")
     
    17681967        available = findFile("sqlcli.h") && findFile("sqlcli1.h") && findFile("db2cli.lib");
    17691968    else if (part == "SQL_SQLITE")
     1969
     1970
     1971
    17701972            available = true; // Built in, we have a fork
    17711973    else if (part == "SQL_SQLITE_LIB") {
    17721974        if (dictionary[ "SQL_SQLITE_LIB" ] == "system") {
    1773             available = findFile("sqlite3.h") && findFile("sqlite3.lib");
    1774             if (available)
    1775                 dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib";
     1975                    // Symbian has multiple .lib/.dll files we need to find
     1976            if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
     1977                            available = true; // There is sqlite_symbian plugin which exports the necessary stuff
     1978                            dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3";
     1979                    } else {
     1980                            available = findFile("sqlite3.h") && findFile("sqlite3.lib");
     1981                            if (available)
     1982                                    dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib";
     1983                    }
    17761984        } else
    17771985            available = true;
     
    17851993        available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
    17861994    else if (part == "OPENGL_ES_CL")
     1995
     1996
    17871997        available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
    17881998    else if (part == "DIRECTSHOW")
     
    18062016            dictionary[ "QT_CE_RAPI_LIB" ] += QLatin1String("\"") + rapiLib + QLatin1String("\"");
    18072017        }
     2018
     2019
     2020
     2021
     2022
    18082023    }
    18092024    else if (part == "INCREDIBUILD_XGE")
     
    18162031               && dictionary.value("QMAKESPEC") != "win32-msvc2002"
    18172032               && dictionary.value("EXCEPTIONS") == "yes";
    1818     } else if (part == "DIRECT3D") {
    1819         QString sdk_dir(QString::fromLocal8Bit(getenv("DXSDK_DIR")));
    1820         QDir dir;
    1821         bool has_d3d = false;
    1822 
    1823         if (!sdk_dir.isEmpty() && dir.exists(sdk_dir))
    1824             has_d3d = true;
    1825 
    1826         if (has_d3d && !QFile::exists(sdk_dir + QLatin1String("\\include\\d3d9.h"))) {
    1827             cout << "No Direct3D version 9 SDK found." << endl;
    1828            has_d3d = false;
    1829         }
    1830 
    1831         // find the first dxguid.lib in the current LIB paths, if it is NOT
    1832         // the D3D SDK one, we're most likely in trouble..
    1833         if (has_d3d) {
    1834             has_d3d = false;
    1835             QString env_lib(QString::fromLocal8Bit(getenv("LIB")));
    1836             QStringList lib_paths = env_lib.split(';');
    1837             for (int i=0; i<lib_paths.size(); ++i) {
    1838                QString lib_path = lib_paths.at(i);
    1839                 if (QFile::exists(lib_path + QLatin1String("\\dxguid.lib")))
    1840                 {
    1841                     if (lib_path.startsWith(sdk_dir)) {
    1842                         has_d3d = true;
    1843                     } else {
    1844                         cout << "Your D3D/Platform SDK library paths seem to appear in the wrong order." << endl;
    1845                     }
    1846                     break;
    1847                 }
    1848             }
    1849         }
    1850 
    1851         available = has_d3d;
    1852         if (!has_d3d) {
    1853             cout << "Setting Direct3D to NO, since the proper Direct3D SDK was not detected." << endl
    1854                  << "Make sure you have the Direct3D SDK installed, and that you have run" << endl
    1855                  << "the <path to SDK>\\Utilities\\Bin\\dx_setenv.cmd script." << endl
    1856                  << "The D3D SDK library path *needs* to appear before the Platform SDK library" << endl
    1857                  << "path in your LIB environment variable." << endl;
    1858         }
    18592033    } else if (part == "PHONON") {
    1860         available = findFile("vmr9.h") && findFile("dshow.h") && findFile("strmiids.lib") &&
    1861                         findFile("dmoguids.lib") && findFile("msdmo.lib") && findFile("d3d9.h");
     2034        available = findFile("vmr9.h") && findFile("dshow.h") && findFile("dmo.h") && findFile("dmodshow.h")
     2035            && (findFile("strmiids.lib") || findFile("libstrmiids.a"))
     2036            && (findFile("dmoguids.lib") || findFile("libdmoguids.a"))
     2037            && (findFile("msdmo.lib") || findFile("libmsdmo.a"))
     2038            && findFile("d3d9.h");
    18622039
    18632040        if (!available) {
    18642041            cout << "All the required DirectShow/Direct3D files couldn't be found." << endl
    1865                  << "Make sure you have either the platform SDK AND the DirectX SDK or the Windows SDK installed." << endl
    1866                  << "If you have the DirectX SDK installed, please make sure that you have run the <path to SDK>\\SetEnv.Cmd script." << endl;
    1867         }
     2042                 << "Make sure you have either the platform SDK AND the DirectShow SDK or the Windows SDK installed." << endl
     2043                 << "If you have the DirectShow SDK installed, please make sure that you have run the <path to SDK>\\SetEnv.Cmd script." << endl;
     2044            if (!findFile("vmr9.h"))  cout << "vmr9.h not found" << endl;
     2045            if (!findFile("dshow.h")) cout << "dshow.h not found" << endl;
     2046            if (!findFile("strmiids.lib")) cout << "strmiids.lib not found" << endl;
     2047            if (!findFile("dmoguids.lib")) cout << "dmoguids.lib not found" << endl;
     2048            if (!findFile("msdmo.lib")) cout << "msdmo.lib not found" << endl;
     2049            if (!findFile("d3d9.h")) cout << "d3d9.h not found" << endl;
     2050        }
     2051    } else if (part == "MULTIMEDIA" || part == "SCRIPT" || part == "SCRIPTTOOLS") {
     2052        available = true;
    18682053    } else if (part == "WEBKIT") {
    18692054        available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-g++");
    1870     } else if (part == "SCRIPTTOOLS") {
    1871         available = true;
     2055    } else if (part == "") {
     2056        available = ;
    18722057    }
    18732058
     
    19462131    if (dictionary["DBUS"] == "auto")
    19472132        dictionary["DBUS"] = checkAvailability("DBUS") ? "yes" : "no";
     2133
     2134
    19482135    if (dictionary["SCRIPTTOOLS"] == "auto")
    19492136        dictionary["SCRIPTTOOLS"] = checkAvailability("SCRIPTTOOLS") ? "yes" : "no";
    19502137    if (dictionary["XMLPATTERNS"] == "auto")
    19512138        dictionary["XMLPATTERNS"] = checkAvailability("XMLPATTERNS") ? "yes" : "no";
    1952     if (dictionary["DIRECT3D"] == "auto")
    1953         dictionary["DIRECT3D"] = checkAvailability("DIRECT3D") ? "yes" : "no";
    19542139    if (dictionary["PHONON"] == "auto")
    19552140        dictionary["PHONON"] = checkAvailability("PHONON") ? "yes" : "no";
    19562141    if (dictionary["WEBKIT"] == "auto")
    19572142        dictionary["WEBKIT"] = checkAvailability("WEBKIT") ? "yes" : "no";
     2143
     2144
    19582145
    19592146    // Qt/WinCE remote test application
     
    19992186            exit(0);      // Exit cleanly for Ctrl+C
    20002187    }
     2188
     2189
     2190
     2191
     2192
     2193
     2194
     2195
     2196
    20012197
    20022198    return true;
     
    20212217     dll staticlib
    20222218
    2023      internal
    20242219     nocrosscompiler
    20252220     GNUmake
     
    20472242    if (!dictionary["QCONFIG"].isEmpty())
    20482243        build_options += dictionary["QCONFIG"] + "-config ";
    2049     if (dictionary["STL"] == "no")
    2050         build_options += "no-stl";
    20512244    build_options.sort();
    20522245
     
    21482341        qtConfig += "system-mng";
    21492342
     2343
     2344
     2345
     2346
    21502347    // Styles -------------------------------------------------------
    21512348    if ( dictionary[ "STYLE_WINDOWS" ] == "yes" )
     
    21782375    if ( dictionary[ "STYLE_CDE" ] == "yes" )
    21792376        qmakeStyles += "cde";
     2377
     2378
     2379
    21802380
    21812381    // Databases ----------------------------------------------------
     
    22632463    if ( dictionary["OPENGL_ES_CM"] == "yes" ) {
    22642464        qtConfig += "opengles1";
     2465
     2466
     2467
     2468
     2469
     2470
    22652471    }
    22662472
    22672473    if ( dictionary["OPENGL_ES_CL"] == "yes" ) {
    22682474        qtConfig += "opengles1cl";
     2475
     2476
     2477
     2478
     2479
     2480
     2481
     2482
     2483
     2484
    22692485    }
    22702486
    22712487     if ( dictionary["DIRECTSHOW"] == "yes" )
    22722488        qtConfig += "directshow";
    2273 
    2274     if (dictionary[ "DIRECT3D" ] == "yes")
    2275         qtConfig += "direct3d";
    22762489
    22772490    if (dictionary[ "OPENSSL" ] == "yes")
     
    22932506        qtConfig += "cetest";
    22942507
    2295     if (dictionary[ "SCRIPTTOOLS" ] == "yes")
     2508    if (dictionary[ "SCRIPT" ] == "yes")
     2509        qtConfig += "script";
     2510
     2511    if (dictionary[ "SCRIPTTOOLS" ] == "yes") {
     2512        if (dictionary[ "SCRIPT" ] == "no") {
     2513            cout << "QtScriptTools was requested, but it can't be built due to QtScript being "
     2514                    "disabled." << endl;
     2515            dictionary[ "DONE" ] = "error";
     2516        }
    22962517        qtConfig += "scripttools";
     2518
    22972519
    22982520    if (dictionary[ "XMLPATTERNS" ] == "yes")
     
    23052527    }
    23062528
     2529
     2530
     2531
    23072532    if (dictionary["WEBKIT"] == "yes")
    23082533        qtConfig += "webkit";
     2534
     2535
     2536
     2537
     2538
     2539
    23092540
    23102541    // We currently have no switch for QtSvg, so add it unconditionally.
     
    23272558        }
    23282559    }
     2560
     2561
     2562
    23292563
    23302564    // Directories and settings for .qmake.cache --------------------
     
    23682602    if (!opensslLibs.isEmpty())
    23692603        qmakeVars += opensslLibs;
    2370     else if (dictionary[ "OPENSSL" ] == "linked")
    2371         qmakeVars += QString("OPENSSL_LIBS    = -lssleay32 -llibeay32");
     2604    else if (dictionary[ "OPENSSL" ] == "linked") {
     2605        if(dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("symbian") )
     2606            qmakeVars += QString("OPENSSL_LIBS    = -llibssl -llibcrypto");
     2607        else
     2608            qmakeVars += QString("OPENSSL_LIBS    = -lssleay32 -llibeay32");
     2609        }
    23722610    if (!qmakeSql.isEmpty())
    23732611        qmakeVars += QString("sql-drivers    += ") + qmakeSql.join( " " );
     
    24822720            configStream << " static";
    24832721
     2722
     2723
    24842724        if( dictionary[ "STL" ] == "yes" )
    24852725            configStream << " stl";
     
    25262766
    25272767        if(!dictionary["QMAKE_RPATHDIR"].isEmpty())
    2528             configStream<<"QMAKE_RPATHDIR += "<<dictionary["QMAKE_RPATHDIR"];
     2768            configStream << "QMAKE_RPATHDIR += " << dictionary["QMAKE_RPATHDIR"] << endl;
     2769
     2770        if (!dictionary["QT_LIBINFIX"].isEmpty())
     2771            configStream << "QT_LIBINFIX = " << dictionary["QT_LIBINFIX"] << endl;
     2772
     2773        if(!dictionary["ARM_FPU_TYPE"].isEmpty()) {
     2774            configStream<<"QMAKE_CXXFLAGS.ARMCC += --fpu "<< dictionary["ARM_FPU_TYPE"];
     2775        }
    25292776
    25302777        configStream.flush();
     
    26362883        if(dictionary["STYLE_MOTIF"] != "yes")       qconfigList += "QT_NO_STYLE_MOTIF";
    26372884        if(dictionary["STYLE_CDE"] != "yes")         qconfigList += "QT_NO_STYLE_CDE";
     2885
    26382886        if(dictionary["STYLE_WINDOWSCE"] != "yes")   qconfigList += "QT_NO_STYLE_WINDOWSCE";
    26392887        if(dictionary["STYLE_WINDOWSMOBILE"] != "yes")   qconfigList += "QT_NO_STYLE_WINDOWSMOBILE";
     
    26502898        }
    26512899
    2652         if(dictionary["QT3SUPPORT"] == "no")        qconfigList += "QT_NO_QT3SUPPORT";
    26532900        if(dictionary["ACCESSIBILITY"] == "no")     qconfigList += "QT_NO_ACCESSIBILITY";
    26542901        if(dictionary["EXCEPTIONS"] == "no")        qconfigList += "QT_NO_EXCEPTIONS";
    26552902        if(dictionary["OPENGL"] == "no")            qconfigList += "QT_NO_OPENGL";
    2656         if(dictionary["DIRECT3D"] == "no")          qconfigList += "QT_NO_DIRECT3D";
     2903        if(dictionary["";
    26572904        if(dictionary["OPENSSL"] == "no")           qconfigList += "QT_NO_OPENSSL";
    26582905        if(dictionary["OPENSSL"] == "linked")       qconfigList += "QT_LINKED_OPENSSL";
     
    26602907        if(dictionary["IPV6"] == "no")              qconfigList += "QT_NO_IPV6";
    26612908        if(dictionary["WEBKIT"] == "no")            qconfigList += "QT_NO_WEBKIT";
     2909
    26622910        if(dictionary["PHONON"] == "no")            qconfigList += "QT_NO_PHONON";
     2911
    26632912        if(dictionary["XMLPATTERNS"] == "no")       qconfigList += "QT_NO_XMLPATTERNS";
     2913
    26642914        if(dictionary["SCRIPTTOOLS"] == "no")       qconfigList += "QT_NO_SCRIPTTOOLS";
     2915
     2916
     2917
    26652918
    26662919        if(dictionary["OPENGL_ES_CM"] == "yes" ||
    2667            dictionary["OPENGL_ES_CL"] == "yes")     qconfigList += "QT_OPENGL_ES";
     2920           dictionary["OPENGL_ES_CL"] == "yes" ||
     2921           dictionary["OPENGL_ES_2"]  == "yes")     qconfigList += "QT_OPENGL_ES";
    26682922
    26692923        if(dictionary["OPENGL_ES_CM"] == "yes")     qconfigList += "QT_OPENGL_ES_1";
     2924
    26702925        if(dictionary["OPENGL_ES_CL"] == "yes")     qconfigList += "QT_OPENGL_ES_1_CL";
    26712926
     
    26802935        if(dictionary["SQL_IBASE"] == "yes")        qconfigList += "QT_SQL_IBASE";
    26812936
     2937
    26822938        if (dictionary["GRAPHICS_SYSTEM"] == "opengl") qconfigList += "QT_GRAPHICSSYSTEM_OPENGL";
    26832939        if (dictionary["GRAPHICS_SYSTEM"] == "raster") qconfigList += "QT_GRAPHICSSYSTEM_RASTER";
     2940
     2941
     2942
     2943
     2944
     2945
     2946
     2947
     2948
    26842949
    26852950        qconfigList.sort();
     
    27433008
    27443009        // Replace old qconfig.h with new one
    2745         ::SetFileAttributesA(outName.toLocal8Bit(), FILE_ATTRIBUTE_NORMAL);
     3010        ::SetFileAttributes(), FILE_ATTRIBUTE_NORMAL);
    27463011        QFile::remove(outName);
    27473012        tmpFile.copy(outName);
     
    27793044
    27803045    outName = defSpec + "/qmake.conf";
    2781     ::SetFileAttributesA(outName.toLocal8Bit(), FILE_ATTRIBUTE_NORMAL );
     3046    ::SetFileAttributes(), FILE_ATTRIBUTE_NORMAL );
    27823047    QFile qmakeConfFile(outName);
    27833048    if (qmakeConfFile.open(QFile::Append | QFile::WriteOnly | QFile::Text)) {
     
    27983063        tmpStream << "/* Licensed */" << endl
    27993064                  << "static const char qt_configure_licensee_str          [512 + 12] = \"qt_lcnsuser=" << licenseInfo["LICENSEE"] << "\";" << endl
    2800                   << "static const char qt_configure_licensed_products_str [512 + 12] = \"qt_lcnsprod=" << dictionary["EDITION"] << "\";" << endl;
     3065                  << "static const char qt_configure_licensed_products_str [512 + 12] = \"qt_lcnsprod=" << dictionary["EDITION"] << "\";" << endl
     3066                  << endl
     3067                  << "/* Build date */" << endl
     3068                  << "static const char qt_configure_installation          [11  + 12] = \"qt_instdate=" << QDate::currentDate().toString(Qt::ISODate) << "\";" << endl
     3069                  << endl;
    28013070        if(!dictionary[ "QT_HOST_PREFIX" ].isNull())
    28023071            tmpStream << "#if !defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE)" << endl;
     
    28473116
    28483117        // Replace old qconfig.cpp with new one
    2849         ::SetFileAttributesA(outName.toLocal8Bit(), FILE_ATTRIBUTE_NORMAL );
     3118        ::SetFileAttributes(), FILE_ATTRIBUTE_NORMAL );
    28503119        QFile::remove( outName );
    28513120        tmpFile2.copy(outName);
    28523121        tmpFile2.close();
     3122
     3123
     3124
     3125
     3126
     3127
     3128
     3129
     3130
     3131
     3132
     3133
     3134
     3135
     3136
     3137
     3138
     3139
    28533140    }
    28543141}
     
    29023189    cout << "Maketool...................." << dictionary[ "MAKE" ] << endl;
    29033190    cout << "Debug symbols..............." << (dictionary[ "BUILD" ] == "debug" ? "yes" : "no") << endl;
     3191
    29043192    cout << "Accessibility support......." << dictionary[ "ACCESSIBILITY" ] << endl;
    29053193    cout << "STL support................." << dictionary[ "STL" ] << endl;
     
    29123200    cout << "IWMMXT support.............." << dictionary[ "IWMMXT" ] << endl;
    29133201    cout << "OpenGL support.............." << dictionary[ "OPENGL" ] << endl;
    2914     cout << "Direct3D support............" << dictionary[ "DIRECT3D" ] << endl;
     3202    cout << "" ] << endl;
    29153203    cout << "OpenSSL support............." << dictionary[ "OPENSSL" ] << endl;
    29163204    cout << "QtDBus support.............." << dictionary[ "DBUS" ] << endl;
    29173205    cout << "QtXmlPatterns support......." << dictionary[ "XMLPATTERNS" ] << endl;
    29183206    cout << "Phonon support.............." << dictionary[ "PHONON" ] << endl;
     3207
    29193208    cout << "WebKit support.............." << dictionary[ "WEBKIT" ] << endl;
     3209
     3210
    29203211    cout << "QtScriptTools support......." << dictionary[ "SCRIPTTOOLS" ] << endl;
    29213212    cout << "Graphics System............." << dictionary[ "GRAPHICS_SYSTEM" ] << endl;
     
    29283219    cout << "    JPEG support............" << dictionary[ "JPEG" ] << endl;
    29293220    cout << "    PNG support............." << dictionary[ "PNG" ] << endl;
    2930     cout << "    MNG support............." << dictionary[ "MNG" ] << endl << endl;
     3221    cout << "    MNG support............." << dictionary[ "MNG" ] << endl;
     3222    cout << "    FreeType support........" << dictionary[ "FREETYPE" ] << endl << endl;
    29313223
    29323224    cout << "Styles:" << endl;
     
    29393231    cout << "    CDE....................." << dictionary[ "STYLE_CDE" ] << endl;
    29403232    cout << "    Windows CE.............." << dictionary[ "STYLE_WINDOWSCE" ] << endl;
    2941     cout << "    Windows Mobile.........." << dictionary[ "STYLE_WINDOWSMOBILE" ] << endl << endl;
     3233    cout << "    Windows Mobile.........." << dictionary[ "STYLE_WINDOWSMOBILE" ] << endl;
     3234    cout << "    S60....................." << dictionary[ "STYLE_S60" ] << endl << endl;
    29423235
    29433236    cout << "Sql Drivers:" << endl;
     
    29693262        cout << "Cetest support.............." << dictionary[ "CETEST" ] << endl;
    29703263        cout << "Signature..................." << dictionary[ "CE_SIGNATURE"] << endl << endl;
     3264
     3265
     3266
     3267
    29713268    }
    29723269
     
    31043401void Configure::buildHostTools()
    31053402{
     3403
     3404
     3405
    31063406    if (!dictionary.contains("XQMAKESPEC"))
    31073407        return;
     
    31103410    QStringList hostToolsDirs;
    31113411    hostToolsDirs
    3112         << "src/tools/bootstrap"
    3113         << "src/tools/moc"
    3114         << "src/tools/rcc"
    3115         << "src/tools/uic"
    3116         << "tools/checksdk";
     3412        << "src/tools"
     3413        << "
     3414
     3415   
     3416        << "tools/checksdk";
    31173417
    31183418    if (dictionary[ "CETEST" ] == "yes")
     
    33273627        cout << "Processing of project files have been disabled." << endl;
    33283628        cout << "Only use this option if you really know what you're doing." << endl << endl;
    3329         dictionary[ "DONE" ] = "yes";
    33303629        return;
    33313630    }
     
    33353634{
    33363635    QString make = dictionary[ "MAKE" ];
    3337     cout << endl << endl << "Qt is now configured for building. Just run " << qPrintable(make) << "." << endl;
    3338     cout << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl;
     3636    if (!dictionary.contains("XQMAKESPEC")) {
     3637        cout << endl << endl << "Qt is now configured for building. Just run " << qPrintable(make) << "." << endl;
     3638        cout << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl;
     3639    } else if(dictionary.value("QMAKESPEC").startsWith("wince")) {
     3640        // we are cross compiling for Windows CE
     3641        cout << endl << endl << "Qt is now configured for building. To start the build run:" << endl
     3642             << "\tsetcepaths " << dictionary.value("XQMAKESPEC") << endl
     3643             << "\t" << qPrintable(make) << endl
     3644             << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl;
     3645    } else { // Compiling for Symbian OS
     3646        cout << endl << endl << "Qt is now configured for building. To start the build run:" << qPrintable(dictionary["QTBUILDINSTRUCTION"]) << "." << endl
     3647        << "To reconfigure, run '" << qPrintable(dictionary["CONFCLEANINSTRUCTION"]) << "' and configure." << endl;
     3648    }
    33393649}
    33403650
     
    33783688    }
    33793689
     3690
    33803691    QString licenseFile = orgLicenseFile;
    33813692    QString theLicense;
    33823693    if (dictionary["EDITION"] == "OpenSource" || dictionary["EDITION"] == "Snapshot") {
    3383         theLicense = "GNU General Public License (GPL) version 3 \nor the GNU Lesser General Public License (LGPL) version 2.1";
     3694        haveGpl3 = QFile::exists(orgLicenseFile + "/LICENSE.GPL3");
     3695        theLicense = "GNU Lesser General Public License (LGPL) version 2.1";
     3696        if (haveGpl3)
     3697            theLicense += "\nor the GNU General Public License (GPL) version 3";
    33843698    } else {
    33853699        // the first line of the license file tells us which license it is
     
    33983712             << endl;
    33993713        if (dictionary["EDITION"] == "OpenSource" || dictionary["EDITION"] == "Snapshot") {
    3400             cout << "Type '3' to view the GNU General Public License version 3 (GPLv3)." << endl;
     3714            if (haveGpl3)
     3715                cout << "Type '3' to view the GNU General Public License version 3 (GPLv3)." << endl;
    34013716            cout << "Type 'L' to view the Lesser GNU General Public License version 2.1 (LGPLv2.1)." << endl;
    34023717        } else {
     
    34523767void Configure::readLicense()
    34533768{
    3454     dictionary[ "PLATFORM NAME" ]   = (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/src/corelib/kernel/qfunctions_wince.h")
    3455                                       && (dictionary.value("QMAKESPEC").startsWith("wince") || dictionary.value("XQMAKESPEC").startsWith("wince")))
    3456                                         ? "Qt for Windows CE" : "Qt for Windows";
     3769   if (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/src/corelib/kernel/qfunctions_wince.h") &&
     3770       (dictionary.value("QMAKESPEC").startsWith("wince") || dictionary.value("XQMAKESPEC").startsWith("wince")))
     3771        dictionary["PLATFORM NAME"] = "Qt for Windows CE";
     3772    else if (dictionary.value("XQMAKESPEC").startsWith("symbian"))
     3773        dictionary["PLATFORM NAME"] = "Qt for Symbian";
     3774    else
     3775        dictionary["PLATFORM NAME"] = "Qt for Windows";
     3776    dictionary["LICENSE FILE"] = sourcePath;
     3777
    34573778    bool openSource = false;
     3779
    34583780    if (dictionary["BUILDNOKIA"] == "yes" || dictionary["BUILDTYPE"] == "commercial") {
    34593781        openSource = false;
    34603782    } else if (dictionary["BUILDTYPE"] == "opensource") {
    34613783        openSource = true;
    3462     } else {
     3784    } else
    34633785        forever {
    34643786            char accept = '?';
     
    34783800        }
    34793801    }
    3480     if (openSource) {
    3481         dictionary["LICENSE FILE"] = sourcePath;
    3482         if (QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.GPL3") || QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.LGPL")) {
    3483             cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl;
    3484             licenseInfo["LICENSEE"] = "Open Source";
    3485             dictionary["EDITION"] = "OpenSource";
    3486             dictionary["QT_EDITION"] = "QT_EDITION_OPENSOURCE";
    3487             cout << endl;
    3488             if (!showLicense(dictionary["LICENSE FILE"])) {
    3489                 cout << "Configuration aborted since license was not accepted";
    3490                 dictionary["DONE"] = "error";
    3491                 return;
    3492             }
     3802    if (hasOpenSource && openSource) {
     3803        cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl;
     3804        licenseInfo["LICENSEE"] = "Open Source";
     3805        dictionary["EDITION"] = "OpenSource";
     3806        dictionary["QT_EDITION"] = "QT_EDITION_OPENSOURCE";
     3807        cout << endl;
     3808        if (!showLicense(dictionary["LICENSE FILE"])) {
     3809            cout << "Configuration aborted since license was not accepted";
     3810            dictionary["DONE"] = "error";
    34933811            return;
    34943812        }
    3495 #ifndef COMMERCIAL_VERSION
     3813    } else if (openSource) {
     3814        cout << endl << "Cannot find the GPL license files! Please download the Open Source version of the library." << endl;
     3815        dictionary["DONE"] = "error";
     3816    }
     3817#ifdef COMMERCIAL_VERSION
    34963818    else {
    3497         cout << endl << "Cannot find the GPL license files!" << endl;
    3498         dictionary["DONE"] = "error";
    3499     }
    3500 #else
    3501     } else {
    35023819        Tools::checkLicense(dictionary, licenseInfo, firstLicensePath());
    3503         if (dictionary["DONE"] != "error") {
     3820        if (dictionary["DONE"] != "error") {
    35043821            // give the user some feedback, and prompt for license acceptance
    35053822            cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " " << dictionary["EDITION"] << " Edition."<< endl << endl;
     
    35113828        }
    35123829    }
    3513 #endif // COMMERCIAL_VERSION
     3830#else // !COMMERCIAL_VERSION
     3831    else {
     3832        cout << endl << "Cannot build commercial edition from the open source version of the library." << endl;
     3833        dictionary["DONE"] = "error";
     3834    }
     3835#endif
    35143836}
    35153837
  • trunk/tools/configure/configureapp.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the tools applications of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    151151    bool filesDiffer(const QString &file1, const QString &file2);
    152152
    153     static bool findFile(const QString &fileName);
    154     static bool findFileInPaths(const QString &fileName, const QStringList &paths);
     153    bool findFile(const QString &fileName);
     154    static &paths);
    155155#if !defined(EVAL)
    156156    void reloadCmdLine();
  • trunk/tools/configure/environment.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the tools applications of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    147147
    148148    HKEY handle = 0;
    149     LONG res;
    150     QT_WA( {
    151         res = RegOpenKeyExW(parentHandle, (WCHAR*)rSubkeyPath.utf16(),
    152                             0, KEY_READ, &handle);
    153     } , {
    154         res = RegOpenKeyExA(parentHandle, rSubkeyPath.toLocal8Bit(),
    155                             0, KEY_READ, &handle);
    156     } );
    157 
     149    LONG res = RegOpenKeyEx(parentHandle, (wchar_t*)rSubkeyPath.utf16(), 0, KEY_READ, &handle);
    158150    if (res != ERROR_SUCCESS)
    159151        return QString();
     
    162154    DWORD dataType;
    163155    DWORD dataSize;
    164     QT_WA( {
    165         res = RegQueryValueExW(handle, (WCHAR*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize);
    166     }, {
    167         res = RegQueryValueExA(handle, rSubkeyName.toLocal8Bit(), 0, &dataType, 0, &dataSize);
    168     } );
     156    res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize);
    169157    if (res != ERROR_SUCCESS) {
    170158        RegCloseKey(handle);
     
    174162    // get the value
    175163    QByteArray data(dataSize, 0);
    176     QT_WA( {
    177         res = RegQueryValueExW(handle, (WCHAR*)rSubkeyName.utf16(), 0, 0,
    178                                reinterpret_cast<unsigned char*>(data.data()), &dataSize);
    179     }, {
    180         res = RegQueryValueExA(handle, rSubkeyName.toLocal8Bit(), 0, 0,
    181                                reinterpret_cast<unsigned char*>(data.data()), &dataSize);
    182     } );
     164    res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, 0,
     165                           reinterpret_cast<unsigned char*>(data.data()), &dataSize);
    183166    if (res != ERROR_SUCCESS) {
    184167        RegCloseKey(handle);
     
    190173        case REG_EXPAND_SZ:
    191174        case REG_SZ: {
    192             QT_WA( {
    193                 result = QString::fromUtf16(((const ushort*)data.constData()));
    194             }, {
    195                 result = QString::fromLatin1(data.constData());
    196             } );
     175            result = QString::fromWCharArray(((const wchar_t *)data.constData()));
    197176            break;
    198177        }
     
    202181            int i = 0;
    203182            for (;;) {
    204                 QString s;
    205                 QT_WA( {
    206                     s = QString::fromUtf16((const ushort*)data.constData() + i);
    207                 }, {
    208                     s = QString::fromLatin1(data.constData() + i);
    209                 } );
     183                QString s = QString::fromWCharArray((const wchar_t *)data.constData() + i);
    210184                i += s.length() + 1;
    211185
     
    214188                l.append(s);
    215189            }
    216             result = l.join(", ");
     190    result = l.join(", ");
    217191            break;
    218192        }
     
    220194        case REG_NONE:
    221195        case REG_BINARY: {
    222             QT_WA( {
    223                 result = QString::fromUtf16((const ushort*)data.constData(), data.size()/2);
    224             }, {
    225                 result = QString::fromLatin1(data.constData(), data.size());
    226             } );
     196            result = QString::fromWCharArray((const wchar_t *)data.constData(), data.size() / 2);
    227197            break;
    228198        }
     
    233203            int i;
    234204            memcpy((char*)&i, data.constData(), sizeof(int));
    235             result = QString::number(i);
     205    result = QString::number(i);
    236206            break;
    237207        }
     
    351321    memset(&procInfo, 0, sizeof(procInfo));
    352322
    353     bool couldExecute;
    354     QT_WA({
    355         // Unicode version
    356         STARTUPINFOW startInfo;
    357         memset(&startInfo, 0, sizeof(startInfo));
    358         startInfo.cb = sizeof(startInfo);
    359 
    360         couldExecute = CreateProcessW(0, (WCHAR*)executable.utf16(),
     323    STARTUPINFO startInfo;
     324    memset(&startInfo, 0, sizeof(startInfo));
     325    startInfo.cb = sizeof(startInfo);
     326
     327    bool couldExecute = CreateProcess(0, (wchar_t*)executable.utf16(),
    361328                                      0, 0, false,
    362329                                      CREATE_NO_WINDOW | CREATE_SUSPENDED,
    363330                                      0, 0, &startInfo, &procInfo);
    364 
    365     }, {
    366         // Ansi version
    367         STARTUPINFOA startInfo;
    368         memset(&startInfo, 0, sizeof(startInfo));
    369         startInfo.cb = sizeof(startInfo);
    370 
    371         couldExecute = CreateProcessA(0, executable.toLocal8Bit().data(),
    372                                       0, 0, false,
    373                                       CREATE_NO_WINDOW | CREATE_SUSPENDED,
    374                                       0, 0, &startInfo, &procInfo);
    375     })
    376331
    377332    if (couldExecute) {
     
    422377
    423378/*!
    424     Creates a QByteArray of the \a environment in either UNICODE or
    425     ansi representation.
     379    Creates a QByteArray of the \a environment.
    426380*/
    427381static QByteArray qt_create_environment(const QStringList &environment)
    428382{
    429383    QByteArray envlist;
    430     if (!environment.isEmpty()) {
    431         int pos = 0;
    432         // add PATH if necessary (for DLL loading)
    433         QByteArray path = qgetenv("PATH");
    434         QT_WA({
    435             if (environment.filter(QRegExp("^PATH=",Qt::CaseInsensitive)).isEmpty()
    436                 && !path.isNull()) {
    437                 QString tmp = QString(QLatin1String("PATH=%1")).arg(QString::fromLocal8Bit(path));
    438                 uint tmpSize = sizeof(TCHAR) * (tmp.length()+1);
    439                 envlist.resize(envlist.size() + tmpSize );
    440                 memcpy(envlist.data()+pos, tmp.utf16(), tmpSize);
    441                 pos += tmpSize;
    442             }
    443             // add the user environment
    444             for (QStringList::ConstIterator it = environment.begin(); it != environment.end(); it++ ) {
    445                 QString tmp = *it;
    446                 uint tmpSize = sizeof(TCHAR) * (tmp.length()+1);
    447                 envlist.resize(envlist.size() + tmpSize);
    448                 memcpy(envlist.data()+pos, tmp.utf16(), tmpSize);
    449                 pos += tmpSize;
    450             }
    451             // add the 2 terminating 0 (actually 4, just to be on the safe side)
    452             envlist.resize( envlist.size()+4 );
    453             envlist[pos++] = 0;
    454             envlist[pos++] = 0;
    455             envlist[pos++] = 0;
    456             envlist[pos++] = 0;
    457         }, {
    458             if (environment.filter(QRegExp("^PATH=",Qt::CaseInsensitive)).isEmpty() && !path.isNull()) {
    459                 QByteArray tmp = QString("PATH=%1").arg(QString::fromLocal8Bit(path)).toLocal8Bit();
    460                 uint tmpSize = tmp.length() + 1;
    461                 envlist.resize(envlist.size() + tmpSize);
    462                 memcpy(envlist.data()+pos, tmp.data(), tmpSize);
    463                 pos += tmpSize;
    464             }
    465             // add the user environment
    466             for (QStringList::ConstIterator it = environment.begin(); it != environment.end(); it++) {
    467                 QByteArray tmp = (*it).toLocal8Bit();
    468                 uint tmpSize = tmp.length() + 1;
    469                 envlist.resize(envlist.size() + tmpSize);
    470                 memcpy(envlist.data()+pos, tmp.data(), tmpSize);
    471                 pos += tmpSize;
    472             }
    473             // add the terminating 0 (actually 2, just to be on the safe side)
    474             envlist.resize(envlist.size()+2);
    475             envlist[pos++] = 0;
    476             envlist[pos++] = 0;
    477         })
    478     }
     384    if (environment.isEmpty())
     385        return envlist;
     386
     387    int pos = 0;
     388    // add PATH if necessary (for DLL loading)
     389    QByteArray path = qgetenv("PATH");
     390    if (environment.filter(QRegExp("^PATH=",Qt::CaseInsensitive)).isEmpty() && !path.isNull()) {
     391            QString tmp = QString(QLatin1String("PATH=%1")).arg(QString::fromLocal8Bit(path));
     392            uint tmpSize = sizeof(wchar_t) * (tmp.length() + 1);
     393            envlist.resize(envlist.size() + tmpSize);
     394            memcpy(envlist.data() + pos, tmp.utf16(), tmpSize);
     395            pos += tmpSize;
     396    }
     397    // add the user environment
     398    for (QStringList::ConstIterator it = environment.begin(); it != environment.end(); it++ ) {
     399            QString tmp = *it;
     400            uint tmpSize = sizeof(wchar_t) * (tmp.length() + 1);
     401            envlist.resize(envlist.size() + tmpSize);
     402            memcpy(envlist.data() + pos, tmp.utf16(), tmpSize);
     403            pos += tmpSize;
     404    }
     405    // add the 2 terminating 0 (actually 4, just to be on the safe side)
     406    envlist.resize(envlist.size() + 4);
     407    envlist[pos++] = 0;
     408    envlist[pos++] = 0;
     409    envlist[pos++] = 0;
     410    envlist[pos++] = 0;
    479411
    480412    return envlist;
     
    502434    qDebug() << "   " << removeEnv;
    503435#endif
    504 // GetEnvironmentStrings is defined to GetEnvironmentStringsW when
    505 // UNICODE is defined. We cannot use that, since we need to
    506 // destinguish between unicode and ansi versions of the functions.
    507 #if defined(UNICODE) && defined(GetEnvironmentStrings)
    508 #undef GetEnvironmentStrings
    509 #endif
    510 
    511436    // Create the full environment from the current environment and
    512437    // the additionalEnv strings, then remove all variables defined
    513438    // in removeEnv
    514439    QMap<QString, QString> fullEnvMap;
    515     QT_WA({
    516         LPWSTR envStrings = GetEnvironmentStringsW();
    517         if (envStrings) {
    518             int strLen = 0;
    519             for (LPWSTR envString = envStrings; *(envString); envString += strLen + 1) {
    520                 strLen = wcslen(envString);
    521                 QString str = QString((const QChar*)envString, strLen);
    522                 if (!str.startsWith("=")) { // These are added by the system
    523                     int sepIndex = str.indexOf('=');
    524                     fullEnvMap.insert(str.left(sepIndex).toUpper(), str.mid(sepIndex +1));
    525                 }
     440    LPWSTR envStrings = GetEnvironmentStrings();
     441    if (envStrings) {
     442        int strLen = 0;
     443        for (LPWSTR envString = envStrings; *(envString); envString += strLen + 1) {
     444            strLen = wcslen(envString);
     445            QString str = QString((const QChar*)envString, strLen);
     446            if (!str.startsWith("=")) { // These are added by the system
     447                int sepIndex = str.indexOf('=');
     448                fullEnvMap.insert(str.left(sepIndex).toUpper(), str.mid(sepIndex +1));
    526449            }
    527450        }
    528         FreeEnvironmentStringsW(envStrings);
    529     }, {
    530         LPSTR envStrings = GetEnvironmentStrings();
    531         if (envStrings) {
    532             int strLen = 0;
    533             for (LPSTR envString = envStrings; *(envString); envString += strLen + 1) {
    534                 strLen = strlen(envString);
    535                 QString str = QLatin1String(envString);
    536                 if (!str.startsWith("=")) { // These are added by the system
    537                     int sepIndex = str.indexOf('=');
    538                     fullEnvMap.insert(str.left(sepIndex).toUpper(), str.mid(sepIndex +1));
    539                 }
    540             }
    541         }
    542         FreeEnvironmentStringsA(envStrings);
    543     })
     451    }
     452    FreeEnvironmentStrings(envStrings);
     453
    544454    // Add additionalEnv variables
    545455    for (int i = 0; i < additionalEnv.count(); ++i) {
     
    570480    memset(&procInfo, 0, sizeof(procInfo));
    571481
    572     bool couldExecute;
    573     QT_WA({
    574         // Unicode version
    575         STARTUPINFOW startInfo;
    576         memset(&startInfo, 0, sizeof(startInfo));
    577         startInfo.cb = sizeof(startInfo);
    578 
    579         couldExecute = CreateProcessW(0, (WCHAR*)args.utf16(),
     482    STARTUPINFO startInfo;
     483    memset(&startInfo, 0, sizeof(startInfo));
     484    startInfo.cb = sizeof(startInfo);
     485
     486    bool couldExecute = CreateProcess(0, (wchar_t*)args.utf16(),
    580487                                      0, 0, true, CREATE_UNICODE_ENVIRONMENT,
    581488                                      envlist.isEmpty() ? 0 : envlist.data(),
    582489                                      0, &startInfo, &procInfo);
    583     }, {
    584         // Ansi version
    585         STARTUPINFOA startInfo;
    586         memset(&startInfo, 0, sizeof(startInfo));
    587         startInfo.cb = sizeof(startInfo);
    588 
    589         couldExecute = CreateProcessA(0, args.toLocal8Bit().data(),
    590                                       0, 0, true, 0,
    591                                       envlist.isEmpty() ? 0 : envlist.data(),
    592                                       0, &startInfo, &procInfo);
    593     })
    594490
    595491    if (couldExecute) {
     
    655551            QFile::remove(destFile);
    656552            intermediate = QFile::copy(entry.absoluteFilePath(), destFile);
    657             SetFileAttributesA(destFile.toLocal8Bit(), FILE_ATTRIBUTE_NORMAL);
     553            SetFileAttributes(), FILE_ATTRIBUTE_NORMAL);
    658554        }
    659555        if(!intermediate) {
  • trunk/tools/configure/environment.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the tools applications of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/configure/main.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the tools applications of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    9393    if( !app.isDone() )
    9494        app.buildQmake();
    95     if( !app.isOk() )
    96         return 2;
    9795#endif
    9896    if( !app.isDone() )
    9997        app.generateMakefiles();
    100     if( app.isOk() )
     98    if( () )
    10199        app.buildHostTools();
    102100    if( !app.isDone() )
    103101        app.showSummary();
     102
     103
    104104
    105105    return 0;
  • trunk/tools/configure/tools.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the tools applications of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5959                         const QString &path)
    6060{
     61
     62
     63
     64
     65
     66
     67
    6168    QString tpLicense = dictionary["QT_SOURCE_TREE"] + "/LICENSE.PREVIEW.OPENSOURCE";
    6269    if (QFile::exists(tpLicense)) {
     
    104111    // Verify license info...
    105112    QString licenseKey = licenseInfo["LICENSEKEYEXT"];
    106     const char * clicenseKey = licenseKey.toLatin1();
     113    clicenseKey = licenseKey.toLatin1();
    107114    //We check the licence
    108 #ifndef _WIN32_WCE
    109         char *buffer = strdup(clicenseKey);
    110 #else
    111         char *buffer = (char*) malloc(strlen(clicenseKey) + 1);
    112         strcpy(buffer, clicenseKey);
    113 #endif
    114115    static const char * const SEP = "-";
    115116    char *licenseParts[NUMBER_OF_PARTS];
    116117    int partNumber = 0;
    117     for (char *part = strtok(buffer, SEP); part != 0; part = strtok(0, SEP))
     118    for (char *part = strtok(, SEP); part != 0; part = strtok(0, SEP))
    118119        licenseParts[partNumber++] = part;
    119120    if (partNumber < (NUMBER_OF_PARTS-1)) {
    120121        dictionary["DONE"] = "error";
    121122        cout << "License file does not contain proper license key." <<partNumber<< endl;
    122         free(buffer);
    123123        return;
    124124    }
    125125
    126126    char products = licenseParts[0][0];
    127     char platforms = licenseParts[1][0];
     127    char];
    128128    char* licenseSchema = licenseParts[2];
    129129    char licenseFeatures = licenseParts[3][0];
     
    143143            dictionary["QT_EDITION"] = "QT_EDITION_DESKTOPLIGHT";
    144144        }
    145 
    146         if (platforms == 'X') {
    147             dictionary["LICENSE_EXTENSION"] = "-ALLOS";
    148         } else if (strchr("3679ACDEHJKMSUWX", platforms)) {
    149             dictionary["LICENSE_EXTENSION"] = "-EMBEDDED";
    150         } else if (strchr("4BFPQRTY", platforms)) {
    151             dictionary["LICENSE_EXTENSION"] = "-DESKTOP";
    152         }
    153145    } else if (strcmp(licenseSchema,"Z4M") == 0 || strcmp(licenseSchema,"R4M") == 0 || strcmp(licenseSchema,"Q4M") == 0) {
    154146        if (products == 'B') {
    155147            dictionary["EDITION"] = "Evaluation";
    156148            dictionary["QT_EDITION"] = "QT_EDITION_EVALUATION";
    157             dictionary["LICENSE_EXTENSION"] = "-EVALUATION";
    158         }
    159     }
     149        }
     150    }
     151
     152    if (platforms[2] == 'L') {
     153        static const char src[] = "8NPQRTZ";
     154        static const char dst[] = "UCWX9M7";
     155        const char *p = strchr(src, platforms[1]);
     156        platforms[1] = dst[p - src];
     157    }
     158
     159#define PL(a,b) (int(a)+int(b)*256)
     160    int platformCode = PL(platforms[0],platforms[1]);
     161    switch (platformCode) {
     162    case PL('X','9'):
     163    case PL('X','C'):
     164    case PL('X','U'):
     165    case PL('X','W'):
     166        case PL('X','M'): // old license key
     167        dictionary["LICENSE_EXTENSION"] = "-ALLOS";
     168        break;
     169
     170    case PL('6', 'M'):
     171    case PL('8', 'M'):
     172        case PL('K', 'M'): // old license key
     173    case PL('N', '7'):
     174    case PL('N', '9'):
     175    case PL('N', 'X'):
     176    case PL('S', '9'):
     177    case PL('S', 'C'):
     178    case PL('S', 'U'):
     179    case PL('S', 'W'):
     180        dictionary["LICENSE_EXTENSION"] = "-EMBEDDED";
     181        if (dictionary["PLATFORM NAME"].contains("Windows CE")
     182            && platformCode != PL('6', 'M') && platformCode != PL('S', '9')
     183            && platformCode != PL('S', 'C') && platformCode != PL('S', 'U')
     184            && platformCode != PL('S', 'W') && platformCode != PL('K', 'M')) {
     185            dictionary["DONE"] = "error";
     186        } else if (dictionary["PLATFORM NAME"].contains("Symbian")
     187                   && platformCode != PL('N', '9') && platformCode != PL('S', '9')
     188                   && platformCode != PL('S', 'C') && platformCode != PL('S', 'U')
     189                   && platformCode != PL('S', 'W')) {
     190            dictionary["DONE"] = "error";
     191        }
     192        break;
     193    case PL('R', 'M'):
     194    case PL('F', 'M'):
     195        dictionary["LICENSE_EXTENSION"] = "-DESKTOP";
     196        if (!dictionary["PLATFORM NAME"].endsWith("Windows")) {
     197            dictionary["DONE"] = "error";
     198        }
     199        break;
     200    default:
     201        dictionary["DONE"] = "error";
     202        break;
     203    }
     204#undef PL
     205
     206    if (dictionary.value("DONE") == "error") {
     207        cout << "You are not licensed for the " << dictionary["PLATFORM NAME"] << " platform." << endl << endl;
     208        cout << "Please contact [email protected] to upgrade your license" << endl;
     209        cout << "to include the " << dictionary["PLATFORM NAME"] << " platform, or install the" << endl;
     210        cout << "Qt Open Source Edition if you intend to develop free software." << endl;
     211        return;
     212    }
     213
     214    // Override for evaluation licenses
     215    if (dictionary["Edition"] == "Evaluation")
     216        dictionary["LICENSE_EXTENSION"] = "-EVALUATION";
    160217
    161218    if (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/.LICENSE")) {
     
    174231    }
    175232
    176     if (dictionary["PLATFORM NAME"].contains("Windows CE")) {
    177         // verify that we are licensed to use Qt for Windows CE
    178         if (dictionary["LICENSE_EXTENSION"] != "-EMBEDDED" && dictionary["LICENSE_EXTENSION"] != "-ALLOS") {
    179             cout << "You are not licensed for the " << dictionary["PLATFORM NAME"] << " platform." << endl << endl;
    180             cout << "Please contact [email protected] to upgrade your license" << endl;
    181             cout << "to include the " << dictionary["PLATFORM NAME"] << " platform, or install the" << endl;
    182             cout << "Qt Open Source Edition if you intend to develop free software." << endl;
    183             dictionary["DONE"] = "error";
    184             return;
    185         }
    186     }
    187 
    188233    // copy one of .LICENSE-*(-US) to LICENSE
    189234    QString toLicenseFile   = dictionary["QT_SOURCE_TREE"] + "/LICENSE";
    190235    QString fromLicenseFile = dictionary["QT_SOURCE_TREE"] + "/.LICENSE" + dictionary["LICENSE_EXTENSION"];
    191     if (licenseFeatures == 'G') //US
     236    if (licenseFeatures == 'B' || licenseFeatures == 'G'
     237        || licenseFeatures == 'L' || licenseFeatures == 'Y')
    192238        fromLicenseFile += "-US";
    193239
    194     if (licenseFeatures == '5') //Floating
    195         dictionary["METERED LICENSE"] = "true";
    196 
    197     if (!CopyFileA(QDir::toNativeSeparators(fromLicenseFile).toLocal8Bit(),
    198         QDir::toNativeSeparators(toLicenseFile).toLocal8Bit(), FALSE)) {
     240    if (!CopyFile((wchar_t*)QDir::toNativeSeparators(fromLicenseFile).utf16(),
     241        (wchar_t*)QDir::toNativeSeparators(toLicenseFile).utf16(), FALSE)) {
    199242        cout << "Failed to copy license file (" << fromLicenseFile << ")";
    200243        dictionary["DONE"] = "error";
     
    202245    }
    203246    dictionary["LICENSE FILE"] = toLicenseFile;
    204     free(buffer);
    205247}
    206248
  • trunk/tools/configure/tools.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the tools applications of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
Note: See TracChangeset for help on using the changeset viewer.