tools/configure/configureapp.cpp
branchGCC_SURGE
changeset 31 5daf16870df6
parent 30 5dc02b23752f
child 33 3e2da88830cd
equal deleted inserted replaced
27:93b982ccede2 31:5daf16870df6
   193                        << "set QTDIR=" << QDir::toNativeSeparators(buildPath) << endl;
   193                        << "set QTDIR=" << QDir::toNativeSeparators(buildPath) << endl;
   194                 syncqt_bat.close();
   194                 syncqt_bat.close();
   195             }
   195             }
   196         }
   196         }
   197 
   197 
       
   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 
   198         // For Windows CE and shadow builds we need to copy these to the
   226         // For Windows CE and shadow builds we need to copy these to the
   199         // build directory.
   227         // build directory.
   200         QFile::copy(sourcePath + "/bin/setcepaths.bat" , buildPath + "/bin/setcepaths.bat");
   228         QFile::copy(sourcePath + "/bin/setcepaths.bat" , buildPath + "/bin/setcepaths.bat");
   201 
       
   202         //copy the mkspecs
   229         //copy the mkspecs
   203         buildDir.mkpath("mkspecs");
   230         buildDir.mkpath("mkspecs");
   204         if(!Environment::cpdir(sourcePath + "/mkspecs", buildPath + "/mkspecs")){
   231         if(!Environment::cpdir(sourcePath + "/mkspecs", buildPath + "/mkspecs")){
   205             cout << "Couldn't copy mkspecs!" << sourcePath << " " << buildPath << endl;
   232             cout << "Couldn't copy mkspecs!" << sourcePath << " " << buildPath << endl;
   206             dictionary["DONE"] = "error";
   233             dictionary["DONE"] = "error";
   246     dictionary[ "XMLPATTERNS" ]     = "auto";
   273     dictionary[ "XMLPATTERNS" ]     = "auto";
   247     dictionary[ "PHONON" ]          = "auto";
   274     dictionary[ "PHONON" ]          = "auto";
   248     dictionary[ "PHONON_BACKEND" ]  = "yes";
   275     dictionary[ "PHONON_BACKEND" ]  = "yes";
   249     dictionary[ "MULTIMEDIA" ]      = "yes";
   276     dictionary[ "MULTIMEDIA" ]      = "yes";
   250     dictionary[ "AUDIO_BACKEND" ]   = "auto";
   277     dictionary[ "AUDIO_BACKEND" ]   = "auto";
       
   278     dictionary[ "WMSDK" ]           = "auto";
   251     dictionary[ "DIRECTSHOW" ]      = "no";
   279     dictionary[ "DIRECTSHOW" ]      = "no";
   252     dictionary[ "WEBKIT" ]          = "auto";
   280     dictionary[ "WEBKIT" ]          = "auto";
   253     dictionary[ "DECLARATIVE" ]     = "auto";
   281     dictionary[ "DECLARATIVE" ]     = "auto";
   254     dictionary[ "PLUGIN_MANIFESTS" ] = "yes";
   282     dictionary[ "PLUGIN_MANIFESTS" ] = "yes";
   255 
   283 
   699         else if( configCmdLine.at(i) == "-no-opengl" ) {
   727         else if( configCmdLine.at(i) == "-no-opengl" ) {
   700             dictionary[ "OPENGL" ]    = "no";
   728             dictionary[ "OPENGL" ]    = "no";
   701         } else if ( configCmdLine.at(i) == "-opengl-es-cm" ) {
   729         } else if ( configCmdLine.at(i) == "-opengl-es-cm" ) {
   702             dictionary[ "OPENGL" ]          = "yes";
   730             dictionary[ "OPENGL" ]          = "yes";
   703             dictionary[ "OPENGL_ES_CM" ]    = "yes";
   731             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" ) {
   732         } else if ( configCmdLine.at(i) == "-opengl-es-2" ) {
   708             dictionary[ "OPENGL" ]          = "yes";
   733             dictionary[ "OPENGL" ]          = "yes";
   709             dictionary[ "OPENGL_ES_2" ]     = "yes";
   734             dictionary[ "OPENGL_ES_2" ]     = "yes";
   710         }
   735         }
   711 
   736 
   962         else if( configCmdLine.at(i) == "-qtnamespace" ) {
   987         else if( configCmdLine.at(i) == "-qtnamespace" ) {
   963             ++i;
   988             ++i;
   964             if(i==argCount)
   989             if(i==argCount)
   965                 break;
   990                 break;
   966             qmakeDefines += "QT_NAMESPACE="+configCmdLine.at(i);
   991             qmakeDefines += "QT_NAMESPACE="+configCmdLine.at(i);
       
   992             dictionary[ "QT_NAMESPACE" ] = configCmdLine.at(i);
   967         } else if( configCmdLine.at(i) == "-qtlibinfix" ) {
   993         } else if( configCmdLine.at(i) == "-qtlibinfix" ) {
   968             ++i;
   994             ++i;
   969             if(i==argCount)
   995             if(i==argCount)
   970                 break;
   996                 break;
   971             dictionary[ "QT_LIBINFIX" ] = configCmdLine.at(i);
   997             dictionary[ "QT_LIBINFIX" ] = configCmdLine.at(i);
  1069             if(i==argCount)
  1095             if(i==argCount)
  1070                 break;
  1096                 break;
  1071             dictionary[ "QT_INSTALL_PLUGINS" ] = configCmdLine.at(i);
  1097             dictionary[ "QT_INSTALL_PLUGINS" ] = configCmdLine.at(i);
  1072         }
  1098         }
  1073 
  1099 
       
  1100         else if( configCmdLine.at(i) == "-importdir" ) {
       
  1101             ++i;
       
  1102             if(i==argCount)
       
  1103                 break;
       
  1104             dictionary[ "QT_INSTALL_IMPORTS" ] = configCmdLine.at(i);
       
  1105         }
  1074         else if( configCmdLine.at(i) == "-datadir" ) {
  1106         else if( configCmdLine.at(i) == "-datadir" ) {
  1075             ++i;
  1107             ++i;
  1076             if(i==argCount)
  1108             if(i==argCount)
  1077                 break;
  1109                 break;
  1078             dictionary[ "QT_INSTALL_DATA" ] = configCmdLine.at(i);
  1110             dictionary[ "QT_INSTALL_DATA" ] = configCmdLine.at(i);
  1169             dictionary[ "QMAKESPEC" ].endsWith( "-msvc" ) ||
  1201             dictionary[ "QMAKESPEC" ].endsWith( "-msvc" ) ||
  1170             dictionary[ "QMAKESPEC" ].endsWith( "-msvc.net" ) ||
  1202             dictionary[ "QMAKESPEC" ].endsWith( "-msvc.net" ) ||
  1171             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2002" ) ||
  1203             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2002" ) ||
  1172             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2003" ) ||
  1204             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2003" ) ||
  1173             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2005" ) ||
  1205             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2005" ) ||
  1174             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2008" )) {
  1206             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2008" ) ||
       
  1207             dictionary[ "QMAKESPEC" ].endsWith( "-msvc2010" )) {
  1175             if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "nmake";
  1208             if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "nmake";
  1176             dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
  1209             dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
  1177         } else if ( dictionary[ "QMAKESPEC" ] == QString( "win32-g++" ) ) {
  1210         } else if ( dictionary[ "QMAKESPEC" ] == QString( "win32-g++" ) ) {
  1178             if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "mingw32-make";
  1211             if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "mingw32-make";
  1179             if (Environment::detectExecutable("sh.exe")) {
  1212             if (Environment::detectExecutable("sh.exe")) {
  1489         dictionary[ "QT_ICONV" ]            = "no";
  1522         dictionary[ "QT_ICONV" ]            = "no";
  1490         dictionary[ "SCRIPTTOOLS" ]         = "no";
  1523         dictionary[ "SCRIPTTOOLS" ]         = "no";
  1491         dictionary[ "QT_HOST_PREFIX" ]      = dictionary[ "QT_INSTALL_PREFIX" ];
  1524         dictionary[ "QT_HOST_PREFIX" ]      = dictionary[ "QT_INSTALL_PREFIX" ];
  1492         dictionary[ "QT_INSTALL_PREFIX" ]   = "";
  1525         dictionary[ "QT_INSTALL_PREFIX" ]   = "";
  1493         dictionary[ "QT_INSTALL_PLUGINS" ]  = "\\resource\\qt\\plugins";
  1526         dictionary[ "QT_INSTALL_PLUGINS" ]  = "\\resource\\qt\\plugins";
       
  1527         dictionary[ "QT_INSTALL_IMPORTS" ]  = "\\resource\\qt\\imports";
  1494         dictionary[ "QT_INSTALL_TRANSLATIONS" ]  = "\\resource\\qt\\translations";
  1528         dictionary[ "QT_INSTALL_TRANSLATIONS" ]  = "\\resource\\qt\\translations";
  1495         dictionary[ "ARM_FPU_TYPE" ]        = "softvfp";
  1529         dictionary[ "ARM_FPU_TYPE" ]        = "softvfp";
  1496         dictionary[ "SQL_SQLITE" ]          = "yes";
  1530         dictionary[ "SQL_SQLITE" ]          = "yes";
  1497         dictionary[ "SQL_SQLITE_LIB" ]      = "system";
  1531         dictionary[ "SQL_SQLITE_LIB" ]      = "system";
  1498 
  1532 
  1517         dictionary[ "QT_CUPS" ]             = "no";
  1551         dictionary[ "QT_CUPS" ]             = "no";
  1518         dictionary[ "QT_GLIB" ]             = "no";
  1552         dictionary[ "QT_GLIB" ]             = "no";
  1519         dictionary[ "QT_ICONV" ]            = "no";
  1553         dictionary[ "QT_ICONV" ]            = "no";
  1520 
  1554 
  1521         dictionary["DECORATIONS"]           = "default windows styled";
  1555         dictionary["DECORATIONS"]           = "default windows styled";
  1522         dictionary[ "QMAKEADDITIONALARGS" ] = "-unix";
       
  1523     }
  1556     }
  1524 }
  1557 }
  1525 
  1558 
  1526 QString Configure::locateFileInPaths(const QString &fileName, const QStringList &paths)
  1559 QString Configure::locateFileInPaths(const QString &fileName, const QStringList &paths)
  1527 {
  1560 {
  1566 {
  1599 {
  1567     if( dictionary[ "HELP" ] == "yes" ) {
  1600     if( dictionary[ "HELP" ] == "yes" ) {
  1568         desc("Usage: configure [-buildkey <key>]\n"
  1601         desc("Usage: configure [-buildkey <key>]\n"
  1569 //      desc("Usage: configure [-prefix dir] [-bindir <dir>] [-libdir <dir>]\n"
  1602 //      desc("Usage: configure [-prefix dir] [-bindir <dir>] [-libdir <dir>]\n"
  1570 //                  "[-docdir <dir>] [-headerdir <dir>] [-plugindir <dir>]\n"
  1603 //                  "[-docdir <dir>] [-headerdir <dir>] [-plugindir <dir>]\n"
  1571 //                  "[-datadir <dir>] [-translationdir <dir>]\n"
  1604 //                  "[-importdir <dir>] [-datadir <dir>] [-translationdir <dir>]\n"
  1572 //                  "[-examplesdir <dir>] [-demosdir <dir>][-buildkey <key>]\n"
  1605 //                  "[-examplesdir <dir>] [-demosdir <dir>][-buildkey <key>]\n"
  1573                     "[-release] [-debug] [-debug-and-release] [-shared] [-static]\n"
  1606                     "[-release] [-debug] [-debug-and-release] [-shared] [-static]\n"
  1574                     "[-no-fast] [-fast] [-no-exceptions] [-exceptions]\n"
  1607                     "[-no-fast] [-fast] [-no-exceptions] [-exceptions]\n"
  1575                     "[-no-accessibility] [-accessibility] [-no-rtti] [-rtti]\n"
  1608                     "[-no-accessibility] [-accessibility] [-no-rtti] [-rtti]\n"
  1576                     "[-no-stl] [-stl] [-no-sql-<driver>] [-qt-sql-<driver>]\n"
  1609                     "[-no-stl] [-stl] [-no-sql-<driver>] [-qt-sql-<driver>]\n"
  1606         desc(                   "-bindir <dir>",        "Executables will be installed to dir\n(default PREFIX/bin)");
  1639         desc(                   "-bindir <dir>",        "Executables will be installed to dir\n(default PREFIX/bin)");
  1607         desc(                   "-libdir <dir>",        "Libraries will be installed to dir\n(default PREFIX/lib)");
  1640         desc(                   "-libdir <dir>",        "Libraries will be installed to dir\n(default PREFIX/lib)");
  1608         desc(                   "-docdir <dir>",        "Documentation will be installed to dir\n(default PREFIX/doc)");
  1641         desc(                   "-docdir <dir>",        "Documentation will be installed to dir\n(default PREFIX/doc)");
  1609         desc(                   "-headerdir <dir>",     "Headers will be installed to dir\n(default PREFIX/include)");
  1642         desc(                   "-headerdir <dir>",     "Headers will be installed to dir\n(default PREFIX/include)");
  1610         desc(                   "-plugindir <dir>",     "Plugins will be installed to dir\n(default PREFIX/plugins)");
  1643         desc(                   "-plugindir <dir>",     "Plugins will be installed to dir\n(default PREFIX/plugins)");
       
  1644         desc(                   "-importdir <dir>",     "Imports for QML will be installed to dir\n(default PREFIX/imports)");
  1611         desc(                   "-datadir <dir>",       "Data used by Qt programs will be installed to dir\n(default PREFIX)");
  1645         desc(                   "-datadir <dir>",       "Data used by Qt programs will be installed to dir\n(default PREFIX)");
  1612         desc(                   "-translationdir <dir>","Translations of Qt programs will be installed to dir\n(default PREFIX/translations)\n");
  1646         desc(                   "-translationdir <dir>","Translations of Qt programs will be installed to dir\n(default PREFIX/translations)\n");
  1613         desc(                   "-examplesdir <dir>",   "Examples will be installed to dir\n(default PREFIX/examples)");
  1647         desc(                   "-examplesdir <dir>",   "Examples will be installed to dir\n(default PREFIX/examples)");
  1614         desc(                   "-demosdir <dir>",      "Demos will be installed to dir\n(default PREFIX/demos)");
  1648         desc(                   "-demosdir <dir>",      "Demos will be installed to dir\n(default PREFIX/demos)");
  1615 */
  1649 */
  1827         desc(                      "-crt <path>",          "Specify path to C runtime used for project generation.");
  1861         desc(                      "-crt <path>",          "Specify path to C runtime used for project generation.");
  1828         desc("CETEST", "no",       "-no-cetest",           "Do not compile Windows CE remote test application");
  1862         desc("CETEST", "no",       "-no-cetest",           "Do not compile Windows CE remote test application");
  1829         desc("CETEST", "yes",      "-cetest",              "Compile Windows CE remote test application");
  1863         desc("CETEST", "yes",      "-cetest",              "Compile Windows CE remote test application");
  1830         desc(                      "-signature <file>",    "Use file for signing the target project");
  1864         desc(                      "-signature <file>",    "Use file for signing the target project");
  1831         desc("OPENGL_ES_CM", "no", "-opengl-es-cm",        "Enable support for OpenGL ES Common");
  1865         desc("OPENGL_ES_CM", "no", "-opengl-es-cm",        "Enable support for OpenGL ES Common");
  1832         desc("OPENGL_ES_CL", "no", "-opengl-es-cl",        "Enable support for OpenGL ES Common Lite");
       
  1833         desc("OPENGL_ES_2",  "no", "-opengl-es-2",         "Enable support for OpenGL ES 2.0");
  1866         desc("OPENGL_ES_2",  "no", "-opengl-es-2",         "Enable support for OpenGL ES 2.0");
  1834         desc("DIRECTSHOW", "no",   "-phonon-wince-ds9",    "Enable Phonon Direct Show 9 backend for Windows CE");
  1867         desc("DIRECTSHOW", "no",   "-phonon-wince-ds9",    "Enable Phonon Direct Show 9 backend for Windows CE");
  1835 
  1868 
  1836         // Qt\Symbian only options go below here -----------------------------------------------------------------------------
  1869         // Qt\Symbian only options go below here -----------------------------------------------------------------------------
  1837         desc("Qt for Symbian OS only:\n\n");
  1870         desc("Qt for Symbian OS only:\n\n");
  1873 bool Configure::findFile( const QString &fileName )
  1906 bool Configure::findFile( const QString &fileName )
  1874 {
  1907 {
  1875     const QString file = fileName.toLower();
  1908     const QString file = fileName.toLower();
  1876     const QString pathEnvVar = QString::fromLocal8Bit(getenv("PATH"));
  1909     const QString pathEnvVar = QString::fromLocal8Bit(getenv("PATH"));
  1877     const QString mingwPath = dictionary["QMAKESPEC"].endsWith("-g++") ?
  1910     const QString mingwPath = dictionary["QMAKESPEC"].endsWith("-g++") ?
  1878         findFileInPaths("mingw32-g++.exe", pathEnvVar) : QString();
  1911         findFileInPaths("g++.exe", pathEnvVar) : QString();
  1879 
  1912 
  1880     QString paths;
  1913     QString paths;
  1881     if (file.endsWith(".h")) {
  1914     if (file.endsWith(".h")) {
  1882         if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull())
  1915         if (!mingwPath.isNull()) {
  1883 		    return true;
  1916             if (!findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull())
       
  1917 		        return true;
       
  1918             //now let's try the additional compiler path
       
  1919             QDir mingwLibDir = mingwPath + QLatin1String("/../lib/gcc/mingw32");
       
  1920             foreach(const QFileInfo &version, mingwLibDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) {
       
  1921                 if (!findFileInPaths(file, version.absoluteFilePath() + QLatin1String("/include")).isNull())
       
  1922                     return true;
       
  1923             }
       
  1924         }
  1884         paths = QString::fromLocal8Bit(getenv("INCLUDE"));
  1925         paths = QString::fromLocal8Bit(getenv("INCLUDE"));
  1885     } else if ( file.endsWith( ".lib" ) ||  file.endsWith( ".a" ) ) {
  1926     } else if ( file.endsWith( ".lib" ) ||  file.endsWith( ".a" ) ) {
  1886         if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../lib")).isNull())
  1927         if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../lib")).isNull())
  1887 		    return true;
  1928 		    return true;
  1888         paths = QString::fromLocal8Bit(getenv("LIB"));
  1929         paths = QString::fromLocal8Bit(getenv("LIB"));
  1957 */
  1998 */
  1958 bool Configure::checkAvailability(const QString &part)
  1999 bool Configure::checkAvailability(const QString &part)
  1959 {
  2000 {
  1960     bool available = false;
  2001     bool available = false;
  1961     if (part == "STYLE_WINDOWSXP")
  2002     if (part == "STYLE_WINDOWSXP")
  1962         available = (findFile("uxtheme.h"));
  2003         available = findFile("uxtheme.h");
  1963 
  2004 
  1964     else if (part == "ZLIB")
  2005     else if (part == "ZLIB")
  1965         available = findFile("zlib.h");
  2006         available = findFile("zlib.h");
  1966 
  2007 
  1967     else if (part == "LIBJPEG")
  2008     else if (part == "LIBJPEG")
  2008         available = findFile("ibase.h") && (findFile("gds32_ms.lib") || findFile("gds32.lib"));
  2049         available = findFile("ibase.h") && (findFile("gds32_ms.lib") || findFile("gds32.lib"));
  2009     else if (part == "IWMMXT")
  2050     else if (part == "IWMMXT")
  2010         available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
  2051         available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
  2011     else if (part == "OPENGL_ES_CM")
  2052     else if (part == "OPENGL_ES_CM")
  2012         available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
  2053         available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
  2013     else if (part == "OPENGL_ES_CL")
       
  2014         available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
       
  2015     else if (part == "OPENGL_ES_2")
  2054     else if (part == "OPENGL_ES_2")
  2016         available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
  2055         available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
  2017     else if (part == "DIRECTSHOW")
  2056     else if (part == "DIRECTSHOW")
  2018         available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
  2057         available = (dictionary[ "ARCHITECTURE" ]  == "windowsce");
  2019     else if (part == "SSE2")
  2058     else if (part == "SSE2")
  2020         available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-g++");
  2059         available = (dictionary.value("QMAKESPEC") != "win32-msvc");
  2021     else if (part == "3DNOW" )
  2060     else if (part == "3DNOW" )
  2022         available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-icc") && findFile("mm3dnow.h") && (dictionary.value("QMAKESPEC") != "win32-g++");
  2061         available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-icc") && findFile("mm3dnow.h");
  2023     else if (part == "MMX" || part == "SSE")
  2062     else if (part == "MMX" || part == "SSE")
  2024         available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-g++");
  2063         available = (dictionary.value("QMAKESPEC") != "win32-msvc");
  2025     else if (part == "OPENSSL")
  2064     else if (part == "OPENSSL")
  2026         available = findFile("openssl\\ssl.h");
  2065         available = findFile("openssl\\ssl.h");
  2027     else if (part == "DBUS")
  2066     else if (part == "DBUS")
  2028         available = findFile("dbus\\dbus.h");
  2067         available = findFile("dbus\\dbus.h");
  2029     else if (part == "CETEST") {
  2068     else if (part == "CETEST") {
  2048         return dictionary.value("QMAKESPEC") != "win32-msvc"
  2087         return dictionary.value("QMAKESPEC") != "win32-msvc"
  2049                && dictionary.value("QMAKESPEC") != "win32-msvc.net" // Leave for now, since we can't be sure if they are using 2002 or 2003 with this spec
  2088                && dictionary.value("QMAKESPEC") != "win32-msvc.net" // Leave for now, since we can't be sure if they are using 2002 or 2003 with this spec
  2050                && dictionary.value("QMAKESPEC") != "win32-msvc2002"
  2089                && dictionary.value("QMAKESPEC") != "win32-msvc2002"
  2051                && dictionary.value("EXCEPTIONS") == "yes";
  2090                && dictionary.value("EXCEPTIONS") == "yes";
  2052     } else if (part == "PHONON") {
  2091     } else if (part == "PHONON") {
  2053         available = findFile("vmr9.h") && findFile("dshow.h") && findFile("dmo.h") && findFile("dmodshow.h")
  2092         if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
  2054             && (findFile("strmiids.lib") || findFile("libstrmiids.a"))
  2093             available = true;
  2055             && (findFile("dmoguids.lib") || findFile("libdmoguids.a"))
  2094         } else {
  2056             && (findFile("msdmo.lib") || findFile("libmsdmo.a"))
  2095             available = findFile("vmr9.h") && findFile("dshow.h") && findFile("dmo.h") && findFile("dmodshow.h")
  2057             && findFile("d3d9.h");
  2096                 && (findFile("strmiids.lib") || findFile("libstrmiids.a"))
  2058 
  2097                 && (findFile("dmoguids.lib") || findFile("libdmoguids.a"))
  2059         if (!available) {
  2098                 && (findFile("msdmo.lib") || findFile("libmsdmo.a"))
  2060             cout << "All the required DirectShow/Direct3D files couldn't be found." << endl
  2099                 && findFile("d3d9.h");
  2061                  << "Make sure you have either the platform SDK AND the DirectShow SDK or the Windows SDK installed." << endl
  2100 
  2062                  << "If you have the DirectShow SDK installed, please make sure that you have run the <path to SDK>\\SetEnv.Cmd script." << endl;
  2101             if (!available) {
  2063             if (!findFile("vmr9.h"))  cout << "vmr9.h not found" << endl;
  2102                 cout << "All the required DirectShow/Direct3D files couldn't be found." << endl
  2064             if (!findFile("dshow.h")) cout << "dshow.h not found" << endl;
  2103                      << "Make sure you have either the platform SDK AND the DirectShow SDK or the Windows SDK installed." << endl
  2065             if (!findFile("strmiids.lib")) cout << "strmiids.lib not found" << endl;
  2104                      << "If you have the DirectShow SDK installed, please make sure that you have run the <path to SDK>\\SetEnv.Cmd script." << endl;
  2066             if (!findFile("dmoguids.lib")) cout << "dmoguids.lib not found" << endl;
  2105                 if (!findFile("vmr9.h"))  cout << "vmr9.h not found" << endl;
  2067             if (!findFile("msdmo.lib")) cout << "msdmo.lib not found" << endl;
  2106                 if (!findFile("dshow.h")) cout << "dshow.h not found" << endl;
  2068             if (!findFile("d3d9.h")) cout << "d3d9.h not found" << endl;
  2107                 if (!findFile("strmiids.lib")) cout << "strmiids.lib not found" << endl;
  2069         }
  2108                 if (!findFile("dmoguids.lib")) cout << "dmoguids.lib not found" << endl;
  2070     } else if (part == "MULTIMEDIA" || part == "SCRIPT" || part == "SCRIPTTOOLS") {
  2109                 if (!findFile("msdmo.lib")) cout << "msdmo.lib not found" << endl;
       
  2110                 if (!findFile("d3d9.h")) cout << "d3d9.h not found" << endl;
       
  2111             }
       
  2112         }
       
  2113     } else if (part == "WMSDK") {
       
  2114         available = findFile("wmsdk.h");
       
  2115     } else if (part == "MULTIMEDIA" || part == "SCRIPT" || part == "SCRIPTTOOLS" || part == "DECLARATIVE") {
  2071         available = true;
  2116         available = true;
  2072     } else if (part == "WEBKIT") {
  2117     } else if (part == "WEBKIT") {
  2073         available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-g++");
  2118         available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-msvc2010") || (dictionary.value("QMAKESPEC") == "win32-g++");
  2074     } else if (part == "DECLARATIVE") {
       
  2075         available = QFile::exists(sourcePath + "/src/declarative/qml/qmlcomponent.h");
       
  2076     } else if (part == "AUDIO_BACKEND") {
  2119     } else if (part == "AUDIO_BACKEND") {
  2077         available = true;
  2120         available = true;
  2078         if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
  2121         if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
  2079             QString epocRoot = Environment::symbianEpocRoot();
  2122             QString epocRoot = Environment::symbianEpocRoot();
  2080             const QDir epocRootDir(epocRoot);
  2123             const QDir epocRootDir(epocRoot);
  2196     if (dictionary["DBUS"] == "auto")
  2239     if (dictionary["DBUS"] == "auto")
  2197         dictionary["DBUS"] = checkAvailability("DBUS") ? "yes" : "no";
  2240         dictionary["DBUS"] = checkAvailability("DBUS") ? "yes" : "no";
  2198     if (dictionary["SCRIPT"] == "auto")
  2241     if (dictionary["SCRIPT"] == "auto")
  2199         dictionary["SCRIPT"] = checkAvailability("SCRIPT") ? "yes" : "no";
  2242         dictionary["SCRIPT"] = checkAvailability("SCRIPT") ? "yes" : "no";
  2200     if (dictionary["SCRIPTTOOLS"] == "auto")
  2243     if (dictionary["SCRIPTTOOLS"] == "auto")
  2201         dictionary["SCRIPTTOOLS"] = checkAvailability("SCRIPTTOOLS") ? "yes" : "no";
  2244         dictionary["SCRIPTTOOLS"] = dictionary["SCRIPT"] == "yes" ? "yes" : "no";
  2202     if (dictionary["XMLPATTERNS"] == "auto")
  2245     if (dictionary["XMLPATTERNS"] == "auto")
  2203         dictionary["XMLPATTERNS"] = checkAvailability("XMLPATTERNS") ? "yes" : "no";
  2246         dictionary["XMLPATTERNS"] = checkAvailability("XMLPATTERNS") ? "yes" : "no";
  2204     if (dictionary["PHONON"] == "auto")
  2247     if (dictionary["PHONON"] == "auto")
  2205         dictionary["PHONON"] = checkAvailability("PHONON") ? "yes" : "no";
  2248         dictionary["PHONON"] = checkAvailability("PHONON") ? "yes" : "no";
  2206     if (dictionary["WEBKIT"] == "auto")
  2249     if (dictionary["WEBKIT"] == "auto")
  2207         dictionary["WEBKIT"] = checkAvailability("WEBKIT") ? "yes" : "no";
  2250         dictionary["WEBKIT"] = checkAvailability("WEBKIT") ? "yes" : "no";
  2208     if (dictionary["DECLARATIVE"] == "auto")
  2251     if (dictionary["DECLARATIVE"] == "auto")
  2209         dictionary["DECLARATIVE"] = checkAvailability("DECLARATIVE") ? "yes" : "no";
  2252         dictionary["DECLARATIVE"] = dictionary["SCRIPT"] == "yes" ? "yes" : "no";
  2210     if (dictionary["AUDIO_BACKEND"] == "auto")
  2253     if (dictionary["AUDIO_BACKEND"] == "auto")
  2211         dictionary["AUDIO_BACKEND"] = checkAvailability("AUDIO_BACKEND") ? "yes" : "no";
  2254         dictionary["AUDIO_BACKEND"] = checkAvailability("AUDIO_BACKEND") ? "yes" : "no";
       
  2255     if (dictionary["WMSDK"] == "auto")
       
  2256         dictionary["WMSDK"] = checkAvailability("WMSDK") ? "yes" : "no";
  2212 
  2257 
  2213     // Qt/WinCE remote test application
  2258     // Qt/WinCE remote test application
  2214     if (dictionary["CETEST"] == "auto")
  2259     if (dictionary["CETEST"] == "auto")
  2215         dictionary["CETEST"] = checkAvailability("CETEST") ? "yes" : "no";
  2260         dictionary["CETEST"] = checkAvailability("CETEST") ? "yes" : "no";
  2216 
  2261 
  2250              << "win32-msvc2002 or win32-msvc2003 instead." << endl;
  2295              << "win32-msvc2002 or win32-msvc2003 instead." << endl;
  2251         cout << "(Press any key to continue..)";
  2296         cout << "(Press any key to continue..)";
  2252         if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
  2297         if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
  2253             exit(0);      // Exit cleanly for Ctrl+C
  2298             exit(0);      // Exit cleanly for Ctrl+C
  2254     }
  2299     }
  2255 	if (0 != dictionary["ARM_FPU_TYPE"].size())
  2300     if (0 != dictionary["ARM_FPU_TYPE"].size()) {
  2256 	{
  2301             QStringList l= QStringList()
  2257 		QStringList l= QStringList()
  2302                     << "softvfp"
  2258 			<< "softvfp"
  2303                     << "softvfp+vfpv2"
  2259 			<< "softvfp+vfpv2"
  2304                     << "vfpv2";
  2260 			<< "vfpv2";
  2305             if (!(l.contains(dictionary["ARM_FPU_TYPE"])))
  2261 		if (!(l.contains(dictionary["ARM_FPU_TYPE"])))
  2306                     cout << QString("WARNING: Using unsupported fpu flag: %1").arg(dictionary["ARM_FPU_TYPE"]) << endl;
  2262 			cout << QString("WARNING: Using unsupported fpu flag: %1").arg(dictionary["ARM_FPU_TYPE"]) << endl;
  2307     }
  2263 	}
  2308     if (dictionary["DECLARATIVE"] == "yes" && dictionary["SCRIPT"] == "no") {
       
  2309         cout << "WARNING: To be able to compile QtDeclarative we need to also compile the" << endl
       
  2310              << "QtScript module. If you continue, we will turn on the QtScript module." << endl
       
  2311              << "(Press any key to continue..)";
       
  2312         if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
       
  2313             exit(0);      // Exit cleanly for Ctrl+C
       
  2314 
       
  2315         dictionary["SCRIPT"] = "yes";
       
  2316     }
  2264 
  2317 
  2265     return true;
  2318     return true;
  2266 }
  2319 }
  2267 
  2320 
  2268 /*
  2321 /*
  2331 
  2384 
  2332     QString buildkey = "#if defined(__SYMBIAN32__)\n"
  2385     QString buildkey = "#if defined(__SYMBIAN32__)\n"
  2333                        + buildSymbianKey + "\"\n"
  2386                        + buildSymbianKey + "\"\n"
  2334                        "#else\n"
  2387                        "#else\n"
  2335                        // Debug builds
  2388                        // Debug builds
  2336                        "# if (defined(_DEBUG) || defined(DEBUG))\n"
  2389                        "# if (!QT_NO_DEBUG)\n"
  2337                        "#  if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n"
  2390                        "#  if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n"
  2338                        + build64Key.arg("debug") + "\"\n"
  2391                        + build64Key.arg("debug") + "\"\n"
  2339                        "#  else\n"
  2392                        "#  else\n"
  2340                        + build32Key.arg("debug") + "\"\n"
  2393                        + build32Key.arg("debug") + "\"\n"
  2341                        "#  endif\n"
  2394                        "#  endif\n"
  2542     if ( dictionary["OPENGL_ES_2"] == "yes" ) {
  2595     if ( dictionary["OPENGL_ES_2"] == "yes" ) {
  2543         qtConfig += "opengles2";
  2596         qtConfig += "opengles2";
  2544         qtConfig += "egl";
  2597         qtConfig += "egl";
  2545     }
  2598     }
  2546 
  2599 
  2547     if ( dictionary["OPENGL_ES_CL"] == "yes" ) {
       
  2548         qtConfig += "opengles1cl";
       
  2549         qtConfig += "egl";
       
  2550     }
       
  2551 
       
  2552     if ( dictionary["OPENVG"] == "yes" ) {
  2600     if ( dictionary["OPENVG"] == "yes" ) {
  2553         qtConfig += "openvg";
  2601         qtConfig += "openvg";
  2554         qtConfig += "egl";
  2602         qtConfig += "egl";
  2555     }
  2603     }
  2556 
  2604 
  2607     }
  2655     }
  2608 
  2656 
  2609     if (dictionary["WEBKIT"] == "yes")
  2657     if (dictionary["WEBKIT"] == "yes")
  2610         qtConfig += "webkit";
  2658         qtConfig += "webkit";
  2611 
  2659 
  2612     if (dictionary["DECLARATIVE"] == "yes")
  2660     if (dictionary["DECLARATIVE"] == "yes") {
       
  2661         if (dictionary[ "SCRIPT" ] == "no") {
       
  2662             cout << "QtDeclarative was requested, but it can't be built due to QtScript being "
       
  2663                     "disabled." << endl;
       
  2664             dictionary[ "DONE" ] = "error";
       
  2665         }
  2613         qtConfig += "declarative";
  2666         qtConfig += "declarative";
       
  2667     }
  2614 
  2668 
  2615     if( dictionary[ "NATIVE_GESTURES" ] == "yes" )
  2669     if( dictionary[ "NATIVE_GESTURES" ] == "yes" )
  2616         qtConfig += "native-gestures";
  2670         qtConfig += "native-gestures";
  2617 
  2671 
  2618     // We currently have no switch for QtSvg, so add it unconditionally.
  2672     // We currently have no switch for QtSvg, so add it unconditionally.
  2654         dictionary[ "QT_INSTALL_LIBS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/lib" );
  2708         dictionary[ "QT_INSTALL_LIBS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/lib" );
  2655     if( !dictionary[ "QT_INSTALL_BINS" ].size() )
  2709     if( !dictionary[ "QT_INSTALL_BINS" ].size() )
  2656         dictionary[ "QT_INSTALL_BINS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/bin" );
  2710         dictionary[ "QT_INSTALL_BINS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/bin" );
  2657     if( !dictionary[ "QT_INSTALL_PLUGINS" ].size() )
  2711     if( !dictionary[ "QT_INSTALL_PLUGINS" ].size() )
  2658         dictionary[ "QT_INSTALL_PLUGINS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/plugins" );
  2712         dictionary[ "QT_INSTALL_PLUGINS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/plugins" );
       
  2713     if( !dictionary[ "QT_INSTALL_IMPORTS" ].size() )
       
  2714         dictionary[ "QT_INSTALL_IMPORTS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/imports" );
  2659     if( !dictionary[ "QT_INSTALL_DATA" ].size() )
  2715     if( !dictionary[ "QT_INSTALL_DATA" ].size() )
  2660         dictionary[ "QT_INSTALL_DATA" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] );
  2716         dictionary[ "QT_INSTALL_DATA" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] );
  2661     if( !dictionary[ "QT_INSTALL_TRANSLATIONS" ].size() )
  2717     if( !dictionary[ "QT_INSTALL_TRANSLATIONS" ].size() )
  2662         dictionary[ "QT_INSTALL_TRANSLATIONS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/translations" );
  2718         dictionary[ "QT_INSTALL_TRANSLATIONS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/translations" );
  2663     if( !dictionary[ "QT_INSTALL_EXAMPLES" ].size() )
  2719     if( !dictionary[ "QT_INSTALL_EXAMPLES" ].size() )
  2856 
  2912 
  2857         configStream << "#Qt for Symbian FPU settings" << endl;
  2913         configStream << "#Qt for Symbian FPU settings" << endl;
  2858         if(!dictionary["ARM_FPU_TYPE"].isEmpty()) {
  2914         if(!dictionary["ARM_FPU_TYPE"].isEmpty()) {
  2859             configStream<<"MMP_RULES += \"ARMFPU "<< dictionary["ARM_FPU_TYPE"]<< "\"";
  2915             configStream<<"MMP_RULES += \"ARMFPU "<< dictionary["ARM_FPU_TYPE"]<< "\"";
  2860         }
  2916         }
       
  2917         if (!dictionary["QT_NAMESPACE"].isEmpty()) {
       
  2918             configStream << "#namespaces" << endl << "QT_NAMESPACE = " << dictionary["QT_NAMESPACE"] << endl;
       
  2919         }
  2861 
  2920 
  2862         configStream.flush();
  2921         configStream.flush();
  2863         configFile.close();
  2922         configFile.close();
  2864     }
  2923     }
  2865 }
  2924 }
  2999         if(dictionary["SCRIPTTOOLS"] == "no")       qconfigList += "QT_NO_SCRIPTTOOLS";
  3058         if(dictionary["SCRIPTTOOLS"] == "no")       qconfigList += "QT_NO_SCRIPTTOOLS";
  3000         if(dictionary["FREETYPE"] == "no")          qconfigList += "QT_NO_FREETYPE";
  3059         if(dictionary["FREETYPE"] == "no")          qconfigList += "QT_NO_FREETYPE";
  3001         if(dictionary["S60"] == "no")               qconfigList += "QT_NO_S60";
  3060         if(dictionary["S60"] == "no")               qconfigList += "QT_NO_S60";
  3002         if(dictionary["NATIVE_GESTURES"] == "no")   qconfigList += "QT_NO_NATIVE_GESTURES";
  3061         if(dictionary["NATIVE_GESTURES"] == "no")   qconfigList += "QT_NO_NATIVE_GESTURES";
  3003 
  3062 
       
  3063         if(dictionary["OPENGL_ES_CM"] == "no" &&
       
  3064            dictionary["OPENGL_ES_2"]  == "no" &&
       
  3065            dictionary["OPENVG"]       == "no")      qconfigList += "QT_NO_EGL";
       
  3066 
  3004         if(dictionary["OPENGL_ES_CM"] == "yes" ||
  3067         if(dictionary["OPENGL_ES_CM"] == "yes" ||
  3005            dictionary["OPENGL_ES_CL"] == "yes" ||
       
  3006            dictionary["OPENGL_ES_2"]  == "yes")     qconfigList += "QT_OPENGL_ES";
  3068            dictionary["OPENGL_ES_2"]  == "yes")     qconfigList += "QT_OPENGL_ES";
  3007 
  3069 
  3008         if(dictionary["OPENGL_ES_CM"] == "yes")     qconfigList += "QT_OPENGL_ES_1";
  3070         if(dictionary["OPENGL_ES_CM"] == "yes")     qconfigList += "QT_OPENGL_ES_1";
  3009         if(dictionary["OPENGL_ES_2"]  == "yes")     qconfigList += "QT_OPENGL_ES_2";
  3071         if(dictionary["OPENGL_ES_2"]  == "yes")     qconfigList += "QT_OPENGL_ES_2";
  3010         if(dictionary["OPENGL_ES_CL"] == "yes")     qconfigList += "QT_OPENGL_ES_1_CL";
       
  3011 
       
  3012         if(dictionary["SQL_MYSQL"] == "yes")        qconfigList += "QT_SQL_MYSQL";
  3072         if(dictionary["SQL_MYSQL"] == "yes")        qconfigList += "QT_SQL_MYSQL";
  3013         if(dictionary["SQL_ODBC"] == "yes")         qconfigList += "QT_SQL_ODBC";
  3073         if(dictionary["SQL_ODBC"] == "yes")         qconfigList += "QT_SQL_ODBC";
  3014         if(dictionary["SQL_OCI"] == "yes")          qconfigList += "QT_SQL_OCI";
  3074         if(dictionary["SQL_OCI"] == "yes")          qconfigList += "QT_SQL_OCI";
  3015         if(dictionary["SQL_PSQL"] == "yes")         qconfigList += "QT_SQL_PSQL";
  3075         if(dictionary["SQL_PSQL"] == "yes")         qconfigList += "QT_SQL_PSQL";
  3016         if(dictionary["SQL_TDS"] == "yes")          qconfigList += "QT_SQL_TDS";
  3076         if(dictionary["SQL_TDS"] == "yes")          qconfigList += "QT_SQL_TDS";
  3160                   << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << QString(dictionary["QT_INSTALL_DOCS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3220                   << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << QString(dictionary["QT_INSTALL_DOCS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3161                   << "static const char qt_configure_headers_path_str      [512 + 12] = \"qt_hdrspath=" << QString(dictionary["QT_INSTALL_HEADERS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3221                   << "static const char qt_configure_headers_path_str      [512 + 12] = \"qt_hdrspath=" << QString(dictionary["QT_INSTALL_HEADERS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3162                   << "static const char qt_configure_libraries_path_str    [512 + 12] = \"qt_libspath=" << QString(dictionary["QT_INSTALL_LIBS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3222                   << "static const char qt_configure_libraries_path_str    [512 + 12] = \"qt_libspath=" << QString(dictionary["QT_INSTALL_LIBS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3163                   << "static const char qt_configure_binaries_path_str     [512 + 12] = \"qt_binspath=" << QString(dictionary["QT_INSTALL_BINS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3223                   << "static const char qt_configure_binaries_path_str     [512 + 12] = \"qt_binspath=" << QString(dictionary["QT_INSTALL_BINS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3164                   << "static const char qt_configure_plugins_path_str      [512 + 12] = \"qt_plugpath=" << QString(dictionary["QT_INSTALL_PLUGINS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3224                   << "static const char qt_configure_plugins_path_str      [512 + 12] = \"qt_plugpath=" << QString(dictionary["QT_INSTALL_PLUGINS"]).replace( "\\", "\\\\" ) << "\";"  << endl
       
  3225                   << "static const char qt_configure_imports_path_str      [512 + 12] = \"qt_impspath=" << QString(dictionary["QT_INSTALL_IMPORTS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3165                   << "static const char qt_configure_data_path_str         [512 + 12] = \"qt_datapath=" << QString(dictionary["QT_INSTALL_DATA"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3226                   << "static const char qt_configure_data_path_str         [512 + 12] = \"qt_datapath=" << QString(dictionary["QT_INSTALL_DATA"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3166                   << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << QString(dictionary["QT_INSTALL_TRANSLATIONS"]).replace( "\\", "\\\\" ) << "\";" << endl
  3227                   << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << QString(dictionary["QT_INSTALL_TRANSLATIONS"]).replace( "\\", "\\\\" ) << "\";" << endl
  3167                   << "static const char qt_configure_examples_path_str     [512 + 12] = \"qt_xmplpath=" << QString(dictionary["QT_INSTALL_EXAMPLES"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3228                   << "static const char qt_configure_examples_path_str     [512 + 12] = \"qt_xmplpath=" << QString(dictionary["QT_INSTALL_EXAMPLES"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3168                   << "static const char qt_configure_demos_path_str        [512 + 12] = \"qt_demopath=" << QString(dictionary["QT_INSTALL_DEMOS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3229                   << "static const char qt_configure_demos_path_str        [512 + 12] = \"qt_demopath=" << QString(dictionary["QT_INSTALL_DEMOS"]).replace( "\\", "\\\\" ) << "\";"  << endl
  3169                   //<< "static const char qt_configure_settings_path_str [256] = \"qt_stngpath=" << QString(dictionary["QT_INSTALL_SETTINGS"]).replace( "\\", "\\\\" ) << "\";" << endl
  3230                   //<< "static const char qt_configure_settings_path_str [256] = \"qt_stngpath=" << QString(dictionary["QT_INSTALL_SETTINGS"]).replace( "\\", "\\\\" ) << "\";" << endl
  3174                        << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/doc").replace( "\\", "\\\\" ) <<"\";"  << endl
  3235                        << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/doc").replace( "\\", "\\\\" ) <<"\";"  << endl
  3175                        << "static const char qt_configure_headers_path_str      [512 + 12] = \"qt_hdrspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/include").replace( "\\", "\\\\" ) <<"\";"  << endl
  3236                        << "static const char qt_configure_headers_path_str      [512 + 12] = \"qt_hdrspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/include").replace( "\\", "\\\\" ) <<"\";"  << endl
  3176                        << "static const char qt_configure_libraries_path_str    [512 + 12] = \"qt_libspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/lib").replace( "\\", "\\\\" ) <<"\";"  << endl
  3237                        << "static const char qt_configure_libraries_path_str    [512 + 12] = \"qt_libspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/lib").replace( "\\", "\\\\" ) <<"\";"  << endl
  3177                        << "static const char qt_configure_binaries_path_str     [512 + 12] = \"qt_binspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/bin").replace( "\\", "\\\\" ) <<"\";"  << endl
  3238                        << "static const char qt_configure_binaries_path_str     [512 + 12] = \"qt_binspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/bin").replace( "\\", "\\\\" ) <<"\";"  << endl
  3178                        << "static const char qt_configure_plugins_path_str      [512 + 12] = \"qt_plugpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/plugins").replace( "\\", "\\\\" ) <<"\";"  << endl
  3239                        << "static const char qt_configure_plugins_path_str      [512 + 12] = \"qt_plugpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/plugins").replace( "\\", "\\\\" ) <<"\";"  << endl
       
  3240                        << "static const char qt_configure_imports_path_str      [512 + 12] = \"qt_impspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/imports").replace( "\\", "\\\\" ) <<"\";"  << endl
  3179                        << "static const char qt_configure_data_path_str         [512 + 12] = \"qt_datapath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ]).replace( "\\", "\\\\" ) <<"\";"  << endl
  3241                        << "static const char qt_configure_data_path_str         [512 + 12] = \"qt_datapath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ]).replace( "\\", "\\\\" ) <<"\";"  << endl
  3180                        << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/translations").replace( "\\", "\\\\" ) <<"\";" << endl
  3242                        << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/translations").replace( "\\", "\\\\" ) <<"\";" << endl
  3181                        << "static const char qt_configure_examples_path_str     [512 + 12] = \"qt_xmplpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/example").replace( "\\", "\\\\" ) <<"\";"  << endl
  3243                        << "static const char qt_configure_examples_path_str     [512 + 12] = \"qt_xmplpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/example").replace( "\\", "\\\\" ) <<"\";"  << endl
  3182                        << "static const char qt_configure_demos_path_str        [512 + 12] = \"qt_demopath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/demos").replace( "\\", "\\\\" ) <<"\";"  << endl
  3244                        << "static const char qt_configure_demos_path_str        [512 + 12] = \"qt_demopath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/demos").replace( "\\", "\\\\" ) <<"\";"  << endl
  3183                        << "#endif //QT_BOOTSTRAPPED" << endl;
  3245                        << "#endif //QT_BOOTSTRAPPED" << endl;
  3189                   << "#define QT_CONFIGURE_DOCUMENTATION_PATH qt_configure_documentation_path_str + 12;" << endl
  3251                   << "#define QT_CONFIGURE_DOCUMENTATION_PATH qt_configure_documentation_path_str + 12;" << endl
  3190                   << "#define QT_CONFIGURE_HEADERS_PATH qt_configure_headers_path_str + 12;" << endl
  3252                   << "#define QT_CONFIGURE_HEADERS_PATH qt_configure_headers_path_str + 12;" << endl
  3191                   << "#define QT_CONFIGURE_LIBRARIES_PATH qt_configure_libraries_path_str + 12;" << endl
  3253                   << "#define QT_CONFIGURE_LIBRARIES_PATH qt_configure_libraries_path_str + 12;" << endl
  3192                   << "#define QT_CONFIGURE_BINARIES_PATH qt_configure_binaries_path_str + 12;" << endl
  3254                   << "#define QT_CONFIGURE_BINARIES_PATH qt_configure_binaries_path_str + 12;" << endl
  3193                   << "#define QT_CONFIGURE_PLUGINS_PATH qt_configure_plugins_path_str + 12;" << endl
  3255                   << "#define QT_CONFIGURE_PLUGINS_PATH qt_configure_plugins_path_str + 12;" << endl
       
  3256                   << "#define QT_CONFIGURE_IMPORTS_PATH qt_configure_imports_path_str + 12;" << endl
  3194                   << "#define QT_CONFIGURE_DATA_PATH qt_configure_data_path_str + 12;" << endl
  3257                   << "#define QT_CONFIGURE_DATA_PATH qt_configure_data_path_str + 12;" << endl
  3195                   << "#define QT_CONFIGURE_TRANSLATIONS_PATH qt_configure_translations_path_str + 12;" << endl
  3258                   << "#define QT_CONFIGURE_TRANSLATIONS_PATH qt_configure_translations_path_str + 12;" << endl
  3196                   << "#define QT_CONFIGURE_EXAMPLES_PATH qt_configure_examples_path_str + 12;" << endl
  3259                   << "#define QT_CONFIGURE_EXAMPLES_PATH qt_configure_examples_path_str + 12;" << endl
  3197                   << "#define QT_CONFIGURE_DEMOS_PATH qt_configure_demos_path_str + 12;" << endl
  3260                   << "#define QT_CONFIGURE_DEMOS_PATH qt_configure_demos_path_str + 12;" << endl
  3198                   //<< "#define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12;" << endl
  3261                   //<< "#define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12;" << endl
  3335     cout << "Build is done in............" << dictionary[ "QT_BUILD_TREE" ] << endl;
  3398     cout << "Build is done in............" << dictionary[ "QT_BUILD_TREE" ] << endl;
  3336     cout << "Install prefix.............." << dictionary[ "QT_INSTALL_PREFIX" ] << endl;
  3399     cout << "Install prefix.............." << dictionary[ "QT_INSTALL_PREFIX" ] << endl;
  3337     cout << "Headers installed to........" << dictionary[ "QT_INSTALL_HEADERS" ] << endl;
  3400     cout << "Headers installed to........" << dictionary[ "QT_INSTALL_HEADERS" ] << endl;
  3338     cout << "Libraries installed to......" << dictionary[ "QT_INSTALL_LIBS" ] << endl;
  3401     cout << "Libraries installed to......" << dictionary[ "QT_INSTALL_LIBS" ] << endl;
  3339     cout << "Plugins installed to........" << dictionary[ "QT_INSTALL_PLUGINS" ] << endl;
  3402     cout << "Plugins installed to........" << dictionary[ "QT_INSTALL_PLUGINS" ] << endl;
       
  3403     cout << "Imports installed to........" << dictionary[ "QT_INSTALL_IMPORTS" ] << endl;
  3340     cout << "Binaries installed to......." << dictionary[ "QT_INSTALL_BINS" ] << endl;
  3404     cout << "Binaries installed to......." << dictionary[ "QT_INSTALL_BINS" ] << endl;
  3341     cout << "Docs installed to..........." << dictionary[ "QT_INSTALL_DOCS" ] << endl;
  3405     cout << "Docs installed to..........." << dictionary[ "QT_INSTALL_DOCS" ] << endl;
  3342     cout << "Data installed to..........." << dictionary[ "QT_INSTALL_DATA" ] << endl;
  3406     cout << "Data installed to..........." << dictionary[ "QT_INSTALL_DATA" ] << endl;
  3343     cout << "Translations installed to..." << dictionary[ "QT_INSTALL_TRANSLATIONS" ] << endl;
  3407     cout << "Translations installed to..." << dictionary[ "QT_INSTALL_TRANSLATIONS" ] << endl;
  3344     cout << "Examples installed to......." << dictionary[ "QT_INSTALL_EXAMPLES" ] << endl;
  3408     cout << "Examples installed to......." << dictionary[ "QT_INSTALL_EXAMPLES" ] << endl;
  3394     }
  3458     }
  3395     if( dictionary[ "OPENSSL" ] == "linked" && opensslLibs.isEmpty() ) {
  3459     if( dictionary[ "OPENSSL" ] == "linked" && opensslLibs.isEmpty() ) {
  3396         cout << "NOTE: When linking against OpenSSL, you can override the default" << endl;
  3460         cout << "NOTE: When linking against OpenSSL, you can override the default" << endl;
  3397         cout << "library names through OPENSSL_LIBS." << endl;
  3461         cout << "library names through OPENSSL_LIBS." << endl;
  3398         cout << "For example:" << endl;
  3462         cout << "For example:" << endl;
  3399         cout << "    configure -openssl-linked OPENSSL_LIBS='-lssleay32 -llibeay32'" << endl;
  3463         cout << "    configure -openssl-linked OPENSSL_LIBS=\"-lssleay32 -llibeay32\"" << endl;
  3400     }
  3464     }
  3401     if( dictionary[ "ZLIB_FORCED" ] == "yes" ) {
  3465     if( dictionary[ "ZLIB_FORCED" ] == "yes" ) {
  3402         QString which_zlib = "supplied";
  3466         QString which_zlib = "supplied";
  3403         if( dictionary[ "ZLIB" ] == "system")
  3467         if( dictionary[ "ZLIB" ] == "system")
  3404             which_zlib = "system";
  3468             which_zlib = "system";
  3465         args += dictionary[ "MAKE" ];
  3529         args += dictionary[ "MAKE" ];
  3466         args += "-f";
  3530         args += "-f";
  3467         args += makefile;
  3531         args += makefile;
  3468 
  3532 
  3469         cout << "Creating qmake..." << endl;
  3533         cout << "Creating qmake..." << endl;
  3470         int exitCode = 0;
  3534         int exitCode = Environment::execute(args, QStringList(), QStringList());
  3471         if( exitCode = Environment::execute(args, QStringList(), QStringList()) ) {
  3535         if( exitCode ) {
  3472             args.clear();
  3536             args.clear();
  3473             args += dictionary[ "MAKE" ];
  3537             args += dictionary[ "MAKE" ];
  3474             args += "-f";
  3538             args += "-f";
  3475             args += makefile;
  3539             args += makefile;
  3476             args += "clean";
  3540             args += "clean";
  3477             if( exitCode = Environment::execute(args, QStringList(), QStringList())) {
  3541             exitCode = Environment::execute(args, QStringList(), QStringList());
       
  3542             if(exitCode) {
  3478                 cout << "Cleaning qmake failed, return code " << exitCode << endl << endl;
  3543                 cout << "Cleaning qmake failed, return code " << exitCode << endl << endl;
  3479                 dictionary[ "DONE" ] = "error";
  3544                 dictionary[ "DONE" ] = "error";
  3480             } else {
  3545             } else {
  3481                 args.clear();
  3546                 args.clear();
  3482                 args += dictionary[ "MAKE" ];
  3547                 args += dictionary[ "MAKE" ];
  3483                 args += "-f";
  3548                 args += "-f";
  3484                 args += makefile;
  3549                 args += makefile;
  3485                 if (exitCode = Environment::execute(args, QStringList(), QStringList())) {
  3550                 exitCode = Environment::execute(args, QStringList(), QStringList());
       
  3551                 if (exitCode) {
  3486                     cout << "Building qmake failed, return code " << exitCode << endl << endl;
  3552                     cout << "Building qmake failed, return code " << exitCode << endl << endl;
  3487                     dictionary[ "DONE" ] = "error";
  3553                     dictionary[ "DONE" ] = "error";
  3488                 }
  3554                 }
  3489             }
  3555             }
  3490         }
  3556         }
  3524         args << "-spec" << dictionary["QMAKESPEC"] << "-r";
  3590         args << "-spec" << dictionary["QMAKESPEC"] << "-r";
  3525         args << "-o" << QDir::toNativeSeparators(toolBuildPath + "/Makefile");
  3591         args << "-o" << QDir::toNativeSeparators(toolBuildPath + "/Makefile");
  3526 
  3592 
  3527         QDir().mkpath(toolBuildPath);
  3593         QDir().mkpath(toolBuildPath);
  3528         QDir::setCurrent(toolSourcePath);
  3594         QDir::setCurrent(toolSourcePath);
  3529         int exitCode = 0;
  3595         int exitCode = Environment::execute(args, QStringList(), QStringList());
  3530         if (exitCode = Environment::execute(args, QStringList(), QStringList())) {
  3596         if (exitCode) {
  3531             cout << "qmake failed, return code " << exitCode << endl << endl;
  3597             cout << "qmake failed, return code " << exitCode << endl << endl;
  3532             dictionary["DONE"] = "error";
  3598             dictionary["DONE"] = "error";
  3533             break;
  3599             break;
  3534         }
  3600         }
  3535 
  3601 
  3536         // build app
  3602         // build app
  3537         args.clear();
  3603         args.clear();
  3538         args += dictionary["MAKE"];
  3604         args += dictionary["MAKE"];
  3539         QDir::setCurrent(toolBuildPath);
  3605         QDir::setCurrent(toolBuildPath);
  3540         if (exitCode = Environment::execute(args, QStringList(), QStringList())) {
  3606         exitCode = Environment::execute(args, QStringList(), QStringList());
       
  3607         if (exitCode) {
  3541             args.clear();
  3608             args.clear();
  3542             args += dictionary["MAKE"];
  3609             args += dictionary["MAKE"];
  3543             args += "clean";
  3610             args += "clean";
  3544             if(exitCode = Environment::execute(args, QStringList(), QStringList())) {
  3611             exitCode = Environment::execute(args, QStringList(), QStringList());
       
  3612             if(exitCode) {
  3545                 cout << "Cleaning " << hostToolsDirs.at(i) << " failed, return code " << exitCode << endl << endl;
  3613                 cout << "Cleaning " << hostToolsDirs.at(i) << " failed, return code " << exitCode << endl << endl;
  3546                 dictionary["DONE"] = "error";
  3614                 dictionary["DONE"] = "error";
  3547                 break;
  3615                 break;
  3548             } else {
  3616             } else {
  3549                 args.clear();
  3617                 args.clear();
  3550                 args += dictionary["MAKE"];
  3618                 args += dictionary["MAKE"];
  3551                 if (exitCode = Environment::execute(args, QStringList(), QStringList())) {
  3619                 exitCode = Environment::execute(args, QStringList(), QStringList());
       
  3620                 if (exitCode) {
  3552                     cout << "Building " << hostToolsDirs.at(i) << " failed, return code " << exitCode << endl << endl;
  3621                     cout << "Building " << hostToolsDirs.at(i) << " failed, return code " << exitCode << endl << endl;
  3553                     dictionary["DONE"] = "error";
  3622                     dictionary["DONE"] = "error";
  3554                     break;
  3623                     break;
  3555                 }
  3624                 }
  3556             }
  3625             }