From ed4d47fde11bf1bded55394358b19ceedb1d5768 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Mon, 14 Nov 2011 21:56:40 +0000 Subject: Add the ability to do unsafe SSL renegotiation as a fallback. This commit adds the ability to perform legacy SSL renegotiation as a fallback via QSsl::SslOptions. This is something that used to work, but has been disabled by default in newer versions of openssl. The need for this has been reported by users (eg. in QTBUG-14983). Change-Id: I5b80f3ffd07e0c5faddc469f6a8f857bac5740f7 Reviewed-by: Corentin Chary Reviewed-by: Peter Hartmann (cherry picked from commit 75b2a4960b753766ea2eec4dbd34c67733ca8089) --- src/network/ssl/qssl.cpp | 8 +++++++- src/network/ssl/qssl.h | 3 ++- src/network/ssl/qsslconfiguration.cpp | 2 +- src/network/ssl/qsslconfiguration_p.h | 3 ++- src/network/ssl/qsslsocket_openssl.cpp | 8 ++++++++ tests/manual/qssloptions/main.cpp | 3 +++ 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/network/ssl/qssl.cpp b/src/network/ssl/qssl.cpp index b556328..01297c9 100644 --- a/src/network/ssl/qssl.cpp +++ b/src/network/ssl/qssl.cpp @@ -141,9 +141,15 @@ QT_BEGIN_NAMESPACE \value SslOptionDisableServerNameIndication Disables the SSL server name indication extension. When enabled, this tells the server the virtual host being accessed allowing it to respond with the correct certificate. + \value SslOptionDisableLegacyRenegotiation Disables the older insecure + mechanism for renegotiating the connection parameters. When enabled, this + option can allow connections for legacy servers, but it introduces the + possibility that an attacker could inject plaintext into the SSL session. By default, SslOptionDisableEmptyFragments is turned on since this causes - problems with a large number of servers, but the other options are disabled. + problems with a large number of servers. SslOptionDisableLegacyRenegotiation + is also turned on, since it introduces a security risk. The other options + are turned off. Note: Availability of above options depends on the version of the SSL backend in use. diff --git a/src/network/ssl/qssl.h b/src/network/ssl/qssl.h index 453d4da..571aa1f 100644 --- a/src/network/ssl/qssl.h +++ b/src/network/ssl/qssl.h @@ -87,7 +87,8 @@ namespace QSsl { SslOptionDisableEmptyFragments = 0x01, SslOptionDisableSessionTickets = 0x02, SslOptionDisableCompression = 0x04, - SslOptionDisableServerNameIndication = 0x08 + SslOptionDisableServerNameIndication = 0x08, + SslOptionDisableLegacyRenegotiation = 0x10 }; Q_DECLARE_FLAGS(SslOptions, SslOption) } diff --git a/src/network/ssl/qsslconfiguration.cpp b/src/network/ssl/qsslconfiguration.cpp index e24076e..727130b 100644 --- a/src/network/ssl/qsslconfiguration.cpp +++ b/src/network/ssl/qsslconfiguration.cpp @@ -201,7 +201,7 @@ bool QSslConfiguration::isNull() const d->privateKey.isNull() && d->peerCertificate.isNull() && d->peerCertificateChain.count() == 0 && - d->sslOptions == 0); + d->sslOptions == QSsl::SslOptionDisableEmptyFragments|QSsl::SslOptionDisableLegacyRenegotiation); } /*! diff --git a/src/network/ssl/qsslconfiguration_p.h b/src/network/ssl/qsslconfiguration_p.h index b83edb9..a711eeb 100644 --- a/src/network/ssl/qsslconfiguration_p.h +++ b/src/network/ssl/qsslconfiguration_p.h @@ -82,7 +82,8 @@ public: QSslConfigurationPrivate() : protocol(QSsl::SecureProtocols), peerVerifyMode(QSslSocket::AutoVerifyPeer), - peerVerifyDepth(0) + peerVerifyDepth(0), + sslOptions(QSsl::SslOptionDisableEmptyFragments|QSsl::SslOptionDisableLegacyRenegotiation) { } QSslCertificate peerCertificate; diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 3942209..5f520f7 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -298,6 +298,14 @@ init_context: else options &= ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; +#ifdef SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION + // This option is disabled by default, so we need to be able to clear it + if (configuration.sslOptions & QSsl::SslOptionDisableLegacyRenegotiation) + options &= ~SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION; + else + options |= SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION; +#endif + #ifdef SSL_OP_NO_TICKET if (configuration.sslOptions & QSsl::SslOptionDisableSessionTickets) options |= SSL_OP_NO_TICKET; diff --git a/tests/manual/qssloptions/main.cpp b/tests/manual/qssloptions/main.cpp index 6f2f361..727ad23 100644 --- a/tests/manual/qssloptions/main.cpp +++ b/tests/manual/qssloptions/main.cpp @@ -56,6 +56,7 @@ int main(int argc, char **argv) out << "disable_session_tickets" << endl; out << "disable_compression" << endl; out << "disable_sni" << endl; + out << "enable_unsafe_reneg" << endl; return 1; } @@ -75,6 +76,8 @@ int main(int argc, char **argv) config.setSslOption(QSsl::SslOptionDisableCompression, true); else if (option == QLatin1String("disable_sni")) config.setSslOption(QSsl::SslOptionDisableServerNameIndication, true); + else if (option == QStringLiteral("enable_unsafe_reneg")) + config.setSslOption(QSsl::SslOptionDisableLegacyRenegotiation, false); } QSslConfiguration::setDefaultConfiguration(config); -- cgit v0.12 From f94eea0176e7ecd2c9c6a748259e08a4361d9478 Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:11 +0100 Subject: Resolve atomic operations issues on INTEGRITY. Now passes atomicpointer autotest successfully. Merge-request: 1438 Reviewed-by: Harald Fernengel --- src/corelib/arch/qatomic_integrity.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/corelib/arch/qatomic_integrity.h b/src/corelib/arch/qatomic_integrity.h index f957297..c72a48d 100644 --- a/src/corelib/arch/qatomic_integrity.h +++ b/src/corelib/arch/qatomic_integrity.h @@ -203,7 +203,7 @@ inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) { - return TestAndSet((Address*)&_q_value, qt_addr(expectedValue), qt_addr(newValue)) == Success; + return TestAndSet(reinterpret_cast
(const_cast(&_q_value)), qt_addr(expectedValue), qt_addr(newValue)) == Success; } template @@ -231,7 +231,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) { Address old_val; do { - old_val = *reinterpret_cast
(const_cast(newValue)); + old_val = *reinterpret_cast
(const_cast(_q_value)); } while (TestAndSet(reinterpret_cast
(const_cast(&_q_value)), old_val, qt_addr(newValue)) != Success); return reinterpret_cast(old_val); } @@ -259,7 +259,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) { - AtomicModify(qt_p2addr(&_q_value), qt_addr(_q_value), qt_addr(_q_value) + valueToAdd * sizeof(T)); + Address old_value; + AtomicModify(reinterpret_cast(&_q_value), &old_value, 0, valueToAdd * sizeof(T)); return _q_value; } -- cgit v0.12 From 7793fe4290ac7d34b7fb219b7f0624d1c5ad5f0e Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:12 +0100 Subject: Change the overload from write() to writeMakefile() in INTEGRITY generator This way, INTEGRITY-specific generation is only called in Makefile mode. Merge-request: 1438 Reviewed-by: Harald Fernengel --- qmake/generators/integrity/gbuild.cpp | 2 +- qmake/generators/integrity/gbuild.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index f9fdb38..df246cd 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -64,7 +64,7 @@ GBuildMakefileGenerator::GBuildMakefileGenerator() : MakefileGenerator() } bool -GBuildMakefileGenerator::write() +GBuildMakefileGenerator::writeMakefile(QTextStream &text) { QStringList tmp; QString filename(Option::output.fileName()); diff --git a/qmake/generators/integrity/gbuild.h b/qmake/generators/integrity/gbuild.h index 0927a2e..6f9a5c0 100644 --- a/qmake/generators/integrity/gbuild.h +++ b/qmake/generators/integrity/gbuild.h @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE class GBuildMakefileGenerator : public MakefileGenerator { - virtual bool write(); + virtual bool writeMakefile(QTextStream &text); QString projectSuffix() const { return QString(".gpj"); }; QString writeOne(QString filename, QString pathtoremove = ""); -- cgit v0.12 From 70c4230cbc0ce06d54e2451d9300dd855280ae33 Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:13 +0100 Subject: Make applications start by default (StartIt True). Merge-request: 1438 Reviewed-by: Harald Fernengel --- qmake/generators/integrity/gbuild.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index df246cd..48bd57f 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -141,6 +141,7 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text) ti << "\tHeapSize\t0x00D00000" << "\n"; ti << "\tTask\tInitial" << "\n"; ti << "\t\tStackSize\t0x30000" << "\n"; + ti << "\t\tStartIt\tTrue" << "\n"; ti << "\tEndTask" << "\n"; ti << "EndAddressSpace" << "\n"; ti.flush(); -- cgit v0.12 From 96f9dd665f0bd56fc39a327481ba440c6d8450bd Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:14 +0100 Subject: Clean up generated linker file for the shared library case. Generated linker file was not looking good, now much better. Merge-request: 1438 Reviewed-by: Harald Fernengel --- qmake/generators/integrity/gbuild.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index 48bd57f..fcadec0 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -189,26 +189,28 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text) tl << "}\n" "-sec\n" "{\n" - " .picbase __INTEGRITY_LibCBaseAddress :\n" + " .picbase __INTEGRITY_LibCBaseAddress :\n" " .text :\n" - " .syscall :\n" + " .syscall :\n" " .intercall :\n" " .interfunc :\n" - " .secinfo :\n" - " .rodata align(16) :\n" - " .fixaddr :\n" - " .fixtype :\n" + " .secinfo :\n" + " .rodata align(16) :\n" + " .fixaddr :\n" + " .fixtype :\n" " .rombeg :\n" " .textchecksum :\n" " // The above sections may be large. Leave a bigger gap for large pages.\n" - " .pidbase align(__INTEGRITY_MaxPageAlign) :\n" + " .pidbase align(__INTEGRITY_MaxPageAlign) :\n" " .sdabase :\n" " .data :\n" " .toc :\n" " .opd :\n" " .datachecksum :\n" - " .bss align(__INTEGRITY_MinPageAlign) :\n" - " .heap :\n" + " .sbss : \n" + " .bss align(__INTEGRITY_MinPageAlign) :\n" + " .argsection(__INTEGRITY_MaxPageAlign) :\n" + " .heap : \n" "}\n"; tl.flush(); dllbase += DLLOFFSET; -- cgit v0.12 From ef2f939effb8e0684b5832eb03c71b1427437526 Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:16 +0100 Subject: Do not generate -D defines for project types. Options are implicitly inherited from project to subprojects and applications, so there is no need to respecify them. Worse, if an app/lib disables an option, the project might still have the define enabled, forcing it also onto the app/lib. This prevents double-define or this kind of conflict. Merge-request: 1438 Reviewed-by: Harald Fernengel --- qmake/generators/integrity/gbuild.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index fcadec0..658bb3c 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -273,7 +273,8 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text) } t << "\n"; - t << varGlue("DEFINES", "\t-D", "\n\t-D", "\n"); + if (project->first("TEMPLATE") != "project") + t << varGlue("DEFINES", "\t-D", "\n\t-D", "\n"); t << "\t-I.\n\t-I" << specdir() << "\n"; t << varGlue("INCLUDEPATH", "\t-I", "\n\t-I", "\n"); -- cgit v0.12 From ddca33b935b411442a17614f622fdd18846e3a7a Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:17 +0100 Subject: Instead of translating / into _, check if subdir is a .pro. Previously, .pro files were treated as directories, and a previous workaround for the issue was to replace / with _ in directory paths. This was both actually non-sensical and not effective. This resolves the issue by checking if the subdir has a .pro extension. Merge-request: 1438 Reviewed-by: Harald Fernengel --- qmake/generators/integrity/gbuild.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index 658bb3c..f6499eb 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -310,9 +310,11 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text) continue; if (!project->first((*it) + ".subdir").isEmpty()) gpjname = project->first((*it) + ".subdir"); + /* some SUBDIRS are not actually subdirs, instead .pro files */ + if (gpjname.endsWith(".pro")) + gpjname.chop(4); else - gpjname.replace("_", QDir::separator()); - gpjname += QDir::separator() + gpjname.section(QDir::separator(), -1); + gpjname += QDir::separator() + gpjname.section(QDir::separator(), -1); gpjname += projectSuffix(); /* make relative */ if (!project->values("QT_SOURCE_TREE").isEmpty()) { -- cgit v0.12 From fe02f62524515b80edd9b18609fe7e5b1fb7eb2b Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:18 +0100 Subject: Use "dll" instead of "shared". For DLLs (which are not supported, but may be soon), use the CONFIG variable "dll" instead of the "shared" template, because some testcases actually use shared even when compiled statically. Merge-request: 1438 Reviewed-by: Harald Fernengel --- qmake/generators/integrity/gbuild.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index f6499eb..081b441 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -153,7 +153,7 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text) Option::output.setFileName(filename); MakefileGenerator::openOutput(Option::output, QString()); } else if ((project->first("TEMPLATE") == "lib") - && project->isActiveConfig("shared")) { + && project->isActiveConfig("dll")) { QString gpjname(strtarget); gpjname += "_shared"; gpjname += projectSuffix(); -- cgit v0.12 From b721cff590ca7e98f121f483d86bd089787639ff Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:19 +0100 Subject: Use outname to specify the output .gpj to generate. This resolves several path issues as well. outname itself is now based on the first TARGET file, instead of using the output filename. Merge-request: 1438 Reviewed-by: Harald Fernengel --- qmake/generators/integrity/gbuild.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index 081b441..4601130 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -77,7 +77,7 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text) /* correct output for non-prl, non-recursive case */ QString outname(qmake_getpwd()); outname += QDir::separator(); - outname += fileInfo(Option::output.fileName()).baseName(); + outname += strtarget; outname += projectSuffix(); Option::output.close(); Option::output.setFileName(outname); @@ -148,9 +148,9 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text) /* change current project file to _app.gpj and continue * generation */ - filename.insert(filename.lastIndexOf("."), "_app"); + outname.insert(outname.lastIndexOf("."), "_app"); Option::output.close(); - Option::output.setFileName(filename); + Option::output.setFileName(outname); MakefileGenerator::openOutput(Option::output, QString()); } else if ((project->first("TEMPLATE") == "lib") && project->isActiveConfig("dll")) { -- cgit v0.12 From ea39013a5401866367e4a0deccfcf58256bdaaa2 Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:21 +0100 Subject: Only call moc if the file needs it. This applies to both headers and cpp files (use mocable()). Previously, moc was called on all cpp and h files, causing additional compilation time, and trouble on QSvgGenerator. Merge-request: 1438 Reviewed-by: Harald Fernengel --- qmake/generators/integrity/gbuild.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index 4601130..0ca470d 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -379,8 +379,9 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text) QString GBuildMakefileGenerator::writeOne(QString filename, QString pathtoremove) { QString s(""); + QString origfilename(filename); s += filename.remove(pathtoremove); - if (filename.endsWith(Option::h_ext.first())) { + if (filename.endsWith(Option::h_ext.first()) && mocable(origfilename)) { QString corename(filename.section(QDir::separator(), -1)); corename.remove(Option::h_ext.first()); corename.append(Option::cpp_ext.first()); @@ -396,7 +397,7 @@ QString GBuildMakefileGenerator::writeOne(QString filename, QString pathtoremove s += tmpstr; s += ".qrc"; s += "\n"; - } else if (filename.endsWith(Option::cpp_ext.first())) { + } else if (filename.endsWith(Option::cpp_ext.first()) && mocable(origfilename)) { QString tmpstr(filename.section("/", -1)); QString filepath(pathtoremove); if (!project->values("QT_SOURCE_TREE").isEmpty()) { -- cgit v0.12 From 0648decd6a5307be3ebf98ea891385989fecb1eb Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:22 +0100 Subject: Add relative path to the work directory, to prevent filename clashes. This was causing issues for some examples, which are all consistently using main.cpp as the entry file. Merge-request: 1438 Reviewed-by: Harald Fernengel --- qmake/generators/integrity/gbuild.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index 0ca470d..9b75fbc 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -389,6 +389,8 @@ QString GBuildMakefileGenerator::writeOne(QString filename, QString pathtoremove s += "\t[MOC/Qt Header]\n"; s += "\t-o "; s += "work/"; + s += pathtoremove; + s += QDir::separator(); s += corename; s += "\n"; } else if (filename.section(QDir::separator(), -1).startsWith("qrc_")) { @@ -413,6 +415,8 @@ QString GBuildMakefileGenerator::writeOne(QString filename, QString pathtoremove s += " -o "; tmpstr.replace(Option::cpp_ext.first(), Option::cpp_moc_ext); s += "work/"; + s += pathtoremove; + s += QDir::separator(); s += tmpstr; s += "\n"; } else -- cgit v0.12 From 0f808217dc6d1dbdfd1beeef4fecc24128eaac7b Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:23 +0100 Subject: Add support for .pro-type subdirectories. Merge-request: 1438 Reviewed-by: Harald Fernengel --- qmake/generators/integrity/gbuild.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index 9b75fbc..dd20321 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -83,7 +83,7 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text) Option::output.setFileName(outname); MakefileGenerator::openOutput(Option::output, QString()); - if (strtarget != fileInfo(project->projectFile()).baseName()) { + if (strtarget != fileInfo(project->projectFile()).baseName().section('.', -2, -2)) { QString gpjname(strtarget); QString outputName(qmake_getpwd()); outputName += QDir::separator(); -- cgit v0.12 From ea1f480170a285b2c46e934ce32af10f59b9d1fa Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:24 +0100 Subject: Make sure QMAKE_CXX is defined to prevent crashing on some projects. Merge-request: 1438 Reviewed-by: Harald Fernengel --- qmake/generators/integrity/gbuild.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index dd20321..ffb2d0a 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -218,7 +218,9 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text) warn_msg(WarnParser, Option::output.fileName().toAscii()); QTextStream t(&Option::output); - QString primaryTarget(project->values("QMAKE_CXX").at(0)); + QString primaryTarget; + if (!project->values("QMAKE_CXX").isEmpty()) + primaryTarget = project->values("QMAKE_CXX").at(0); pathtoremove += QDir::separator(); filename.remove(qmake_getpwd()); -- cgit v0.12 From a74ba4514efac05c7af6f4824ca622dd5d5a2698 Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:26 +0100 Subject: Use the project root from .gpj project files, instead of local path. Merge-request: 1438 Reviewed-by: Harald Fernengel --- qmake/generators/integrity/gbuild.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index ffb2d0a..8df858a 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -259,6 +259,8 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text) t << "\t:sourceDir=." << "\n"; t << "\t:outputDir=work" << relpath << "\n"; + t << "\t-I${%expand_path(.)}/work" << relpath << "\n"; + t << "\t--cxx_include_directory ${%expand_path(.)}/work" << relpath << "\n"; if (filename.endsWith("projects.gpj")) { t << "\t:sourceDir=work\n"; t << "\t-Iwork\n"; @@ -336,7 +338,7 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text) t << "\t-name " << tmpstr << "\n"; tmpstr.insert(tmpstr.lastIndexOf(QDir::separator()) + 1, "qrc_"); tmpstr.append(".cpp"); - t << "\t-o work/" << tmpstr << "\n"; + t << "\t-o work/" << relpath << QDir::separator() << tmpstr << "\n"; } } { @@ -348,7 +350,7 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text) tmpstr.insert(tmpstr.lastIndexOf(QDir::separator()) + 1, "ui_"); tmpstr.remove(".ui"); tmpstr.append(".h"); - t << "\t-o work/" << tmpstr << "\n"; + t << "\t-o work/" << relpath << QDir::separator() << tmpstr << "\n"; } } @@ -371,7 +373,7 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text) { QStringList &l = project->values("GENERATED_SOURCES"); for (QStringList::Iterator it = l.begin(); it != l.end(); ++it) { - t << "work/" << (*it).section(QDir::separator(), -1) << "\n"; + t << "work/" << relpath << QDir::separator() << (*it).section(QDir::separator(), -1) << "\n"; } } -- cgit v0.12 From 75c2d2fb2d29f33d85c801c68c1a8f823e4b8c3c Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:27 +0100 Subject: Add INTEGRITY gbuild.* files to qmake project. This allows building and debugging qmake from Qt Creator. Merge-request: 1438 Reviewed-by: Harald Fernengel --- qmake/qmake.pri | 6 ++++-- qmake/qmake.pro | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qmake/qmake.pri b/qmake/qmake.pri index c2fc1d5..f2a3705 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -22,7 +22,8 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \ generators/symbian/initprojectdeploy_symbian.cpp \ generators/integrity/gbuild.cpp \ windows/registry.cpp \ - symbian/epocroot.cpp + symbian/epocroot.cpp \ + generators/integrity/gbuild.cpp HEADERS += project.h property.h generators/makefile.h \ generators/unix/unixmake.h meta.h option.h cachekeys.h \ @@ -39,7 +40,8 @@ HEADERS += project.h property.h generators/makefile.h \ generators/symbian/initprojectdeploy_symbian.h \ generators/integrity/gbuild.h \ windows/registry_p.h \ - symbian/epocroot_p.h + symbian/epocroot_p.h \ + generators/integrity/gbuild.h contains(QT_EDITION, OpenSource) { DEFINES += QMAKE_OPENSOURCE_EDITION diff --git a/qmake/qmake.pro b/qmake/qmake.pro index b602afa..38e0fce 100644 --- a/qmake/qmake.pro +++ b/qmake/qmake.pro @@ -25,6 +25,7 @@ INCLUDEPATH += . \ generators/win32 \ generators/mac \ generators/symbian \ + generators/integrity \ $$QT_SOURCE_TREE/include \ $$QT_SOURCE_TREE/include/QtCore \ $$QT_SOURCE_TREE/qmake -- cgit v0.12 From 220ca59cc29148b998dd411500e6e9dc82218d2c Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:28 +0100 Subject: Use Q_FUNC_INFO without line number on GHS compiler. Merge-request: 1438 Reviewed-by: Harald Fernengel --- src/corelib/global/qglobal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index cfe5eea..e8c611b 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1824,7 +1824,7 @@ inline T *q_check_ptr(T *p) { Q_CHECK_PTR(p); return p; } #elif defined(_MSC_VER) # define Q_FUNC_INFO __FUNCSIG__ #else -# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC) || defined(Q_OS_SYMBIAN) +# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC) || defined(Q_OS_SYMBIAN) || defined(Q_OS_INTEGRITY) # define Q_FUNC_INFO __FILE__ "(line number unavailable)" # else /* These two macros makes it possible to turn the builtin line expander into a -- cgit v0.12 From 9d8a93ec30bebb3e102d7906d15cf3af9830993e Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:29 +0100 Subject: Improve default mkspec for INTEGRITY. More specifically : - add DEFINES for removing unsupported features - disable one more warning - specify non-shared-library mode - add hiddev library to linker list - fill debug mode flags Merge-request: 1438 Reviewed-by: Harald Fernengel --- mkspecs/unsupported/integrity-ghs/qmake.conf | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mkspecs/unsupported/integrity-ghs/qmake.conf b/mkspecs/unsupported/integrity-ghs/qmake.conf index 822d6bb..803b2da 100644 --- a/mkspecs/unsupported/integrity-ghs/qmake.conf +++ b/mkspecs/unsupported/integrity-ghs/qmake.conf @@ -7,9 +7,10 @@ MAKEFILE_GENERATOR = GBUILD TEMPLATE = app CONFIG += qt warn_on release integrity unix QT += core gui network +DEFINES += QT_NO_SHAREDMEMORY QT_NO_PROCESS QT_NO_QWS_MULTIPROCESS QT_NO_SYSTEMSEMAPHORE QT_NO_PRINTER QT_NO_QWS_QPF2 -QMAKE_CFLAGS = -bsp $$INTEGRITY_BSP -os_dir $__OS_DIR -QMAKE_CFLAGS += --diag_suppress=1,228,236,381,611,997 +QMAKE_CFLAGS = -bsp $$INTEGRITY_BSP -os_dir $__OS_DIR +QMAKE_CFLAGS += --diag_suppress=1,228,236,381,611,997,1795 QMAKE_CFLAGS_WARN_ON = QMAKE_CFLAGS_WARN_OFF = -w QMAKE_CFLAGS_RELEASE = -g -Ospeed -Olink --signed_fields --no_commons @@ -17,7 +18,7 @@ QMAKE_CFLAGS_DEBUG = -g --no_commons --signed_fields QMAKE_CFLAGS_SHLIB = QMAKE_CFLAGS_THREAD = -D_REENTRANT -QMAKE_CXXFLAGS = $$QMAKE_CFLAGS --no_implicit_include --link_once_templates +QMAKE_CXXFLAGS = $$QMAKE_CFLAGS --no_implicit_include --link_once_templates -non_shared QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE @@ -37,9 +38,9 @@ QMAKE_LIBDIR_OPENGL = QMAKE_INCDIR_QTOPIA = $(QPEDIR)/include QMAKE_LIBDIR_QTOPIA = $(QPEDIR)/lib -QMAKE_LFLAGS = -lposix -livfs -lnet -lsocket -lfbdev -ldl +QMAKE_LFLAGS = -lposix -livfs -lnet -lsocket -lfbdev -lhiddev -ldl QMAKE_LFLAGS_RELEASE = -g -Ospeed -Olink --no_commons -non_shared --link_once_templates -QMAKE_LFLAGS_DEBUG = -g --no_commons +QMAKE_LFLAGS_DEBUG = -g --no_commons -non_shared --link_once_templates QMAKE_LFLAGS_SHLIB = QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB QMAKE_LFLAGS_SONAME = -- cgit v0.12 From 84ad4e1b4082f85463124e834b4502ff7efce7df Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:31 +0100 Subject: Add specific INTEGRITY cases for autotests requiring a target path. SRCDIR is not parsed the same way due to the different qmake generation process. furthermore, the full host path doesn't seem like a good idea to use for the path of the target filesystem. Use "/" as default. Merge-request: 1438 Reviewed-by: Harald Fernengel --- tests/auto/qbytearray/qbytearray.pro | 2 ++ tests/auto/qchar/qchar.pro | 2 ++ tests/auto/qelapsedtimer/qelapsedtimer.pro | 2 ++ tests/auto/qfileinfo/qfileinfo.pro | 2 ++ tests/auto/qresourceengine/qresourceengine.pro | 2 ++ tests/auto/qsharedpointer/qsharedpointer.pro | 7 ++++++- tests/auto/qtemporaryfile/qtemporaryfile.pro | 2 ++ tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro | 6 +++++- 8 files changed, 23 insertions(+), 2 deletions(-) diff --git a/tests/auto/qbytearray/qbytearray.pro b/tests/auto/qbytearray/qbytearray.pro index f195dc8..b954ca0 100644 --- a/tests/auto/qbytearray/qbytearray.pro +++ b/tests/auto/qbytearray/qbytearray.pro @@ -14,6 +14,8 @@ wince* { DEFINES += SRCDIR=\\\"./\\\" } else:symbian { TARGET.EPOCHEAPSIZE="0x100 0x800000" +} else:integrity { + DEFINES += SRCDIR=\"/\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qchar/qchar.pro b/tests/auto/qchar/qchar.pro index 1681220..cbbde7c 100644 --- a/tests/auto/qchar/qchar.pro +++ b/tests/auto/qchar/qchar.pro @@ -10,6 +10,8 @@ DEPLOYMENT += deploy symbian: { DEFINES += SRCDIR="" +} else:integrity { + DEFINES += SRCDIR=\"/\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qelapsedtimer/qelapsedtimer.pro b/tests/auto/qelapsedtimer/qelapsedtimer.pro index 8768876..1d74fc5 100644 --- a/tests/auto/qelapsedtimer/qelapsedtimer.pro +++ b/tests/auto/qelapsedtimer/qelapsedtimer.pro @@ -7,6 +7,8 @@ wince* { } else:symbian { # do not define SRCDIR at all TARGET.EPOCHEAPSIZE = 0x100000 0x3000000 +} else:integrity { + DEFINES += SRCDIR=\"/\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qfileinfo/qfileinfo.pro b/tests/auto/qfileinfo/qfileinfo.pro index 7a2cf9c..d0e284b 100644 --- a/tests/auto/qfileinfo/qfileinfo.pro +++ b/tests/auto/qfileinfo/qfileinfo.pro @@ -26,6 +26,8 @@ wince* { DEFINES += SRCDIR=\\\"\\\" } else:symbian { # do not define SRCDIR at all +} else:integrity { + DEFINES += SRCDIR=\"/\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro index 9ca6994..6359549 100644 --- a/tests/auto/qresourceengine/qresourceengine.pro +++ b/tests/auto/qresourceengine/qresourceengine.pro @@ -40,6 +40,8 @@ wince*|symbian:{ testsub2.path = testqrc/test/test DEPLOYMENT += deploy test alias other search1 search2 sub testsub testsub2 !symbian:DEFINES += SRCDIR=\\\"\\\" +} else:integrity { + DEFINES += SRCDIR=\"/\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qsharedpointer/qsharedpointer.pro b/tests/auto/qsharedpointer/qsharedpointer.pro index 014006e..37ab4ce 100644 --- a/tests/auto/qsharedpointer/qsharedpointer.pro +++ b/tests/auto/qsharedpointer/qsharedpointer.pro @@ -9,7 +9,12 @@ HEADERS += forwarddeclared.h \ wrapper.h QT = core -!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\" + +integrity { + DEFINES += SRCDIR=\"/\" +} else:!symbian { + DEFINES += SRCDIR=\\\"$$PWD/\\\" +} include(externaltests.pri) CONFIG += parallel_test diff --git a/tests/auto/qtemporaryfile/qtemporaryfile.pro b/tests/auto/qtemporaryfile/qtemporaryfile.pro index 64a043b..4cbc76d 100644 --- a/tests/auto/qtemporaryfile/qtemporaryfile.pro +++ b/tests/auto/qtemporaryfile/qtemporaryfile.pro @@ -7,6 +7,8 @@ symbian { testData.files = tst_qtemporaryfile.cpp testData.path = . DEPLOYMENT += testData +} else:integrity { + DEFINES += SRCDIR=\"/\" }else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro index 5f3cb11..c52ca52 100644 --- a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro +++ b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro @@ -2,7 +2,11 @@ load(qttest_p4) QT = core HEADERS += SOURCES += tst_qtextboundaryfinder.cpp -!symbian:*:DEFINES += SRCDIR=\\\"$$PWD\\\" +integrity { + DEFINES += SRCDIR=\"/\" +} else:!symbian { + DEFINES += SRCDIR=\\\"$$PWD/\\\" +} wince*|symbian:{ addFiles.files = data -- cgit v0.12 From ec8b0dc65ead3fc1fb557e52dd14b4c0073ff1a9 Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:32 +0100 Subject: Disable some tests because INTEGRITY doesn't support shared libraries. Merge-request: 1438 Reviewed-by: Harald Fernengel --- tests/auto/qlibrary/qlibrary.pro | 2 ++ tests/auto/qplugin/qplugin.pro | 2 +- tests/auto/qpluginloader/qpluginloader.pro | 4 ++-- tests/auto/selftests/selftests.pro | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/auto/qlibrary/qlibrary.pro b/tests/auto/qlibrary/qlibrary.pro index 5dc129f..b351753 100644 --- a/tests/auto/qlibrary/qlibrary.pro +++ b/tests/auto/qlibrary/qlibrary.pro @@ -6,6 +6,8 @@ symbian: { # Can't build two versions of lib with same name in symbian, so just build one SUBDIRS = lib2 \ tst +} else:integrity { +# no shared support, empty test } else { SUBDIRS = lib \ lib2 \ diff --git a/tests/auto/qplugin/qplugin.pro b/tests/auto/qplugin/qplugin.pro index 37a12da..1dcf0a7 100644 --- a/tests/auto/qplugin/qplugin.pro +++ b/tests/auto/qplugin/qplugin.pro @@ -22,7 +22,7 @@ mac { SUBDIRS = debugplugin releaseplugin tst_qplugin_pro.depends += debugplugin releaseplugin } -SUBDIRS += tst_qplugin.pro +!integrity:SUBDIRS += tst_qplugin.pro CONFIG += parallel_test diff --git a/tests/auto/qpluginloader/qpluginloader.pro b/tests/auto/qpluginloader/qpluginloader.pro index 6e41b4c..cb25b0f 100644 --- a/tests/auto/qpluginloader/qpluginloader.pro +++ b/tests/auto/qpluginloader/qpluginloader.pro @@ -1,10 +1,10 @@ QT = core TEMPLATE = subdirs CONFIG += ordered -SUBDIRS = lib \ +!integrity:SUBDIRS = lib \ theplugin \ tst -!win32: !macx-*: !symbian: SUBDIRS += almostplugin +!win32: !macx-*: !symbian: !integrity: SUBDIRS += almostplugin TARGET = tst_qpluginloader # no special install rule for subdir diff --git a/tests/auto/selftests/selftests.pro b/tests/auto/selftests/selftests.pro index 74cd075..1494e38 100644 --- a/tests/auto/selftests/selftests.pro +++ b/tests/auto/selftests/selftests.pro @@ -12,5 +12,6 @@ INSTALLS = QT = core +integrity: SUBDIRS -= test CONFIG += parallel_test -- cgit v0.12 From 395d177cd83c174e33b205feafd8e7b613b79a6d Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:33 +0100 Subject: Remove QT 3 API support by default for INTEGRITY. Merge-request: 1438 Reviewed-by: Harald Fernengel --- src/src.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/src.pro b/src/src.pro index 9314fbd..c51683b 100644 --- a/src/src.pro +++ b/src/src.pro @@ -8,7 +8,7 @@ SRC_SUBDIRS += src_corelib src_xml src_network src_sql src_testlib nacl: SRC_SUBDIRS -= src_network src_testlib !symbian:contains(QT_CONFIG, dbus):SRC_SUBDIRS += src_dbus !contains(QT_CONFIG, no-gui): SRC_SUBDIRS += src_gui -!wince*:!symbian:!vxworks:contains(QT_CONFIG, qt3support): SRC_SUBDIRS += src_qt3support +!wince*:!symbian:!vxworks:!integrity:contains(QT_CONFIG, qt3support): SRC_SUBDIRS += src_qt3support !wince*:!symbian-abld:!symbian-sbsv2:include(tools/tools.pro) win32:!win32-g++*:SRC_SUBDIRS += src_activeqt -- cgit v0.12 From bc8dcd6a90ea74de2f934dda6975e8a215313d14 Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:34 +0100 Subject: Add XPLATFORM_INTEGRITY to define defaults for INTEGRITY. Defaults are set for QT_INSTALL paths, and for various CFG_ defines. Also set the input and framebuffer drivers to be used. Also set the BUILD_PARTS to the reduced set that produce target code. If using script and declarative, then these are added still. Make the configuration explicitly "Qt for INTEGRITY". Since *_DIR variables are set in the first part of the configuration, do not set them again in the generic code. Merge-request: 1438 Reviewed-by: Harald Fernengel --- configure | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/configure b/configure index b590507..2665a34 100755 --- a/configure +++ b/configure @@ -816,6 +816,7 @@ l_FLAGS= QCONFIG_FLAGS= XPLATFORM= # This seems to be the QMAKESPEC, like "linux-g++" or "symbian-gcce" XPLATFORM_MINGW=no # Whether target platform is MinGW (win32-g++*) +XPLATFORM_INTEGRITY=no # Whether target platform is INTEGRITY (*integrity*) XPLATFORM_SYMBIAN=no # Whether target platform is SYMBIAN (*symbian*) XPLATFORM_SYMBIAN_SBSV2=no # Whether target platform is SYMBIAN_SBSV2 (symbian-sbsv2) PLATFORM=$QMAKESPEC @@ -1596,6 +1597,7 @@ while [ "$#" -gt 0 ]; do xplatform) XPLATFORM="$VAL" case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac + case "$XPLATFORM" in *integrity*) XPLATFORM_INTEGRITY=yes;; esac case "$XPLATFORM" in *symbian*) XPLATFORM_SYMBIAN=yes;; esac case "$XPLATFORM" in symbian-sbsv2) XPLATFORM_SYMBIAN_SBSV2=yes;; esac ;; @@ -2899,6 +2901,7 @@ fi [ -z "$XPLATFORM" ] && XPLATFORM="$PLATFORM" case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac +case "$XPLATFORM" in *integrity*) XPLATFORM_INTEGRITY=yes;; esac case "$XPLATFORM" in *symbian*) XPLATFORM_SYMBIAN=yes;; esac case "$XPLATFORM" in symbian-sbsv2) XPLATFORM_SYMBIAN_SBSV2=yes;; esac @@ -3179,6 +3182,8 @@ if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then esac elif [ "$XPLATFORM_MINGW" = "yes" ]; then [ -z "$CFG_ARCH" ] && CFG_ARCH="windows" +elif [ "$XPLATFORM_INTEGRITY" = "yes" ]; then + CFG_ARCH=integrity elif [ "$XPLATFORM_SYMBIAN" = "yes" ]; then CFG_ARCH=symbian elif [ "$PLATFORM_MAC" = "yes" ] || [ -z "$CFG_ARCH" ]; then @@ -3531,6 +3536,19 @@ if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then [ -z "$QT_INSTALL_SETTINGS" ] && QT_INSTALL_SETTINGS= [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES= [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS= +elif [ "$XPLATFORM_INTEGRITY" = "yes" ]; then + [ -z "$QT_HOST_PREFIX" ] && QT_HOST_PREFIX="$QT_INSTALL_PREFIX" + [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS="$QT_INSTALL_PREFIX/doc" + [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS="$QT_INSTALL_PREFIX/include" + [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS="$QT_INSTALL_PREFIX/lib" + [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS="$QT_INSTALL_PREFIX/bin" + [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="$QT_INSTALL_PREFIX/plugins" + [ -z "$QT_INSTALL_IMPORTS" ] && QT_INSTALL_IMPORTS="$QT_INSTALL_PREFIX/imports" + [ -z "$QT_INSTALL_DATA" ] && QT_INSTALL_DATA="$QT_INSTALL_PREFIX" + [ -z "$QT_INSTALL_TRANSLATIONS" ] && QT_INSTALL_TRANSLATIONS="$QT_INSTALL_PREFIX/translations" + [ -z "$QT_INSTALL_SETTINGS" ] && QT_INSTALL_SETTINGS="$QT_INSTALL_PREFIX" + [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES="$QT_INSTALL_PREFIX/examples" + [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS="$QT_INSTALL_PREFIX/demos" else #docs if [ -z "$QT_INSTALL_DOCS" ]; then #default @@ -4422,6 +4440,8 @@ if [ "$PLATFORM_QWS" = "yes" ]; then Platform="Qt for Embedded Linux" elif [ "$PLATFORM_QPA" = "yes" ]; then Platform="Qt Lighthouse" +elif [ "$XPLATFORM_INTEGRITY" = "yes" ]; then + Platform="Qt for INTEGRITY" elif [ "$XPLATFORM_SYMBIAN" = "yes" ]; then Platform="Qt for Symbian" elif [ "$PLATFORM_MAC" = "yes" ]; then @@ -5115,6 +5135,26 @@ if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then fi fi fi +# Adjust all variables for INTEGRITY +if [ "$XPLATFORM_INTEGRITY" = "yes" ]; then + QMakeVar set gfx-drivers "integrityfb" + QMakeVar set kbd-drivers "integrity" + QMakeVar set mouse-drivers "integrity" + CFG_TIFF="no" + CFG_KBD_ON="integrity" + CFG_MOUSE_ON="integrity" + CFG_GFX_ON="integrityfb" + CFG_LARGEFILE="no" + CFG_STL="yes" + CFG_OPENSSL="no" + CFG_GLIB="no" + CFG_SHARED="no" + if [ "$CFG_SCRIPT" != "yes" ]; then + CFG_SCRIPT="no" + fi + CFG_BUILD_PARTS="libs examples demos" + CFG_GIF="no" +fi # check IPC support if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipc_sysv "ipc_sysv" $L_FLAGS $I_FLAGS $l_FLAGS ; then @@ -6584,7 +6624,7 @@ if [ "$CFG_DOUBLEFORMAT" = "auto" ]; then fi HAVE_STL=no -if [ "$XPLATFORM_SYMBIAN" = "yes" ] || "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $l_FLAGS; then +if [ "$XPLATFORM_SYMBIAN" = "yes" ] || [ "$XPLATFORM_INTEGRITY" = "yes" ] || "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $l_FLAGS; then HAVE_STL=yes fi @@ -6980,9 +7020,9 @@ case "$PLATFORM,$CFG_MAC_COCOA" in ;; esac -# disable Qt 3 support on VxWorks and Symbian +# disable Qt 3 support on VxWorks, Symbian and INTEGRITY case "$XPLATFORM" in - unsupported/vxworks*|symbian*) + unsupported/vxworks*|symbian*|unsupported/integrity*) CFG_QT3SUPPORT="no" ;; esac @@ -7122,10 +7162,17 @@ if [ "$XPLATFORM_MINGW" != "yes" ]; then # debug and release precompiled headers are kept separate. QMakeVar set PRECOMPILED_DIR ".pch/$QMAKE_OUTDIR" fi -QMakeVar set OBJECTS_DIR ".obj/$QMAKE_OUTDIR" -QMakeVar set MOC_DIR ".moc/$QMAKE_OUTDIR" -QMakeVar set RCC_DIR ".rcc/$QMAKE_OUTDIR" -QMakeVar set UI_DIR ".uic/$QMAKE_OUTDIR" +if [ "$XPLATFORM_INTEGRITY" = "yes" ]; then + QMakeVar set OBJECTS_DIR "$PWD/work" + QMakeVar set MOC_DIR "$PWD/work" + QMakeVar set RCC_DIR "$PWD/work" + QMakeVar set UI_DIR "$PWD/work" +else + QMakeVar set OBJECTS_DIR ".obj/$QMAKE_OUTDIR" + QMakeVar set MOC_DIR ".moc/$QMAKE_OUTDIR" + QMakeVar set RCC_DIR ".rcc/$QMAKE_OUTDIR" + QMakeVar set UI_DIR ".uic/$QMAKE_OUTDIR" +fi if [ "$CFG_LARGEFILE" = "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then QMAKE_CONFIG="$QMAKE_CONFIG largefile" fi -- cgit v0.12 From 481f5f0146261864bddf7f25fbba4c6ae35a3afa Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:36 +0100 Subject: Remove docs and translations generation for INTEGRITY. The source should only be used to build target code, in the context of building for INTEGRITY. Merge-request: 1438 Reviewed-by: Harald Fernengel --- projects.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects.pro b/projects.pro index bf4dc5e..0b498f8 100644 --- a/projects.pro +++ b/projects.pro @@ -8,7 +8,7 @@ TEMPLATE = subdirs cross_compile: CONFIG += nostrip isEmpty(QT_BUILD_PARTS) { #defaults - symbian { + symbian|integrity { QT_BUILD_PARTS = libs tools examples demos } else { QT_BUILD_PARTS = libs tools examples demos docs translations -- cgit v0.12 From ff01e5cca39fb418f21cc8b06885178600a84f56 Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:37 +0100 Subject: Remove support for tilde expansion as there is no home on INTEGRITY. Instead of removing each use of the function, make the function do nearly nothing. If home support gets added (it is actually there when user/group support is present with full-posix mode is used), then this is trivial to remove. Also, keeps changes minimal. Merge-request: 1438 Reviewed-by: Harald Fernengel --- src/gui/dialogs/qfiledialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 817cd38..8b76dac 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -869,6 +869,7 @@ Q_AUTOTEST_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded if (!path.startsWith(QLatin1Char('~'))) return path; QString ret = path; +#if defined(Q_OS_INTEGRITY) QStringList tokens = ret.split(QDir::separator()); if (tokens.first() == QLatin1String("~")) { ret.replace(0, 1, QDir::homePath()); @@ -899,6 +900,7 @@ Q_AUTOTEST_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded } if (expanded != 0) *expanded = true; +#endif return ret; } #endif -- cgit v0.12 From 7624731b02eee17a69e717a2f6a2e3a3a7281977 Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:38 +0100 Subject: Update to latest INTEGRITY Framebuffer API. Merge-request: 1438 Reviewed-by: Harald Fernengel --- src/gui/embedded/qscreenintegrityfb_qws.cpp | 154 ++++++++-------------------- 1 file changed, 44 insertions(+), 110 deletions(-) diff --git a/src/gui/embedded/qscreenintegrityfb_qws.cpp b/src/gui/embedded/qscreenintegrityfb_qws.cpp index 6f30812..5b1e0d5 100644 --- a/src/gui/embedded/qscreenintegrityfb_qws.cpp +++ b/src/gui/embedded/qscreenintegrityfb_qws.cpp @@ -64,7 +64,8 @@ public: ~QIntfbScreenPrivate(); FBHandle handle; - struct FBInfoStruct fbinfo; + FBInfo fbinfo; + FBDriver *fbdrv; QWSMouseHandler *mouse; #ifndef QT_NO_QWS_KEYBOARD @@ -172,15 +173,14 @@ static QIntfbScreen *connected = 0; bool QIntfbScreen::connect(const QString &displaySpec) { - FBDriver *fbdev; - - CheckSuccess(gh_FB_get_driver(0, &fbdev)); - CheckSuccess(gh_FB_init_device(fbdev, 0, &d_ptr->handle)); + CheckSuccess(gh_FB_get_driver(0, &d_ptr->fbdrv)); + CheckSuccess(gh_FB_check_info(d_ptr->fbdrv, &d_ptr->fbinfo)); + CheckSuccess(gh_FB_open(d_ptr->fbdrv, &d_ptr->fbinfo, &d_ptr->handle)); CheckSuccess(gh_FB_get_info(d_ptr->handle, &d_ptr->fbinfo)); - data = (uchar *)d_ptr->fbinfo.start; + data = (uchar *)d_ptr->fbinfo.Start; - d = d_ptr->fbinfo.bitsperpixel; + d = d_ptr->fbinfo.BitsPerPixel; switch (d) { case 1: setPixelFormat(QImage::Format_Mono); @@ -205,24 +205,24 @@ bool QIntfbScreen::connect(const QString &displaySpec) #ifdef QT_QWS_DEPTH_GENERIC #if Q_BYTE_ORDER != Q_BIG_ENDIAN qt_set_generic_blit(this, 24, - d_ptr->fbinfo.redbits, - d_ptr->fbinfo.greenbits, - d_ptr->fbinfo.bluebits, - d_ptr->fbinfo.alphabits, - d_ptr->fbinfo.redoffset, - d_ptr->fbinfo.greenoffset, - d_ptr->fbinfo.blueoffset, - d_ptr->fbinfo.alphaoffset); + d_ptr->fbinfo.Red.Bits, + d_ptr->fbinfo.Green.Bits, + d_ptr->fbinfo.Blue.Bits, + d_ptr->fbinfo.Alpha.Bits, + d_ptr->fbinfo.Red.Offset, + d_ptr->fbinfo.Green.Offset, + d_ptr->fbinfo.Blue.Offset, + d_ptr->fbinfo.Alpha.Offset); #else qt_set_generic_blit(this, 24, - d_ptr->fbinfo.redbits, - d_ptr->fbinfo.greenbits, - d_ptr->fbinfo.bluebits, - d_ptr->fbinfo.alphabits, - 16 - d_ptr->fbinfo.redoffset, - 16 - d_ptr->fbinfo.greenoffset, - 16 - d_ptr->fbinfo.blueoffset, - d_ptr->fbinfo.alphaoffset); + d_ptr->fbinfo.Red.Bits, + d_ptr->fbinfo.Green.Bits, + d_ptr->fbinfo.Blue.Bits, + d_ptr->fbinfo.Alpha.Bits, + 16 - d_ptr->fbinfo.Red.Offset, + 16 - d_ptr->fbinfo.Green.Offset, + 16 - d_ptr->fbinfo.Blue.Offset, + 16 - d_ptr->fbinfo.Alpha.Offset); #endif #endif break; @@ -231,31 +231,31 @@ bool QIntfbScreen::connect(const QString &displaySpec) #ifdef QT_QWS_DEPTH_GENERIC #if Q_BYTE_ORDER != Q_BIG_ENDIAN qt_set_generic_blit(this, 32, - d_ptr->fbinfo.redbits, - d_ptr->fbinfo.greenbits, - d_ptr->fbinfo.bluebits, - d_ptr->fbinfo.alphabits, - d_ptr->fbinfo.redoffset, - d_ptr->fbinfo.greenoffset, - d_ptr->fbinfo.blueoffset, - d_ptr->fbinfo.alphaoffset); + d_ptr->fbinfo.Red.Bits, + d_ptr->fbinfo.Green.Bits, + d_ptr->fbinfo.Blue.Bits, + d_ptr->fbinfo.Alpha.Bits, + d_ptr->fbinfo.Red.Offset, + d_ptr->fbinfo.Green.Offset, + d_ptr->fbinfo.Blue.Offset, + d_ptr->fbinfo.Alpha.Offset); #else qt_set_generic_blit(this, 32, - d_ptr->fbinfo.redbits, - d_ptr->fbinfo.greenbits, - d_ptr->fbinfo.bluebits, - d_ptr->fbinfo.alphabits, - 24 - d_ptr->fbinfo.redoffset, - 24 - d_ptr->fbinfo.greenoffset, - 24 - d_ptr->fbinfo.blueoffset, - d_ptr->fbinfo.alphaoffset ? 24 - d_ptr->fbinfo.alphaoffset : 0); + d_ptr->fbinfo.Red.Bits, + d_ptr->fbinfo.Green.Bits, + d_ptr->fbinfo.Blue.Bits, + d_ptr->fbinfo.Alpha.Bits, + 24 - d_ptr->fbinfo.Red.Offset, + 24 - d_ptr->fbinfo.Green.Offset, + 24 - d_ptr->fbinfo.Blue.Offset, + 24 - d_ptr->fbinfo.Alpha.Offset); #endif #endif break; } - dw = w = d_ptr->fbinfo.width; - dh = h = d_ptr->fbinfo.height; + dw = w = d_ptr->fbinfo.Width; + dh = h = d_ptr->fbinfo.Height; /* assumes no padding */ lstep = w * ((d + 7) >> 3); @@ -286,72 +286,6 @@ void QIntfbScreen::disconnect() bool QIntfbScreen::initDevice() { - - CheckSuccess(gh_FB_set_info(d_ptr->handle, &d_ptr->fbinfo, false)); - CheckSuccess(gh_FB_get_info(d_ptr->handle, &d_ptr->fbinfo)); - data = (uchar *)d_ptr->fbinfo.start; - d = d_ptr->fbinfo.bitsperpixel; - dw = w = d_ptr->fbinfo.width; - dh = h = d_ptr->fbinfo.height; - mapsize = d_ptr->fbinfo.length; - /* assumes no padding */ - lstep = w * ((d + 7) >> 3); - - mapsize = size = h * lstep; - - data = (uchar *)d_ptr->fbinfo.start; - - d = d_ptr->fbinfo.bitsperpixel; - switch (d) { - case 1: - setPixelFormat(QImage::Format_Mono); - break; - case 8: - setPixelFormat(QImage::Format_Indexed8); - break; - case 12: - setPixelFormat(QImage::Format_RGB444); - break; - case 15: - setPixelFormat(QImage::Format_RGB555); - break; - case 16: - setPixelFormat(QImage::Format_RGB16); - break; - case 18: - setPixelFormat(QImage::Format_RGB666); - break; - case 24: - setPixelFormat(QImage::Format_RGB888); - break; - case 32: - setPixelFormat(QImage::Format_ARGB32_Premultiplied); - break; - } -#ifdef QT_QWS_DEPTH_GENERIC -#if defined(__BIG_ENDIAN__) - qt_set_generic_blit(this, d, - d_ptr->fbinfo.redbits, - d_ptr->fbinfo.greenbits, - d_ptr->fbinfo.bluebits, - d_ptr->fbinfo.alphabits, - 24 - d_ptr->fbinfo.redoffset, - 24 - d_ptr->fbinfo.greenoffset, - 24 - d_ptr->fbinfo.blueoffset, - d_ptr->fbinfo.alphaoffset ? 24 - d_ptr->fbinfo.alphaoffset : 0); -#else - qt_set_generic_blit(this, d, - d_ptr->fbinfo.redbits, - d_ptr->fbinfo.greenbits, - d_ptr->fbinfo.bluebits, - d_ptr->fbinfo.alphabits, - d_ptr->fbinfo.redoffset, - d_ptr->fbinfo.greenoffset, - d_ptr->fbinfo.blueoffset, - d_ptr->fbinfo.alphaoffset); -#endif -#endif - #ifndef QT_NO_QWS_CURSOR QScreenCursor::initSoftwareCursor(); #endif @@ -384,9 +318,9 @@ void QIntfbScreen::setDirty(const QRect& rect) FBRect fbrect; fbrect.dx = rect.x(); fbrect.dy = rect.y(); - fbrect.width = rect.width(); - fbrect.height = rect.height(); - gh_FB_expose(d_ptr->handle, &fbrect); + fbrect.Width = rect.width(); + fbrect.Height = rect.height(); + gh_FB_expose(d_ptr->handle, &fbrect, 0); } void QIntfbScreen::setBrightness(int b) -- cgit v0.12 From 2326a8d878e0d18473c27ddd54880621518b6e6e Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Tue, 15 Nov 2011 17:36:16 +0100 Subject: Amend qfiledialog INTEGRITY patch --- src/gui/dialogs/qfiledialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 8b76dac..970d111 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -869,7 +869,7 @@ Q_AUTOTEST_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded if (!path.startsWith(QLatin1Char('~'))) return path; QString ret = path; -#if defined(Q_OS_INTEGRITY) +#if !defined(Q_OS_INTEGRITY) QStringList tokens = ret.split(QDir::separator()); if (tokens.first() == QLatin1String("~")) { ret.replace(0, 1, QDir::homePath()); -- cgit v0.12 From d4150975af620e2889cc58bd476bac6b4d101db3 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 16 Nov 2011 09:53:38 +0100 Subject: Windows: Add gcc 4.6. - Add gcc 4.6 mkspec for > 4.4 (win32-g++-4.6) - Add detection of g++ version and 64bit to configure. Reviewed-by: mariusSO --- mkspecs/win32-g++-4.6/qmake.conf | 3 + mkspecs/win32-g++-4.6/qplatformdefs.h | 159 ++++++++++++++++++++++++++++++++++ qmake/Makefile.win32-g++ | 2 +- src/corelib/tools/qlocale_tools.cpp | 7 ++ tools/configure/configureapp.cpp | 31 ++++--- tools/configure/environment.cpp | 86 +++++++++++++++++- tools/configure/environment.h | 3 + 7 files changed, 275 insertions(+), 16 deletions(-) create mode 100644 mkspecs/win32-g++-4.6/qmake.conf create mode 100644 mkspecs/win32-g++-4.6/qplatformdefs.h diff --git a/mkspecs/win32-g++-4.6/qmake.conf b/mkspecs/win32-g++-4.6/qmake.conf new file mode 100644 index 0000000..2c94587 --- /dev/null +++ b/mkspecs/win32-g++-4.6/qmake.conf @@ -0,0 +1,3 @@ +include(../win32-g++/qmake.conf) +QMAKE_CFLAGS *= -fno-keep-inline-dllexport +QMAKE_CXXFLAGS *= -fno-keep-inline-dllexport diff --git a/mkspecs/win32-g++-4.6/qplatformdefs.h b/mkspecs/win32-g++-4.6/qplatformdefs.h new file mode 100644 index 0000000..630a6a4 --- /dev/null +++ b/mkspecs/win32-g++-4.6/qplatformdefs.h @@ -0,0 +1,159 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMDEFS_H +#define QPLATFORMDEFS_H + +#ifdef UNICODE +#ifndef _UNICODE +#define _UNICODE +#endif +#endif + +// Get Qt defines/settings + +#include "qglobal.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500) +typedef enum { + NameUnknown = 0, + NameFullyQualifiedDN = 1, + NameSamCompatible = 2, + NameDisplay = 3, + NameUniqueId = 6, + NameCanonical = 7, + NameUserPrincipal = 8, + NameCanonicalEx = 9, + NameServicePrincipal = 10, + NameDnsDomain = 12 +} EXTENDED_NAME_FORMAT, *PEXTENDED_NAME_FORMAT; +#endif + +#define Q_FS_FAT +#ifdef QT_LARGEFILE_SUPPORT +#define QT_STATBUF struct _stati64 // non-ANSI defs +#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs +#define QT_STAT ::_stati64 +#define QT_FSTAT ::_fstati64 +#else +#define QT_STATBUF struct _stat // non-ANSI defs +#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs +#define QT_STAT ::_stat +#define QT_FSTAT ::_fstat +#endif +#define QT_STAT_REG _S_IFREG +#define QT_STAT_DIR _S_IFDIR +#define QT_STAT_MASK _S_IFMT +#if defined(_S_IFLNK) +# define QT_STAT_LNK _S_IFLNK +#endif +#define QT_FILENO _fileno +#define QT_OPEN ::_open +#define QT_CLOSE ::_close +#ifdef QT_LARGEFILE_SUPPORT +#define QT_LSEEK ::_lseeki64 +#ifndef UNICODE +#define QT_TSTAT ::_stati64 +#else +#define QT_TSTAT ::_wstati64 +#endif +#else +#define QT_LSEEK ::_lseek +#ifndef UNICODE +#define QT_TSTAT ::_stat +#else +#define QT_TSTAT ::_wstat +#endif +#endif +#define QT_READ ::_read +#define QT_WRITE ::_write +#define QT_ACCESS ::_access +#define QT_GETCWD ::_getcwd +#define QT_CHDIR ::_chdir +#define QT_MKDIR ::_mkdir +#define QT_RMDIR ::_rmdir +#define QT_OPEN_LARGEFILE 0 +#define QT_OPEN_RDONLY _O_RDONLY +#define QT_OPEN_WRONLY _O_WRONLY +#define QT_OPEN_RDWR _O_RDWR +#define QT_OPEN_CREAT _O_CREAT +#define QT_OPEN_TRUNC _O_TRUNC +#define QT_OPEN_APPEND _O_APPEND +#if defined(O_TEXT) +# define QT_OPEN_TEXT _O_TEXT +# define QT_OPEN_BINARY _O_BINARY +#endif + +#include "../common/c89/qplatformdefs.h" + +#ifdef QT_LARGEFILE_SUPPORT +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + +#define QT_FSEEK ::fseeko64 +#define QT_FTELL ::ftello64 +#define QT_OFF_T off64_t +#endif + +#define QT_SIGNAL_ARGS int + +#define QT_VSNPRINTF ::_vsnprintf +#define QT_SNPRINTF ::_snprintf + +# define F_OK 0 +# define X_OK 1 +# define W_OK 2 +# define R_OK 4 + + +#endif // QPLATFORMDEFS_H diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++ index d40dc29..5fa1e5e 100644 --- a/qmake/Makefile.win32-g++ +++ b/qmake/Makefile.win32-g++ @@ -27,7 +27,7 @@ CFLAGS = -c -o$@ -O \ -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT CXXFLAGS = $(CFLAGS) -LFLAGS = -static-libgcc -static-libstdc++ -s +LFLAGS = -static-libgcc -s LIBS = -lole32 -luuid -ladvapi32 -lkernel32 LINKQMAKE = g++ $(LFLAGS) -o qmake.exe $(OBJS) $(QTOBJS) $(LIBS) ADDCLEAN = diff --git a/src/corelib/tools/qlocale_tools.cpp b/src/corelib/tools/qlocale_tools.cpp index df31bf9..750379c 100644 --- a/src/corelib/tools/qlocale_tools.cpp +++ b/src/corelib/tools/qlocale_tools.cpp @@ -2253,6 +2253,13 @@ static int quorem(Bigint *b, Bigint *S) * calculation. */ +#if defined(Q_OS_WIN) && defined (Q_CC_GNU) && !defined(_clear87) // See QTBUG-7576 +extern "C" { +__attribute__ ((dllimport)) unsigned int __cdecl __MINGW_NOTHROW _control87 (unsigned int unNew, unsigned int unMask); +__attribute__ ((dllimport)) unsigned int __cdecl __MINGW_NOTHROW _clearfp (void); /* Clear the FPU status word */ +} +# define _clear87 _clearfp +#endif /* This actually sometimes returns a pointer to a string literal cast to a char*. Do NOT try to modify the return value. */ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index e6d8526..60996e3 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1263,17 +1263,18 @@ 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("-msvc") || - dictionary[ "QMAKESPEC" ].endsWith("-msvc.net") || - dictionary[ "QMAKESPEC" ].endsWith("-msvc2002") || - dictionary[ "QMAKESPEC" ].endsWith("-msvc2003") || - dictionary[ "QMAKESPEC" ].endsWith("-msvc2005") || - dictionary[ "QMAKESPEC" ].endsWith("-msvc2008") || - dictionary[ "QMAKESPEC" ].endsWith("-msvc2010")) { + const QString qmakeSpec = dictionary[ "QMAKESPEC" ]; + if (qmakeSpec.endsWith("-icc") || + qmakeSpec.endsWith("-msvc") || + qmakeSpec.endsWith("-msvc.net") || + qmakeSpec.endsWith("-msvc2002") || + qmakeSpec.endsWith("-msvc2003") || + qmakeSpec.endsWith("-msvc2005") || + qmakeSpec.endsWith("-msvc2008") || + qmakeSpec.endsWith("-msvc2010")) { if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "nmake"; dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32"; - } else if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) { + } else if (qmakeSpec.contains("win32-g++")) { if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "mingw32-make"; if (Environment::detectExecutable("sh.exe")) { dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-g++-sh"; @@ -1329,7 +1330,7 @@ void Configure::parseCmdLine() } } - useUnixSeparators = (dictionary["QMAKESPEC"] == "win32-g++"); + useUnixSeparators = dictionary["QMAKESPEC"].contains("win32-g++"); // Allow tests for private classes to be compiled against internal builds if (dictionary["BUILDDEV"] == "yes") @@ -2201,7 +2202,9 @@ bool Configure::checkAvailability(const QString &part) } else if (part == "MULTIMEDIA" || part == "SCRIPT" || part == "SCRIPTTOOLS" || part == "DECLARATIVE") { available = true; } else if (part == "WEBKIT") { - available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-msvc2010") || (dictionary.value("QMAKESPEC") == "win32-g++"); + const QString qmakeSpec = dictionary.value("QMAKESPEC"); + available = qmakeSpec == "win32-msvc2005" || qmakeSpec == "win32-msvc2008" || + qmakeSpec == "win32-msvc2010" || qmakeSpec.startsWith("win32-g++"); if (dictionary[ "SHARED" ] == "no") { cout << endl << "WARNING: Using static linking will disable the WebKit module." << endl << endl; @@ -2376,7 +2379,7 @@ bool Configure::verifyConfiguration() dictionary["SQL_SQLITE_LIB"] = "qt"; // Set to Qt's bundled lib an continue } - if (dictionary["QMAKESPEC"].endsWith("-g++") + if (dictionary["QMAKESPEC"].contains("-g++") && dictionary["SQL_OCI"] != "no") { cout << "WARNING: Qt does not support compiling the Oracle database driver with" << endl << "MinGW, due to lack of such support from Oracle. Consider disabling the" << endl @@ -2456,7 +2459,7 @@ void Configure::generateBuildKey() QString spec = dictionary["QMAKESPEC"]; QString compiler = "msvc"; // ICC is compatible - if (spec.endsWith("-g++")) + if (spec.contains("-g++")) compiler = "mingw"; else if (spec.endsWith("-borland")) compiler = "borland"; @@ -2874,7 +2877,7 @@ void Configure::generateOutputVars() if (!qmakeStylePlugins.isEmpty()) qmakeVars += QString("style-plugins += ") + qmakeStylePlugins.join(" "); - if (dictionary["QMAKESPEC"].endsWith("-g++")) { + if (dictionary["QMAKESPEC"].contains("-g++")) { QString includepath = qgetenv("INCLUDE"); bool hasSh = Environment::detectExecutable("sh.exe"); QChar separator = (!includepath.contains(":\\") && hasSh ? QChar(':') : QChar(';')); diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp index f9b3e85..78e1d87 100644 --- a/tools/configure/environment.cpp +++ b/tools/configure/environment.cpp @@ -120,6 +120,9 @@ QString Environment::detectQMakeSpec() spec = "win32-icc"; break; case CC_MINGW: + spec = "win32-g++-4.6"; + break; + case CC_MINGW_44: spec = "win32-g++"; break; case CC_BORLAND: @@ -173,6 +176,12 @@ Compiler Environment::detectCompiler() if (executable.length() && Environment::detectExecutable(executable)) { ++installed; detectedCompiler = compiler_info[i].compiler; + if (detectedCompiler == CC_MINGW) { + bool is64bit; + const int version = detectGPlusPlusVersion(executable, &is64bit); + if (version < 0x040600) + detectedCompiler = CC_MINGW_44; + } break; } } @@ -184,7 +193,7 @@ Compiler Environment::detectCompiler() } return detectedCompiler; #endif -}; +} /*! Returns true if the \a executable could be loaded, else false. @@ -214,6 +223,81 @@ bool Environment::detectExecutable(const QString &executable) } /*! + Determine the g++ version. +*/ + +int Environment::detectGPlusPlusVersion(const QString &executable, + bool *is64bit) +{ + QRegExp regexp(QLatin1String("[gG]\\+\\+[\\.exEX]{0,4} ([^\\s]+) (\\d+)\\.(\\d+)\\.(\\d+)")); + QString stdOut = readProcessStandardOutput(executable + QLatin1String(" --version")); + if (regexp.indexIn(stdOut) != -1) { + const QString compiler = regexp.cap(1); + // Check for "tdm64-1" + *is64bit = compiler.contains(QLatin1String("64")); + const int major = regexp.cap(2).toInt(); + const int minor = regexp.cap(3).toInt(); + const int patch = regexp.cap(4).toInt(); + return (major << 16) + (minor << 8) + patch; + } + *is64bit = false; + return 0; +} + +/*! + Run a process and return its standard output. +*/ + +QString Environment::readProcessStandardOutput(const QString &commandLine) +{ + QString stdOut; + TCHAR tempFileName[MAX_PATH]; + TCHAR tempPathBuffer[MAX_PATH]; + if (!GetTempPath(MAX_PATH, tempPathBuffer) + || !GetTempFileName(tempPathBuffer, TEXT("qtconfigure"), 0, tempFileName)) + return stdOut; + + STARTUPINFO startInfo; + memset(&startInfo, 0, sizeof(startInfo)); + startInfo.cb = sizeof(startInfo); + startInfo.dwFlags |= STARTF_USESTDHANDLES; + + SECURITY_ATTRIBUTES securityAttributes; + securityAttributes.nLength = sizeof(SECURITY_ATTRIBUTES); + securityAttributes.bInheritHandle = TRUE; + securityAttributes.lpSecurityDescriptor = NULL; + + startInfo.hStdOutput = CreateFile(tempFileName, GENERIC_WRITE, 0, &securityAttributes, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (startInfo.hStdOutput == INVALID_HANDLE_VALUE) + return stdOut; + + PROCESS_INFORMATION procInfo; + memset(&procInfo, 0, sizeof(procInfo)); + + if (!CreateProcess(0, (wchar_t*)commandLine.utf16(), + 0, 0, TRUE, + 0, + 0, 0, &startInfo, &procInfo)) { + CloseHandle(startInfo.hStdOutput); + DeleteFile(tempFileName); + return stdOut; + } + + WaitForSingleObject(procInfo.hProcess, INFINITE); + CloseHandle(procInfo.hThread); + CloseHandle(procInfo.hProcess); + CloseHandle(startInfo.hStdOutput); + QFile file(QString::fromWCharArray(tempFileName)); + + if (file.open(QIODevice::Text| QIODevice::ReadOnly)) { + stdOut = QString::fromLocal8Bit(file.readAll()); + file.close(); + } + DeleteFile(tempFileName); + return stdOut; +} + +/*! Creates a commandling from \a program and it \a arguments, escaping characters that needs it. */ diff --git a/tools/configure/environment.h b/tools/configure/environment.h index 9bbd096..81c232a 100644 --- a/tools/configure/environment.h +++ b/tools/configure/environment.h @@ -49,6 +49,7 @@ enum Compiler { CC_UNKNOWN = 0, CC_BORLAND = 0x01, CC_MINGW = 0x02, + CC_MINGW_44 = 0x21, CC_INTEL = 0x03, CC_NET2003 = 0x71, CC_NET2005 = 0x80, @@ -63,6 +64,8 @@ public: static Compiler detectCompiler(); static QString detectQMakeSpec(); static bool detectExecutable(const QString &executable); + static int detectGPlusPlusVersion(const QString &executable, bool *is64bit); + static QString readProcessStandardOutput(const QString &commandLine); static int execute(QStringList arguments, const QStringList &additionalEnv, const QStringList &removeEnv); static bool cpdir(const QString &srcDir, -- cgit v0.12 From 44b08536caa51700e6885bff90c2c3f9de699ad6 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 16 Nov 2011 14:40:43 +0100 Subject: Rebuild configure.exe with support for MinGW 4.6 See d4150975af620e2889cc58bd476bac6b4d101db3 --- configure.exe | Bin 1473536 -> 1498624 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index 9538a4b..5487fda 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12