diff options
Diffstat (limited to 'tools/configure/configureapp.cpp')
-rw-r--r-- | tools/configure/configureapp.cpp | 136 |
1 files changed, 94 insertions, 42 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 092e26abfd..576eca5bb9 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -69,6 +69,7 @@ QT_BEGIN_NAMESPACE enum Platforms { WINDOWS, WINDOWS_CE, + WINDOWS_RT, QNX, BLACKBERRY, ANDROID @@ -135,23 +136,9 @@ Configure::Configure(int& argc, char** argv) const QString installPath = buildPath; #endif if (sourceDir != buildDir) { //shadow builds! - cout << "Preparing build tree..." << endl; QDir(buildPath).mkpath("bin"); - //copy the mkspecs buildDir.mkpath("mkspecs"); - if (!Environment::cpdir(sourcePath + "/mkspecs", buildPath + "/mkspecs")){ - cout << "Couldn't copy mkspecs!" << sourcePath << " " << buildPath << endl; - dictionary["DONE"] = "error"; - return; - } - - buildDir.mkpath("doc"); - if (!Environment::cpdir(sourcePath + "/doc/global", buildPath + "/doc/global")) { - cout << "Couldn't copy global documentation!" << sourcePath << " " << buildPath << endl; - dictionary["DONE"] = "error"; - return; - } } defaultBuildParts << QStringLiteral("libs") << QStringLiteral("tools") << QStringLiteral("examples"); @@ -192,7 +179,6 @@ Configure::Configure(int& argc, char** argv) dictionary[ "AUDIO_BACKEND" ] = "auto"; dictionary[ "WMF_BACKEND" ] = "auto"; dictionary[ "WMSDK" ] = "auto"; - dictionary[ "V8SNAPSHOT" ] = "auto"; dictionary[ "QML_DEBUG" ] = "yes"; dictionary[ "PLUGIN_MANIFESTS" ] = "yes"; dictionary[ "DIRECTWRITE" ] = "no"; @@ -275,6 +261,7 @@ Configure::Configure(int& argc, char** argv) dictionary[ "LIBJPEG" ] = "auto"; dictionary[ "LIBPNG" ] = "auto"; dictionary[ "FREETYPE" ] = "yes"; + dictionary[ "HARFBUZZ" ] = "no"; dictionary[ "ACCESSIBILITY" ] = "yes"; dictionary[ "OPENGL" ] = "yes"; @@ -581,6 +568,13 @@ void Configure::parseCmdLine() else if (configCmdLine.at(i) == "-system-freetype") dictionary[ "FREETYPE" ] = "system"; + else if (configCmdLine.at(i) == "-no-harfbuzz") + dictionary[ "HARFBUZZ" ] = "no"; + else if (configCmdLine.at(i) == "-qt-harfbuzz") + dictionary[ "HARFBUZZ" ] = "yes"; + else if (configCmdLine.at(i) == "-system-harfbuzz") + dictionary[ "HARFBUZZ" ] = "system"; + // CE- C runtime -------------------------------------------- else if (configCmdLine.at(i) == "-crt") { ++i; @@ -1594,7 +1588,29 @@ void Configure::applySpecSpecifics() nobuildParts << "tools"; } - if (dictionary.value("XQMAKESPEC").startsWith("wince")) { + if (dictionary.value("XQMAKESPEC").startsWith("winphone") || dictionary.value("XQMAKESPEC").startsWith("winrt")) { + dictionary[ "STYLE_WINDOWSXP" ] = "no"; + dictionary[ "STYLE_WINDOWSVISTA" ] = "no"; + dictionary[ "GIF" ] = "qt"; + dictionary[ "JPEG" ] = "qt"; + dictionary[ "LIBJPEG" ] = "qt"; + dictionary[ "LIBPNG" ] = "qt"; + dictionary[ "FREETYPE" ] = "yes"; + dictionary[ "ACCESSIBILITY" ] = "no"; + dictionary[ "OPENGL" ] = "no"; + dictionary[ "OPENGL_ES_2" ] = "no"; + dictionary[ "OPENVG" ] = "no"; + dictionary[ "OPENSSL" ] = "auto"; + dictionary[ "DBUS" ] = "no"; + dictionary[ "ZLIB" ] = "qt"; + dictionary[ "PCRE" ] = "qt"; + dictionary[ "ICU" ] = "qt"; + dictionary[ "CE_CRT" ] = "yes"; + dictionary[ "LARGE_FILE" ] = "no"; + dictionary[ "ANGLE" ] = "no"; + if (dictionary.value("XQMAKESPEC").startsWith("winphone")) + dictionary[ "SQL_SQLITE" ] = "no"; + } else if (dictionary.value("XQMAKESPEC").startsWith("wince")) { dictionary[ "STYLE_WINDOWSXP" ] = "no"; dictionary[ "STYLE_WINDOWSVISTA" ] = "no"; dictionary[ "STYLE_FUSION" ] = "no"; @@ -1817,7 +1833,7 @@ bool Configure::displayHelp() desc("ZLIB", "system", "-system-zlib", "Use zlib from the operating system.\nSee http://www.gzip.org/zlib\n"); desc("PCRE", "qt", "-qt-pcre", "Use the PCRE library bundled with Qt."); - desc("PCRE", "qt", "-system-pcre", "Use the PCRE library from the operating system.\nSee http://pcre.org/\n"); + desc("PCRE", "system", "-system-pcre", "Use the PCRE library from the operating system.\nSee http://pcre.org/\n"); desc("ICU", "yes", "-icu", "Use the ICU library."); desc("ICU", "no", "-no-icu", "Do not use the ICU library.\nSee http://site.icu-project.org/\n"); @@ -1834,7 +1850,15 @@ bool Configure::displayHelp() desc("FREETYPE", "no", "-no-freetype", "Do not compile in Freetype2 support."); desc("FREETYPE", "yes", "-qt-freetype", "Use the libfreetype bundled with Qt."); - desc("FREETYPE", "yes", "-system-freetype", "Use the libfreetype provided by the system."); + desc("FREETYPE", "system","-system-freetype", "Use the libfreetype provided by the system."); + + desc("HARFBUZZ", "no", "-no-harfbuzz", "Do not compile in HarfBuzz-NG support."); + desc("HARFBUZZ", "yes", "-qt-harfbuzz", "(experimental) Use HarfBuzz-NG bundled with Qt\n" + "to do text shaping. It can still be disabled\n" + "by setting QT_HARFBUZZ environment variable to \"old\"."); + desc("HARFBUZZ", "system","-system-harfbuzz", "(experimental) Use HarfBuzz-NG from the operating system\n" + "to do text shaping. It can still be disabled\n" + "by setting QT_HARFBUZZ environment variable to \"old\"."); if ((platform() == QNX) || (platform() == BLACKBERRY)) { desc("SLOG2", "yes", "-slog2", "Compile with slog2 support."); @@ -2086,6 +2110,9 @@ bool Configure::checkAvailability(const QString &part) available = checkAngleAvailability(); } + else if (part == "HARFBUZZ") + available = tryCompileProject("unix/harfbuzz"); + else if (part == "LIBJPEG") available = findFile("jpeglib.h"); else if (part == "LIBPNG") @@ -2163,8 +2190,6 @@ bool Configure::checkAvailability(const QString &part) && !QStandardPaths::findExecutable(QStringLiteral("xgConsole.exe")).isEmpty(); } else if (part == "WMSDK") { available = findFile("wmsdk.h"); - } else if (part == "V8SNAPSHOT") { - available = true; } else if (part == "AUDIO_BACKEND") { available = true; } else if (part == "WMF_BACKEND") { @@ -2178,7 +2203,7 @@ bool Configure::checkAvailability(const QString &part) } else if (part == "QT_EVENTFD") { available = tryCompileProject("unix/eventfd"); } else if (part == "CUPS") { - available = (platform() != WINDOWS) && (platform() != WINDOWS_CE) && tryCompileProject("unix/cups"); + available = (platform() != WINDOWS) && (platform() != WINDOWS_CE) && (platform() != WINDOWS_RT) && tryCompileProject("unix/cups"); } else if (part == "STACK_PROTECTOR_STRONG") { available = (platform() == QNX || platform() == BLACKBERRY) && compilerSupportsFlag("qcc -fstack-protector-strong"); } else if (part == "SLOG2") { @@ -2282,8 +2307,6 @@ void Configure::autoDetection() dictionary["OPENSSL"] = checkAvailability("OPENSSL") ? "yes" : "no"; if (dictionary["DBUS"] == "auto") dictionary["DBUS"] = checkAvailability("DBUS") ? "yes" : "no"; - if (dictionary["V8SNAPSHOT"] == "auto") - dictionary["V8SNAPSHOT"] = (dictionary["V8"] == "yes") && checkAvailability("V8SNAPSHOT") ? "yes" : "no"; if (dictionary["QML_DEBUG"] == "auto") dictionary["QML_DEBUG"] = dictionary["QML"] == "yes" ? "yes" : "no"; if (dictionary["AUDIO_BACKEND"] == "auto") @@ -2506,6 +2529,11 @@ void Configure::generateOutputVars() else if (dictionary[ "FREETYPE" ] == "system") qtConfig += "system-freetype"; + if (dictionary[ "HARFBUZZ" ] == "yes") + qtConfig += "harfbuzz"; + else if (dictionary[ "HARFBUZZ" ] == "system") + qtConfig += "system-harfbuzz"; + // Styles ------------------------------------------------------- if (dictionary[ "STYLE_WINDOWS" ] == "yes") qmakeStyles += "windows"; @@ -2703,10 +2731,6 @@ void Configure::generateOutputVars() // We currently have no switch for QtConcurrent, so add it unconditionally. qtConfig += "concurrent"; - // ### Vestige - if (dictionary[ "V8SNAPSHOT" ] == "yes") - qtConfig += "v8snapshot"; - if (dictionary[ "SYSTEM_PROXIES" ] == "yes") qtConfig += "system-proxies"; @@ -2836,6 +2860,14 @@ void Configure::generateCachefile() moduleStream << "QT_SKIP_MODULES += " << skipModules.join(' ') << endl; moduleStream << endl; + moduleStream << "host_build {" << endl; + moduleStream << " QT_CPU_FEATURES." << dictionary["QT_HOST_ARCH"] << + " = " << dictionary["QT_HOST_CPU_FEATURES"] << endl; + moduleStream << "} else {" << endl; + moduleStream << " QT_CPU_FEATURES." << dictionary["QT_ARCH"] << + " = " << dictionary["QT_CPU_FEATURES"] << endl; + moduleStream << "}" << endl; + if (dictionary["QT_EDITION"] != "QT_EDITION_OPENSOURCE") moduleStream << "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" << endl; @@ -3151,15 +3183,17 @@ void Configure::generateQConfigPri() configStream << " qpa"; configStream << endl; - configStream << "QT_ARCH = " << dictionary["QT_ARCH"] << endl; - configStream << "QT_HOST_ARCH = " << dictionary["QT_HOST_ARCH"] << endl; - configStream << "QT_CPU_FEATURES = " << dictionary["QT_CPU_FEATURES"] << endl; - configStream << "QT_HOST_CPU_FEATURES = " << dictionary["QT_HOST_CPU_FEATURES"] << endl; + configStream << "host_build {" << endl; + configStream << " QT_ARCH = " << dictionary["QT_HOST_ARCH"] << endl; + configStream << " QT_TARGET_ARCH = " << dictionary["QT_ARCH"] << endl; + configStream << "} else {" << endl; + configStream << " QT_ARCH = " << dictionary["QT_ARCH"] << endl; if (dictionary.contains("XQMAKESPEC") && !dictionary["XQMAKESPEC"].startsWith("wince")) { // FIXME: add detection - configStream << "QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib" << endl; - configStream << "QMAKE_DEFAULT_INCDIRS = /usr/include /usr/local/include" << endl; + configStream << " QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib" << endl; + configStream << " QMAKE_DEFAULT_INCDIRS = /usr/include /usr/local/include" << endl; } + configStream << "}" << endl; if (dictionary["QT_EDITION"].contains("OPENSOURCE")) configStream << "QT_EDITION = " << QLatin1String("OpenSource") << endl; else @@ -3332,6 +3366,7 @@ void Configure::generateConfigfiles() if (dictionary["DBUS"] == "no") qconfigList += "QT_NO_DBUS"; if (dictionary["QML_DEBUG"] == "no") qconfigList += "QT_QML_NO_DEBUGGER"; if (dictionary["FREETYPE"] == "no") qconfigList += "QT_NO_FREETYPE"; + if (dictionary["HARFBUZZ"] == "no") qconfigList += "QT_NO_HARFBUZZ"; if (dictionary["NATIVE_GESTURES"] == "no") qconfigList += "QT_NO_NATIVE_GESTURES"; if (dictionary["OPENGL_ES_CM"] == "yes" || @@ -3437,7 +3472,8 @@ void Configure::displayConfig() sout << "Licensee...................." << (l1.isNull() ? "" : l1) << endl; sout << "License ID.................." << (l2.isNull() ? "" : l2) << endl; sout << "Product license............." << (l3.isNull() ? "" : l3) << endl; - sout << "Expiry Date................." << (l4.isNull() ? "" : l4) << endl << endl; + sout << "Expiry Date................." << (l4.isNull() ? "" : l4) << endl; + sout << endl; } sout << "Configuration:" << endl; @@ -3491,19 +3527,22 @@ void Configure::displayConfig() sout << "Qt GUI module support......." << dictionary[ "GUI" ] << endl; sout << "QML debugging..............." << dictionary[ "QML_DEBUG" ] << endl; sout << "DirectWrite support........." << dictionary[ "DIRECTWRITE" ] << endl; - sout << "Use system proxies.........." << dictionary[ "SYSTEM_PROXIES" ] << endl << endl; + sout << "Use system proxies.........." << dictionary[ "SYSTEM_PROXIES" ] << endl; + sout << endl; sout << "Third Party Libraries:" << endl; sout << " ZLIB support............" << dictionary[ "ZLIB" ] << endl; sout << " GIF support............." << dictionary[ "GIF" ] << endl; sout << " JPEG support............" << dictionary[ "JPEG" ] << endl; sout << " PNG support............." << dictionary[ "PNG" ] << endl; - sout << " FreeType support........" << dictionary[ "FREETYPE" ] << endl << endl; + sout << " FreeType support........" << dictionary[ "FREETYPE" ] << endl; + sout << " HarfBuzz-NG support....." << dictionary[ "HARFBUZZ" ] << endl; sout << " PCRE support............" << dictionary[ "PCRE" ] << endl; sout << " ICU support............." << dictionary[ "ICU" ] << endl; if ((platform() == QNX) || (platform() == BLACKBERRY)) sout << " SLOG2 support..........." << dictionary[ "SLOG2" ] << endl; sout << " ANGLE..................." << dictionary[ "ANGLE" ] << endl; + sout << endl; sout << "Styles:" << endl; sout << " Windows................." << dictionary[ "STYLE_WINDOWS" ] << endl; @@ -3511,7 +3550,8 @@ void Configure::displayConfig() sout << " Windows Vista..........." << dictionary[ "STYLE_WINDOWSVISTA" ] << endl; sout << " Fusion.................." << dictionary[ "STYLE_FUSION" ] << endl; sout << " Windows CE.............." << dictionary[ "STYLE_WINDOWSCE" ] << endl; - sout << " Windows Mobile.........." << dictionary[ "STYLE_WINDOWSMOBILE" ] << endl << endl; + sout << " Windows Mobile.........." << dictionary[ "STYLE_WINDOWSMOBILE" ] << endl; + sout << endl; sout << "Sql Drivers:" << endl; sout << " ODBC...................." << dictionary[ "SQL_ODBC" ] << endl; @@ -3522,7 +3562,8 @@ void Configure::displayConfig() sout << " DB2....................." << dictionary[ "SQL_DB2" ] << endl; sout << " SQLite.................." << dictionary[ "SQL_SQLITE" ] << " (" << dictionary[ "SQL_SQLITE_LIB" ] << ")" << endl; sout << " SQLite2................." << dictionary[ "SQL_SQLITE2" ] << endl; - sout << " InterBase..............." << dictionary[ "SQL_IBASE" ] << endl << endl; + sout << " InterBase..............." << dictionary[ "SQL_IBASE" ] << endl; + sout << endl; sout << "Sources are in.............." << QDir::toNativeSeparators(sourcePath) << endl; sout << "Build is done in............" << QDir::toNativeSeparators(buildPath) << endl; @@ -3544,7 +3585,8 @@ void Configure::displayConfig() if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith(QLatin1String("wince"))) { sout << "Using c runtime detection..." << dictionary[ "CE_CRT" ] << endl; sout << "Cetest support.............." << dictionary[ "CETEST" ] << endl; - sout << "Signature..................." << dictionary[ "CE_SIGNATURE"] << endl << endl; + sout << "Signature..................." << dictionary[ "CE_SIGNATURE"] << endl; + sout << endl; } if (checkAvailability("INCREDIBUILD_XGE")) @@ -3794,7 +3836,7 @@ void Configure::generateQConfigCpp() << "#endif" << endl << "};" << endl; - if ((platform() != WINDOWS) && (platform() != WINDOWS_CE)) + if ((platform() != WINDOWS) && (platform() != WINDOWS_CE) && (platform() != WINDOWS_RT)) tmpStream << "static const char qt_configure_settings_path_str [256 + 12] = \"qt_stngpath=" << formatPath(dictionary["QT_INSTALL_SETTINGS"]) << "\";" << endl; tmpStream << endl @@ -3805,7 +3847,7 @@ void Configure::generateQConfigCpp() << "#define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12;" << endl << "#define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12;" << endl; - if ((platform() != WINDOWS) && (platform() != WINDOWS_CE)) + if ((platform() != WINDOWS) && (platform() != WINDOWS_CE) && (platform() != WINDOWS_RT)) tmpStream << "#define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12;" << endl; if (!tmpStream.flush()) @@ -3950,6 +3992,9 @@ void Configure::buildQmake() QTextStream confStream(&confFile); confStream << "[EffectivePaths]" << endl << "Prefix=.." << endl; + if (sourcePath != buildPath) + confStream << "[EffectiveSourcePaths]" << endl + << "Prefix=" << sourcePath << endl; confStream.flush(); confFile.close(); @@ -3975,7 +4020,7 @@ void Configure::generateMakefiles() { if (dictionary[ "PROCESS" ] != "no") { QString spec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ]; - if (spec != "win32-msvc.net" && !spec.startsWith("win32-msvc2") && !spec.startsWith(QLatin1String("wince"))) + if (spec != "win32-msvc.net" && !spec.startsWith("win32-msvc2") && !spec.startsWith(QLatin1String("wince")) && !spec.startsWith("winphone") && !spec.startsWith("winrt") ) dictionary[ "VCPROJFILES" ] = "no"; QString pwd = QDir::currentPath(); @@ -4256,6 +4301,8 @@ QString Configure::platformName() const return QStringLiteral("Qt for Windows"); case WINDOWS_CE: return QStringLiteral("Qt for Windows CE"); + case WINDOWS_RT: + return QStringLiteral("Qt for Windows Runtime"); case QNX: return QStringLiteral("Qt for QNX"); case BLACKBERRY: @@ -4272,6 +4319,8 @@ QString Configure::qpaPlatformName() const case WINDOWS: case WINDOWS_CE: return QStringLiteral("windows"); + case WINDOWS_RT: + return QStringLiteral("winrt"); case QNX: return QStringLiteral("qnx"); case BLACKBERRY: @@ -4286,6 +4335,9 @@ int Configure::platform() const const QString qMakeSpec = dictionary.value("QMAKESPEC"); const QString xQMakeSpec = dictionary.value("XQMAKESPEC"); + if ((xQMakeSpec.startsWith("winphone") || xQMakeSpec.startsWith("winrt"))) + return WINDOWS_RT; + if ((qMakeSpec.startsWith("wince") || xQMakeSpec.startsWith("wince"))) return WINDOWS_CE; |