2011-04-27 10:05:43 +00:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
2016-01-15 12:36:27 +00:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-04-27 10:05:43 +00:00
|
|
|
**
|
|
|
|
** This file is part of the tools applications of the Qt Toolkit.
|
|
|
|
**
|
2016-01-15 12:36:27 +00:00
|
|
|
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
|
2012-09-19 12:28:29 +00:00
|
|
|
** 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
|
2015-01-28 08:44:43 +00:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
2016-01-15 12:36:27 +00:00
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2012-09-19 12:28:29 +00:00
|
|
|
**
|
2016-01-15 12:36:27 +00:00
|
|
|
** GNU General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2011-04-27 10:05:43 +00:00
|
|
|
**
|
|
|
|
** $QT_END_LICENSE$
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <qmap.h>
|
|
|
|
#include <qstring.h>
|
|
|
|
#include <qstringlist.h>
|
|
|
|
#include <qlist.h>
|
2013-07-15 14:45:44 +00:00
|
|
|
#include <qbuffer.h>
|
2011-04-27 10:05:43 +00:00
|
|
|
#include <qtextstream.h>
|
|
|
|
#include <qdir.h>
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
|
|
|
class Configure
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Configure( int& argc, char** argv );
|
|
|
|
~Configure();
|
|
|
|
|
|
|
|
void parseCmdLine();
|
|
|
|
|
2012-06-14 14:17:11 +00:00
|
|
|
void generateQConfigCpp();
|
|
|
|
void buildQmake();
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2016-08-14 07:48:55 +00:00
|
|
|
void prepareConfigureInput();
|
|
|
|
void configure();
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
void generateHeaders();
|
2013-08-09 12:10:15 +00:00
|
|
|
void generateQDevicePri();
|
2013-05-17 15:53:03 +00:00
|
|
|
void prepareConfigTests();
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
bool showLicense(QString licenseFile);
|
|
|
|
void readLicense();
|
|
|
|
|
|
|
|
bool isDone();
|
|
|
|
bool isOk();
|
2012-06-08 13:20:35 +00:00
|
|
|
|
|
|
|
int platform() const;
|
|
|
|
QString platformName() const;
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
private:
|
2015-10-01 14:39:57 +00:00
|
|
|
int verbose;
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Our variable dictionaries
|
|
|
|
QMap<QString,QString> dictionary;
|
|
|
|
QStringList configCmdLine;
|
|
|
|
|
|
|
|
QString outputLine;
|
|
|
|
|
|
|
|
QTextStream outStream;
|
|
|
|
QString sourcePath, buildPath;
|
2016-08-23 18:03:50 +00:00
|
|
|
QString sourcePathMangled, buildPathMangled;
|
2011-04-27 10:05:43 +00:00
|
|
|
QDir sourceDir, buildDir;
|
|
|
|
|
2014-12-04 15:03:13 +00:00
|
|
|
QString confStrOffsets[2];
|
|
|
|
QString confStrings[2];
|
|
|
|
int confStringOff;
|
2013-08-09 11:34:04 +00:00
|
|
|
|
2014-12-04 15:03:13 +00:00
|
|
|
void addConfStr(int group, const QString &val);
|
2012-03-28 14:00:06 +00:00
|
|
|
QString formatPath(const QString &path);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2016-08-24 12:24:15 +00:00
|
|
|
bool reloadCmdLine(int idx);
|
2011-04-27 10:05:43 +00:00
|
|
|
void saveCmdLine();
|
|
|
|
|
|
|
|
void applySpecSpecifics();
|
2015-02-05 14:45:53 +00:00
|
|
|
|
|
|
|
QString formatConfigPath(const char *var);
|
2011-04-27 10:05:43 +00:00
|
|
|
};
|
|
|
|
|
2013-07-15 14:45:44 +00:00
|
|
|
class FileWriter : public QTextStream
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FileWriter(const QString &name);
|
|
|
|
bool flush();
|
|
|
|
private:
|
|
|
|
QString m_name;
|
|
|
|
QBuffer m_buffer;
|
|
|
|
};
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
QT_END_NAMESPACE
|