From 04403d5b12debadf95b565bf84e0527ae787c87d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Jun 2016 23:21:03 -0700 Subject: Merge all "win32-msvc*" mkspecs into one Since we can tell the MSVC version from the compiler now, each of the qmake.conf files is now the same, so let's just have "win32-msvc" and be future-proof. Likewise for win32-clang-msvc. qplatformdefs.h was already common. Since we can't obtain the MSVC version from the unified mkspec name any more, I dropped the warning level during the qmake bootstrap to reduce the number of warnings that need to be disabled from compiler version to version. There is no point in keeping the old mkspecs, but configure will re-map the -platform argument to the unified spec as necessary, to keep existing configure command lines working. [ChangeLog][Visual Studio] Qt now has a common mkspec for all Visual Studio versions, called "win32-msvc". The old names which contained the version number are now gone (but qmake scopes based on the old names continue to work). The version of the compiler can be obtained from the MSC_VER and MSVC_VER variables (for example, for Visual Studio 2015, those contain the values 1900 and 14.0, respectively). Those variables are also available with the Intel compiler (win32-icc) and with Clang (win32-clang-msvc). Done-with: Oswald Buddenhagen Change-Id: Ib57b52598e2f452985e9fffd14587c0a77a5c09c Reviewed-by: Thiago Macieira Reviewed-by: Oswald Buddenhagen --- tools/configure/Makefile.mingw | 10 ++--- tools/configure/Makefile.win32 | 9 +---- tools/configure/configure.pro | 7 +--- tools/configure/configureapp.cpp | 13 ++++-- tools/configure/environment.cpp | 85 ++++++---------------------------------- tools/configure/environment.h | 8 +--- 6 files changed, 29 insertions(+), 103 deletions(-) (limited to 'tools') diff --git a/tools/configure/Makefile.mingw b/tools/configure/Makefile.mingw index b61dc38de4..ccc3a64cdf 100644 --- a/tools/configure/Makefile.mingw +++ b/tools/configure/Makefile.mingw @@ -1,11 +1,10 @@ CORESRC = $(QTSRC)src/corelib -TOOLSRC = $(QTSRC)tools -CONFSRC = $(TOOLSRC)/configure +CONFSRC = $(QTSRC)tools/configure RAW_PCH = configure_pch.h PCH = $(RAW_PCH).gch/c++ DEFINES = -DUNICODE -D_CRT_SECURE_NO_DEPRECATE -DQT_BOOTSTRAPPED -DQT_BUILD_CONFIGURE -DQT_USE_QSTRINGBUILDER -DQT_VERSION_STR=\"$(QTVERSION)\" -DQT_VERSION_MAJOR=$(QT_VERSION_MAJOR) -DQT_VERSION_MINOR=$(QT_VERSION_MINOR) -DQT_VERSION_PATCH=$(QT_VERSION_PATCH) -INCPATH = -I"../../include" -I"../../include/QtCore" -I"../../include/QtCore/$(QTVERSION)" -I"../../include/QtCore/$(QTVERSION)/QtCore" -I"$(TOOLSRC)/shared" -I"$(QTSRC)mkspecs/win32-g++" +INCPATH = -I"../../include" -I"../../include/QtCore" -I"../../include/QtCore/$(QTVERSION)" -I"../../include/QtCore/$(QTVERSION)/QtCore" -I"$(QTSRC)mkspecs/win32-g++" CXXFLAGS_BARE = -std=c++11 -fno-rtti -fno-exceptions -mthreads -Wall -Wextra $(DEFINES) $(INCPATH) CXXFLAGS = -include $(RAW_PCH) $(CXXFLAGS_BARE) LINK = g++ @@ -70,8 +69,7 @@ OBJECTS = \ qmalloc.o \ qxmlstream.o \ qxmlutils.o \ - quuid.o \ - registry.o + quuid.o $(TARGET): $(OBJECTS) $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) @@ -112,7 +110,7 @@ $(PCH): $(CONFSRC)/configure_pch.h @$(CHK_DIR_EXISTS) $(RAW_PCH).gch $(CHK_DIR_EXISTS_GLUE) $(MKDIR) $(RAW_PCH).gch $(CXX) -x c++-header -c $(CXXFLAGS_BARE) -o $@ $< -VPATH = $(CONFSRC):$(TOOLSRC)/shared/windows:$(CORESRC)/global:$(CORESRC)/kernel:$(CORESRC)/tools:$(CORESRC)/codecs:$(CORESRC)/io:$(CORESRC)/xml:$(CORESRC)/plugin +VPATH = $(CONFSRC):$(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 diff --git a/tools/configure/Makefile.win32 b/tools/configure/Makefile.win32 index 8864d6fc8f..f0199343be 100644 --- a/tools/configure/Makefile.win32 +++ b/tools/configure/Makefile.win32 @@ -1,9 +1,8 @@ CORESRC = $(QTSRC)src\corelib -TOOLSRC = $(QTSRC)tools -CONFSRC = $(TOOLSRC)\configure +CONFSRC = $(QTSRC)tools\configure DEFINES = -DUNICODE -D_CRT_SECURE_NO_DEPRECATE -DQT_BOOTSTRAPPED -DQT_BUILD_CONFIGURE -DQT_USE_QSTRINGBUILDER -DQT_VERSION_STR=\"$(QTVERSION)\" -DQT_VERSION_MAJOR=$(QT_VERSION_MAJOR) -DQT_VERSION_MINOR=$(QT_VERSION_MINOR) -DQT_VERSION_PATCH=$(QT_VERSION_PATCH) -INCPATH = -I"..\..\include" -I"..\..\include\QtCore" -I"..\..\include\QtCore\$(QTVERSION)" -I"..\..\include\QtCore\$(QTVERSION)\QtCore" -I"$(TOOLSRC)\shared" -I"$(QTSRC)mkspecs\win32-msvc2012" +INCPATH = -I"..\..\include" -I"..\..\include\QtCore" -I"..\..\include\QtCore\$(QTVERSION)" -I"..\..\include\QtCore\$(QTVERSION)\QtCore" -I"$(QTSRC)mkspecs\win32-msvc" CXXFLAGS_BARE = -nologo -Zc:wchar_t -W3 -GR -EHsc -w34100 -w34189 -wd4577 $(CFLAGS_CRT) $(EXTRA_CXXFLAGS) $(DEFINES) $(INCPATH) !IF ("$(CXX)" != "clang-cl") PCH = configure_pch.pch @@ -76,7 +75,6 @@ OBJECTS = \ qxmlstream.obj \ qxmlutils.obj \ quuid.obj \ - registry.obj \ $(PCH_OBJECT) $(TARGET): $(OBJECTS) @@ -98,7 +96,6 @@ $(OBJECTS): $(PCH) main.obj: $(CONFSRC)\main.cpp $(CONFSRC)\configureapp.h $(PCH) configureapp.obj: $(CONFSRC)\configureapp.cpp $(CONFSRC)\configureapp.h $(CONFSRC)\environment.h $(PCH) environment.obj: $(CONFSRC)\environment.cpp $(CONFSRC)\environment.h $(PCH) -registry.obj: $(TOOLSRC)\shared\windows\registry.cpp $(PCH) qarraydata.obj: $(CORESRC)\tools\qarraydata.cpp $(PCH) qbytearray.obj: $(CORESRC)\tools\qbytearray.cpp $(PCH) qbytearraymatcher.obj: $(CORESRC)\tools\qbytearraymatcher.cpp $(PCH) @@ -157,8 +154,6 @@ quuid.obj: $(CORESRC)\plugin\quuid.cpp $(PCH) {$(CONFSRC)}.cpp{}.obj:: $(CXX) -c $(CXXFLAGS) $< -{$(TOOLSRC)\shared\windows}.cpp{}.obj:: - $(CXX) -c $(CXXFLAGS) $< {$(CORESRC)\tools}.cpp{}.obj:: $(CXX) -c $(CXXFLAGS) $< {$(CORESRC)\codecs}.cpp{}.obj:: diff --git a/tools/configure/configure.pro b/tools/configure/configure.pro index 93e6a197a2..90da2de119 100644 --- a/tools/configure/configure.pro +++ b/tools/configure/configure.pro @@ -76,9 +76,7 @@ HEADERS = configureapp.h environment.h \ $$QT_SOURCE_TREE/src/corelib/tools/qunicodetables_p.h \ $$QT_SOURCE_TREE/src/corelib/kernel/qsystemerror_p.h \ $$QT_SOURCE_TREE/src/corelib/xml/qxmlstream.h \ - $$QT_SOURCE_TREE/src/corelib/xml/qxmlutils_p.h \ - $$QT_SOURCE_TREE/tools/shared/windows/registry_p.h - + $$QT_SOURCE_TREE/src/corelib/xml/qxmlutils_p.h SOURCES = main.cpp configureapp.cpp environment.cpp \ $$QT_SOURCE_TREE/src/corelib/tools/qbytearray.cpp \ @@ -134,5 +132,4 @@ SOURCES = main.cpp configureapp.cpp environment.cpp \ $$QT_SOURCE_TREE/src/corelib/xml/qxmlstream.cpp \ $$QT_SOURCE_TREE/src/corelib/xml/qxmlutils.cpp \ $$QT_SOURCE_TREE/src/corelib/plugin/quuid.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qcryptographichash.cpp \ - $$QT_SOURCE_TREE/tools/shared/windows/registry.cpp + $$QT_SOURCE_TREE/src/corelib/tools/qcryptographichash.cpp diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 2ffec0707f..6a09705cc1 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -163,6 +163,14 @@ void Configure::parseCmdLine() mkspecs << mkspec; } + if (dictionary[ "QMAKESPEC" ] == "win32-msvc2012" + || dictionary[ "QMAKESPEC" ] == "win32-msvc2013" + || dictionary[ "QMAKESPEC" ] == "win32-msvc2015" + || dictionary[ "QMAKESPEC" ] == "win32-msvc2017") { + cout << "\nNotice: re-mapping requested qmake spec to unified 'win32-msvc'.\n\n"; + dictionary[ "QMAKESPEC" ] = "win32-msvc"; + } + if (dictionary["QMAKESPEC"].toLower() == "features" || !mkspecs.contains(dictionary["QMAKESPEC"], Qt::CaseInsensitive)) { dictionary[ "DONE" ] = "error"; @@ -175,10 +183,7 @@ void Configure::parseCmdLine() 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("-msvc2017")) { + dictionary[ "QMAKESPEC" ].contains("-msvc")) { if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "nmake"; dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32"; } else if (dictionary[ "QMAKESPEC" ].startsWith(QLatin1String("win32-g++"))) { diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp index 260af276fa..312e2f9e56 100644 --- a/tools/configure/environment.cpp +++ b/tools/configure/environment.cpp @@ -51,25 +51,18 @@ using namespace std; #include #endif -#include // from tools/shared - QT_BEGIN_NAMESPACE struct CompilerInfo{ Compiler compiler; const char *compilerStr; - const char *regKey; const char *executable; } compiler_info[] = { // The compilers here are sorted in a reversed-preferred order - {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}, + {CC_MINGW, "MinGW (Minimalist GNU for Windows)", "g++.exe"}, + {CC_INTEL, "Intel(R) C++ Compiler for 32-bit applications", "icl.exe"}, // xilink.exe, xilink5.exe, xilink6.exe, xilib.exe + {CC_MSVC, "Microsoft (R) Visual Studio C/C++ Compiler", "cl.exe"}, // link.exe, lib.exe + {CC_UNKNOWN, "Unknown", 0}, }; @@ -94,17 +87,8 @@ QString Environment::detectQMakeSpec() { QString spec; switch (detectCompiler()) { - case CC_MSVC2017: - spec = "win32-msvc2017"; - break; - case CC_MSVC2015: - spec = "win32-msvc2015"; - break; - case CC_MSVC2013: - spec = "win32-msvc2013"; - break; - case CC_MSVC2012: - spec = "win32-msvc2012"; + case CC_MSVC: + spec = "win32-msvc"; break; case CC_INTEL: spec = "win32-icc"; @@ -128,61 +112,15 @@ QString Environment::detectQMakeSpec() */ Compiler Environment::detectCompiler() { -#ifndef Q_OS_WIN32 - return CC_UNKNOWN; // Always generate CC_UNKNOWN on other platforms -#else if(detectedCompiler != CC_UNKNOWN) return detectedCompiler; int installed = 0; - - // Check for compilers in registry first, to see which version is in PATH - QString paths = qgetenv("PATH"); - QStringList pathlist = paths.toLower().split(";"); - for(int i = 0; compiler_info[i].compiler; ++i) { - QString productPath = qt_readRegistryKey(HKEY_LOCAL_MACHINE, compiler_info[i].regKey, - KEY_WOW64_32KEY).toLower(); - if (productPath.length()) { - QStringList::iterator it; - for(it = pathlist.begin(); it != pathlist.end(); ++it) { - if((*it).contains(productPath)) { - if (detectedCompiler != compiler_info[i].compiler) { - ++installed; - detectedCompiler = compiler_info[i].compiler; - } - /* else { - - We detected the same compiler again, which happens when - configure is build with the 64-bit compiler. Skip the - duplicate so that we don't think it's installed twice. - - } - */ - break; - } - } - } - } - - // Now just go looking for the executables, and accept any executable as the lowest version - if (!installed) { - for(int i = 0; compiler_info[i].compiler; ++i) { - QString executable = QString(compiler_info[i].executable).toLower(); - if (executable.length() && !QStandardPaths::findExecutable(executable).isEmpty()) { - if (detectedCompiler != compiler_info[i].compiler) { - ++installed; - detectedCompiler = compiler_info[i].compiler; - } - /* else { - - We detected the same compiler again, which happens when - configure is build with the 64-bit compiler. Skip the - duplicate so that we don't think it's installed twice. - - } - */ - break; - } + for (int i = 0; compiler_info[i].compiler; ++i) { + if (!QStandardPaths::findExecutable(compiler_info[i].executable).isEmpty()) { + if (detectedCompiler == CC_UNKNOWN) + detectedCompiler = compiler_info[i].compiler; + ++installed; } } @@ -191,7 +129,6 @@ Compiler Environment::detectCompiler() detectedCompiler = CC_UNKNOWN; } return detectedCompiler; -#endif }; /*! diff --git a/tools/configure/environment.h b/tools/configure/environment.h index 8415fa10a6..65ddc60eff 100644 --- a/tools/configure/environment.h +++ b/tools/configure/environment.h @@ -35,13 +35,7 @@ enum Compiler { CC_UNKNOWN = 0, CC_MINGW = 0x02, CC_INTEL = 0x03, - CC_MSVC2005 = 0x80, - CC_MSVC2008 = 0x90, - CC_MSVC2010 = 0xA0, - CC_MSVC2012 = 0xB0, - CC_MSVC2013 = 0xC0, - CC_MSVC2015 = 0xD0, - CC_MSVC2017 = 0xE0 + CC_MSVC = 0x04 }; struct CompilerInfo; -- cgit v1.2.3 From 9b68bc4147e1a8e61cbe0b5e318001fd6b76c7be Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 18 Nov 2016 11:42:35 +0100 Subject: move "shared" registry reading code into qmake now that configureapp does not use it any more, qmake is the only remaining user. and the license headers already claimed that this code is part of qmake ... Change-Id: I9b8a16f8f2b432d2b1143efbdd1f0042305ccc0c Reviewed-by: Thiago Macieira --- tools/shared/windows/registry.cpp | 158 -------------------------------------- tools/shared/windows/registry_p.h | 73 ------------------ 2 files changed, 231 deletions(-) delete mode 100644 tools/shared/windows/registry.cpp delete mode 100644 tools/shared/windows/registry_p.h (limited to 'tools') diff --git a/tools/shared/windows/registry.cpp b/tools/shared/windows/registry.cpp deleted file mode 100644 index 74c912ca43..0000000000 --- a/tools/shared/windows/registry.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the qmake application 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 -#include "registry_p.h" - -QT_BEGIN_NAMESPACE - -#ifdef Q_OS_WIN32 -/*! - Returns the path part of a registry key. - e.g. - For a key - "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir" - it returns - "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\" -*/ -static QString keyPath(const QString &rKey) -{ - int idx = rKey.lastIndexOf(QLatin1Char('\\')); - if (idx == -1) - return QString(); - return rKey.left(idx + 1); -} - -/*! - Returns the name part of a registry key. - e.g. - For a key - "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir" - it returns - "ProductDir" -*/ -static QString keyName(const QString &rKey) -{ - int idx = rKey.lastIndexOf(QLatin1Char('\\')); - if (idx == -1) - return rKey; - - QString res(rKey.mid(idx + 1)); - if (res == QLatin1String("Default") || res == QLatin1String(".")) - res = QString(); - return res; -} -#endif - -QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey, unsigned long options) -{ - QString result; - -#ifdef Q_OS_WIN32 - QString rSubkeyName = keyName(rSubkey); - QString rSubkeyPath = keyPath(rSubkey); - - HKEY handle = 0; - LONG res = RegOpenKeyEx(parentHandle, (wchar_t*)rSubkeyPath.utf16(), 0, - KEY_READ | options, &handle); - - if (res != ERROR_SUCCESS) - return QString(); - - // get the size and type of the value - DWORD dataType; - DWORD dataSize; - res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize); - if (res != ERROR_SUCCESS) { - RegCloseKey(handle); - return QString(); - } - - // get the value - QByteArray data(dataSize, 0); - res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, 0, - reinterpret_cast(data.data()), &dataSize); - if (res != ERROR_SUCCESS) { - RegCloseKey(handle); - return QString(); - } - - switch (dataType) { - case REG_EXPAND_SZ: - case REG_SZ: { - result = QString::fromWCharArray(((const wchar_t *)data.constData())); - break; - } - - case REG_MULTI_SZ: { - QStringList l; - int i = 0; - for (;;) { - QString s = QString::fromWCharArray((const wchar_t *)data.constData() + i); - i += s.length() + 1; - - if (s.isEmpty()) - break; - l.append(s); - } - result = l.join(QLatin1String(", ")); - break; - } - - case REG_NONE: - case REG_BINARY: { - result = QString::fromWCharArray((const wchar_t *)data.constData(), data.size() / 2); - break; - } - - case REG_DWORD_BIG_ENDIAN: - case REG_DWORD: { - Q_ASSERT(data.size() == sizeof(int)); - int i; - memcpy((char*)&i, data.constData(), sizeof(int)); - result = QString::number(i); - break; - } - - default: - qWarning("QSettings: unknown data %u type in windows registry", quint32(dataType)); - break; - } - - RegCloseKey(handle); -#else - Q_UNUSED(parentHandle); - Q_UNUSED(rSubkey) - Q_UNUSED(options); -#endif - - return result; -} - -QT_END_NAMESPACE - diff --git a/tools/shared/windows/registry_p.h b/tools/shared/windows/registry_p.h deleted file mode 100644 index 3526dffd45..0000000000 --- a/tools/shared/windows/registry_p.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the qmake application 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 QT_WINDOWS_REGISTRY_H -#define QT_WINDOWS_REGISTRY_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -QT_BEGIN_NAMESPACE - -#include - -#ifdef Q_OS_WIN32 - #include -#else - typedef void* HKEY; -#endif - -#include - -/** - * Read a value from the Windows registry. - * - * If the key is not found, or the registry cannot be accessed (for example - * if this code is compiled for a platform other than Windows), a null - * string is returned. - * - * 32-bit code reads from the registry's 32 bit view (Wow6432Node), - * 64 bit code reads from the 64 bit view. - * Pass KEY_WOW64_32KEY to access the 32 bit view regardless of the - * application's architecture, KEY_WOW64_64KEY respectively. - */ -QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey, - unsigned long options = 0); - -QT_END_NAMESPACE - -#endif // QT_WINDOWS_REGISTRY_H - -- cgit v1.2.3 From 8f49da6c18a2a86576f06deb9a6ff1deef748837 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 18 Nov 2016 16:24:31 +0100 Subject: ... and so configureapp.exe disappeareth Change-Id: I3fd9f2b0d4cf05a625484fce21532da8563cd62c Reviewed-by: Thiago Macieira --- tools/configure/Makefile.mingw | 125 ------------- tools/configure/Makefile.win32 | 174 ------------------ tools/configure/configure.pro | 135 -------------- tools/configure/configure_pch.h | 41 ----- tools/configure/configureapp.cpp | 380 --------------------------------------- tools/configure/configureapp.h | 74 -------- tools/configure/environment.cpp | 318 -------------------------------- tools/configure/environment.h | 57 ------ tools/configure/main.cpp | 72 -------- 9 files changed, 1376 deletions(-) delete mode 100644 tools/configure/Makefile.mingw delete mode 100644 tools/configure/Makefile.win32 delete mode 100644 tools/configure/configure.pro delete mode 100644 tools/configure/configure_pch.h delete mode 100644 tools/configure/configureapp.cpp delete mode 100644 tools/configure/configureapp.h delete mode 100644 tools/configure/environment.cpp delete mode 100644 tools/configure/environment.h delete mode 100644 tools/configure/main.cpp (limited to 'tools') diff --git a/tools/configure/Makefile.mingw b/tools/configure/Makefile.mingw deleted file mode 100644 index ccc3a64cdf..0000000000 --- a/tools/configure/Makefile.mingw +++ /dev/null @@ -1,125 +0,0 @@ -CORESRC = $(QTSRC)src/corelib -CONFSRC = $(QTSRC)tools/configure - -RAW_PCH = configure_pch.h -PCH = $(RAW_PCH).gch/c++ -DEFINES = -DUNICODE -D_CRT_SECURE_NO_DEPRECATE -DQT_BOOTSTRAPPED -DQT_BUILD_CONFIGURE -DQT_USE_QSTRINGBUILDER -DQT_VERSION_STR=\"$(QTVERSION)\" -DQT_VERSION_MAJOR=$(QT_VERSION_MAJOR) -DQT_VERSION_MINOR=$(QT_VERSION_MINOR) -DQT_VERSION_PATCH=$(QT_VERSION_PATCH) -INCPATH = -I"../../include" -I"../../include/QtCore" -I"../../include/QtCore/$(QTVERSION)" -I"../../include/QtCore/$(QTVERSION)/QtCore" -I"$(QTSRC)mkspecs/win32-g++" -CXXFLAGS_BARE = -std=c++11 -fno-rtti -fno-exceptions -mthreads -Wall -Wextra $(DEFINES) $(INCPATH) -CXXFLAGS = -include $(RAW_PCH) $(CXXFLAGS_BARE) -LINK = g++ -LFLAGS = -Wl,-subsystem,console -mthreads -LIBS = -lole32 -ladvapi32 -luuid - -TARGET = ../../configureapp.exe - -OBJECTS = \ - main.o \ - configureapp.o \ - environment.o \ - qarraydata.o \ - qbytearray.o \ - qbytearraymatcher.o \ - qhash.o \ - qlist.o \ - qlocale.o \ - qlocale_win.o \ - qlocale_tools.o \ - qvector.o \ - qutfcodec.o \ - qtextcodec.o \ - qglobal.o \ - qnumeric.o \ - qbuffer.o \ - qdatastream.o \ - qdir.o \ - qdiriterator.o \ - qfiledevice.o \ - qfile.o \ - qfileinfo.o \ - qabstractfileengine.o \ - qfilesystementry.o \ - qfilesystemengine.o \ - qfilesystemengine_win.o \ - qfilesystemiterator_win.o \ - qfsfileengine.o \ - qfsfileengine_win.o \ - qfsfileengine_iterator.o \ - qiodevice.o \ - qringbuffer.o \ - qdebug.o \ - qtextstream.o \ - qlogging.o \ - qtemporaryfile.o \ - qstandardpaths.o \ - qstandardpaths_win.o \ - qsystemlibrary.o \ - qbitarray.o \ - qdatetime.o \ - qmap.o \ - qregexp.o \ - qstring.o \ - qstring_compat.o \ - qstringbuilder.o \ - qstringlist.o \ - qvsnprintf.o \ - qvariant.o \ - qsystemerror.o \ - qmetatype.o \ - qmalloc.o \ - qxmlstream.o \ - qxmlutils.o \ - quuid.o - -$(TARGET): $(OBJECTS) - $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) - -$(OBJECTS): $(PCH) - -# 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. -ifeq ($(SHELL), sh.exe) - ifeq ($(wildcard "$(CURDIR)/sh.exe"), ) - SH = 0 - else - SH = 1 - endif -else - SH = 1 -endif - -ifeq ($(SH), 1) - CHK_DIR_EXISTS = test -d - CHK_DIR_EXISTS_GLUE = || - MKDIR = mkdir -p -else - CHK_DIR_EXISTS = if not exist - CHK_DIR_EXISTS_GLUE = - MKDIR = md -endif - -$(PCH): $(CONFSRC)/configure_pch.h - @$(CHK_DIR_EXISTS) $(RAW_PCH).gch $(CHK_DIR_EXISTS_GLUE) $(MKDIR) $(RAW_PCH).gch - $(CXX) -x c++-header -c $(CXXFLAGS_BARE) -o $@ $< - -VPATH = $(CONFSRC):$(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 -environment.o: $(CONFSRC)/environment.h - -# Make sure qstring_compat.obj isn't compiled with PCH enabled -qstring_compat.o: $(CORESRC)/tools/qstring_compat.cpp - $(CXX) -c $(CXXFLAGS_BARE) -o $@ $< - -clean: - -rm -f *.o - -rm -rf *.gch diff --git a/tools/configure/Makefile.win32 b/tools/configure/Makefile.win32 deleted file mode 100644 index f0199343be..0000000000 --- a/tools/configure/Makefile.win32 +++ /dev/null @@ -1,174 +0,0 @@ -CORESRC = $(QTSRC)src\corelib -CONFSRC = $(QTSRC)tools\configure - -DEFINES = -DUNICODE -D_CRT_SECURE_NO_DEPRECATE -DQT_BOOTSTRAPPED -DQT_BUILD_CONFIGURE -DQT_USE_QSTRINGBUILDER -DQT_VERSION_STR=\"$(QTVERSION)\" -DQT_VERSION_MAJOR=$(QT_VERSION_MAJOR) -DQT_VERSION_MINOR=$(QT_VERSION_MINOR) -DQT_VERSION_PATCH=$(QT_VERSION_PATCH) -INCPATH = -I"..\..\include" -I"..\..\include\QtCore" -I"..\..\include\QtCore\$(QTVERSION)" -I"..\..\include\QtCore\$(QTVERSION)\QtCore" -I"$(QTSRC)mkspecs\win32-msvc" -CXXFLAGS_BARE = -nologo -Zc:wchar_t -W3 -GR -EHsc -w34100 -w34189 -wd4577 $(CFLAGS_CRT) $(EXTRA_CXXFLAGS) $(DEFINES) $(INCPATH) -!IF ("$(CXX)" != "clang-cl") -PCH = configure_pch.pch -PCH_OBJECT = configure_pch.obj -CXXFLAGS = -FIconfigure_pch.h -Yuconfigure_pch.h -Fp$(PCH) -MP $(CXXFLAGS_BARE) -!ELSE -PCH = -CXXFLAGS = -Wmicrosoft $(CXXFLAGS_BARE) -!ENDIF -LINK = link -LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST /MANIFESTFILE:"configure.intermediate.manifest" -LIBS = ole32.lib advapi32.lib shell32.lib - -TARGET = ..\..\configureapp.exe - -OBJECTS = \ - main.obj \ - configureapp.obj \ - environment.obj \ - qarraydata.obj \ - qbytearray.obj \ - qbytearraymatcher.obj \ - qhash.obj \ - qlist.obj \ - qlocale.obj \ - qlocale_win.obj \ - qlocale_tools.obj \ - qvector.obj \ - qutfcodec.obj \ - qtextcodec.obj \ - qglobal.obj \ - qnumeric.obj \ - qbuffer.obj \ - qdatastream.obj \ - qdir.obj \ - qdiriterator.obj \ - qfiledevice.obj \ - qfile.obj \ - qfileinfo.obj \ - qabstractfileengine.obj \ - qfilesystementry.obj \ - qfilesystemengine.obj \ - qfilesystemengine_win.obj \ - qfilesystemiterator_win.obj \ - qfsfileengine.obj \ - qfsfileengine_win.obj \ - qfsfileengine_iterator.obj \ - qiodevice.obj \ - qringbuffer.obj \ - qdebug.obj \ - qtextstream.obj \ - qlogging.obj \ - qtemporaryfile.obj \ - qstandardpaths.obj \ - qstandardpaths_win.obj \ - qsystemlibrary.obj \ - qbitarray.obj \ - qdatetime.obj \ - qmap.obj \ - qregexp.obj \ - qstring.obj \ - qstring_compat.obj \ - qstringbuilder.obj \ - qstringlist.obj \ - qvsnprintf.obj \ - qvariant.obj \ - qsystemerror.obj \ - qmetatype.obj \ - qmalloc.obj \ - qxmlstream.obj \ - qxmlutils.obj \ - quuid.obj \ - $(PCH_OBJECT) - -$(TARGET): $(OBJECTS) - $(LINK) $(LFLAGS) /OUT:$(TARGET) @<< - $(OBJECTS) $(LIBS) -<< - mt.exe -nologo -manifest "configure.intermediate.manifest" -outputresource:$(TARGET);1 - -clean: - -del *.obj - -del *.pch - -del configure.intermediate.manifest - -$(PCH): $(CONFSRC)\configure_pch.h - $(CXX) -c -Yc $(CXXFLAGS_BARE) -Fp$@ -Foconfigure_pch.obj -TP $** - -$(OBJECTS): $(PCH) - -main.obj: $(CONFSRC)\main.cpp $(CONFSRC)\configureapp.h $(PCH) -configureapp.obj: $(CONFSRC)\configureapp.cpp $(CONFSRC)\configureapp.h $(CONFSRC)\environment.h $(PCH) -environment.obj: $(CONFSRC)\environment.cpp $(CONFSRC)\environment.h $(PCH) -qarraydata.obj: $(CORESRC)\tools\qarraydata.cpp $(PCH) -qbytearray.obj: $(CORESRC)\tools\qbytearray.cpp $(PCH) -qbytearraymatcher.obj: $(CORESRC)\tools\qbytearraymatcher.cpp $(PCH) -qhash.obj: $(CORESRC)\tools\qhash.cpp $(PCH) -qlist.obj: $(CORESRC)\tools\qlist.cpp $(PCH) -qlocale.obj: $(CORESRC)\tools\qlocale.cpp $(PCH) -qlocale_win.obj: $(CORESRC)\tools\qlocale_win.cpp $(PCH) -qlocale_tools.obj: $(CORESRC)\tools\qlocale_tools.cpp $(PCH) -qvector.obj: $(CORESRC)\tools\qvector.cpp $(PCH) -qutfcodec.obj: $(CORESRC)\codecs\qutfcodec.cpp $(PCH) -qtextcodec.obj: $(CORESRC)\codecs\qtextcodec.cpp $(PCH) -qglobal.obj: $(CORESRC)\global\qglobal.cpp $(PCH) -qnumeric.obj: $(CORESRC)\global\qnumeric.cpp $(PCH) -qbuffer.obj: $(CORESRC)\io\qbuffer.cpp $(PCH) -qdatastream.obj: $(CORESRC)\io\qdatastream.cpp $(PCH) -qdir.obj: $(CORESRC)\io\qdir.cpp $(PCH) -qdiriterator.obj: $(CORESRC)\io\qdiriterator.cpp $(PCH) -qfiledevice.obj: $(CORESRC)\io\qfiledevice.cpp $(PCH) -qfile.obj: $(CORESRC)\io\qfile.cpp $(PCH) -qfileinfo.obj: $(CORESRC)\io\qfileinfo.cpp $(PCH) -qabstractfileengine.obj: $(CORESRC)\io\qabstractfileengine.cpp $(PCH) -qfilesystementry.obj: $(CORESRC)\io\qfilesystementry.cpp $(PCH) -qfilesystemengine.obj: $(CORESRC)\io\qfilesystemengine.cpp $(PCH) -qfilesystemengine_win.obj: $(CORESRC)\io\qfilesystemengine_win.cpp $(PCH) -qfilesystemiterator_win.obj: $(CORESRC)\io\qfilesystemiterator_win.cpp $(PCH) -qfsfileengine.obj: $(CORESRC)\io\qfsfileengine.cpp $(PCH) -qfsfileengine_win.obj: $(CORESRC)\io\qfsfileengine_win.cpp $(PCH) -qfsfileengine_iterator.obj: $(CORESRC)\io\qfsfileengine_iterator.cpp $(PCH) -qiodevice.obj: $(CORESRC)\io\qiodevice.cpp $(PCH) -qringbuffer.obj: $(CORESRC)\tools\qringbuffer.cpp $(PCH) -qdebug.obj: $(CORESRC)\io\qdebug.cpp $(PCH) -qtextstream.obj: $(CORESRC)\io\qtextstream.cpp $(PCH) -qtemporaryfile.obj: $(CORESRC)\io\qtemporaryfile.cpp $(PCH) -qstandardpaths.obj: $(CORESRC)\io\qstandardpaths.cpp $(PCH) -qstandardpaths_win.obj: $(CORESRC)\io\qstandardpaths_win.cpp $(PCH) -qsystemlibrary.obj: $(CORESRC)\plugin\qsystemlibrary.cpp $(PCH) -qbitarray.obj: $(CORESRC)\tools\qbitarray.cpp $(PCH) -qdatetime.obj: $(CORESRC)\tools\qdatetime.cpp $(PCH) -qmap.obj: $(CORESRC)\tools\qmap.cpp $(PCH) -qregexp.obj: $(CORESRC)\tools\qregexp.cpp $(PCH) -qstring.obj: $(CORESRC)\tools\qstring.cpp $(PCH) -qstringbuilder.obj: $(CORESRC)\tools\qstringbuilder.cpp $(PCH) -qstringlist.obj: $(CORESRC)\tools\qstringlist.cpp $(PCH) -qvsnprintf.obj: $(CORESRC)\tools\qvsnprintf.cpp $(PCH) -qvariant.obj: $(CORESRC)\kernel\qvariant.cpp $(PCH) -qsystemerror.obj: $(CORESRC)\kernel\qsystemerror.cpp $(PCH) -qline.obj: $(CORESRC)\tools\qline.cpp $(PCH) -qsize.obj: $(CORESRC)\tools\qsize.cpp $(PCH) -qpoint.obj: $(CORESRC)\tools\qpoint.cpp $(PCH) -qrect.obj: $(CORESRC)\tools\qrect.cpp $(PCH) -qmetatype.obj: $(CORESRC)\kernel\qmetatype.cpp $(PCH) -qmalloc.obj: $(CORESRC)\global\qmalloc.cpp $(PCH) -qxmlstream.obj: $(CORESRC)\xml\qxmlstream.cpp $(PCH) -qxmlutils.obj: $(CORESRC)\xml\qxmlutils.cpp $(PCH) -quuid.obj: $(CORESRC)\plugin\quuid.cpp $(PCH) - -{$(CONFSRC)}.cpp{}.obj:: - $(CXX) -c $(CXXFLAGS) $< -{$(CORESRC)\tools}.cpp{}.obj:: - $(CXX) -c $(CXXFLAGS) $< -{$(CORESRC)\codecs}.cpp{}.obj:: - $(CXX) -c $(CXXFLAGS) $< -{$(CORESRC)\global}.cpp{}.obj:: - $(CXX) -c $(CXXFLAGS) $< -{$(CORESRC)\io}.cpp{}.obj:: - $(CXX) -c $(CXXFLAGS) $< -{$(CORESRC)\kernel}.cpp{}.obj:: - $(CXX) -c $(CXXFLAGS) $< -{$(CORESRC)\plugin}.cpp{}.obj:: - $(CXX) -c $(CXXFLAGS) $< -{$(CORESRC)\xml}.cpp{}.obj:: - $(CXX) -c $(CXXFLAGS) $< - -# Make sure qstring_compat.obj isn't compiled with PCH enabled -qstring_compat.obj: $(CORESRC)\tools\qstring_compat.cpp - $(CXX) -c $(CXXFLAGS_BARE) $(CORESRC)\tools\qstring_compat.cpp diff --git a/tools/configure/configure.pro b/tools/configure/configure.pro deleted file mode 100644 index 90da2de119..0000000000 --- a/tools/configure/configure.pro +++ /dev/null @@ -1,135 +0,0 @@ -TARGET = configureapp -DESTDIR = $$PWD/../.. # build directly in source dir - -CONFIG += console flat stl rtti_off -CONFIG -= moc qt -DEFINES = UNICODE _CRT_SECURE_NO_DEPRECATE QT_USE_QSTRINGBUILDER -DEFINES += QT_BOOTSTRAPPED QT_BUILD_CONFIGURE - -win32 : LIBS += -lole32 -ladvapi32 -mingw : LIBS += -luuid - -win32-msvc* { - QMAKE_CFLAGS_RELEASE -= -MD - QMAKE_CFLAGS_RELEASE -= -O2 - QMAKE_CFLAGS_RELEASE += -MT -O1 -Os - QMAKE_CFLAGS_DEBUG -= -MDd - QMAKE_CFLAGS_DEBUG += -MTd - QMAKE_CXXFLAGS_RELEASE -= -MD - QMAKE_CXXFLAGS_RELEASE -= -O2 - QMAKE_CXXFLAGS_RELEASE += -MT -O1 -Os - QMAKE_CXXFLAGS_DEBUG -= -MDd - QMAKE_CXXFLAGS_DEBUG += -MTd -} - -PRECOMPILED_HEADER = configure_pch.h - -INCLUDEPATH += \ - $$QT_BUILD_TREE/include \ - $$QT_BUILD_TREE/include/QtCore \ - $$QT_BUILD_TREE/include/QtCore/$$QT.core.VERSION \ - $$QT_BUILD_TREE/include/QtCore/$$QT.core.VERSION/QtCore \ - $$QT_SOURCE_TREE/tools/shared - -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 \ - $$QT_SOURCE_TREE/src/corelib/tools/qarraydataops.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qbytearraymatcher.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qchar.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qhash.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qlist.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qlocale.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qvector.h \ - $$QT_SOURCE_TREE/src/corelib/codecs/qutfcodec_p.h \ - $$QT_SOURCE_TREE/src/corelib/codecs/qtextcodec.h \ - $$QT_SOURCE_TREE/src/corelib/global/qglobal.h \ - $$QT_SOURCE_TREE/src/corelib/global/qnumeric.h \ - $$QT_SOURCE_TREE/src/corelib/global/qlogging.h \ - $$QT_SOURCE_TREE/src/corelib/io/qbuffer.h \ - $$QT_SOURCE_TREE/src/corelib/io/qdatastream.h \ - $$QT_SOURCE_TREE/src/corelib/io/qdir.h \ - $$QT_SOURCE_TREE/src/corelib/io/qdiriterator.h \ - $$QT_SOURCE_TREE/src/corelib/io/qfiledevice.h \ - $$QT_SOURCE_TREE/src/corelib/io/qfile.h \ - $$QT_SOURCE_TREE/src/corelib/io/qfileinfo.h \ - $$QT_SOURCE_TREE/src/corelib/io/qfilesystementry_p.h \ - $$QT_SOURCE_TREE/src/corelib/io/qfilesystemengine_p.h \ - $$QT_SOURCE_TREE/src/corelib/io/qfilesystemmetadata_p.h \ - $$QT_SOURCE_TREE/src/corelib/io/qfilesystemiterator_p.h \ - $$QT_SOURCE_TREE/src/corelib/io/qfsfileengine.h \ - $$QT_SOURCE_TREE/src/corelib/io/qfsfileengine_iterator_p.h \ - $$QT_SOURCE_TREE/src/corelib/io/qiodevice.h \ - $$QT_SOURCE_TREE/src/corelib/io/qtextstream.h \ - $$QT_SOURCE_TREE/src/corelib/io/qtemporaryfile.h \ - $$QT_SOURCE_TREE/src/corelib/io/qstandardpaths.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qbitarray.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qdatetime.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qmap.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qregexp.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qringbuffer_p.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qstring.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qstringbuilder.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qstringlist.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qstringmatcher.h \ - $$QT_SOURCE_TREE/src/corelib/tools/qunicodetables_p.h \ - $$QT_SOURCE_TREE/src/corelib/kernel/qsystemerror_p.h \ - $$QT_SOURCE_TREE/src/corelib/xml/qxmlstream.h \ - $$QT_SOURCE_TREE/src/corelib/xml/qxmlutils_p.h - -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 \ - $$QT_SOURCE_TREE/src/corelib/tools/qhash.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qlist.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qlocale.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qlocale_win.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qlocale_tools.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qvector.cpp \ - $$QT_SOURCE_TREE/src/corelib/codecs/qutfcodec.cpp \ - $$QT_SOURCE_TREE/src/corelib/codecs/qtextcodec.cpp \ - $$QT_SOURCE_TREE/src/corelib/global/qglobal.cpp \ - $$QT_SOURCE_TREE/src/corelib/global/qnumeric.cpp \ - $$QT_SOURCE_TREE/src/corelib/global/qlogging.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qbuffer.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qdatastream.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qdir.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qdiriterator.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfiledevice.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfile.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfileinfo.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qabstractfileengine.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfilesystementry.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfilesystemengine.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfilesystemengine_win.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfilesystemiterator_win.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfsfileengine.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfsfileengine_win.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfsfileengine_iterator.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qiodevice.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qdebug.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qtextstream.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qtemporaryfile.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qstandardpaths.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qstandardpaths_win.cpp \ - $$QT_SOURCE_TREE/src/corelib/plugin/qsystemlibrary.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qbitarray.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qdatetime.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qmap.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qregexp.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qringbuffer.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qstring.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qstringbuilder.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qstring_compat.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qstringlist.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qvsnprintf.cpp \ - $$QT_SOURCE_TREE/src/corelib/kernel/qvariant.cpp \ - $$QT_SOURCE_TREE/src/corelib/kernel/qsystemerror.cpp \ - $$QT_SOURCE_TREE/src/corelib/kernel/qmetatype.cpp \ - $$QT_SOURCE_TREE/src/corelib/global/qmalloc.cpp \ - $$QT_SOURCE_TREE/src/corelib/xml/qxmlstream.cpp \ - $$QT_SOURCE_TREE/src/corelib/xml/qxmlutils.cpp \ - $$QT_SOURCE_TREE/src/corelib/plugin/quuid.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qcryptographichash.cpp diff --git a/tools/configure/configure_pch.h b/tools/configure/configure_pch.h deleted file mode 100644 index 8e36f7e54e..0000000000 --- a/tools/configure/configure_pch.h +++ /dev/null @@ -1,41 +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$ -** -****************************************************************************/ - -// for rand_s, _CRT_RAND_S must be #defined before #including stdlib.h. -// put it at the beginning so some indirect inclusion doesn't break it -#ifndef _CRT_RAND_S -#define _CRT_RAND_S -#endif -#include -#include -#include -#include // All moc genereated code has this include -#include -#include -#include -#include diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp deleted file mode 100644 index 6a09705cc1..0000000000 --- a/tools/configure/configureapp.cpp +++ /dev/null @@ -1,380 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2016 Intel Corporation. -** 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 "configureapp.h" -#include "environment.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -std::ostream &operator<<(std::ostream &s, const QString &val) { - s << val.toLocal8Bit().data(); - return s; -} - - -using namespace std; - -Configure::Configure(int& argc, char** argv) -{ - int i; - - for (i = 1; i < argc; i++) - configCmdLine += argv[ i ]; - - if (configCmdLine.size() >= 2 && configCmdLine.at(0) == "-srcdir") { - sourcePath = QDir::cleanPath(configCmdLine.at(1)); - sourceDir = QDir(sourcePath); - configCmdLine.erase(configCmdLine.begin(), configCmdLine.begin() + 2); - } else { - // Get the path to the executable - 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(); - if (sourceDir != buildDir) { //shadow builds! - QDir(buildPath).mkpath("bin"); - - buildDir.mkpath("mkspecs"); - } - - if (dictionary[ "QMAKESPEC" ].size() == 0) { - dictionary[ "QMAKESPEC" ] = Environment::detectQMakeSpec(); - dictionary[ "QMAKESPEC_FROM" ] = "detected"; - } - - dictionary[ "SYNCQT" ] = "auto"; - - QString tmp = dictionary[ "QMAKESPEC" ]; - if (tmp.contains("\\")) { - tmp = tmp.mid(tmp.lastIndexOf("\\") + 1); - } else { - tmp = tmp.mid(tmp.lastIndexOf("/") + 1); - } - dictionary[ "QMAKESPEC" ] = tmp; -} - -Configure::~Configure() -{ -} - -void Configure::parseCmdLine() -{ - sourcePathMangled = sourcePath; - buildPathMangled = buildPath; - if (configCmdLine.size() && configCmdLine.at(0) == "-top-level") { - dictionary[ "TOPLEVEL" ] = "yes"; - configCmdLine.removeAt(0); - sourcePathMangled = QFileInfo(sourcePath).path(); - buildPathMangled = QFileInfo(buildPath).path(); - } - qmakeCmdLine = configCmdLine; - - int argCount = configCmdLine.size(); - int i = 0; - - // Look first for -redo - for (int k = 0 ; k < argCount; ++k) { - if (configCmdLine.at(k) == "-redo") { - configCmdLine.removeAt(k); - if (!reloadCmdLine(k)) { - dictionary["DONE"] = "error"; - return; - } - argCount = configCmdLine.size(); - break; - } - } - - for (; i -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Configure -{ -public: - Configure( int& argc, char** argv ); - ~Configure(); - - void parseCmdLine(); - - void buildQmake(); - - void prepareConfigureInput(); - void configure(); - - void generateHeaders(); - - bool isDone(); - bool isOk(); - -private: - int verbose; - - // Our variable dictionaries - QMap dictionary; - QStringList configCmdLine, qmakeCmdLine; - - QString outputLine; - - QTextStream outStream; - QString sourcePath, buildPath; - QString sourcePathMangled, buildPathMangled; - QDir sourceDir, buildDir; - - bool reloadCmdLine(int idx); -}; - -QT_END_NAMESPACE diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp deleted file mode 100644 index 312e2f9e56..0000000000 --- a/tools/configure/environment.cpp +++ /dev/null @@ -1,318 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2016 Intel Corporation. -** 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 "environment.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -//#define CONFIGURE_DEBUG_EXECUTE -//#define CONFIGURE_DEBUG_CP_DIR - -using namespace std; - -#ifdef Q_OS_WIN32 -#include -#endif - -QT_BEGIN_NAMESPACE - -struct CompilerInfo{ - Compiler compiler; - const char *compilerStr; - const char *executable; -} compiler_info[] = { - // The compilers here are sorted in a reversed-preferred order - {CC_MINGW, "MinGW (Minimalist GNU for Windows)", "g++.exe"}, - {CC_INTEL, "Intel(R) C++ Compiler for 32-bit applications", "icl.exe"}, // xilink.exe, xilink5.exe, xilink6.exe, xilib.exe - {CC_MSVC, "Microsoft (R) Visual Studio C/C++ Compiler", "cl.exe"}, // link.exe, lib.exe - {CC_UNKNOWN, "Unknown", 0}, -}; - - -// Initialize static variables -Compiler Environment::detectedCompiler = CC_UNKNOWN; - -/*! - Returns the pointer to the CompilerInfo for a \a compiler. -*/ -CompilerInfo *Environment::compilerInfo(Compiler compiler) -{ - int i = 0; - while(compiler_info[i].compiler != compiler && compiler_info[i].compiler != CC_UNKNOWN) - ++i; - return &(compiler_info[i]); -} - -/*! - Returns the qmakespec for the compiler detected on the system. -*/ -QString Environment::detectQMakeSpec() -{ - QString spec; - switch (detectCompiler()) { - case CC_MSVC: - spec = "win32-msvc"; - break; - case CC_INTEL: - spec = "win32-icc"; - break; - case CC_MINGW: - spec = "win32-g++"; - break; - default: - break; - } - - return spec; -} - -/*! - Returns the enum of the compiler which was detected on the system. - The compilers are detected in the order as entered into the - compiler_info list. - - If more than one compiler is found, CC_UNKNOWN is returned. -*/ -Compiler Environment::detectCompiler() -{ - if(detectedCompiler != CC_UNKNOWN) - return detectedCompiler; - - int installed = 0; - for (int i = 0; compiler_info[i].compiler; ++i) { - if (!QStandardPaths::findExecutable(compiler_info[i].executable).isEmpty()) { - if (detectedCompiler == CC_UNKNOWN) - detectedCompiler = compiler_info[i].compiler; - ++installed; - } - } - - if (installed > 1) { - cout << "Found more than one known compiler! Using \"" << compilerInfo(detectedCompiler)->compilerStr << "\"" << endl; - detectedCompiler = CC_UNKNOWN; - } - return detectedCompiler; -}; - -/*! - Creates a commandling from \a program and it \a arguments, - escaping characters that needs it. -*/ -static QString qt_create_commandline(const QString &program, const QStringList &arguments) -{ - QString programName = program; - if (!programName.startsWith("\"") && !programName.endsWith("\"") && programName.contains(" ")) - programName = "\"" + programName + "\""; - programName.replace("/", "\\"); - - QString args; - // add the prgram as the first arrg ... it works better - args = programName + " "; - for (int i=0; i0 && tmp.at(i-1) == '\\') { - --i; - endQuote += "\\"; - } - args += QString(" \"") + tmp.left(i) + endQuote; - } else { - args += ' ' + tmp; - } - } - return args; -} - -/*! - Creates a QByteArray of the \a environment. -*/ -static QByteArray qt_create_environment(const QStringList &environment) -{ - QByteArray envlist; - if (environment.isEmpty()) - return envlist; - - int pos = 0; - // add PATH if necessary (for DLL loading) - QByteArray path = qgetenv("PATH"); - if (environment.filter(QRegExp("^PATH=",Qt::CaseInsensitive)).isEmpty() && !path.isNull()) { - QString tmp = QString(QLatin1String("PATH=%1")).arg(QString::fromLocal8Bit(path)); - uint tmpSize = sizeof(wchar_t) * (tmp.length() + 1); - envlist.resize(envlist.size() + tmpSize); - memcpy(envlist.data() + pos, tmp.utf16(), tmpSize); - pos += tmpSize; - } - // add the user environment - foreach (const QString &tmp, environment) { - uint tmpSize = sizeof(wchar_t) * (tmp.length() + 1); - envlist.resize(envlist.size() + tmpSize); - memcpy(envlist.data() + pos, tmp.utf16(), tmpSize); - pos += tmpSize; - } - // add the 2 terminating 0 (actually 4, just to be on the safe side) - envlist.resize(envlist.size() + 4); - envlist[pos++] = 0; - envlist[pos++] = 0; - envlist[pos++] = 0; - envlist[pos++] = 0; - - return envlist; -} - -/*! - Executes the command described in \a arguments, in the - environment inherited from the parent process, with the - \a additionalEnv settings applied. - \a removeEnv removes the specified environment variables from - the environment of the executed process. - - Returns the exit value of the process, or -1 if the command could - not be executed. - - This function uses _(w)spawnvpe to spawn a process by searching - through the PATH environment variable. -*/ -int Environment::execute(QStringList arguments, const QStringList &additionalEnv, const QStringList &removeEnv) -{ -#ifdef CONFIGURE_DEBUG_EXECUTE - qDebug() << "About to Execute: " << arguments; - qDebug() << " " << QDir::currentPath(); - qDebug() << " " << additionalEnv; - qDebug() << " " << removeEnv; -#endif - // Create the full environment from the current environment and - // the additionalEnv strings, then remove all variables defined - // in removeEnv - QMap fullEnvMap; - LPWSTR envStrings = GetEnvironmentStrings(); - if (envStrings) { - int strLen = 0; - for (LPWSTR envString = envStrings; *(envString); envString += strLen + 1) { - strLen = int(wcslen(envString)); - QString str = QString((const QChar*)envString, strLen); - if (!str.startsWith("=")) { // These are added by the system - int sepIndex = str.indexOf('='); - fullEnvMap.insert(str.left(sepIndex).toUpper(), str.mid(sepIndex +1)); - } - } - } - FreeEnvironmentStrings(envStrings); - - // Add additionalEnv variables - for (int i = 0; i < additionalEnv.count(); ++i) { - const QString &str = additionalEnv.at(i); - int sepIndex = str.indexOf('='); - fullEnvMap.insert(str.left(sepIndex).toUpper(), str.mid(sepIndex +1)); - } - - // Remove removeEnv variables - for (int j = 0; j < removeEnv.count(); ++j) - fullEnvMap.remove(removeEnv.at(j).toUpper()); - - // Add all variables to a QStringList - QStringList fullEnv; - QMapIterator it(fullEnvMap); - while (it.hasNext()) { - it.next(); - fullEnv += QString(it.key() + "=" + it.value()); - } - - // ---------------------------- - QString program = arguments.takeAt(0); - QString args = qt_create_commandline(program, arguments); - QByteArray envlist = qt_create_environment(fullEnv); - - DWORD exitCode = DWORD(-1); - PROCESS_INFORMATION procInfo; - memset(&procInfo, 0, sizeof(procInfo)); - - STARTUPINFO startInfo; - memset(&startInfo, 0, sizeof(startInfo)); - startInfo.cb = sizeof(startInfo); - - bool couldExecute = CreateProcess(0, (wchar_t*)args.utf16(), - 0, 0, true, CREATE_UNICODE_ENVIRONMENT, - envlist.isEmpty() ? 0 : envlist.data(), - 0, &startInfo, &procInfo); - - if (couldExecute) { - WaitForSingleObject(procInfo.hProcess, INFINITE); - GetExitCodeProcess(procInfo.hProcess, &exitCode); - CloseHandle(procInfo.hThread); - CloseHandle(procInfo.hProcess); - } - - - if (exitCode == DWORD(-1)) { - switch(GetLastError()) { - case E2BIG: - cerr << "execute: Argument list exceeds 1024 bytes" << endl; - foreach (const QString &arg, arguments) - cerr << " (" << arg.toLocal8Bit().constData() << ")" << endl; - break; - case ENOENT: - cerr << "execute: File or path is not found (" << program.toLocal8Bit().constData() << ")" << endl; - break; - case ENOEXEC: - cerr << "execute: Specified file is not executable or has invalid executable-file format (" << program.toLocal8Bit().constData() << ")" << endl; - break; - case ENOMEM: - cerr << "execute: Not enough memory is available to execute new process." << endl; - break; - default: - cerr << "execute: Unknown error" << endl; - foreach (const QString &arg, arguments) - cerr << " (" << arg.toLocal8Bit().constData() << ")" << endl; - break; - } - } - return exitCode; -} - -QT_END_NAMESPACE diff --git a/tools/configure/environment.h b/tools/configure/environment.h deleted file mode 100644 index 65ddc60eff..0000000000 --- a/tools/configure/environment.h +++ /dev/null @@ -1,57 +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 - -QT_BEGIN_NAMESPACE - - -enum Compiler { - CC_UNKNOWN = 0, - CC_MINGW = 0x02, - CC_INTEL = 0x03, - CC_MSVC = 0x04 -}; - -struct CompilerInfo; -class Environment -{ -public: - static Compiler detectCompiler(); - static QString detectQMakeSpec(); - - static int execute(QStringList arguments, const QStringList &additionalEnv, const QStringList &removeEnv); - -private: - static Compiler detectedCompiler; - - static CompilerInfo *compilerInfo(Compiler compiler); -}; - - -QT_END_NAMESPACE diff --git a/tools/configure/main.cpp b/tools/configure/main.cpp deleted file mode 100644 index c6b555d14d..0000000000 --- a/tools/configure/main.cpp +++ /dev/null @@ -1,72 +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$ -** -****************************************************************************/ - -/* -** Configure tool -** -*/ - -#include "configureapp.h" - -QT_BEGIN_NAMESPACE - -int runConfigure( int argc, char** argv ) -{ - Configure app( argc, argv ); - if (!app.isOk()) - return 3; - - app.parseCmdLine(); - if (!app.isOk()) - return 3; - - // Bootstrapped includes. Needed by qmake. - app.generateHeaders(); - if (!app.isOk()) - return 3; - - // Bootstrap qmake. Needed by config tests. - app.buildQmake(); - if (!app.isOk()) - return 3; - - // run qmake based configure - app.configure(); - if (!app.isOk()) - return 3; - - return 0; -} - -QT_END_NAMESPACE - -int main( int argc, char** argv ) -{ - QT_USE_NAMESPACE - return runConfigure(argc, argv); -} -- cgit v1.2.3