From 38675e18fcc841228141568a2ecfafdeb99eba2a Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 17 Nov 2016 10:40:44 +0100 Subject: Add support for Visual Studio 2017 Tested with RC Task-number: QTBUG-57086 Change-Id: I21f56edca3852b52edd2c5fdcce76817141e8d4a Reviewed-by: Friedemann Kleint --- tools/configure/configureapp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools/configure/configureapp.cpp') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 88dcd8170b..a908db0707 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1458,7 +1458,8 @@ void Configure::parseCmdLine() dictionary[ "QMAKESPEC" ].endsWith("-msvc2010") || dictionary[ "QMAKESPEC" ].endsWith("-msvc2012") || dictionary[ "QMAKESPEC" ].endsWith("-msvc2013") || - dictionary[ "QMAKESPEC" ].endsWith("-msvc2015")) { + dictionary[ "QMAKESPEC" ].endsWith("-msvc2015") || + dictionary[ "QMAKESPEC" ].endsWith("-msvc2017")) { if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "nmake"; dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32"; } else if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) { -- cgit v1.2.3 From a9af3c85022994cfe18a05cd92db9fc0b0ad902c Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 16 Sep 2016 11:27:00 +0200 Subject: win: Show Tech Preview license Show the tech preview license for commercial users if -confirm-license is not set. This matches what the configure shell script is doing, too. Task-number: QTBUG-55676 Change-Id: I69f5553ab53dfcdc14c200e682c024a6cebee8fe Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'tools/configure/configureapp.cpp') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index a908db0707..2b7a1d6b07 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -4550,11 +4550,6 @@ Configure::ProjectType Configure::projectType(const QString& proFileName) bool Configure::showLicense(QString orgLicenseFile) { - if (dictionary["LICENSE_CONFIRMED"] == "yes") { - cout << "You have already accepted the terms of the license." << endl << endl; - return true; - } - bool showLgpl2 = true; QString licenseFile = orgLicenseFile; QString theLicense; @@ -4665,21 +4660,32 @@ void Configure::readLicense() } } if (hasOpenSource && openSource) { - cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl; + cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl << endl; dictionary["LICENSEE"] = "Open Source"; dictionary["EDITION"] = "OpenSource"; - cout << endl; - if (!showLicense(dictionary["LICENSE FILE"])) { - cout << "Configuration aborted since license was not accepted"; - dictionary["DONE"] = "error"; - return; - } } else if (openSource) { cout << endl << "Cannot find the GPL license files! Please download the Open Source version of the library." << endl; dictionary["DONE"] = "error"; + } else { + QString tpLicense = sourcePath + "/LICENSE.PREVIEW.COMMERCIAL"; + if (QFile::exists(tpLicense)) { + cout << endl << "This is the Qt Preview Edition." << endl << endl; + + dictionary["EDITION"] = "Preview"; + dictionary["LICENSE FILE"] = tpLicense; + } else { + Tools::checkLicense(dictionary, sourcePath, buildPath); + } } - else { - Tools::checkLicense(dictionary, sourcePath, buildPath); + + if (dictionary["LICENSE_CONFIRMED"] != "yes") { + if (!showLicense(dictionary["LICENSE FILE"])) { + cout << "Configuration aborted since license was not accepted" << endl; + dictionary["DONE"] = "error"; + return; + } + } else if (dictionary["LICHECK"].isEmpty()) { // licheck executable shows license + cout << "You have already accepted the terms of the license." << endl << endl; } } -- cgit v1.2.3 From 798b09ffe61b6b7f490b7d530f0e89501bbc89fd Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 17 Nov 2016 19:24:49 +0100 Subject: configure: don't read QMAKESPEC from the environment it was rather unexpected that this was done, entirely inconsistently with how the rest of the configure parameters are handled. Task-number: QTBUG-52266 Change-Id: I6e1d7a4fe1c85d6d64d465517b6be3f3cdda3359 Reviewed-by: Lars Knoll --- tools/configure/configureapp.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'tools/configure/configureapp.cpp') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 8716fa88f7..d9d247dbae 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -107,12 +107,9 @@ Configure::Configure(int& argc, char** argv) dictionary[ "QT_INSTALL_PREFIX" ] = installPath; - dictionary[ "QMAKESPEC" ] = getenv("QMAKESPEC"); if (dictionary[ "QMAKESPEC" ].size() == 0) { dictionary[ "QMAKESPEC" ] = Environment::detectQMakeSpec(); dictionary[ "QMAKESPEC_FROM" ] = "detected"; - } else { - dictionary[ "QMAKESPEC_FROM" ] = "env"; } dictionary[ "SYNCQT" ] = "auto"; @@ -481,12 +478,9 @@ void Configure::parseCmdLine() dictionary[ "DONE" ] = "error"; if (dictionary ["QMAKESPEC_FROM"] == "commandline") { cout << "Invalid option \"" << dictionary["QMAKESPEC"] << "\" for -platform." << endl; - } else if (dictionary ["QMAKESPEC_FROM"] == "env") { - cout << "QMAKESPEC environment variable is set to \"" << dictionary["QMAKESPEC"] - << "\" which is not a supported platform" << endl; } else { // was autodetected from environment cout << "Unable to detect the platform from environment. Use -platform command line" << endl - << "argument or set the QMAKESPEC environment variable and run configure again." << endl; + << "argument and run configure again." << endl; } cout << "See the README file for a list of supported operating systems and compilers." << endl; } else { -- cgit v1.2.3 From 4ce0beee1b69a8695fc24a244a8a3053711906ac Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 18 Nov 2016 18:11:41 +0100 Subject: configure: delete some dead code and outdated comments Change-Id: I764a9b383176e1fe9573790547ce0e12d1f88261 Reviewed-by: Lars Knoll --- tools/configure/configureapp.cpp | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'tools/configure/configureapp.cpp') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index d9d247dbae..870bf3d368 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -173,12 +173,6 @@ QString Configure::formatPath(const QString &path) return ret; } -// #### somehow I get a compiler error about vc++ reaching the nesting limit without -// undefining the ansi for scoping. -#ifdef for -#undef for -#endif - void Configure::parseCmdLine() { sourcePathMangled = sourcePath; @@ -599,16 +593,6 @@ void Configure::generateQDevicePri() dictionary[ "DONE" ] = "error"; } -QString Configure::formatConfigPath(const char *var) -{ - QString val = dictionary[var]; - if (QFileInfo(val).isRelative()) { - QString pfx = dictionary["QT_INSTALL_PREFIX"]; - val = (val == ".") ? pfx : QDir(pfx).absoluteFilePath(val); - } - return QDir::toNativeSeparators(val); -} - void Configure::generateHeaders() { if (dictionary["SYNCQT"] == "auto") @@ -882,7 +866,6 @@ void Configure::buildQmake() << "QT_PATCH_VERSION = " << dictionary["VERSION_PATCH"] << endl; if (dictionary[ "QMAKESPEC" ].startsWith("win32-g++")) { stream << "QMAKESPEC = $(SOURCE_PATH)\\mkspecs\\" << dictionary[ "QMAKESPEC" ] << endl - << "EXTRA_CFLAGS = -DUNICODE -ffunction-sections" << endl << "EXTRA_CXXFLAGS = -std=c++11 -DUNICODE -ffunction-sections" << endl << "EXTRA_LFLAGS = -Wl,--gc-sections" << endl << "QTOBJS = qfilesystemengine_win.o \\" << endl -- cgit v1.2.3 From 9bdb5b5ffea50b2e8d3deb9fd370c2fb5805e076 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 18 Nov 2016 16:27:15 +0100 Subject: configure: put more of the makefile contents into template files ... instead of having (duplicated) code in the configures to create it. Change-Id: Ia86b44021a024a969f5a49b7fb18d3d414869f93 Reviewed-by: Lars Knoll --- tools/configure/configureapp.cpp | 57 +++++++--------------------------------- 1 file changed, 9 insertions(+), 48 deletions(-) (limited to 'tools/configure/configureapp.cpp') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 870bf3d368..f7baf4086b 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -866,54 +866,15 @@ void Configure::buildQmake() << "QT_PATCH_VERSION = " << dictionary["VERSION_PATCH"] << endl; if (dictionary[ "QMAKESPEC" ].startsWith("win32-g++")) { stream << "QMAKESPEC = $(SOURCE_PATH)\\mkspecs\\" << dictionary[ "QMAKESPEC" ] << endl - << "EXTRA_CXXFLAGS = -std=c++11 -DUNICODE -ffunction-sections" << endl - << "EXTRA_LFLAGS = -Wl,--gc-sections" << endl - << "QTOBJS = qfilesystemengine_win.o \\" << endl - << " qfilesystemiterator_win.o \\" << endl - << " qfsfileengine_win.o \\" << endl - << " qlocale_win.o \\" << endl - << " qsettings_win.o \\" << endl - << " qsystemlibrary.o \\" << endl - << " registry.o" << endl - << "QTSRCS=\"$(SOURCE_PATH)/src/corelib/io/qfilesystemengine_win.cpp\" \\" << endl - << " \"$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_win.cpp\" \\" << endl - << " \"$(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp\" \\" << endl - << " \"$(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp\" \\" << endl - << " \"$(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp\" \\" << endl\ - << " \"$(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp\" \\" << endl - << " \"$(SOURCE_PATH)/tools/shared/windows/registry.cpp\"" << endl - << "EXEEXT=.exe" << endl - << "LFLAGS=-static -s -lole32 -luuid -ladvapi32 -lkernel32" << endl; - /* - ** SHELL is the full path of sh.exe, unless - ** 1) it is found in the current directory - ** 2) it is not found at all - ** 3) it is overridden on the command line with an existing file - ** ... otherwise it is always sh.exe. Specifically, SHELL from the - ** environment has no effect. - ** - ** This check will fail if SHELL is explicitly set to a not - ** sh-compatible shell. This is not a problem, because configure.bat - ** will not do that. - */ - stream << "ifeq ($(SHELL), sh.exe)" << endl - << " ifeq ($(wildcard $(CURDIR)/sh.exe), )" << endl - << " SH = 0" << endl - << " else" << endl - << " SH = 1" << endl - << " endif" << endl - << "else" << endl - << " SH = 1" << endl - << "endif" << endl - << "\n" - << "ifeq ($(SH), 1)" << endl - << " RM_F = rm -f" << endl - << " RM_RF = rm -rf" << endl - << "else" << endl - << " RM_F = del /f" << endl - << " RM_RF = rmdir /s /q" << endl - << "endif" << endl; - stream << "\n\n"; + << "CONFIG_CXXFLAGS = -std=c++11 -ffunction-sections" << endl + << "CONFIG_LFLAGS = -Wl,--gc-sections" << endl; + + QFile in(sourcePath + "/qmake/Makefile.unix.win32"); + if (in.open(QFile::ReadOnly | QFile::Text)) + stream << in.readAll(); + QFile in2(sourcePath + "/qmake/Makefile.unix.mingw"); + if (in2.open(QFile::ReadOnly | QFile::Text)) + stream << in2.readAll(); } else { stream << "QMAKESPEC = " << dictionary["QMAKESPEC"] << endl; } -- cgit v1.2.3 From 53686bf86db1c2695ee16b903e4b86cc3ee74006 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 16 Nov 2016 15:57:36 +0100 Subject: configure: simplify version string setup this basically finishes the job of 2d2cb6434. Change-Id: I47a5e29ca0df7f521242790be64a09b3514be464 Reviewed-by: Lars Knoll --- tools/configure/configureapp.cpp | 38 +++++--------------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) (limited to 'tools/configure/configureapp.cpp') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index f7baf4086b..2e6ee2a681 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -117,34 +117,6 @@ Configure::Configure(int& argc, char** argv) //Only used when cross compiling. dictionary[ "QT_INSTALL_SETTINGS" ] = "/etc/xdg"; - QString version; - QFile qmake_conf(sourcePath + "/.qmake.conf"); - if (qmake_conf.open(QFile::ReadOnly)) { - while (!qmake_conf.atEnd()) { - static const char beginning[] = "MODULE_VERSION = "; - QByteArray line = qmake_conf.readLine(); - if (!line.startsWith(beginning)) - continue; - - version = qMove(line).mid(int(strlen(beginning))).trimmed(); - break; - } - qmake_conf.close(); - } - - if (version.isEmpty()) - version = QString("%1.%2.%3").arg(QT_VERSION>>16).arg(((QT_VERSION>>8)&0xff)).arg(QT_VERSION&0xff); - - dictionary[ "VERSION" ] = version; - { - QRegExp version_re("([0-9]*)\\.([0-9]*)\\.([0-9]*)(|-.*)"); - if (version_re.exactMatch(version)) { - dictionary[ "VERSION_MAJOR" ] = version_re.cap(1); - dictionary[ "VERSION_MINOR" ] = version_re.cap(2); - dictionary[ "VERSION_PATCH" ] = version_re.cap(3); - } - } - dictionary[ "REDO" ] = "no"; dictionary[ "BUILDTYPE" ] = "none"; @@ -604,7 +576,7 @@ void Configure::generateHeaders() QStringList args; args << "perl" << "-w"; args += sourcePath + "/bin/syncqt.pl"; - args << "-version" << dictionary["VERSION"] << "-minimal" << "-module" << "QtCore"; + args << "-version" << QT_VERSION_STR << "-minimal" << "-module" << "QtCore"; args += sourcePath; int retc = Environment::execute(args, QStringList(), QStringList()); if (retc) { @@ -860,10 +832,10 @@ void Configure::buildQmake() << "INC_PATH = " << QDir::toNativeSeparators( (QFile::exists(sourcePath + "/.git") ? ".." : sourcePath) + "/include") << endl; - stream << "QT_VERSION = " << dictionary["VERSION"] << endl - << "QT_MAJOR_VERSION = " << dictionary["VERSION_MAJOR"] << endl - << "QT_MINOR_VERSION = " << dictionary["VERSION_MINOR"] << endl - << "QT_PATCH_VERSION = " << dictionary["VERSION_PATCH"] << endl; + stream << "QT_VERSION = " QT_VERSION_STR << endl + << "QT_MAJOR_VERSION = " QT_STRINGIFY(QT_VERSION_MAJOR) << endl + << "QT_MINOR_VERSION = " QT_STRINGIFY(QT_VERSION_MINOR) << endl + << "QT_PATCH_VERSION = " QT_STRINGIFY(QT_VERSION_PATCH) << endl; if (dictionary[ "QMAKESPEC" ].startsWith("win32-g++")) { stream << "QMAKESPEC = $(SOURCE_PATH)\\mkspecs\\" << dictionary[ "QMAKESPEC" ] << endl << "CONFIG_CXXFLAGS = -std=c++11 -ffunction-sections" << endl -- cgit v1.2.3 From e2978d6097be2313e49c57ec14618033cbfa7414 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 18 Nov 2016 18:17:49 +0100 Subject: move license check to qmake-based configure system this also removes the need for passing pre-processed options via configure.cfg, so get rid of that. a somewhat unfortunate side effect is that the android-style-assets feature had to move back to the top level, as the licensing options depend on it. Started-by: Lars Knoll Change-Id: Id4d1e0ba18b3e3104400293b8f0c7f2f65e68dea Reviewed-by: Lars Knoll --- tools/configure/configureapp.cpp | 216 +++------------------------------------ 1 file changed, 14 insertions(+), 202 deletions(-) (limited to 'tools/configure/configureapp.cpp') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 841aa66b8f..fc66220335 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -29,7 +29,6 @@ #include "configureapp.h" #include "environment.h" -#include "tools.h" #include #include @@ -46,7 +45,6 @@ #include #include #include -#include QT_BEGIN_NAMESPACE @@ -66,13 +64,6 @@ std::ostream &operator<<(std::ostream &s, const QString &val) { using namespace std; -static inline void promptKeyPress() -{ - cout << "(Press any key to continue...)"; - if (_getch() == 3) // _Any_ keypress w/no echo(eat for stdout) - exit(0); // Exit cleanly for Ctrl+C -} - Configure::Configure(int& argc, char** argv) { int i; @@ -183,7 +174,6 @@ void Configure::parseCmdLine() if (j == argCount) break; dictionary["XQMAKESPEC"] = configCmdLine.at(j); - applySpecSpecifics(); break; } } @@ -419,12 +409,6 @@ void Configure::parseCmdLine() break; dictionary[ "ANDROID_NDK_TOOLCHAIN_VERSION" ] = configCmdLine.at(i); } - - else if (configCmdLine.at(i) == "-no-android-style-assets") { - dictionary[ "ANDROID_STYLE_ASSETS" ] = "no"; - } else if (configCmdLine.at(i) == "-android-style-assets") { - dictionary[ "ANDROID_STYLE_ASSETS" ] = "yes"; - } } // Ensure that QMAKESPEC exists in the mkspecs folder @@ -495,16 +479,6 @@ void Configure::parseCmdLine() } } -/*! - Modifies the default configuration based on given -platform option. - Eg. switches to different default styles for Windows CE. -*/ -void Configure::applySpecSpecifics() -{ - if (platform() == ANDROID) - dictionary["ANDROID_STYLE_ASSETS"] = "yes"; -} - void Configure::prepareConfigTests() { // Generate an empty .qmake.cache file for config.tests @@ -914,16 +888,6 @@ void Configure::buildQmake() void Configure::configure() { - FileWriter ci(buildPath + "/config.tests/configure.cfg"); - ci << "# Feature defaults set by configure command line\n" - << "config.input.qt_edition = " << dictionary["EDITION"] << "\n" - << "config.input.qt_licheck = " << dictionary["LICHECK"] << "\n" - << "config.input.qt_release_date = " << dictionary["RELEASEDATE"]; - if (!ci.flush()) { - dictionary[ "DONE" ] = "error"; - return; - } - QStringList args; args << buildPath + "/bin/qmake" << sourcePathMangled @@ -941,155 +905,6 @@ void Configure::configure() saveCmdLine(); } -bool Configure::showLicense(QString orgLicenseFile) -{ - bool showGpl2 = true; - QString licenseFile = orgLicenseFile; - QString theLicense; - if (dictionary["EDITION"] == "OpenSource") { - if (platform() != WINDOWS_RT - && (platform() != ANDROID || dictionary["ANDROID_STYLE_ASSETS"] == "no")) { - theLicense = "GNU Lesser General Public License (LGPL) version 3\n" - "or the GNU General Public License (GPL) version 2"; - } else { - theLicense = "GNU Lesser General Public License (LGPL) version 3"; - showGpl2 = false; - } - } else { - // the first line of the license file tells us which license it is - QFile file(licenseFile); - if (!file.open(QFile::ReadOnly)) { - cout << "Failed to load LICENSE file" << endl; - return false; - } - theLicense = file.readLine().trimmed(); - } - - forever { - char accept = '?'; - cout << "You are licensed to use this software under the terms of" << endl - << "the " << theLicense << "." << endl - << endl; - if (dictionary["EDITION"] == "OpenSource") { - cout << "Type 'L' to view the GNU Lesser General Public License version 3 (LGPLv3)." << endl; - if (showGpl2) - cout << "Type 'G' to view the GNU General Public License version 2 (GPLv2)." << endl; - } else { - cout << "Type '?' to view the " << theLicense << "." << endl; - } - cout << "Type 'y' to accept this license offer." << endl - << "Type 'n' to decline this license offer." << endl - << endl - << "Do you accept the terms of the license?" << endl; - cin >> accept; - accept = tolower(accept); - - if (accept == 'y') { - configCmdLine << "-confirm-license"; - return true; - } else if (accept == 'n') { - return false; - } else { - if (dictionary["EDITION"] == "OpenSource") { - if (accept == 'l') - licenseFile = orgLicenseFile + "/LICENSE.LGPL3"; - else - licenseFile = orgLicenseFile + "/LICENSE.GPL2"; - } - // Get console line height, to fill the screen properly - int i = 0, screenHeight = 25; // default - CONSOLE_SCREEN_BUFFER_INFO consoleInfo; - HANDLE stdOut = GetStdHandle(STD_OUTPUT_HANDLE); - if (GetConsoleScreenBufferInfo(stdOut, &consoleInfo)) - screenHeight = consoleInfo.srWindow.Bottom - - consoleInfo.srWindow.Top - - 1; // Some overlap for context - - // Prompt the license content to the user - QFile file(licenseFile); - if (!file.open(QFile::ReadOnly)) { - cout << "Failed to load LICENSE file" << licenseFile << endl; - return false; - } - QStringList licenseContent = QString(file.readAll()).split('\n'); - while (i < licenseContent.size()) { - cout << licenseContent.at(i) << endl; - if (++i % screenHeight == 0) { - promptKeyPress(); - cout << "\r"; // Overwrite text above - } - } - } - } -} - -void Configure::readLicense() -{ - dictionary["PLATFORM NAME"] = platformName(); - dictionary["LICENSE FILE"] = sourcePath; - - bool openSource = false; - bool hasOpenSource = QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.LGPL3") || QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.GPL2"); - if (dictionary["BUILDTYPE"] == "commercial") { - openSource = false; - } else if (dictionary["BUILDTYPE"] == "opensource") { - openSource = true; - } else if (hasOpenSource) { // No Open Source? Just display the commercial license right away - forever { - char accept = '?'; - cout << "Which edition of Qt do you want to use ?" << endl; - cout << "Type 'c' if you want to use the Commercial Edition." << endl; - cout << "Type 'o' if you want to use the Open Source Edition." << endl; - cin >> accept; - accept = tolower(accept); - - if (accept == 'c') { - openSource = false; - break; - } else if (accept == 'o') { - openSource = true; - break; - } - } - } - if (hasOpenSource && openSource) { - cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl << endl; - dictionary["LICENSEE"] = "Open Source"; - dictionary["EDITION"] = "OpenSource"; - } else if (openSource) { - cout << endl << "Cannot find the GPL license files! Please download the Open Source version of the library." << endl; - dictionary["DONE"] = "error"; - return; - } else { - QString tpLicense = sourcePath + "/LICENSE.PREVIEW.COMMERCIAL"; - if (QFile::exists(tpLicense)) { - cout << endl << "This is the Qt Preview Edition." << endl << endl; - - dictionary["EDITION"] = "Preview"; - dictionary["LICENSE FILE"] = tpLicense; - } else { - Tools::checkLicense(dictionary, sourcePath, buildPath); - } - } - - if (dictionary["LICENSE_CONFIRMED"] != "yes") { - if (!showLicense(dictionary["LICENSE FILE"])) { - cout << "Configuration aborted since license was not accepted" << endl; - dictionary["DONE"] = "error"; - return; - } - } else if (dictionary["LICHECK"].isEmpty()) { // licheck executable shows license - cout << "You have already accepted the terms of the license." << endl << endl; - } - - if (dictionary["BUILDTYPE"] == "none") { - if (openSource) - configCmdLine << "-opensource"; - else - configCmdLine << "-commercial"; - } -} - bool Configure::reloadCmdLine(int idx) { QFile inFile(buildPathMangled + "/config.opt"); @@ -1112,6 +927,20 @@ bool Configure::reloadCmdLine(int idx) void Configure::saveCmdLine() { if (dictionary[ "REDO" ] != "yes") { + if (dictionary["BUILDTYPE"] == "none") { + bool openSource = false; + QFile inFile(buildPath + "/mkspecs/qconfig.pri"); + if (inFile.open(QFile::ReadOnly | QFile::Text)) { + QTextStream inStream(&inFile); + while (!inStream.atEnd()) { + if (inStream.readLine() == "QT_EDITION = OpenSource") + openSource = true; + } + } + configCmdLine.append(openSource ? "-opensource" : "-commercial"); + } + if (dictionary["LICENSE_CONFIRMED"] != "yes") + configCmdLine.append("-confirm-license"); QFile outFile(buildPathMangled + "/config.opt"); if (outFile.open(QFile::WriteOnly | QFile::Text)) { QTextStream outStream(&outFile); @@ -1134,23 +963,6 @@ bool Configure::isOk() return (dictionary[ "DONE" ] != "error"); } -QString Configure::platformName() const -{ - switch (platform()) { - default: - case WINDOWS: - return QStringLiteral("Qt for Windows"); - case WINDOWS_RT: - return QStringLiteral("Qt for Windows Runtime"); - case QNX: - return QStringLiteral("Qt for QNX"); - case ANDROID: - return QStringLiteral("Qt for Android"); - case OTHER: - return QStringLiteral("Qt for ???"); - } -} - int Configure::platform() const { const QString xQMakeSpec = dictionary.value("XQMAKESPEC"); -- cgit v1.2.3