/**************************************************************************** ** ** Copyright (C) 1992-$THISYEAR$ Trolltech AS. All rights reserved. ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** ** $LICENSE$ ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ****************************************************************************/ #include #if !defined(Q_CC_GNU) #pragma warning(disable : 4996) #endif #include "configutils.h" #include #include #include #include #include #include #ifdef Q_WS_WIN #include #endif static void dumpMessages() { qWarning( "%s", qPrintable(messages().join( QLatin1String("\n") )) ); } static void dumpMessagesStdout() { printf("%s\n", qPrintable(messages().join( QLatin1String("\n") )) ); } int main( int argc, char **argv ) { #ifndef QT_VERSION # define QT_VERSION 0x01 #endif #if QT_VERSION < 0x040001 printf("\nThis version of QSA requires Qt 4.0.1 or later, using: %x.%x.%x\n\n", (QT_VERSION>>16) & 0xff, (QT_VERSION>>8) & 0xff, QT_VERSION & 0xff); return 100; #endif QCoreApplication qapp( argc, argv ); QStringList antiConfigs; QStringList configs; bool buildIde = true; bool buildEditor = true; bool buildNewEditor = false; #if QT_VERSION >= 0x040100 int arg_count = qapp.arguments().size(); QStringList args = qapp.arguments(); #else int arg_count = qapp.argc(); QStringList args; for (int i=0; iisEmpty() ) { qWarning( "%s: QTDIR not set", qPrintable(args.at(0)) ); dumpMessages(); return 1; } *qtDir += QLatin1String("/"); if( !writeQSConfig( buildIde, buildEditor, buildNewEditor ) ) { dumpMessages(); return 1; } if (!writeExtraConfigs(configs)) { dumpMessages(); return 1; } if (!writeQsaPrfFile(buildIde || buildEditor)) { dumpMessages(); return 1; } runQMake( configs, antiConfigs, qsa_prefix ? *qsa_prefix : QString()); if( errors ) { message(QLatin1String("\nThere were errors during configure!")); dumpMessages(); } else if( warnings ) { if (qdoc_warning) { message(QLatin1String("\nFailed to install documentation")); } if (qmake_warning) { message(QLatin1String("\nFailed to run qmake on top level .pro file\n")); } message(QLatin1String("\nThere were errors during configure, but these" "\ndo not appear to be fatal, so you should still be" "\nable to build QSA." "\nRun your make tool to build QSA.")); dumpMessages(); } else { message(QLatin1String("\n" "Configuration completed successfully\n" "Run your make tool to build QSA")); dumpMessagesStdout(); } return errors; }