diff options
Diffstat (limited to 'tools/configure/configureapp.cpp')
-rw-r--r-- | tools/configure/configureapp.cpp | 197 |
1 files changed, 94 insertions, 103 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 1e501c5..f32e7dc 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(); @@ -252,6 +245,7 @@ Configure::Configure( int& argc, char** argv ) dictionary[ "XMLPATTERNS" ] = "auto"; dictionary[ "PHONON" ] = "auto"; dictionary[ "PHONON_BACKEND" ] = "yes"; + dictionary[ "MULTIMEDIA" ] = "yes"; dictionary[ "DIRECTSHOW" ] = "no"; dictionary[ "WEBKIT" ] = "auto"; dictionary[ "PLUGIN_MANIFESTS" ] = "yes"; @@ -314,7 +308,6 @@ Configure::Configure( int& argc, char** argv ) dictionary[ "QT3SUPPORT" ] = "yes"; dictionary[ "ACCESSIBILITY" ] = "yes"; dictionary[ "OPENGL" ] = "yes"; - dictionary[ "DIRECT3D" ] = "auto"; dictionary[ "IPV6" ] = "yes"; // Always, dynamicly loaded dictionary[ "OPENSSL" ] = "auto"; dictionary[ "DBUS" ] = "auto"; @@ -605,10 +598,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") { @@ -824,11 +820,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"; @@ -852,6 +844,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" ) { @@ -1144,6 +1140,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 ) { @@ -1327,7 +1327,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"; @@ -1427,10 +1426,11 @@ 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-multimedia] [-multimedia]\n" "[-no-webkit] [-webkit]\n" "[-no-scripttools] [-scripttools]\n" "[-graphicssystem raster|opengl]\n\n", 0, 7); @@ -1595,7 +1595,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,6 +1605,8 @@ 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("SCRIPTTOOLS", "no", "-no-scripttools", "Do not build the QtScriptTools module."); @@ -1663,39 +1664,49 @@ bool Configure::displayHelp() 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 +1776,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"); @@ -1831,6 +1842,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,56 +1857,26 @@ 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; - } + << "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") { available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-g++"); } else if (part == "SCRIPTTOOLS") { @@ -1975,8 +1961,6 @@ void Configure::autoDetection() 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") @@ -2046,7 +2030,6 @@ bool Configure::verifyConfiguration() no-gif gif dll staticlib - internal nocrosscompiler GNUmake largefile @@ -2072,8 +2055,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_ @@ -2301,9 +2282,6 @@ void Configure::generateOutputVars() if ( dictionary["DIRECTSHOW"] == "yes" ) qtConfig += "directshow"; - if (dictionary[ "DIRECT3D" ] == "yes") - qtConfig += "direct3d"; - if (dictionary[ "OPENSSL" ] == "yes") qtConfig += "openssl"; else if (dictionary[ "OPENSSL" ] == "linked") @@ -2334,6 +2312,9 @@ void Configure::generateOutputVars() qtConfig += "phonon-backend"; } + if (dictionary["MULTIMEDIA"] == "yes") + qtConfig += "multimedia"; + if (dictionary["WEBKIT"] == "yes") qtConfig += "webkit"; @@ -2688,13 +2669,13 @@ void Configure::generateConfigfiles() 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["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["SCRIPTTOOLS"] == "no") qconfigList += "QT_NO_SCRIPTTOOLS"; @@ -2779,7 +2760,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 +2796,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 +2864,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,11 +2930,11 @@ 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 << "OpenSSL support............." << dictionary[ "OPENSSL" ] << endl; cout << "QtDBus support.............." << dictionary[ "DBUS" ] << endl; cout << "QtXmlPatterns support......." << dictionary[ "XMLPATTERNS" ] << endl; cout << "Phonon support.............." << dictionary[ "PHONON" ] << endl; + cout << "Multimedia support.........." << dictionary[ "MULTIMEDIA" ] << endl; cout << "WebKit support.............." << dictionary[ "WEBKIT" ] << endl; cout << "QtScriptTools support......." << dictionary[ "SCRIPTTOOLS" ] << endl; cout << "Graphics System............." << dictionary[ "GRAPHICS_SYSTEM" ] << endl; @@ -3141,6 +3122,9 @@ void Configure::buildQmake() void Configure::buildHostTools() { + if (dictionary[ "NOPROCESS" ] == "yes") + dictionary[ "DONE" ] = "yes"; + if (!dictionary.contains("XQMAKESPEC")) return; @@ -3364,7 +3348,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 +3355,16 @@ 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 { + // 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; + } } Configure::ProjectType Configure::projectType( const QString& proFileName ) |