From 267dd9133d76d466c0f940e7286dc9ba03bac18e Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 16 Sep 2016 14:37:16 +0200 Subject: Clean up building of bootstrap lib and tools Add a qconfig-bootstrap.h, which contains all the defines required to build the bootstrapped tools. This will be required anyway when moving more code over to use QT_CONFIG(foo) instead of QT_NO_FOO. Change-Id: I783d0aa0100b9190fe2d422bee4a95b05720aebe Reviewed-by: Oswald Buddenhagen Reviewed-by: Lars Knoll --- qmake/Makefile.unix | 9 +-- qmake/Makefile.win32 | 7 +-- qmake/qmake.pri | 6 +- src/corelib/global/qconfig-bootstrapped.h | 95 +++++++++++++++++++++++++++++++ src/corelib/global/qglobal.h | 4 +- src/tools/bootstrap/bootstrap.pro | 14 +---- tools/configure/Makefile.mingw | 2 +- tools/configure/Makefile.win32 | 2 +- tools/configure/configure.pro | 2 +- 9 files changed, 108 insertions(+), 33 deletions(-) create mode 100644 src/corelib/global/qconfig-bootstrapped.h diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index ffbd0d4545..320979150f 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -99,15 +99,12 @@ CPPFLAGS = -g $(EXTRA_CPPFLAGS) \ -I$(QMKSRC)/generators/mac -I$(QMKSRC)/generators/integrity \ -I$(INC_PATH) -I$(INC_PATH)/QtCore \ -I$(INC_PATH)/QtCore/$(QT_VERSION) -I$(INC_PATH)/QtCore/$(QT_VERSION)/QtCore \ - -I$(BUILD_PATH)/src/corelib/global -DHAVE_QCONFIG_CPP \ + -I$(BUILD_PATH)/src/corelib/global \ -I$(QMAKESPEC) \ -I$(SOURCE_PATH)/tools/shared \ -DQT_VERSION_STR=\"$(QT_VERSION)\" -DQT_VERSION_MAJOR=$(QT_MAJOR_VERSION) -DQT_VERSION_MINOR=$(QT_MINOR_VERSION) -DQT_VERSION_PATCH=$(QT_PATCH_VERSION) \ - -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \ - -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \ - -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ - -DQT_NO_FOREACH \ - -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_JSON_READONLY -DQT_NO_STANDARDPATHS + -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \ + -DQT_NO_FOREACH CXXFLAGS = $(EXTRA_CXXFLAGS) $(CPPFLAGS) diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index fc225ff098..5db8b04aa0 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -40,15 +40,12 @@ CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \ $(CFLAGS_EXTRA) \ -I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac -I$(QMKSRC)\generators\integrity \ -I$(INC_PATH) -I$(INC_PATH)\QtCore -I$(INC_PATH)\QtCore\$(QT_VERSION) -I$(INC_PATH)\QtCore\$(QT_VERSION)\QtCore \ - -I$(BUILD_PATH)\src\corelib\global -DHAVE_QCONFIG_CPP \ + -I$(BUILD_PATH)\src\corelib\global \ -I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \ -I$(SOURCE_PATH)\tools\shared \ -DQT_VERSION_STR=\"$(QT_VERSION)\" -DQT_VERSION_MAJOR=$(QT_MAJOR_VERSION) -DQT_VERSION_MINOR=$(QT_MINOR_VERSION) -DQT_VERSION_PATCH=$(QT_PATCH_VERSION) \ -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \ - -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \ - -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ - -DQT_NO_FOREACH \ - -DUNICODE -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_JSON_READONLY -DQT_NO_STANDARDPATHS + -DQT_NO_FOREACH -DUNICODE CFLAGS = $(CFLAGS_PCH) $(CFLAGS_BARE) $(CFLAGS) CXXFLAGS_BARE = $(CFLAGS_BARE) diff --git a/qmake/qmake.pri b/qmake/qmake.pri index 7f49bb9adb..288d99d8a2 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -151,11 +151,7 @@ bootstrap { #Qt code LFLAGS += -lcpp } - DEFINES += \ - QT_BOOTSTRAPPED \ - QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_NO_COMPONENT QT_NO_COMPRESS \ - QT_NO_THREAD QT_NO_QOBJECT QT_NO_GEOM_VARIANT QT_NO_DATASTREAM \ - QT_CRYPTOGRAPHICHASH_ONLY_SHA1 QT_JSON_READONLY QT_NO_STANDARDPATHS + DEFINES += QT_BOOTSTRAPPED INCLUDEPATH += \ $$QT.core.includes $$QT.core_private.includes \ diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h new file mode 100644 index 0000000000..38b0cf2abf --- /dev/null +++ b/src/corelib/global/qconfig-bootstrapped.h @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** 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-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// +// 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. +// +// Despite its file name, this really is not a public header. +// It is an implementation detail of the private bootstrap library. +// + +#if 0 +// silence syncqt warnings +#pragma qt_sync_skip_header_check +#pragma qt_sync_stop_processing +#endif + +#ifdef QT_BOOTSTRAPPED + +#ifndef QT_NO_EXCEPTIONS +#define QT_NO_EXCEPTIONS +#endif + +#define QT_NO_USING_NAMESPACE +#define QT_NO_DEPRECATED + +#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1 +#define QT_NO_DATASTREAM +#define QT_NO_LIBRARY +#define QT_FEATURE_library -1 +#define QT_NO_QOBJECT +#define QT_NO_SYSTEMLOCALE +#define QT_NO_THREAD +#define QT_NO_TRANSLATION +#define QT_FEATURE_translation -1 +#define QT_NO_GEOM_VARIANT + +#if defined(QT_BUILD_QMAKE) || defined(QT_BUILD_CONFIGURE) +#define QT_NO_COMPRESS +#define QT_JSON_READONLY +#define QT_NO_TEXTCODEC +#define QT_FEATURE_textcodec -1 +#else +#define QT_FEATURE_textcodec 1 +#define QT_NO_CODECS +#define QT_FEATURE_codecs -1 +#endif + +#if defined(QT_BUILD_QMAKE) +#define QT_NO_STANDARDPATHS +#endif + +#endif // QT_BOOTSTRAPPED diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index dd8b6110b3..8b67f0d3ef 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -56,7 +56,9 @@ */ #define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) -#ifndef QT_BOOTSTRAPPED +#ifdef QT_BOOTSTRAPPED +#include +#else #include #include #endif diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index 8a1e1fd6e3..0e0a617f2b 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -11,22 +11,10 @@ MODULE_DEFINES = \ QT_VERSION_MINOR=$$QT_MINOR_VERSION \ QT_VERSION_PATCH=$$QT_PATCH_VERSION \ QT_BOOTSTRAPPED \ - QT_LITE_UNICODE \ - QT_NO_CAST_TO_ASCII \ - QT_NO_CODECS \ - QT_NO_DATASTREAM \ - QT_NO_LIBRARY \ - QT_NO_QOBJECT \ - QT_NO_SYSTEMLOCALE \ - QT_NO_THREAD \ - QT_NO_UNICODETABLES \ - QT_NO_USING_NAMESPACE \ - QT_NO_DEPRECATED \ - QT_NO_TRANSLATION + QT_NO_CAST_TO_ASCII DEFINES += \ $$MODULE_DEFINES \ - QT_CRYPTOGRAPHICHASH_ONLY_SHA1 \ QT_NO_FOREACH \ QT_NO_CAST_FROM_ASCII diff --git a/tools/configure/Makefile.mingw b/tools/configure/Makefile.mingw index bdf5758b61..ff960115f9 100644 --- a/tools/configure/Makefile.mingw +++ b/tools/configure/Makefile.mingw @@ -4,7 +4,7 @@ CONFSRC = $(TOOLSRC)/configure RAW_PCH = configure_pch.h PCH = $(RAW_PCH).gch/c++ -DEFINES = -DUNICODE -DQT_NO_DATASTREAM -DQT_NO_CODECS -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -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) +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++" CXXFLAGS_BARE = -std=c++11 -fno-rtti -fno-exceptions -mthreads -Wall -Wextra $(DEFINES) $(INCPATH) CXXFLAGS = -include $(RAW_PCH) $(CXXFLAGS_BARE) diff --git a/tools/configure/Makefile.win32 b/tools/configure/Makefile.win32 index 94cc074730..8ed2ffd23f 100644 --- a/tools/configure/Makefile.win32 +++ b/tools/configure/Makefile.win32 @@ -2,7 +2,7 @@ CORESRC = $(QTSRC)src\corelib TOOLSRC = $(QTSRC)tools CONFSRC = $(TOOLSRC)\configure -DEFINES = -DUNICODE -DQT_NO_CODECS -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -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) +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" CXXFLAGS_BARE = -nologo -Zc:wchar_t -W3 -GR -EHsc -w34100 -w34189 -wd4577 $(CFLAGS_CRT) $(EXTRA_CXXFLAGS) $(DEFINES) $(INCPATH) !IF ("$(CXX)" != "clang-cl") diff --git a/tools/configure/configure.pro b/tools/configure/configure.pro index 5a42a4be95..9149a30e3e 100644 --- a/tools/configure/configure.pro +++ b/tools/configure/configure.pro @@ -3,7 +3,7 @@ DESTDIR = $$PWD/../.. # build directly in source dir CONFIG += console flat stl rtti_off CONFIG -= moc qt -DEFINES = UNICODE QT_NO_CODECS QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_LITE_COMPONENT QT_NO_COMPRESS QT_NO_THREAD QT_NO_QOBJECT QT_NO_GEOM_VARIANT _CRT_SECURE_NO_DEPRECATE QT_USE_QSTRINGBUILDER +DEFINES = UNICODE _CRT_SECURE_NO_DEPRECATE QT_USE_QSTRINGBUILDER DEFINES += QT_BOOTSTRAPPED QT_BUILD_CONFIGURE win32 : LIBS += -lole32 -ladvapi32 -- cgit v1.2.3