summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-12-13 09:36:26 +0100
committerLiang Qi <liang.qi@qt.io>2016-12-13 09:39:20 +0100
commit6755ec891a1740110c48895afd53d39e8370704a (patch)
tree982606f3bc582262e4b315a63f55ccb141fff97b /tools
parent449204f8c0d6679ae0e58dbb8a30b8a86fbdb4ec (diff)
parent00c9ec63a552d040e851b561c11428fabf1a2b08 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: configure qmake/Makefile.unix.macos qmake/Makefile.unix.win32 qmake/generators/win32/msvc_vcproj.cpp src/3rdparty/pcre/qt_attribution.json src/corelib/io/qsettings.cpp src/corelib/kernel/qdeadlinetimer.cpp src/platformsupport/kmsconvenience/qkmsdevice.cpp src/platformsupport/kmsconvenience/qkmsdevice_p.h src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h tests/manual/qstorageinfo/printvolumes.cpp tools/configure/configureapp.cpp Change-Id: Ibaabcc8e965c44926f9fb018466e8b132b8df49e
Diffstat (limited to 'tools')
-rw-r--r--tools/configure/Makefile.mingw4
-rw-r--r--tools/configure/Makefile.win324
-rw-r--r--tools/configure/configure.pro4
-rw-r--r--tools/configure/configureapp.cpp334
-rw-r--r--tools/configure/configureapp.h8
-rw-r--r--tools/configure/environment.cpp33
-rw-r--r--tools/configure/environment.h5
-rw-r--r--tools/configure/main.cpp7
-rw-r--r--tools/configure/tools.cpp85
-rw-r--r--tools/configure/tools.h43
10 files changed, 41 insertions, 486 deletions
diff --git a/tools/configure/Makefile.mingw b/tools/configure/Makefile.mingw
index 724084e0c8..e589ea3526 100644
--- a/tools/configure/Makefile.mingw
+++ b/tools/configure/Makefile.mingw
@@ -18,7 +18,6 @@ OBJECTS = \
main.o \
configureapp.o \
environment.o \
- tools.o \
qarraydata.o \
qbytearray.o \
qbytearraymatcher.o \
@@ -118,9 +117,8 @@ $(PCH): $(CONFSRC)/configure_pch.h
VPATH = $(CONFSRC):$(TOOLSRC)/shared/windows:$(CORESRC)/global:$(CORESRC)/kernel:$(CORESRC)/tools:$(CORESRC)/codecs:$(CORESRC)/io:$(CORESRC)/xml:$(CORESRC)/plugin
main.o: $(CONFSRC)/configureapp.h
-configureapp.o: $(CONFSRC)/configureapp.h $(CONFSRC)/environment.h $(CONFSRC)/tools.h
+configureapp.o: $(CONFSRC)/configureapp.h $(CONFSRC)/environment.h
environment.o: $(CONFSRC)/environment.h
-tools.o: $(CONFSRC)/tools.h
# Make sure qstring_compat.obj isn't compiled with PCH enabled
qstring_compat.o: $(CORESRC)/tools/qstring_compat.cpp
diff --git a/tools/configure/Makefile.win32 b/tools/configure/Makefile.win32
index 80e2a2e5fc..cc56610578 100644
--- a/tools/configure/Makefile.win32
+++ b/tools/configure/Makefile.win32
@@ -23,7 +23,6 @@ OBJECTS = \
main.obj \
configureapp.obj \
environment.obj \
- tools.obj \
qarraydata.obj \
qbytearray.obj \
qbytearraymatcher.obj \
@@ -99,9 +98,8 @@ $(PCH): $(CONFSRC)\configure_pch.h
$(OBJECTS): $(PCH)
main.obj: $(CONFSRC)\main.cpp $(CONFSRC)\configureapp.h $(PCH)
-configureapp.obj: $(CONFSRC)\configureapp.cpp $(CONFSRC)\configureapp.h $(CONFSRC)\environment.h $(CONFSRC)\tools.h $(PCH)
+configureapp.obj: $(CONFSRC)\configureapp.cpp $(CONFSRC)\configureapp.h $(CONFSRC)\environment.h $(PCH)
environment.obj: $(CONFSRC)\environment.cpp $(CONFSRC)\environment.h $(PCH)
-tools.obj: $(CONFSRC)\tools.cpp $(CONFSRC)\tools.h $(PCH)
registry.obj: $(TOOLSRC)\shared\windows\registry.cpp $(PCH)
qarraydata.obj: $(CORESRC)\tools\qarraydata.cpp $(PCH)
qbytearray.obj: $(CORESRC)\tools\qbytearray.cpp $(PCH)
diff --git a/tools/configure/configure.pro b/tools/configure/configure.pro
index 9149a30e3e..93e6a197a2 100644
--- a/tools/configure/configure.pro
+++ b/tools/configure/configure.pro
@@ -31,7 +31,7 @@ INCLUDEPATH += \
$$QT_BUILD_TREE/include/QtCore/$$QT.core.VERSION/QtCore \
$$QT_SOURCE_TREE/tools/shared
-HEADERS = configureapp.h environment.h tools.h\
+HEADERS = configureapp.h environment.h \
$$QT_SOURCE_TREE/src/corelib/tools/qarraydata.h \
$$QT_SOURCE_TREE/src/corelib/tools/qbytearray.h \
$$QT_SOURCE_TREE/src/corelib/tools/qarraydatapointer.h \
@@ -80,7 +80,7 @@ HEADERS = configureapp.h environment.h tools.h\
$$QT_SOURCE_TREE/tools/shared/windows/registry_p.h
-SOURCES = main.cpp configureapp.cpp environment.cpp tools.cpp \
+SOURCES = main.cpp configureapp.cpp environment.cpp \
$$QT_SOURCE_TREE/src/corelib/tools/qbytearray.cpp \
$$QT_SOURCE_TREE/src/corelib/tools/qarraydata.cpp \
$$QT_SOURCE_TREE/src/corelib/tools/qbytearraymatcher.cpp \
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index d6ad95c97d..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 <qdir.h>
#include <qdiriterator.h>
@@ -46,7 +45,6 @@
#include <string>
#include <fstream>
#include <windows.h>
-#include <conio.h>
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 <Enter> for stdout)
- exit(0); // Exit cleanly for Ctrl+C
-}
-
Configure::Configure(int& argc, char** argv)
{
int i;
@@ -107,12 +98,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";
@@ -120,34 +108,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";
@@ -176,12 +136,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;
@@ -220,7 +174,6 @@ void Configure::parseCmdLine()
if (j == argCount)
break;
dictionary["XQMAKESPEC"] = configCmdLine.at(j);
- applySpecSpecifics();
break;
}
}
@@ -456,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
@@ -481,19 +428,17 @@ 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 {
if (dictionary[ "QMAKESPEC" ].endsWith("-icc") ||
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" ].startsWith(QLatin1String("win32-g++"))) {
@@ -534,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
@@ -605,16 +540,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")
@@ -626,7 +551,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) {
@@ -882,63 +807,21 @@ 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
- << "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
- << " qfilesystemiterator_win.o \\" << endl
- << " qfsfileengine_win.o \\" << endl
- << " qlocale_win.o \\" << endl
- << " qoperatingsystemversion_win.o \\" << endl
- << " qsettings_win.o \\" << endl
- << " qsystemlibrary.o \\" << endl
- << " registry.o" << endl
- << "QTSRCS=\"$(SOURCE_PATH)/src/corelib/global/qoperatingsystemversion_win.cpp\" \\" << endl
- << " \"$(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;
}
@@ -1005,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
@@ -1032,148 +905,6 @@ void Configure::configure()
saveCmdLine();
}
-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 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;
- 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";
- return;
- }
- else {
- Tools::checkLicense(dictionary, sourcePath, buildPath);
- }
- if (dictionary["BUILDTYPE"] == "none") {
- if (openSource)
- configCmdLine << "-opensource";
- else
- configCmdLine << "-commercial";
- }
-}
-
bool Configure::reloadCmdLine(int idx)
{
QFile inFile(buildPathMangled + "/config.opt");
@@ -1196,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);
@@ -1218,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");
diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h
index b1c6ea9181..b007f3c487 100644
--- a/tools/configure/configureapp.h
+++ b/tools/configure/configureapp.h
@@ -54,14 +54,10 @@ public:
void generateQDevicePri();
void prepareConfigTests();
- bool showLicense(QString licenseFile);
- void readLicense();
-
bool isDone();
bool isOk();
int platform() const;
- QString platformName() const;
private:
int verbose;
@@ -86,10 +82,6 @@ private:
bool reloadCmdLine(int idx);
void saveCmdLine();
-
- void applySpecSpecifics();
-
- QString formatConfigPath(const char *var);
};
class FileWriter : public QTextStream
diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp
index 6cc350acc5..260af276fa 100644
--- a/tools/configure/environment.cpp
+++ b/tools/configure/environment.cpp
@@ -62,13 +62,13 @@ struct CompilerInfo{
const char *executable;
} compiler_info[] = {
// The compilers here are sorted in a reversed-preferred order
- {CC_BORLAND, "Borland C++", 0, "bcc32.exe"},
{CC_MINGW, "MinGW (Minimalist GNU for Windows)", 0, "g++.exe"},
{CC_INTEL, "Intel(R) C++ Compiler for 32-bit applications", 0, "icl.exe"}, // xilink.exe, xilink5.exe, xilink6.exe, xilib.exe
{CC_MSVC2012, "Microsoft (R) Visual Studio 2012 C/C++ Compiler (11.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\11.0", "cl.exe"}, // link.exe, lib.exe
{CC_MSVC2013, "Microsoft (R) Visual Studio 2013 C/C++ Compiler (12.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\12.0", "cl.exe"}, // link.exe, lib.exe
// Microsoft skipped version 13
{CC_MSVC2015, "Microsoft (R) Visual Studio 2015 C/C++ Compiler (14.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VS7\\14.0", "cl.exe"}, // link.exe, lib.exe
+ {CC_MSVC2017, "Microsoft (R) Visual Studio 2017 C/C++ Compiler (15.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VS7\\15.0", "cl.exe"}, // link.exe, lib.exe
{CC_UNKNOWN, "Unknown", 0, 0},
};
@@ -94,6 +94,9 @@ QString Environment::detectQMakeSpec()
{
QString spec;
switch (detectCompiler()) {
+ case CC_MSVC2017:
+ spec = "win32-msvc2017";
+ break;
case CC_MSVC2015:
spec = "win32-msvc2015";
break;
@@ -109,9 +112,6 @@ QString Environment::detectQMakeSpec()
case CC_MINGW:
spec = "win32-g++";
break;
- case CC_BORLAND:
- spec = "win32-borland";
- break;
default:
break;
}
@@ -378,29 +378,4 @@ int Environment::execute(QStringList arguments, const QStringList &additionalEnv
return exitCode;
}
-/*!
- Executes \a command with _popen() and returns the stdout of the command.
-
- Taken from qmake's system() command.
-*/
-QString Environment::execute(const QString &command, int *returnCode)
-{
- QString output;
- FILE *proc = _popen(command.toLatin1().constData(), "r");
- char buff[256];
- while (proc && !feof(proc)) {
- int read_in = int(fread(buff, 1, 255, proc));
- if (!read_in)
- break;
- buff[read_in] = '\0';
- output += buff;
- }
- if (proc) {
- int r = _pclose(proc);
- if (returnCode)
- *returnCode = r;
- }
- return output;
-}
-
QT_END_NAMESPACE
diff --git a/tools/configure/environment.h b/tools/configure/environment.h
index d14961b5ac..8415fa10a6 100644
--- a/tools/configure/environment.h
+++ b/tools/configure/environment.h
@@ -33,7 +33,6 @@ QT_BEGIN_NAMESPACE
enum Compiler {
CC_UNKNOWN = 0,
- CC_BORLAND = 0x01,
CC_MINGW = 0x02,
CC_INTEL = 0x03,
CC_MSVC2005 = 0x80,
@@ -41,7 +40,8 @@ enum Compiler {
CC_MSVC2010 = 0xA0,
CC_MSVC2012 = 0xB0,
CC_MSVC2013 = 0xC0,
- CC_MSVC2015 = 0xD0
+ CC_MSVC2015 = 0xD0,
+ CC_MSVC2017 = 0xE0
};
struct CompilerInfo;
@@ -52,7 +52,6 @@ public:
static QString detectQMakeSpec();
static int execute(QStringList arguments, const QStringList &additionalEnv, const QStringList &removeEnv);
- static QString execute(const QString &command, int *returnCode = 0);
private:
static Compiler detectedCompiler;
diff --git a/tools/configure/main.cpp b/tools/configure/main.cpp
index 91a99c16c2..f6c2722529 100644
--- a/tools/configure/main.cpp
+++ b/tools/configure/main.cpp
@@ -45,13 +45,6 @@ int runConfigure( int argc, char** argv )
if (!app.isOk())
return 3;
- // Read license now, and exit if it doesn't pass.
- // This lets the user see the command-line options of configure
- // without having to load and parse the license file.
- app.readLicense();
- if (!app.isOk())
- return 3;
-
// Source file with path settings. Needed by qmake.
app.generateQConfigCpp();
diff --git a/tools/configure/tools.cpp b/tools/configure/tools.cpp
deleted file mode 100644
index fb80e2136b..0000000000
--- a/tools/configure/tools.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "tools.h"
-#include "environment.h"
-
-#include <qdir.h>
-#include <qfile.h>
-#include <qbytearray.h>
-#include <qstringlist.h>
-
-#include <iostream>
-
-std::ostream &operator<<(std::ostream &s, const QString &val);
-using namespace std;
-
-void Tools::checkLicense(QMap<QString,QString> &dictionary,
- const QString &sourcePath, const QString &buildPath)
-{
- QString tpLicense = sourcePath + "/LICENSE.PREVIEW.COMMERCIAL";
- if (QFile::exists(tpLicense)) {
- dictionary["EDITION"] = "Preview";
- dictionary["LICENSE FILE"] = tpLicense;
- return;
- }
-
- dictionary["LICHECK"] = "licheck.exe";
-
- const QString licenseChecker =
- QDir::toNativeSeparators(sourcePath + "/bin/licheck.exe");
-
- if (QFile::exists(licenseChecker)) {
- const QString qMakeSpec =
- QDir::toNativeSeparators(dictionary.value("QMAKESPEC"));
- const QString xQMakeSpec =
- QDir::toNativeSeparators(dictionary.value("XQMAKESPEC"));
-
- QString command = QString("%1 %2 %3 %4 %5 %6")
- .arg(licenseChecker,
- dictionary.value("LICENSE_CONFIRMED", "no"),
- QDir::toNativeSeparators(sourcePath),
- QDir::toNativeSeparators(buildPath),
- qMakeSpec, xQMakeSpec);
-
- int returnValue = 0;
- QString licheckOutput = Environment::execute(command, &returnValue);
-
- if (returnValue) {
- dictionary["DONE"] = "error";
- } else {
- foreach (const QString &var, licheckOutput.split('\n'))
- dictionary[var.section('=', 0, 0).toUpper()] = var.section('=', 1, 1);
- }
- } else {
- cout << endl << "Error: Could not find licheck.exe" << endl
- << "Try re-installing." << endl << endl;
- dictionary["DONE"] = "error";
- }
-}
-
diff --git a/tools/configure/tools.h b/tools/configure/tools.h
deleted file mode 100644
index 17dcc88518..0000000000
--- a/tools/configure/tools.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef _TOOLS_H_
-#define _TOOLS_H_
-
-#include <qstring.h>
-#include <qmap.h>
-
-class Tools
-{
-public:
- static void checkLicense(QMap<QString,QString> &dictionary,
- const QString &sourcePath, const QString &buildPath);
-};
-
-#endif // _TOOLS_H_
-