From 08a737def9145a53615871bb5900f9794bf699f5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 23 Oct 2013 15:24:03 +0200 Subject: generate qfeatures.h at build time much more elegant than the checked in file. and less chance to get it wrong, as people often enough do. Change-Id: I975a62dfd83ce4f15947ce54f3c40931b1badae0 Reviewed-by: Tasuku Suzuki Reviewed-by: Joerg Bornemann --- qtbase.pro | 47 +++ src/corelib/global/global.pri | 1 + src/corelib/global/qfeatures.h | 686 -------------------------------------- src/corelib/global/qglobal.h | 3 +- sync.profile | 2 +- util/scripts/make_qfeatures_dot_h | 198 ----------- 6 files changed, 50 insertions(+), 887 deletions(-) delete mode 100644 src/corelib/global/qfeatures.h delete mode 100755 util/scripts/make_qfeatures_dot_h diff --git a/qtbase.pro b/qtbase.pro index d3b03d1fba..afdeed853c 100644 --- a/qtbase.pro +++ b/qtbase.pro @@ -103,6 +103,53 @@ prefix_build|!equals(PWD, $$OUT_PWD) { } +# Generate qfeatures.h +features = +lines = $$cat("src/corelib/global/qfeatures.txt", lines) +for (line, lines) { + t = $$replace(line, "^Feature: (\\S+)\\s*$", "\\1") + !isEqual(t, $$line) { + feature = $$t + features += $$t + } else { + t = $$replace(line, "^Requires: (.*)$", "\\1") + !isEqual(t, $$line) { + features.$${feature}.depends = $$replace(t, \\s+$, ) + } else { + t = $$replace(line, "^Name: (.*)$", "\\1") + !isEqual(t, $$line) { + features.$${feature}.name = $$replace(t, \\s+$, ) + } + } + } +} +features = $$sort_depends(features, features.) +features = $$reverse(features) +FEATURES_H = \ + "/*" \ + " * All features and their dependencies." \ + " *" \ + " * This list is generated by qmake from /src/corelib/global/qfeatures.txt" \ + " */" +for (ft, features) { + FEATURES_H += \ + "$$escape_expand(\\n)// $$eval(features.$${ft}.name)" + isEmpty(features.$${ft}.depends) { + FEATURES_H += \ + "//$${LITERAL_HASH}define QT_NO_$$ft" + } else { + FEATURES_H += \ + "$${LITERAL_HASH}if !defined(QT_NO_$$ft) && ($$join($$list($$split(features.$${ft}.depends)), ") || defined(QT_NO_", "defined(QT_NO_", ")"))" \ + "$${LITERAL_HASH} define QT_NO_$$ft" \ + "$${LITERAL_HASH}endif" + } +} +write_file($$OUT_PWD/src/corelib/global/qfeatures.h, FEATURES_H)|error("Aborting.") +# Create forwarding header +FWD_FEATURES_H = \ + '$${LITERAL_HASH}include "../../src/corelib/global/qfeatures.h"' +write_file($$OUT_PWD/include/QtCore/qfeatures.h, FWD_FEATURES_H)|error("Aborting.") + #mkspecs mkspecs.path = $$[QT_HOST_DATA]/mkspecs mkspecs.files = \ diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri index a0842a946d..fd031469f6 100644 --- a/src/corelib/global/global.pri +++ b/src/corelib/global/global.pri @@ -31,6 +31,7 @@ INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global # configure creates these, not syncqt, so we need to manually inject them qconfig_h_files = \ + $$OUT_PWD/global/qfeatures.h \ $$OUT_PWD/global/qconfig.h \ $$QT_BUILD_TREE/include/QtCore/QtConfig targ_headers.files += $$qconfig_h_files diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h deleted file mode 100644 index 17dd600265..0000000000 --- a/src/corelib/global/qfeatures.h +++ /dev/null @@ -1,686 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - * All features and their dependencies. - * - * This list is generated from $QTDIR/src/corelib/global/qfeatures.txt - * by $QTSRCDIR/util/scripts/make_qfeatures_dot_h - */ - -// QAction -//#define QT_NO_ACTION - -// QClipboard -//#define QT_NO_CLIPBOARD - -// Color Names -//#define QT_NO_COLORNAMES - -// QtConcurrent -//#define QT_NO_CONCURRENT - -// CssParser -//#define QT_NO_CSSPARSER - -// QCursor -//#define QT_NO_CURSOR - -// QDesktopServices -//#define QT_NO_DESKTOPSERVICES - -// Document Object Model -//#define QT_NO_DOM - -// Effects -//#define QT_NO_EFFECTS - -// QFileSystemIterator -//#define QT_NO_FILESYSTEMITERATOR - -// QFileSystemWatcher -//#define QT_NO_FILESYSTEMWATCHER - -// Freetype Font Engine -//#define QT_NO_FREETYPE - -// Gesture -//#define QT_NO_GESTURES - -// QGroupBox -//#define QT_NO_GROUPBOX - -// QHostInfo -//#define QT_NO_HOSTINFO - -// BMP Image Format -//#define QT_NO_IMAGEFORMAT_BMP - -// JPEG Image Format -//#define QT_NO_IMAGEFORMAT_JPEG - -// PNG Image Format -//#define QT_NO_IMAGEFORMAT_PNG - -// PPM Image Format -//#define QT_NO_IMAGEFORMAT_PPM - -// XBM Image Format -//#define QT_NO_IMAGEFORMAT_XBM - -// XPM Image Format -//#define QT_NO_IMAGEFORMAT_XPM - -// QImage::createHeuristicMask() -//#define QT_NO_IMAGE_HEURISTIC_MASK - -// Image Text -//#define QT_NO_IMAGE_TEXT - -// QKeySequenceEdit -//#define QT_NO_KEYSEQUENCEEDIT - -// QLCDNumber -//#define QT_NO_LCDNUMBER - -// QLibrary -//#define QT_NO_LIBRARY - -// QLineEdit -//#define QT_NO_LINEEDIT - -// QMessageBox -//#define QT_NO_MESSAGEBOX - -// QMovie -//#define QT_NO_MOVIE - -// QNetworkInterface -//#define QT_NO_NETWORKINTERFACE - -// QNetworkProxy -//#define QT_NO_NETWORKPROXY - -// Qt::WA_PaintOnScreen -//#define QT_NO_PAINTONSCREEN - -// Painting Debug Utilities -//#define QT_NO_PAINT_DEBUG - -// QPicture -//#define QT_NO_PICTURE - -// QProcess -//#define QT_NO_PROCESS - -// QProgressBar -//#define QT_NO_PROGRESSBAR - -// Properties -//#define QT_NO_PROPERTIES - -// QRegularExpression -//#define QT_NO_REGULAREXPRESSION - -// Resize Handler -//#define QT_NO_RESIZEHANDLER - -// QRubberBand -//#define QT_NO_RUBBERBAND - -// Session Manager -//#define QT_NO_SESSIONMANAGER - -// QSettings -//#define QT_NO_SETTINGS - -// QSharedMemory -//#define QT_NO_SHAREDMEMORY - -// QShortcut -//#define QT_NO_SHORTCUT - -// QSizeGrip -//#define QT_NO_SIZEGRIP - -// QSlider -//#define QT_NO_SLIDER - -// Spin Widget -//#define QT_NO_SPINWIDGET - -// Splash screen widget -//#define QT_NO_SPLASHSCREEN - -// QStackedWidget -//#define QT_NO_STACKEDWIDGET - -// QStatusBar -//#define QT_NO_STATUSBAR - -// Status Tip -//#define QT_NO_STATUSTIP - -// QWindowsStyle -//#define QT_NO_STYLE_WINDOWS - -// QSystemSemaphore -//#define QT_NO_SYSTEMSEMAPHORE - -// QSystemTrayIcon -//#define QT_NO_SYSTEMTRAYICON - -// QTabletEvent -//#define QT_NO_TABLETEVENT - -// QTemporaryFile -//#define QT_NO_TEMPORARYFILE - -// QTextCodec -//#define QT_NO_TEXTCODEC - -// Text Date -//#define QT_NO_TEXTDATE - -// HtmlParser -//#define QT_NO_TEXTHTMLPARSER - -// QToolTip -//#define QT_NO_TOOLTIP - -// Translation -//#define QT_NO_TRANSLATION - -// QUdpSocket -//#define QT_NO_UDPSOCKET - -// QUndoCommand -//#define QT_NO_UNDOCOMMAND - -// QValidator -//#define QT_NO_VALIDATOR - -// QWheelEvent -//#define QT_NO_WHEELEVENT - -// -//#define QT_NO_XMLSTREAM - -// Animation -#if !defined(QT_NO_ANIMATION) && (defined(QT_NO_PROPERTIES)) -#define QT_NO_ANIMATION -#endif - -// Big Codecs -#if !defined(QT_NO_BIG_CODECS) && (defined(QT_NO_TEXTCODEC)) -#define QT_NO_BIG_CODECS -#endif - -// QButtonGroup -#if !defined(QT_NO_BUTTONGROUP) && (defined(QT_NO_GROUPBOX)) -#define QT_NO_BUTTONGROUP -#endif - -// Codecs -#if !defined(QT_NO_CODECS) && (defined(QT_NO_TEXTCODEC)) -#define QT_NO_CODECS -#endif - -// QDate/QTime/QDateTime -#if !defined(QT_NO_DATESTRING) && (defined(QT_NO_TEXTDATE)) -#define QT_NO_DATESTRING -#endif - -// QDial -#if !defined(QT_NO_DIAL) && (defined(QT_NO_SLIDER)) -#define QT_NO_DIAL -#endif - -// Drag and drop -#if !defined(QT_NO_DRAGANDDROP) && (defined(QT_NO_IMAGEFORMAT_XPM)) -#define QT_NO_DRAGANDDROP -#endif - -// File Transfer Protocol -#if !defined(QT_NO_FTP) && (defined(QT_NO_TEXTDATE)) -#define QT_NO_FTP -#endif - -// Hyper Text Transfer Protocol -#if !defined(QT_NO_HTTP) && (defined(QT_NO_HOSTINFO)) -#define QT_NO_HTTP -#endif - -// iconv -#if !defined(QT_NO_ICONV) && (defined(QT_NO_TEXTCODEC)) -#define QT_NO_ICONV -#endif - -// QInputContext -#if !defined(QT_NO_IM) && (defined(QT_NO_LIBRARY)) -#define QT_NO_IM -#endif - -// QImageIOPlugin -#if !defined(QT_NO_IMAGEFORMATPLUGIN) && (defined(QT_NO_LIBRARY)) -#define QT_NO_IMAGEFORMATPLUGIN -#endif - -// QKeySequenceEdit -#if !defined(QT_NO_KEYSEQUENCEEDIT) && (defined(QT_NO_SHORTCUT)) -#define QT_NO_KEYSEQUENCEEDIT -#endif - -// QLocalServer -#if !defined(QT_NO_LOCALSERVER) && (defined(QT_NO_TEMPORARYFILE)) -#define QT_NO_LOCALSERVER -#endif - -// QPdf -#if !defined(QT_NO_PDF) && (defined(QT_NO_TEMPORARYFILE)) -#define QT_NO_PDF -#endif - -// QMenu -#if !defined(QT_NO_MENU) && (defined(QT_NO_ACTION)) -#define QT_NO_MENU -#endif - -// QNetworkDiskCache -#if !defined(QT_NO_NETWORKDISKCACHE) && (defined(QT_NO_TEMPORARYFILE)) -#define QT_NO_NETWORKDISKCACHE -#endif - -// QProgressDialog -#if !defined(QT_NO_PROGRESSDIALOG) && (defined(QT_NO_PROGRESSBAR)) -#define QT_NO_PROGRESSDIALOG -#endif - -// QScrollBar -#if !defined(QT_NO_SCROLLBAR) && (defined(QT_NO_SLIDER)) -#define QT_NO_SCROLLBAR -#endif - -// SOCKS5 -#if !defined(QT_NO_SOCKS5) && (defined(QT_NO_NETWORKPROXY)) -#define QT_NO_SOCKS5 -#endif - -// QSplitter -#if !defined(QT_NO_SPLITTER) && (defined(QT_NO_RUBBERBAND)) -#define QT_NO_SPLITTER -#endif - -// State machine -#if !defined(QT_NO_STATEMACHINE) && (defined(QT_NO_PROPERTIES)) -#define QT_NO_STATEMACHINE -#endif - -// QFusionStyle -#if !defined(QT_NO_STYLE_FUSION) && (defined(QT_NO_IMAGEFORMAT_XPM)) -#define QT_NO_STYLE_FUSION -#endif - -// QWindowsXPStyle -#if !defined(QT_NO_STYLE_WINDOWSXP) && (defined(QT_NO_STYLE_WINDOWS)) -#define QT_NO_STYLE_WINDOWSXP -#endif - -// QToolButton -#if !defined(QT_NO_TOOLBUTTON) && (defined(QT_NO_ACTION)) -#define QT_NO_TOOLBUTTON -#endif - -// QUndoStack -#if !defined(QT_NO_UNDOSTACK) && (defined(QT_NO_UNDOCOMMAND)) -#define QT_NO_UNDOSTACK -#endif - -// QWizard -#if !defined(QT_NO_WIZARD) && (defined(QT_NO_PROPERTIES)) -#define QT_NO_WIZARD -#endif - -// QXmlStreamReader -#if !defined(QT_NO_XMLSTREAMREADER) && (defined(QT_NO_XMLSTREAM)) -#define QT_NO_XMLSTREAMREADER -#endif - -// QXmlStreamWriter -#if !defined(QT_NO_XMLSTREAMWRITER) && (defined(QT_NO_XMLSTREAM)) -#define QT_NO_XMLSTREAMWRITER -#endif - -// Context menu -#if !defined(QT_NO_CONTEXTMENU) && (defined(QT_NO_MENU)) -#define QT_NO_CONTEXTMENU -#endif - -// QPrinter -#if !defined(QT_NO_PRINTER) && (defined(QT_NO_PICTURE) || defined(QT_NO_TEMPORARYFILE)) -#define QT_NO_PRINTER -#endif - -// QScrollArea -#if !defined(QT_NO_SCROLLAREA) && (defined(QT_NO_SCROLLBAR)) -#define QT_NO_SCROLLAREA -#endif - -// QWindowsCEStyle -#if !defined(QT_NO_STYLE_WINDOWSCE) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_IMAGEFORMAT_XPM)) -#define QT_NO_STYLE_WINDOWSCE -#endif - -// QWindowsMobileStyle -#if !defined(QT_NO_STYLE_WINDOWSMOBILE) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_IMAGEFORMAT_XPM)) -#define QT_NO_STYLE_WINDOWSMOBILE -#endif - -// QWindowsVistaStyle -#if !defined(QT_NO_STYLE_WINDOWSVISTA) && (defined(QT_NO_STYLE_WINDOWSXP)) -#define QT_NO_STYLE_WINDOWSVISTA -#endif - -// QTabBar -#if !defined(QT_NO_TABBAR) && (defined(QT_NO_TOOLBUTTON)) -#define QT_NO_TABBAR -#endif - -// OdfWriter -#if !defined(QT_NO_TEXTODFWRITER) && (defined(QT_NO_XMLSTREAMWRITER)) -#define QT_NO_TEXTODFWRITER -#endif - -// Translation (UTF-8 representation) -#if !defined(QT_NO_TRANSLATION_UTF8) && (defined(QT_NO_TRANSLATION) || defined(QT_NO_TEXTCODEC)) -#define QT_NO_TRANSLATION_UTF8 -#endif - -// QUndoGroup -#if !defined(QT_NO_UNDOGROUP) && (defined(QT_NO_UNDOSTACK)) -#define QT_NO_UNDOGROUP -#endif - -// QWhatsThis -#if !defined(QT_NO_WHATSTHIS) && (defined(QT_NO_TOOLBUTTON)) -#define QT_NO_WHATSTHIS -#endif - -// Bearer Management -#if !defined(QT_NO_BEARERMANAGEMENT) && (defined(QT_NO_LIBRARY) || defined(QT_NO_NETWORKINTERFACE) || defined(QT_NO_PROPERTIES)) -#define QT_NO_BEARERMANAGEMENT -#endif - -// Qt D-Bus module -#if !defined(QT_NO_DBUS) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_XMLSTREAMREADER)) -#define QT_NO_DBUS -#endif - -// QGraphicsView -#if !defined(QT_NO_GRAPHICSVIEW) && (defined(QT_NO_SCROLLAREA)) -#define QT_NO_GRAPHICSVIEW -#endif - -// QMdiArea -#if !defined(QT_NO_MDIAREA) && (defined(QT_NO_SCROLLAREA)) -#define QT_NO_MDIAREA -#endif - -// QSpinBox -#if !defined(QT_NO_SPINBOX) && (defined(QT_NO_SPINWIDGET) || defined(QT_NO_LINEEDIT) || defined(QT_NO_VALIDATOR)) -#define QT_NO_SPINBOX -#endif - -// QStyleSheetStyle -#if !defined(QT_NO_STYLE_STYLESHEET) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_PROPERTIES) || defined(QT_NO_CSSPARSER)) -#define QT_NO_STYLE_STYLESHEET -#endif - -// QColorDialog -#if !defined(QT_NO_COLORDIALOG) && (defined(QT_NO_SPINBOX)) -#define QT_NO_COLORDIALOG -#endif - -// Common UNIX Printing System -#if !defined(QT_NO_CUPS) && (defined(QT_NO_PRINTER) || defined(QT_NO_LIBRARY)) -#define QT_NO_CUPS -#endif - -// QGraphicsEffect -#if !defined(QT_NO_GRAPHICSEFFECT) && (defined(QT_NO_GRAPHICSVIEW)) -#define QT_NO_GRAPHICSEFFECT -#endif - -// The Model/View Framework -#if !defined(QT_NO_ITEMVIEWS) && (defined(QT_NO_RUBBERBAND) || defined(QT_NO_SCROLLAREA)) -#define QT_NO_ITEMVIEWS -#endif - -// QMenuBar -#if !defined(QT_NO_MENUBAR) && (defined(QT_NO_MENU) || defined(QT_NO_TOOLBUTTON)) -#define QT_NO_MENUBAR -#endif - -// QTabWidget -#if !defined(QT_NO_TABWIDGET) && (defined(QT_NO_TABBAR) || defined(QT_NO_STACKEDWIDGET)) -#define QT_NO_TABWIDGET -#endif - -// QTextEdit -#if !defined(QT_NO_TEXTEDIT) && (defined(QT_NO_SCROLLAREA) || defined(QT_NO_PROPERTIES)) -#define QT_NO_TEXTEDIT -#endif - -// QErrorMessage -#if !defined(QT_NO_ERRORMESSAGE) && (defined(QT_NO_TEXTEDIT)) -#define QT_NO_ERRORMESSAGE -#endif - -// QListView -#if !defined(QT_NO_LISTVIEW) && (defined(QT_NO_ITEMVIEWS)) -#define QT_NO_LISTVIEW -#endif - -// QMainWindow -#if !defined(QT_NO_MAINWINDOW) && (defined(QT_NO_MENU) || defined(QT_NO_RESIZEHANDLER) || defined(QT_NO_TOOLBUTTON)) -#define QT_NO_MAINWINDOW -#endif - -// QAbstractProxyModel -#if !defined(QT_NO_PROXYMODEL) && (defined(QT_NO_ITEMVIEWS)) -#define QT_NO_PROXYMODEL -#endif - -// QStandardItemModel -#if !defined(QT_NO_STANDARDITEMMODEL) && (defined(QT_NO_ITEMVIEWS)) -#define QT_NO_STANDARDITEMMODEL -#endif - -// QStringListModel -#if !defined(QT_NO_STRINGLISTMODEL) && (defined(QT_NO_ITEMVIEWS)) -#define QT_NO_STRINGLISTMODEL -#endif - -// QSyntaxHighlighter -#if !defined(QT_NO_SYNTAXHIGHLIGHTER) && (defined(QT_NO_TEXTEDIT)) -#define QT_NO_SYNTAXHIGHLIGHTER -#endif - -// QTableView -#if !defined(QT_NO_TABLEVIEW) && (defined(QT_NO_ITEMVIEWS)) -#define QT_NO_TABLEVIEW -#endif - -// QTextBrowser -#if !defined(QT_NO_TEXTBROWSER) && (defined(QT_NO_TEXTEDIT)) -#define QT_NO_TEXTBROWSER -#endif - -// QToolBox -#if !defined(QT_NO_TOOLBOX) && (defined(QT_NO_TOOLBUTTON) || defined(QT_NO_SCROLLAREA)) -#define QT_NO_TOOLBOX -#endif - -// QTreeView -#if !defined(QT_NO_TREEVIEW) && (defined(QT_NO_ITEMVIEWS)) -#define QT_NO_TREEVIEW -#endif - -// Accessibility -#if !defined(QT_NO_ACCESSIBILITY) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_MENUBAR)) -#define QT_NO_ACCESSIBILITY -#endif - -// QColumnView -#if !defined(QT_NO_COLUMNVIEW) && (defined(QT_NO_LISTVIEW)) -#define QT_NO_COLUMNVIEW -#endif - -// QCompleter -#if !defined(QT_NO_COMPLETER) && (defined(QT_NO_PROXYMODEL)) -#define QT_NO_COMPLETER -#endif - -// QDataWidgetMapper -#if !defined(QT_NO_DATAWIDGETMAPPER) && (defined(QT_NO_ITEMVIEWS) || defined(QT_NO_PROPERTIES)) -#define QT_NO_DATAWIDGETMAPPER -#endif - -// QIdentityProxyModel -#if !defined(QT_NO_IDENTITYPROXYMODEL) && (defined(QT_NO_PROXYMODEL)) -#define QT_NO_IDENTITYPROXYMODEL -#endif - -// QListWidget -#if !defined(QT_NO_LISTWIDGET) && (defined(QT_NO_LISTVIEW)) -#define QT_NO_LISTWIDGET -#endif - -// QSortFilterProxyModel -#if !defined(QT_NO_SORTFILTERPROXYMODEL) && (defined(QT_NO_PROXYMODEL)) -#define QT_NO_SORTFILTERPROXYMODEL -#endif - -// QTableWidget -#if !defined(QT_NO_TABLEWIDGET) && (defined(QT_NO_TABLEVIEW)) -#define QT_NO_TABLEWIDGET -#endif - -// QToolBar -#if !defined(QT_NO_TOOLBAR) && (defined(QT_NO_MAINWINDOW)) -#define QT_NO_TOOLBAR -#endif - -// QTreeWidget -#if !defined(QT_NO_TREEWIDGET) && (defined(QT_NO_TREEVIEW)) -#define QT_NO_TREEWIDGET -#endif - -// QDirModel -#if !defined(QT_NO_DIRMODEL) && (defined(QT_NO_ITEMVIEWS) || defined(QT_NO_FILESYSTEMMODEL)) -#define QT_NO_DIRMODEL -#endif - -// QDockwidget -#if !defined(QT_NO_DOCKWIDGET) && (defined(QT_NO_RUBBERBAND) || defined(QT_NO_MAINWINDOW)) -#define QT_NO_DOCKWIDGET -#endif - -// QUndoView -#if !defined(QT_NO_UNDOVIEW) && (defined(QT_NO_UNDOSTACK) || defined(QT_NO_LISTVIEW)) -#define QT_NO_UNDOVIEW -#endif - -// QCompleter -#if !defined(QT_NO_FSCOMPLETER) && (defined(QT_NO_FILESYSTEMMODEL) || defined(QT_NO_COMPLETER)) -#define QT_NO_FSCOMPLETER -#endif - -// QComboBox -#if !defined(QT_NO_COMBOBOX) && (defined(QT_NO_LINEEDIT) || defined(QT_NO_STANDARDITEMMODEL) || defined(QT_NO_LISTVIEW)) -#define QT_NO_COMBOBOX -#endif - -// QPrintPreviewWidget -#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_MAINWINDOW)) -#define QT_NO_PRINTPREVIEWWIDGET -#endif - -// QCalendarWidget -#if !defined(QT_NO_CALENDARWIDGET) && (defined(QT_NO_TABLEVIEW) || defined(QT_NO_MENU) || defined(QT_NO_TEXTDATE) || defined(QT_NO_SPINBOX) || defined(QT_NO_TOOLBUTTON)) -#define QT_NO_CALENDARWIDGET -#endif - -// QDateTimeEdit -#if !defined(QT_NO_DATETIMEEDIT) && (defined(QT_NO_CALENDARWIDGET) || defined(QT_NO_DATESTRING)) -#define QT_NO_DATETIMEEDIT -#endif - -// QInputDialog -#if !defined(QT_NO_INPUTDIALOG) && (defined(QT_NO_COMBOBOX) || defined(QT_NO_SPINBOX) || defined(QT_NO_STACKEDWIDGET)) -#define QT_NO_INPUTDIALOG -#endif - -// QFontComboBox -#if !defined(QT_NO_FONTCOMBOBOX) && (defined(QT_NO_COMBOBOX) || defined(QT_NO_STRINGLISTMODEL)) -#define QT_NO_FONTCOMBOBOX -#endif - -// QFontDialog -#if !defined(QT_NO_FONTDIALOG) && (defined(QT_NO_STRINGLISTMODEL) || defined(QT_NO_COMBOBOX) || defined(QT_NO_VALIDATOR) || defined(QT_NO_GROUPBOX)) -#define QT_NO_FONTDIALOG -#endif - -// QPrintDialog -#if !defined(QT_NO_PRINTDIALOG) && (defined(QT_NO_PRINTER) || defined(QT_NO_COMBOBOX) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_SPINBOX) || defined(QT_NO_TREEVIEW) || defined(QT_NO_TABWIDGET)) -#define QT_NO_PRINTDIALOG -#endif - -// QFileDialog -#if !defined(QT_NO_FILEDIALOG) && (defined(QT_NO_DIRMODEL) || defined(QT_NO_TREEVIEW) || defined(QT_NO_COMBOBOX) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_TOOLTIP) || defined(QT_NO_SPLITTER) || defined(QT_NO_STACKEDWIDGET) || defined(QT_NO_PROXYMODEL)) -#define QT_NO_FILEDIALOG -#endif - -// QPrintPreviewDialog -#if !defined(QT_NO_PRINTPREVIEWDIALOG) && (defined(QT_NO_PRINTPREVIEWWIDGET) || defined(QT_NO_PRINTDIALOG) || defined(QT_NO_TOOLBAR)) -#define QT_NO_PRINTPREVIEWDIALOG -#endif - diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index c430da80fd..0fd9bab979 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -57,10 +57,9 @@ #if !defined(QT_BUILD_QMAKE) && !defined(QT_BUILD_CONFIGURE) #include -#endif - #include #define QT_SUPPORTS(FEATURE) (!defined(QT_NO_##FEATURE)) +#endif /* These two macros makes it possible to turn the builtin line expander into a * string literal. */ diff --git a/sync.profile b/sync.profile index 74e29a7acf..7bd10b4865 100644 --- a/sync.profile +++ b/sync.profile @@ -59,7 +59,7 @@ my @zlib_headers = ( "zconf.h", "zlib.h" ); @ignore_headers = ( @internal_zlib_headers ); @ignore_for_include_check = ( "qsystemdetection.h", "qcompilerdetection.h", "qprocessordetection.h", @zlib_headers, @angle_headers); @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h", @zlib_headers, @angle_headers); -%inject_headers = ( "$basedir/src/corelib/global" => [ "qconfig.h" ] ); +%inject_headers = ( "$basedir/src/corelib/global" => [ "qconfig.h", "qfeatures.h" ] ); # Module dependencies. # Every module that is required to build this module should have one entry. # Each of the module version specifiers can take one of the following values: diff --git a/util/scripts/make_qfeatures_dot_h b/util/scripts/make_qfeatures_dot_h deleted file mode 100755 index 20999a239b..0000000000 --- a/util/scripts/make_qfeatures_dot_h +++ /dev/null @@ -1,198 +0,0 @@ -#!/usr/bin/perl -############################################################################# -## -## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -## Contact: http://www.qt-project.org/legal -## -## This file is part of the test suite 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 Digia. For licensing terms and -## conditions see http://qt.digia.com/licensing. For further information -## use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software -## Foundation and appearing in the file LICENSE.LGPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU Lesser General Public License version 2.1 requirements -## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## -## -## $QT_END_LICENSE$ -## -############################################################################# - -# -# Usage: make_qfeatures_dot_h -# -# Generates src/corelib/global/qfeatures.h from src/corelib/global/qfeatures.txt. -# -# The qfeatures.txt file can contain redundancies, and this program -# will show them. -# - -if ($ENV{QTSRCDIR} ne '') { - $qtbase=$ENV{QTSRCDIR}; -} else { - $qtbase=$ENV{QTDIR}; -} - -open FL, "$qtbase/src/corelib/global/qfeatures.txt" - or die "Cannot open $qtbase/src/corelib/global/qfeatures.txt"; - -while () { - if ( /^Feature: (\S*)/ ) { - print STDERR "Duplicate: $1\n" if $macro{$1}; - $macro{$macro=$1}=1; - } elsif ( /^Requires: (.*?)\s*$/ ) { - $deps{$macro}=$1; - map { $dep{"$macro $_"}=1 } split /\s+/, $1; - } elsif ( /^Name: (.*?)\s*$/ ) { - $label{$macro}=$1; - } -} - -close FL; - -sub depends { - my($x,$y) = @_; - return 1 if $dep{"$x $y"}; - return 0 if $dep{"$y $x"}; - return 0 if $x eq $y; - my $d; - for $d (split /\s+/, $deps{$x}) { - return 1 if depends($d,$y); - } - return 0; -} -sub dependants_rec { - my($x) = @_; - my $n = 0; - my $d = 0; - $dependants_rec_count++; - if ( $dependants_rec_count > $dependants_rec_limit ) { - if ( $circularity_start eq $x ) { - print STDERR "Circular dependency: $circularity\n"; - exit; - } - $circularity_start=$x if !$circularity_start; - $circularity="$x $circularity"; - } - for $d (split /\s+/, $deps{$x}) { - $n += 1 + dependants_rec($d); - } - $dependants_rec_count--; - return $n; -} -sub dependants { - $dependants_rec_limit=keys %macro if !$dependants_rec_limit; - $dependants_rec_count=0; - return dependants_rec @_; -} -sub dependencysort { - my($x, $y) = @_; - my $xd = dependants($x); - my $yd = dependants($y); - return $xd-$yd if $xd != $yd; - return $x cmp $y; -} - -@macros = sort { dependencysort($a,$b) } keys %macro; - -for $macro ( @macros ) { - for $d1 (split /\s+/, $deps{$macro} ) { - for $d2 (split /\s+/, $deps{$macro} ) { - print STDERR "Redundancy in $macro - $d1 depends on $d2\n" if depends($d1,$d2); - } - print STDERR "Unknown in $macro - $d1\n" if !$macro{$d1}; - } -} - -open OUT, ">$qtbase/src/corelib/global/qfeatures.h" - or die "Cannot open $qtbase/src/corelib/global/qfeatures.h for writing"; - -print OUT -'/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - * All features and their dependencies. - * - * This list is generated from $QTDIR/src/corelib/global/qfeatures.txt - * by $QTSRCDIR/util/scripts/make_qfeatures_dot_h - */ - -'; - - -for $macro ( @macros ) { - print OUT "// $label{$macro}\n"; - if ( $deps{$macro} ) { - print OUT "#if !defined(QT_NO_$macro)"; - print OUT " && (", (join " || ", map { "defined(QT_NO_$_)" } split /\s+/, $deps{$macro}), ")"; - print OUT "\n"; - print OUT "#define QT_NO_$macro\n"; - print OUT "#endif\n"; - } else { - print OUT "//#define QT_NO_$macro\n"; - } - print OUT "\n"; -} - -close OUT; -- cgit v1.2.3