diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2012-02-10 15:50:47 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-17 08:22:43 +0100 |
commit | f0f78eb0a9cc5d5898937201baa0e543ce4cac22 (patch) | |
tree | b9db7b48f92f01935f5c1fb5d0b75037d7537878 | |
parent | e7b8c9227132a26acd3d975050fd1f6fd4f22944 (diff) |
Remove usages of QT_ARCH and QT_ARCH_* from qtbase
The architecture is detected at compile time based on the predefined
macros from the compiler. Don't use QT_ARCH in .pro, .pri, or .prf
files. The PNG_NO_ASSEMBLER_CODE define from libpng.pri is not present
in the current copy of src/3rdparty/libpng, so no change in
functionality is expected.
The conditional for the SUPPORT_JIT define in pcre.pri is moved to
src/3rdparty/pcre/config.h, again so that we can use the compiler's
predefined macros to detect the architecture at compile time.
Replace QT_ARCH_ARM, QT_ARCH_MIPS, and QT_ARCH_SPARC with their
Q_PROCESSOR_* equivalents.
Replace QT_ARCH_INTEGRITY, QT_ARCH_VXWORKS, and QT_ARCH_WINDOWSCE with
their Q_OS_* equivalents.
Note that this commit also effectively disables the SPARC atomic
implementation. An inline implementation for SPARC needs to be added,
or we remove the current code and instead rely on the GCC intrinsic or
C++11 std::atomic support on SPARC.
Note also that this commit does not remove QT_ARCH from configure or
qconfig.h. This will continue to be set until all Qt 5 projects can be
moved away from using QT_ARCH.
Change-Id: I5de747cc4436d21941329974cff3016970f497b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
20 files changed, 37 insertions, 38 deletions
diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf index b0de7b8fd8..8b17aa90fb 100644 --- a/mkspecs/features/qt_installs.prf +++ b/mkspecs/features/qt_installs.prf @@ -11,8 +11,7 @@ qt_install_headers { INSTALL_HEADERS = $$SYNCQT.HEADER_FILES equals(TARGET, QtCore) { #headers created by configure - INSTALL_HEADERS *= $$QT_BUILD_TREE/src/corelib/global/qconfig.h \ - $$QT_SOURCE_TREE/src/corelib/arch/$$QT_ARCH/arch + INSTALL_HEADERS *= $$QT_BUILD_TREE/src/corelib/global/qconfig.h } equals(TARGET, phonon) { diff --git a/mkspecs/features/qt_module_config.prf b/mkspecs/features/qt_module_config.prf index 4da1666fc5..a8439198df 100644 --- a/mkspecs/features/qt_module_config.prf +++ b/mkspecs/features/qt_module_config.prf @@ -17,7 +17,6 @@ INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES/$$TARGET INCLUDEPATH *= $$MODULE_INCLUDES $$MODULE_INCLUDES/.. #just for today to have some compat !isEmpty(RCC_DIR): INCLUDEPATH += $$RCC_DIR -isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCH #another compat that will rot for change #215700 TEMPLATE = lib isEmpty(QT_MAJOR_VERSION) { VERSION=5.0.0 diff --git a/src/3rdparty/libpng.pri b/src/3rdparty/libpng.pri index 7ac1910151..8479114aa2 100644 --- a/src/3rdparty/libpng.pri +++ b/src/3rdparty/libpng.pri @@ -1,5 +1,4 @@ DEFINES *= QT_USE_BUNDLED_LIBPNG -!isEqual(QT_ARCH, i386):!isEqual(QT_ARCH, x86_64):DEFINES += PNG_NO_ASSEMBLER_CODE INCLUDEPATH += $$PWD/libpng SOURCES += $$PWD/libpng/png.c \ $$PWD/libpng/pngerror.c \ diff --git a/src/3rdparty/pcre.pri b/src/3rdparty/pcre.pri index 92066e1aee..7febd8fd0b 100644 --- a/src/3rdparty/pcre.pri +++ b/src/3rdparty/pcre.pri @@ -1,14 +1,5 @@ DEFINES += PCRE_HAVE_CONFIG_H -# man 3 pcrejit for a list of supported platforms; -# as PCRE 8.30, stable JIT support is available for: -# - ARM v5, v7, and Thumb2 -# - x86/x86-64 -# - MIPS 32bit -equals(QT_ARCH, "i386")|equals(QT_ARCH, "x86_64")|equals(QT_ARCH, "arm")|if(equals(QT_ARCH, "mips"):!*-64) { - DEFINES += SUPPORT_JIT -} - win32:DEFINES += PCRE_STATIC INCLUDEPATH += $$PWD/pcre diff --git a/src/3rdparty/pcre/config.h b/src/3rdparty/pcre/config.h index 4fe10f41d8..fede0dcbb0 100644 --- a/src/3rdparty/pcre/config.h +++ b/src/3rdparty/pcre/config.h @@ -13,3 +13,20 @@ #define SUPPORT_UCP #define SUPPORT_UTF16 +/* + man 3 pcrejit for a list of supported platforms; + as PCRE 8.30, stable JIT support is available for: + - ARM v5, v7, and Thumb2 + - x86/x86-64 + - MIPS 32bit +*/ +#if \ + /* ARM */ \ + defined(__arm__) || defined(__TARGET_ARCH_ARM) \ + /* x86 32/64 */ \ + || defined(__i386) || defined(__i386__) || defined(_M_IX86) \ + || defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64) \ + /* MIPS32 */ \ + || defined(__mips) || defined(__mips__) || defined(_M_MRX000) && !(defined(_MIPS_ARCH_MIPS64) || defined(__mips64)) +# define SUPPORT_JIT +#endif diff --git a/src/corelib/arch/arch.pri b/src/corelib/arch/arch.pri index cb2102cefd..c64bbe2821 100644 --- a/src/corelib/arch/arch.pri +++ b/src/corelib/arch/arch.pri @@ -25,9 +25,3 @@ unix { HEADERS += arch/qatomic_unix.h SOURCES += arch/qatomic_unix.cpp } - -QT_ARCH_CPP = $$QT_SOURCE_TREE/src/corelib/arch/$$QT_ARCH -exists($$QT_ARCH_CPP) { - DEPENDPATH += $$QT_ARCH_CPP - include($$QT_ARCH_CPP/arch.pri, "", true) -} diff --git a/src/corelib/arch/sparc/arch.pri b/src/corelib/arch/sparc/arch.pri index 9bb3a888e8..b3ca399640 100644 --- a/src/corelib/arch/sparc/arch.pri +++ b/src/corelib/arch/sparc/arch.pri @@ -2,9 +2,9 @@ # SPARC architecture # *-64* { - SOURCES += $$QT_ARCH_CPP/qatomic64.s + SOURCES += $$PWD/qatomic64.s } else { - SOURCES += $$QT_ARCH_CPP/qatomic32.s \ - $$QT_ARCH_CPP/qatomic_sparc.cpp + SOURCES += $$PWD/qatomic32.s \ + $$PWD/qatomic_sparc.cpp } diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 91ac4bd41d..22e73ede26 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -463,7 +463,7 @@ typedef int QNoImplicitBoolCast; // This logic must match the one in qmetatype.h #if defined(QT_COORD_TYPE) typedef QT_COORD_TYPE qreal; -#elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) +#elif defined(QT_NO_FPU) || defined(Q_PROCESSOR_ARM) || defined(Q_OS_WINCE) typedef float qreal; #else typedef double qreal; diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 0b6a62e5c8..1473231d64 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -203,7 +203,7 @@ public: // This logic must match the one in qglobal.h #if defined(QT_COORD_TYPE) QReal = 0, -#elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) +#elif defined(QT_NO_FPU) || defined(Q_PROCESSOR_ARM) || defined(Q_OS_WINCE) QReal = Float, #else QReal = Double, diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 0eb227e59d..4230e55ff5 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -67,7 +67,7 @@ struct Q_CORE_EXPORT QVectorData QtPrivate::RefCount ref; int alloc; int size; -#if defined(QT_ARCH_SPARC) && defined(Q_CC_GNU) && defined(__LP64__) && defined(QT_BOOTSTRAPPED) +#if defined(Q_PROCESSOR_SPARC) && defined(Q_CC_GNU) && defined(__LP64__) && defined(QT_BOOTSTRAPPED) // workaround for bug in gcc 3.4.2 uint sharable; uint capacity; diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 128decb646..e4f4020461 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -264,7 +264,7 @@ namespace QTest template <typename T1, typename T2> bool qCompare(T1 const &, T2 const &, const char *, const char *, const char *, int); -#if defined(QT_COORD_TYPE) && (defined(QT_ARCH_ARM) || defined(QT_NO_FPU) || defined(QT_ARCH_WINDOWSCE)) +#if defined(QT_COORD_TYPE) && (defined(Q_PROCESSOR_ARM) || defined(QT_NO_FPU) || defined(Q_OS_WINCE)) template <> inline bool qCompare<qreal, float>(qreal const &t1, float const &t2, const char *actual, const char *expected, const char *file, int line) @@ -279,7 +279,7 @@ namespace QTest return qCompare<qreal>(qreal(t1), t2, actual, expected, file, line); } -#elif defined(QT_COORD_TYPE) || defined(QT_ARCH_ARM) || defined(QT_NO_FPU) || defined(QT_ARCH_WINDOWSCE) +#elif defined(QT_COORD_TYPE) || defined(Q_PROCESSOR_ARM) || defined(QT_NO_FPU) || defined(Q_OS_WINCE) template <> inline bool qCompare<qreal, double>(qreal const &t1, double const &t2, const char *actual, const char *expected, const char *file, int line) diff --git a/src/tools/uic/uic.pro b/src/tools/uic/uic.pro index 6598180e45..7a95db861f 100644 --- a/src/tools/uic/uic.pro +++ b/src/tools/uic/uic.pro @@ -14,7 +14,7 @@ HEADERS += uic.h SOURCES += main.cpp \ uic.cpp -linux-g++-maemo:contains(QT_ARCH, arm) { +linux-g++-maemo { # UIC will crash when running inside QEMU if built with -O2 QMAKE_CFLAGS_RELEASE -= -O2 QMAKE_CXXFLAGS_RELEASE -= -O2 diff --git a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp index 578f867032..73cb8e9cd6 100644 --- a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp +++ b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp @@ -62,7 +62,7 @@ private slots: static const int iterations = 10; // Note: some tests rely on ThreadCount being multiple of 2 -#if defined(Q_OS_SOLARIS) || ( defined(Q_OS_LINUX) && defined(QT_ARCH_ARMV6) ) +#if defined(Q_OS_SOLARIS) || ( defined(Q_OS_LINUX) && defined(Q_PROCESSOR_ARM) ) static const int ThreadCount = 4; #else static const int ThreadCount = 10; diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 3ccc533086..ca5b992012 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -1574,7 +1574,7 @@ void tst_QGraphicsProxyWidget::resize_simple_data() QTest::addColumn<QSizeF>("size"); QTest::newRow("200, 200") << QSizeF(200, 200); -#if !defined(QT_ARCH_ARM) && !defined(Q_OS_WINCE) +#if !defined(Q_PROCESSOR_ARM) && !defined(Q_OS_WINCE) QTest::newRow("1000, 1000") << QSizeF(1000, 1000); // Since 4.5, 10000x10000 runs out of memory. // QTest::newRow("10000, 10000") << QSizeF(10000, 10000); diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index f103d3d529..3257e7efea 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -365,7 +365,7 @@ void tst_QGraphicsScene::itemIndexMethod() QGraphicsScene scene; QCOMPARE(scene.itemIndexMethod(), QGraphicsScene::BspTreeIndex); -#ifdef QT_ARCH_ARM +#ifdef Q_PROCESSOR_ARM const int minY = -500; const int maxY = 500; const int minX = -500; @@ -426,7 +426,7 @@ void tst_QGraphicsScene::bspTreeDepth() void tst_QGraphicsScene::items() { -#ifdef QT_ARCH_ARM +#ifdef Q_PROCESSOR_ARM const int minY = -500; const int maxY = 500; const int minX = -500; diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 7681b3c787..7ceeaaa0d3 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -1656,7 +1656,7 @@ void tst_QGraphicsView::mapToScene() QCOMPARE(view.size(), viewSize); // First once without setting the scene rect -#ifdef QT_ARCH_ARM +#ifdef Q_PROCESSOR_ARM const int step = 20; #else const int step = 1; diff --git a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp index 04b32d1e56..4e71bf964c 100644 --- a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp +++ b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp @@ -286,7 +286,7 @@ void tst_QItemView::populate() { treeModel = new CheckerModel; QModelIndex parent; -#if defined(QT_ARCH_ARM) +#if defined(Q_PROCESSOR_ARM) const int baseInsert = 4; #else const int baseInsert = 26; diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index 80285ded78..907a239912 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -765,7 +765,7 @@ void tst_QComboBox::virtualAutocompletion() // We need to set the keyboard input interval to a higher value // as the processEvent() call takes too much time, so it restarts // the keyboard search then -#if defined(QT_ARCH_ARM) || defined(QT_ARCH_MIPS) +#if defined(Q_PROCESSOR_ARM) || defined(Q_PROCESSOR_MIPS) int oldInterval = QApplication::keyboardInputInterval(); QApplication::setKeyboardInputInterval(1500); #endif @@ -797,7 +797,7 @@ void tst_QComboBox::virtualAutocompletion() QApplication::sendEvent(testWidget, &kr2); qApp->processEvents(); // Process events to trigger autocompletion QTRY_COMPARE(testWidget->currentIndex(), 3); -#if defined(QT_ARCH_ARM) || defined(QT_ARCH_MIPS) +#if defined(Q_PROCESSOR_ARM) || defined(Q_PROCESSOR_MIPS) QApplication::setKeyboardInputInterval(oldInterval); #endif } diff --git a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp index 615e4453bc..4019faf428 100644 --- a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp +++ b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp @@ -219,7 +219,7 @@ void tst_QPlainTextEdit::getSetCheck() QCOMPARE(0, obj1.tabStopWidth()); obj1.setTabStopWidth(INT_MIN); QCOMPARE(0, obj1.tabStopWidth()); // Makes no sense to set a negative tabstop value -#if defined(QT_ARCH_WINDOWSCE) +#if defined(Q_OS_WINCE) // due to rounding error in qRound when qreal==float // we cannot use INT_MAX for this check obj1.setTabStopWidth(SHRT_MAX*2); diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp index 6253ef89e4..249e9d7fbe 100644 --- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp @@ -288,7 +288,7 @@ void tst_QTextEdit::getSetCheck() QCOMPARE(0, obj1.tabStopWidth()); obj1.setTabStopWidth(INT_MIN); QCOMPARE(0, obj1.tabStopWidth()); // Makes no sense to set a negative tabstop value -#if defined(QT_ARCH_WINDOWSCE) +#if defined(Q_OS_WINCE) // due to rounding error in qRound when qreal==float // we cannot use INT_MAX for this check obj1.setTabStopWidth(SHRT_MAX*2); |