summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2014-04-02 16:56:15 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-03 18:31:45 +0200
commit10a0ac759e26e27751ae96d02eb1e260ab371194 (patch)
tree2915a74edeae37664c057af4fa9ed7c2aa5a6652 /tools
parentf412f2b5ee58e3919a8cd514c8fcfa75444ae976 (diff)
Windows XP target support for MSVC >= 2012
To enable windows xp support, we must do two things: 1. linker flag must be /SUBSYSTEM:CONSOLE,5.01 or /SUBSYSTEM:WINDOWS,5.01. For x64, the version is 5.02. 2. Do not use Windows Kit 8. Win SDK v7.1A is recommended. Prepend the right include paths and lib paths to INCLUDE and LIB before building. The Windows XP target support is enabled by passing "-target xp" to configure. Task-number: QTBUG-29939 Change-Id: I84c8439606cc2a9d27d64947702846faa4f1e4a2 Reviewed-by: Lucas Wang <wbsecg1@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/configure/configureapp.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 176fe3092f..49c7fc9618 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -482,7 +482,18 @@ void Configure::parseCmdLine()
else if (configCmdLine.at(i) == "-force-asserts") {
dictionary[ "FORCE_ASSERTS" ] = "yes";
}
-
+ else if (configCmdLine.at(i) == "-target") {
+ ++i;
+ if (i == argCount)
+ break;
+ const QString option = configCmdLine.at(i);
+ if (option != "xp") {
+ cout << "ERROR: invalid argument for -target option" << endl;
+ dictionary["DONE"] = "error";
+ return;
+ }
+ dictionary["TARGET_OS"] = option;
+ }
else if (configCmdLine.at(i) == "-platform") {
++i;
if (i == argCount)
@@ -1817,6 +1828,10 @@ bool Configure::displayHelp()
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");
desc( "", "See the README file for a list of supported operating systems and compilers.\n", false, ' ');
+
+ desc("TARGET_OS", "*", "-target", "Set target OS version. Currently the only valid value is 'xp' for targeting Windows XP.\n"
+ "MSVC >= 2012 targets Windows Vista by default.\n");
+
desc( "-sysroot <dir>", "Sets <dir> as the target compiler's and qmake's sysroot and also sets pkg-config paths.");
desc( "-no-gcc-sysroot", "When using -sysroot, it disables the passing of --sysroot to the compiler.\n");
@@ -2497,6 +2512,12 @@ bool Configure::verifyConfiguration()
<< "files such as headers and libraries." << endl;
prompt = true;
}
+#if WINVER > 0x0601
+ if (dictionary["TARGET_OS"] == "xp") {
+ cout << "WARNING: Cannot use Windows Kit 8 to build Qt for Windows XP.\n"
+ "WARNING: Windows SDK v7.1A is recommended.\n";
+ }
+#endif
if (dictionary["DIRECT2D"] == "yes" && !checkAvailability("DIRECT2D")) {
cout << "WARNING: To be able to build the Direct2D platform plugin you will" << endl
@@ -3331,6 +3352,10 @@ void Configure::generateQConfigPri()
<< "}" << endl;
}
+ const QString targetOS = dictionary.value("TARGET_OS");
+ if (!targetOS.isEmpty())
+ configStream << "QMAKE_TARGET_OS = " << targetOS << endl;
+
if (!dictionary["QMAKE_RPATHDIR"].isEmpty())
configStream << "QMAKE_RPATHDIR += " << formatPath(dictionary["QMAKE_RPATHDIR"]) << endl;
@@ -3574,6 +3599,8 @@ void Configure::displayConfig()
sout << "QMAKESPEC..................." << dictionary[ "XQMAKESPEC" ] << " (" << dictionary["QMAKESPEC_FROM"] << ")" << endl;
else
sout << "QMAKESPEC..................." << dictionary[ "QMAKESPEC" ] << " (" << dictionary["QMAKESPEC_FROM"] << ")" << endl;
+ if (!dictionary["TARGET_OS"].isEmpty())
+ sout << "Target OS..................." << dictionary["TARGET_OS"] << endl;
sout << "Architecture................" << dictionary["QT_ARCH"]
<< ", features:" << dictionary["QT_CPU_FEATURES"] << endl;
sout << "Host Architecture..........." << dictionary["QT_HOST_ARCH"]