From 94fe8043579d398feddecae86c7359dfd300e25f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 20 Jul 2009 12:55:04 +0200 Subject: checksdk now uses the bootstrap lib The checksdk build was broken and it makes no sense to maintain two seperate bootstrap configurations. The checksdk sources had to be corrected in certain cases to work with the bootstrap lib. Esp. using qDebug for ouput message is not a good idea. Reviewed-by: thartman --- tools/checksdk/cesdkhandler.cpp | 7 ++++--- tools/checksdk/cesdkhandler.h | 4 ++-- tools/checksdk/checksdk.pro | 41 ++-------------------------------------- tools/checksdk/main.cpp | 42 +++++++++++++++++++++++------------------ 4 files changed, 32 insertions(+), 62 deletions(-) diff --git a/tools/checksdk/cesdkhandler.cpp b/tools/checksdk/cesdkhandler.cpp index 48452a3..677d003 100644 --- a/tools/checksdk/cesdkhandler.cpp +++ b/tools/checksdk/cesdkhandler.cpp @@ -71,15 +71,15 @@ bool CeSdkHandler::parse() // look at the file at %VCInstallDir%/vcpackages/WCE.VCPlatform.config // and scan through all installed sdks... m_list.clear(); - VCInstallDir = qgetenv("VCInstallDir"); + VCInstallDir = QString::fromLatin1(qgetenv("VCInstallDir")); VCInstallDir += QLatin1String("\\"); - VSInstallDir = qgetenv("VSInstallDir"); + VSInstallDir = QString::fromLatin1(qgetenv("VSInstallDir")); VSInstallDir += QLatin1String("\\"); if (VCInstallDir.isEmpty() || VSInstallDir.isEmpty()) return false; QDir vStudioDir(VCInstallDir); - if (!vStudioDir.cd("vcpackages")) + if (!vStudioDir.cd(QLatin1String("vcpackages"))) return false; QFile configFile(vStudioDir.absoluteFilePath(QLatin1String("WCE.VCPlatform.config"))); @@ -118,6 +118,7 @@ bool CeSdkHandler::parse() qWarning() << "XML ERROR:" << xml.lineNumber() << ": " << xml.errorString(); return false; } + return m_list.size() > 0 ? true : false; } diff --git a/tools/checksdk/cesdkhandler.h b/tools/checksdk/cesdkhandler.h index 04d3bdf..6ec26db 100644 --- a/tools/checksdk/cesdkhandler.h +++ b/tools/checksdk/cesdkhandler.h @@ -102,8 +102,8 @@ inline QList CeSdkHandler::listAll() const inline QString CeSdkHandler::fixPaths(QString path) const { - QString str = QDir::toNativeSeparators(QDir::cleanPath(path.replace(VCINSTALL_MACRO, VCInstallDir).replace(VSINSTALL_MACRO, VSInstallDir).replace(QLatin1String("$(PATH)"), QLatin1String("%PATH%")))); - if (str.endsWith(';')) + QString str = QDir::toNativeSeparators(QDir::cleanPath(path.replace(QLatin1String(VCINSTALL_MACRO), VCInstallDir).replace(QLatin1String(VSINSTALL_MACRO), VSInstallDir).replace(QLatin1String("$(PATH)"), QLatin1String("%PATH%")))); + if (str.endsWith(QLatin1Char(';'))) str.truncate(str.length() - 1); return str; } diff --git a/tools/checksdk/checksdk.pro b/tools/checksdk/checksdk.pro index 3aa72d7..a513981 100644 --- a/tools/checksdk/checksdk.pro +++ b/tools/checksdk/checksdk.pro @@ -32,42 +32,5 @@ SOURCES += \ HEADERS += \ cesdkhandler.h -# Bootstrapped Input -SOURCES += \ - $$QT_SOURCE_TREE/src/corelib/kernel/qmetatype.cpp \ - $$QT_SOURCE_TREE/src/corelib/kernel/qvariant.cpp \ - $$QT_SOURCE_TREE/src/corelib/codecs/qutfcodec.cpp \ - $$QT_SOURCE_TREE/src/corelib/codecs/qtextcodec.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qstring.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qstringlist.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfile.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qdir.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfsfileengine.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qabstractfileengine.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfsfileengine_win.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfsfileengine_iterator.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfsfileengine_iterator_win.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qfileinfo.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qtemporaryfile.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qdiriterator.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qiodevice.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qbuffer.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qtextstream.cpp \ - $$QT_SOURCE_TREE/src/corelib/io/qurl.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qdatetime.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qlocale.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qbytearray.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qbytearraymatcher.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qvector.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qvsnprintf.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qlistdata.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qhash.cpp \ - $$QT_SOURCE_TREE/src/corelib/global/qglobal.cpp \ - $$QT_SOURCE_TREE/src/corelib/global/qmalloc.cpp \ - $$QT_SOURCE_TREE/src/corelib/global/qnumeric.cpp \ - $$QT_SOURCE_TREE/src/corelib/xml/qxmlstream.cpp \ - $$QT_SOURCE_TREE/src/corelib/xml/qxmlutils.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qregexp.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qmap.cpp \ - $$QT_SOURCE_TREE/src/corelib/tools/qbitarray.cpp \ - $$QT_BUILD_TREE/src/corelib/global/qconfig.cpp +include(../../src/tools/bootstrap/bootstrap.pri) + diff --git a/tools/checksdk/main.cpp b/tools/checksdk/main.cpp index 2dd7214..6322eb7 100644 --- a/tools/checksdk/main.cpp +++ b/tools/checksdk/main.cpp @@ -46,17 +46,17 @@ void usage() { - qDebug() << "SDK Scanner - Convenience Tool to setup your environment"; - qDebug() << " for crosscompilation to Windows CE"; - qDebug() << "Options:"; - qDebug() << "-help This output"; - qDebug() << "-list List all available SDKs"; - qDebug() << "-sdk Select specified SDK."; - qDebug() << " Note: SDK names with spaces need to be"; - qDebug() << " specified in parenthesis"; - qDebug() << " default: Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"; - qDebug() << "-script Create a script file which can be launched"; - qDebug() << " to setup your environment for specified SDK"; + printf("SDK Scanner - Convenience Tool to setup your environment\n"); + printf(" for crosscompilation to Windows CE\n"); + printf("Options:\n"); + printf("-help This output\n"); + printf("-list List all available SDKs\n"); + printf("-sdk Select specified SDK.\n"); + printf(" Note: SDK names with spaces need to be\n"); + printf(" specified in parenthesis\n"); + printf(" default: Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\n"); + printf("-script Create a script file which can be launched\n"); + printf(" to setup your environment for specified SDK\n"); } int main(int argc, char **argv) @@ -106,9 +106,12 @@ int main(int argc, char **argv) QList list = handler.listAll(); if (operationList) { - qDebug() << "Available SDKs:"; - for (QList::iterator it = list.begin(); it != list.end(); ++it) - qDebug() << "SDK Name:" << it->name(); + printf("Available SDKs:\n"); + for (QList::iterator it = list.begin(); it != list.end(); ++it) { + printf("SDK Name: "); + printf(qPrintable(it->name())); + printf("\n"); + } return 0; } @@ -132,10 +135,13 @@ int main(int argc, char **argv) includePath = QString::fromLatin1("INCLUDE=") + it->includePath(); libPath = QString::fromLatin1("LIB=") + it->libPath(); if (scriptFile.isEmpty()) { - qDebug() << "Please set up your environment with the following paths:"; - qDebug() << qPrintable(binPath); - qDebug() << qPrintable(includePath); - qDebug() << qPrintable(libPath); + printf("Please set up your environment with the following paths:\n"); + printf(qPrintable(binPath)); + printf("\n"); + printf(qPrintable(includePath)); + printf("\n"); + printf(qPrintable(libPath)); + printf("\n"); return 0; } else { QFile file(scriptFile); -- cgit v0.12