diff options
Diffstat (limited to 'tools/configure')
-rw-r--r-- | tools/configure/configure.pro | 6 | ||||
-rw-r--r-- | tools/configure/configureapp.cpp | 491 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 4 | ||||
-rw-r--r-- | tools/configure/environment.cpp | 218 | ||||
-rw-r--r-- | tools/configure/main.cpp | 6 | ||||
-rw-r--r-- | tools/configure/tools.cpp | 6 |
6 files changed, 428 insertions, 303 deletions
diff --git a/tools/configure/configure.pro b/tools/configure/configure.pro index 1ce9a1b..06e9fe0 100644 --- a/tools/configure/configure.pro +++ b/tools/configure/configure.pro @@ -3,7 +3,7 @@ DESTDIR = ../.. CONFIG += console flat CONFIG -= moc qt -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 +DEFINES = UNICODE 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 win32 : LIBS += -lole32 -ladvapi32 @@ -32,6 +32,7 @@ HEADERS = configureapp.h environment.h tools.h\ $$QT_SOURCE_TREE/src/corelib/tools/qlist.h \ $$QT_SOURCE_TREE/src/corelib/tools/qlocale.h \ $$QT_SOURCE_TREE/src/corelib/tools/qvector.h \ + $$QT_SOURCE_TREE/src/corelib/codecs/qutfcodec_p.h \ $$QT_SOURCE_TREE/src/corelib/codecs/qtextcodec.h \ $$QT_SOURCE_TREE/src/corelib/global/qglobal.h \ $$QT_SOURCE_TREE/src/corelib/global/qnumeric.h \ @@ -61,9 +62,10 @@ SOURCES = main.cpp configureapp.cpp environment.cpp tools.cpp \ $$QT_SOURCE_TREE/src/corelib/tools/qbytearraymatcher.cpp \ $$QT_SOURCE_TREE/src/corelib/tools/qchar.cpp \ $$QT_SOURCE_TREE/src/corelib/tools/qhash.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qlistdata.cpp \ + $$QT_SOURCE_TREE/src/corelib/tools/qlist.cpp \ $$QT_SOURCE_TREE/src/corelib/tools/qlocale.cpp \ $$QT_SOURCE_TREE/src/corelib/tools/qvector.cpp \ + $$QT_SOURCE_TREE/src/corelib/codecs/qutfcodec.cpp \ $$QT_SOURCE_TREE/src/corelib/codecs/qtextcodec.cpp \ $$QT_SOURCE_TREE/src/corelib/global/qglobal.cpp \ $$QT_SOURCE_TREE/src/corelib/global/qnumeric.cpp \ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 7ccd35b..5b30b4e 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -116,16 +116,9 @@ Configure::Configure( int& argc, char** argv ) // Get the path to the executable - QFileInfo sourcePathInfo; - QT_WA({ - unsigned short module_name[256]; - GetModuleFileNameW(0, reinterpret_cast<wchar_t *>(module_name), sizeof(module_name)); - sourcePathInfo = QString::fromUtf16(module_name); - }, { - char module_name[256]; - GetModuleFileNameA(0, module_name, sizeof(module_name)); - sourcePathInfo = QString::fromLocal8Bit(module_name); - }); + wchar_t module_name[MAX_PATH]; + GetModuleFileName(0, module_name, sizeof(module_name) / sizeof(wchar_t)); + QFileInfo sourcePathInfo = QString::fromWCharArray(module_name); sourcePath = sourcePathInfo.absolutePath(); sourceDir = sourcePathInfo.dir(); buildPath = QDir::currentPath(); @@ -248,10 +241,12 @@ Configure::Configure( int& argc, char** argv ) dictionary[ "CE_CRT" ] = "no"; dictionary[ "CETEST" ] = "auto"; dictionary[ "CE_SIGNATURE" ] = "no"; - dictionary[ "SCRIPTTOOLS" ] = "yes"; + dictionary[ "SCRIPT" ] = "auto"; + dictionary[ "SCRIPTTOOLS" ] = "auto"; dictionary[ "XMLPATTERNS" ] = "auto"; dictionary[ "PHONON" ] = "auto"; dictionary[ "PHONON_BACKEND" ] = "yes"; + dictionary[ "MULTIMEDIA" ] = "yes"; dictionary[ "DIRECTSHOW" ] = "no"; dictionary[ "WEBKIT" ] = "auto"; dictionary[ "PLUGIN_MANIFESTS" ] = "yes"; @@ -310,14 +305,16 @@ Configure::Configure( int& argc, char** argv ) dictionary[ "LIBJPEG" ] = "auto"; dictionary[ "LIBPNG" ] = "auto"; dictionary[ "LIBMNG" ] = "auto"; + dictionary[ "FREETYPE" ] = "no"; dictionary[ "QT3SUPPORT" ] = "yes"; dictionary[ "ACCESSIBILITY" ] = "yes"; dictionary[ "OPENGL" ] = "yes"; - dictionary[ "DIRECT3D" ] = "auto"; + dictionary[ "OPENVG" ] = "no"; dictionary[ "IPV6" ] = "yes"; // Always, dynamicly loaded dictionary[ "OPENSSL" ] = "auto"; dictionary[ "DBUS" ] = "auto"; + dictionary[ "S60" ] = "yes"; dictionary[ "STYLE_WINDOWS" ] = "yes"; dictionary[ "STYLE_WINDOWSXP" ] = "auto"; @@ -328,6 +325,7 @@ Configure::Configure( int& argc, char** argv ) dictionary[ "STYLE_WINDOWSMOBILE" ] = "no"; dictionary[ "STYLE_MOTIF" ] = "yes"; dictionary[ "STYLE_CDE" ] = "yes"; + dictionary[ "STYLE_S60" ] = "no"; dictionary[ "STYLE_GTK" ] = "no"; dictionary[ "SQL_MYSQL" ] = "no"; @@ -436,7 +434,7 @@ void Configure::parseCmdLine() } for( ; i<configCmdLine.size(); ++i ) { - bool continueElse = false; + bool continueElse[] = {false, false}; if( configCmdLine.at(i) == "-help" || configCmdLine.at(i) == "-h" || configCmdLine.at(i) == "-?" ) @@ -587,6 +585,13 @@ void Configure::parseCmdLine() dictionary[ "MNG" ] = "qt"; dictionary[ "LIBMNG" ] = "system"; } + + // Text Rendering -------------------------------------------- + else if( configCmdLine.at(i) == "-no-freetype" ) + dictionary[ "FREETYPE" ] = "no"; + else if( configCmdLine.at(i) == "-qt-freetype" ) + dictionary[ "FREETYPE" ] = "yes"; + // CE- C runtime -------------------------------------------- else if( configCmdLine.at(i) == "-crt" ) { ++i; @@ -605,10 +610,13 @@ void Configure::parseCmdLine() // cetest --------------------------------------------------- else if (configCmdLine.at(i) == "-no-cetest") { dictionary[ "CETEST" ] = "no"; + dictionary[ "CETEST_REQUESTED" ] = "no"; } else if (configCmdLine.at(i) == "-cetest") { // although specified to use it, we stay at "auto" state // this is because checkAvailability() adds variables - // we need for crosscompilation + // we need for crosscompilation; but remember if we asked + // for it. + dictionary[ "CETEST_REQUESTED" ] = "yes"; } // Qt/CE - signing tool ------------------------------------- else if( configCmdLine.at(i) == "-signature") { @@ -666,14 +674,19 @@ void Configure::parseCmdLine() else if( configCmdLine.at(i) == "-no-style-cde" ) dictionary[ "STYLE_CDE" ] = "no"; + else if( configCmdLine.at(i) == "-qt-style-s60" ) + dictionary[ "STYLE_S60" ] = "yes"; + else if( configCmdLine.at(i) == "-no-style-s60" ) + dictionary[ "STYLE_S60" ] = "no"; + // Qt 3 Support --------------------------------------------- else if( configCmdLine.at(i) == "-no-qt3support" ) dictionary[ "QT3SUPPORT" ] = "no"; // Work around compiler nesting limitation else - continueElse = true; - if (!continueElse) { + continueElse[1] = true; + if (!continueElse[1]) { } // OpenGL Support ------------------------------------------- @@ -689,6 +702,14 @@ void Configure::parseCmdLine() dictionary[ "OPENGL" ] = "yes"; dictionary[ "OPENGL_ES_2" ] = "yes"; } + + // OpenVG Support ------------------------------------------- + else if( configCmdLine.at(i) == "-openvg" ) { + dictionary[ "OPENVG" ] = "yes"; + } else if( configCmdLine.at(i) == "-no-openvg" ) { + dictionary[ "OPENVG" ] = "no"; + } + // Databases ------------------------------------------------ else if( configCmdLine.at(i) == "-qt-sql-mysql" ) dictionary[ "SQL_MYSQL" ] = "yes"; @@ -776,6 +797,20 @@ void Configure::parseCmdLine() dictionary[ "INCREDIBUILD_XGE" ] = "yes"; #if !defined(EVAL) // Others --------------------------------------------------- + else if (configCmdLine.at(i) == "-fpu" ) + { + ++i; + if(i==argCount) + break; + dictionary[ "ARM_FPU_TYPE" ] = configCmdLine.at(i); + } + + // S60 Support ------------------------------------------- + else if( configCmdLine.at(i) == "-s60" ) + dictionary[ "S60" ] = "yes"; + else if( configCmdLine.at(i) == "-no-s60" ) + dictionary[ "S60" ] = "no"; + else if (configCmdLine.at(i) == "-fast" ) dictionary[ "FAST" ] = "yes"; else if (configCmdLine.at(i) == "-no-fast" ) @@ -824,11 +859,7 @@ void Configure::parseCmdLine() else if (configCmdLine.at(i) == "-iwmmxt") dictionary[ "IWMMXT" ] = "yes"; - else if (configCmdLine.at(i) == "-no-direct3d") { - dictionary["DIRECT3D"] = "no"; - }else if (configCmdLine.at(i) == "-direct3d") { - dictionary["DIRECT3D"] = "auto"; // have to pass auto detection to enable Direct3D - } else if( configCmdLine.at(i) == "-no-openssl" ) { + else if( configCmdLine.at(i) == "-no-openssl" ) { dictionary[ "OPENSSL"] = "no"; } else if( configCmdLine.at(i) == "-openssl" ) { dictionary[ "OPENSSL" ] = "yes"; @@ -844,6 +875,10 @@ void Configure::parseCmdLine() dictionary[ "DBUS" ] = "yes"; } else if( configCmdLine.at(i) == "-dbus-linked" ) { dictionary[ "DBUS" ] = "linked"; + } else if( configCmdLine.at(i) == "-no-script" ) { + dictionary[ "SCRIPT" ] = "no"; + } else if( configCmdLine.at(i) == "-script" ) { + dictionary[ "SCRIPT" ] = "yes"; } else if( configCmdLine.at(i) == "-no-scripttools" ) { dictionary[ "SCRIPTTOOLS" ] = "no"; } else if( configCmdLine.at(i) == "-scripttools" ) { @@ -852,6 +887,10 @@ void Configure::parseCmdLine() dictionary[ "XMLPATTERNS" ] = "no"; } else if( configCmdLine.at(i) == "-xmlpatterns" ) { dictionary[ "XMLPATTERNS" ] = "yes"; + } else if( configCmdLine.at(i) == "-no-multimedia" ) { + dictionary[ "MULTIMEDIA" ] = "no"; + } else if( configCmdLine.at(i) == "-multimedia" ) { + dictionary[ "MULTIMEDIA" ] = "yes"; } else if( configCmdLine.at(i) == "-no-phonon" ) { dictionary[ "PHONON" ] = "no"; } else if( configCmdLine.at(i) == "-phonon" ) { @@ -872,6 +911,12 @@ void Configure::parseCmdLine() dictionary[ "PLUGIN_MANIFESTS" ] = "yes"; } + // Work around compiler nesting limitation + else + continueElse[0] = true; + if (!continueElse[0]) { + } + else if( configCmdLine.at(i) == "-internal" ) dictionary[ "QMAKE_INTERNAL" ] = "yes"; @@ -1046,7 +1091,9 @@ void Configure::parseCmdLine() if (i == argCount) break; QString system = configCmdLine.at(i); - if (system == QLatin1String("raster") || system == QLatin1String("opengl")) + if (system == QLatin1String("raster") + || system == QLatin1String("opengl") + || system == QLatin1String("openvg")) dictionary["GRAPHICS_SYSTEM"] = configCmdLine.at(i); } @@ -1107,12 +1154,29 @@ void Configure::parseCmdLine() } else { dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-g++"; } + } else if ( dictionary[ "QMAKESPEC" ] == QString( "win32-mwc" ) ) { + dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-mwc"; + dictionary[ "MAKE" ] = "make"; } else { if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "make"; dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32"; } } + // Tell the user how to proceed building Qt after configure finished its job + dictionary["QTBUILDINSTRUCTION"] = dictionary["MAKE"]; + if (dictionary.contains("XQMAKESPEC")) { + if (dictionary["XQMAKESPEC"].startsWith("symbian")) { + dictionary["QTBUILDINSTRUCTION"] = dictionary["MAKE"] + QString(" debug-winscw|debug-armv5|release-armv5"); + } else if (dictionary["XQMAKESPEC"].startsWith("wince")) { + dictionary["QTBUILDINSTRUCTION"] = + QString("setcepaths.bat ") + dictionary["XQMAKESPEC"] + QString(" && ") + dictionary["MAKE"]; + } + } + + // Tell the user how to confclean before the next configure + dictionary["CONFCLEANINSTRUCTION"] = dictionary["MAKE"] + QString(" confclean"); + // Ensure that -spec (XQMAKESPEC) exists in the mkspecs folder as well if (dictionary.contains("XQMAKESPEC") && !mkspecs.contains(dictionary["XQMAKESPEC"], Qt::CaseInsensitive)) { @@ -1144,6 +1208,10 @@ void Configure::parseCmdLine() useUnixSeparators = (dictionary["QMAKESPEC"] == "win32-g++"); + // Allow tests for private classes to be compiled against internal builds + if (dictionary["BUILDDEV"] == "yes") + qtConfig += "private_tests"; + #if !defined(EVAL) for( QStringList::Iterator dis = disabledModules.begin(); dis != disabledModules.end(); ++dis ) { @@ -1166,9 +1234,9 @@ void Configure::parseCmdLine() #if !defined(EVAL) void Configure::validateArgs() { - QStringList configs; // Validate the specified config + // Get all possible configurations from the file system. QDir dir; QStringList filters; filters << "qconfig-*.h"; @@ -1182,9 +1250,24 @@ void Configure::validateArgs() allConfigs << it->remove("qconfig-").remove(".h"); allConfigs << "full"; + // Try internal configurations first. + QStringList possible_configs = QStringList() + << "minimal" + << "small" + << "medium" + << "large" + << "full"; + int index = possible_configs.indexOf(dictionary["QCONFIG"]); + if (index >= 0) { + for (int c = 0; c <= index; c++) { + qmakeConfig += possible_configs[c] + "-config"; + } + return; + } + + // If the internal configurations failed, try others. QStringList::Iterator config; for( config = allConfigs.begin(); config != allConfigs.end(); ++config ) { - configs += (*config) + "-config"; if( (*config) == dictionary[ "QCONFIG" ] ) break; } @@ -1193,7 +1276,7 @@ void Configure::validateArgs() cout << "No such configuration \"" << qPrintable(dictionary[ "QCONFIG" ]) << "\"" << endl ; } else - qmakeConfig += configs; + qmakeConfig += (*config) + "-config"; } #endif @@ -1314,6 +1397,8 @@ void Configure::applySpecSpecifics() dictionary[ "STYLE_WINDOWSMOBILE" ] = "yes"; dictionary[ "STYLE_MOTIF" ] = "no"; dictionary[ "STYLE_CDE" ] = "no"; + dictionary[ "STYLE_S60" ] = "no"; + dictionary[ "FREETYPE" ] = "no"; dictionary[ "QT3SUPPORT" ] = "no"; dictionary[ "OPENGL" ] = "no"; dictionary[ "OPENSSL" ] = "no"; @@ -1327,7 +1412,6 @@ void Configure::applySpecSpecifics() dictionary[ "MMX" ] = "no"; dictionary[ "IWMMXT" ] = "no"; dictionary[ "CE_CRT" ] = "yes"; - dictionary[ "DIRECT3D" ] = "no"; dictionary[ "WEBKIT" ] = "no"; dictionary[ "PHONON" ] = "yes"; dictionary[ "DIRECTSHOW" ] = "no"; @@ -1341,6 +1425,49 @@ void Configure::applySpecSpecifics() dictionary[ "QT_HOST_PREFIX" ] = dictionary[ "QT_INSTALL_PREFIX" ]; dictionary[ "QT_INSTALL_PREFIX" ] = ""; + } else if(dictionary[ "XQMAKESPEC" ].startsWith("symbian")) { + dictionary[ "ACCESSIBILITY" ] = "no"; + dictionary[ "STYLE_WINDOWSXP" ] = "no"; + dictionary[ "STYLE_WINDOWSVISTA" ] = "no"; + dictionary[ "STYLE_PLASTIQUE" ] = "no"; + dictionary[ "STYLE_CLEANLOOKS" ] = "no"; + dictionary[ "STYLE_WINDOWSCE" ] = "no"; + dictionary[ "STYLE_WINDOWSMOBILE" ] = "no"; + dictionary[ "STYLE_MOTIF" ] = "no"; + dictionary[ "STYLE_CDE" ] = "no"; + dictionary[ "STYLE_S60" ] = "yes"; + dictionary[ "FREETYPE" ] = "no"; + dictionary[ "QT3SUPPORT" ] = "no"; + dictionary[ "OPENGL" ] = "no"; + dictionary[ "OPENSSL" ] = "yes"; + dictionary[ "STL" ] = "yes"; + dictionary[ "EXCEPTIONS" ] = "yes"; + dictionary[ "RTTI" ] = "yes"; + dictionary[ "ARCHITECTURE" ] = "symbian"; + dictionary[ "3DNOW" ] = "no"; + dictionary[ "SSE" ] = "no"; + dictionary[ "SSE2" ] = "no"; + dictionary[ "MMX" ] = "no"; + dictionary[ "IWMMXT" ] = "no"; + dictionary[ "CE_CRT" ] = "no"; + dictionary[ "DIRECT3D" ] = "no"; + dictionary[ "WEBKIT" ] = "no"; + dictionary[ "ASSISTANT_WEBKIT" ] = "no"; + dictionary[ "PHONON" ] = "yes"; + dictionary[ "XMLPATTERNS" ] = "no"; + dictionary[ "QT_GLIB" ] = "no"; + dictionary[ "S60" ] = "yes"; + // iconv makes makes apps start and run ridiculously slowly in symbian emulator (HW not tested) + // iconv_open seems to return -1 always, so something is probably missing from the platform. + dictionary[ "QT_ICONV" ] = "no"; + dictionary[ "SCRIPTTOOLS" ] = "no"; + dictionary[ "QT_HOST_PREFIX" ] = dictionary[ "QT_INSTALL_PREFIX" ]; + dictionary[ "QT_INSTALL_PREFIX" ] = ""; + dictionary[ "QT_INSTALL_PLUGINS" ] = "\\resource\\qt\\plugins"; + dictionary[ "ARM_FPU_TYPE" ] = "softvfp"; + dictionary[ "SQL_SQLITE" ] = "yes"; + dictionary[ "SQL_SQLITE_LIB" ] = "system"; + } else if(dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong. //TODO dictionary[ "STYLE_WINDOWSXP" ] = "no"; @@ -1427,13 +1554,13 @@ bool Configure::displayHelp() "[-system-libtiff] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg]\n" "[-no-libmng] [-qt-libmng] [-system-libmng] [-no-qt3support] [-mmx]\n" "[-no-mmx] [-3dnow] [-no-3dnow] [-sse] [-no-sse] [-sse2] [-no-sse2]\n" - "[-no-iwmmxt] [-iwmmxt] [-direct3d] [-openssl] [-openssl-linked]\n" + "[-no-iwmmxt] [-iwmmxt] [-openssl] [-openssl-linked]\n" "[-no-openssl] [-no-dbus] [-dbus] [-dbus-linked] [-platform <spec>]\n" "[-qtnamespace <namespace>] [-qtlibinfix <infix>] [-no-phonon]\n" "[-phonon] [-no-phonon-backend] [-phonon-backend]\n" - "[-no-webkit] [-webkit]\n" - "[-no-scripttools] [-scripttools]\n" - "[-graphicssystem raster|opengl]\n\n", 0, 7); + "[-no-multimedia] [-multimedia] [-no-webkit] [-webkit]\n" + "[-no-script] [-script] [-no-scripttools] [-scripttools]\n" + "[-graphicssystem raster|opengl|openvg]\n\n", 0, 7); desc("Installation options:\n\n"); @@ -1515,6 +1642,11 @@ bool Configure::displayHelp() desc("QT3SUPPORT", "no","-no-qt3support", "Disables the Qt 3 support functionality.\n"); desc("OPENGL", "no","-no-opengl", "Disables OpenGL functionality\n"); + desc("OPENVG", "no","-no-openvg", "Disables OpenVG functionality\n"); + desc("OPENVG", "yes","-openvg", "Enables OpenVG functionality"); + desc( "", "Requires EGL support, typically supplied by an OpenGL", false, ' '); + desc( "", "or other graphics implementation\n", false, ' '); + #endif desc( "-platform <spec>", "The operating system and compiler you are building on.\n(default %QMAKESPEC%)\n"); desc( "-xplatform <spec>", "The operating system and compiler you are cross compiling to.\n"); @@ -1532,6 +1664,7 @@ bool Configure::displayHelp() "Available values for <sys>:"); desc("GRAPHICS_SYSTEM", "raster", "", " raster - Software rasterizer", ' '); desc("GRAPHICS_SYSTEM", "opengl", "", " opengl - Using OpenGL acceleration, experimental!", ' '); + desc("GRAPHICS_SYSTEM", "openvg", "", " openvg - Using OpenVG acceleration, experimental!", ' '); desc( "-help, -h, -?", "Display this information.\n"); @@ -1595,7 +1728,6 @@ bool Configure::displayHelp() desc("SSE", "yes", "-sse", "Compile with use of SSE instructions"); desc("SSE2", "no", "-no-sse2", "Do not compile with use of SSE2 instructions"); desc("SSE2", "yes", "-sse2", "Compile with use of SSE2 instructions"); - desc("DIRECT3D", "yes", "-direct3d", "Compile in Direct3D support (experimental - see INSTALL for more info)"); desc("OPENSSL", "no", "-no-openssl", "Do not compile in OpenSSL support"); desc("OPENSSL", "yes", "-openssl", "Compile in run-time OpenSSL support"); desc("OPENSSL", "linked","-openssl-linked", "Compile in linked OpenSSL support"); @@ -1606,8 +1738,12 @@ bool Configure::displayHelp() desc("PHONON", "yes", "-phonon", "Compile the Phonon module (Phonon is built if a decent C++ compiler is used.)"); desc("PHONON_BACKEND","no", "-no-phonon-backend","Do not compile the platform-specific Phonon backend-plugin"); desc("PHONON_BACKEND","yes","-phonon-backend", "Compile in the platform-specific Phonon backend-plugin"); + desc("MULTIMEDIA", "no", "-no-multimedia", "Do not compile the multimedia module"); + desc("MULTIMEDIA", "yes","-multimedia", "Compile in multimedia module"); desc("WEBKIT", "no", "-no-webkit", "Do not compile in the WebKit module"); desc("WEBKIT", "yes", "-webkit", "Compile in the WebKit module (WebKit is built if a decent C++ compiler is used.)"); + desc("SCRIPT", "no", "-no-script", "Do not build the QtScript module."); + desc("SCRIPT", "yes", "-script", "Build the QtScript module."); desc("SCRIPTTOOLS", "no", "-no-scripttools", "Do not build the QtScriptTools module."); desc("SCRIPTTOOLS", "yes", "-scripttools", "Build the QtScriptTools module."); @@ -1615,6 +1751,7 @@ bool Configure::displayHelp() "Available values for <arch>:"); desc("ARCHITECTURE","windows", "", " windows", ' '); desc("ARCHITECTURE","windowsce", "", " windowsce", ' '); + desc("ARCHITECTURE","symbian", "", " symbian", ' '); desc("ARCHITECTURE","boundschecker", "", " boundschecker", ' '); desc("ARCHITECTURE","generic", "", " generic\n", ' '); @@ -1629,7 +1766,8 @@ bool Configure::displayHelp() desc("STYLE_MOTIF", "yes", "", " motif", ' '); desc("STYLE_CDE", "yes", "", " cde", ' '); desc("STYLE_WINDOWSCE", "yes", "", " windowsce", ' '); - desc("STYLE_WINDOWSMOBILE" , "yes", "", " windowsmobile\n", ' '); + desc("STYLE_WINDOWSMOBILE" , "yes", "", " windowsmobile", ' '); + desc("STYLE_S60" , "yes", "", " s60\n", ' '); /* We do not support -qconfig on Windows yet @@ -1658,44 +1796,61 @@ bool Configure::displayHelp() desc("OPENGL_ES_2", "no", "-opengl-es-2", "Enable support for OpenGL ES 2.0"); desc("DIRECTSHOW", "no", "-phonon-wince-ds9", "Enable Phonon Direct Show 9 backend for Windows CE"); + // Qt\Symbian only options go below here ----------------------------------------------------------------------------- + desc("Qt for Symbian OS only:\n\n"); + desc("FREETYPE", "no", "-no-freetype", "Do not compile in Freetype2 support."); + desc("FREETYPE", "yes", "-qt-freetype", "Use the libfreetype bundled with Qt."); + desc( "-fpu <flags>", "VFP type on ARM, supported options: softvfp(default) | vfpv2 | softvfp+vfpv2"); + desc("S60", "no", "-no-s60", "Do not compile in S60 support."); + desc("S60", "yes", "-s60", "Compile with support for the S60 UI Framework\n"); return true; } return false; } -bool Configure::findFileInPaths(const QString &fileName, const QStringList &paths) +QString Configure::findFileInPaths(const QString &fileName, const QString &paths) { +#if defined(Q_OS_WIN32) + QRegExp splitReg("[;,]"); +#else + QRegExp splitReg("[:]"); +#endif + QStringList pathList = paths.split(splitReg, QString::SkipEmptyParts); QDir d; - for( QStringList::ConstIterator it = paths.begin(); it != paths.end(); ++it ) { + for( QStringList::ConstIterator it = pathList.begin(); it != pathList.end(); ++it ) { // Remove any leading or trailing ", this is commonly used in the environment // variables QString path = (*it); - if ( path.startsWith( "\"" ) ) + if ( path.startsWith( '\"' ) ) path = path.right( path.length() - 1 ); - if ( path.endsWith( "\"" ) ) + if ( path.endsWith( '\"' ) ) path = path.left( path.length() - 1 ); if( d.exists( path + QDir::separator() + fileName ) ) - return true; + return path; } - return false; + return QString(); } bool Configure::findFile( const QString &fileName ) { - QString file = fileName.toLower(); - QStringList paths; -#if defined(Q_OS_WIN32) - QRegExp splitReg("[;,]"); -#else - QRegExp splitReg("[:]"); -#endif - if (file.endsWith(".h")) - paths = QString::fromLocal8Bit(getenv("INCLUDE")).split(splitReg, QString::SkipEmptyParts); - else if ( file.endsWith( ".lib" ) ) - paths = QString::fromLocal8Bit(getenv("LIB")).split(splitReg, QString::SkipEmptyParts); - else - paths = QString::fromLocal8Bit(getenv("PATH")).split(splitReg, QString::SkipEmptyParts); - return findFileInPaths(file, paths); + const QString file = fileName.toLower(); + const QString pathEnvVar = QString::fromLocal8Bit(getenv("PATH")); + const QString mingwPath = dictionary["QMAKESPEC"].endsWith("-g++") ? + findFileInPaths("mingw32-g++.exe", pathEnvVar) : QString(); + + QString paths; + if (file.endsWith(".h")) { + if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull()) + return true; + paths = QString::fromLocal8Bit(getenv("INCLUDE")); + } else if ( file.endsWith( ".lib" ) || file.endsWith( ".a" ) ) { + if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../lib")).isNull()) + return true; + paths = QString::fromLocal8Bit(getenv("LIB")); + } else { + paths = pathEnvVar; + } + return !findFileInPaths(file, paths).isNull(); } /*! @@ -1765,7 +1920,7 @@ bool Configure::checkAvailability(const QString &part) { bool available = false; if (part == "STYLE_WINDOWSXP") - available = (dictionary.value("QMAKESPEC") == "win32-g++" || findFile("uxtheme.h")); + available = (findFile("uxtheme.h")); else if (part == "ZLIB") available = findFile("zlib.h"); @@ -1791,12 +1946,21 @@ bool Configure::checkAvailability(const QString &part) else if (part == "SQL_DB2") available = findFile("sqlcli.h") && findFile("sqlcli1.h") && findFile("db2cli.lib"); else if (part == "SQL_SQLITE") + if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) + available = false; // In Symbian we only support system sqlite option + else available = true; // Built in, we have a fork else if (part == "SQL_SQLITE_LIB") { if (dictionary[ "SQL_SQLITE_LIB" ] == "system") { - available = findFile("sqlite3.h") && findFile("sqlite3.lib"); - if (available) - dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib"; + // Symbian has multiple .lib/.dll files we need to find + if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) { + available = true; // There is sqlite_symbian plugin which exports the necessary stuff + dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3"; + } else { + available = findFile("sqlite3.h") && findFile("sqlite3.lib"); + if (available) + dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib"; + } } else available = true; } else if (part == "SQL_SQLITE2") @@ -1831,6 +1995,11 @@ bool Configure::checkAvailability(const QString &part) dictionary[ "QT_CE_RAPI_INC" ] += QLatin1String("\"") + rapiHeader + QLatin1String("\""); dictionary[ "QT_CE_RAPI_LIB" ] += QLatin1String("\"") + rapiLib + QLatin1String("\""); } + else if (dictionary[ "CETEST_REQUESTED" ] == "yes") { + cout << "cetest could not be enabled: rapi.h and rapi.lib could not be found." << endl; + cout << "Make sure the environment is set up for compiling with ActiveSync." << endl; + dictionary[ "DONE" ] = "error"; + } } else if (part == "INCREDIBUILD_XGE") available = findFile("BuildConsole.exe") && findFile("xgConsole.exe"); @@ -1841,60 +2010,28 @@ bool Configure::checkAvailability(const QString &part) && 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 && dictionary.value("QMAKESPEC") != "win32-msvc2002" && dictionary.value("EXCEPTIONS") == "yes"; - } else if (part == "DIRECT3D") { - QString sdk_dir(QString::fromLocal8Bit(getenv("DXSDK_DIR"))); - QDir dir; - bool has_d3d = false; - - if (!sdk_dir.isEmpty() && dir.exists(sdk_dir)) - has_d3d = true; - - if (has_d3d && !QFile::exists(sdk_dir + QLatin1String("\\include\\d3d9.h"))) { - cout << "No Direct3D version 9 SDK found." << endl; - has_d3d = false; - } - - // find the first dxguid.lib in the current LIB paths, if it is NOT - // the D3D SDK one, we're most likely in trouble.. - if (has_d3d) { - has_d3d = false; - QString env_lib(QString::fromLocal8Bit(getenv("LIB"))); - QStringList lib_paths = env_lib.split(';'); - for (int i=0; i<lib_paths.size(); ++i) { - QString lib_path = lib_paths.at(i); - if (QFile::exists(lib_path + QLatin1String("\\dxguid.lib"))) - { - if (lib_path.startsWith(sdk_dir)) { - has_d3d = true; - } else { - cout << "Your D3D/Platform SDK library paths seem to appear in the wrong order." << endl; - } - break; - } - } - } - - available = has_d3d; - if (!has_d3d) { - cout << "Setting Direct3D to NO, since the proper Direct3D SDK was not detected." << endl - << "Make sure you have the Direct3D SDK installed, and that you have run" << endl - << "the <path to SDK>\\Utilities\\Bin\\dx_setenv.cmd script." << endl - << "The D3D SDK library path *needs* to appear before the Platform SDK library" << endl - << "path in your LIB environment variable." << endl; - } } else if (part == "PHONON") { - available = findFile("vmr9.h") && findFile("dshow.h") && findFile("strmiids.lib") && - findFile("dmoguids.lib") && findFile("msdmo.lib") && findFile("d3d9.h"); + available = findFile("vmr9.h") && findFile("dshow.h") && findFile("dmo.h") && findFile("dmodshow.h") + && (findFile("strmiids.lib") || findFile("libstrmiids.a")) + && (findFile("dmoguids.lib") || findFile("libdmoguids.a")) + && (findFile("msdmo.lib") || findFile("libmsdmo.a")) + && findFile("d3d9.h"); if (!available) { cout << "All the required DirectShow/Direct3D files couldn't be found." << endl - << "Make sure you have either the platform SDK AND the DirectX SDK or the Windows SDK installed." << endl - << "If you have the DirectX SDK installed, please make sure that you have run the <path to SDK>\\SetEnv.Cmd script." << endl; - } - } else if (part == "WEBKIT") { - available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-g++"); - } else if (part == "SCRIPTTOOLS") { + << "Make sure you have either the platform SDK AND the DirectShow SDK or the Windows SDK installed." << endl + << "If you have the DirectShow SDK installed, please make sure that you have run the <path to SDK>\\SetEnv.Cmd script." << endl; + if (!findFile("vmr9.h")) cout << "vmr9.h not found" << endl; + if (!findFile("dshow.h")) cout << "dshow.h not found" << endl; + if (!findFile("strmiids.lib")) cout << "strmiids.lib not found" << endl; + if (!findFile("dmoguids.lib")) cout << "dmoguids.lib not found" << endl; + if (!findFile("msdmo.lib")) cout << "msdmo.lib not found" << endl; + if (!findFile("d3d9.h")) cout << "d3d9.h not found" << endl; + } + } else if (part == "MULTIMEDIA") { available = true; + } else if (part == "WEBKIT" || part == "SCRIPT" || part == "SCRIPTTOOLS") { + available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-g++"); } return available; @@ -1971,12 +2108,12 @@ void Configure::autoDetection() dictionary["OPENSSL"] = checkAvailability("OPENSSL") ? "yes" : "no"; if (dictionary["DBUS"] == "auto") dictionary["DBUS"] = checkAvailability("DBUS") ? "yes" : "no"; + if (dictionary["SCRIPT"] == "auto") + dictionary["SCRIPT"] = checkAvailability("SCRIPT") ? "yes" : "no"; if (dictionary["SCRIPTTOOLS"] == "auto") dictionary["SCRIPTTOOLS"] = checkAvailability("SCRIPTTOOLS") ? "yes" : "no"; if (dictionary["XMLPATTERNS"] == "auto") dictionary["XMLPATTERNS"] = checkAvailability("XMLPATTERNS") ? "yes" : "no"; - if (dictionary["DIRECT3D"] == "auto") - dictionary["DIRECT3D"] = checkAvailability("DIRECT3D") ? "yes" : "no"; if (dictionary["PHONON"] == "auto") dictionary["PHONON"] = checkAvailability("PHONON") ? "yes" : "no"; if (dictionary["WEBKIT"] == "auto") @@ -2024,6 +2161,15 @@ bool Configure::verifyConfiguration() if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout) exit(0); // Exit cleanly for Ctrl+C } + if (0 != dictionary["ARM_FPU_TYPE"].size()) + { + QStringList l= QStringList() + << "softvfp" + << "softvfp+vfpv2" + << "vfpv2"; + if (!(l.contains(dictionary["ARM_FPU_TYPE"]))) + cout << QString("WARNING: Using unsupported fpu flag: %1").arg(dictionary["ARM_FPU_TYPE"]) << endl; + } return true; } @@ -2046,7 +2192,6 @@ bool Configure::verifyConfiguration() no-gif gif dll staticlib - internal nocrosscompiler GNUmake largefile @@ -2072,8 +2217,6 @@ void Configure::generateBuildKey() QStringList build_options; if (!dictionary["QCONFIG"].isEmpty()) build_options += dictionary["QCONFIG"] + "-config "; - if (dictionary["STL"] == "no") - build_options += "no-stl"; build_options.sort(); // Sorted defines that start with QT_NO_ @@ -2173,6 +2316,10 @@ void Configure::generateOutputVars() if( dictionary[ "LIBMNG" ] == "system" ) qtConfig += "system-mng"; + // Text rendering -------------------------------------------------- + if( dictionary[ "FREETYPE" ] == "yes" ) + qtConfig += "freetype"; + // Styles ------------------------------------------------------- if ( dictionary[ "STYLE_WINDOWS" ] == "yes" ) qmakeStyles += "windows"; @@ -2204,6 +2351,9 @@ void Configure::generateOutputVars() if ( dictionary[ "STYLE_CDE" ] == "yes" ) qmakeStyles += "cde"; + if ( dictionary[ "STYLE_S60" ] == "yes" ) + qmakeStyles += "s60"; + // Databases ---------------------------------------------------- if ( dictionary[ "SQL_MYSQL" ] == "yes" ) qmakeSql += "mysql"; @@ -2298,12 +2448,18 @@ void Configure::generateOutputVars() qtConfig += "opengles1cl"; } + if ( dictionary["OPENVG"] == "yes" ) { + qtConfig += "openvg"; + qtConfig += "egl"; + } + + if ( dictionary["S60"] == "yes" ) { + qtConfig += "s60"; + } + if ( dictionary["DIRECTSHOW"] == "yes" ) qtConfig += "directshow"; - if (dictionary[ "DIRECT3D" ] == "yes") - qtConfig += "direct3d"; - if (dictionary[ "OPENSSL" ] == "yes") qtConfig += "openssl"; else if (dictionary[ "OPENSSL" ] == "linked") @@ -2322,8 +2478,17 @@ void Configure::generateOutputVars() if (dictionary[ "CETEST" ] == "yes") qtConfig += "cetest"; - if (dictionary[ "SCRIPTTOOLS" ] == "yes") + if (dictionary[ "SCRIPT" ] == "yes") + qtConfig += "script"; + + if (dictionary[ "SCRIPTTOOLS" ] == "yes") { + if (dictionary[ "SCRIPT" ] == "no") { + cout << "QtScriptTools was requested, but it can't be built due to QtScript being " + "disabled." << endl; + dictionary[ "DONE" ] = "error"; + } qtConfig += "scripttools"; + } if (dictionary[ "XMLPATTERNS" ] == "yes") qtConfig += "xmlpatterns"; @@ -2334,6 +2499,9 @@ void Configure::generateOutputVars() qtConfig += "phonon-backend"; } + if (dictionary["MULTIMEDIA"] == "yes") + qtConfig += "multimedia"; + if (dictionary["WEBKIT"] == "yes") qtConfig += "webkit"; @@ -2357,6 +2525,9 @@ void Configure::generateOutputVars() } } + if (dictionary.contains("XQMAKESPEC") && ( dictionary["QMAKESPEC"] != dictionary["XQMAKESPEC"] ) ) + qmakeConfig += "cross_compile"; + // Directories and settings for .qmake.cache -------------------- // if QT_INSTALL_* have not been specified on commandline, define them now from QT_INSTALL_PREFIX @@ -2397,8 +2568,12 @@ void Configure::generateOutputVars() qmakeVars += QString("INCLUDEPATH += ") + qmakeIncludes.join( " " ); if (!opensslLibs.isEmpty()) qmakeVars += opensslLibs; - else if (dictionary[ "OPENSSL" ] == "linked") - qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32"); + else if (dictionary[ "OPENSSL" ] == "linked") { + if(dictionary[ "XQMAKESPEC" ].startsWith("symbian") ) + qmakeVars += QString("OPENSSL_LIBS = -llibssl -llibcrypto"); + else + qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32"); + } if (!qmakeSql.isEmpty()) qmakeVars += QString("sql-drivers += ") + qmakeSql.join( " " ); if (!qmakeSqlPlugins.isEmpty()) @@ -2562,6 +2737,10 @@ void Configure::generateCachefile() if (!dictionary["QT_LIBINFIX"].isEmpty()) configStream << "QT_LIBINFIX = " << dictionary["QT_LIBINFIX"] << endl; + if(!dictionary["ARM_FPU_TYPE"].isEmpty()) { + configStream<<"QMAKE_CXXFLAGS.ARMCC += --fpu "<< dictionary["ARM_FPU_TYPE"]; + } + configStream.flush(); configFile.close(); } @@ -2601,6 +2780,18 @@ QString Configure::addDefine(QString def) } #if !defined(EVAL) +// ### This should be removed once Qt for S60 is out. +static void applyTemporarySymbianFlags(QStringList &qconfigList) +{ + qconfigList += "QT_NO_CONCURRENT"; + qconfigList += "QT_NO_QFUTURE"; + // This is removed because it uses UNIX signals which are not implemented yet + qconfigList += "QT_NO_CRASHHANDLER"; + qconfigList += "QT_NO_PRINTER"; + qconfigList += "QT_NO_CURSOR"; + qconfigList += "QT_NO_SYSTEMTRAYICON"; +} + void Configure::generateConfigfiles() { QDir(buildPath).mkpath("src/corelib/global"); @@ -2670,6 +2861,7 @@ void Configure::generateConfigfiles() if(dictionary["STYLE_WINDOWSVISTA"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSVISTA"; if(dictionary["STYLE_MOTIF"] != "yes") qconfigList += "QT_NO_STYLE_MOTIF"; if(dictionary["STYLE_CDE"] != "yes") qconfigList += "QT_NO_STYLE_CDE"; + if(dictionary["STYLE_S60"] != "yes") qconfigList += "QT_NO_STYLE_S60"; if(dictionary["STYLE_WINDOWSCE"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSCE"; if(dictionary["STYLE_WINDOWSMOBILE"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSMOBILE"; if(dictionary["STYLE_GTK"] != "yes") qconfigList += "QT_NO_STYLE_GTK"; @@ -2684,19 +2876,22 @@ void Configure::generateConfigfiles() qconfigList += "QT_NO_COMPRESS"; } - if(dictionary["QT3SUPPORT"] == "no") qconfigList += "QT_NO_QT3SUPPORT"; if(dictionary["ACCESSIBILITY"] == "no") qconfigList += "QT_NO_ACCESSIBILITY"; if(dictionary["EXCEPTIONS"] == "no") qconfigList += "QT_NO_EXCEPTIONS"; if(dictionary["OPENGL"] == "no") qconfigList += "QT_NO_OPENGL"; - if(dictionary["DIRECT3D"] == "no") qconfigList += "QT_NO_DIRECT3D"; + if(dictionary["OPENVG"] == "no") qconfigList += "QT_NO_OPENVG"; if(dictionary["OPENSSL"] == "no") qconfigList += "QT_NO_OPENSSL"; if(dictionary["OPENSSL"] == "linked") qconfigList += "QT_LINKED_OPENSSL"; if(dictionary["DBUS"] == "no") qconfigList += "QT_NO_DBUS"; if(dictionary["IPV6"] == "no") qconfigList += "QT_NO_IPV6"; if(dictionary["WEBKIT"] == "no") qconfigList += "QT_NO_WEBKIT"; if(dictionary["PHONON"] == "no") qconfigList += "QT_NO_PHONON"; + if(dictionary["MULTIMEDIA"] == "no") qconfigList += "QT_NO_MULTIMEDIA"; if(dictionary["XMLPATTERNS"] == "no") qconfigList += "QT_NO_XMLPATTERNS"; + if(dictionary["SCRIPT"] == "no") qconfigList += "QT_NO_SCRIPT"; if(dictionary["SCRIPTTOOLS"] == "no") qconfigList += "QT_NO_SCRIPTTOOLS"; + if(dictionary["FREETYPE"] == "no") qconfigList += "QT_NO_FREETYPE"; + if(dictionary["S60"] == "no") qconfigList += "QT_NO_S60"; if(dictionary["OPENGL_ES_CM"] == "yes" || dictionary["OPENGL_ES_CL"] == "yes" || @@ -2716,8 +2911,13 @@ void Configure::generateConfigfiles() if(dictionary["SQL_SQLITE2"] == "yes") qconfigList += "QT_SQL_SQLITE2"; if(dictionary["SQL_IBASE"] == "yes") qconfigList += "QT_SQL_IBASE"; + if (dictionary["GRAPHICS_SYSTEM"] == "openvg") qconfigList += "QT_GRAPHICSSYSTEM_OPENVG"; if (dictionary["GRAPHICS_SYSTEM"] == "opengl") qconfigList += "QT_GRAPHICSSYSTEM_OPENGL"; if (dictionary["GRAPHICS_SYSTEM"] == "raster") qconfigList += "QT_GRAPHICSSYSTEM_RASTER"; + // ### This block should be removed once Qt for S60 is out. + if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) { + applyTemporarySymbianFlags(qconfigList); + } qconfigList.sort(); for (int i = 0; i < qconfigList.count(); ++i) @@ -2779,7 +2979,7 @@ void Configure::generateConfigfiles() tmpFile.flush(); // Replace old qconfig.h with new one - ::SetFileAttributesA(outName.toLocal8Bit(), FILE_ATTRIBUTE_NORMAL); + ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL); QFile::remove(outName); tmpFile.copy(outName); tmpFile.close(); @@ -2815,7 +3015,7 @@ void Configure::generateConfigfiles() } outName = defSpec + "/qmake.conf"; - ::SetFileAttributesA(outName.toLocal8Bit(), FILE_ATTRIBUTE_NORMAL ); + ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL ); QFile qmakeConfFile(outName); if (qmakeConfFile.open(QFile::Append | QFile::WriteOnly | QFile::Text)) { QTextStream qmakeConfStream; @@ -2883,7 +3083,7 @@ void Configure::generateConfigfiles() tmpFile2.flush(); // Replace old qconfig.cpp with new one - ::SetFileAttributesA(outName.toLocal8Bit(), FILE_ATTRIBUTE_NORMAL ); + ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL ); QFile::remove( outName ); tmpFile2.copy(outName); tmpFile2.close(); @@ -2949,12 +3149,14 @@ void Configure::displayConfig() cout << "SSE2 support................" << dictionary[ "SSE2" ] << endl; cout << "IWMMXT support.............." << dictionary[ "IWMMXT" ] << endl; cout << "OpenGL support.............." << dictionary[ "OPENGL" ] << endl; - cout << "Direct3D support............" << dictionary[ "DIRECT3D" ] << endl; + cout << "OpenVG support.............." << dictionary[ "OPENVG" ] << endl; cout << "OpenSSL support............." << dictionary[ "OPENSSL" ] << endl; cout << "QtDBus support.............." << dictionary[ "DBUS" ] << endl; cout << "QtXmlPatterns support......." << dictionary[ "XMLPATTERNS" ] << endl; cout << "Phonon support.............." << dictionary[ "PHONON" ] << endl; + cout << "QtMultimedia support........" << dictionary[ "MULTIMEDIA" ] << endl; cout << "WebKit support.............." << dictionary[ "WEBKIT" ] << endl; + cout << "QtScript support............" << dictionary[ "SCRIPT" ] << endl; cout << "QtScriptTools support......." << dictionary[ "SCRIPTTOOLS" ] << endl; cout << "Graphics System............." << dictionary[ "GRAPHICS_SYSTEM" ] << endl; cout << "Qt3 compatibility..........." << dictionary[ "QT3SUPPORT" ] << endl << endl; @@ -2965,7 +3167,8 @@ void Configure::displayConfig() cout << " TIFF support............" << dictionary[ "TIFF" ] << endl; cout << " JPEG support............" << dictionary[ "JPEG" ] << endl; cout << " PNG support............." << dictionary[ "PNG" ] << endl; - cout << " MNG support............." << dictionary[ "MNG" ] << endl << endl; + cout << " MNG support............." << dictionary[ "MNG" ] << endl; + cout << " FreeType support........" << dictionary[ "FREETYPE" ] << endl << endl; cout << "Styles:" << endl; cout << " Windows................." << dictionary[ "STYLE_WINDOWS" ] << endl; @@ -2976,7 +3179,8 @@ void Configure::displayConfig() cout << " Motif..................." << dictionary[ "STYLE_MOTIF" ] << endl; cout << " CDE....................." << dictionary[ "STYLE_CDE" ] << endl; cout << " Windows CE.............." << dictionary[ "STYLE_WINDOWSCE" ] << endl; - cout << " Windows Mobile.........." << dictionary[ "STYLE_WINDOWSMOBILE" ] << endl << endl; + cout << " Windows Mobile.........." << dictionary[ "STYLE_WINDOWSMOBILE" ] << endl; + cout << " S60....................." << dictionary[ "STYLE_S60" ] << endl << endl; cout << "Sql Drivers:" << endl; cout << " ODBC...................." << dictionary[ "SQL_ODBC" ] << endl; @@ -3008,6 +3212,10 @@ void Configure::displayConfig() cout << "Signature..................." << dictionary[ "CE_SIGNATURE"] << endl << endl; } + if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith(QLatin1String("symbian"))) { + cout << "Support for S60............." << dictionary[ "S60" ] << endl; + } + if(dictionary["ASSISTANT_WEBKIT"] == "yes") cout << "Using WebKit as html rendering engine in Qt Assistant." << endl; @@ -3141,6 +3349,9 @@ void Configure::buildQmake() void Configure::buildHostTools() { + if (dictionary[ "NOPROCESS" ] == "yes") + dictionary[ "DONE" ] = "yes"; + if (!dictionary.contains("XQMAKESPEC")) return; @@ -3150,8 +3361,10 @@ void Configure::buildHostTools() << "src/tools/bootstrap" << "src/tools/moc" << "src/tools/rcc" - << "src/tools/uic" - << "tools/checksdk"; + << "src/tools/uic"; + + if(dictionary["XQMAKESPEC"].startsWith("wince")) + hostToolsDirs << "tools/checksdk"; if (dictionary[ "CETEST" ] == "yes") hostToolsDirs << "tools/qtestlib/wince/cetest"; @@ -3364,7 +3577,6 @@ void Configure::generateMakefiles() } else { cout << "Processing of project files have been disabled." << endl; cout << "Only use this option if you really know what you're doing." << endl << endl; - dictionary[ "DONE" ] = "yes"; return; } } @@ -3372,8 +3584,19 @@ void Configure::generateMakefiles() void Configure::showSummary() { QString make = dictionary[ "MAKE" ]; - cout << endl << endl << "Qt is now configured for building. Just run " << qPrintable(make) << "." << endl; - cout << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl; + if (!dictionary.contains("XQMAKESPEC")) { + cout << endl << endl << "Qt is now configured for building. Just run " << qPrintable(make) << "." << endl; + cout << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl; + } else if(dictionary.value("QMAKESPEC").startsWith("wince")) { + // we are cross compiling for Windows CE + cout << endl << endl << "Qt is now configured for building. To start the build run:" << endl + << "\tsetcepaths " << dictionary.value("XQMAKESPEC") << endl + << "\t" << qPrintable(make) << endl + << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl; + } else { // Compiling for Symbian OS + cout << endl << endl << "Qt is now configured for building. To start the build run:" << qPrintable(dictionary["QTBUILDINSTRUCTION"]) << "." << endl + << "To reconfigure, run '" << qPrintable(dictionary["CONFCLEANINSTRUCTION"]) << "' and configure." << endl; + } } Configure::ProjectType Configure::projectType( const QString& proFileName ) @@ -3489,9 +3712,13 @@ bool Configure::showLicense(QString orgLicenseFile) void Configure::readLicense() { - dictionary[ "PLATFORM NAME" ] = (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/src/corelib/kernel/qfunctions_wince.h") - && (dictionary.value("QMAKESPEC").startsWith("wince") || dictionary.value("XQMAKESPEC").startsWith("wince"))) - ? "Qt for Windows CE" : "Qt for Windows"; + if (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/src/corelib/kernel/qfunctions_wince.h") && + (dictionary.value("QMAKESPEC").startsWith("wince") || dictionary.value("XQMAKESPEC").startsWith("wince"))) + dictionary["PLATFORM NAME"] = "Qt for Windows CE"; + else if (dictionary.value("XQMAKESPEC").startsWith("symbian")) + dictionary["PLATFORM NAME"] = "Qt for S60"; + else + dictionary["PLATFORM NAME"] = "Qt for Windows"; dictionary["LICENSE FILE"] = sourcePath; bool openSource = false; diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 0ce8ec5..fa8a76a 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -150,8 +150,8 @@ private: QString fixSeparators(QString somePath); bool filesDiffer(const QString &file1, const QString &file2); - static bool findFile(const QString &fileName); - static bool findFileInPaths(const QString &fileName, const QStringList &paths); + bool findFile(const QString &fileName); + static QString findFileInPaths(const QString &fileName, const QString &paths); #if !defined(EVAL) void reloadCmdLine(); void saveCmdLine(); diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp index 6183c28..b349295 100644 --- a/tools/configure/environment.cpp +++ b/tools/configure/environment.cpp @@ -146,26 +146,14 @@ QString Environment::readRegistryKey(HKEY parentHandle, const QString &rSubkey) QString rSubkeyPath = keyPath(rSubkey); HKEY handle = 0; - LONG res; - QT_WA( { - res = RegOpenKeyExW(parentHandle, (WCHAR*)rSubkeyPath.utf16(), - 0, KEY_READ, &handle); - } , { - res = RegOpenKeyExA(parentHandle, rSubkeyPath.toLocal8Bit(), - 0, KEY_READ, &handle); - } ); - + LONG res = RegOpenKeyEx(parentHandle, (wchar_t*)rSubkeyPath.utf16(), 0, KEY_READ, &handle); if (res != ERROR_SUCCESS) return QString(); // get the size and type of the value DWORD dataType; DWORD dataSize; - QT_WA( { - res = RegQueryValueExW(handle, (WCHAR*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize); - }, { - res = RegQueryValueExA(handle, rSubkeyName.toLocal8Bit(), 0, &dataType, 0, &dataSize); - } ); + res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize); if (res != ERROR_SUCCESS) { RegCloseKey(handle); return QString(); @@ -173,13 +161,8 @@ QString Environment::readRegistryKey(HKEY parentHandle, const QString &rSubkey) // get the value QByteArray data(dataSize, 0); - QT_WA( { - res = RegQueryValueExW(handle, (WCHAR*)rSubkeyName.utf16(), 0, 0, - reinterpret_cast<unsigned char*>(data.data()), &dataSize); - }, { - res = RegQueryValueExA(handle, rSubkeyName.toLocal8Bit(), 0, 0, - reinterpret_cast<unsigned char*>(data.data()), &dataSize); - } ); + res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, 0, + reinterpret_cast<unsigned char*>(data.data()), &dataSize); if (res != ERROR_SUCCESS) { RegCloseKey(handle); return QString(); @@ -189,11 +172,7 @@ QString Environment::readRegistryKey(HKEY parentHandle, const QString &rSubkey) switch (dataType) { case REG_EXPAND_SZ: case REG_SZ: { - QT_WA( { - result = QString::fromUtf16(((const ushort*)data.constData())); - }, { - result = QString::fromLatin1(data.constData()); - } ); + result = QString::fromWCharArray(((const wchar_t *)data.constData())); break; } @@ -201,29 +180,20 @@ QString Environment::readRegistryKey(HKEY parentHandle, const QString &rSubkey) QStringList l; int i = 0; for (;;) { - QString s; - QT_WA( { - s = QString::fromUtf16((const ushort*)data.constData() + i); - }, { - s = QString::fromLatin1(data.constData() + i); - } ); + QString s = QString::fromWCharArray((const wchar_t *)data.constData() + i); i += s.length() + 1; if (s.isEmpty()) break; l.append(s); } - result = l.join(", "); + result = l.join(", "); break; } case REG_NONE: case REG_BINARY: { - QT_WA( { - result = QString::fromUtf16((const ushort*)data.constData(), data.size()/2); - }, { - result = QString::fromLatin1(data.constData(), data.size()); - } ); + result = QString::fromWCharArray((const wchar_t *)data.constData(), data.size() / 2); break; } @@ -232,7 +202,7 @@ QString Environment::readRegistryKey(HKEY parentHandle, const QString &rSubkey) Q_ASSERT(data.size() == sizeof(int)); int i; memcpy((char*)&i, data.constData(), sizeof(int)); - result = QString::number(i); + result = QString::number(i); break; } @@ -350,29 +320,14 @@ bool Environment::detectExecutable(const QString &executable) PROCESS_INFORMATION procInfo; memset(&procInfo, 0, sizeof(procInfo)); - bool couldExecute; - QT_WA({ - // Unicode version - STARTUPINFOW startInfo; - memset(&startInfo, 0, sizeof(startInfo)); - startInfo.cb = sizeof(startInfo); - - couldExecute = CreateProcessW(0, (WCHAR*)executable.utf16(), - 0, 0, false, - CREATE_NO_WINDOW | CREATE_SUSPENDED, - 0, 0, &startInfo, &procInfo); - - }, { - // Ansi version - STARTUPINFOA startInfo; - memset(&startInfo, 0, sizeof(startInfo)); - startInfo.cb = sizeof(startInfo); + STARTUPINFO startInfo; + memset(&startInfo, 0, sizeof(startInfo)); + startInfo.cb = sizeof(startInfo); - couldExecute = CreateProcessA(0, executable.toLocal8Bit().data(), + bool couldExecute = CreateProcess(0, (wchar_t*)executable.utf16(), 0, 0, false, CREATE_NO_WINDOW | CREATE_SUSPENDED, 0, 0, &startInfo, &procInfo); - }) if (couldExecute) { CloseHandle(procInfo.hThread); @@ -421,61 +376,38 @@ static QString qt_create_commandline(const QString &program, const QStringList & } /*! - Creates a QByteArray of the \a environment in either UNICODE or - ansi representation. + Creates a QByteArray of the \a environment. */ static QByteArray qt_create_environment(const QStringList &environment) { QByteArray envlist; - if (!environment.isEmpty()) { - int pos = 0; - // add PATH if necessary (for DLL loading) - QByteArray path = qgetenv("PATH"); - QT_WA({ - if (environment.filter(QRegExp("^PATH=",Qt::CaseInsensitive)).isEmpty() - && !path.isNull()) { - QString tmp = QString(QLatin1String("PATH=%1")).arg(QString::fromLocal8Bit(path)); - uint tmpSize = sizeof(TCHAR) * (tmp.length()+1); - envlist.resize(envlist.size() + tmpSize ); - memcpy(envlist.data()+pos, tmp.utf16(), tmpSize); - pos += tmpSize; - } - // add the user environment - for (QStringList::ConstIterator it = environment.begin(); it != environment.end(); it++ ) { - QString tmp = *it; - uint tmpSize = sizeof(TCHAR) * (tmp.length()+1); - envlist.resize(envlist.size() + tmpSize); - memcpy(envlist.data()+pos, tmp.utf16(), tmpSize); - pos += tmpSize; - } - // add the 2 terminating 0 (actually 4, just to be on the safe side) - envlist.resize( envlist.size()+4 ); - envlist[pos++] = 0; - envlist[pos++] = 0; - envlist[pos++] = 0; - envlist[pos++] = 0; - }, { - if (environment.filter(QRegExp("^PATH=",Qt::CaseInsensitive)).isEmpty() && !path.isNull()) { - QByteArray tmp = QString("PATH=%1").arg(QString::fromLocal8Bit(path)).toLocal8Bit(); - uint tmpSize = tmp.length() + 1; - envlist.resize(envlist.size() + tmpSize); - memcpy(envlist.data()+pos, tmp.data(), tmpSize); - pos += tmpSize; - } - // add the user environment - for (QStringList::ConstIterator it = environment.begin(); it != environment.end(); it++) { - QByteArray tmp = (*it).toLocal8Bit(); - uint tmpSize = tmp.length() + 1; - envlist.resize(envlist.size() + tmpSize); - memcpy(envlist.data()+pos, tmp.data(), tmpSize); - pos += tmpSize; - } - // add the terminating 0 (actually 2, just to be on the safe side) - envlist.resize(envlist.size()+2); - envlist[pos++] = 0; - envlist[pos++] = 0; - }) + if (environment.isEmpty()) + return envlist; + + int pos = 0; + // add PATH if necessary (for DLL loading) + QByteArray path = qgetenv("PATH"); + if (environment.filter(QRegExp("^PATH=",Qt::CaseInsensitive)).isEmpty() && !path.isNull()) { + QString tmp = QString(QLatin1String("PATH=%1")).arg(QString::fromLocal8Bit(path)); + uint tmpSize = sizeof(wchar_t) * (tmp.length() + 1); + envlist.resize(envlist.size() + tmpSize); + memcpy(envlist.data() + pos, tmp.utf16(), tmpSize); + pos += tmpSize; } + // add the user environment + for (QStringList::ConstIterator it = environment.begin(); it != environment.end(); it++ ) { + QString tmp = *it; + uint tmpSize = sizeof(wchar_t) * (tmp.length() + 1); + envlist.resize(envlist.size() + tmpSize); + memcpy(envlist.data() + pos, tmp.utf16(), tmpSize); + pos += tmpSize; + } + // add the 2 terminating 0 (actually 4, just to be on the safe side) + envlist.resize(envlist.size() + 4); + envlist[pos++] = 0; + envlist[pos++] = 0; + envlist[pos++] = 0; + envlist[pos++] = 0; return envlist; } @@ -501,46 +433,24 @@ int Environment::execute(QStringList arguments, const QStringList &additionalEnv qDebug() << " " << additionalEnv; qDebug() << " " << removeEnv; #endif -// GetEnvironmentStrings is defined to GetEnvironmentStringsW when -// UNICODE is defined. We cannot use that, since we need to -// destinguish between unicode and ansi versions of the functions. -#if defined(UNICODE) && defined(GetEnvironmentStrings) -#undef GetEnvironmentStrings -#endif - // Create the full environment from the current environment and // the additionalEnv strings, then remove all variables defined // in removeEnv QMap<QString, QString> fullEnvMap; - QT_WA({ - LPWSTR envStrings = GetEnvironmentStringsW(); - if (envStrings) { - int strLen = 0; - for (LPWSTR envString = envStrings; *(envString); envString += strLen + 1) { - strLen = wcslen(envString); - QString str = QString((const QChar*)envString, strLen); - if (!str.startsWith("=")) { // These are added by the system - int sepIndex = str.indexOf('='); - fullEnvMap.insert(str.left(sepIndex).toUpper(), str.mid(sepIndex +1)); - } - } - } - FreeEnvironmentStringsW(envStrings); - }, { - LPSTR envStrings = GetEnvironmentStrings(); - if (envStrings) { - int strLen = 0; - for (LPSTR envString = envStrings; *(envString); envString += strLen + 1) { - strLen = strlen(envString); - QString str = QLatin1String(envString); - if (!str.startsWith("=")) { // These are added by the system - int sepIndex = str.indexOf('='); - fullEnvMap.insert(str.left(sepIndex).toUpper(), str.mid(sepIndex +1)); - } + LPWSTR envStrings = GetEnvironmentStrings(); + if (envStrings) { + int strLen = 0; + for (LPWSTR envString = envStrings; *(envString); envString += strLen + 1) { + strLen = wcslen(envString); + QString str = QString((const QChar*)envString, strLen); + if (!str.startsWith("=")) { // These are added by the system + int sepIndex = str.indexOf('='); + fullEnvMap.insert(str.left(sepIndex).toUpper(), str.mid(sepIndex +1)); } } - FreeEnvironmentStringsA(envStrings); - }) + } + FreeEnvironmentStrings(envStrings); + // Add additionalEnv variables for (int i = 0; i < additionalEnv.count(); ++i) { const QString &str = additionalEnv.at(i); @@ -569,28 +479,14 @@ int Environment::execute(QStringList arguments, const QStringList &additionalEnv PROCESS_INFORMATION procInfo; memset(&procInfo, 0, sizeof(procInfo)); - bool couldExecute; - QT_WA({ - // Unicode version - STARTUPINFOW startInfo; - memset(&startInfo, 0, sizeof(startInfo)); - startInfo.cb = sizeof(startInfo); + STARTUPINFO startInfo; + memset(&startInfo, 0, sizeof(startInfo)); + startInfo.cb = sizeof(startInfo); - couldExecute = CreateProcessW(0, (WCHAR*)args.utf16(), + bool couldExecute = CreateProcess(0, (wchar_t*)args.utf16(), 0, 0, true, CREATE_UNICODE_ENVIRONMENT, envlist.isEmpty() ? 0 : envlist.data(), 0, &startInfo, &procInfo); - }, { - // Ansi version - STARTUPINFOA startInfo; - memset(&startInfo, 0, sizeof(startInfo)); - startInfo.cb = sizeof(startInfo); - - couldExecute = CreateProcessA(0, args.toLocal8Bit().data(), - 0, 0, true, 0, - envlist.isEmpty() ? 0 : envlist.data(), - 0, &startInfo, &procInfo); - }) if (couldExecute) { WaitForSingleObject(procInfo.hProcess, INFINITE); @@ -654,7 +550,7 @@ bool Environment::cpdir(const QString &srcDir, const QString &destDir) #endif QFile::remove(destFile); intermediate = QFile::copy(entry.absoluteFilePath(), destFile); - SetFileAttributesA(destFile.toLocal8Bit(), FILE_ATTRIBUTE_NORMAL); + SetFileAttributes((wchar_t*)destFile.utf16(), FILE_ATTRIBUTE_NORMAL); } if(!intermediate) { qDebug() << "cpdir: Failure for " << entry.fileName() << entry.isDir(); diff --git a/tools/configure/main.cpp b/tools/configure/main.cpp index 3608773..e4ea080 100644 --- a/tools/configure/main.cpp +++ b/tools/configure/main.cpp @@ -92,15 +92,15 @@ int runConfigure( int argc, char** argv ) app.generateHeaders(); if( !app.isDone() ) app.buildQmake(); - if( !app.isOk() ) - return 2; #endif if( !app.isDone() ) app.generateMakefiles(); - if( app.isOk() ) + if( !app.isDone() ) app.buildHostTools(); if( !app.isDone() ) app.showSummary(); + if( !app.isOk() ) + return 2; return 0; } diff --git a/tools/configure/tools.cpp b/tools/configure/tools.cpp index 9c86747..0d2acb6 100644 --- a/tools/configure/tools.cpp +++ b/tools/configure/tools.cpp @@ -184,7 +184,7 @@ void Tools::checkLicense(QMap<QString,QString> &dictionary, QMap<QString,QString // verify that we are licensed to use Qt for Windows CE if (dictionary["LICENSE_EXTENSION"] != "-EMBEDDED" && dictionary["LICENSE_EXTENSION"] != "-ALLOS") { cout << "You are not licensed for the " << dictionary["PLATFORM NAME"] << " platform." << endl << endl; - cout << "Please contact sales@trolltech.com to upgrade your license" << endl; + cout << "Please contact qt-info@nokia.com to upgrade your license" << endl; cout << "to include the " << dictionary["PLATFORM NAME"] << " platform, or install the" << endl; cout << "Qt Open Source Edition if you intend to develop free software." << endl; dictionary["DONE"] = "error"; @@ -201,8 +201,8 @@ void Tools::checkLicense(QMap<QString,QString> &dictionary, QMap<QString,QString if (licenseFeatures == '5') //Floating dictionary["METERED LICENSE"] = "true"; - if (!CopyFileA(QDir::toNativeSeparators(fromLicenseFile).toLocal8Bit(), - QDir::toNativeSeparators(toLicenseFile).toLocal8Bit(), FALSE)) { + if (!CopyFile((wchar_t*)QDir::toNativeSeparators(fromLicenseFile).utf16(), + (wchar_t*)QDir::toNativeSeparators(toLicenseFile).utf16(), FALSE)) { cout << "Failed to copy license file (" << fromLicenseFile << ")"; dictionary["DONE"] = "error"; return; |