2011-04-27 10:05:43 +00:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
2016-01-15 12:36:27 +00:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
2016-01-21 01:24:57 +00:00
|
|
|
** Copyright (C) 2016 Intel Corporation.
|
2016-01-15 12:36:27 +00:00
|
|
|
** 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 "configureapp.h"
|
|
|
|
#include "environment.h"
|
2015-05-22 13:38:00 +00:00
|
|
|
#include "tools.h"
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#include <qdir.h>
|
2012-05-02 09:42:20 +00:00
|
|
|
#include <qdiriterator.h>
|
2011-04-27 10:05:43 +00:00
|
|
|
#include <qtemporaryfile.h>
|
2012-11-01 13:31:16 +00:00
|
|
|
#include <qstandardpaths.h>
|
2011-04-27 10:05:43 +00:00
|
|
|
#include <qstack.h>
|
|
|
|
#include <qdebug.h>
|
|
|
|
#include <qfileinfo.h>
|
|
|
|
#include <qtextstream.h>
|
|
|
|
#include <qregexp.h>
|
|
|
|
#include <qhash.h>
|
|
|
|
|
|
|
|
#include <iostream>
|
2012-05-18 05:23:50 +00:00
|
|
|
#include <string>
|
|
|
|
#include <fstream>
|
2011-04-27 10:05:43 +00:00
|
|
|
#include <windows.h>
|
|
|
|
#include <conio.h>
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
2012-06-08 13:20:35 +00:00
|
|
|
enum Platforms {
|
|
|
|
WINDOWS,
|
2013-09-02 08:55:55 +00:00
|
|
|
WINDOWS_RT,
|
2012-06-08 13:20:35 +00:00
|
|
|
QNX,
|
2015-01-19 10:49:06 +00:00
|
|
|
ANDROID,
|
|
|
|
OTHER
|
2012-06-08 13:20:35 +00:00
|
|
|
};
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
std::ostream &operator<<(std::ostream &s, const QString &val) {
|
|
|
|
s << val.toLocal8Bit().data();
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
// Macros to simplify options marking
|
|
|
|
#define MARK_OPTION(x,y) ( dictionary[ #x ] == #y ? "*" : " " )
|
|
|
|
|
2012-11-01 11:53:24 +00:00
|
|
|
static inline void promptKeyPress()
|
|
|
|
{
|
|
|
|
cout << "(Press any key to continue...)";
|
|
|
|
if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
|
|
|
|
exit(0); // Exit cleanly for Ctrl+C
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2015-10-01 14:39:57 +00:00
|
|
|
Configure::Configure(int& argc, char** argv) : verbose(0)
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
|
|
|
// Default values for indentation
|
|
|
|
optionIndent = 4;
|
|
|
|
descIndent = 25;
|
|
|
|
outputWidth = 0;
|
|
|
|
// Get console buffer output width
|
|
|
|
CONSOLE_SCREEN_BUFFER_INFO info;
|
|
|
|
HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
|
|
if (GetConsoleScreenBufferInfo(hStdout, &info))
|
|
|
|
outputWidth = info.dwSize.X - 1;
|
|
|
|
outputWidth = qMin(outputWidth, 79); // Anything wider gets unreadable
|
|
|
|
if (outputWidth < 35) // Insanely small, just use 79
|
|
|
|
outputWidth = 79;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 1; i < argc; i++)
|
|
|
|
configCmdLine += argv[ i ];
|
|
|
|
|
2012-02-08 10:38:07 +00:00
|
|
|
if (configCmdLine.size() >= 2 && configCmdLine.at(0) == "-srcdir") {
|
|
|
|
sourcePath = QDir::cleanPath(configCmdLine.at(1));
|
|
|
|
sourceDir = QDir(sourcePath);
|
|
|
|
configCmdLine.erase(configCmdLine.begin(), configCmdLine.begin() + 2);
|
|
|
|
} else {
|
|
|
|
// Get the path to the executable
|
|
|
|
wchar_t module_name[MAX_PATH];
|
|
|
|
GetModuleFileName(0, module_name, sizeof(module_name) / sizeof(wchar_t));
|
|
|
|
QFileInfo sourcePathInfo = QString::fromWCharArray(module_name);
|
|
|
|
sourcePath = sourcePathInfo.absolutePath();
|
|
|
|
sourceDir = sourcePathInfo.dir();
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
buildPath = QDir::currentPath();
|
|
|
|
#if 0
|
|
|
|
const QString installPath = QString("C:\\Qt\\%1").arg(QT_VERSION_STR);
|
|
|
|
#else
|
|
|
|
const QString installPath = buildPath;
|
|
|
|
#endif
|
|
|
|
if (sourceDir != buildDir) { //shadow builds!
|
|
|
|
QDir(buildPath).mkpath("bin");
|
|
|
|
|
|
|
|
buildDir.mkpath("mkspecs");
|
|
|
|
}
|
|
|
|
|
2012-07-09 22:58:19 +00:00
|
|
|
defaultBuildParts << QStringLiteral("libs") << QStringLiteral("tools") << QStringLiteral("examples");
|
2013-06-17 09:21:40 +00:00
|
|
|
allBuildParts = defaultBuildParts;
|
|
|
|
allBuildParts << QStringLiteral("tests");
|
2012-03-28 14:00:06 +00:00
|
|
|
dictionary[ "QT_INSTALL_PREFIX" ] = installPath;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
dictionary[ "QMAKESPEC" ] = getenv("QMAKESPEC");
|
|
|
|
if (dictionary[ "QMAKESPEC" ].size() == 0) {
|
|
|
|
dictionary[ "QMAKESPEC" ] = Environment::detectQMakeSpec();
|
|
|
|
dictionary[ "QMAKESPEC_FROM" ] = "detected";
|
|
|
|
} else {
|
|
|
|
dictionary[ "QMAKESPEC_FROM" ] = "env";
|
|
|
|
}
|
|
|
|
|
2012-03-07 00:11:44 +00:00
|
|
|
dictionary[ "WIDGETS" ] = "yes";
|
2013-04-18 20:34:46 +00:00
|
|
|
dictionary[ "GUI" ] = "yes";
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "RTTI" ] = "yes";
|
2012-09-14 14:04:59 +00:00
|
|
|
dictionary[ "STRIP" ] = "yes";
|
2016-03-18 15:32:13 +00:00
|
|
|
dictionary[ "PCH" ] = "yes";
|
2014-04-09 08:17:20 +00:00
|
|
|
dictionary[ "SEPARATE_DEBUG_INFO" ] = "no";
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "SSE2" ] = "auto";
|
2011-12-30 00:44:16 +00:00
|
|
|
dictionary[ "SSE3" ] = "auto";
|
|
|
|
dictionary[ "SSSE3" ] = "auto";
|
|
|
|
dictionary[ "SSE4_1" ] = "auto";
|
|
|
|
dictionary[ "SSE4_2" ] = "auto";
|
|
|
|
dictionary[ "AVX" ] = "auto";
|
|
|
|
dictionary[ "AVX2" ] = "auto";
|
2015-07-17 21:46:05 +00:00
|
|
|
dictionary[ "AVX512" ] = "auto";
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "SYNCQT" ] = "auto";
|
2015-10-23 11:45:23 +00:00
|
|
|
dictionary[ "WMF_BACKEND" ] = "no";
|
2012-03-30 11:43:10 +00:00
|
|
|
dictionary[ "QML_DEBUG" ] = "yes";
|
2013-11-22 17:36:25 +00:00
|
|
|
dictionary[ "PLUGIN_MANIFESTS" ] = "no";
|
2015-06-15 12:09:19 +00:00
|
|
|
dictionary[ "DIRECTWRITE" ] = "auto";
|
Add color font support on Windows
Detect if DirectWrite 2 is available, and support color fonts if possible.
One limitation worth mentioning is that if the color font contains regular,
monochrome glyphs as well, then these will be drawn in black, and not in the
pen color. Fixing this would require some elaborate rewrites in the font
rendering system, since we would have to have two font caches per
color font (one for mono and one for colors), or do some sort of trick where
we make argb(r, g, b, 0) mean subpixel alpha instead, and detect glyphs that
are not correctly premultiplied when blitting to the screen.
Another limitation is that the approach does not work with distance field
rendering. In principle we could support this on Windows, since the
format is vector based, but it would also require substantial work and
it is not possible to support for Apple/Google fonts anyway, so it would
just lead to code which is not cross-platform.
[ChangeLog][Windows] Added support for color fonts (color emojis) when
DirectWrite 2 is available.
Change-Id: I6a608dd5d2aa3a7e762a06830902bddac7c550a5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-12-16 14:52:28 +00:00
|
|
|
dictionary[ "DIRECTWRITE2" ] = "auto";
|
2013-12-04 11:40:23 +00:00
|
|
|
dictionary[ "DIRECT2D" ] = "no";
|
2012-06-20 14:00:34 +00:00
|
|
|
dictionary[ "NIS" ] = "no";
|
2013-11-11 15:48:33 +00:00
|
|
|
dictionary[ "NEON" ] = "auto";
|
2012-06-21 20:33:07 +00:00
|
|
|
dictionary[ "LARGE_FILE" ] = "yes";
|
2012-06-20 14:00:34 +00:00
|
|
|
dictionary[ "FONT_CONFIG" ] = "no";
|
|
|
|
dictionary[ "POSIX_IPC" ] = "no";
|
|
|
|
dictionary[ "QT_GLIB" ] = "no";
|
2012-07-18 12:06:42 +00:00
|
|
|
dictionary[ "QT_ICONV" ] = "auto";
|
2014-04-02 09:54:36 +00:00
|
|
|
dictionary[ "QT_EVDEV" ] = "auto";
|
2014-04-07 08:38:26 +00:00
|
|
|
dictionary[ "QT_MTDEV" ] = "auto";
|
2015-03-12 13:18:26 +00:00
|
|
|
dictionary[ "QT_TSLIB" ] = "auto";
|
2012-11-14 16:33:16 +00:00
|
|
|
dictionary[ "QT_INOTIFY" ] = "auto";
|
2013-05-07 21:40:38 +00:00
|
|
|
dictionary[ "QT_EVENTFD" ] = "auto";
|
2012-07-18 13:37:21 +00:00
|
|
|
dictionary[ "QT_CUPS" ] = "auto";
|
2012-07-12 11:03:16 +00:00
|
|
|
dictionary[ "CFG_GCC_SYSROOT" ] = "yes";
|
2012-09-18 18:15:18 +00:00
|
|
|
dictionary[ "SLOG2" ] = "no";
|
2013-10-16 15:38:32 +00:00
|
|
|
dictionary[ "QNX_IMF" ] = "no";
|
2013-11-21 11:58:22 +00:00
|
|
|
dictionary[ "PPS" ] = "no";
|
2014-01-29 12:43:03 +00:00
|
|
|
dictionary[ "LGMON" ] = "no";
|
2016-05-13 09:05:09 +00:00
|
|
|
dictionary[ "SYSTEM_PROXIES" ] = "yes";
|
2014-09-24 14:31:33 +00:00
|
|
|
dictionary[ "SCTP" ] = "no";
|
2012-12-22 02:31:54 +00:00
|
|
|
dictionary[ "WERROR" ] = "auto";
|
2013-10-01 10:34:20 +00:00
|
|
|
dictionary[ "QREAL" ] = "double";
|
2015-09-08 23:35:33 +00:00
|
|
|
dictionary[ "ATOMIC64" ] = "auto";
|
2012-06-20 14:00:34 +00:00
|
|
|
|
|
|
|
//Only used when cross compiling.
|
|
|
|
dictionary[ "QT_INSTALL_SETTINGS" ] = "/etc/xdg";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
QString version;
|
2015-09-18 01:17:40 +00:00
|
|
|
QFile qmake_conf(sourcePath + "/.qmake.conf");
|
|
|
|
if (qmake_conf.open(QFile::ReadOnly)) {
|
|
|
|
while (!qmake_conf.atEnd()) {
|
|
|
|
static const char beginning[] = "MODULE_VERSION = ";
|
|
|
|
QByteArray line = qmake_conf.readLine();
|
|
|
|
if (!line.startsWith(beginning))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
version = qMove(line).mid(int(strlen(beginning))).trimmed();
|
|
|
|
break;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2015-09-18 01:17:40 +00:00
|
|
|
qmake_conf.close();
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (version.isEmpty())
|
|
|
|
version = QString("%1.%2.%3").arg(QT_VERSION>>16).arg(((QT_VERSION>>8)&0xff)).arg(QT_VERSION&0xff);
|
|
|
|
|
|
|
|
dictionary[ "VERSION" ] = version;
|
|
|
|
{
|
|
|
|
QRegExp version_re("([0-9]*)\\.([0-9]*)\\.([0-9]*)(|-.*)");
|
|
|
|
if (version_re.exactMatch(version)) {
|
|
|
|
dictionary[ "VERSION_MAJOR" ] = version_re.cap(1);
|
|
|
|
dictionary[ "VERSION_MINOR" ] = version_re.cap(2);
|
|
|
|
dictionary[ "VERSION_PATCH" ] = version_re.cap(3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dictionary[ "REDO" ] = "no";
|
|
|
|
|
|
|
|
dictionary[ "BUILD" ] = "debug";
|
|
|
|
dictionary[ "BUILDALL" ] = "auto"; // Means yes, but not explicitly
|
2012-08-07 20:22:38 +00:00
|
|
|
dictionary[ "FORCEDEBUGINFO" ] = "no";
|
2016-03-18 15:27:51 +00:00
|
|
|
dictionary[ "RELEASE_TOOLS" ] = "no";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
dictionary[ "BUILDTYPE" ] = "none";
|
|
|
|
|
|
|
|
dictionary[ "BUILDDEV" ] = "no";
|
|
|
|
|
2013-07-17 12:34:10 +00:00
|
|
|
dictionary[ "COMPILE_EXAMPLES" ] = "yes";
|
2013-05-07 15:10:22 +00:00
|
|
|
|
2015-07-09 00:21:30 +00:00
|
|
|
dictionary[ "C++STD" ] = "auto";
|
2012-09-05 08:31:49 +00:00
|
|
|
|
2014-07-01 09:46:50 +00:00
|
|
|
dictionary[ "USE_GOLD_LINKER" ] = "no";
|
|
|
|
|
2015-04-22 11:09:36 +00:00
|
|
|
dictionary[ "ENABLE_NEW_DTAGS" ] = "no";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "SHARED" ] = "yes";
|
|
|
|
|
2015-02-20 10:07:09 +00:00
|
|
|
dictionary[ "STATIC_RUNTIME" ] = "no";
|
|
|
|
|
2016-02-19 14:18:47 +00:00
|
|
|
dictionary[ "SYSTEM_ZLIB" ] = "auto";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2012-01-23 22:31:13 +00:00
|
|
|
dictionary[ "PCRE" ] = "auto";
|
|
|
|
|
2014-04-10 10:34:42 +00:00
|
|
|
dictionary[ "ICU" ] = "no";
|
2012-03-08 02:51:27 +00:00
|
|
|
|
2012-10-15 12:16:51 +00:00
|
|
|
dictionary[ "ANGLE" ] = "auto";
|
2016-07-07 14:36:26 +00:00
|
|
|
dictionary[ "DYNAMICGL" ] = "no";
|
2012-10-15 12:16:51 +00:00
|
|
|
|
2016-04-06 08:15:14 +00:00
|
|
|
dictionary[ "GIF" ] = "yes";
|
|
|
|
dictionary[ "JPEG" ] = "yes";
|
|
|
|
dictionary[ "PNG" ] = "yes";
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "LIBJPEG" ] = "auto";
|
|
|
|
dictionary[ "LIBPNG" ] = "auto";
|
2015-10-15 13:40:26 +00:00
|
|
|
dictionary[ "DOUBLECONVERSION" ] = "auto";
|
2011-10-07 08:00:04 +00:00
|
|
|
dictionary[ "FREETYPE" ] = "yes";
|
2016-03-18 15:44:41 +00:00
|
|
|
dictionary[ "FREETYPE_FROM" ] = "default";
|
2014-07-08 16:49:18 +00:00
|
|
|
dictionary[ "HARFBUZZ" ] = "qt";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
dictionary[ "ACCESSIBILITY" ] = "yes";
|
|
|
|
dictionary[ "OPENGL" ] = "yes";
|
2012-10-15 12:16:51 +00:00
|
|
|
dictionary[ "OPENGL_ES_2" ] = "yes";
|
2014-08-12 17:04:05 +00:00
|
|
|
dictionary[ "SSL" ] = "auto";
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "OPENSSL" ] = "auto";
|
2016-05-27 08:14:29 +00:00
|
|
|
dictionary[ "LIBPROXY" ] = "no";
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "DBUS" ] = "auto";
|
|
|
|
|
|
|
|
dictionary[ "STYLE_WINDOWS" ] = "yes";
|
|
|
|
dictionary[ "STYLE_WINDOWSXP" ] = "auto";
|
|
|
|
dictionary[ "STYLE_WINDOWSVISTA" ] = "auto";
|
2012-09-21 17:53:28 +00:00
|
|
|
dictionary[ "STYLE_FUSION" ] = "yes";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
dictionary[ "SQL_MYSQL" ] = "no";
|
|
|
|
dictionary[ "SQL_ODBC" ] = "no";
|
|
|
|
dictionary[ "SQL_OCI" ] = "no";
|
|
|
|
dictionary[ "SQL_PSQL" ] = "no";
|
|
|
|
dictionary[ "SQL_TDS" ] = "no";
|
|
|
|
dictionary[ "SQL_DB2" ] = "no";
|
|
|
|
dictionary[ "SQL_SQLITE" ] = "auto";
|
|
|
|
dictionary[ "SQL_SQLITE_LIB" ] = "qt";
|
|
|
|
dictionary[ "SQL_SQLITE2" ] = "no";
|
|
|
|
dictionary[ "SQL_IBASE" ] = "no";
|
|
|
|
|
|
|
|
QString tmp = dictionary[ "QMAKESPEC" ];
|
|
|
|
if (tmp.contains("\\")) {
|
|
|
|
tmp = tmp.mid(tmp.lastIndexOf("\\") + 1);
|
|
|
|
} else {
|
|
|
|
tmp = tmp.mid(tmp.lastIndexOf("/") + 1);
|
|
|
|
}
|
|
|
|
dictionary[ "QMAKESPEC" ] = tmp;
|
|
|
|
|
|
|
|
dictionary[ "INCREDIBUILD_XGE" ] = "auto";
|
|
|
|
dictionary[ "LTCG" ] = "no";
|
|
|
|
dictionary[ "MSVC_MP" ] = "no";
|
2015-03-04 11:58:28 +00:00
|
|
|
|
2015-09-22 21:58:05 +00:00
|
|
|
if (dictionary["QMAKESPEC"].startsWith("win32-g++")) {
|
2015-03-04 11:58:28 +00:00
|
|
|
const QString zero = QStringLiteral("0");
|
|
|
|
const QStringList parts = Environment::gccVersion().split(QLatin1Char('.'));
|
|
|
|
dictionary["QT_GCC_MAJOR_VERSION"] = parts.value(0, zero);
|
|
|
|
dictionary["QT_GCC_MINOR_VERSION"] = parts.value(1, zero);
|
|
|
|
dictionary["QT_GCC_PATCH_VERSION"] = parts.value(2, zero);
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Configure::~Configure()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-03-28 14:00:06 +00:00
|
|
|
QString Configure::formatPath(const QString &path)
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
2012-03-28 14:00:06 +00:00
|
|
|
QString ret = QDir::cleanPath(path);
|
2012-06-25 15:18:37 +00:00
|
|
|
// This amount of quoting is deemed sufficient.
|
2012-03-28 14:00:06 +00:00
|
|
|
if (ret.contains(QLatin1Char(' '))) {
|
|
|
|
ret.prepend(QLatin1Char('"'));
|
|
|
|
ret.append(QLatin1Char('"'));
|
|
|
|
}
|
|
|
|
return ret;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
2012-03-28 14:00:06 +00:00
|
|
|
QString Configure::formatPaths(const QStringList &paths)
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
2012-03-28 14:00:06 +00:00
|
|
|
QString ret;
|
|
|
|
foreach (const QString &path, paths) {
|
|
|
|
if (!ret.isEmpty())
|
|
|
|
ret += QLatin1Char(' ');
|
|
|
|
ret += formatPath(path);
|
|
|
|
}
|
|
|
|
return ret;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// #### somehow I get a compiler error about vc++ reaching the nesting limit without
|
|
|
|
// undefining the ansi for scoping.
|
|
|
|
#ifdef for
|
|
|
|
#undef for
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void Configure::parseCmdLine()
|
|
|
|
{
|
2013-06-18 13:11:11 +00:00
|
|
|
if (configCmdLine.size() && configCmdLine.at(0) == "-top-level") {
|
|
|
|
dictionary[ "TOPLEVEL" ] = "yes";
|
|
|
|
configCmdLine.removeAt(0);
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
int argCount = configCmdLine.size();
|
|
|
|
int i = 0;
|
|
|
|
|
2016-07-06 10:47:12 +00:00
|
|
|
// Look first for -redo
|
|
|
|
for (int k = 0 ; k < argCount; ++k) {
|
|
|
|
if (configCmdLine.at(k) == "-redo") {
|
|
|
|
dictionary["REDO"] = "yes";
|
|
|
|
configCmdLine.removeAt(k);
|
|
|
|
reloadCmdLine(k);
|
|
|
|
argCount = configCmdLine.size();
|
|
|
|
break;
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2015-10-01 14:39:57 +00:00
|
|
|
|
2016-07-06 10:47:12 +00:00
|
|
|
// Then look for XQMAKESPEC
|
2012-10-17 20:06:41 +00:00
|
|
|
bool isDeviceMkspec = false;
|
2011-04-27 10:05:43 +00:00
|
|
|
for (int j = 0 ; j < argCount; ++j)
|
|
|
|
{
|
2012-10-17 20:06:41 +00:00
|
|
|
if ((configCmdLine.at(j) == "-xplatform") || (configCmdLine.at(j) == "-device")) {
|
|
|
|
isDeviceMkspec = (configCmdLine.at(j) == "-device");
|
2011-04-27 10:05:43 +00:00
|
|
|
++j;
|
|
|
|
if (j == argCount)
|
|
|
|
break;
|
|
|
|
dictionary["XQMAKESPEC"] = configCmdLine.at(j);
|
2013-01-31 10:25:20 +00:00
|
|
|
applySpecSpecifics();
|
2012-10-17 20:06:41 +00:00
|
|
|
break;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (; i<configCmdLine.size(); ++i) {
|
|
|
|
bool continueElse[] = {false, false};
|
|
|
|
|
2016-08-01 10:40:03 +00:00
|
|
|
if (configCmdLine.at(i) == "-v" || configCmdLine.at(i) == "-verbose") {
|
2015-10-01 14:39:57 +00:00
|
|
|
++verbose;
|
|
|
|
}
|
|
|
|
|
2013-10-01 10:34:20 +00:00
|
|
|
else if (configCmdLine.at(i) == "-qreal") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
2014-06-13 22:12:28 +00:00
|
|
|
QString s = dictionary[ "QREAL" ] = configCmdLine.at(i);
|
|
|
|
if (s == "float") {
|
|
|
|
dictionary[ "QREAL_STRING" ] = "\"float\"";
|
|
|
|
} else {
|
|
|
|
// escape
|
|
|
|
s = s.simplified();
|
|
|
|
s = '"' + s.toLatin1().toPercentEncoding(QByteArray(), "-._~", '_') + '"';
|
|
|
|
dictionary[ "QREAL_STRING" ] = s;
|
|
|
|
}
|
2013-10-01 10:34:20 +00:00
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-release") {
|
|
|
|
dictionary[ "BUILD" ] = "release";
|
|
|
|
if (dictionary[ "BUILDALL" ] == "auto")
|
|
|
|
dictionary[ "BUILDALL" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-debug") {
|
|
|
|
dictionary[ "BUILD" ] = "debug";
|
|
|
|
if (dictionary[ "BUILDALL" ] == "auto")
|
|
|
|
dictionary[ "BUILDALL" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-debug-and-release")
|
|
|
|
dictionary[ "BUILDALL" ] = "yes";
|
2012-08-07 20:22:38 +00:00
|
|
|
else if (configCmdLine.at(i) == "-force-debug-info")
|
|
|
|
dictionary[ "FORCEDEBUGINFO" ] = "yes";
|
2014-04-09 08:17:20 +00:00
|
|
|
else if (configCmdLine.at(i) == "-no-separate-debug-info")
|
|
|
|
dictionary[ "SEPARATE_DEBUG_INFO" ] = "no";
|
|
|
|
else if (configCmdLine.at(i) == "-separate-debug-info")
|
|
|
|
dictionary[ "SEPARATE_DEBUG_INFO" ] = "yes";
|
2015-10-26 11:38:50 +00:00
|
|
|
else if (configCmdLine.at(i) == "-optimized-tools")
|
|
|
|
dictionary[ "RELEASE_TOOLS" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-optimized-tools")
|
|
|
|
dictionary[ "RELEASE_TOOLS" ] = "no";
|
2013-05-07 15:10:22 +00:00
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-compile-examples") {
|
|
|
|
dictionary[ "COMPILE_EXAMPLES" ] = "yes";
|
|
|
|
} else if (configCmdLine.at(i) == "-no-compile-examples") {
|
|
|
|
dictionary[ "COMPILE_EXAMPLES" ] = "no";
|
|
|
|
}
|
|
|
|
|
2015-07-09 00:21:30 +00:00
|
|
|
else if (configCmdLine.at(i) == "-c++std") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
|
|
|
|
QString level = configCmdLine.at(i);
|
2015-07-09 23:33:33 +00:00
|
|
|
if (level == "c++11" || level == "c++14" || level == "c++1z"
|
2015-07-09 00:21:30 +00:00
|
|
|
|| level == "auto") {
|
|
|
|
dictionary[ "C++STD" ] = level;
|
2015-07-09 23:33:33 +00:00
|
|
|
} else if (level == "11" || level == "14" || level == "1z") {
|
2015-07-09 00:21:30 +00:00
|
|
|
dictionary[ "C++STD" ] = "c++" + level;
|
|
|
|
} else {
|
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
cout << "ERROR: invalid C++ standard " << level
|
2015-07-09 23:33:33 +00:00
|
|
|
<< "; valid options are: c++11 c++14 c++1z auto" << endl;
|
2015-07-09 00:21:30 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-01 09:46:50 +00:00
|
|
|
else if (configCmdLine.at(i) == "-use-gold-linker")
|
|
|
|
dictionary[ "USE_GOLD_LINKER" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-use-gold-linker")
|
|
|
|
dictionary[ "USE_GOLD_LINKER" ] = "no";
|
2015-04-22 11:09:36 +00:00
|
|
|
else if (configCmdLine.at(i) == "-enable-new-dtags")
|
|
|
|
dictionary[ "ENABLE_NEW_DTAGS" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-disable-new-dtags")
|
|
|
|
dictionary[ "ENABLE_NEW_DTAGS" ] = "no";
|
2011-04-27 10:05:43 +00:00
|
|
|
else if (configCmdLine.at(i) == "-shared")
|
|
|
|
dictionary[ "SHARED" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-static")
|
|
|
|
dictionary[ "SHARED" ] = "no";
|
2015-02-20 10:07:09 +00:00
|
|
|
else if (configCmdLine.at(i) == "-static-runtime")
|
|
|
|
dictionary[ "STATIC_RUNTIME" ] = "yes";
|
2011-04-27 10:05:43 +00:00
|
|
|
else if (configCmdLine.at(i) == "-developer-build")
|
|
|
|
dictionary[ "BUILDDEV" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-opensource") {
|
|
|
|
dictionary[ "BUILDTYPE" ] = "opensource";
|
|
|
|
}
|
|
|
|
else if (configCmdLine.at(i) == "-commercial") {
|
|
|
|
dictionary[ "BUILDTYPE" ] = "commercial";
|
|
|
|
}
|
|
|
|
else if (configCmdLine.at(i) == "-ltcg") {
|
|
|
|
dictionary[ "LTCG" ] = "yes";
|
|
|
|
}
|
|
|
|
else if (configCmdLine.at(i) == "-no-ltcg") {
|
|
|
|
dictionary[ "LTCG" ] = "no";
|
|
|
|
}
|
|
|
|
else if (configCmdLine.at(i) == "-mp") {
|
|
|
|
dictionary[ "MSVC_MP" ] = "yes";
|
|
|
|
}
|
|
|
|
else if (configCmdLine.at(i) == "-no-mp") {
|
|
|
|
dictionary[ "MSVC_MP" ] = "no";
|
|
|
|
}
|
2011-11-17 09:37:24 +00:00
|
|
|
else if (configCmdLine.at(i) == "-force-asserts") {
|
|
|
|
dictionary[ "FORCE_ASSERTS" ] = "yes";
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
else if (configCmdLine.at(i) == "-platform") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QMAKESPEC" ] = configCmdLine.at(i);
|
|
|
|
dictionary[ "QMAKESPEC_FROM" ] = "commandline";
|
2012-10-17 20:06:41 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-xplatform"
|
|
|
|
|| configCmdLine.at(i) == "-device") {
|
2011-04-27 10:05:43 +00:00
|
|
|
++i;
|
|
|
|
// do nothing
|
2013-08-09 12:10:15 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-device-option") {
|
|
|
|
++i;
|
|
|
|
const QString option = configCmdLine.at(i);
|
|
|
|
QString &devOpt = dictionary["DEVICE_OPTION"];
|
|
|
|
if (!devOpt.isEmpty())
|
|
|
|
devOpt.append("\n").append(option);
|
|
|
|
else
|
|
|
|
devOpt = option;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
} else if (configCmdLine.at(i) == "-qt-zlib") {
|
2016-02-19 14:18:47 +00:00
|
|
|
dictionary[ "SYSTEM_ZLIB" ] = "no";
|
2011-04-27 10:05:43 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-system-zlib") {
|
2016-02-19 14:18:47 +00:00
|
|
|
dictionary[ "SYSTEM_ZLIB" ] = "yes";
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
2012-01-23 22:31:13 +00:00
|
|
|
else if (configCmdLine.at(i) == "-qt-pcre") {
|
|
|
|
dictionary[ "PCRE" ] = "qt";
|
|
|
|
} else if (configCmdLine.at(i) == "-system-pcre") {
|
|
|
|
dictionary[ "PCRE" ] = "system";
|
|
|
|
}
|
|
|
|
|
2012-03-08 02:51:27 +00:00
|
|
|
else if (configCmdLine.at(i) == "-icu") {
|
|
|
|
dictionary[ "ICU" ] = "yes";
|
|
|
|
} else if (configCmdLine.at(i) == "-no-icu") {
|
|
|
|
dictionary[ "ICU" ] = "no";
|
|
|
|
}
|
|
|
|
|
2012-10-15 12:16:51 +00:00
|
|
|
else if (configCmdLine.at(i) == "-angle") {
|
|
|
|
dictionary[ "ANGLE" ] = "yes";
|
2012-11-02 09:41:22 +00:00
|
|
|
dictionary[ "ANGLE_FROM" ] = "commandline";
|
2012-10-15 12:16:51 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-no-angle") {
|
|
|
|
dictionary[ "ANGLE" ] = "no";
|
2012-11-02 09:41:22 +00:00
|
|
|
dictionary[ "ANGLE_FROM" ] = "commandline";
|
2012-10-15 12:16:51 +00:00
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Image formats --------------------------------------------
|
|
|
|
else if (configCmdLine.at(i) == "-no-gif")
|
|
|
|
dictionary[ "GIF" ] = "no";
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-no-libjpeg") {
|
|
|
|
dictionary[ "JPEG" ] = "no";
|
|
|
|
dictionary[ "LIBJPEG" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-qt-libjpeg") {
|
|
|
|
dictionary[ "LIBJPEG" ] = "qt";
|
|
|
|
} else if (configCmdLine.at(i) == "-system-libjpeg") {
|
|
|
|
dictionary[ "LIBJPEG" ] = "system";
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-no-libpng") {
|
|
|
|
dictionary[ "PNG" ] = "no";
|
|
|
|
dictionary[ "LIBPNG" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-qt-libpng") {
|
|
|
|
dictionary[ "LIBPNG" ] = "qt";
|
|
|
|
} else if (configCmdLine.at(i) == "-system-libpng") {
|
|
|
|
dictionary[ "LIBPNG" ] = "system";
|
|
|
|
}
|
|
|
|
|
2015-10-15 13:40:26 +00:00
|
|
|
// Double Conversion -----------------------------------------
|
|
|
|
else if (configCmdLine.at(i) == "-no-doubleconversion")
|
|
|
|
dictionary[ "DOUBLECONVERSION" ] = "no";
|
|
|
|
else if (configCmdLine.at(i) == "-qt-doubleconversion")
|
|
|
|
dictionary[ "DOUBLECONVERSION" ] = "qt";
|
|
|
|
else if (configCmdLine.at(i) == "-system-doubleconversion")
|
|
|
|
dictionary[ "DOUBLECONVERSION" ] = "system";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Text Rendering --------------------------------------------
|
2016-03-18 15:44:41 +00:00
|
|
|
else if (configCmdLine.at(i) == "-no-freetype") {
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "FREETYPE" ] = "no";
|
2016-03-18 15:44:41 +00:00
|
|
|
dictionary[ "FREETYPE_FROM" ] = "commandline";
|
|
|
|
} else if (configCmdLine.at(i) == "-qt-freetype") {
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "FREETYPE" ] = "yes";
|
2016-03-18 15:44:41 +00:00
|
|
|
dictionary[ "FREETYPE_FROM" ] = "commandline";
|
|
|
|
} else if (configCmdLine.at(i) == "-system-freetype") {
|
2012-06-20 14:00:34 +00:00
|
|
|
dictionary[ "FREETYPE" ] = "system";
|
2016-03-18 15:44:41 +00:00
|
|
|
dictionary[ "FREETYPE_FROM" ] = "commandline";
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2013-08-26 15:44:36 +00:00
|
|
|
else if (configCmdLine.at(i) == "-no-harfbuzz")
|
|
|
|
dictionary[ "HARFBUZZ" ] = "no";
|
|
|
|
else if (configCmdLine.at(i) == "-qt-harfbuzz")
|
2014-07-08 16:49:18 +00:00
|
|
|
dictionary[ "HARFBUZZ" ] = "qt";
|
2013-08-26 15:44:36 +00:00
|
|
|
else if (configCmdLine.at(i) == "-system-harfbuzz")
|
|
|
|
dictionary[ "HARFBUZZ" ] = "system";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Styles ---------------------------------------------------
|
|
|
|
else if (configCmdLine.at(i) == "-qt-style-windows")
|
|
|
|
dictionary[ "STYLE_WINDOWS" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-style-windows")
|
|
|
|
dictionary[ "STYLE_WINDOWS" ] = "no";
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-qt-style-windowsxp")
|
|
|
|
dictionary[ "STYLE_WINDOWSXP" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-style-windowsxp")
|
|
|
|
dictionary[ "STYLE_WINDOWSXP" ] = "no";
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-qt-style-windowsvista")
|
|
|
|
dictionary[ "STYLE_WINDOWSVISTA" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-style-windowsvista")
|
|
|
|
dictionary[ "STYLE_WINDOWSVISTA" ] = "no";
|
|
|
|
|
2012-09-21 17:53:28 +00:00
|
|
|
else if (configCmdLine.at(i) == "-qt-style-fusion")
|
|
|
|
dictionary[ "STYLE_FUSION" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-style-fusion")
|
|
|
|
dictionary[ "STYLE_FUSION" ] = "no";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Work around compiler nesting limitation
|
|
|
|
else
|
|
|
|
continueElse[1] = true;
|
|
|
|
if (!continueElse[1]) {
|
|
|
|
}
|
|
|
|
|
|
|
|
// OpenGL Support -------------------------------------------
|
|
|
|
else if (configCmdLine.at(i) == "-no-opengl") {
|
|
|
|
dictionary[ "OPENGL" ] = "no";
|
2012-11-05 09:48:07 +00:00
|
|
|
dictionary[ "OPENGL_ES_2" ] = "no";
|
2011-04-27 10:05:43 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-opengl-es-2") {
|
|
|
|
dictionary[ "OPENGL" ] = "yes";
|
|
|
|
dictionary[ "OPENGL_ES_2" ] = "yes";
|
|
|
|
} else if (configCmdLine.at(i) == "-opengl") {
|
|
|
|
dictionary[ "OPENGL" ] = "yes";
|
|
|
|
i++;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
|
2012-10-15 12:16:51 +00:00
|
|
|
dictionary[ "OPENGL_ES_2" ] = "no";
|
2014-03-03 20:20:30 +00:00
|
|
|
if ( configCmdLine.at(i) == "es2" ) {
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "OPENGL_ES_2" ] = "yes";
|
|
|
|
} else if ( configCmdLine.at(i) == "desktop" ) {
|
|
|
|
// OPENGL=yes suffices
|
Dynamic GL switch on Windows
The patch introduces a new build configuration on Windows which
can be requested by passing -opengl dynamic to configure.
Platforms other than Windows (including WinRT) are not affected.
The existing Angle and desktop configurations are not affected.
These continue to function as before and Angle remains the default.
In the future, when all modules have added support for the dynamic
path, as described below, the default configuration could be changed
to be the dynamic one. This would allow providing a single set of
binaries in the official builds instead of the current two.
When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are
never defined. Instead, the code path that has traditionally been
desktop GL only becomes the dynamic path that has to do runtime
checks. Qt modules and applications are not linked to opengl32.dll or
libegl/glesv2.dll in this case. Instead, QtGui exports all necessary
egl/egl/gl functions which will, under the hood, forward all requests
to a dynamically loaded EGL/WGL/GL implementation.
Porting guide (better said, changes needed to prepare your code to
work with dynamic GL builds when the fallback to Angle is utilized):
1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to
differentiate between desktop and ES where needed. Keep in mind that
it is the desktop GL header (plus qopenglext.h) that is included,
not the GLES one.
QtGui's proxy will handle some differences, for example calling
glClearDepth will route to glClearDepthf when needed. The built-in
eglGetProcAddress is able to retrieve pointers for standard GLES2
functions too so code resolving OpenGL 2 functions will function
in any case.
2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds,
but never "angle" or "opengles2".
3. The preprocessor define QT_OPENGL_DYNAMIC is also available in
dynamic builds. The usage of this is strongly discouraged and should
not be needed anywhere except for QtGui and the platform plugin.
4. Code in need of the library handle can use
QOpenGLFunctions::platformGLHandle().
The decision on which library to load is currently based on a simple
test that creates a dummy window/context and tries to resolve an
OpenGL 2 function. If this fails, it goes for Angle. This seems to work
well on Win7 PCs for example that do not have proper graphics drivers
providing OpenGL installed but are D3D9 capable using the default drivers.
Setting QT_OPENGL to desktop or angle skips the test and forces
usage of the given GL. There are also two new application attributes
that could be used for the same purpose.
If Angle is requested but the libraries are not present, desktop is
tried. If desktop is requested, or if angle is requested but nothing
works, the EGL/WGL functions will still be callable but will return 0.
This conveniently means that eglInitialize() and such will report a failure.
Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will
tell which implementation is chosen.
The textures example application is ported to OpenGL 2, the GL 1
code path is removed.
[ChangeLog][QtGui] Qt builds on Windows can now be configured for
dynamic loading of the OpenGL implementation. This can be requested
by passing -opengl dynamic to configure. In this mode no modules will
link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will
dynamically choose between desktop and Angle during the first GL/EGL/WGL
call. This allows deploying applications with a single set of Qt libraries
with the ability of transparently falling back to Angle in case the
opengl32.dll is not suitable, due to missing graphics drivers for example.
Task-number: QTBUG-36483
Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-01-27 13:45:11 +00:00
|
|
|
} else if ( configCmdLine.at(i) == "dynamic" ) {
|
|
|
|
dictionary[ "DYNAMICGL" ] = "yes";
|
2011-04-27 10:05:43 +00:00
|
|
|
} else {
|
|
|
|
cout << "Argument passed to -opengl option is not valid." << endl;
|
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Databases ------------------------------------------------
|
2016-03-18 12:35:40 +00:00
|
|
|
else if (configCmdLine.at(i) == "-sql-mysql" || configCmdLine.at(i) == "-plugin-sql-mysql")
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "SQL_MYSQL" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-sql-mysql")
|
|
|
|
dictionary[ "SQL_MYSQL" ] = "no";
|
|
|
|
|
2016-03-18 12:35:40 +00:00
|
|
|
else if (configCmdLine.at(i) == "-sql-odbc" || configCmdLine.at(i) == "-plugin-sql-odbc")
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "SQL_ODBC" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-sql-odbc")
|
|
|
|
dictionary[ "SQL_ODBC" ] = "no";
|
|
|
|
|
2016-03-18 12:35:40 +00:00
|
|
|
else if (configCmdLine.at(i) == "-sql-oci" || configCmdLine.at(i) == "-plugin-sql-oci")
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "SQL_OCI" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-sql-oci")
|
|
|
|
dictionary[ "SQL_OCI" ] = "no";
|
|
|
|
|
2016-03-18 12:35:40 +00:00
|
|
|
else if (configCmdLine.at(i) == "-sql-psql" || configCmdLine.at(i) == "-plugin-sql-psql")
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "SQL_PSQL" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-sql-psql")
|
|
|
|
dictionary[ "SQL_PSQL" ] = "no";
|
|
|
|
|
2016-03-18 12:35:40 +00:00
|
|
|
else if (configCmdLine.at(i) == "-sql-tds" || configCmdLine.at(i) == "-plugin-sql-tds")
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "SQL_TDS" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-sql-tds")
|
|
|
|
dictionary[ "SQL_TDS" ] = "no";
|
|
|
|
|
2016-03-18 12:35:40 +00:00
|
|
|
else if (configCmdLine.at(i) == "-sql-db2")
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "SQL_DB2" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-plugin-sql-db2")
|
|
|
|
dictionary[ "SQL_DB2" ] = "plugin";
|
|
|
|
else if (configCmdLine.at(i) == "-no-sql-db2")
|
|
|
|
dictionary[ "SQL_DB2" ] = "no";
|
|
|
|
|
2016-03-18 12:35:40 +00:00
|
|
|
else if (configCmdLine.at(i) == "-sql-sqlite" || configCmdLine.at(i) == "-plugin-sql-sqlite")
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "SQL_SQLITE" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-sql-sqlite")
|
|
|
|
dictionary[ "SQL_SQLITE" ] = "no";
|
|
|
|
else if (configCmdLine.at(i) == "-system-sqlite")
|
|
|
|
dictionary[ "SQL_SQLITE_LIB" ] = "system";
|
2016-03-18 12:35:40 +00:00
|
|
|
else if (configCmdLine.at(i) == "-sql-sqlite2" || configCmdLine.at(i) == "-plugin-sql-sqlite2")
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "SQL_SQLITE2" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-sql-sqlite2")
|
|
|
|
dictionary[ "SQL_SQLITE2" ] = "no";
|
|
|
|
|
2016-03-18 12:35:40 +00:00
|
|
|
else if (configCmdLine.at(i) == "-sql-ibase" || configCmdLine.at(i) == "-plugin-sql-ibase")
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "SQL_IBASE" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-sql-ibase")
|
|
|
|
dictionary[ "SQL_IBASE" ] = "no";
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-no-incredibuild-xge")
|
|
|
|
dictionary[ "INCREDIBUILD_XGE" ] = "no";
|
|
|
|
else if (configCmdLine.at(i) == "-incredibuild-xge")
|
|
|
|
dictionary[ "INCREDIBUILD_XGE" ] = "yes";
|
|
|
|
// Others ---------------------------------------------------
|
2012-03-07 00:11:44 +00:00
|
|
|
else if (configCmdLine.at(i) == "-widgets")
|
|
|
|
dictionary[ "WIDGETS" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-widgets")
|
|
|
|
dictionary[ "WIDGETS" ] = "no";
|
|
|
|
|
2013-04-18 20:34:46 +00:00
|
|
|
else if (configCmdLine.at(i) == "-gui")
|
|
|
|
dictionary[ "GUI" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-gui")
|
|
|
|
dictionary[ "GUI" ] = "no";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
else if (configCmdLine.at(i) == "-rtti")
|
|
|
|
dictionary[ "RTTI" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-rtti")
|
|
|
|
dictionary[ "RTTI" ] = "no";
|
|
|
|
|
2012-09-14 14:04:59 +00:00
|
|
|
else if (configCmdLine.at(i) == "-strip")
|
|
|
|
dictionary[ "STRIP" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-strip")
|
|
|
|
dictionary[ "STRIP" ] = "no";
|
|
|
|
|
2016-03-18 15:32:13 +00:00
|
|
|
else if (configCmdLine.at(i) == "-pch")
|
|
|
|
dictionary[ "PCH" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-pch")
|
|
|
|
dictionary[ "PCH" ] = "no";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
else if (configCmdLine.at(i) == "-accessibility")
|
|
|
|
dictionary[ "ACCESSIBILITY" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-accessibility") {
|
|
|
|
dictionary[ "ACCESSIBILITY" ] = "no";
|
|
|
|
cout << "Setting accessibility to NO" << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-no-sse2")
|
|
|
|
dictionary[ "SSE2" ] = "no";
|
|
|
|
else if (configCmdLine.at(i) == "-sse2")
|
|
|
|
dictionary[ "SSE2" ] = "yes";
|
2011-12-30 00:44:16 +00:00
|
|
|
else if (configCmdLine.at(i) == "-no-sse3")
|
|
|
|
dictionary[ "SSE3" ] = "no";
|
|
|
|
else if (configCmdLine.at(i) == "-sse3")
|
|
|
|
dictionary[ "SSE3" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-ssse3")
|
|
|
|
dictionary[ "SSSE3" ] = "no";
|
|
|
|
else if (configCmdLine.at(i) == "-ssse3")
|
|
|
|
dictionary[ "SSSE3" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-sse4.1")
|
|
|
|
dictionary[ "SSE4_1" ] = "no";
|
|
|
|
else if (configCmdLine.at(i) == "-sse4.1")
|
|
|
|
dictionary[ "SSE4_1" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-sse4.2")
|
|
|
|
dictionary[ "SSE4_2" ] = "no";
|
|
|
|
else if (configCmdLine.at(i) == "-sse4.2")
|
|
|
|
dictionary[ "SSE4_2" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-avx")
|
|
|
|
dictionary[ "AVX" ] = "no";
|
|
|
|
else if (configCmdLine.at(i) == "-avx")
|
|
|
|
dictionary[ "AVX" ] = "yes";
|
|
|
|
else if (configCmdLine.at(i) == "-no-avx2")
|
|
|
|
dictionary[ "AVX2" ] = "no";
|
|
|
|
else if (configCmdLine.at(i) == "-avx2")
|
|
|
|
dictionary[ "AVX2" ] = "yes";
|
2015-07-17 21:46:05 +00:00
|
|
|
else if (configCmdLine.at(i) == "-no-avx512")
|
|
|
|
dictionary[ "AVX512" ] = "";
|
|
|
|
else if (configCmdLine.at(i) == "-avx512")
|
|
|
|
dictionary[ "AVX512" ] = "auto";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2014-08-12 17:04:05 +00:00
|
|
|
else if (configCmdLine.at(i) == "-no-ssl") {
|
|
|
|
dictionary[ "SSL"] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-ssl") {
|
|
|
|
dictionary[ "SSL" ] = "yes";
|
|
|
|
} else if (configCmdLine.at(i) == "-no-openssl") {
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "OPENSSL"] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-openssl") {
|
|
|
|
dictionary[ "OPENSSL" ] = "yes";
|
2015-07-30 07:59:48 +00:00
|
|
|
dictionary[ "SSL" ] = "yes";
|
2011-04-27 10:05:43 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-openssl-linked") {
|
|
|
|
dictionary[ "OPENSSL" ] = "linked";
|
2015-07-30 07:59:48 +00:00
|
|
|
dictionary[ "SSL" ] = "yes";
|
2015-01-27 17:41:32 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-no-libproxy") {
|
|
|
|
dictionary[ "LIBPROXY"] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-libproxy") {
|
|
|
|
dictionary[ "LIBPROXY" ] = "yes";
|
2011-04-27 10:05:43 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-no-qdbus") {
|
|
|
|
dictionary[ "DBUS" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-qdbus") {
|
2014-12-11 22:32:59 +00:00
|
|
|
dictionary[ "DBUS" ] = "auto";
|
2011-04-27 10:05:43 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-no-dbus") {
|
|
|
|
dictionary[ "DBUS" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-dbus") {
|
2014-12-11 22:32:59 +00:00
|
|
|
dictionary[ "DBUS" ] = "auto";
|
2011-04-27 10:05:43 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-dbus-linked") {
|
|
|
|
dictionary[ "DBUS" ] = "linked";
|
2014-12-11 22:32:59 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-dbus-runtime") {
|
|
|
|
dictionary[ "DBUS" ] = "runtime";
|
2013-07-22 11:45:30 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-wmf-backend") {
|
|
|
|
dictionary[ "WMF_BACKEND" ] = "yes";
|
|
|
|
} else if (configCmdLine.at(i) == "-no-wmf-backend") {
|
|
|
|
dictionary[ "WMF_BACKEND" ] = "no";
|
2012-03-30 11:43:10 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-no-qml-debug") {
|
|
|
|
dictionary[ "QML_DEBUG" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-qml-debug") {
|
|
|
|
dictionary[ "QML_DEBUG" ] = "yes";
|
2011-04-27 10:05:43 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-no-plugin-manifests") {
|
|
|
|
dictionary[ "PLUGIN_MANIFESTS" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-plugin-manifests") {
|
|
|
|
dictionary[ "PLUGIN_MANIFESTS" ] = "yes";
|
2012-09-18 18:15:18 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-no-slog2") {
|
|
|
|
dictionary[ "SLOG2" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-slog2") {
|
|
|
|
dictionary[ "SLOG2" ] = "yes";
|
2013-10-16 15:38:32 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-no-imf") {
|
|
|
|
dictionary[ "QNX_IMF" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-imf") {
|
|
|
|
dictionary[ "QNX_IMF" ] = "yes";
|
2013-11-21 11:58:22 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-no-pps") {
|
|
|
|
dictionary[ "PPS" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-pps") {
|
|
|
|
dictionary[ "PPS" ] = "yes";
|
2014-01-29 12:43:03 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-no-lgmon") {
|
|
|
|
dictionary[ "LGMON" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-lgmon") {
|
|
|
|
dictionary[ "LGMON" ] = "yes";
|
2012-10-23 13:31:20 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-no-system-proxies") {
|
|
|
|
dictionary[ "SYSTEM_PROXIES" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-system-proxies") {
|
|
|
|
dictionary[ "SYSTEM_PROXIES" ] = "yes";
|
2014-09-24 14:31:33 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-no-sctp") {
|
|
|
|
dictionary[ "SCTP" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-sctp") {
|
|
|
|
dictionary[ "SCTP" ] = "yes";
|
2012-12-22 02:31:54 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-warnings-are-errors" ||
|
|
|
|
configCmdLine.at(i) == "-Werror") {
|
|
|
|
dictionary[ "WERROR" ] = "yes";
|
|
|
|
} else if (configCmdLine.at(i) == "-no-warnings-are-errors") {
|
|
|
|
dictionary[ "WERROR" ] = "no";
|
2012-12-22 21:12:02 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-no-headersclean") {
|
|
|
|
dictionary[ "HEADERSCLEAN" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-headersclean") {
|
|
|
|
dictionary[ "HEADERSCLEAN" ] = "yes";
|
2013-05-07 21:40:38 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-no-eventfd") {
|
|
|
|
dictionary[ "QT_EVENTFD" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-eventfd") {
|
|
|
|
dictionary[ "QT_EVENTFD" ] = "yes";
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Work around compiler nesting limitation
|
|
|
|
else
|
|
|
|
continueElse[0] = true;
|
|
|
|
if (!continueElse[0]) {
|
|
|
|
}
|
|
|
|
|
2012-02-08 10:38:07 +00:00
|
|
|
else if (configCmdLine.at(i) == "-no-syncqt")
|
|
|
|
dictionary[ "SYNCQT" ] = "no";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
else if (configCmdLine.at(i) == "-qtnamespace") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_NAMESPACE" ] = configCmdLine.at(i);
|
|
|
|
} else if (configCmdLine.at(i) == "-qtlibinfix") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_LIBINFIX" ] = configCmdLine.at(i);
|
|
|
|
} else if (configCmdLine.at(i) == "-D") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
qmakeDefines += configCmdLine.at(i);
|
|
|
|
} else if (configCmdLine.at(i) == "-I") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
qmakeIncludes += configCmdLine.at(i);
|
|
|
|
} else if (configCmdLine.at(i) == "-L") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
2012-01-09 18:03:48 +00:00
|
|
|
QFileInfo checkDirectory(configCmdLine.at(i));
|
|
|
|
if (!checkDirectory.isDir()) {
|
2011-04-27 10:05:43 +00:00
|
|
|
cout << "Argument passed to -L option is not a directory path. Did you mean the -l option?" << endl;
|
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
break;
|
|
|
|
}
|
2016-07-07 11:47:49 +00:00
|
|
|
qmakeLibs += configCmdLine.at(i);
|
2011-04-27 10:05:43 +00:00
|
|
|
} else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS=")) {
|
|
|
|
opensslLibs = configCmdLine.at(i);
|
2012-07-26 15:16:29 +00:00
|
|
|
} else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS_DEBUG=")) {
|
|
|
|
opensslLibsDebug = configCmdLine.at(i);
|
|
|
|
} else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS_RELEASE=")) {
|
|
|
|
opensslLibsRelease = configCmdLine.at(i);
|
2012-08-06 18:34:34 +00:00
|
|
|
} else if (configCmdLine.at(i).startsWith("OPENSSL_PATH=")) {
|
2013-04-08 22:07:13 +00:00
|
|
|
opensslPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1));
|
2011-04-27 10:05:43 +00:00
|
|
|
} else if (configCmdLine.at(i).startsWith("PSQL_LIBS=")) {
|
|
|
|
psqlLibs = configCmdLine.at(i);
|
|
|
|
} else if (configCmdLine.at(i).startsWith("SYBASE=")) {
|
|
|
|
sybase = configCmdLine.at(i);
|
|
|
|
} else if (configCmdLine.at(i).startsWith("SYBASE_LIBS=")) {
|
|
|
|
sybaseLibs = configCmdLine.at(i);
|
2012-08-06 18:34:34 +00:00
|
|
|
} else if (configCmdLine.at(i).startsWith("DBUS_PATH=")) {
|
2013-04-08 22:07:13 +00:00
|
|
|
dbusPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1));
|
2014-07-09 09:58:44 +00:00
|
|
|
} else if (configCmdLine.at(i).startsWith("DBUS_HOST_PATH=")) {
|
|
|
|
dbusHostPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1));
|
2012-08-06 18:34:34 +00:00
|
|
|
} else if (configCmdLine.at(i).startsWith("MYSQL_PATH=")) {
|
2013-04-08 22:07:13 +00:00
|
|
|
mysqlPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1));
|
2012-08-20 17:54:58 +00:00
|
|
|
} else if (configCmdLine.at(i).startsWith("ZLIB_LIBS=")) {
|
|
|
|
zlibLibs = QDir::fromNativeSeparators(configCmdLine.at(i));
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-confirm-license") {
|
|
|
|
dictionary["LICENSE_CONFIRMED"] = "yes";
|
|
|
|
}
|
|
|
|
|
2012-03-21 10:09:59 +00:00
|
|
|
else if (configCmdLine.at(i) == "-make") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
2013-06-17 09:21:40 +00:00
|
|
|
QString part = configCmdLine.at(i);
|
|
|
|
if (!allBuildParts.contains(part)) {
|
|
|
|
cout << "Unknown part " << part << " passed to -make." << endl;
|
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
}
|
|
|
|
buildParts += part;
|
2012-03-21 10:09:59 +00:00
|
|
|
} else if (configCmdLine.at(i) == "-nomake") {
|
2011-04-27 10:05:43 +00:00
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
2013-06-17 09:21:40 +00:00
|
|
|
QString part = configCmdLine.at(i);
|
|
|
|
if (!allBuildParts.contains(part)) {
|
|
|
|
cout << "Unknown part " << part << " passed to -nomake." << endl;
|
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
}
|
|
|
|
nobuildParts += part;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
2013-02-18 16:37:21 +00:00
|
|
|
else if (configCmdLine.at(i) == "-skip") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
QString mod = configCmdLine.at(i);
|
Don't use QStringLiteral in comparisons
For QLatin1String, operator== is overloaded, so comparing to a latin-1
(C) string literal is efficient, since strlen() is comparatively fast.
OTOH, QStringLiteral, when not using RVO, litters the code with
QString dtor calls, which are not inline. Worse, absent lambdas,
it even allocates memory.
So, just compare using QLatin1String instead.
Change-Id: I761b2b26ab5b416bc695f524a9ee607dacf0a7b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-19 08:49:37 +00:00
|
|
|
if (!mod.startsWith(QLatin1String("qt")))
|
2013-02-18 16:37:21 +00:00
|
|
|
mod.insert(0, QStringLiteral("qt"));
|
|
|
|
if (!QFileInfo(sourcePath + "/../" + mod).isDir()) {
|
|
|
|
cout << "Attempting to skip non-existent module " << mod << "." << endl;
|
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
}
|
|
|
|
skipModules += mod;
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Directories ----------------------------------------------
|
|
|
|
else if (configCmdLine.at(i) == "-prefix") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_INSTALL_PREFIX" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-bindir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_INSTALL_BINS" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
2012-10-25 21:32:09 +00:00
|
|
|
else if (configCmdLine.at(i) == "-libexecdir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_INSTALL_LIBEXECS" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
else if (configCmdLine.at(i) == "-libdir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_INSTALL_LIBS" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-docdir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_INSTALL_DOCS" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-headerdir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_INSTALL_HEADERS" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-plugindir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_INSTALL_PLUGINS" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-importdir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_INSTALL_IMPORTS" ] = configCmdLine.at(i);
|
|
|
|
}
|
2012-10-15 20:23:13 +00:00
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-qmldir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_INSTALL_QML" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
2012-09-24 12:30:45 +00:00
|
|
|
else if (configCmdLine.at(i) == "-archdatadir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_INSTALL_ARCHDATA" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
else if (configCmdLine.at(i) == "-datadir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_INSTALL_DATA" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-translationdir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_INSTALL_TRANSLATIONS" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-examplesdir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_INSTALL_EXAMPLES" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
2011-11-17 05:39:19 +00:00
|
|
|
else if (configCmdLine.at(i) == "-testsdir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_INSTALL_TESTS" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
2012-02-28 19:57:38 +00:00
|
|
|
else if (configCmdLine.at(i) == "-sysroot") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "CFG_SYSROOT" ] = configCmdLine.at(i);
|
|
|
|
}
|
2012-07-12 11:03:16 +00:00
|
|
|
else if (configCmdLine.at(i) == "-no-gcc-sysroot") {
|
|
|
|
dictionary[ "CFG_GCC_SYSROOT" ] = "no";
|
|
|
|
}
|
2012-02-28 19:57:38 +00:00
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
else if (configCmdLine.at(i) == "-hostprefix") {
|
2012-02-28 19:57:38 +00:00
|
|
|
++i;
|
|
|
|
if (i == argCount || configCmdLine.at(i).startsWith('-'))
|
2013-07-24 11:48:36 +00:00
|
|
|
dictionary[ "QT_HOST_PREFIX" ] = buildPath;
|
2012-02-28 19:57:38 +00:00
|
|
|
else
|
|
|
|
dictionary[ "QT_HOST_PREFIX" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-hostbindir") {
|
2011-04-27 10:05:43 +00:00
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
2012-02-28 19:57:38 +00:00
|
|
|
dictionary[ "QT_HOST_BINS" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
2013-05-08 13:30:56 +00:00
|
|
|
else if (configCmdLine.at(i) == "-hostlibdir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_HOST_LIBS" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
2012-02-28 19:57:38 +00:00
|
|
|
else if (configCmdLine.at(i) == "-hostdatadir") {
|
2011-04-27 10:05:43 +00:00
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
2012-02-28 19:57:38 +00:00
|
|
|
dictionary[ "QT_HOST_DATA" ] = configCmdLine.at(i);
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
2013-08-09 11:34:04 +00:00
|
|
|
else if (configCmdLine.at(i) == "-extprefix") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "QT_EXT_PREFIX" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
2012-03-21 10:09:59 +00:00
|
|
|
else if (configCmdLine.at(i) == "-make-tool") {
|
2011-04-27 10:05:43 +00:00
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "MAKE" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i).indexOf(QRegExp("^-(en|dis)able-")) != -1) {
|
|
|
|
// Scan to see if any specific modules and drivers are enabled or disabled
|
|
|
|
for (QStringList::Iterator module = modules.begin(); module != modules.end(); ++module) {
|
|
|
|
if (configCmdLine.at(i) == QString("-enable-") + (*module)) {
|
|
|
|
enabledModules += (*module);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if (configCmdLine.at(i) == QString("-disable-") + (*module)) {
|
|
|
|
disabledModules += (*module);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-directwrite") {
|
|
|
|
dictionary["DIRECTWRITE"] = "yes";
|
|
|
|
} else if (configCmdLine.at(i) == "-no-directwrite") {
|
|
|
|
dictionary["DIRECTWRITE"] = "no";
|
|
|
|
}
|
|
|
|
|
2013-12-04 11:40:23 +00:00
|
|
|
else if (configCmdLine.at(i) == "-direct2d") {
|
|
|
|
dictionary["DIRECT2D"] = "yes";
|
|
|
|
} else if (configCmdLine.at(i) == "-no-direct2d") {
|
|
|
|
dictionary["DIRECT2D"] = "no";
|
|
|
|
}
|
|
|
|
|
2012-06-20 14:00:34 +00:00
|
|
|
else if (configCmdLine.at(i) == "-nis") {
|
|
|
|
dictionary["NIS"] = "yes";
|
|
|
|
} else if (configCmdLine.at(i) == "-no-nis") {
|
|
|
|
dictionary["NIS"] = "no";
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-cups") {
|
|
|
|
dictionary["QT_CUPS"] = "yes";
|
|
|
|
} else if (configCmdLine.at(i) == "-no-cups") {
|
|
|
|
dictionary["QT_CUPS"] = "no";
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-iconv") {
|
|
|
|
dictionary["QT_ICONV"] = "yes";
|
|
|
|
} else if (configCmdLine.at(i) == "-no-iconv") {
|
|
|
|
dictionary["QT_ICONV"] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-sun-iconv") {
|
|
|
|
dictionary["QT_ICONV"] = "sun";
|
|
|
|
} else if (configCmdLine.at(i) == "-gnu-iconv") {
|
|
|
|
dictionary["QT_ICONV"] = "gnu";
|
|
|
|
}
|
|
|
|
|
2014-04-02 09:54:36 +00:00
|
|
|
else if (configCmdLine.at(i) == "-no-evdev") {
|
|
|
|
dictionary[ "QT_EVDEV" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-evdev") {
|
|
|
|
dictionary[ "QT_EVDEV" ] = "yes";
|
|
|
|
}
|
|
|
|
|
2014-04-07 08:38:26 +00:00
|
|
|
else if (configCmdLine.at(i) == "-no-mtdev") {
|
|
|
|
dictionary[ "QT_MTDEV" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-mtdev") {
|
|
|
|
dictionary[ "QT_MTDEV" ] = "yes";
|
|
|
|
}
|
|
|
|
|
2012-11-14 16:33:16 +00:00
|
|
|
else if (configCmdLine.at(i) == "-inotify") {
|
|
|
|
dictionary["QT_INOTIFY"] = "yes";
|
|
|
|
} else if (configCmdLine.at(i) == "-no-inotify") {
|
|
|
|
dictionary["QT_INOTIFY"] = "no";
|
|
|
|
}
|
|
|
|
|
2012-06-20 14:00:34 +00:00
|
|
|
else if (configCmdLine.at(i) == "-fontconfig") {
|
|
|
|
dictionary["FONT_CONFIG"] = "yes";
|
|
|
|
} else if (configCmdLine.at(i) == "-no-fontconfig") {
|
|
|
|
dictionary["FONT_CONFIG"] = "no";
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-posix-ipc") {
|
|
|
|
dictionary["POSIX_IPC"] = "yes";
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-glib") {
|
|
|
|
dictionary["QT_GLIB"] = "yes";
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-sysconfdir") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
|
|
|
|
dictionary["QT_INSTALL_SETTINGS"] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
2013-03-27 20:34:42 +00:00
|
|
|
else if (configCmdLine.at(i) == "-android-ndk") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "ANDROID_NDK_ROOT" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-android-sdk") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "ANDROID_SDK_ROOT" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-android-ndk-platform") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "ANDROID_PLATFORM" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
2016-03-09 17:27:50 +00:00
|
|
|
else if (configCmdLine.at(i) == "-android-ndk-host") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
|
|
|
|
dictionary[ "ANDROID_HOST" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
2013-03-27 20:34:42 +00:00
|
|
|
else if (configCmdLine.at(i) == "-android-arch") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "ANDROID_TARGET_ARCH" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (configCmdLine.at(i) == "-android-toolchain-version") {
|
|
|
|
++i;
|
|
|
|
if (i == argCount)
|
|
|
|
break;
|
|
|
|
dictionary[ "ANDROID_NDK_TOOLCHAIN_VERSION" ] = configCmdLine.at(i);
|
|
|
|
}
|
|
|
|
|
2014-09-30 08:34:00 +00:00
|
|
|
else if (configCmdLine.at(i) == "-no-android-style-assets") {
|
|
|
|
dictionary[ "ANDROID_STYLE_ASSETS" ] = "no";
|
|
|
|
} else if (configCmdLine.at(i) == "-android-style-assets") {
|
|
|
|
dictionary[ "ANDROID_STYLE_ASSETS" ] = "yes";
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
else {
|
2013-11-12 18:42:41 +00:00
|
|
|
dictionary[ "DONE" ] = "error";
|
2011-04-27 10:05:43 +00:00
|
|
|
cout << "Unknown option " << configCmdLine.at(i) << endl;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Ensure that QMAKESPEC exists in the mkspecs folder
|
2012-03-28 14:00:06 +00:00
|
|
|
const QString mkspecPath(sourcePath + "/mkspecs");
|
2012-05-02 09:42:20 +00:00
|
|
|
QDirIterator itMkspecs(mkspecPath, QDir::AllDirs | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
|
|
|
|
QStringList mkspecs;
|
|
|
|
|
|
|
|
while (itMkspecs.hasNext()) {
|
|
|
|
QString mkspec = itMkspecs.next();
|
|
|
|
// Remove base PATH
|
|
|
|
mkspec.remove(0, mkspecPath.length() + 1);
|
|
|
|
mkspecs << mkspec;
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
if (dictionary["QMAKESPEC"].toLower() == "features"
|
|
|
|
|| !mkspecs.contains(dictionary["QMAKESPEC"], Qt::CaseInsensitive)) {
|
2013-11-12 18:42:41 +00:00
|
|
|
dictionary[ "DONE" ] = "error";
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary ["QMAKESPEC_FROM"] == "commandline") {
|
|
|
|
cout << "Invalid option \"" << dictionary["QMAKESPEC"] << "\" for -platform." << endl;
|
|
|
|
} else if (dictionary ["QMAKESPEC_FROM"] == "env") {
|
|
|
|
cout << "QMAKESPEC environment variable is set to \"" << dictionary["QMAKESPEC"]
|
|
|
|
<< "\" which is not a supported platform" << endl;
|
|
|
|
} else { // was autodetected from environment
|
2015-12-01 12:54:04 +00:00
|
|
|
cout << "Unable to detect the platform from environment. Use -platform command line" << endl
|
|
|
|
<< "argument or set the QMAKESPEC environment variable and run configure again." << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
cout << "See the README file for a list of supported operating systems and compilers." << endl;
|
|
|
|
} else {
|
|
|
|
if (dictionary[ "QMAKESPEC" ].endsWith("-icc") ||
|
2013-07-02 11:48:08 +00:00
|
|
|
dictionary[ "QMAKESPEC" ].endsWith("-msvc2012") ||
|
2014-06-19 22:52:49 +00:00
|
|
|
dictionary[ "QMAKESPEC" ].endsWith("-msvc2013") ||
|
|
|
|
dictionary[ "QMAKESPEC" ].endsWith("-msvc2015")) {
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "nmake";
|
|
|
|
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
|
2015-09-22 21:58:05 +00:00
|
|
|
} else if (dictionary[ "QMAKESPEC" ].startsWith(QLatin1String("win32-g++"))) {
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "mingw32-make";
|
2013-02-02 12:31:53 +00:00
|
|
|
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.unix";
|
2011-04-27 10:05:43 +00:00
|
|
|
} else {
|
|
|
|
if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "make";
|
|
|
|
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-17 20:06:41 +00:00
|
|
|
if (isDeviceMkspec) {
|
|
|
|
const QStringList devices = mkspecs.filter("devices/", Qt::CaseInsensitive);
|
|
|
|
const QStringList family = devices.filter(dictionary["XQMAKESPEC"], Qt::CaseInsensitive);
|
|
|
|
|
|
|
|
if (family.isEmpty()) {
|
2013-11-12 18:42:41 +00:00
|
|
|
dictionary[ "DONE" ] = "error";
|
2012-10-17 20:06:41 +00:00
|
|
|
cout << "Error: No device matching '" << dictionary["XQMAKESPEC"] << "'." << endl;
|
|
|
|
} else if (family.size() > 1) {
|
2013-11-12 18:42:41 +00:00
|
|
|
dictionary[ "DONE" ] = "error";
|
2012-10-17 20:06:41 +00:00
|
|
|
|
|
|
|
cout << "Error: Multiple matches for device '" << dictionary["XQMAKESPEC"] << "'. Candidates are:" << endl;
|
|
|
|
|
|
|
|
foreach (const QString &device, family)
|
|
|
|
cout << "\t* " << device << endl;
|
|
|
|
} else {
|
|
|
|
Q_ASSERT(family.size() == 1);
|
|
|
|
dictionary["XQMAKESPEC"] = family.at(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
// Ensure that -spec (XQMAKESPEC) exists in the mkspecs folder as well
|
|
|
|
if (dictionary.contains("XQMAKESPEC") &&
|
|
|
|
!mkspecs.contains(dictionary["XQMAKESPEC"], Qt::CaseInsensitive)) {
|
2013-11-12 18:42:41 +00:00
|
|
|
dictionary[ "DONE" ] = "error";
|
2011-04-27 10:05:43 +00:00
|
|
|
cout << "Invalid option \"" << dictionary["XQMAKESPEC"] << "\" for -xplatform." << endl;
|
2012-10-17 20:06:41 +00:00
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Allow tests for private classes to be compiled against internal builds
|
2012-12-22 02:31:54 +00:00
|
|
|
if (dictionary["BUILDDEV"] == "yes") {
|
|
|
|
qtConfig << "private_tests";
|
|
|
|
if (dictionary["WERROR"] != "no")
|
|
|
|
qmakeConfig << "warnings_are_errors";
|
2012-12-22 21:12:02 +00:00
|
|
|
if (dictionary["HEADERSCLEAN"] != "no")
|
|
|
|
qmakeConfig << "headersclean";
|
2012-12-22 02:31:54 +00:00
|
|
|
} else {
|
|
|
|
if (dictionary["WERROR"] == "yes")
|
|
|
|
qmakeConfig << "warnings_are_errors";
|
2012-12-22 21:12:02 +00:00
|
|
|
if (dictionary["HEADERSCLEAN"] == "yes")
|
|
|
|
qmakeConfig << "headersclean";
|
2012-12-22 02:31:54 +00:00
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2011-11-17 09:37:24 +00:00
|
|
|
if (dictionary["FORCE_ASSERTS"] == "yes")
|
|
|
|
qtConfig += "force_asserts";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
for (QStringList::Iterator dis = disabledModules.begin(); dis != disabledModules.end(); ++dis) {
|
|
|
|
modules.removeAll((*dis));
|
|
|
|
}
|
|
|
|
for (QStringList::Iterator ena = enabledModules.begin(); ena != enabledModules.end(); ++ena) {
|
|
|
|
if (modules.indexOf((*ena)) == -1)
|
|
|
|
modules += (*ena);
|
|
|
|
}
|
|
|
|
qtConfig += modules;
|
|
|
|
|
|
|
|
for (QStringList::Iterator it = disabledModules.begin(); it != disabledModules.end(); ++it)
|
|
|
|
qtConfig.removeAll(*it);
|
|
|
|
|
2016-08-01 10:40:03 +00:00
|
|
|
if ((dictionary["REDO"] != "yes") && (dictionary["DONE"] != "error"))
|
2011-04-27 10:05:43 +00:00
|
|
|
saveCmdLine();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Modifies the default configuration based on given -platform option.
|
|
|
|
Eg. switches to different default styles for Windows CE.
|
|
|
|
*/
|
|
|
|
void Configure::applySpecSpecifics()
|
|
|
|
{
|
2013-01-31 10:26:11 +00:00
|
|
|
if (dictionary.contains("XQMAKESPEC")) {
|
2013-06-17 09:00:19 +00:00
|
|
|
//Disable building tools when cross compiling.
|
|
|
|
nobuildParts << "tools";
|
2012-06-20 14:00:34 +00:00
|
|
|
}
|
|
|
|
|
2013-09-02 08:55:55 +00:00
|
|
|
if (dictionary.value("XQMAKESPEC").startsWith("winphone") || dictionary.value("XQMAKESPEC").startsWith("winrt")) {
|
|
|
|
dictionary[ "STYLE_WINDOWSXP" ] = "no";
|
|
|
|
dictionary[ "STYLE_WINDOWSVISTA" ] = "no";
|
|
|
|
dictionary[ "LIBJPEG" ] = "qt";
|
|
|
|
dictionary[ "LIBPNG" ] = "qt";
|
|
|
|
dictionary[ "FREETYPE" ] = "yes";
|
2014-08-12 17:04:05 +00:00
|
|
|
dictionary[ "SSL" ] = "yes";
|
2013-12-06 06:25:37 +00:00
|
|
|
dictionary[ "OPENSSL" ] = "no";
|
2013-09-02 08:55:55 +00:00
|
|
|
dictionary[ "DBUS" ] = "no";
|
2016-02-19 14:18:47 +00:00
|
|
|
dictionary[ "SYSTEM_ZLIB" ] = "no";
|
2013-09-02 08:55:55 +00:00
|
|
|
dictionary[ "PCRE" ] = "qt";
|
|
|
|
dictionary[ "ICU" ] = "qt";
|
|
|
|
dictionary[ "LARGE_FILE" ] = "no";
|
2013-01-31 10:26:11 +00:00
|
|
|
} else if (dictionary.value("XQMAKESPEC").startsWith("linux")) { //TODO actually wrong.
|
2011-04-27 10:05:43 +00:00
|
|
|
//TODO
|
|
|
|
dictionary[ "STYLE_WINDOWSXP" ] = "no";
|
|
|
|
dictionary[ "STYLE_WINDOWSVISTA" ] = "no";
|
|
|
|
dictionary[ "OPENGL" ] = "no";
|
|
|
|
dictionary[ "DBUS"] = "no";
|
|
|
|
dictionary[ "QT_INOTIFY" ] = "no";
|
2012-05-08 02:56:45 +00:00
|
|
|
dictionary[ "QT_CUPS" ] = "no";
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary[ "QT_GLIB" ] = "no";
|
|
|
|
dictionary[ "QT_ICONV" ] = "no";
|
2014-04-02 09:54:36 +00:00
|
|
|
dictionary[ "QT_EVDEV" ] = "no";
|
2014-04-07 08:38:26 +00:00
|
|
|
dictionary[ "QT_MTDEV" ] = "no";
|
2013-11-11 15:51:09 +00:00
|
|
|
dictionary[ "FONT_CONFIG" ] = "auto";
|
2015-02-02 20:42:48 +00:00
|
|
|
dictionary[ "ANGLE" ] = "no";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2015-10-15 13:24:54 +00:00
|
|
|
} else if (platform() == QNX) {
|
2016-03-18 15:56:43 +00:00
|
|
|
dictionary[ "REDUCE_EXPORTS" ] = "yes";
|
2012-09-20 12:11:25 +00:00
|
|
|
dictionary["STACK_PROTECTOR_STRONG"] = "auto";
|
2012-09-18 18:15:18 +00:00
|
|
|
dictionary["SLOG2"] = "auto";
|
2013-10-16 15:38:32 +00:00
|
|
|
dictionary["QNX_IMF"] = "auto";
|
2013-11-21 11:58:22 +00:00
|
|
|
dictionary["PPS"] = "auto";
|
2014-01-29 12:43:03 +00:00
|
|
|
dictionary["LGMON"] = "auto";
|
2013-07-01 16:36:34 +00:00
|
|
|
dictionary["QT_XKBCOMMON"] = "no";
|
2013-10-31 12:31:11 +00:00
|
|
|
dictionary[ "ANGLE" ] = "no";
|
Dynamic GL switch on Windows
The patch introduces a new build configuration on Windows which
can be requested by passing -opengl dynamic to configure.
Platforms other than Windows (including WinRT) are not affected.
The existing Angle and desktop configurations are not affected.
These continue to function as before and Angle remains the default.
In the future, when all modules have added support for the dynamic
path, as described below, the default configuration could be changed
to be the dynamic one. This would allow providing a single set of
binaries in the official builds instead of the current two.
When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are
never defined. Instead, the code path that has traditionally been
desktop GL only becomes the dynamic path that has to do runtime
checks. Qt modules and applications are not linked to opengl32.dll or
libegl/glesv2.dll in this case. Instead, QtGui exports all necessary
egl/egl/gl functions which will, under the hood, forward all requests
to a dynamically loaded EGL/WGL/GL implementation.
Porting guide (better said, changes needed to prepare your code to
work with dynamic GL builds when the fallback to Angle is utilized):
1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to
differentiate between desktop and ES where needed. Keep in mind that
it is the desktop GL header (plus qopenglext.h) that is included,
not the GLES one.
QtGui's proxy will handle some differences, for example calling
glClearDepth will route to glClearDepthf when needed. The built-in
eglGetProcAddress is able to retrieve pointers for standard GLES2
functions too so code resolving OpenGL 2 functions will function
in any case.
2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds,
but never "angle" or "opengles2".
3. The preprocessor define QT_OPENGL_DYNAMIC is also available in
dynamic builds. The usage of this is strongly discouraged and should
not be needed anywhere except for QtGui and the platform plugin.
4. Code in need of the library handle can use
QOpenGLFunctions::platformGLHandle().
The decision on which library to load is currently based on a simple
test that creates a dummy window/context and tries to resolve an
OpenGL 2 function. If this fails, it goes for Angle. This seems to work
well on Win7 PCs for example that do not have proper graphics drivers
providing OpenGL installed but are D3D9 capable using the default drivers.
Setting QT_OPENGL to desktop or angle skips the test and forces
usage of the given GL. There are also two new application attributes
that could be used for the same purpose.
If Angle is requested but the libraries are not present, desktop is
tried. If desktop is requested, or if angle is requested but nothing
works, the EGL/WGL functions will still be callable but will return 0.
This conveniently means that eglInitialize() and such will report a failure.
Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will
tell which implementation is chosen.
The textures example application is ported to OpenGL 2, the GL 1
code path is removed.
[ChangeLog][QtGui] Qt builds on Windows can now be configured for
dynamic loading of the OpenGL implementation. This can be requested
by passing -opengl dynamic to configure. In this mode no modules will
link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will
dynamically choose between desktop and Angle during the first GL/EGL/WGL
call. This allows deploying applications with a single set of Qt libraries
with the ability of transparently falling back to Angle in case the
opengl32.dll is not suitable, due to missing graphics drivers for example.
Task-number: QTBUG-36483
Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-01-27 13:45:11 +00:00
|
|
|
dictionary[ "DYNAMICGL" ] = "no";
|
2013-11-11 15:51:09 +00:00
|
|
|
dictionary[ "FONT_CONFIG" ] = "auto";
|
2016-03-18 15:56:43 +00:00
|
|
|
dictionary[ "ICU" ] = "auto";
|
2015-12-11 01:42:15 +00:00
|
|
|
dictionary[ "POLL" ] = "poll";
|
2016-05-09 06:50:32 +00:00
|
|
|
dictionary[ "ZLIB" ] = "system";
|
2013-03-27 20:34:42 +00:00
|
|
|
} else if (platform() == ANDROID) {
|
|
|
|
dictionary[ "REDUCE_EXPORTS" ] = "yes";
|
|
|
|
dictionary[ "BUILD" ] = "release";
|
|
|
|
dictionary[ "BUILDALL" ] = "no";
|
|
|
|
dictionary[ "LARGE_FILE" ] = "no";
|
|
|
|
dictionary[ "ANGLE" ] = "no";
|
Dynamic GL switch on Windows
The patch introduces a new build configuration on Windows which
can be requested by passing -opengl dynamic to configure.
Platforms other than Windows (including WinRT) are not affected.
The existing Angle and desktop configurations are not affected.
These continue to function as before and Angle remains the default.
In the future, when all modules have added support for the dynamic
path, as described below, the default configuration could be changed
to be the dynamic one. This would allow providing a single set of
binaries in the official builds instead of the current two.
When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are
never defined. Instead, the code path that has traditionally been
desktop GL only becomes the dynamic path that has to do runtime
checks. Qt modules and applications are not linked to opengl32.dll or
libegl/glesv2.dll in this case. Instead, QtGui exports all necessary
egl/egl/gl functions which will, under the hood, forward all requests
to a dynamically loaded EGL/WGL/GL implementation.
Porting guide (better said, changes needed to prepare your code to
work with dynamic GL builds when the fallback to Angle is utilized):
1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to
differentiate between desktop and ES where needed. Keep in mind that
it is the desktop GL header (plus qopenglext.h) that is included,
not the GLES one.
QtGui's proxy will handle some differences, for example calling
glClearDepth will route to glClearDepthf when needed. The built-in
eglGetProcAddress is able to retrieve pointers for standard GLES2
functions too so code resolving OpenGL 2 functions will function
in any case.
2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds,
but never "angle" or "opengles2".
3. The preprocessor define QT_OPENGL_DYNAMIC is also available in
dynamic builds. The usage of this is strongly discouraged and should
not be needed anywhere except for QtGui and the platform plugin.
4. Code in need of the library handle can use
QOpenGLFunctions::platformGLHandle().
The decision on which library to load is currently based on a simple
test that creates a dummy window/context and tries to resolve an
OpenGL 2 function. If this fails, it goes for Angle. This seems to work
well on Win7 PCs for example that do not have proper graphics drivers
providing OpenGL installed but are D3D9 capable using the default drivers.
Setting QT_OPENGL to desktop or angle skips the test and forces
usage of the given GL. There are also two new application attributes
that could be used for the same purpose.
If Angle is requested but the libraries are not present, desktop is
tried. If desktop is requested, or if angle is requested but nothing
works, the EGL/WGL functions will still be callable but will return 0.
This conveniently means that eglInitialize() and such will report a failure.
Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will
tell which implementation is chosen.
The textures example application is ported to OpenGL 2, the GL 1
code path is removed.
[ChangeLog][QtGui] Qt builds on Windows can now be configured for
dynamic loading of the OpenGL implementation. This can be requested
by passing -opengl dynamic to configure. In this mode no modules will
link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will
dynamically choose between desktop and Angle during the first GL/EGL/WGL
call. This allows deploying applications with a single set of Qt libraries
with the ability of transparently falling back to Angle in case the
opengl32.dll is not suitable, due to missing graphics drivers for example.
Task-number: QTBUG-36483
Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-01-27 13:45:11 +00:00
|
|
|
dictionary[ "DYNAMICGL" ] = "no";
|
2013-03-27 20:34:42 +00:00
|
|
|
dictionary[ "REDUCE_RELOCATIONS" ] = "yes";
|
|
|
|
dictionary[ "QT_GETIFADDRS" ] = "no";
|
2013-05-14 01:02:21 +00:00
|
|
|
dictionary[ "QT_XKBCOMMON" ] = "no";
|
2014-09-30 08:34:00 +00:00
|
|
|
dictionary["ANDROID_STYLE_ASSETS"] = "yes";
|
2014-12-16 11:18:25 +00:00
|
|
|
dictionary[ "STYLE_ANDROID" ] = "yes";
|
2015-12-11 01:42:15 +00:00
|
|
|
dictionary[ "POLL" ] = "poll";
|
2016-05-04 13:22:01 +00:00
|
|
|
dictionary[ "ZLIB" ] = "system";
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-01 13:31:16 +00:00
|
|
|
// Locate a file and return its containing directory.
|
|
|
|
QString Configure::locateFile(const QString &fileName) const
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
2015-03-10 13:25:57 +00:00
|
|
|
const QString mkspec = dictionary.contains(QStringLiteral("XQMAKESPEC"))
|
|
|
|
? dictionary[QStringLiteral("XQMAKESPEC")] : dictionary[QStringLiteral("QMAKESPEC")];
|
2011-04-27 10:05:43 +00:00
|
|
|
const QString file = fileName.toLower();
|
2012-11-01 13:31:16 +00:00
|
|
|
QStringList pathList;
|
2011-04-27 10:05:43 +00:00
|
|
|
if (file.endsWith(".h")) {
|
2012-11-01 13:31:16 +00:00
|
|
|
static const QStringList headerPaths =
|
2015-03-10 13:25:57 +00:00
|
|
|
Environment::headerPaths(Environment::compilerFromQMakeSpec(mkspec));
|
2014-10-22 08:51:49 +00:00
|
|
|
pathList = qmakeIncludes;
|
|
|
|
pathList += headerPaths;
|
2011-04-27 10:05:43 +00:00
|
|
|
} else if (file.endsWith(".lib") || file.endsWith(".a")) {
|
2012-11-01 13:31:16 +00:00
|
|
|
static const QStringList libPaths =
|
2015-03-10 13:25:57 +00:00
|
|
|
Environment::libraryPaths(Environment::compilerFromQMakeSpec(mkspec));
|
2012-11-01 13:31:16 +00:00
|
|
|
pathList = libPaths;
|
2011-04-27 10:05:43 +00:00
|
|
|
} else {
|
2012-11-01 13:31:16 +00:00
|
|
|
// Fallback for .exe and .dll (latter are not covered by QStandardPaths).
|
|
|
|
static const QStringList exePaths = Environment::path();
|
|
|
|
pathList = exePaths;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2012-11-01 13:31:16 +00:00
|
|
|
return Environment::findFileInPaths(file, pathList);
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Default value for options marked as "auto" if the test passes.
|
|
|
|
(Used both by the autoDetection() below, and the desc() function
|
|
|
|
to mark (+) the default option of autodetecting options.
|
|
|
|
*/
|
|
|
|
QString Configure::defaultTo(const QString &option)
|
|
|
|
{
|
|
|
|
// We prefer using the system version of the 3rd party libs
|
2016-02-19 14:18:47 +00:00
|
|
|
if (option == "PCRE"
|
2011-04-27 10:05:43 +00:00
|
|
|
|| option == "LIBJPEG"
|
2012-01-25 15:04:51 +00:00
|
|
|
|| option == "LIBPNG")
|
2011-04-27 10:05:43 +00:00
|
|
|
return "system";
|
|
|
|
|
|
|
|
// These database drivers and image formats can be built-in or plugins.
|
|
|
|
// Prefer plugins when Qt is shared.
|
|
|
|
if (dictionary[ "SHARED" ] == "yes") {
|
|
|
|
if (option == "SQL_MYSQL"
|
|
|
|
|| option == "SQL_MYSQL"
|
|
|
|
|| option == "SQL_ODBC"
|
|
|
|
|| option == "SQL_OCI"
|
|
|
|
|| option == "SQL_PSQL"
|
|
|
|
|| option == "SQL_TDS"
|
|
|
|
|| option == "SQL_DB2"
|
|
|
|
|| option == "SQL_SQLITE"
|
|
|
|
|| option == "SQL_SQLITE2"
|
2016-04-06 08:15:14 +00:00
|
|
|
|| option == "SQL_IBASE")
|
2016-03-18 12:35:40 +00:00
|
|
|
return "yes";
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// By default we do not want to compile OCI driver when compiling with
|
2013-01-27 04:58:38 +00:00
|
|
|
// MinGW, due to lack of such support from Oracle. It prob. won't work.
|
2011-04-27 10:05:43 +00:00
|
|
|
// (Customer may force the use though)
|
|
|
|
if (dictionary["QMAKESPEC"].endsWith("-g++")
|
|
|
|
&& option == "SQL_OCI")
|
|
|
|
return "no";
|
|
|
|
|
2012-09-26 13:37:03 +00:00
|
|
|
// keep 'auto' default for msvc, since we can't set the language supported
|
2015-07-09 00:21:30 +00:00
|
|
|
if (option == "C++STD"
|
2012-09-26 13:37:03 +00:00
|
|
|
&& dictionary["QMAKESPEC"].contains("msvc"))
|
|
|
|
return "auto";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
if (option == "SYNCQT"
|
2013-05-28 19:34:05 +00:00
|
|
|
&& (!QFile::exists(sourcePath + "/.git")))
|
2011-04-27 10:05:43 +00:00
|
|
|
return "no";
|
|
|
|
|
|
|
|
return "yes";
|
|
|
|
}
|
|
|
|
|
2012-11-02 09:41:22 +00:00
|
|
|
bool Configure::checkAngleAvailability(QString *errorMessage /* = 0 */) const
|
|
|
|
{
|
|
|
|
// Check for Direct X SDK (include lib and direct shader compiler 'fxc').
|
|
|
|
// Up to Direct X SDK June 2010 and for MinGW, this is pointed to by the
|
|
|
|
// DXSDK_DIR variable. Starting with Windows Kit 8, it is included
|
|
|
|
// in the Windows SDK. Checking for the header is not sufficient since
|
|
|
|
// it is also present in MinGW.
|
|
|
|
const QString directXSdk = Environment::detectDirectXSdk();
|
|
|
|
const Compiler compiler = Environment::compilerFromQMakeSpec(dictionary[QStringLiteral("QMAKESPEC")]);
|
|
|
|
const QString compilerHeader = QStringLiteral("d3dcompiler.h");
|
|
|
|
if (!findFile(compilerHeader)) {
|
|
|
|
if (errorMessage)
|
|
|
|
*errorMessage = QString::fromLatin1("The header '%1' could not be found.").arg(compilerHeader);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (dictionary["SSE2"] != "no") {
|
|
|
|
const QString intrinHeader = QStringLiteral("intrin.h"); // Not present on MinGW-32
|
|
|
|
if (!findFile(intrinHeader)) {
|
|
|
|
if (errorMessage)
|
|
|
|
*errorMessage = QString::fromLatin1("The header '%1' required for SSE2 could not be found.").arg(intrinHeader);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-02 12:04:43 +00:00
|
|
|
const QString directXLibrary = QStringLiteral("d3d11.lib"); // Ensures at least the June 2010 DXSDK is present
|
2012-11-02 09:41:22 +00:00
|
|
|
if (!findFile(directXLibrary)) {
|
|
|
|
if (errorMessage)
|
|
|
|
*errorMessage = QString::fromLatin1("The library '%1' could not be found.").arg(directXLibrary);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const QString fxcBinary = QStringLiteral("fxc.exe");
|
|
|
|
QStringList additionalPaths;
|
|
|
|
if (!directXSdk.isEmpty())
|
|
|
|
additionalPaths.push_back(directXSdk + QStringLiteral("/Utilities/bin/x86"));
|
|
|
|
QString fxcPath = QStandardPaths::findExecutable(fxcBinary, additionalPaths);
|
|
|
|
if (fxcPath.isEmpty()) {
|
|
|
|
if (errorMessage)
|
|
|
|
*errorMessage = QString::fromLatin1("The shader compiler '%1' could not be found.").arg(fxcBinary);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-07-17 21:46:05 +00:00
|
|
|
QString Configure::checkAvx512Availability()
|
|
|
|
{
|
|
|
|
static const char avx512features[][5] = { "cd", "er", "pf", "bw", "dq", "vl", "ifma", "vbmi" };
|
|
|
|
|
|
|
|
// try AVX512 Foundation. No Foundation, nothing else works.
|
|
|
|
if (!tryCompileProject("common/avx512", "AVX512=F"))
|
|
|
|
return QString();
|
|
|
|
|
|
|
|
QString available = "avx512f";
|
2016-04-22 13:47:55 +00:00
|
|
|
for (size_t i = 0; i < sizeof(avx512features)/sizeof(avx512features[0]); ++i) {
|
2015-07-17 21:46:05 +00:00
|
|
|
if (tryCompileProject("common/avx512", QStringLiteral("AVX512=%0").arg(avx512features[i]).toUpper())) {
|
|
|
|
available += " avx512";
|
|
|
|
available += avx512features[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return available;
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
/*!
|
|
|
|
Checks the system for the availability of a feature.
|
|
|
|
Returns true if the feature is available, else false.
|
|
|
|
*/
|
2012-11-02 09:41:22 +00:00
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
bool Configure::checkAvailability(const QString &part)
|
|
|
|
{
|
|
|
|
bool available = false;
|
|
|
|
if (part == "STYLE_WINDOWSXP")
|
2012-07-18 13:25:13 +00:00
|
|
|
available = (platform() == WINDOWS) && findFile("uxtheme.h");
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2014-04-09 08:17:20 +00:00
|
|
|
else if (part == "OBJCOPY")
|
|
|
|
available = tryCompileProject("unix/objcopy");
|
|
|
|
|
2015-09-08 23:35:33 +00:00
|
|
|
else if (part == "ATOMIC64")
|
|
|
|
available = tryCompileProject("common/atomic64");
|
|
|
|
|
|
|
|
else if (part == "ATOMIC64-LIBATOMIC")
|
|
|
|
available = tryCompileProject("common/atomic64", "LIBS+=-latomic");
|
|
|
|
|
2015-10-28 02:48:04 +00:00
|
|
|
else if (part == "ATOMICFPTR")
|
|
|
|
available = tryCompileProject("common/atomicfptr");
|
|
|
|
|
2016-02-19 14:18:47 +00:00
|
|
|
else if (part == "SYSTEM_ZLIB")
|
2011-04-27 10:05:43 +00:00
|
|
|
available = findFile("zlib.h");
|
|
|
|
|
2012-01-23 22:31:13 +00:00
|
|
|
else if (part == "PCRE")
|
|
|
|
available = findFile("pcre.h");
|
|
|
|
|
2012-03-08 02:51:27 +00:00
|
|
|
else if (part == "ICU")
|
2013-11-11 15:49:31 +00:00
|
|
|
available = tryCompileProject("unix/icu");
|
2012-03-08 02:51:27 +00:00
|
|
|
|
2013-08-26 15:44:36 +00:00
|
|
|
else if (part == "HARFBUZZ")
|
|
|
|
available = tryCompileProject("unix/harfbuzz");
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
else if (part == "LIBJPEG")
|
|
|
|
available = findFile("jpeglib.h");
|
|
|
|
else if (part == "LIBPNG")
|
|
|
|
available = findFile("png.h");
|
|
|
|
else if (part == "SQL_MYSQL")
|
|
|
|
available = findFile("mysql.h") && findFile("libmySQL.lib");
|
|
|
|
else if (part == "SQL_ODBC")
|
|
|
|
available = findFile("sql.h") && findFile("sqlext.h") && findFile("odbc32.lib");
|
|
|
|
else if (part == "SQL_OCI")
|
|
|
|
available = findFile("oci.h") && findFile("oci.lib");
|
|
|
|
else if (part == "SQL_PSQL")
|
|
|
|
available = findFile("libpq-fe.h") && findFile("libpq.lib") && findFile("ws2_32.lib") && findFile("advapi32.lib");
|
|
|
|
else if (part == "SQL_TDS")
|
|
|
|
available = findFile("sybfront.h") && findFile("sybdb.h") && findFile("ntwdblib.lib");
|
|
|
|
else if (part == "SQL_DB2")
|
|
|
|
available = findFile("sqlcli.h") && findFile("sqlcli1.h") && findFile("db2cli.lib");
|
|
|
|
else if (part == "SQL_SQLITE")
|
2011-11-07 09:16:21 +00:00
|
|
|
available = true; // Built in, we have a fork
|
2011-04-27 10:05:43 +00:00
|
|
|
else if (part == "SQL_SQLITE_LIB") {
|
|
|
|
if (dictionary[ "SQL_SQLITE_LIB" ] == "system") {
|
2015-10-15 13:24:54 +00:00
|
|
|
if (platform() == QNX) {
|
2012-07-17 09:52:10 +00:00
|
|
|
available = true;
|
2016-03-20 22:07:46 +00:00
|
|
|
dictionary[ "QMAKE_LIBS_SQLITE" ] += "-lsqlite3 -lz";
|
2012-07-17 09:52:10 +00:00
|
|
|
} else {
|
|
|
|
available = findFile("sqlite3.h") && findFile("sqlite3.lib");
|
|
|
|
if (available)
|
2016-03-20 22:07:46 +00:00
|
|
|
dictionary[ "QMAKE_LIBS_SQLITE" ] += "sqlite3.lib";
|
2012-07-17 09:52:10 +00:00
|
|
|
}
|
|
|
|
} else {
|
2011-04-27 10:05:43 +00:00
|
|
|
available = true;
|
2012-07-17 09:52:10 +00:00
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
} else if (part == "SQL_SQLITE2")
|
|
|
|
available = findFile("sqlite.h") && findFile("sqlite.lib");
|
|
|
|
else if (part == "SQL_IBASE")
|
|
|
|
available = findFile("ibase.h") && (findFile("gds32_ms.lib") || findFile("gds32.lib"));
|
|
|
|
else if (part == "SSE2")
|
2011-12-30 00:44:16 +00:00
|
|
|
available = tryCompileProject("common/sse2");
|
|
|
|
else if (part == "SSE3")
|
|
|
|
available = tryCompileProject("common/sse3");
|
|
|
|
else if (part == "SSSE3")
|
|
|
|
available = tryCompileProject("common/ssse3");
|
|
|
|
else if (part == "SSE4_1")
|
|
|
|
available = tryCompileProject("common/sse4_1");
|
|
|
|
else if (part == "SSE4_2")
|
|
|
|
available = tryCompileProject("common/sse4_2");
|
|
|
|
else if (part == "AVX")
|
|
|
|
available = tryCompileProject("common/avx");
|
|
|
|
else if (part == "AVX2")
|
|
|
|
available = tryCompileProject("common/avx2");
|
2011-04-27 10:05:43 +00:00
|
|
|
else if (part == "OPENSSL")
|
|
|
|
available = findFile("openssl\\ssl.h");
|
2015-01-27 17:41:32 +00:00
|
|
|
else if (part == "LIBPROXY")
|
|
|
|
available = dictionary.contains("XQMAKESPEC") && tryCompileProject("common/libproxy");
|
2011-04-27 10:05:43 +00:00
|
|
|
else if (part == "DBUS")
|
|
|
|
available = findFile("dbus\\dbus.h");
|
2016-03-04 16:11:09 +00:00
|
|
|
else if (part == "INCREDIBUILD_XGE") {
|
2012-11-01 13:31:16 +00:00
|
|
|
available = !QStandardPaths::findExecutable(QStringLiteral("BuildConsole.exe")).isEmpty()
|
|
|
|
&& !QStandardPaths::findExecutable(QStringLiteral("xgConsole.exe")).isEmpty();
|
2013-07-22 11:45:30 +00:00
|
|
|
} else if (part == "WMF_BACKEND") {
|
|
|
|
available = findFile("mfapi.h") && findFile("mf.lib");
|
2011-04-27 10:05:43 +00:00
|
|
|
} else if (part == "DIRECTWRITE") {
|
2015-06-15 12:09:19 +00:00
|
|
|
available = tryCompileProject("win/directwrite");
|
Add color font support on Windows
Detect if DirectWrite 2 is available, and support color fonts if possible.
One limitation worth mentioning is that if the color font contains regular,
monochrome glyphs as well, then these will be drawn in black, and not in the
pen color. Fixing this would require some elaborate rewrites in the font
rendering system, since we would have to have two font caches per
color font (one for mono and one for colors), or do some sort of trick where
we make argb(r, g, b, 0) mean subpixel alpha instead, and detect glyphs that
are not correctly premultiplied when blitting to the screen.
Another limitation is that the approach does not work with distance field
rendering. In principle we could support this on Windows, since the
format is vector based, but it would also require substantial work and
it is not possible to support for Apple/Google fonts anyway, so it would
just lead to code which is not cross-platform.
[ChangeLog][Windows] Added support for color fonts (color emojis) when
DirectWrite 2 is available.
Change-Id: I6a608dd5d2aa3a7e762a06830902bddac7c550a5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-12-16 14:52:28 +00:00
|
|
|
} else if (part == "DIRECTWRITE2") {
|
|
|
|
available = tryCompileProject("win/directwrite2");
|
2013-12-04 11:40:23 +00:00
|
|
|
} else if (part == "DIRECT2D") {
|
|
|
|
available = tryCompileProject("qpa/direct2d");
|
2012-07-18 12:06:42 +00:00
|
|
|
} else if (part == "ICONV") {
|
|
|
|
available = tryCompileProject("unix/iconv") || tryCompileProject("unix/gnu-libiconv");
|
2014-04-02 09:54:36 +00:00
|
|
|
} else if (part == "EVDEV") {
|
|
|
|
available = tryCompileProject("unix/evdev");
|
2014-04-07 08:38:26 +00:00
|
|
|
} else if (part == "MTDEV") {
|
|
|
|
available = tryCompileProject("unix/mtdev");
|
2015-03-12 13:18:26 +00:00
|
|
|
} else if (part == "TSLIB") {
|
|
|
|
available = tryCompileProject("unix/tslib");
|
2012-11-14 16:33:16 +00:00
|
|
|
} else if (part == "INOTIFY") {
|
|
|
|
available = tryCompileProject("unix/inotify");
|
2013-05-07 21:40:38 +00:00
|
|
|
} else if (part == "QT_EVENTFD") {
|
|
|
|
available = tryCompileProject("unix/eventfd");
|
2012-07-18 13:37:21 +00:00
|
|
|
} else if (part == "CUPS") {
|
2016-03-04 16:11:09 +00:00
|
|
|
available = (platform() != WINDOWS) && (platform() != WINDOWS_RT) && tryCompileProject("unix/cups");
|
2012-09-20 12:11:25 +00:00
|
|
|
} else if (part == "STACK_PROTECTOR_STRONG") {
|
2015-10-15 13:24:54 +00:00
|
|
|
available = (platform() == QNX) && compilerSupportsFlag("qcc -fstack-protector-strong");
|
2012-09-18 18:15:18 +00:00
|
|
|
} else if (part == "SLOG2") {
|
|
|
|
available = tryCompileProject("unix/slog2");
|
2013-10-16 15:38:32 +00:00
|
|
|
} else if (part == "QNX_IMF") {
|
|
|
|
available = tryCompileProject("unix/qqnx_imf");
|
2013-11-21 11:58:22 +00:00
|
|
|
} else if (part == "PPS") {
|
2015-10-15 13:24:54 +00:00
|
|
|
available = (platform() == QNX) && tryCompileProject("unix/pps");
|
2014-01-29 12:43:03 +00:00
|
|
|
} else if (part == "LGMON") {
|
2015-10-15 13:24:54 +00:00
|
|
|
available = (platform() == QNX) && tryCompileProject("unix/lgmon");
|
2014-09-24 14:31:33 +00:00
|
|
|
} else if (part == "SCTP") {
|
|
|
|
available = tryCompileProject("unix/sctp");
|
2013-11-11 15:48:33 +00:00
|
|
|
} else if (part == "NEON") {
|
2014-06-25 00:03:53 +00:00
|
|
|
available = dictionary["QT_CPU_FEATURES"].contains("neon");
|
2013-11-11 15:51:09 +00:00
|
|
|
} else if (part == "FONT_CONFIG") {
|
|
|
|
available = tryCompileProject("unix/fontconfig");
|
2015-10-15 13:40:26 +00:00
|
|
|
} else if (part == "DOUBLECONVERSION") {
|
|
|
|
available = tryCompileProject("unix/doubleconversion");
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return available;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Autodetect options marked as "auto".
|
|
|
|
*/
|
|
|
|
void Configure::autoDetection()
|
|
|
|
{
|
2013-03-12 19:00:37 +00:00
|
|
|
cout << "Running configuration tests..." << endl;
|
|
|
|
|
2013-11-11 15:47:54 +00:00
|
|
|
// Auto-detect CPU architectures.
|
|
|
|
detectArch();
|
|
|
|
|
2015-07-09 00:21:30 +00:00
|
|
|
if (dictionary["C++STD"] == "auto" && !dictionary["QMAKESPEC"].contains("msvc")) {
|
2016-07-07 09:18:41 +00:00
|
|
|
if (!tryCompileProject("common/c++14")) {
|
2015-07-09 00:21:30 +00:00
|
|
|
dictionary["C++STD"] = "c++11";
|
|
|
|
} else if (!tryCompileProject("common/c++1z")) {
|
|
|
|
dictionary["C++STD"] = "c++14";
|
|
|
|
} else {
|
|
|
|
dictionary["C++STD"] = "c++1z";
|
|
|
|
}
|
2012-09-05 08:31:49 +00:00
|
|
|
}
|
|
|
|
|
2015-09-08 23:35:33 +00:00
|
|
|
if (dictionary["ATOMIC64"] == "auto")
|
|
|
|
dictionary["ATOMIC64"] = checkAvailability("ATOMIC64") ? "yes" :
|
|
|
|
checkAvailability("ATOMIC64-LIBATOMIC") ? "libatomic" : "no";
|
|
|
|
|
2015-10-28 02:48:04 +00:00
|
|
|
// special case:
|
|
|
|
if (!checkAvailability("ATOMICFPTR")) {
|
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
cout << "ERROR: detected an std::atomic implementation that fails for function pointers." << endl
|
|
|
|
<< "Please apply the patch corresponding to your Standard Library vendor, found in" << endl
|
|
|
|
<< sourcePath << "/config.tests/common/atomicfptr" << endl;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Style detection
|
|
|
|
if (dictionary["STYLE_WINDOWSXP"] == "auto")
|
|
|
|
dictionary["STYLE_WINDOWSXP"] = checkAvailability("STYLE_WINDOWSXP") ? defaultTo("STYLE_WINDOWSXP") : "no";
|
|
|
|
if (dictionary["STYLE_WINDOWSVISTA"] == "auto") // Vista style has the same requirements as XP style
|
|
|
|
dictionary["STYLE_WINDOWSVISTA"] = checkAvailability("STYLE_WINDOWSXP") ? defaultTo("STYLE_WINDOWSVISTA") : "no";
|
|
|
|
|
|
|
|
// Compression detection
|
2016-02-19 14:18:47 +00:00
|
|
|
if (dictionary["SYSTEM_ZLIB"] == "auto")
|
|
|
|
dictionary["SYSTEM_ZLIB"] = checkAvailability("SYSTEM_ZLIB") ? "yes" : "no";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2012-01-23 22:31:13 +00:00
|
|
|
// PCRE detection
|
|
|
|
if (dictionary["PCRE"] == "auto")
|
|
|
|
dictionary["PCRE"] = checkAvailability("PCRE") ? defaultTo("PCRE") : "qt";
|
|
|
|
|
2012-03-08 02:51:27 +00:00
|
|
|
// ICU detection
|
|
|
|
if (dictionary["ICU"] == "auto")
|
|
|
|
dictionary["ICU"] = checkAvailability("ICU") ? "yes" : "no";
|
|
|
|
|
2012-10-15 12:16:51 +00:00
|
|
|
// ANGLE detection
|
|
|
|
if (dictionary["ANGLE"] == "auto") {
|
2016-07-07 14:36:26 +00:00
|
|
|
if (dictionary["OPENGL_ES_2"] == "yes" || dictionary["DYNAMICGL"] == "yes") {
|
|
|
|
QString err;
|
|
|
|
dictionary["ANGLE"] = checkAngleAvailability(&err) ? "yes" : "no";
|
2012-11-02 09:41:22 +00:00
|
|
|
dictionary["ANGLE_FROM"] = "detected";
|
2016-07-07 14:36:26 +00:00
|
|
|
dictionary["ANGLE_ERR"] = err;
|
2012-11-02 09:41:22 +00:00
|
|
|
} else {
|
|
|
|
dictionary["ANGLE"] = "no";
|
|
|
|
}
|
2012-10-15 12:16:51 +00:00
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Image format detection
|
|
|
|
if (dictionary["LIBJPEG"] == "auto")
|
|
|
|
dictionary["LIBJPEG"] = checkAvailability("LIBJPEG") ? defaultTo("LIBJPEG") : "qt";
|
|
|
|
if (dictionary["LIBPNG"] == "auto")
|
|
|
|
dictionary["LIBPNG"] = checkAvailability("LIBPNG") ? defaultTo("LIBPNG") : "qt";
|
|
|
|
|
|
|
|
// SQL detection (not on by default)
|
|
|
|
if (dictionary["SQL_MYSQL"] == "auto")
|
|
|
|
dictionary["SQL_MYSQL"] = checkAvailability("SQL_MYSQL") ? defaultTo("SQL_MYSQL") : "no";
|
|
|
|
if (dictionary["SQL_ODBC"] == "auto")
|
|
|
|
dictionary["SQL_ODBC"] = checkAvailability("SQL_ODBC") ? defaultTo("SQL_ODBC") : "no";
|
|
|
|
if (dictionary["SQL_OCI"] == "auto")
|
|
|
|
dictionary["SQL_OCI"] = checkAvailability("SQL_OCI") ? defaultTo("SQL_OCI") : "no";
|
|
|
|
if (dictionary["SQL_PSQL"] == "auto")
|
|
|
|
dictionary["SQL_PSQL"] = checkAvailability("SQL_PSQL") ? defaultTo("SQL_PSQL") : "no";
|
|
|
|
if (dictionary["SQL_TDS"] == "auto")
|
|
|
|
dictionary["SQL_TDS"] = checkAvailability("SQL_TDS") ? defaultTo("SQL_TDS") : "no";
|
|
|
|
if (dictionary["SQL_DB2"] == "auto")
|
|
|
|
dictionary["SQL_DB2"] = checkAvailability("SQL_DB2") ? defaultTo("SQL_DB2") : "no";
|
|
|
|
if (dictionary["SQL_SQLITE"] == "auto")
|
|
|
|
dictionary["SQL_SQLITE"] = checkAvailability("SQL_SQLITE") ? defaultTo("SQL_SQLITE") : "no";
|
|
|
|
if (dictionary["SQL_SQLITE_LIB"] == "system")
|
|
|
|
if (!checkAvailability("SQL_SQLITE_LIB"))
|
|
|
|
dictionary["SQL_SQLITE_LIB"] = "no";
|
|
|
|
if (dictionary["SQL_SQLITE2"] == "auto")
|
|
|
|
dictionary["SQL_SQLITE2"] = checkAvailability("SQL_SQLITE2") ? defaultTo("SQL_SQLITE2") : "no";
|
|
|
|
if (dictionary["SQL_IBASE"] == "auto")
|
|
|
|
dictionary["SQL_IBASE"] = checkAvailability("SQL_IBASE") ? defaultTo("SQL_IBASE") : "no";
|
|
|
|
if (dictionary["SSE2"] == "auto")
|
|
|
|
dictionary["SSE2"] = checkAvailability("SSE2") ? "yes" : "no";
|
2011-12-30 00:44:16 +00:00
|
|
|
if (dictionary["SSE3"] == "auto")
|
|
|
|
dictionary["SSE3"] = checkAvailability("SSE3") ? "yes" : "no";
|
|
|
|
if (dictionary["SSSE3"] == "auto")
|
|
|
|
dictionary["SSSE3"] = checkAvailability("SSSE3") ? "yes" : "no";
|
|
|
|
if (dictionary["SSE4_1"] == "auto")
|
|
|
|
dictionary["SSE4_1"] = checkAvailability("SSE4_1") ? "yes" : "no";
|
|
|
|
if (dictionary["SSE4_2"] == "auto")
|
|
|
|
dictionary["SSE4_2"] = checkAvailability("SSE4_2") ? "yes" : "no";
|
|
|
|
if (dictionary["AVX"] == "auto")
|
|
|
|
dictionary["AVX"] = checkAvailability("AVX") ? "yes" : "no";
|
|
|
|
if (dictionary["AVX2"] == "auto")
|
|
|
|
dictionary["AVX2"] = checkAvailability("AVX2") ? "yes" : "no";
|
2015-07-17 21:46:05 +00:00
|
|
|
if (dictionary["AVX512"] == "auto")
|
|
|
|
dictionary["AVX512"] = checkAvx512Availability();
|
2013-11-11 15:48:33 +00:00
|
|
|
if (dictionary["NEON"] == "auto")
|
|
|
|
dictionary["NEON"] = checkAvailability("NEON") ? "yes" : "no";
|
2014-08-12 17:04:05 +00:00
|
|
|
if (dictionary["SSL"] == "auto") {
|
|
|
|
if (platform() == WINDOWS_RT) {
|
|
|
|
dictionary["SSL"] = "yes";
|
|
|
|
} else {
|
|
|
|
// On Desktop Windows openssl and ssl always have the same value (for now). OpenSSL is
|
|
|
|
// the only backend and if it is available and should be built, that also means that
|
|
|
|
// SSL support in general is enabled.
|
|
|
|
if (dictionary["OPENSSL"] == "auto")
|
|
|
|
dictionary["OPENSSL"] = checkAvailability("OPENSSL") ? "yes" : "no";
|
|
|
|
dictionary["SSL"] = dictionary["OPENSSL"];
|
|
|
|
}
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary["OPENSSL"] == "auto")
|
|
|
|
dictionary["OPENSSL"] = checkAvailability("OPENSSL") ? "yes" : "no";
|
2015-01-27 17:41:32 +00:00
|
|
|
if (dictionary["LIBPROXY"] == "auto")
|
|
|
|
dictionary["LIBPROXY"] = checkAvailability("LIBPROXY") ? "yes" : "no";
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary["DBUS"] == "auto")
|
2014-12-11 22:32:59 +00:00
|
|
|
dictionary["DBUS"] = checkAvailability("DBUS") ? "linked" : "runtime";
|
2012-03-30 11:43:10 +00:00
|
|
|
if (dictionary["QML_DEBUG"] == "auto")
|
|
|
|
dictionary["QML_DEBUG"] = dictionary["QML"] == "yes" ? "yes" : "no";
|
2013-07-22 11:45:30 +00:00
|
|
|
if (dictionary["WMF_BACKEND"] == "auto")
|
|
|
|
dictionary["WMF_BACKEND"] = checkAvailability("WMF_BACKEND") ? "yes" : "no";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
// Detection of IncrediBuild buildconsole
|
|
|
|
if (dictionary["INCREDIBUILD_XGE"] == "auto")
|
|
|
|
dictionary["INCREDIBUILD_XGE"] = checkAvailability("INCREDIBUILD_XGE") ? "yes" : "no";
|
|
|
|
|
2012-07-18 12:06:42 +00:00
|
|
|
// Detection of iconv support
|
|
|
|
if (dictionary["QT_ICONV"] == "auto")
|
|
|
|
dictionary["QT_ICONV"] = checkAvailability("ICONV") ? "yes" : "no";
|
|
|
|
|
2014-04-02 09:54:36 +00:00
|
|
|
// Detection of evdev support
|
|
|
|
if (dictionary["QT_EVDEV"] == "auto")
|
|
|
|
dictionary["QT_EVDEV"] = checkAvailability("EVDEV") ? "yes" : "no";
|
|
|
|
|
2014-04-07 08:38:26 +00:00
|
|
|
// Detection of mtdev support
|
|
|
|
if (dictionary["QT_MTDEV"] == "auto")
|
|
|
|
dictionary["QT_MTDEV"] = checkAvailability("MTDEV") ? "yes" : "no";
|
|
|
|
|
2015-03-12 13:18:26 +00:00
|
|
|
// Detection of tslib support
|
|
|
|
if (dictionary["QT_TSLIB"] == "auto")
|
|
|
|
dictionary["QT_TSLIB"] = checkAvailability("TSLIB") ? "yes" : "no";
|
|
|
|
|
2012-11-14 16:33:16 +00:00
|
|
|
// Detection of inotify
|
|
|
|
if (dictionary["QT_INOTIFY"] == "auto")
|
|
|
|
dictionary["QT_INOTIFY"] = checkAvailability("INOTIFY") ? "yes" : "no";
|
|
|
|
|
2012-07-25 13:23:46 +00:00
|
|
|
// Detection of cups support
|
2012-07-18 13:37:21 +00:00
|
|
|
if (dictionary["QT_CUPS"] == "auto")
|
|
|
|
dictionary["QT_CUPS"] = checkAvailability("CUPS") ? "yes" : "no";
|
|
|
|
|
2012-09-20 12:11:25 +00:00
|
|
|
// Detection of -fstack-protector-strong support
|
|
|
|
if (dictionary["STACK_PROTECTOR_STRONG"] == "auto")
|
|
|
|
dictionary["STACK_PROTECTOR_STRONG"] = checkAvailability("STACK_PROTECTOR_STRONG") ? "yes" : "no";
|
|
|
|
|
2015-10-15 13:24:54 +00:00
|
|
|
if (platform() == QNX && dictionary["SLOG2"] == "auto") {
|
2012-09-18 18:15:18 +00:00
|
|
|
dictionary["SLOG2"] = checkAvailability("SLOG2") ? "yes" : "no";
|
|
|
|
}
|
|
|
|
|
2015-10-15 13:24:54 +00:00
|
|
|
if (platform() == QNX && dictionary["QNX_IMF"] == "auto") {
|
2013-10-16 15:38:32 +00:00
|
|
|
dictionary["QNX_IMF"] = checkAvailability("QNX_IMF") ? "yes" : "no";
|
|
|
|
}
|
|
|
|
|
2013-11-21 11:58:22 +00:00
|
|
|
if (dictionary["PPS"] == "auto") {
|
|
|
|
dictionary["PPS"] = checkAvailability("PPS") ? "yes" : "no";
|
|
|
|
}
|
|
|
|
|
2015-10-15 13:24:54 +00:00
|
|
|
if (platform() == QNX && dictionary["LGMON"] == "auto") {
|
2014-01-29 12:43:03 +00:00
|
|
|
dictionary["LGMON"] = checkAvailability("LGMON") ? "yes" : "no";
|
|
|
|
}
|
|
|
|
|
2014-09-24 14:31:33 +00:00
|
|
|
if (dictionary["SCTP"] == "auto") {
|
|
|
|
dictionary["SCTP"] = checkAvailability("SCTP") ? "yes" : "no";
|
|
|
|
}
|
|
|
|
|
2013-05-07 21:40:38 +00:00
|
|
|
if (dictionary["QT_EVENTFD"] == "auto")
|
|
|
|
dictionary["QT_EVENTFD"] = checkAvailability("QT_EVENTFD") ? "yes" : "no";
|
|
|
|
|
2013-11-11 15:51:09 +00:00
|
|
|
if (dictionary["FONT_CONFIG"] == "auto")
|
|
|
|
dictionary["FONT_CONFIG"] = checkAvailability("FONT_CONFIG") ? "yes" : "no";
|
|
|
|
|
2016-03-18 15:44:41 +00:00
|
|
|
if ((dictionary["FONT_CONFIG"] == "yes") && (dictionary["FREETYPE_FROM"] == "default"))
|
|
|
|
dictionary["FREETYPE"] = "system";
|
|
|
|
|
2015-10-15 13:40:26 +00:00
|
|
|
if (dictionary["DOUBLECONVERSION"] == "auto")
|
|
|
|
dictionary["DOUBLECONVERSION"] = checkAvailability("DOUBLECONVERSION") ? "system" : "qt";
|
|
|
|
|
2015-06-15 12:09:19 +00:00
|
|
|
if (dictionary["DIRECTWRITE"] == "auto")
|
|
|
|
dictionary["DIRECTWRITE"] = checkAvailability("DIRECTWRITE") ? "yes" : "no";
|
|
|
|
|
2016-04-25 13:07:40 +00:00
|
|
|
if (dictionary["DIRECTWRITE"] == "no")
|
|
|
|
dictionary["DIRECTWRITE2"] = "no";
|
|
|
|
else if (dictionary["DIRECTWRITE2"] == "auto")
|
Add color font support on Windows
Detect if DirectWrite 2 is available, and support color fonts if possible.
One limitation worth mentioning is that if the color font contains regular,
monochrome glyphs as well, then these will be drawn in black, and not in the
pen color. Fixing this would require some elaborate rewrites in the font
rendering system, since we would have to have two font caches per
color font (one for mono and one for colors), or do some sort of trick where
we make argb(r, g, b, 0) mean subpixel alpha instead, and detect glyphs that
are not correctly premultiplied when blitting to the screen.
Another limitation is that the approach does not work with distance field
rendering. In principle we could support this on Windows, since the
format is vector based, but it would also require substantial work and
it is not possible to support for Apple/Google fonts anyway, so it would
just lead to code which is not cross-platform.
[ChangeLog][Windows] Added support for color fonts (color emojis) when
DirectWrite 2 is available.
Change-Id: I6a608dd5d2aa3a7e762a06830902bddac7c550a5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-12-16 14:52:28 +00:00
|
|
|
dictionary["DIRECTWRITE2"] = checkAvailability("DIRECTWRITE2") ? "yes" : "no";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Mark all unknown "auto" to the default value..
|
|
|
|
for (QMap<QString,QString>::iterator i = dictionary.begin(); i != dictionary.end(); ++i) {
|
|
|
|
if (i.value() == "auto")
|
|
|
|
i.value() = defaultTo(i.key());
|
|
|
|
}
|
2013-10-17 13:47:46 +00:00
|
|
|
|
2015-09-28 18:19:36 +00:00
|
|
|
cout << "Done running configuration tests." << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Configure::verifyConfiguration()
|
|
|
|
{
|
2012-11-01 11:53:24 +00:00
|
|
|
bool prompt = false;
|
2015-07-09 00:21:30 +00:00
|
|
|
if (dictionary["C++STD"] != "auto"
|
2012-09-05 08:31:49 +00:00
|
|
|
&& dictionary["QMAKESPEC"].contains("msvc")) {
|
2015-07-09 00:21:30 +00:00
|
|
|
cout << "WARNING: It is not possible to change the C++ standard edition with MSVC compilers. "
|
|
|
|
"Therefore, the option -c++std " << dictionary["C++STD"] << " was ignored." << endl << endl;
|
|
|
|
dictionary["C++STD"] = "auto";
|
2012-09-05 08:31:49 +00:00
|
|
|
}
|
|
|
|
|
2015-02-20 10:07:09 +00:00
|
|
|
if (dictionary["STATIC_RUNTIME"] == "yes" && dictionary["SHARED"] == "yes") {
|
|
|
|
cout << "ERROR: -static-runtime requires -static" << endl << endl;
|
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
}
|
|
|
|
|
2014-04-09 08:17:20 +00:00
|
|
|
if (dictionary["SEPARATE_DEBUG_INFO"] == "yes") {
|
|
|
|
if (dictionary[ "SHARED" ] == "no") {
|
|
|
|
cout << "ERROR: -separate-debug-info is incompatible with -static" << endl << endl;
|
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
} else if (dictionary[ "BUILD" ] != "debug"
|
|
|
|
&& dictionary[ "BUILDALL" ] == "no"
|
|
|
|
&& dictionary[ "FORCEDEBUGINFO" ] == "no") {
|
|
|
|
cout << "ERROR: -separate-debug-info needs -debug, -debug-and-release, or -force-debug-info" << endl << endl;
|
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
} else if (dictionary["SEPARATE_DEBUG_INFO"] == "yes" && !checkAvailability("OBJCOPY")) {
|
|
|
|
cout << "ERROR: -separate-debug-info was requested but this binutils does not support it." << endl;
|
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary["SQL_SQLITE_LIB"] == "no" && dictionary["SQL_SQLITE"] != "no") {
|
|
|
|
cout << "WARNING: Configure could not detect the presence of a system SQLite3 lib." << endl
|
2012-11-01 11:53:24 +00:00
|
|
|
<< "Configure will therefore continue with the SQLite3 lib bundled with Qt." << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary["SQL_SQLITE_LIB"] = "qt"; // Set to Qt's bundled lib an continue
|
2012-11-01 11:53:24 +00:00
|
|
|
prompt = true;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
if (dictionary["QMAKESPEC"].endsWith("-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
|
|
|
|
<< "Oracle driver, as the current build will most likely fail." << endl;
|
2012-11-01 11:53:24 +00:00
|
|
|
prompt = true;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
if (dictionary["DIRECTWRITE"] == "yes" && !checkAvailability("DIRECTWRITE")) {
|
|
|
|
cout << "WARNING: To be able to compile the DirectWrite font engine you will" << endl
|
|
|
|
<< "need the Microsoft DirectWrite and Microsoft Direct2D development" << endl
|
2012-11-01 11:53:24 +00:00
|
|
|
<< "files such as headers and libraries." << endl;
|
|
|
|
prompt = true;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
2013-12-04 11:40:23 +00:00
|
|
|
if (dictionary["DIRECT2D"] == "yes" && !checkAvailability("DIRECT2D")) {
|
|
|
|
cout << "WARNING: To be able to build the Direct2D platform plugin you will" << endl
|
|
|
|
<< "need the Microsoft DirectWrite and Microsoft Direct2D development" << endl
|
|
|
|
<< "files such as headers and libraries." << endl;
|
|
|
|
prompt = true;
|
|
|
|
}
|
|
|
|
|
2016-07-07 14:36:26 +00:00
|
|
|
if (dictionary["ANGLE"] == "no") {
|
2012-11-02 09:41:22 +00:00
|
|
|
if (dictionary["ANGLE_FROM"] == "detected") {
|
2016-07-07 14:36:26 +00:00
|
|
|
QString errorMessage = dictionary["ANGLE_ERR"];
|
2012-11-02 09:41:22 +00:00
|
|
|
cout << "WARNING: The DirectX SDK could not be detected:" << endl
|
|
|
|
<< " " << qPrintable(errorMessage) << endl
|
|
|
|
<< "Disabling the ANGLE backend." << endl;
|
|
|
|
prompt = true;
|
|
|
|
}
|
2016-07-07 14:36:26 +00:00
|
|
|
if (dictionary["OPENGL_ES_2"] == "yes"
|
|
|
|
&& (platform() == WINDOWS || platform() == WINDOWS_RT)) {
|
2012-11-02 09:41:22 +00:00
|
|
|
cout << endl << "WARNING: Using OpenGL ES 2.0 without ANGLE." << endl
|
|
|
|
<< "Specify -opengl desktop to use Open GL." << endl
|
|
|
|
<< "The build will most likely fail." << endl;
|
|
|
|
prompt = true;
|
|
|
|
}
|
2016-07-07 14:36:26 +00:00
|
|
|
} else if (dictionary["ANGLE_FROM"] == "commandline") {
|
|
|
|
QString errorMessage;
|
|
|
|
if (!checkAngleAvailability(&errorMessage)) {
|
|
|
|
cout << "WARNING: ANGLE specified, but the DirectX SDK could not be detected:" << endl
|
|
|
|
<< " " << qPrintable(errorMessage) << endl
|
|
|
|
<< "The build will most likely fail." << endl;
|
Dynamic GL switch on Windows
The patch introduces a new build configuration on Windows which
can be requested by passing -opengl dynamic to configure.
Platforms other than Windows (including WinRT) are not affected.
The existing Angle and desktop configurations are not affected.
These continue to function as before and Angle remains the default.
In the future, when all modules have added support for the dynamic
path, as described below, the default configuration could be changed
to be the dynamic one. This would allow providing a single set of
binaries in the official builds instead of the current two.
When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are
never defined. Instead, the code path that has traditionally been
desktop GL only becomes the dynamic path that has to do runtime
checks. Qt modules and applications are not linked to opengl32.dll or
libegl/glesv2.dll in this case. Instead, QtGui exports all necessary
egl/egl/gl functions which will, under the hood, forward all requests
to a dynamically loaded EGL/WGL/GL implementation.
Porting guide (better said, changes needed to prepare your code to
work with dynamic GL builds when the fallback to Angle is utilized):
1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to
differentiate between desktop and ES where needed. Keep in mind that
it is the desktop GL header (plus qopenglext.h) that is included,
not the GLES one.
QtGui's proxy will handle some differences, for example calling
glClearDepth will route to glClearDepthf when needed. The built-in
eglGetProcAddress is able to retrieve pointers for standard GLES2
functions too so code resolving OpenGL 2 functions will function
in any case.
2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds,
but never "angle" or "opengles2".
3. The preprocessor define QT_OPENGL_DYNAMIC is also available in
dynamic builds. The usage of this is strongly discouraged and should
not be needed anywhere except for QtGui and the platform plugin.
4. Code in need of the library handle can use
QOpenGLFunctions::platformGLHandle().
The decision on which library to load is currently based on a simple
test that creates a dummy window/context and tries to resolve an
OpenGL 2 function. If this fails, it goes for Angle. This seems to work
well on Win7 PCs for example that do not have proper graphics drivers
providing OpenGL installed but are D3D9 capable using the default drivers.
Setting QT_OPENGL to desktop or angle skips the test and forces
usage of the given GL. There are also two new application attributes
that could be used for the same purpose.
If Angle is requested but the libraries are not present, desktop is
tried. If desktop is requested, or if angle is requested but nothing
works, the EGL/WGL functions will still be callable but will return 0.
This conveniently means that eglInitialize() and such will report a failure.
Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will
tell which implementation is chosen.
The textures example application is ported to OpenGL 2, the GL 1
code path is removed.
[ChangeLog][QtGui] Qt builds on Windows can now be configured for
dynamic loading of the OpenGL implementation. This can be requested
by passing -opengl dynamic to configure. In this mode no modules will
link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will
dynamically choose between desktop and Angle during the first GL/EGL/WGL
call. This allows deploying applications with a single set of Qt libraries
with the ability of transparently falling back to Angle in case the
opengl32.dll is not suitable, due to missing graphics drivers for example.
Task-number: QTBUG-36483
Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-01-27 13:45:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-09-02 11:51:35 +00:00
|
|
|
if (dictionary["OPENGL"] == "no" || dictionary["OPENGL_ES_2"] == "no") {
|
|
|
|
if (dictionary.value("XQMAKESPEC").startsWith("winphone") ||
|
|
|
|
dictionary.value("XQMAKESPEC").startsWith("winrt")) {
|
2016-07-07 14:36:26 +00:00
|
|
|
cout << "ERROR: Only '-opengl es2' is valid for WinRT." << endl;
|
Dynamic GL switch on Windows
The patch introduces a new build configuration on Windows which
can be requested by passing -opengl dynamic to configure.
Platforms other than Windows (including WinRT) are not affected.
The existing Angle and desktop configurations are not affected.
These continue to function as before and Angle remains the default.
In the future, when all modules have added support for the dynamic
path, as described below, the default configuration could be changed
to be the dynamic one. This would allow providing a single set of
binaries in the official builds instead of the current two.
When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are
never defined. Instead, the code path that has traditionally been
desktop GL only becomes the dynamic path that has to do runtime
checks. Qt modules and applications are not linked to opengl32.dll or
libegl/glesv2.dll in this case. Instead, QtGui exports all necessary
egl/egl/gl functions which will, under the hood, forward all requests
to a dynamically loaded EGL/WGL/GL implementation.
Porting guide (better said, changes needed to prepare your code to
work with dynamic GL builds when the fallback to Angle is utilized):
1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to
differentiate between desktop and ES where needed. Keep in mind that
it is the desktop GL header (plus qopenglext.h) that is included,
not the GLES one.
QtGui's proxy will handle some differences, for example calling
glClearDepth will route to glClearDepthf when needed. The built-in
eglGetProcAddress is able to retrieve pointers for standard GLES2
functions too so code resolving OpenGL 2 functions will function
in any case.
2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds,
but never "angle" or "opengles2".
3. The preprocessor define QT_OPENGL_DYNAMIC is also available in
dynamic builds. The usage of this is strongly discouraged and should
not be needed anywhere except for QtGui and the platform plugin.
4. Code in need of the library handle can use
QOpenGLFunctions::platformGLHandle().
The decision on which library to load is currently based on a simple
test that creates a dummy window/context and tries to resolve an
OpenGL 2 function. If this fails, it goes for Angle. This seems to work
well on Win7 PCs for example that do not have proper graphics drivers
providing OpenGL installed but are D3D9 capable using the default drivers.
Setting QT_OPENGL to desktop or angle skips the test and forces
usage of the given GL. There are also two new application attributes
that could be used for the same purpose.
If Angle is requested but the libraries are not present, desktop is
tried. If desktop is requested, or if angle is requested but nothing
works, the EGL/WGL functions will still be callable but will return 0.
This conveniently means that eglInitialize() and such will report a failure.
Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will
tell which implementation is chosen.
The textures example application is ported to OpenGL 2, the GL 1
code path is removed.
[ChangeLog][QtGui] Qt builds on Windows can now be configured for
dynamic loading of the OpenGL implementation. This can be requested
by passing -opengl dynamic to configure. In this mode no modules will
link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will
dynamically choose between desktop and Angle during the first GL/EGL/WGL
call. This allows deploying applications with a single set of Qt libraries
with the ability of transparently falling back to Angle in case the
opengl32.dll is not suitable, due to missing graphics drivers for example.
Task-number: QTBUG-36483
Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-01-27 13:45:11 +00:00
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-18 15:44:41 +00:00
|
|
|
if ((dictionary["FONT_CONFIG"] == "yes") && (dictionary["FREETYPE_FROM"] == "commandline")) {
|
|
|
|
if (dictionary["FREETYPE"] == "yes") {
|
|
|
|
cout << "WARNING: Bundled FreeType can't be used."
|
|
|
|
" FontConfig use requires system FreeType." << endl;
|
|
|
|
dictionary["FREETYPE"] = "system";
|
|
|
|
dictionary["FREETYPE_FROM"] = "override";
|
|
|
|
prompt = true;
|
|
|
|
} else if (dictionary["FREETYPE"] == "no") {
|
|
|
|
cout << "WARNING: FreeType can't be disabled."
|
|
|
|
" FontConfig use requires system FreeType." << endl;
|
|
|
|
dictionary["FREETYPE"] = "system";
|
|
|
|
dictionary["FREETYPE_FROM"] = "override";
|
|
|
|
prompt = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-01 11:53:24 +00:00
|
|
|
if (prompt)
|
|
|
|
promptKeyPress();
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-05-17 15:53:03 +00:00
|
|
|
void Configure::prepareConfigTests()
|
2012-10-29 09:17:33 +00:00
|
|
|
{
|
|
|
|
// Generate an empty .qmake.cache file for config.tests
|
|
|
|
QDir buildDir(buildPath);
|
|
|
|
bool success = true;
|
|
|
|
if (!buildDir.exists("config.tests"))
|
|
|
|
success = buildDir.mkdir("config.tests");
|
|
|
|
|
|
|
|
QString fileName(buildPath + "/config.tests/.qmake.cache");
|
|
|
|
QFile cacheFile(fileName);
|
|
|
|
success &= cacheFile.open(QIODevice::WriteOnly);
|
|
|
|
cacheFile.close();
|
|
|
|
|
|
|
|
if (!success) {
|
|
|
|
cout << "Failed to create file " << qPrintable(QDir::toNativeSeparators(fileName)) << endl;
|
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
void Configure::generateOutputVars()
|
|
|
|
{
|
|
|
|
// Generate variables for output
|
|
|
|
QString build = dictionary[ "BUILD" ];
|
|
|
|
bool buildAll = (dictionary[ "BUILDALL" ] == "yes");
|
|
|
|
if (build == "debug") {
|
|
|
|
if (buildAll)
|
2012-06-12 11:30:13 +00:00
|
|
|
qtConfig += "debug_and_release build_all release";
|
2011-04-27 10:05:43 +00:00
|
|
|
qtConfig += "debug";
|
|
|
|
} else if (build == "release") {
|
|
|
|
if (buildAll)
|
2012-06-12 11:30:13 +00:00
|
|
|
qtConfig += "debug_and_release build_all debug";
|
2011-04-27 10:05:43 +00:00
|
|
|
qtConfig += "release";
|
|
|
|
}
|
2015-10-26 11:38:50 +00:00
|
|
|
if (dictionary[ "RELEASE_TOOLS" ] == "yes")
|
|
|
|
qtConfig += "release_tools";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2016-03-18 15:32:13 +00:00
|
|
|
if (dictionary[ "PCH" ] == "yes")
|
|
|
|
qmakeConfig += "precompile_header";
|
|
|
|
else
|
|
|
|
qmakeVars += "CONFIG -= precompile_header";
|
|
|
|
|
2015-07-09 00:21:30 +00:00
|
|
|
if (dictionary[ "C++STD" ] == "c++11")
|
2012-09-05 08:31:49 +00:00
|
|
|
qtConfig += "c++11";
|
2015-07-09 00:21:30 +00:00
|
|
|
else if (dictionary[ "C++STD" ] == "c++14")
|
|
|
|
qtConfig += "c++11 c++14";
|
|
|
|
else if (dictionary[ "C++STD" ] == "c++1z")
|
|
|
|
qtConfig += "c++11 c++14 c++1z";
|
2012-09-05 08:31:49 +00:00
|
|
|
|
2014-07-01 09:46:50 +00:00
|
|
|
if (dictionary[ "USE_GOLD_LINKER" ] == "yes")
|
|
|
|
qmakeConfig += "use_gold_linker";
|
|
|
|
|
2015-04-22 11:09:36 +00:00
|
|
|
if (dictionary[ "ENABLE_NEW_DTAGS" ] == "yes")
|
|
|
|
qmakeConfig += "enable_new_dtags";
|
|
|
|
|
2012-05-30 10:09:00 +00:00
|
|
|
if (dictionary[ "SHARED" ] == "no")
|
|
|
|
qtConfig += "static";
|
|
|
|
else
|
|
|
|
qtConfig += "shared";
|
|
|
|
|
2015-02-20 10:07:09 +00:00
|
|
|
if (dictionary[ "STATIC_RUNTIME" ] == "yes")
|
|
|
|
qtConfig += "static_runtime";
|
|
|
|
|
2014-02-10 09:01:58 +00:00
|
|
|
if (dictionary[ "GUI" ] == "no") {
|
|
|
|
qtConfig += "no-gui";
|
|
|
|
dictionary [ "WIDGETS" ] = "no";
|
|
|
|
}
|
|
|
|
|
2012-03-07 00:11:44 +00:00
|
|
|
if (dictionary[ "WIDGETS" ] == "no")
|
|
|
|
qtConfig += "no-widgets";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Compression --------------------------------------------------
|
2016-02-19 14:18:47 +00:00
|
|
|
if (dictionary[ "SYSTEM_ZLIB" ] == "yes")
|
2011-04-27 10:05:43 +00:00
|
|
|
qtConfig += "system-zlib";
|
|
|
|
|
2012-01-23 22:31:13 +00:00
|
|
|
// PCRE ---------------------------------------------------------
|
|
|
|
if (dictionary[ "PCRE" ] == "qt")
|
|
|
|
qmakeConfig += "pcre";
|
|
|
|
|
2012-03-08 02:51:27 +00:00
|
|
|
// ICU ---------------------------------------------------------
|
|
|
|
if (dictionary[ "ICU" ] == "yes")
|
|
|
|
qtConfig += "icu";
|
|
|
|
|
2012-10-15 12:16:51 +00:00
|
|
|
// ANGLE --------------------------------------------------------
|
2013-04-03 16:57:09 +00:00
|
|
|
if (dictionary[ "ANGLE" ] != "no") {
|
2012-10-15 12:16:51 +00:00
|
|
|
qtConfig += "angle";
|
2013-04-03 16:57:09 +00:00
|
|
|
}
|
2012-10-15 12:16:51 +00:00
|
|
|
|
Dynamic GL switch on Windows
The patch introduces a new build configuration on Windows which
can be requested by passing -opengl dynamic to configure.
Platforms other than Windows (including WinRT) are not affected.
The existing Angle and desktop configurations are not affected.
These continue to function as before and Angle remains the default.
In the future, when all modules have added support for the dynamic
path, as described below, the default configuration could be changed
to be the dynamic one. This would allow providing a single set of
binaries in the official builds instead of the current two.
When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are
never defined. Instead, the code path that has traditionally been
desktop GL only becomes the dynamic path that has to do runtime
checks. Qt modules and applications are not linked to opengl32.dll or
libegl/glesv2.dll in this case. Instead, QtGui exports all necessary
egl/egl/gl functions which will, under the hood, forward all requests
to a dynamically loaded EGL/WGL/GL implementation.
Porting guide (better said, changes needed to prepare your code to
work with dynamic GL builds when the fallback to Angle is utilized):
1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to
differentiate between desktop and ES where needed. Keep in mind that
it is the desktop GL header (plus qopenglext.h) that is included,
not the GLES one.
QtGui's proxy will handle some differences, for example calling
glClearDepth will route to glClearDepthf when needed. The built-in
eglGetProcAddress is able to retrieve pointers for standard GLES2
functions too so code resolving OpenGL 2 functions will function
in any case.
2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds,
but never "angle" or "opengles2".
3. The preprocessor define QT_OPENGL_DYNAMIC is also available in
dynamic builds. The usage of this is strongly discouraged and should
not be needed anywhere except for QtGui and the platform plugin.
4. Code in need of the library handle can use
QOpenGLFunctions::platformGLHandle().
The decision on which library to load is currently based on a simple
test that creates a dummy window/context and tries to resolve an
OpenGL 2 function. If this fails, it goes for Angle. This seems to work
well on Win7 PCs for example that do not have proper graphics drivers
providing OpenGL installed but are D3D9 capable using the default drivers.
Setting QT_OPENGL to desktop or angle skips the test and forces
usage of the given GL. There are also two new application attributes
that could be used for the same purpose.
If Angle is requested but the libraries are not present, desktop is
tried. If desktop is requested, or if angle is requested but nothing
works, the EGL/WGL functions will still be callable but will return 0.
This conveniently means that eglInitialize() and such will report a failure.
Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will
tell which implementation is chosen.
The textures example application is ported to OpenGL 2, the GL 1
code path is removed.
[ChangeLog][QtGui] Qt builds on Windows can now be configured for
dynamic loading of the OpenGL implementation. This can be requested
by passing -opengl dynamic to configure. In this mode no modules will
link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will
dynamically choose between desktop and Angle during the first GL/EGL/WGL
call. This allows deploying applications with a single set of Qt libraries
with the ability of transparently falling back to Angle in case the
opengl32.dll is not suitable, due to missing graphics drivers for example.
Task-number: QTBUG-36483
Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-01-27 13:45:11 +00:00
|
|
|
// Dynamic OpenGL loading ---------------------------------------
|
2014-07-24 09:07:48 +00:00
|
|
|
if (dictionary[ "DYNAMICGL" ] != "no") {
|
Dynamic GL switch on Windows
The patch introduces a new build configuration on Windows which
can be requested by passing -opengl dynamic to configure.
Platforms other than Windows (including WinRT) are not affected.
The existing Angle and desktop configurations are not affected.
These continue to function as before and Angle remains the default.
In the future, when all modules have added support for the dynamic
path, as described below, the default configuration could be changed
to be the dynamic one. This would allow providing a single set of
binaries in the official builds instead of the current two.
When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are
never defined. Instead, the code path that has traditionally been
desktop GL only becomes the dynamic path that has to do runtime
checks. Qt modules and applications are not linked to opengl32.dll or
libegl/glesv2.dll in this case. Instead, QtGui exports all necessary
egl/egl/gl functions which will, under the hood, forward all requests
to a dynamically loaded EGL/WGL/GL implementation.
Porting guide (better said, changes needed to prepare your code to
work with dynamic GL builds when the fallback to Angle is utilized):
1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to
differentiate between desktop and ES where needed. Keep in mind that
it is the desktop GL header (plus qopenglext.h) that is included,
not the GLES one.
QtGui's proxy will handle some differences, for example calling
glClearDepth will route to glClearDepthf when needed. The built-in
eglGetProcAddress is able to retrieve pointers for standard GLES2
functions too so code resolving OpenGL 2 functions will function
in any case.
2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds,
but never "angle" or "opengles2".
3. The preprocessor define QT_OPENGL_DYNAMIC is also available in
dynamic builds. The usage of this is strongly discouraged and should
not be needed anywhere except for QtGui and the platform plugin.
4. Code in need of the library handle can use
QOpenGLFunctions::platformGLHandle().
The decision on which library to load is currently based on a simple
test that creates a dummy window/context and tries to resolve an
OpenGL 2 function. If this fails, it goes for Angle. This seems to work
well on Win7 PCs for example that do not have proper graphics drivers
providing OpenGL installed but are D3D9 capable using the default drivers.
Setting QT_OPENGL to desktop or angle skips the test and forces
usage of the given GL. There are also two new application attributes
that could be used for the same purpose.
If Angle is requested but the libraries are not present, desktop is
tried. If desktop is requested, or if angle is requested but nothing
works, the EGL/WGL functions will still be callable but will return 0.
This conveniently means that eglInitialize() and such will report a failure.
Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will
tell which implementation is chosen.
The textures example application is ported to OpenGL 2, the GL 1
code path is removed.
[ChangeLog][QtGui] Qt builds on Windows can now be configured for
dynamic loading of the OpenGL implementation. This can be requested
by passing -opengl dynamic to configure. In this mode no modules will
link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will
dynamically choose between desktop and Angle during the first GL/EGL/WGL
call. This allows deploying applications with a single set of Qt libraries
with the ability of transparently falling back to Angle in case the
opengl32.dll is not suitable, due to missing graphics drivers for example.
Task-number: QTBUG-36483
Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-01-27 13:45:11 +00:00
|
|
|
qtConfig += "dynamicgl";
|
2014-07-24 09:07:48 +00:00
|
|
|
}
|
Dynamic GL switch on Windows
The patch introduces a new build configuration on Windows which
can be requested by passing -opengl dynamic to configure.
Platforms other than Windows (including WinRT) are not affected.
The existing Angle and desktop configurations are not affected.
These continue to function as before and Angle remains the default.
In the future, when all modules have added support for the dynamic
path, as described below, the default configuration could be changed
to be the dynamic one. This would allow providing a single set of
binaries in the official builds instead of the current two.
When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are
never defined. Instead, the code path that has traditionally been
desktop GL only becomes the dynamic path that has to do runtime
checks. Qt modules and applications are not linked to opengl32.dll or
libegl/glesv2.dll in this case. Instead, QtGui exports all necessary
egl/egl/gl functions which will, under the hood, forward all requests
to a dynamically loaded EGL/WGL/GL implementation.
Porting guide (better said, changes needed to prepare your code to
work with dynamic GL builds when the fallback to Angle is utilized):
1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to
differentiate between desktop and ES where needed. Keep in mind that
it is the desktop GL header (plus qopenglext.h) that is included,
not the GLES one.
QtGui's proxy will handle some differences, for example calling
glClearDepth will route to glClearDepthf when needed. The built-in
eglGetProcAddress is able to retrieve pointers for standard GLES2
functions too so code resolving OpenGL 2 functions will function
in any case.
2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds,
but never "angle" or "opengles2".
3. The preprocessor define QT_OPENGL_DYNAMIC is also available in
dynamic builds. The usage of this is strongly discouraged and should
not be needed anywhere except for QtGui and the platform plugin.
4. Code in need of the library handle can use
QOpenGLFunctions::platformGLHandle().
The decision on which library to load is currently based on a simple
test that creates a dummy window/context and tries to resolve an
OpenGL 2 function. If this fails, it goes for Angle. This seems to work
well on Win7 PCs for example that do not have proper graphics drivers
providing OpenGL installed but are D3D9 capable using the default drivers.
Setting QT_OPENGL to desktop or angle skips the test and forces
usage of the given GL. There are also two new application attributes
that could be used for the same purpose.
If Angle is requested but the libraries are not present, desktop is
tried. If desktop is requested, or if angle is requested but nothing
works, the EGL/WGL functions will still be callable but will return 0.
This conveniently means that eglInitialize() and such will report a failure.
Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will
tell which implementation is chosen.
The textures example application is ported to OpenGL 2, the GL 1
code path is removed.
[ChangeLog][QtGui] Qt builds on Windows can now be configured for
dynamic loading of the OpenGL implementation. This can be requested
by passing -opengl dynamic to configure. In this mode no modules will
link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will
dynamically choose between desktop and Angle during the first GL/EGL/WGL
call. This allows deploying applications with a single set of Qt libraries
with the ability of transparently falling back to Angle in case the
opengl32.dll is not suitable, due to missing graphics drivers for example.
Task-number: QTBUG-36483
Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-01-27 13:45:11 +00:00
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Image formates -----------------------------------------------
|
2016-04-06 08:15:14 +00:00
|
|
|
if (dictionary[ "GIF" ] == "yes")
|
2011-04-27 10:05:43 +00:00
|
|
|
qtConfig += "gif";
|
|
|
|
|
2016-04-06 08:15:14 +00:00
|
|
|
if (dictionary[ "JPEG" ] == "yes")
|
2011-04-27 10:05:43 +00:00
|
|
|
qtConfig += "jpeg";
|
|
|
|
if (dictionary[ "LIBJPEG" ] == "system")
|
|
|
|
qtConfig += "system-jpeg";
|
|
|
|
|
2016-04-06 08:15:14 +00:00
|
|
|
if (dictionary[ "PNG" ] == "yes")
|
2011-04-27 10:05:43 +00:00
|
|
|
qtConfig += "png";
|
|
|
|
if (dictionary[ "LIBPNG" ] == "system")
|
|
|
|
qtConfig += "system-png";
|
|
|
|
|
2015-10-15 13:40:26 +00:00
|
|
|
// Double conversion -----------------------------------------------
|
2016-03-29 08:02:17 +00:00
|
|
|
if (dictionary[ "DOUBLECONVERSION" ] != "no")
|
2015-10-15 13:40:26 +00:00
|
|
|
qtConfig += "doubleconversion";
|
2016-03-29 08:02:17 +00:00
|
|
|
if (dictionary[ "DOUBLECONVERSION" ] == "system")
|
2015-10-15 13:40:26 +00:00
|
|
|
qtConfig += "system-doubleconversion";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Text rendering --------------------------------------------------
|
2016-03-29 08:02:17 +00:00
|
|
|
if (dictionary[ "FREETYPE" ] != "no")
|
2011-04-27 10:05:43 +00:00
|
|
|
qtConfig += "freetype";
|
2016-03-29 08:02:17 +00:00
|
|
|
if (dictionary[ "FREETYPE" ] == "system")
|
2012-06-20 14:00:34 +00:00
|
|
|
qtConfig += "system-freetype";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2016-03-29 08:02:17 +00:00
|
|
|
if (dictionary[ "HARFBUZZ" ] != "no")
|
2013-08-26 15:44:36 +00:00
|
|
|
qtConfig += "harfbuzz";
|
2016-03-29 08:02:17 +00:00
|
|
|
if (dictionary[ "HARFBUZZ" ] == "system")
|
2013-08-26 15:44:36 +00:00
|
|
|
qtConfig += "system-harfbuzz";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Styles -------------------------------------------------------
|
|
|
|
if (dictionary[ "STYLE_WINDOWS" ] == "yes")
|
|
|
|
qmakeStyles += "windows";
|
|
|
|
|
2012-09-21 17:53:28 +00:00
|
|
|
if (dictionary[ "STYLE_FUSION" ] == "yes")
|
|
|
|
qmakeStyles += "fusion";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary[ "STYLE_WINDOWSXP" ] == "yes")
|
|
|
|
qmakeStyles += "windowsxp";
|
|
|
|
|
|
|
|
if (dictionary[ "STYLE_WINDOWSVISTA" ] == "yes")
|
|
|
|
qmakeStyles += "windowsvista";
|
|
|
|
|
2014-12-16 11:18:25 +00:00
|
|
|
if (dictionary[ "STYLE_ANDROID" ] == "yes")
|
|
|
|
qmakeStyles += "android";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Databases ----------------------------------------------------
|
|
|
|
if (dictionary[ "SQL_MYSQL" ] == "yes")
|
|
|
|
qmakeSql += "mysql";
|
|
|
|
if (dictionary[ "SQL_ODBC" ] == "yes")
|
|
|
|
qmakeSql += "odbc";
|
|
|
|
if (dictionary[ "SQL_OCI" ] == "yes")
|
|
|
|
qmakeSql += "oci";
|
|
|
|
if (dictionary[ "SQL_PSQL" ] == "yes")
|
|
|
|
qmakeSql += "psql";
|
|
|
|
if (dictionary[ "SQL_TDS" ] == "yes")
|
|
|
|
qmakeSql += "tds";
|
|
|
|
if (dictionary[ "SQL_DB2" ] == "yes")
|
|
|
|
qmakeSql += "db2";
|
2016-03-18 12:35:40 +00:00
|
|
|
if (dictionary[ "SQL_SQLITE2" ] == "yes")
|
|
|
|
qmakeSql += "sqlite2";
|
|
|
|
if (dictionary[ "SQL_IBASE" ] == "yes")
|
|
|
|
qmakeSql += "ibase";
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary[ "SQL_SQLITE" ] == "yes")
|
|
|
|
qmakeSql += "sqlite";
|
|
|
|
|
|
|
|
if (dictionary[ "SQL_SQLITE_LIB" ] == "system")
|
|
|
|
qmakeConfig += "system-sqlite";
|
|
|
|
|
|
|
|
// Other options ------------------------------------------------
|
|
|
|
if (dictionary[ "BUILDALL" ] == "yes") {
|
2011-09-12 22:53:40 +00:00
|
|
|
qtConfig += "build_all";
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2014-04-09 08:17:20 +00:00
|
|
|
if (dictionary[ "SEPARATE_DEBUG_INFO" ] == "yes")
|
|
|
|
qtConfig += "separate_debug_info";
|
2012-08-07 20:22:38 +00:00
|
|
|
if (dictionary[ "FORCEDEBUGINFO" ] == "yes")
|
2013-02-11 11:20:32 +00:00
|
|
|
qmakeConfig += "force_debug_info";
|
2011-04-27 10:05:43 +00:00
|
|
|
qmakeConfig += dictionary[ "BUILD" ];
|
|
|
|
|
2012-03-21 10:15:22 +00:00
|
|
|
if (buildParts.isEmpty()) {
|
2012-03-21 10:09:59 +00:00
|
|
|
buildParts = defaultBuildParts;
|
2012-03-21 10:15:22 +00:00
|
|
|
|
|
|
|
if (dictionary["BUILDDEV"] == "yes")
|
|
|
|
buildParts += "tests";
|
|
|
|
}
|
2012-03-21 10:09:59 +00:00
|
|
|
while (!nobuildParts.isEmpty())
|
|
|
|
buildParts.removeAll(nobuildParts.takeFirst());
|
|
|
|
if (!buildParts.contains("libs"))
|
|
|
|
buildParts += "libs";
|
|
|
|
buildParts.removeDuplicates();
|
2013-05-07 15:10:22 +00:00
|
|
|
if (dictionary[ "COMPILE_EXAMPLES" ] == "yes")
|
|
|
|
qmakeConfig += "compile_examples";
|
2012-03-21 10:09:59 +00:00
|
|
|
|
2012-02-01 10:19:27 +00:00
|
|
|
if (dictionary["MSVC_MP"] == "yes")
|
|
|
|
qmakeConfig += "msvc_mp";
|
|
|
|
|
2015-09-08 23:35:33 +00:00
|
|
|
if (dictionary["ATOMIC64"] == "libatomic")
|
|
|
|
qmakeConfig += "atomic64-libatomic";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary[ "ACCESSIBILITY" ] == "yes")
|
|
|
|
qtConfig += "accessibility";
|
|
|
|
|
|
|
|
if (!qmakeLibs.isEmpty())
|
2016-07-07 11:47:49 +00:00
|
|
|
qmakeVars += "EXTRA_LIBDIR += " + formatPaths(qmakeLibs);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2016-03-20 22:07:46 +00:00
|
|
|
if (!dictionary["QMAKE_LIBS_SQLITE"].isEmpty())
|
|
|
|
qmakeVars += "QMAKE_LIBS_SQLITE += " + dictionary["QMAKE_LIBS_SQLITE"];
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
if (dictionary[ "OPENGL" ] == "yes")
|
|
|
|
qtConfig += "opengl";
|
|
|
|
|
|
|
|
if (dictionary["OPENGL_ES_2"] == "yes") {
|
|
|
|
qtConfig += "opengles2";
|
|
|
|
qtConfig += "egl";
|
|
|
|
}
|
|
|
|
|
2014-08-12 17:04:05 +00:00
|
|
|
if (dictionary[ "SSL" ] == "yes")
|
|
|
|
qtConfig += "ssl";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary[ "OPENSSL" ] == "yes")
|
|
|
|
qtConfig += "openssl";
|
|
|
|
else if (dictionary[ "OPENSSL" ] == "linked")
|
|
|
|
qtConfig += "openssl-linked";
|
|
|
|
|
2015-01-27 17:41:32 +00:00
|
|
|
if (dictionary[ "LIBPROXY" ] == "yes")
|
|
|
|
qtConfig += "libproxy";
|
|
|
|
|
2014-12-11 22:32:59 +00:00
|
|
|
if (dictionary[ "DBUS" ] == "runtime")
|
2011-04-27 10:05:43 +00:00
|
|
|
qtConfig += "dbus";
|
|
|
|
else if (dictionary[ "DBUS" ] == "linked")
|
|
|
|
qtConfig += "dbus dbus-linked";
|
|
|
|
|
2015-07-02 15:33:08 +00:00
|
|
|
if (dictionary["QML_DEBUG"] == "no")
|
|
|
|
qtConfig += "no-qml-debug";
|
|
|
|
|
2013-07-22 11:45:30 +00:00
|
|
|
if (dictionary["WMF_BACKEND"] == "yes")
|
|
|
|
qtConfig += "wmf-backend";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary["DIRECTWRITE"] == "yes")
|
|
|
|
qtConfig += "directwrite";
|
|
|
|
|
Add color font support on Windows
Detect if DirectWrite 2 is available, and support color fonts if possible.
One limitation worth mentioning is that if the color font contains regular,
monochrome glyphs as well, then these will be drawn in black, and not in the
pen color. Fixing this would require some elaborate rewrites in the font
rendering system, since we would have to have two font caches per
color font (one for mono and one for colors), or do some sort of trick where
we make argb(r, g, b, 0) mean subpixel alpha instead, and detect glyphs that
are not correctly premultiplied when blitting to the screen.
Another limitation is that the approach does not work with distance field
rendering. In principle we could support this on Windows, since the
format is vector based, but it would also require substantial work and
it is not possible to support for Apple/Google fonts anyway, so it would
just lead to code which is not cross-platform.
[ChangeLog][Windows] Added support for color fonts (color emojis) when
DirectWrite 2 is available.
Change-Id: I6a608dd5d2aa3a7e762a06830902bddac7c550a5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-12-16 14:52:28 +00:00
|
|
|
if (dictionary["DIRECTWRITE2"] == "yes")
|
|
|
|
qtConfig += "directwrite2";
|
|
|
|
|
2013-12-04 11:40:23 +00:00
|
|
|
if (dictionary["DIRECT2D"] == "yes")
|
|
|
|
qtConfig += "direct2d";
|
|
|
|
|
2012-06-20 14:00:34 +00:00
|
|
|
if (dictionary["NIS"] == "yes")
|
|
|
|
qtConfig += "nis";
|
|
|
|
|
|
|
|
if (dictionary["QT_CUPS"] == "yes")
|
|
|
|
qtConfig += "cups";
|
|
|
|
|
2016-03-29 08:02:17 +00:00
|
|
|
if (dictionary["QT_ICONV"] != "no")
|
2012-06-20 14:00:34 +00:00
|
|
|
qtConfig += "iconv";
|
2016-03-29 08:02:17 +00:00
|
|
|
if (dictionary["QT_ICONV"] == "sun")
|
2012-06-20 14:00:34 +00:00
|
|
|
qtConfig += "sun-libiconv";
|
|
|
|
else if (dictionary["QT_ICONV"] == "gnu")
|
|
|
|
qtConfig += "gnu-libiconv";
|
|
|
|
|
2014-04-02 09:54:36 +00:00
|
|
|
if (dictionary["QT_EVDEV"] == "yes")
|
|
|
|
qtConfig += "evdev";
|
|
|
|
|
2014-04-07 08:38:26 +00:00
|
|
|
if (dictionary["QT_MTDEV"] == "yes")
|
|
|
|
qtConfig += "mtdev";
|
|
|
|
|
2015-03-12 13:18:26 +00:00
|
|
|
if (dictionary[ "QT_TSLIB" ] == "yes")
|
|
|
|
qtConfig += "tslib";
|
|
|
|
|
2012-12-05 23:45:48 +00:00
|
|
|
if (dictionary["QT_INOTIFY"] == "yes")
|
|
|
|
qtConfig += "inotify";
|
|
|
|
|
2013-05-07 21:40:38 +00:00
|
|
|
if (dictionary["QT_EVENTFD"] == "yes")
|
|
|
|
qtConfig += "eventfd";
|
|
|
|
|
2012-06-20 14:00:34 +00:00
|
|
|
if (dictionary["FONT_CONFIG"] == "yes") {
|
|
|
|
qtConfig += "fontconfig";
|
|
|
|
qmakeVars += "QMAKE_CFLAGS_FONTCONFIG =";
|
|
|
|
qmakeVars += "QMAKE_LIBS_FONTCONFIG = -lfreetype -lfontconfig";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dictionary["QT_GLIB"] == "yes")
|
|
|
|
qtConfig += "glib";
|
|
|
|
|
2012-09-20 12:11:25 +00:00
|
|
|
if (dictionary["STACK_PROTECTOR_STRONG"] == "yes")
|
|
|
|
qtConfig += "stack-protector-strong";
|
|
|
|
|
2013-03-27 20:04:15 +00:00
|
|
|
if (dictionary["REDUCE_EXPORTS"] == "yes")
|
|
|
|
qtConfig += "reduce_exports";
|
|
|
|
|
2015-12-11 01:42:15 +00:00
|
|
|
if (!dictionary["POLL"].isEmpty())
|
|
|
|
qtConfig += "poll_" + dictionary["POLL"];
|
|
|
|
|
2012-01-26 11:52:44 +00:00
|
|
|
// We currently have no switch for QtConcurrent, so add it unconditionally.
|
|
|
|
qtConfig += "concurrent";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2012-10-23 13:31:20 +00:00
|
|
|
if (dictionary[ "SYSTEM_PROXIES" ] == "yes")
|
|
|
|
qtConfig += "system-proxies";
|
|
|
|
|
2014-09-24 14:31:33 +00:00
|
|
|
if (dictionary[ "SCTP" ] == "yes")
|
|
|
|
qtConfig += "sctp";
|
|
|
|
|
2012-02-29 23:55:13 +00:00
|
|
|
if (dictionary.contains("XQMAKESPEC") && (dictionary["QMAKESPEC"] != dictionary["XQMAKESPEC"])) {
|
2011-04-27 10:05:43 +00:00
|
|
|
qmakeConfig += "cross_compile";
|
2012-02-29 23:55:13 +00:00
|
|
|
dictionary["CROSS_COMPILE"] = "yes";
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
// Directories and settings for .qmake.cache --------------------
|
|
|
|
|
|
|
|
if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux"))
|
2012-08-09 13:02:44 +00:00
|
|
|
qtConfig += "rpath";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
if (!qmakeDefines.isEmpty())
|
2016-05-17 08:45:43 +00:00
|
|
|
qmakeVars += QString("EXTRA_DEFINES += ") + qmakeDefines.join(' ');
|
2011-04-27 10:05:43 +00:00
|
|
|
if (!qmakeIncludes.isEmpty())
|
2016-05-17 08:45:43 +00:00
|
|
|
qmakeVars += QString("EXTRA_INCLUDEPATH += ") + formatPaths(qmakeIncludes);
|
2011-04-27 10:05:43 +00:00
|
|
|
if (!opensslLibs.isEmpty())
|
|
|
|
qmakeVars += opensslLibs;
|
2012-07-26 15:16:29 +00:00
|
|
|
if (dictionary[ "OPENSSL" ] == "linked") {
|
|
|
|
if (!opensslLibsDebug.isEmpty() || !opensslLibsRelease.isEmpty()) {
|
|
|
|
if (opensslLibsDebug.isEmpty() || opensslLibsRelease.isEmpty()) {
|
|
|
|
cout << "Error: either both or none of OPENSSL_LIBS_DEBUG/_RELEASE must be defined." << endl;
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
qmakeVars += opensslLibsDebug;
|
|
|
|
qmakeVars += opensslLibsRelease;
|
|
|
|
} else if (opensslLibs.isEmpty()) {
|
|
|
|
qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32");
|
|
|
|
}
|
2013-04-08 22:07:13 +00:00
|
|
|
if (!opensslPath.isEmpty()) {
|
|
|
|
qmakeVars += QString("OPENSSL_CFLAGS += -I%1/include").arg(opensslPath);
|
|
|
|
qmakeVars += QString("OPENSSL_LIBS += -L%1/lib").arg(opensslPath);
|
|
|
|
}
|
|
|
|
}
|
2014-12-11 22:32:59 +00:00
|
|
|
if (dictionary[ "DBUS" ] == "linked") {
|
2014-07-09 09:58:44 +00:00
|
|
|
if (!dbusPath.isEmpty()) {
|
2016-03-20 22:07:46 +00:00
|
|
|
qmakeVars += QString("QMAKE_CFLAGS_DBUS = -I%1/include").arg(dbusPath);
|
|
|
|
qmakeVars += QString("QMAKE_LIBS_DBUS = -L%1/lib").arg(dbusPath);
|
2014-07-09 09:58:44 +00:00
|
|
|
if (dbusHostPath.isEmpty())
|
|
|
|
qmakeVars += QString("QT_HOST_CFLAGS_DBUS = -I%1/include").arg(dbusPath);
|
|
|
|
}
|
|
|
|
if (!dbusHostPath.isEmpty())
|
|
|
|
qmakeVars += QString("QT_HOST_CFLAGS_DBUS = -I%1/include").arg(dbusHostPath);
|
2013-04-08 22:07:13 +00:00
|
|
|
}
|
|
|
|
if (dictionary[ "SQL_MYSQL" ] != "no" && !mysqlPath.isEmpty()) {
|
2016-03-20 22:07:46 +00:00
|
|
|
qmakeVars += QString("QMAKE_CFLAGS_MYSQL = -I%1/include").arg(mysqlPath);
|
|
|
|
qmakeVars += QString("QMAKE_LIBS_MYSQL = -L%1/lib").arg(mysqlPath);
|
2012-07-26 15:16:29 +00:00
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
if (!psqlLibs.isEmpty())
|
2016-03-20 22:07:46 +00:00
|
|
|
qmakeVars += QString("QMAKE_LIBS_PSQL=") + psqlLibs.section("=", 1);
|
2012-08-20 17:54:58 +00:00
|
|
|
if (!zlibLibs.isEmpty())
|
|
|
|
qmakeVars += zlibLibs;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
QStringList lflagsTDS;
|
|
|
|
if (!sybase.isEmpty())
|
2012-03-28 14:00:06 +00:00
|
|
|
lflagsTDS += QString("-L") + formatPath(sybase.section("=", 1) + "/lib");
|
2011-04-27 10:05:43 +00:00
|
|
|
if (!sybaseLibs.isEmpty())
|
|
|
|
lflagsTDS += sybaseLibs.section("=", 1);
|
|
|
|
if (!lflagsTDS.isEmpty())
|
2016-03-20 22:07:46 +00:00
|
|
|
qmakeVars += QString("QMAKE_LIBS_TDS=") + lflagsTDS.join(' ');
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!qmakeSql.isEmpty())
|
2012-05-18 18:00:23 +00:00
|
|
|
qmakeVars += QString("sql-drivers += ") + qmakeSql.join(' ');
|
2011-04-27 10:05:43 +00:00
|
|
|
if (!qmakeStyles.isEmpty())
|
2012-05-18 18:00:23 +00:00
|
|
|
qmakeVars += QString("styles += ") + qmakeStyles.join(' ');
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
if (!dictionary[ "QMAKESPEC" ].length()) {
|
|
|
|
cout << "Configure could not detect your compiler. QMAKESPEC must either" << endl
|
|
|
|
<< "be defined as an environment variable, or specified as an" << endl
|
|
|
|
<< "argument with -platform" << endl;
|
|
|
|
|
|
|
|
QStringList winPlatforms;
|
|
|
|
QDir mkspecsDir(sourcePath + "/mkspecs");
|
|
|
|
const QFileInfoList &specsList = mkspecsDir.entryInfoList();
|
|
|
|
for (int i = 0; i < specsList.size(); ++i) {
|
|
|
|
const QFileInfo &fi = specsList.at(i);
|
|
|
|
if (fi.fileName().left(5) == "win32") {
|
|
|
|
winPlatforms += fi.fileName();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cout << "Available platforms are: " << qPrintable(winPlatforms.join(", ")) << endl;
|
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Configure::generateCachefile()
|
|
|
|
{
|
2015-10-31 16:23:23 +00:00
|
|
|
// Generate qmodule.pri, which is loaded only by Qt modules
|
2013-07-15 14:45:44 +00:00
|
|
|
{
|
2013-07-24 11:48:36 +00:00
|
|
|
FileWriter moduleStream(buildPath + "/mkspecs/qmodule.pri");
|
2010-11-11 15:35:09 +00:00
|
|
|
|
2013-02-18 16:37:21 +00:00
|
|
|
moduleStream << "QT_BUILD_PARTS += " << buildParts.join(' ') << endl;
|
|
|
|
if (!skipModules.isEmpty())
|
|
|
|
moduleStream << "QT_SKIP_MODULES += " << skipModules.join(' ') << endl;
|
|
|
|
moduleStream << endl;
|
2010-11-11 15:35:09 +00:00
|
|
|
|
2013-04-10 10:57:06 +00:00
|
|
|
moduleStream << "host_build {" << endl;
|
2013-04-10 15:43:51 +00:00
|
|
|
moduleStream << " QT_CPU_FEATURES." << dictionary["QT_HOST_ARCH"] <<
|
|
|
|
" = " << dictionary["QT_HOST_CPU_FEATURES"] << endl;
|
2013-04-10 10:57:06 +00:00
|
|
|
moduleStream << "} else {" << endl;
|
2013-04-10 15:43:51 +00:00
|
|
|
moduleStream << " QT_CPU_FEATURES." << dictionary["QT_ARCH"] <<
|
|
|
|
" = " << dictionary["QT_CPU_FEATURES"] << endl;
|
2013-04-10 10:57:06 +00:00
|
|
|
moduleStream << "}" << endl;
|
2013-11-01 08:40:27 +00:00
|
|
|
moduleStream << "QT_COORD_TYPE += " << dictionary["QREAL"] << endl;
|
2013-04-10 10:57:06 +00:00
|
|
|
|
2013-05-14 01:02:21 +00:00
|
|
|
if (dictionary["QT_XKBCOMMON"] == "no")
|
|
|
|
moduleStream << "DEFINES += QT_NO_XKBCOMMON" << endl;
|
|
|
|
|
2012-10-23 19:06:08 +00:00
|
|
|
moduleStream << "CONFIG += " << qmakeConfig.join(' ');
|
2012-05-30 12:44:39 +00:00
|
|
|
if (dictionary[ "SSE2" ] == "yes")
|
|
|
|
moduleStream << " sse2";
|
2011-12-30 00:44:16 +00:00
|
|
|
if (dictionary[ "SSE3" ] == "yes")
|
|
|
|
moduleStream << " sse3";
|
|
|
|
if (dictionary[ "SSSE3" ] == "yes")
|
|
|
|
moduleStream << " ssse3";
|
|
|
|
if (dictionary[ "SSE4_1" ] == "yes")
|
|
|
|
moduleStream << " sse4_1";
|
|
|
|
if (dictionary[ "SSE4_2" ] == "yes")
|
|
|
|
moduleStream << " sse4_2";
|
|
|
|
if (dictionary[ "AVX" ] == "yes")
|
|
|
|
moduleStream << " avx";
|
|
|
|
if (dictionary[ "AVX2" ] == "yes")
|
|
|
|
moduleStream << " avx2";
|
2015-07-17 21:46:05 +00:00
|
|
|
if (!dictionary[ "AVX512" ].isEmpty())
|
|
|
|
moduleStream << ' ' << dictionary[ "AVX512" ];
|
2012-06-20 14:00:34 +00:00
|
|
|
if (dictionary[ "NEON" ] == "yes")
|
|
|
|
moduleStream << " neon";
|
|
|
|
if (dictionary[ "LARGE_FILE" ] == "yes")
|
|
|
|
moduleStream << " largefile";
|
2012-09-14 14:04:59 +00:00
|
|
|
if (dictionary[ "STRIP" ] == "no")
|
|
|
|
moduleStream << " nostrip";
|
2015-10-31 16:23:23 +00:00
|
|
|
if (dictionary[ "LTCG" ] == "yes")
|
|
|
|
moduleStream << " ltcg";
|
2012-05-30 12:44:39 +00:00
|
|
|
moduleStream << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2012-11-26 15:45:02 +00:00
|
|
|
for (QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var)
|
|
|
|
moduleStream << (*var) << endl;
|
|
|
|
|
2013-07-15 14:45:44 +00:00
|
|
|
if (!moduleStream.flush())
|
|
|
|
dictionary[ "DONE" ] = "error";
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2012-02-14 09:01:17 +00:00
|
|
|
}
|
|
|
|
|
2014-07-02 12:43:18 +00:00
|
|
|
void Configure::addSysroot(QString *command)
|
|
|
|
{
|
|
|
|
const QString &sysroot = dictionary["CFG_SYSROOT"];
|
|
|
|
if (!sysroot.isEmpty() && dictionary["CFG_GCC_SYSROOT"] == "yes") {
|
|
|
|
command->append(" QMAKE_LFLAGS+=--sysroot=" + sysroot);
|
|
|
|
command->append(" QMAKE_CXXFLAGS+=--sysroot=" + sysroot);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-31 22:40:49 +00:00
|
|
|
struct ArchData {
|
2014-07-02 12:24:33 +00:00
|
|
|
bool isHost;
|
2011-12-31 22:40:49 +00:00
|
|
|
const char *qmakespec;
|
|
|
|
const char *key;
|
|
|
|
const char *subarchKey;
|
|
|
|
const char *type;
|
|
|
|
ArchData() {}
|
2014-07-02 12:24:33 +00:00
|
|
|
ArchData(bool h, const char *t, const char *qm, const char *k, const char *sak)
|
|
|
|
: isHost(h), qmakespec(qm), key(k), subarchKey(sak), type(t)
|
2011-12-31 22:40:49 +00:00
|
|
|
{}
|
|
|
|
};
|
|
|
|
|
2012-02-14 09:01:17 +00:00
|
|
|
/*
|
|
|
|
Runs qmake on config.tests/arch/arch.pro, which will detect the target arch
|
|
|
|
for the compiler we are using
|
|
|
|
*/
|
|
|
|
void Configure::detectArch()
|
|
|
|
{
|
|
|
|
QString oldpwd = QDir::currentPath();
|
|
|
|
|
2012-03-28 14:00:06 +00:00
|
|
|
QString newpwd = QString("%1/config.tests/arch").arg(buildPath);
|
2012-02-14 09:01:17 +00:00
|
|
|
if (!QDir().exists(newpwd) && !QDir().mkpath(newpwd)) {
|
2012-03-28 14:00:06 +00:00
|
|
|
cout << "Failed to create directory " << qPrintable(QDir::toNativeSeparators(newpwd)) << endl;
|
2012-02-14 09:01:17 +00:00
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!QDir::setCurrent(newpwd)) {
|
2012-03-28 14:00:06 +00:00
|
|
|
cout << "Failed to change working directory to " << qPrintable(QDir::toNativeSeparators(newpwd)) << endl;
|
2012-02-14 09:01:17 +00:00
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-12-31 22:40:49 +00:00
|
|
|
QVector<ArchData> qmakespecs;
|
2012-02-14 09:01:17 +00:00
|
|
|
if (dictionary.contains("XQMAKESPEC"))
|
2014-07-02 12:24:33 +00:00
|
|
|
qmakespecs << ArchData(false, "target", "XQMAKESPEC", "QT_ARCH", "QT_CPU_FEATURES");
|
|
|
|
qmakespecs << ArchData(true, "host", "QMAKESPEC", "QT_HOST_ARCH", "QT_HOST_CPU_FEATURES");
|
2012-02-14 09:01:17 +00:00
|
|
|
|
|
|
|
for (int i = 0; i < qmakespecs.count(); ++i) {
|
2011-12-31 22:40:49 +00:00
|
|
|
const ArchData &data = qmakespecs.at(i);
|
|
|
|
QString qmakespec = dictionary.value(data.qmakespec);
|
|
|
|
QString key = data.key;
|
|
|
|
QString subarchKey = data.subarchKey;
|
2012-02-14 09:01:17 +00:00
|
|
|
|
2012-03-27 17:43:45 +00:00
|
|
|
// run qmake
|
2012-09-20 19:40:39 +00:00
|
|
|
QString command = QString("%1 -spec %2 %3")
|
2014-11-20 14:33:54 +00:00
|
|
|
.arg(QDir::toNativeSeparators(QDir(newpwd).relativeFilePath(buildPath + "/bin/qmake.exe")),
|
2012-03-28 14:00:06 +00:00
|
|
|
QDir::toNativeSeparators(qmakespec),
|
2014-07-02 12:24:33 +00:00
|
|
|
QDir::toNativeSeparators(sourcePath + "/config.tests/arch/arch"
|
|
|
|
+ (data.isHost ? "_host" : "") + ".pro"));
|
2013-11-05 19:36:01 +00:00
|
|
|
|
2014-07-02 12:42:58 +00:00
|
|
|
if (!data.isHost) {
|
|
|
|
if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone"))
|
|
|
|
command.append(" QMAKE_LFLAGS+=/ENTRY:main");
|
2014-07-02 12:43:18 +00:00
|
|
|
addSysroot(&command);
|
2014-07-02 12:42:58 +00:00
|
|
|
}
|
2013-11-05 19:36:01 +00:00
|
|
|
|
2012-09-20 19:40:39 +00:00
|
|
|
int returnValue = 0;
|
|
|
|
Environment::execute(command, &returnValue);
|
|
|
|
if (returnValue != 0) {
|
|
|
|
cout << "QMake failed!" << endl;
|
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
return;
|
|
|
|
}
|
2012-03-27 17:43:45 +00:00
|
|
|
|
|
|
|
// compile
|
|
|
|
command = dictionary[ "MAKE" ];
|
2015-02-05 17:07:03 +00:00
|
|
|
if (command.contains("nmake") || command.contains("jom"))
|
2012-03-27 17:43:45 +00:00
|
|
|
command += " /NOLOGO";
|
|
|
|
command += " -s";
|
|
|
|
Environment::execute(command);
|
|
|
|
|
|
|
|
// find the executable that was generated
|
2013-03-27 20:34:42 +00:00
|
|
|
QString arch_exe;
|
|
|
|
if (qmakespec.startsWith("android")) {
|
|
|
|
arch_exe = "libarch.so";
|
|
|
|
} else {
|
|
|
|
arch_exe = "arch.exe";
|
|
|
|
}
|
|
|
|
QFile exe(arch_exe);
|
2012-03-27 17:43:45 +00:00
|
|
|
if (!exe.open(QFile::ReadOnly)) { // no Text, this is binary
|
2012-06-08 12:20:45 +00:00
|
|
|
exe.setFileName("arch");
|
|
|
|
if (!exe.open(QFile::ReadOnly)) {
|
2014-12-30 13:33:51 +00:00
|
|
|
cout << "Could not find output file '" << qPrintable(arch_exe) << "' or 'arch' in " << qPrintable(newpwd) << " : " << qPrintable(exe.errorString()) << endl;
|
2012-06-08 12:20:45 +00:00
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
return;
|
|
|
|
}
|
2012-03-27 17:43:45 +00:00
|
|
|
}
|
|
|
|
QByteArray exeContents = exe.readAll();
|
|
|
|
exe.close();
|
|
|
|
|
2011-12-31 22:40:49 +00:00
|
|
|
static const char archMagic[] = "==Qt=magic=Qt== Architecture:";
|
|
|
|
int magicPos = exeContents.indexOf(archMagic);
|
2012-03-27 17:43:45 +00:00
|
|
|
if (magicPos == -1) {
|
2011-12-31 22:40:49 +00:00
|
|
|
cout << "Internal error, could not find the architecture of the "
|
|
|
|
<< data.type << " executable" << endl;
|
2012-03-27 17:43:45 +00:00
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
//cout << "Found magic at offset 0x" << hex << magicPos << endl;
|
|
|
|
|
|
|
|
// the conversion from QByteArray will stop at the ending NUL anyway
|
|
|
|
QString arch = QString::fromLatin1(exeContents.constData() + magicPos
|
2011-12-31 22:40:49 +00:00
|
|
|
+ sizeof(archMagic) - 1);
|
2012-03-27 17:43:45 +00:00
|
|
|
dictionary[key] = arch;
|
|
|
|
|
2011-12-31 22:40:49 +00:00
|
|
|
static const char subarchMagic[] = "==Qt=magic=Qt== Sub-architecture:";
|
|
|
|
magicPos = exeContents.indexOf(subarchMagic);
|
|
|
|
if (magicPos == -1) {
|
|
|
|
cout << "Internal error, could not find the sub-architecture of the "
|
|
|
|
<< data.type << " executable" << endl;
|
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString subarch = QString::fromLatin1(exeContents.constData() + magicPos
|
|
|
|
+ sizeof(subarchMagic) - 1);
|
|
|
|
dictionary[subarchKey] = subarch;
|
|
|
|
|
2012-03-27 17:43:45 +00:00
|
|
|
//cout << "Detected arch '" << qPrintable(arch) << "'\n";
|
2011-12-31 22:40:49 +00:00
|
|
|
//cout << "Detected sub-arch '" << qPrintable(subarch) << "'\n";
|
2012-02-14 09:01:17 +00:00
|
|
|
|
2012-03-27 17:43:45 +00:00
|
|
|
// clean up
|
|
|
|
Environment::execute(command + " distclean");
|
2012-02-14 09:01:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!dictionary.contains("QT_HOST_ARCH"))
|
|
|
|
dictionary["QT_HOST_ARCH"] = "unknown";
|
2011-12-31 22:40:49 +00:00
|
|
|
if (!dictionary.contains("QT_ARCH")) {
|
2012-02-14 09:01:17 +00:00
|
|
|
dictionary["QT_ARCH"] = dictionary["QT_HOST_ARCH"];
|
2011-12-31 22:40:49 +00:00
|
|
|
dictionary["QT_CPU_FEATURES"] = dictionary["QT_HOST_CPU_FEATURES"];
|
|
|
|
}
|
2012-02-14 09:01:17 +00:00
|
|
|
|
|
|
|
QDir::setCurrent(oldpwd);
|
|
|
|
}
|
2010-11-11 15:35:09 +00:00
|
|
|
|
2015-08-01 20:31:35 +00:00
|
|
|
bool Configure::tryCompileProject(const QString &projectPath, const QString &extraOptions,
|
|
|
|
bool distClean)
|
2011-12-30 00:44:16 +00:00
|
|
|
{
|
|
|
|
QString oldpwd = QDir::currentPath();
|
|
|
|
|
2012-03-28 14:00:06 +00:00
|
|
|
QString newpwd = QString("%1/config.tests/%2").arg(buildPath, projectPath);
|
2011-12-30 00:44:16 +00:00
|
|
|
if (!QDir().exists(newpwd) && !QDir().mkpath(newpwd)) {
|
2012-03-28 14:00:06 +00:00
|
|
|
cout << "Failed to create directory " << qPrintable(QDir::toNativeSeparators(newpwd)) << endl;
|
2011-12-30 00:44:16 +00:00
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (!QDir::setCurrent(newpwd)) {
|
2012-03-28 14:00:06 +00:00
|
|
|
cout << "Failed to change working directory to " << qPrintable(QDir::toNativeSeparators(newpwd)) << endl;
|
2011-12-30 00:44:16 +00:00
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// run qmake
|
2015-10-01 14:39:57 +00:00
|
|
|
QString command = QString("%1 %2 %3")
|
2014-11-20 14:33:54 +00:00
|
|
|
.arg(QDir::toNativeSeparators(QDir(newpwd).relativeFilePath(buildPath + "/bin/qmake.exe")),
|
2012-03-28 14:00:06 +00:00
|
|
|
QDir::toNativeSeparators(sourcePath + "/config.tests/" + projectPath),
|
|
|
|
extraOptions);
|
2013-11-05 19:36:01 +00:00
|
|
|
|
|
|
|
if (dictionary.contains("XQMAKESPEC")) {
|
|
|
|
const QString qmakespec = dictionary["XQMAKESPEC"];
|
|
|
|
if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone"))
|
|
|
|
command.append(" QMAKE_LFLAGS+=/ENTRY:main");
|
2014-07-02 12:43:18 +00:00
|
|
|
addSysroot(&command);
|
2013-11-05 19:36:01 +00:00
|
|
|
}
|
|
|
|
|
2015-10-01 14:39:57 +00:00
|
|
|
if (verbose)
|
|
|
|
cout << qPrintable(command) << endl;
|
|
|
|
else
|
|
|
|
command += " 2>&1";
|
|
|
|
|
2011-12-30 00:44:16 +00:00
|
|
|
int code = 0;
|
|
|
|
QString output = Environment::execute(command, &code);
|
|
|
|
//cout << output << endl;
|
|
|
|
|
|
|
|
if (code == 0) {
|
|
|
|
// compile
|
|
|
|
command = dictionary[ "MAKE" ];
|
2015-02-05 17:07:03 +00:00
|
|
|
if (command.contains("nmake") || command.contains("jom"))
|
2011-12-30 00:44:16 +00:00
|
|
|
command += " /NOLOGO";
|
2015-10-01 14:39:57 +00:00
|
|
|
if (verbose)
|
|
|
|
cout << qPrintable(command) << endl;
|
|
|
|
else
|
|
|
|
command += " -s 2>&1";
|
2011-12-30 00:44:16 +00:00
|
|
|
output = Environment::execute(command, &code);
|
|
|
|
//cout << output << endl;
|
|
|
|
|
|
|
|
// clean up
|
2015-08-01 20:31:35 +00:00
|
|
|
if (distClean)
|
|
|
|
Environment::execute(command + " distclean 2>&1");
|
2011-12-30 00:44:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QDir::setCurrent(oldpwd);
|
|
|
|
return code == 0;
|
|
|
|
}
|
|
|
|
|
2012-09-20 12:11:25 +00:00
|
|
|
bool Configure::compilerSupportsFlag(const QString &compilerAndArgs)
|
|
|
|
{
|
|
|
|
QFile file("conftest.cpp");
|
|
|
|
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
|
|
|
cout << "could not open temp file for writing" << endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (!file.write("int main() { return 0; }\r\n")) {
|
|
|
|
cout << "could not write to temp file" << endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
file.close();
|
|
|
|
// compilerAndArgs contains compiler because there is no way to query it
|
|
|
|
QString command = compilerAndArgs + " -o conftest-out.o conftest.cpp";
|
|
|
|
int code = 0;
|
|
|
|
QString output = Environment::execute(command, &code);
|
|
|
|
file.remove();
|
|
|
|
QFile::remove("conftest-out.o");
|
|
|
|
return code == 0;
|
|
|
|
}
|
|
|
|
|
2013-08-09 12:10:15 +00:00
|
|
|
void Configure::generateQDevicePri()
|
|
|
|
{
|
|
|
|
FileWriter deviceStream(buildPath + "/mkspecs/qdevice.pri");
|
|
|
|
if (dictionary.contains("DEVICE_OPTION")) {
|
|
|
|
const QString devoptionlist = dictionary["DEVICE_OPTION"];
|
|
|
|
const QStringList optionlist = devoptionlist.split(QStringLiteral("\n"));
|
|
|
|
foreach (const QString &entry, optionlist)
|
|
|
|
deviceStream << entry << "\n";
|
|
|
|
}
|
|
|
|
if (dictionary.contains("ANDROID_SDK_ROOT") && dictionary.contains("ANDROID_NDK_ROOT")) {
|
|
|
|
deviceStream << "android_install {" << endl;
|
|
|
|
deviceStream << " DEFAULT_ANDROID_SDK_ROOT = " << formatPath(dictionary["ANDROID_SDK_ROOT"]) << endl;
|
|
|
|
deviceStream << " DEFAULT_ANDROID_NDK_ROOT = " << formatPath(dictionary["ANDROID_NDK_ROOT"]) << endl;
|
2016-03-09 17:27:50 +00:00
|
|
|
if (dictionary.contains("ANDROID_HOST"))
|
|
|
|
deviceStream << " DEFAULT_ANDROID_NDK_HOST = " << dictionary["ANDROID_HOST"] << endl;
|
|
|
|
else if (QSysInfo::WordSize == 64)
|
2013-08-09 12:10:15 +00:00
|
|
|
deviceStream << " DEFAULT_ANDROID_NDK_HOST = windows-x86_64" << endl;
|
|
|
|
else
|
|
|
|
deviceStream << " DEFAULT_ANDROID_NDK_HOST = windows" << endl;
|
|
|
|
QString android_arch(dictionary.contains("ANDROID_TARGET_ARCH")
|
|
|
|
? dictionary["ANDROID_TARGET_ARCH"]
|
|
|
|
: QString("armeabi-v7a"));
|
|
|
|
QString android_tc_vers(dictionary.contains("ANDROID_NDK_TOOLCHAIN_VERSION")
|
|
|
|
? dictionary["ANDROID_NDK_TOOLCHAIN_VERSION"]
|
2014-10-31 08:52:36 +00:00
|
|
|
: QString("4.9"));
|
2014-10-30 15:16:01 +00:00
|
|
|
|
|
|
|
bool targetIs64Bit = android_arch == QString("arm64-v8a")
|
|
|
|
|| android_arch == QString("x86_64")
|
|
|
|
|| android_arch == QString("mips64");
|
|
|
|
QString android_platform(dictionary.contains("ANDROID_PLATFORM")
|
|
|
|
? dictionary["ANDROID_PLATFORM"]
|
|
|
|
: (targetIs64Bit ? QString("android-21") : QString("android-9")));
|
|
|
|
|
|
|
|
deviceStream << " DEFAULT_ANDROID_PLATFORM = " << android_platform << endl;
|
2013-08-09 12:10:15 +00:00
|
|
|
deviceStream << " DEFAULT_ANDROID_TARGET_ARCH = " << android_arch << endl;
|
|
|
|
deviceStream << " DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION = " << android_tc_vers << endl;
|
|
|
|
deviceStream << "}" << endl;
|
|
|
|
}
|
|
|
|
if (!deviceStream.flush())
|
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
}
|
|
|
|
|
2012-02-14 09:01:17 +00:00
|
|
|
void Configure::generateQConfigPri()
|
|
|
|
{
|
2010-11-11 15:35:09 +00:00
|
|
|
// Generate qconfig.pri
|
2013-07-15 14:45:44 +00:00
|
|
|
{
|
2013-07-24 11:48:36 +00:00
|
|
|
FileWriter configStream(buildPath + "/mkspecs/qconfig.pri");
|
2010-11-11 15:35:09 +00:00
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
configStream << "CONFIG+= ";
|
|
|
|
configStream << dictionary[ "BUILD" ];
|
2013-02-15 18:28:28 +00:00
|
|
|
configStream << (dictionary[ "SHARED" ] == "no" ? " static" : " shared");
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2015-02-20 10:07:09 +00:00
|
|
|
if (dictionary["STATIC_RUNTIME"] == "yes")
|
|
|
|
configStream << " static_runtime";
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary[ "RTTI" ] == "yes")
|
|
|
|
configStream << " rtti";
|
|
|
|
if (dictionary["INCREDIBUILD_XGE"] == "yes")
|
|
|
|
configStream << " incredibuild_xge";
|
|
|
|
if (dictionary["PLUGIN_MANIFESTS"] == "no")
|
|
|
|
configStream << " no_plugin_manifest";
|
2012-02-29 23:55:13 +00:00
|
|
|
if (dictionary["CROSS_COMPILE"] == "yes")
|
|
|
|
configStream << " cross_compile";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2012-09-18 18:15:18 +00:00
|
|
|
if (dictionary[ "SLOG2" ] == "yes")
|
|
|
|
configStream << " slog2";
|
|
|
|
|
2013-10-16 15:38:32 +00:00
|
|
|
if (dictionary[ "QNX_IMF" ] == "yes")
|
|
|
|
configStream << " qqnx_imf";
|
|
|
|
|
2013-11-21 11:58:22 +00:00
|
|
|
if (dictionary[ "PPS" ] == "yes")
|
|
|
|
configStream << " qqnx_pps";
|
|
|
|
|
2014-01-29 12:43:03 +00:00
|
|
|
if (dictionary[ "LGMON" ] == "yes")
|
|
|
|
configStream << " lgmon";
|
|
|
|
|
2014-09-30 08:34:00 +00:00
|
|
|
if (dictionary["ANDROID_STYLE_ASSETS"] == "yes")
|
|
|
|
configStream << " android-style-assets";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
configStream << endl;
|
2013-03-25 15:03:25 +00:00
|
|
|
configStream << "host_build {" << endl;
|
|
|
|
configStream << " QT_ARCH = " << dictionary["QT_HOST_ARCH"] << endl;
|
2013-07-18 10:19:02 +00:00
|
|
|
configStream << " QT_TARGET_ARCH = " << dictionary["QT_ARCH"] << endl;
|
2013-03-25 15:03:25 +00:00
|
|
|
configStream << "} else {" << endl;
|
|
|
|
configStream << " QT_ARCH = " << dictionary["QT_ARCH"] << endl;
|
2013-04-01 13:26:23 +00:00
|
|
|
configStream << "}" << endl;
|
2012-05-18 18:00:23 +00:00
|
|
|
configStream << "QT_CONFIG += " << qtConfig.join(' ') << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
configStream << "#versioning " << endl
|
|
|
|
<< "QT_VERSION = " << dictionary["VERSION"] << endl
|
|
|
|
<< "QT_MAJOR_VERSION = " << dictionary["VERSION_MAJOR"] << endl
|
|
|
|
<< "QT_MINOR_VERSION = " << dictionary["VERSION_MINOR"] << endl
|
|
|
|
<< "QT_PATCH_VERSION = " << dictionary["VERSION_PATCH"] << endl;
|
|
|
|
|
2015-05-21 13:45:44 +00:00
|
|
|
configStream << endl
|
|
|
|
<< "QT_EDITION = " << dictionary["EDITION"] << endl;
|
|
|
|
|
2015-05-22 13:02:23 +00:00
|
|
|
if (dictionary["EDITION"] != "OpenSource" && dictionary["EDITION"] != "Preview") {
|
|
|
|
configStream << "QT_LICHECK = " << dictionary["LICHECK"] << endl;
|
|
|
|
configStream << "QT_RELEASE_DATE = " << dictionary["RELEASEDATE"] << endl;
|
|
|
|
}
|
|
|
|
|
2012-07-12 11:03:16 +00:00
|
|
|
if (!dictionary["CFG_SYSROOT"].isEmpty() && dictionary["CFG_GCC_SYSROOT"] == "yes") {
|
2012-02-28 19:57:38 +00:00
|
|
|
configStream << endl
|
|
|
|
<< "# sysroot" << endl
|
2012-07-03 14:19:28 +00:00
|
|
|
<< "!host_build {" << endl
|
2012-02-28 19:57:38 +00:00
|
|
|
<< " QMAKE_CFLAGS += --sysroot=$$[QT_SYSROOT]" << endl
|
|
|
|
<< " QMAKE_CXXFLAGS += --sysroot=$$[QT_SYSROOT]" << endl
|
|
|
|
<< " QMAKE_LFLAGS += --sysroot=$$[QT_SYSROOT]" << endl
|
|
|
|
<< "}" << endl;
|
|
|
|
}
|
|
|
|
|
2012-05-10 00:29:24 +00:00
|
|
|
if (!dictionary["QT_LIBINFIX"].isEmpty())
|
|
|
|
configStream << "QT_LIBINFIX = " << dictionary["QT_LIBINFIX"] << endl;
|
|
|
|
|
|
|
|
if (!dictionary["QT_NAMESPACE"].isEmpty())
|
|
|
|
configStream << "#namespaces" << endl << "QT_NAMESPACE = " << dictionary["QT_NAMESPACE"] << endl;
|
|
|
|
|
2014-04-16 17:35:17 +00:00
|
|
|
if (dictionary[ "SHARED" ] == "no")
|
|
|
|
configStream << "QT_DEFAULT_QPA_PLUGIN = q" << qpaPlatformName() << endl;
|
2012-12-10 14:11:47 +00:00
|
|
|
|
2015-03-04 11:58:28 +00:00
|
|
|
if (!dictionary["QT_GCC_MAJOR_VERSION"].isEmpty()) {
|
|
|
|
configStream << "QT_GCC_MAJOR_VERSION = " << dictionary["QT_GCC_MAJOR_VERSION"] << endl
|
|
|
|
<< "QT_GCC_MINOR_VERSION = " << dictionary["QT_GCC_MINOR_VERSION"] << endl
|
|
|
|
<< "QT_GCC_PATCH_VERSION = " << dictionary["QT_GCC_PATCH_VERSION"] << endl;
|
|
|
|
}
|
|
|
|
|
2013-07-15 14:45:44 +00:00
|
|
|
if (!configStream.flush())
|
|
|
|
dictionary[ "DONE" ] = "error";
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Configure::addDefine(QString def)
|
|
|
|
{
|
|
|
|
QString result, defNeg, defD = def;
|
|
|
|
|
|
|
|
defD.replace(QRegExp("=.*"), "");
|
|
|
|
def.replace(QRegExp("="), " ");
|
|
|
|
|
|
|
|
if (def.startsWith("QT_NO_")) {
|
|
|
|
defNeg = defD;
|
|
|
|
defNeg.replace("QT_NO_", "QT_");
|
|
|
|
} else if (def.startsWith("QT_")) {
|
|
|
|
defNeg = defD;
|
|
|
|
defNeg.replace("QT_", "QT_NO_");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (defNeg.isEmpty()) {
|
|
|
|
result = "#ifndef $DEFD\n"
|
|
|
|
"# define $DEF\n"
|
|
|
|
"#endif\n\n";
|
|
|
|
} else {
|
|
|
|
result = "#if defined($DEFD) && defined($DEFNEG)\n"
|
|
|
|
"# undef $DEFD\n"
|
|
|
|
"#elif !defined($DEFD)\n"
|
|
|
|
"# define $DEF\n"
|
|
|
|
"#endif\n\n";
|
|
|
|
}
|
|
|
|
result.replace("$DEFNEG", defNeg);
|
|
|
|
result.replace("$DEFD", defD);
|
|
|
|
result.replace("$DEF", def);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Configure::generateConfigfiles()
|
|
|
|
{
|
2013-07-15 14:45:44 +00:00
|
|
|
{
|
|
|
|
FileWriter tmpStream(buildPath + "/src/corelib/global/qconfig.h");
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2015-09-18 01:17:40 +00:00
|
|
|
tmpStream << "#define QT_VERSION_MAJOR " << dictionary["VERSION_MAJOR"] << endl
|
|
|
|
<< "#define QT_VERSION_MINOR " << dictionary["VERSION_MINOR"] << endl
|
|
|
|
<< "#define QT_VERSION_PATCH " << dictionary["VERSION_PATCH"] << endl
|
|
|
|
<< "#define QT_VERSION_STR \"" << dictionary["VERSION"] << "\"\n"
|
|
|
|
<< endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
tmpStream << endl;
|
|
|
|
|
2012-05-30 10:09:00 +00:00
|
|
|
if (dictionary[ "SHARED" ] == "no") {
|
|
|
|
tmpStream << "/* Qt was configured for a static build */" << endl
|
|
|
|
<< "#if !defined(QT_SHARED) && !defined(QT_STATIC)" << endl
|
|
|
|
<< "# define QT_STATIC" << endl
|
|
|
|
<< "#endif" << endl
|
|
|
|
<< endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
tmpStream << "/* License information */" << endl;
|
2014-02-26 14:16:34 +00:00
|
|
|
tmpStream << "#define QT_PRODUCT_LICENSEE \"" << dictionary[ "LICENSEE" ] << "\"" << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
tmpStream << "#define QT_PRODUCT_LICENSE \"" << dictionary[ "EDITION" ] << "\"" << endl;
|
|
|
|
tmpStream << endl;
|
|
|
|
if (dictionary["BUILDDEV"] == "yes") {
|
|
|
|
tmpStream << "/* Used for example to export symbols for the certain autotests*/" << endl;
|
|
|
|
tmpStream << "#define QT_BUILD_INTERNAL" << endl;
|
|
|
|
tmpStream << endl;
|
|
|
|
}
|
|
|
|
|
2012-08-11 20:55:04 +00:00
|
|
|
tmpStream << endl << "// Compiler sub-arch support" << endl;
|
|
|
|
if (dictionary[ "SSE2" ] == "yes")
|
2013-08-07 02:32:37 +00:00
|
|
|
tmpStream << "#define QT_COMPILER_SUPPORTS_SSE2 1" << endl;
|
2012-08-11 20:55:04 +00:00
|
|
|
if (dictionary[ "SSE3" ] == "yes")
|
2013-08-07 02:32:37 +00:00
|
|
|
tmpStream << "#define QT_COMPILER_SUPPORTS_SSE3 1" << endl;
|
2012-08-11 20:55:04 +00:00
|
|
|
if (dictionary[ "SSSE3" ] == "yes")
|
2013-08-07 02:32:37 +00:00
|
|
|
tmpStream << "#define QT_COMPILER_SUPPORTS_SSSE3 1" << endl;
|
2012-08-11 20:55:04 +00:00
|
|
|
if (dictionary[ "SSE4_1" ] == "yes")
|
2013-08-07 02:32:37 +00:00
|
|
|
tmpStream << "#define QT_COMPILER_SUPPORTS_SSE4_1 1" << endl;
|
2012-08-11 20:55:04 +00:00
|
|
|
if (dictionary[ "SSE4_2" ] == "yes")
|
2013-08-07 02:32:37 +00:00
|
|
|
tmpStream << "#define QT_COMPILER_SUPPORTS_SSE4_2 1" << endl;
|
2012-08-11 20:55:04 +00:00
|
|
|
if (dictionary[ "AVX" ] == "yes")
|
2013-08-07 02:32:37 +00:00
|
|
|
tmpStream << "#define QT_COMPILER_SUPPORTS_AVX 1" << endl;
|
2012-08-11 20:55:04 +00:00
|
|
|
if (dictionary[ "AVX2" ] == "yes")
|
2013-08-07 02:32:37 +00:00
|
|
|
tmpStream << "#define QT_COMPILER_SUPPORTS_AVX2 1" << endl;
|
2015-07-17 21:46:05 +00:00
|
|
|
foreach (const QString &avx512feature, dictionary[ "AVX512" ].split(' ', QString::SkipEmptyParts))
|
|
|
|
tmpStream << "#define QT_COMPILER_SUPPRTS_" << avx512feature.toUpper() << " 1" << endl;
|
2012-08-11 20:55:04 +00:00
|
|
|
|
2014-06-13 22:12:28 +00:00
|
|
|
if (dictionary["QREAL"] != "double") {
|
2013-10-01 10:34:20 +00:00
|
|
|
tmpStream << "#define QT_COORD_TYPE " << dictionary["QREAL"] << endl;
|
2014-06-13 22:12:28 +00:00
|
|
|
tmpStream << "#define QT_COORD_TYPE_STRING " << dictionary["QREAL_STRING"] << endl;
|
|
|
|
}
|
2012-08-11 20:55:04 +00:00
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
tmpStream << endl << "// Compile time features" << endl;
|
|
|
|
|
|
|
|
QStringList qconfigList;
|
|
|
|
if (dictionary["PNG"] != "yes") qconfigList += "QT_NO_IMAGEFORMAT_PNG";
|
|
|
|
|
|
|
|
if (dictionary["ACCESSIBILITY"] == "no") qconfigList += "QT_NO_ACCESSIBILITY";
|
2012-03-07 00:11:44 +00:00
|
|
|
if (dictionary["WIDGETS"] == "no") qconfigList += "QT_NO_WIDGETS";
|
2013-04-18 20:34:46 +00:00
|
|
|
if (dictionary["GUI"] == "no") qconfigList += "QT_NO_GUI";
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary["OPENGL"] == "no") qconfigList += "QT_NO_OPENGL";
|
2014-08-12 17:04:05 +00:00
|
|
|
if (dictionary["SSL"] == "no") qconfigList += "QT_NO_SSL";
|
|
|
|
if (dictionary["OPENSSL"] == "no") qconfigList += "QT_NO_OPENSSL";
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary["OPENSSL"] == "linked") qconfigList += "QT_LINKED_OPENSSL";
|
|
|
|
if (dictionary["DBUS"] == "no") qconfigList += "QT_NO_DBUS";
|
|
|
|
if (dictionary["FREETYPE"] == "no") qconfigList += "QT_NO_FREETYPE";
|
2013-08-26 15:44:36 +00:00
|
|
|
if (dictionary["HARFBUZZ"] == "no") qconfigList += "QT_NO_HARFBUZZ";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2014-03-03 20:20:30 +00:00
|
|
|
if (dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES";
|
2011-04-27 10:05:43 +00:00
|
|
|
if (dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES_2";
|
Dynamic GL switch on Windows
The patch introduces a new build configuration on Windows which
can be requested by passing -opengl dynamic to configure.
Platforms other than Windows (including WinRT) are not affected.
The existing Angle and desktop configurations are not affected.
These continue to function as before and Angle remains the default.
In the future, when all modules have added support for the dynamic
path, as described below, the default configuration could be changed
to be the dynamic one. This would allow providing a single set of
binaries in the official builds instead of the current two.
When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are
never defined. Instead, the code path that has traditionally been
desktop GL only becomes the dynamic path that has to do runtime
checks. Qt modules and applications are not linked to opengl32.dll or
libegl/glesv2.dll in this case. Instead, QtGui exports all necessary
egl/egl/gl functions which will, under the hood, forward all requests
to a dynamically loaded EGL/WGL/GL implementation.
Porting guide (better said, changes needed to prepare your code to
work with dynamic GL builds when the fallback to Angle is utilized):
1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to
differentiate between desktop and ES where needed. Keep in mind that
it is the desktop GL header (plus qopenglext.h) that is included,
not the GLES one.
QtGui's proxy will handle some differences, for example calling
glClearDepth will route to glClearDepthf when needed. The built-in
eglGetProcAddress is able to retrieve pointers for standard GLES2
functions too so code resolving OpenGL 2 functions will function
in any case.
2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds,
but never "angle" or "opengles2".
3. The preprocessor define QT_OPENGL_DYNAMIC is also available in
dynamic builds. The usage of this is strongly discouraged and should
not be needed anywhere except for QtGui and the platform plugin.
4. Code in need of the library handle can use
QOpenGLFunctions::platformGLHandle().
The decision on which library to load is currently based on a simple
test that creates a dummy window/context and tries to resolve an
OpenGL 2 function. If this fails, it goes for Angle. This seems to work
well on Win7 PCs for example that do not have proper graphics drivers
providing OpenGL installed but are D3D9 capable using the default drivers.
Setting QT_OPENGL to desktop or angle skips the test and forces
usage of the given GL. There are also two new application attributes
that could be used for the same purpose.
If Angle is requested but the libraries are not present, desktop is
tried. If desktop is requested, or if angle is requested but nothing
works, the EGL/WGL functions will still be callable but will return 0.
This conveniently means that eglInitialize() and such will report a failure.
Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will
tell which implementation is chosen.
The textures example application is ported to OpenGL 2, the GL 1
code path is removed.
[ChangeLog][QtGui] Qt builds on Windows can now be configured for
dynamic loading of the OpenGL implementation. This can be requested
by passing -opengl dynamic to configure. In this mode no modules will
link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will
dynamically choose between desktop and Angle during the first GL/EGL/WGL
call. This allows deploying applications with a single set of Qt libraries
with the ability of transparently falling back to Angle in case the
opengl32.dll is not suitable, due to missing graphics drivers for example.
Task-number: QTBUG-36483
Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-01-27 13:45:11 +00:00
|
|
|
if (dictionary["DYNAMICGL"] == "yes") qconfigList += "QT_OPENGL_DYNAMIC";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2015-03-10 12:42:28 +00:00
|
|
|
if (dictionary["POSIX_IPC"] == "yes")
|
|
|
|
qconfigList += "QT_POSIX_IPC";
|
2016-03-04 16:11:09 +00:00
|
|
|
else if ((platform() != ANDROID) && (platform() != WINDOWS) && (platform() != WINDOWS_RT))
|
2015-03-10 12:42:28 +00:00
|
|
|
qconfigList << "QT_NO_SYSTEMSEMAPHORE" << "QT_NO_SHAREDMEMORY";
|
2012-06-20 14:00:34 +00:00
|
|
|
|
|
|
|
if (dictionary["FONT_CONFIG"] == "no") qconfigList += "QT_NO_FONTCONFIG";
|
|
|
|
|
|
|
|
if (dictionary["NIS"] == "yes")
|
|
|
|
qconfigList += "QT_NIS";
|
|
|
|
else
|
|
|
|
qconfigList += "QT_NO_NIS";
|
|
|
|
|
2014-09-24 14:31:33 +00:00
|
|
|
if (dictionary["SCTP"] == "no") qconfigList += "QT_NO_SCTP";
|
|
|
|
|
2012-08-21 09:52:28 +00:00
|
|
|
if (dictionary["LARGE_FILE"] == "yes") qconfigList += "QT_LARGEFILE_SUPPORT=64";
|
|
|
|
if (dictionary["QT_CUPS"] == "no") qconfigList += "QT_NO_CUPS";
|
|
|
|
if (dictionary["QT_ICONV"] == "no") qconfigList += "QT_NO_ICONV";
|
2014-04-02 09:54:36 +00:00
|
|
|
if (dictionary["QT_EVDEV"] == "no") qconfigList += "QT_NO_EVDEV";
|
2014-04-07 08:38:26 +00:00
|
|
|
if (dictionary["QT_MTDEV"] == "no") qconfigList += "QT_NO_MTDEV";
|
2015-03-12 13:18:26 +00:00
|
|
|
if (dictionary["QT_TSLIB"] == "no") qconfigList += "QT_NO_TSLIB";
|
2012-08-21 09:52:28 +00:00
|
|
|
if (dictionary["QT_GLIB"] == "no") qconfigList += "QT_NO_GLIB";
|
|
|
|
if (dictionary["QT_INOTIFY"] == "no") qconfigList += "QT_NO_INOTIFY";
|
2013-05-07 21:40:38 +00:00
|
|
|
if (dictionary["QT_EVENTFD"] == "no") qconfigList += "QT_NO_EVENTFD";
|
2015-09-08 23:35:33 +00:00
|
|
|
if (dictionary["ATOMIC64"] == "no") qconfigList += "QT_NO_STD_ATOMIC64";
|
2012-06-20 14:00:34 +00:00
|
|
|
|
2013-03-27 20:04:15 +00:00
|
|
|
if (dictionary["REDUCE_EXPORTS"] == "yes") qconfigList += "QT_VISIBILITY_AVAILABLE";
|
|
|
|
if (dictionary["REDUCE_RELOCATIONS"] == "yes") qconfigList += "QT_REDUCE_RELOCATIONS";
|
|
|
|
if (dictionary["QT_GETIFADDRS"] == "no") qconfigList += "QT_NO_GETIFADDRS";
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
qconfigList.sort();
|
|
|
|
for (int i = 0; i < qconfigList.count(); ++i)
|
|
|
|
tmpStream << addDefine(qconfigList.at(i));
|
|
|
|
|
2014-04-16 17:35:17 +00:00
|
|
|
tmpStream<<"#define QT_QPA_DEFAULT_PLATFORM_NAME \"" << qpaPlatformName() << "\""<<endl;
|
2012-04-18 22:57:00 +00:00
|
|
|
|
2013-07-15 14:45:44 +00:00
|
|
|
if (!tmpStream.flush())
|
|
|
|
dictionary[ "DONE" ] = "error";
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-02-05 14:45:53 +00:00
|
|
|
QString Configure::formatConfigPath(const char *var)
|
|
|
|
{
|
|
|
|
QString val = dictionary[var];
|
|
|
|
if (QFileInfo(val).isRelative()) {
|
|
|
|
QString pfx = dictionary["QT_INSTALL_PREFIX"];
|
|
|
|
val = (val == ".") ? pfx : QDir(pfx).absoluteFilePath(val);
|
|
|
|
}
|
|
|
|
return QDir::toNativeSeparators(val);
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
void Configure::displayConfig()
|
|
|
|
{
|
2012-05-18 05:23:50 +00:00
|
|
|
fstream sout;
|
|
|
|
sout.open(QString(buildPath + "/config.summary").toLocal8Bit().constData(),
|
|
|
|
ios::in | ios::out | ios::trunc);
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
// Give some feedback
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "Environment:" << endl;
|
2012-12-24 04:48:45 +00:00
|
|
|
QString env = QString::fromLocal8Bit(getenv("INCLUDE")).replace(QRegExp("[;,]"), "\n ");
|
2011-04-27 10:05:43 +00:00
|
|
|
if (env.isEmpty())
|
|
|
|
env = "Unset";
|
2012-12-24 04:48:45 +00:00
|
|
|
sout << " INCLUDE=\n " << env << endl;
|
|
|
|
env = QString::fromLocal8Bit(getenv("LIB")).replace(QRegExp("[;,]"), "\n ");
|
2011-04-27 10:05:43 +00:00
|
|
|
if (env.isEmpty())
|
|
|
|
env = "Unset";
|
2012-12-24 04:48:45 +00:00
|
|
|
sout << " LIB=\n " << env << endl;
|
|
|
|
env = QString::fromLocal8Bit(getenv("PATH")).replace(QRegExp("[;,]"), "\n ");
|
2011-04-27 10:05:43 +00:00
|
|
|
if (env.isEmpty())
|
|
|
|
env = "Unset";
|
2012-12-24 04:48:45 +00:00
|
|
|
sout << " PATH=\n " << env << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
Don't use QStringLiteral in comparisons
For QLatin1String, operator== is overloaded, so comparing to a latin-1
(C) string literal is efficient, since strlen() is comparatively fast.
OTOH, QStringLiteral, when not using RVO, litters the code with
QString dtor calls, which are not inline. Worse, absent lambdas,
it even allocates memory.
So, just compare using QLatin1String instead.
Change-Id: I761b2b26ab5b416bc695f524a9ee607dacf0a7b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-19 08:49:37 +00:00
|
|
|
if (dictionary[QStringLiteral("EDITION")] != QLatin1String("OpenSource")) {
|
2014-02-26 14:16:34 +00:00
|
|
|
QString l1 = dictionary[ "LICENSEE" ];
|
|
|
|
QString l2 = dictionary[ "LICENSEID" ];
|
2011-04-27 10:05:43 +00:00
|
|
|
QString l3 = dictionary["EDITION"] + ' ' + "Edition";
|
2014-02-26 14:16:34 +00:00
|
|
|
QString l4 = dictionary[ "EXPIRYDATE" ];
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "Licensee...................." << (l1.isNull() ? "" : l1) << endl;
|
|
|
|
sout << "License ID.................." << (l2.isNull() ? "" : l2) << endl;
|
|
|
|
sout << "Product license............." << (l3.isNull() ? "" : l3) << endl;
|
2013-08-26 15:23:40 +00:00
|
|
|
sout << "Expiry Date................." << (l4.isNull() ? "" : l4) << endl;
|
|
|
|
sout << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "Configuration:" << endl;
|
2012-12-24 04:48:45 +00:00
|
|
|
sout << " " << qmakeConfig.join("\n ") << endl;
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "Qt Configuration:" << endl;
|
2012-12-24 04:48:45 +00:00
|
|
|
sout << " " << qtConfig.join("\n ") << endl;
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
if (dictionary.contains("XQMAKESPEC"))
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "QMAKESPEC..................." << dictionary[ "XQMAKESPEC" ] << " (" << dictionary["QMAKESPEC_FROM"] << ")" << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
else
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "QMAKESPEC..................." << dictionary[ "QMAKESPEC" ] << " (" << dictionary["QMAKESPEC_FROM"] << ")" << endl;
|
2011-12-31 22:40:49 +00:00
|
|
|
sout << "Architecture................" << dictionary["QT_ARCH"]
|
|
|
|
<< ", features:" << dictionary["QT_CPU_FEATURES"] << endl;
|
|
|
|
sout << "Host Architecture..........." << dictionary["QT_HOST_ARCH"]
|
|
|
|
<< ", features:" << dictionary["QT_HOST_CPU_FEATURES"] << endl;
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "Maketool...................." << dictionary[ "MAKE" ] << endl;
|
2012-08-07 20:22:38 +00:00
|
|
|
if (dictionary[ "BUILDALL" ] == "yes") {
|
|
|
|
sout << "Debug build................." << "yes (combined)" << endl;
|
|
|
|
sout << "Default build..............." << dictionary[ "BUILD" ] << endl;
|
|
|
|
} else {
|
|
|
|
sout << "Debug......................." << (dictionary[ "BUILD" ] == "debug" ? "yes" : "no") << endl;
|
|
|
|
}
|
|
|
|
if (dictionary[ "BUILD" ] == "release" || dictionary[ "BUILDALL" ] == "yes")
|
|
|
|
sout << "Force debug info............" << dictionary[ "FORCEDEBUGINFO" ] << endl;
|
2015-10-26 11:38:50 +00:00
|
|
|
if (dictionary[ "BUILD" ] == "debug")
|
|
|
|
sout << "Force optimized tools......." << dictionary[ "RELEASE_TOOLS" ] << endl;
|
2015-07-09 00:21:30 +00:00
|
|
|
sout << "C++ language standard......." << dictionary[ "C++STD" ] << endl;
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "Link Time Code Generation..." << dictionary[ "LTCG" ] << endl;
|
2016-03-18 15:32:13 +00:00
|
|
|
sout << "Using PCH .................." << dictionary[ "PCH" ] << endl;
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "Accessibility support......." << dictionary[ "ACCESSIBILITY" ] << endl;
|
|
|
|
sout << "RTTI support................" << dictionary[ "RTTI" ] << endl;
|
2015-09-18 05:20:14 +00:00
|
|
|
sout << "SSE support................."
|
|
|
|
<< (dictionary[ "SSE2" ] == "no" ? "<none>" : "SSE2")
|
|
|
|
<< (dictionary[ "SSE3" ] == "no" ? "" : " SSE3")
|
|
|
|
<< (dictionary[ "SSSE3" ] == "no" ? "" : " SSSE3")
|
|
|
|
<< (dictionary[ "SSE4_1" ] == "no" ? "" : " SSE4.1")
|
|
|
|
<< (dictionary[ "SSE4_2" ] == "no" ? "" : " SSE4.2")
|
|
|
|
<< endl;
|
|
|
|
sout << "AVX support................."
|
|
|
|
<< (dictionary[ "AVX" ] == "no" ? "<none>" : "AVX")
|
|
|
|
<< (dictionary[ "AVX2" ] == "no" ? "" : " AVX2")
|
|
|
|
<< endl;
|
2015-07-17 21:46:05 +00:00
|
|
|
sout << "AVX512 support.............."
|
|
|
|
<< (dictionary[ "AVX512" ].isEmpty() ? QString("<none>") : dictionary[ "AVX512" ].toUpper()) << endl;
|
2012-06-20 14:00:34 +00:00
|
|
|
sout << "NEON support................" << dictionary[ "NEON" ] << endl;
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "OpenGL support.............." << dictionary[ "OPENGL" ] << endl;
|
2012-06-20 14:00:34 +00:00
|
|
|
sout << "NIS support................." << dictionary[ "NIS" ] << endl;
|
|
|
|
sout << "Iconv support..............." << dictionary[ "QT_ICONV" ] << endl;
|
2014-04-02 09:54:36 +00:00
|
|
|
sout << "Evdev support..............." << dictionary[ "QT_EVDEV" ] << endl;
|
2014-04-07 08:38:26 +00:00
|
|
|
sout << "Mtdev support..............." << dictionary[ "QT_MTDEV" ] << endl;
|
2012-11-14 16:33:16 +00:00
|
|
|
sout << "Inotify support............." << dictionary[ "QT_INOTIFY" ] << endl;
|
2013-05-07 21:40:38 +00:00
|
|
|
sout << "eventfd(7) support.........." << dictionary[ "QT_EVENTFD" ] << endl;
|
2012-06-20 14:00:34 +00:00
|
|
|
sout << "Glib support................" << dictionary[ "QT_GLIB" ] << endl;
|
2012-07-18 13:37:21 +00:00
|
|
|
sout << "CUPS support................" << dictionary[ "QT_CUPS" ] << endl;
|
2014-08-12 17:04:05 +00:00
|
|
|
sout << "SSL support................." << dictionary[ "SSL" ] << endl;
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "OpenSSL support............." << dictionary[ "OPENSSL" ] << endl;
|
2015-01-27 17:41:32 +00:00
|
|
|
sout << "libproxy support............" << dictionary[ "LIBPROXY" ] << endl;
|
2012-12-29 03:32:44 +00:00
|
|
|
sout << "Qt D-Bus support............" << dictionary[ "DBUS" ] << endl;
|
|
|
|
sout << "Qt Widgets module support..." << dictionary[ "WIDGETS" ] << endl;
|
2013-04-18 20:34:46 +00:00
|
|
|
sout << "Qt GUI module support......." << dictionary[ "GUI" ] << endl;
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "QML debugging..............." << dictionary[ "QML_DEBUG" ] << endl;
|
2012-10-23 13:31:20 +00:00
|
|
|
sout << "DirectWrite support........." << dictionary[ "DIRECTWRITE" ] << endl;
|
Add color font support on Windows
Detect if DirectWrite 2 is available, and support color fonts if possible.
One limitation worth mentioning is that if the color font contains regular,
monochrome glyphs as well, then these will be drawn in black, and not in the
pen color. Fixing this would require some elaborate rewrites in the font
rendering system, since we would have to have two font caches per
color font (one for mono and one for colors), or do some sort of trick where
we make argb(r, g, b, 0) mean subpixel alpha instead, and detect glyphs that
are not correctly premultiplied when blitting to the screen.
Another limitation is that the approach does not work with distance field
rendering. In principle we could support this on Windows, since the
format is vector based, but it would also require substantial work and
it is not possible to support for Apple/Google fonts anyway, so it would
just lead to code which is not cross-platform.
[ChangeLog][Windows] Added support for color fonts (color emojis) when
DirectWrite 2 is available.
Change-Id: I6a608dd5d2aa3a7e762a06830902bddac7c550a5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-12-16 14:52:28 +00:00
|
|
|
sout << "DirectWrite 2 support......." << dictionary[ "DIRECTWRITE2" ] << endl;
|
2013-08-26 15:23:40 +00:00
|
|
|
sout << "Use system proxies.........." << dictionary[ "SYSTEM_PROXIES" ] << endl;
|
2014-09-24 14:31:33 +00:00
|
|
|
sout << "SCTP support................" << dictionary[ "SCTP" ] << endl;
|
2013-08-26 15:23:40 +00:00
|
|
|
sout << endl;
|
2012-05-18 05:23:50 +00:00
|
|
|
|
2013-12-04 11:40:23 +00:00
|
|
|
sout << "QPA Backends:" << endl;
|
|
|
|
sout << " GDI....................." << "yes" << endl;
|
|
|
|
sout << " Direct2D................" << dictionary[ "DIRECT2D" ] << endl;
|
|
|
|
sout << endl;
|
|
|
|
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "Third Party Libraries:" << endl;
|
2016-02-19 14:18:47 +00:00
|
|
|
sout << " ZLIB support............" << (dictionary[ "SYSTEM_ZLIB" ] == QLatin1String("yes") ? QLatin1String("system") : QLatin1String("qt")) << endl;
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << " GIF support............." << dictionary[ "GIF" ] << endl;
|
2016-04-06 08:15:14 +00:00
|
|
|
sout << " JPEG support............" << dictionary[ "JPEG" ] << " (" << dictionary[ "LIBJPEG" ] << ")" << endl;
|
|
|
|
sout << " PNG support............." << dictionary[ "PNG" ] << " (" << dictionary[ "LIBPNG" ] << ")" << endl;
|
2015-10-15 13:40:26 +00:00
|
|
|
sout << " DoubleConversion........" << dictionary[ "DOUBLECONVERSION" ] << endl;
|
2013-08-26 15:23:40 +00:00
|
|
|
sout << " FreeType support........" << dictionary[ "FREETYPE" ] << endl;
|
2013-11-11 15:51:09 +00:00
|
|
|
sout << " Fontconfig support......" << dictionary[ "FONT_CONFIG" ] << endl;
|
2014-07-08 16:49:18 +00:00
|
|
|
sout << " HarfBuzz support........" << dictionary[ "HARFBUZZ" ] << endl;
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << " PCRE support............" << dictionary[ "PCRE" ] << endl;
|
|
|
|
sout << " ICU support............." << dictionary[ "ICU" ] << endl;
|
2015-10-15 13:24:54 +00:00
|
|
|
if (platform() == QNX) {
|
2012-09-18 18:15:18 +00:00
|
|
|
sout << " SLOG2 support..........." << dictionary[ "SLOG2" ] << endl;
|
2013-10-16 15:38:32 +00:00
|
|
|
sout << " IMF support............." << dictionary[ "QNX_IMF" ] << endl;
|
2013-11-21 11:58:22 +00:00
|
|
|
sout << " PPS support............." << dictionary[ "PPS" ] << endl;
|
2014-01-29 12:43:03 +00:00
|
|
|
sout << " LGMON support..........." << dictionary[ "LGMON" ] << endl;
|
2013-10-16 15:38:32 +00:00
|
|
|
}
|
2012-10-15 12:16:51 +00:00
|
|
|
sout << " ANGLE..................." << dictionary[ "ANGLE" ] << endl;
|
Dynamic GL switch on Windows
The patch introduces a new build configuration on Windows which
can be requested by passing -opengl dynamic to configure.
Platforms other than Windows (including WinRT) are not affected.
The existing Angle and desktop configurations are not affected.
These continue to function as before and Angle remains the default.
In the future, when all modules have added support for the dynamic
path, as described below, the default configuration could be changed
to be the dynamic one. This would allow providing a single set of
binaries in the official builds instead of the current two.
When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are
never defined. Instead, the code path that has traditionally been
desktop GL only becomes the dynamic path that has to do runtime
checks. Qt modules and applications are not linked to opengl32.dll or
libegl/glesv2.dll in this case. Instead, QtGui exports all necessary
egl/egl/gl functions which will, under the hood, forward all requests
to a dynamically loaded EGL/WGL/GL implementation.
Porting guide (better said, changes needed to prepare your code to
work with dynamic GL builds when the fallback to Angle is utilized):
1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to
differentiate between desktop and ES where needed. Keep in mind that
it is the desktop GL header (plus qopenglext.h) that is included,
not the GLES one.
QtGui's proxy will handle some differences, for example calling
glClearDepth will route to glClearDepthf when needed. The built-in
eglGetProcAddress is able to retrieve pointers for standard GLES2
functions too so code resolving OpenGL 2 functions will function
in any case.
2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds,
but never "angle" or "opengles2".
3. The preprocessor define QT_OPENGL_DYNAMIC is also available in
dynamic builds. The usage of this is strongly discouraged and should
not be needed anywhere except for QtGui and the platform plugin.
4. Code in need of the library handle can use
QOpenGLFunctions::platformGLHandle().
The decision on which library to load is currently based on a simple
test that creates a dummy window/context and tries to resolve an
OpenGL 2 function. If this fails, it goes for Angle. This seems to work
well on Win7 PCs for example that do not have proper graphics drivers
providing OpenGL installed but are D3D9 capable using the default drivers.
Setting QT_OPENGL to desktop or angle skips the test and forces
usage of the given GL. There are also two new application attributes
that could be used for the same purpose.
If Angle is requested but the libraries are not present, desktop is
tried. If desktop is requested, or if angle is requested but nothing
works, the EGL/WGL functions will still be callable but will return 0.
This conveniently means that eglInitialize() and such will report a failure.
Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will
tell which implementation is chosen.
The textures example application is ported to OpenGL 2, the GL 1
code path is removed.
[ChangeLog][QtGui] Qt builds on Windows can now be configured for
dynamic loading of the OpenGL implementation. This can be requested
by passing -opengl dynamic to configure. In this mode no modules will
link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will
dynamically choose between desktop and Angle during the first GL/EGL/WGL
call. This allows deploying applications with a single set of Qt libraries
with the ability of transparently falling back to Angle in case the
opengl32.dll is not suitable, due to missing graphics drivers for example.
Task-number: QTBUG-36483
Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-01-27 13:45:11 +00:00
|
|
|
sout << " Dynamic OpenGL.........." << dictionary[ "DYNAMICGL" ] << endl;
|
2013-08-26 15:23:40 +00:00
|
|
|
sout << endl;
|
2012-05-18 05:23:50 +00:00
|
|
|
|
|
|
|
sout << "Styles:" << endl;
|
|
|
|
sout << " Windows................." << dictionary[ "STYLE_WINDOWS" ] << endl;
|
|
|
|
sout << " Windows XP.............." << dictionary[ "STYLE_WINDOWSXP" ] << endl;
|
|
|
|
sout << " Windows Vista..........." << dictionary[ "STYLE_WINDOWSVISTA" ] << endl;
|
2012-09-21 17:53:28 +00:00
|
|
|
sout << " Fusion.................." << dictionary[ "STYLE_FUSION" ] << endl;
|
2013-08-26 15:23:40 +00:00
|
|
|
sout << endl;
|
2012-05-18 05:23:50 +00:00
|
|
|
|
|
|
|
sout << "Sql Drivers:" << endl;
|
|
|
|
sout << " ODBC...................." << dictionary[ "SQL_ODBC" ] << endl;
|
|
|
|
sout << " MySQL..................." << dictionary[ "SQL_MYSQL" ] << endl;
|
|
|
|
sout << " OCI....................." << dictionary[ "SQL_OCI" ] << endl;
|
|
|
|
sout << " PostgreSQL.............." << dictionary[ "SQL_PSQL" ] << endl;
|
|
|
|
sout << " TDS....................." << dictionary[ "SQL_TDS" ] << endl;
|
|
|
|
sout << " DB2....................." << dictionary[ "SQL_DB2" ] << endl;
|
|
|
|
sout << " SQLite.................." << dictionary[ "SQL_SQLITE" ] << " (" << dictionary[ "SQL_SQLITE_LIB" ] << ")" << endl;
|
|
|
|
sout << " SQLite2................." << dictionary[ "SQL_SQLITE2" ] << endl;
|
2013-08-26 15:23:40 +00:00
|
|
|
sout << " InterBase..............." << dictionary[ "SQL_IBASE" ] << endl;
|
|
|
|
sout << endl;
|
2012-05-18 05:23:50 +00:00
|
|
|
|
2013-07-24 11:48:36 +00:00
|
|
|
sout << "Sources are in.............." << QDir::toNativeSeparators(sourcePath) << endl;
|
|
|
|
sout << "Build is done in............" << QDir::toNativeSeparators(buildPath) << endl;
|
2012-03-28 14:00:06 +00:00
|
|
|
sout << "Install prefix.............." << QDir::toNativeSeparators(dictionary["QT_INSTALL_PREFIX"]) << endl;
|
2015-02-05 14:45:53 +00:00
|
|
|
sout << "Headers installed to........" << formatConfigPath("QT_REL_INSTALL_HEADERS") << endl;
|
|
|
|
sout << "Libraries installed to......" << formatConfigPath("QT_REL_INSTALL_LIBS") << endl;
|
|
|
|
sout << "Arch-dep. data to..........." << formatConfigPath("QT_REL_INSTALL_ARCHDATA") << endl;
|
|
|
|
sout << "Plugins installed to........" << formatConfigPath("QT_REL_INSTALL_PLUGINS") << endl;
|
|
|
|
sout << "Library execs installed to.." << formatConfigPath("QT_REL_INSTALL_LIBEXECS") << endl;
|
|
|
|
sout << "QML1 imports installed to..." << formatConfigPath("QT_REL_INSTALL_IMPORTS") << endl;
|
|
|
|
sout << "QML2 imports installed to..." << formatConfigPath("QT_REL_INSTALL_QML") << endl;
|
|
|
|
sout << "Binaries installed to......." << formatConfigPath("QT_REL_INSTALL_BINS") << endl;
|
|
|
|
sout << "Arch-indep. data to........." << formatConfigPath("QT_REL_INSTALL_DATA") << endl;
|
|
|
|
sout << "Docs installed to..........." << formatConfigPath("QT_REL_INSTALL_DOCS") << endl;
|
|
|
|
sout << "Translations installed to..." << formatConfigPath("QT_REL_INSTALL_TRANSLATIONS") << endl;
|
|
|
|
sout << "Examples installed to......." << formatConfigPath("QT_REL_INSTALL_EXAMPLES") << endl;
|
|
|
|
sout << "Tests installed to.........." << formatConfigPath("QT_REL_INSTALL_TESTS") << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
if (checkAvailability("INCREDIBUILD_XGE"))
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "Using IncrediBuild XGE......" << dictionary["INCREDIBUILD_XGE"] << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
if (!qmakeDefines.isEmpty()) {
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "Defines.....................";
|
2011-04-27 10:05:43 +00:00
|
|
|
for (QStringList::Iterator defs = qmakeDefines.begin(); defs != qmakeDefines.end(); ++defs)
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << (*defs) << " ";
|
|
|
|
sout << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
if (!qmakeIncludes.isEmpty()) {
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "Include paths...............";
|
2011-04-27 10:05:43 +00:00
|
|
|
for (QStringList::Iterator incs = qmakeIncludes.begin(); incs != qmakeIncludes.end(); ++incs)
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << (*incs) << " ";
|
|
|
|
sout << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
if (!qmakeLibs.isEmpty()) {
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "Additional libraries........";
|
2011-04-27 10:05:43 +00:00
|
|
|
for (QStringList::Iterator libs = qmakeLibs.begin(); libs != qmakeLibs.end(); ++libs)
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << (*libs) << " ";
|
|
|
|
sout << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
if (dictionary[ "SHARED" ] == "no") {
|
2012-05-18 05:23:50 +00:00
|
|
|
sout << "WARNING: Using static linking will disable the use of plugins." << endl;
|
|
|
|
sout << " Make sure you compile ALL needed modules into the library." << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2012-07-26 15:16:29 +00:00
|
|
|
if (dictionary[ "OPENSSL" ] == "linked") {
|
|
|
|
if (!opensslLibsDebug.isEmpty() || !opensslLibsRelease.isEmpty()) {
|
|
|
|
sout << "Using OpenSSL libraries:" << endl;
|
|
|
|
sout << " debug : " << opensslLibsDebug << endl;
|
|
|
|
sout << " release: " << opensslLibsRelease << endl;
|
|
|
|
sout << " both : " << opensslLibs << endl;
|
|
|
|
} else if (opensslLibs.isEmpty()) {
|
|
|
|
sout << "NOTE: When linking against OpenSSL, you can override the default" << endl;
|
|
|
|
sout << "library names through OPENSSL_LIBS and optionally OPENSSL_LIBS_DEBUG/OPENSSL_LIBS_RELEASE" << endl;
|
|
|
|
sout << "For example:" << endl;
|
|
|
|
sout << " configure -openssl-linked OPENSSL_LIBS=\"-lssleay32 -llibeay32\"" << endl;
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2015-10-26 11:38:50 +00:00
|
|
|
if (dictionary["RELEASE_TOOLS"] == "yes" && dictionary["BUILD"] != "debug" ) {
|
|
|
|
sout << endl
|
|
|
|
<< "NOTE: -optimized-tools is not useful in -release mode." << endl;
|
|
|
|
}
|
2014-12-04 15:03:13 +00:00
|
|
|
if (!dictionary["PREFIX_COMPLAINTS"].isEmpty()) {
|
|
|
|
sout << endl
|
|
|
|
<< dictionary["PREFIX_COMPLAINTS"] << endl
|
|
|
|
<< endl;
|
|
|
|
}
|
2012-05-18 05:23:50 +00:00
|
|
|
|
|
|
|
// display config.summary
|
|
|
|
sout.seekg(0, ios::beg);
|
2012-09-03 10:54:33 +00:00
|
|
|
while (sout.good()) {
|
2012-05-18 05:23:50 +00:00
|
|
|
string str;
|
|
|
|
getline(sout, str);
|
|
|
|
cout << str << endl;
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Configure::generateHeaders()
|
|
|
|
{
|
2012-09-11 13:08:48 +00:00
|
|
|
if (dictionary["SYNCQT"] == "auto")
|
|
|
|
dictionary["SYNCQT"] = defaultTo("SYNCQT");
|
|
|
|
|
2011-09-07 18:08:34 +00:00
|
|
|
if (dictionary["SYNCQT"] == "yes") {
|
2012-11-01 13:31:16 +00:00
|
|
|
if (!QStandardPaths::findExecutable(QStringLiteral("perl.exe")).isEmpty()) {
|
2011-09-07 18:08:34 +00:00
|
|
|
cout << "Running syncqt..." << endl;
|
|
|
|
QStringList args;
|
2013-05-10 16:21:27 +00:00
|
|
|
args << "perl" << "-w";
|
|
|
|
args += sourcePath + "/bin/syncqt.pl";
|
2015-09-18 01:17:40 +00:00
|
|
|
args << "-version" << dictionary["VERSION"] << "-minimal" << "-module" << "QtCore";
|
2012-01-23 07:27:06 +00:00
|
|
|
args += sourcePath;
|
2012-08-31 13:43:40 +00:00
|
|
|
int retc = Environment::execute(args, QStringList(), QStringList());
|
2011-09-07 18:08:34 +00:00
|
|
|
if (retc) {
|
|
|
|
cout << "syncqt failed, return code " << retc << endl << endl;
|
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
cout << "Perl not found in environment - cannot run syncqt." << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-04 15:03:13 +00:00
|
|
|
void Configure::addConfStr(int group, const QString &val)
|
2013-08-09 11:34:04 +00:00
|
|
|
{
|
2014-12-04 15:03:13 +00:00
|
|
|
confStrOffsets[group] += ' ' + QString::number(confStringOff) + ',';
|
|
|
|
confStrings[group] += " \"" + val + "\\0\"\n";
|
|
|
|
confStringOff += val.length() + 1;
|
2013-08-09 11:34:04 +00:00
|
|
|
}
|
|
|
|
|
2012-06-14 14:17:11 +00:00
|
|
|
void Configure::generateQConfigCpp()
|
|
|
|
{
|
2014-12-03 09:13:41 +00:00
|
|
|
QString hostSpec = dictionary["QMAKESPEC"];
|
|
|
|
QString targSpec = dictionary.contains("XQMAKESPEC") ? dictionary["XQMAKESPEC"] : hostSpec;
|
|
|
|
|
2014-12-04 15:03:13 +00:00
|
|
|
dictionary["CFG_SYSROOT"] = QDir::cleanPath(dictionary["CFG_SYSROOT"]);
|
|
|
|
|
2012-06-14 14:17:11 +00:00
|
|
|
bool qipempty = false;
|
|
|
|
if (dictionary["QT_INSTALL_PREFIX"].isEmpty())
|
|
|
|
qipempty = true;
|
|
|
|
else
|
2014-12-04 15:03:13 +00:00
|
|
|
dictionary["QT_INSTALL_PREFIX"] = QDir::cleanPath(dictionary["QT_INSTALL_PREFIX"]);
|
|
|
|
|
|
|
|
bool sysrootifyPrefix;
|
|
|
|
if (dictionary["QT_EXT_PREFIX"].isEmpty()) {
|
|
|
|
dictionary["QT_EXT_PREFIX"] = dictionary["QT_INSTALL_PREFIX"];
|
|
|
|
sysrootifyPrefix = !dictionary["CFG_SYSROOT"].isEmpty();
|
|
|
|
} else {
|
|
|
|
dictionary["QT_EXT_PREFIX"] = QDir::cleanPath(dictionary["QT_EXT_PREFIX"]);
|
|
|
|
sysrootifyPrefix = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool haveHpx;
|
|
|
|
if (dictionary["QT_HOST_PREFIX"].isEmpty()) {
|
|
|
|
dictionary["QT_HOST_PREFIX"] = (sysrootifyPrefix ? dictionary["CFG_SYSROOT"] : QString())
|
|
|
|
+ dictionary["QT_INSTALL_PREFIX"];
|
|
|
|
haveHpx = false;
|
|
|
|
} else {
|
|
|
|
dictionary["QT_HOST_PREFIX"] = QDir::cleanPath(dictionary["QT_HOST_PREFIX"]);
|
2012-06-14 14:17:11 +00:00
|
|
|
haveHpx = true;
|
2014-12-04 15:03:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const struct {
|
|
|
|
const char *basevar, *baseoption, *var, *option;
|
|
|
|
} varmod[] = {
|
|
|
|
{ "INSTALL_", "-prefix", "DOCS", "-docdir" },
|
|
|
|
{ "INSTALL_", "-prefix", "HEADERS", "-headerdir" },
|
|
|
|
{ "INSTALL_", "-prefix", "LIBS", "-libdir" },
|
|
|
|
{ "INSTALL_", "-prefix", "LIBEXECS", "-libexecdir" },
|
|
|
|
{ "INSTALL_", "-prefix", "BINS", "-bindir" },
|
|
|
|
{ "INSTALL_", "-prefix", "PLUGINS", "-plugindir" },
|
|
|
|
{ "INSTALL_", "-prefix", "IMPORTS", "-importdir" },
|
|
|
|
{ "INSTALL_", "-prefix", "QML", "-qmldir" },
|
|
|
|
{ "INSTALL_", "-prefix", "ARCHDATA", "-archdatadir" },
|
|
|
|
{ "INSTALL_", "-prefix", "DATA", "-datadir" },
|
|
|
|
{ "INSTALL_", "-prefix", "TRANSLATIONS", "-translationdir" },
|
|
|
|
{ "INSTALL_", "-prefix", "EXAMPLES", "-examplesdir" },
|
|
|
|
{ "INSTALL_", "-prefix", "TESTS", "-testsdir" },
|
|
|
|
{ "INSTALL_", "-prefix", "SETTINGS", "-sysconfdir" },
|
|
|
|
{ "HOST_", "-hostprefix", "BINS", "-hostbindir" },
|
|
|
|
{ "HOST_", "-hostprefix", "LIBS", "-hostlibdir" },
|
|
|
|
{ "HOST_", "-hostprefix", "DATA", "-hostdatadir" },
|
|
|
|
};
|
|
|
|
|
|
|
|
bool prefixReminder = false;
|
2015-02-06 13:53:12 +00:00
|
|
|
for (uint i = 0; i < sizeof(varmod) / sizeof(varmod[0]); i++) {
|
2014-12-04 15:03:13 +00:00
|
|
|
QString path = QDir::cleanPath(
|
|
|
|
dictionary[QLatin1String("QT_") + varmod[i].basevar + varmod[i].var]);
|
|
|
|
if (path.isEmpty())
|
|
|
|
continue;
|
|
|
|
QString base = dictionary[QLatin1String("QT_") + varmod[i].basevar + "PREFIX"];
|
|
|
|
if (!path.startsWith(base)) {
|
|
|
|
if (i != 13) {
|
|
|
|
dictionary["PREFIX_COMPLAINTS"] += QLatin1String("\n NOTICE: ")
|
|
|
|
+ varmod[i].option + " is not a subdirectory of " + varmod[i].baseoption + ".";
|
|
|
|
if (i < 13 ? qipempty : !haveHpx)
|
|
|
|
prefixReminder = true;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
path.remove(0, base.size());
|
|
|
|
if (path.startsWith('/'))
|
|
|
|
path.remove(0, 1);
|
|
|
|
}
|
|
|
|
dictionary[QLatin1String("QT_REL_") + varmod[i].basevar + varmod[i].var]
|
|
|
|
= path.isEmpty() ? "." : path;
|
|
|
|
}
|
|
|
|
if (prefixReminder) {
|
|
|
|
dictionary["PREFIX_COMPLAINTS"]
|
|
|
|
+= "\n Maybe you forgot to specify -prefix/-hostprefix?";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!qipempty) {
|
|
|
|
// If QT_INSTALL_* have not been specified on the command line,
|
|
|
|
// default them here, unless prefix is empty (WinCE).
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_INSTALL_HEADERS"].isEmpty())
|
|
|
|
dictionary["QT_REL_INSTALL_HEADERS"] = "include";
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_INSTALL_LIBS"].isEmpty())
|
|
|
|
dictionary["QT_REL_INSTALL_LIBS"] = "lib";
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_INSTALL_BINS"].isEmpty())
|
|
|
|
dictionary["QT_REL_INSTALL_BINS"] = "bin";
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_INSTALL_ARCHDATA"].isEmpty())
|
|
|
|
dictionary["QT_REL_INSTALL_ARCHDATA"] = ".";
|
|
|
|
if (dictionary["QT_REL_INSTALL_ARCHDATA"] != ".")
|
|
|
|
dictionary["QT_REL_INSTALL_ARCHDATA_PREFIX"] = dictionary["QT_REL_INSTALL_ARCHDATA"] + '/';
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_INSTALL_LIBEXECS"].isEmpty()) {
|
|
|
|
if (targSpec.startsWith("win"))
|
|
|
|
dictionary["QT_REL_INSTALL_LIBEXECS"] = dictionary["QT_REL_INSTALL_ARCHDATA_PREFIX"] + "bin";
|
|
|
|
else
|
|
|
|
dictionary["QT_REL_INSTALL_LIBEXECS"] = dictionary["QT_REL_INSTALL_ARCHDATA_PREFIX"] + "libexec";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_INSTALL_PLUGINS"].isEmpty())
|
|
|
|
dictionary["QT_REL_INSTALL_PLUGINS"] = dictionary["QT_REL_INSTALL_ARCHDATA_PREFIX"] + "plugins";
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_INSTALL_IMPORTS"].isEmpty())
|
|
|
|
dictionary["QT_REL_INSTALL_IMPORTS"] = dictionary["QT_REL_INSTALL_ARCHDATA_PREFIX"] + "imports";
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_INSTALL_QML"].isEmpty())
|
|
|
|
dictionary["QT_REL_INSTALL_QML"] = dictionary["QT_REL_INSTALL_ARCHDATA_PREFIX"] + "qml";
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_INSTALL_DATA"].isEmpty())
|
|
|
|
dictionary["QT_REL_INSTALL_DATA"] = ".";
|
|
|
|
if (dictionary["QT_REL_INSTALL_DATA"] != ".")
|
|
|
|
dictionary["QT_REL_INSTALL_DATA_PREFIX"] = dictionary["QT_REL_INSTALL_DATA"] + '/';
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_INSTALL_DOCS"].isEmpty())
|
|
|
|
dictionary["QT_REL_INSTALL_DOCS"] = dictionary["QT_REL_INSTALL_DATA_PREFIX"] + "doc";
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_INSTALL_TRANSLATIONS"].isEmpty())
|
|
|
|
dictionary["QT_REL_INSTALL_TRANSLATIONS"] = dictionary["QT_REL_INSTALL_DATA_PREFIX"] + "translations";
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_INSTALL_EXAMPLES"].isEmpty())
|
|
|
|
dictionary["QT_REL_INSTALL_EXAMPLES"] = "examples";
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_INSTALL_TESTS"].isEmpty())
|
|
|
|
dictionary["QT_REL_INSTALL_TESTS"] = "tests";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_HOST_BINS"].isEmpty())
|
|
|
|
dictionary["QT_REL_HOST_BINS"] = haveHpx ? "bin" : dictionary["QT_REL_INSTALL_BINS"];
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_HOST_LIBS"].isEmpty())
|
|
|
|
dictionary["QT_REL_HOST_LIBS"] = haveHpx ? "lib" : dictionary["QT_REL_INSTALL_LIBS"];
|
|
|
|
|
|
|
|
if (dictionary["QT_REL_HOST_DATA"].isEmpty())
|
|
|
|
dictionary["QT_REL_HOST_DATA"] = haveHpx ? "." : dictionary["QT_REL_INSTALL_ARCHDATA"];
|
|
|
|
|
|
|
|
confStringOff = 0;
|
|
|
|
addConfStr(0, dictionary["QT_REL_INSTALL_DOCS"]);
|
|
|
|
addConfStr(0, dictionary["QT_REL_INSTALL_HEADERS"]);
|
|
|
|
addConfStr(0, dictionary["QT_REL_INSTALL_LIBS"]);
|
|
|
|
addConfStr(0, dictionary["QT_REL_INSTALL_LIBEXECS"]);
|
|
|
|
addConfStr(0, dictionary["QT_REL_INSTALL_BINS"]);
|
|
|
|
addConfStr(0, dictionary["QT_REL_INSTALL_PLUGINS"]);
|
|
|
|
addConfStr(0, dictionary["QT_REL_INSTALL_IMPORTS"]);
|
|
|
|
addConfStr(0, dictionary["QT_REL_INSTALL_QML"]);
|
|
|
|
addConfStr(0, dictionary["QT_REL_INSTALL_ARCHDATA"]);
|
|
|
|
addConfStr(0, dictionary["QT_REL_INSTALL_DATA"]);
|
|
|
|
addConfStr(0, dictionary["QT_REL_INSTALL_TRANSLATIONS"]);
|
|
|
|
addConfStr(0, dictionary["QT_REL_INSTALL_EXAMPLES"]);
|
|
|
|
addConfStr(0, dictionary["QT_REL_INSTALL_TESTS"]);
|
|
|
|
addConfStr(1, dictionary["CFG_SYSROOT"]);
|
|
|
|
addConfStr(1, dictionary["QT_REL_HOST_BINS"]);
|
|
|
|
addConfStr(1, dictionary["QT_REL_HOST_LIBS"]);
|
|
|
|
addConfStr(1, dictionary["QT_REL_HOST_DATA"]);
|
|
|
|
addConfStr(1, targSpec);
|
|
|
|
addConfStr(1, hostSpec);
|
2012-06-14 14:17:11 +00:00
|
|
|
|
2013-07-15 14:45:44 +00:00
|
|
|
// Generate the new qconfig.cpp file
|
|
|
|
{
|
|
|
|
FileWriter tmpStream(buildPath + "/src/corelib/global/qconfig.cpp");
|
2016-05-11 12:36:13 +00:00
|
|
|
tmpStream << "/* Build date */" << endl
|
2015-02-05 06:37:13 +00:00
|
|
|
<< "static const char qt_configure_installation [11 + 12] = \"qt_instdate=2012-12-20\";" << endl
|
2012-06-14 14:17:11 +00:00
|
|
|
<< endl
|
2014-12-04 15:03:13 +00:00
|
|
|
<< "/* Installation Info */" << endl
|
|
|
|
<< "static const char qt_configure_prefix_path_str [512 + 12] = \"qt_prfxpath=" << dictionary["QT_INSTALL_PREFIX"] << "\";" << endl
|
2014-12-03 21:07:29 +00:00
|
|
|
<< "#ifdef QT_BUILD_QMAKE" << endl
|
|
|
|
<< "static const char qt_configure_ext_prefix_path_str [512 + 12] = \"qt_epfxpath=" << dictionary["QT_EXT_PREFIX"] << "\";" << endl
|
2014-12-04 15:03:13 +00:00
|
|
|
<< "static const char qt_configure_host_prefix_path_str [512 + 12] = \"qt_hpfxpath=" << dictionary["QT_HOST_PREFIX"] << "\";" << endl
|
2012-06-14 14:17:11 +00:00
|
|
|
<< "#endif" << endl
|
2014-12-04 15:03:13 +00:00
|
|
|
<< endl
|
|
|
|
<< "static const short qt_configure_str_offsets[] = {\n"
|
|
|
|
<< " " << confStrOffsets[0] << endl
|
|
|
|
<< "#ifdef QT_BUILD_QMAKE\n"
|
|
|
|
<< " " << confStrOffsets[1] << endl
|
|
|
|
<< "#endif\n"
|
|
|
|
<< "};\n"
|
|
|
|
<< "static const char qt_configure_strs[] =\n"
|
|
|
|
<< confStrings[0] << "#ifdef QT_BUILD_QMAKE\n"
|
|
|
|
<< confStrings[1] << "#endif\n"
|
|
|
|
<< ";\n"
|
|
|
|
<< endl;
|
2016-03-04 16:11:09 +00:00
|
|
|
if ((platform() != WINDOWS) && (platform() != WINDOWS_RT))
|
2015-02-25 11:11:23 +00:00
|
|
|
tmpStream << "#define QT_CONFIGURE_SETTINGS_PATH \"" << dictionary["QT_REL_INSTALL_SETTINGS"] << "\"" << endl;
|
2012-06-14 14:17:11 +00:00
|
|
|
|
|
|
|
tmpStream << endl
|
2013-08-09 11:34:04 +00:00
|
|
|
<< "#ifdef QT_BUILD_QMAKE\n"
|
2014-12-04 15:03:13 +00:00
|
|
|
<< "# define QT_CONFIGURE_SYSROOTIFY_PREFIX " << (sysrootifyPrefix ? "true" : "false") << endl
|
2013-08-09 11:34:04 +00:00
|
|
|
<< "#endif\n\n"
|
2014-12-04 15:03:13 +00:00
|
|
|
<< endl
|
|
|
|
<< "#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12\n"
|
|
|
|
<< "#ifdef QT_BUILD_QMAKE\n"
|
2014-12-03 21:07:29 +00:00
|
|
|
<< "# define QT_CONFIGURE_EXT_PREFIX_PATH qt_configure_ext_prefix_path_str + 12\n"
|
2014-12-04 15:03:13 +00:00
|
|
|
<< "# define QT_CONFIGURE_HOST_PREFIX_PATH qt_configure_host_prefix_path_str + 12\n"
|
|
|
|
<< "#endif\n";
|
2012-06-14 14:17:11 +00:00
|
|
|
|
2013-07-15 14:45:44 +00:00
|
|
|
if (!tmpStream.flush())
|
|
|
|
dictionary[ "DONE" ] = "error";
|
2012-06-14 14:17:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
void Configure::buildQmake()
|
|
|
|
{
|
2016-07-07 14:53:13 +00:00
|
|
|
{
|
2011-04-27 10:05:43 +00:00
|
|
|
QStringList args;
|
|
|
|
|
|
|
|
// Build qmake
|
|
|
|
QString pwd = QDir::currentPath();
|
2012-03-09 09:50:23 +00:00
|
|
|
if (!QDir(buildPath).mkpath("qmake")) {
|
|
|
|
cout << "Cannot create qmake build dir." << endl;
|
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!QDir::setCurrent(buildPath + "/qmake")) {
|
|
|
|
cout << "Cannot enter qmake build dir." << endl;
|
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
return;
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
QString makefile = "Makefile";
|
|
|
|
{
|
|
|
|
QFile out(makefile);
|
|
|
|
if (out.open(QFile::WriteOnly | QFile::Text)) {
|
|
|
|
QTextStream stream(&out);
|
|
|
|
stream << "#AutoGenerated by configure.exe" << endl
|
2014-11-20 14:33:54 +00:00
|
|
|
<< "BUILD_PATH = .." << endl
|
2013-05-28 19:34:05 +00:00
|
|
|
<< "SOURCE_PATH = " << QDir::toNativeSeparators(sourcePath) << endl
|
|
|
|
<< "INC_PATH = " << QDir::toNativeSeparators(
|
2014-11-20 14:33:54 +00:00
|
|
|
(QFile::exists(sourcePath + "/.git") ? ".." : sourcePath)
|
2013-05-28 19:34:05 +00:00
|
|
|
+ "/include") << endl;
|
2015-09-18 01:17:40 +00:00
|
|
|
stream << "QT_VERSION = " << dictionary["VERSION"] << endl
|
|
|
|
<< "QT_MAJOR_VERSION = " << dictionary["VERSION_MAJOR"] << endl
|
|
|
|
<< "QT_MINOR_VERSION = " << dictionary["VERSION_MINOR"] << endl
|
|
|
|
<< "QT_PATCH_VERSION = " << dictionary["VERSION_PATCH"] << endl;
|
2015-09-22 21:58:05 +00:00
|
|
|
if (dictionary[ "QMAKESPEC" ].startsWith("win32-g++")) {
|
|
|
|
stream << "QMAKESPEC = $(SOURCE_PATH)\\mkspecs\\" << dictionary[ "QMAKESPEC" ] << endl
|
2014-05-12 00:43:51 +00:00
|
|
|
<< "EXTRA_CFLAGS = -DUNICODE -ffunction-sections" << endl
|
2015-07-15 23:11:11 +00:00
|
|
|
<< "EXTRA_CXXFLAGS = -std=c++11 -DUNICODE -ffunction-sections" << endl
|
2014-05-06 18:27:06 +00:00
|
|
|
<< "EXTRA_LFLAGS = -Wl,--gc-sections" << endl
|
2013-02-02 12:31:53 +00:00
|
|
|
<< "QTOBJS = qfilesystemengine_win.o \\" << endl
|
|
|
|
<< " qfilesystemiterator_win.o \\" << endl
|
|
|
|
<< " qfsfileengine_win.o \\" << endl
|
|
|
|
<< " qlocale_win.o \\" << endl
|
|
|
|
<< " qsettings_win.o \\" << endl
|
|
|
|
<< " qsystemlibrary.o \\" << endl
|
|
|
|
<< " registry.o" << endl
|
|
|
|
<< "QTSRCS=\"$(SOURCE_PATH)/src/corelib/io/qfilesystemengine_win.cpp\" \\" << endl
|
|
|
|
<< " \"$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_win.cpp\" \\" << endl
|
|
|
|
<< " \"$(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp\" \\" << endl
|
|
|
|
<< " \"$(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp\" \\" << endl
|
|
|
|
<< " \"$(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp\" \\" << endl\
|
|
|
|
<< " \"$(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp\" \\" << endl
|
|
|
|
<< " \"$(SOURCE_PATH)/tools/shared/windows/registry.cpp\"" << endl
|
|
|
|
<< "EXEEXT=.exe" << endl
|
|
|
|
<< "LFLAGS=-static -s -lole32 -luuid -ladvapi32 -lkernel32" << endl;
|
|
|
|
/*
|
|
|
|
** SHELL is the full path of sh.exe, unless
|
|
|
|
** 1) it is found in the current directory
|
|
|
|
** 2) it is not found at all
|
|
|
|
** 3) it is overridden on the command line with an existing file
|
|
|
|
** ... otherwise it is always sh.exe. Specifically, SHELL from the
|
|
|
|
** environment has no effect.
|
|
|
|
**
|
|
|
|
** This check will fail if SHELL is explicitly set to a not
|
|
|
|
** sh-compatible shell. This is not a problem, because configure.bat
|
|
|
|
** will not do that.
|
|
|
|
*/
|
|
|
|
stream << "ifeq ($(SHELL), sh.exe)" << endl
|
|
|
|
<< " ifeq ($(wildcard $(CURDIR)/sh.exe), )" << endl
|
|
|
|
<< " SH = 0" << endl
|
|
|
|
<< " else" << endl
|
|
|
|
<< " SH = 1" << endl
|
|
|
|
<< " endif" << endl
|
|
|
|
<< "else" << endl
|
|
|
|
<< " SH = 1" << endl
|
|
|
|
<< "endif" << endl
|
|
|
|
<< "\n"
|
|
|
|
<< "ifeq ($(SH), 1)" << endl
|
|
|
|
<< " RM_F = rm -f" << endl
|
|
|
|
<< " RM_RF = rm -rf" << endl
|
|
|
|
<< "else" << endl
|
|
|
|
<< " RM_F = del /f" << endl
|
|
|
|
<< " RM_RF = rmdir /s /q" << endl
|
|
|
|
<< "endif" << endl;
|
|
|
|
stream << "\n\n";
|
|
|
|
} else {
|
|
|
|
stream << "QMAKESPEC = " << dictionary["QMAKESPEC"] << endl;
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
stream << "\n\n";
|
|
|
|
|
|
|
|
QFile in(sourcePath + "/qmake/" + dictionary["QMAKEMAKEFILE"]);
|
|
|
|
if (in.open(QFile::ReadOnly | QFile::Text)) {
|
|
|
|
QString d = in.readAll();
|
|
|
|
//### need replaces (like configure.sh)? --Sam
|
|
|
|
stream << d << endl;
|
|
|
|
}
|
|
|
|
stream.flush();
|
|
|
|
out.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
args += dictionary[ "MAKE" ];
|
|
|
|
args += "-f";
|
|
|
|
args += makefile;
|
|
|
|
|
|
|
|
cout << "Creating qmake..." << endl;
|
|
|
|
int exitCode = Environment::execute(args, QStringList(), QStringList());
|
|
|
|
if (exitCode) {
|
|
|
|
args.clear();
|
|
|
|
args += dictionary[ "MAKE" ];
|
|
|
|
args += "-f";
|
|
|
|
args += makefile;
|
|
|
|
args += "clean";
|
|
|
|
exitCode = Environment::execute(args, QStringList(), QStringList());
|
|
|
|
if (exitCode) {
|
|
|
|
cout << "Cleaning qmake failed, return code " << exitCode << endl << endl;
|
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
} else {
|
|
|
|
args.clear();
|
|
|
|
args += dictionary[ "MAKE" ];
|
|
|
|
args += "-f";
|
|
|
|
args += makefile;
|
|
|
|
exitCode = Environment::execute(args, QStringList(), QStringList());
|
|
|
|
if (exitCode) {
|
|
|
|
cout << "Building qmake failed, return code " << exitCode << endl << endl;
|
|
|
|
dictionary[ "DONE" ] = "error";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
QDir::setCurrent(pwd);
|
|
|
|
}
|
2012-05-03 13:36:03 +00:00
|
|
|
|
|
|
|
// Generate qt.conf
|
|
|
|
QFile confFile(buildPath + "/bin/qt.conf");
|
|
|
|
if (confFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file.
|
|
|
|
QTextStream confStream(&confFile);
|
|
|
|
confStream << "[EffectivePaths]" << endl
|
|
|
|
<< "Prefix=.." << endl;
|
2013-05-08 14:29:11 +00:00
|
|
|
if (sourcePath != buildPath)
|
|
|
|
confStream << "[EffectiveSourcePaths]" << endl
|
|
|
|
<< "Prefix=" << sourcePath << endl;
|
2012-05-03 13:36:03 +00:00
|
|
|
|
|
|
|
confStream.flush();
|
|
|
|
confFile.close();
|
|
|
|
}
|
2012-07-18 12:01:08 +00:00
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Configure::generateMakefiles()
|
|
|
|
{
|
|
|
|
QString pwd = QDir::currentPath();
|
2012-12-18 15:55:20 +00:00
|
|
|
{
|
2013-06-18 13:11:11 +00:00
|
|
|
QString sourcePathMangled = sourcePath;
|
|
|
|
QString buildPathMangled = buildPath;
|
|
|
|
if (dictionary.contains("TOPLEVEL")) {
|
|
|
|
sourcePathMangled = QFileInfo(sourcePath).path();
|
|
|
|
buildPathMangled = QFileInfo(buildPath).path();
|
|
|
|
}
|
2014-06-19 09:32:29 +00:00
|
|
|
QStringList args;
|
2014-06-19 09:46:10 +00:00
|
|
|
args << buildPath + "/bin/qmake" << sourcePathMangled;
|
2014-06-19 09:32:29 +00:00
|
|
|
|
|
|
|
QDir::setCurrent(buildPathMangled);
|
|
|
|
if (int exitCode = Environment::execute(args, QStringList(), QStringList())) {
|
|
|
|
cout << "Qmake failed, return code " << exitCode << endl << endl;
|
|
|
|
dictionary[ "DONE" ] = "error";
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
QDir::setCurrent(pwd);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Configure::showSummary()
|
|
|
|
{
|
|
|
|
QString make = dictionary[ "MAKE" ];
|
2012-08-01 12:43:42 +00:00
|
|
|
cout << endl << endl << "Qt is now configured for building. Just run " << qPrintable(make) << "." << endl;
|
|
|
|
cout << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Configure::showLicense(QString orgLicenseFile)
|
|
|
|
{
|
|
|
|
if (dictionary["LICENSE_CONFIRMED"] == "yes") {
|
|
|
|
cout << "You have already accepted the terms of the license." << endl << endl;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-02-12 20:46:51 +00:00
|
|
|
bool showGpl2 = true;
|
2011-04-27 10:05:43 +00:00
|
|
|
QString licenseFile = orgLicenseFile;
|
|
|
|
QString theLicense;
|
2015-05-22 13:33:34 +00:00
|
|
|
if (dictionary["EDITION"] == "OpenSource") {
|
2015-05-29 08:26:03 +00:00
|
|
|
if (platform() != WINDOWS_RT
|
|
|
|
&& (platform() != ANDROID || dictionary["ANDROID_STYLE_ASSETS"] == "no")) {
|
2016-02-12 20:46:51 +00:00
|
|
|
theLicense = "GNU Lesser General Public License (LGPL) version 3\n"
|
|
|
|
"or the GNU General Public License (GPL) version 2";
|
2014-09-30 08:34:00 +00:00
|
|
|
} else {
|
|
|
|
theLicense = "GNU Lesser General Public License (LGPL) version 3";
|
2016-02-12 20:46:51 +00:00
|
|
|
showGpl2 = false;
|
2014-09-30 08:34:00 +00:00
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
} else {
|
|
|
|
// the first line of the license file tells us which license it is
|
|
|
|
QFile file(licenseFile);
|
|
|
|
if (!file.open(QFile::ReadOnly)) {
|
|
|
|
cout << "Failed to load LICENSE file" << endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
theLicense = file.readLine().trimmed();
|
|
|
|
}
|
|
|
|
|
|
|
|
forever {
|
|
|
|
char accept = '?';
|
|
|
|
cout << "You are licensed to use this software under the terms of" << endl
|
|
|
|
<< "the " << theLicense << "." << endl
|
|
|
|
<< endl;
|
2015-05-22 13:33:34 +00:00
|
|
|
if (dictionary["EDITION"] == "OpenSource") {
|
2016-02-12 20:46:51 +00:00
|
|
|
cout << "Type 'L' to view the GNU Lesser General Public License version 3 (LGPLv3)." << endl;
|
|
|
|
if (showGpl2)
|
|
|
|
cout << "Type 'G' to view the GNU General Public License version 2 (GPLv2)." << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
} else {
|
|
|
|
cout << "Type '?' to view the " << theLicense << "." << endl;
|
|
|
|
}
|
|
|
|
cout << "Type 'y' to accept this license offer." << endl
|
|
|
|
<< "Type 'n' to decline this license offer." << endl
|
|
|
|
<< endl
|
|
|
|
<< "Do you accept the terms of the license?" << endl;
|
|
|
|
cin >> accept;
|
|
|
|
accept = tolower(accept);
|
|
|
|
|
|
|
|
if (accept == 'y') {
|
|
|
|
return true;
|
|
|
|
} else if (accept == 'n') {
|
|
|
|
return false;
|
|
|
|
} else {
|
2015-05-22 13:33:34 +00:00
|
|
|
if (dictionary["EDITION"] == "OpenSource") {
|
2016-02-12 20:46:51 +00:00
|
|
|
if (accept == 'L')
|
|
|
|
licenseFile = orgLicenseFile + "/LICENSE.LGPL3";
|
2011-04-27 10:05:43 +00:00
|
|
|
else
|
2016-02-12 20:46:51 +00:00
|
|
|
licenseFile = orgLicenseFile + "/LICENSE.GPL2";
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
// Get console line height, to fill the screen properly
|
|
|
|
int i = 0, screenHeight = 25; // default
|
|
|
|
CONSOLE_SCREEN_BUFFER_INFO consoleInfo;
|
|
|
|
HANDLE stdOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
|
|
if (GetConsoleScreenBufferInfo(stdOut, &consoleInfo))
|
|
|
|
screenHeight = consoleInfo.srWindow.Bottom
|
|
|
|
- consoleInfo.srWindow.Top
|
|
|
|
- 1; // Some overlap for context
|
|
|
|
|
|
|
|
// Prompt the license content to the user
|
|
|
|
QFile file(licenseFile);
|
|
|
|
if (!file.open(QFile::ReadOnly)) {
|
|
|
|
cout << "Failed to load LICENSE file" << licenseFile << endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
QStringList licenseContent = QString(file.readAll()).split('\n');
|
|
|
|
while (i < licenseContent.size()) {
|
|
|
|
cout << licenseContent.at(i) << endl;
|
|
|
|
if (++i % screenHeight == 0) {
|
2012-11-01 11:53:24 +00:00
|
|
|
promptKeyPress();
|
2011-04-27 10:05:43 +00:00
|
|
|
cout << "\r"; // Overwrite text above
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Configure::readLicense()
|
|
|
|
{
|
2012-06-08 13:20:35 +00:00
|
|
|
dictionary["PLATFORM NAME"] = platformName();
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary["LICENSE FILE"] = sourcePath;
|
|
|
|
|
|
|
|
bool openSource = false;
|
2016-02-12 20:46:51 +00:00
|
|
|
bool hasOpenSource = QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.LGPL3") || QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.GPL2");
|
2012-01-03 15:01:40 +00:00
|
|
|
if (dictionary["BUILDTYPE"] == "commercial") {
|
2011-04-27 10:05:43 +00:00
|
|
|
openSource = false;
|
|
|
|
} else if (dictionary["BUILDTYPE"] == "opensource") {
|
|
|
|
openSource = true;
|
|
|
|
} else if (hasOpenSource) { // No Open Source? Just display the commercial license right away
|
|
|
|
forever {
|
|
|
|
char accept = '?';
|
|
|
|
cout << "Which edition of Qt do you want to use ?" << endl;
|
|
|
|
cout << "Type 'c' if you want to use the Commercial Edition." << endl;
|
|
|
|
cout << "Type 'o' if you want to use the Open Source Edition." << endl;
|
|
|
|
cin >> accept;
|
|
|
|
accept = tolower(accept);
|
|
|
|
|
|
|
|
if (accept == 'c') {
|
|
|
|
openSource = false;
|
|
|
|
break;
|
|
|
|
} else if (accept == 'o') {
|
|
|
|
openSource = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (hasOpenSource && openSource) {
|
|
|
|
cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl;
|
2014-02-26 14:16:34 +00:00
|
|
|
dictionary["LICENSEE"] = "Open Source";
|
2011-04-27 10:05:43 +00:00
|
|
|
dictionary["EDITION"] = "OpenSource";
|
|
|
|
cout << endl;
|
|
|
|
if (!showLicense(dictionary["LICENSE FILE"])) {
|
|
|
|
cout << "Configuration aborted since license was not accepted";
|
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else if (openSource) {
|
|
|
|
cout << endl << "Cannot find the GPL license files! Please download the Open Source version of the library." << endl;
|
|
|
|
dictionary["DONE"] = "error";
|
|
|
|
}
|
|
|
|
else {
|
2014-02-26 14:16:34 +00:00
|
|
|
Tools::checkLicense(dictionary, sourcePath, buildPath);
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-06 10:47:12 +00:00
|
|
|
void Configure::reloadCmdLine(int idx)
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
|
|
|
if (dictionary[ "REDO" ] == "yes") {
|
2016-07-06 10:56:02 +00:00
|
|
|
QFile inFile(buildPath + "/config.opt");
|
|
|
|
if (!inFile.open(QFile::ReadOnly)) {
|
|
|
|
inFile.setFileName(buildPath + "/configure.cache");
|
|
|
|
if (!inFile.open(QFile::ReadOnly))
|
|
|
|
return;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2016-07-06 10:56:02 +00:00
|
|
|
QTextStream inStream(&inFile);
|
|
|
|
while (!inStream.atEnd())
|
|
|
|
configCmdLine.insert(idx++, inStream.readLine().trimmed());
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Configure::saveCmdLine()
|
|
|
|
{
|
|
|
|
if (dictionary[ "REDO" ] != "yes") {
|
2016-07-06 10:56:02 +00:00
|
|
|
QFile outFile(buildPath + "/config.opt");
|
2011-04-27 10:05:43 +00:00
|
|
|
if (outFile.open(QFile::WriteOnly | QFile::Text)) {
|
|
|
|
QTextStream outStream(&outFile);
|
|
|
|
for (QStringList::Iterator it = configCmdLine.begin(); it != configCmdLine.end(); ++it) {
|
2014-11-18 19:21:09 +00:00
|
|
|
outStream << (*it) << endl;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
outStream.flush();
|
|
|
|
outFile.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Configure::isDone()
|
|
|
|
{
|
|
|
|
return !dictionary["DONE"].isEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Configure::isOk()
|
|
|
|
{
|
|
|
|
return (dictionary[ "DONE" ] != "error");
|
|
|
|
}
|
|
|
|
|
2012-06-08 13:20:35 +00:00
|
|
|
QString Configure::platformName() const
|
|
|
|
{
|
|
|
|
switch (platform()) {
|
|
|
|
default:
|
|
|
|
case WINDOWS:
|
|
|
|
return QStringLiteral("Qt for Windows");
|
2013-09-02 08:55:55 +00:00
|
|
|
case WINDOWS_RT:
|
|
|
|
return QStringLiteral("Qt for Windows Runtime");
|
2012-06-08 13:20:35 +00:00
|
|
|
case QNX:
|
|
|
|
return QStringLiteral("Qt for QNX");
|
2013-03-27 20:34:42 +00:00
|
|
|
case ANDROID:
|
|
|
|
return QStringLiteral("Qt for Android");
|
2015-01-19 10:49:06 +00:00
|
|
|
case OTHER:
|
|
|
|
return QStringLiteral("Qt for ???");
|
2012-06-08 13:20:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Configure::qpaPlatformName() const
|
|
|
|
{
|
|
|
|
switch (platform()) {
|
|
|
|
default:
|
|
|
|
case WINDOWS:
|
|
|
|
return QStringLiteral("windows");
|
2013-09-02 08:55:55 +00:00
|
|
|
case WINDOWS_RT:
|
|
|
|
return QStringLiteral("winrt");
|
2012-06-08 13:20:35 +00:00
|
|
|
case QNX:
|
|
|
|
return QStringLiteral("qnx");
|
2013-03-27 20:34:42 +00:00
|
|
|
case ANDROID:
|
|
|
|
return QStringLiteral("android");
|
2015-01-19 10:49:06 +00:00
|
|
|
case OTHER:
|
|
|
|
return QStringLiteral("xcb");
|
2012-06-08 13:20:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int Configure::platform() const
|
|
|
|
{
|
|
|
|
const QString xQMakeSpec = dictionary.value("XQMAKESPEC");
|
|
|
|
|
2013-09-02 08:55:55 +00:00
|
|
|
if ((xQMakeSpec.startsWith("winphone") || xQMakeSpec.startsWith("winrt")))
|
|
|
|
return WINDOWS_RT;
|
|
|
|
|
2012-06-08 13:20:35 +00:00
|
|
|
if (xQMakeSpec.contains("qnx"))
|
|
|
|
return QNX;
|
|
|
|
|
2013-03-27 20:34:42 +00:00
|
|
|
if (xQMakeSpec.contains("android"))
|
|
|
|
return ANDROID;
|
|
|
|
|
2015-01-19 10:49:06 +00:00
|
|
|
if (!xQMakeSpec.isEmpty())
|
|
|
|
return OTHER;
|
|
|
|
|
2012-06-08 13:20:35 +00:00
|
|
|
return WINDOWS;
|
|
|
|
}
|
|
|
|
|
2013-07-15 14:45:44 +00:00
|
|
|
FileWriter::FileWriter(const QString &name)
|
|
|
|
: QTextStream()
|
|
|
|
, m_name(name)
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
2013-07-15 14:45:44 +00:00
|
|
|
m_buffer.open(QIODevice::WriteOnly);
|
|
|
|
setDevice(&m_buffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool FileWriter::flush()
|
|
|
|
{
|
|
|
|
QTextStream::flush();
|
2013-07-15 14:46:28 +00:00
|
|
|
QFile oldFile(m_name);
|
|
|
|
if (oldFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
|
|
|
if (oldFile.readAll() == m_buffer.data())
|
|
|
|
return true;
|
|
|
|
oldFile.close();
|
|
|
|
}
|
2013-07-15 14:45:44 +00:00
|
|
|
QString dir = QFileInfo(m_name).absolutePath();
|
|
|
|
if (!QDir().mkpath(dir)) {
|
|
|
|
cout << "Cannot create directory " << qPrintable(QDir::toNativeSeparators(dir)) << ".\n";
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
QFile file(m_name + ".new");
|
|
|
|
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
|
|
|
if (file.write(m_buffer.data()) == m_buffer.data().size()) {
|
|
|
|
file.close();
|
|
|
|
if (file.error() == QFile::NoError) {
|
|
|
|
::SetFileAttributes((wchar_t*)m_name.utf16(), FILE_ATTRIBUTE_NORMAL);
|
|
|
|
QFile::remove(m_name);
|
|
|
|
if (!file.rename(m_name)) {
|
|
|
|
cout << "Cannot replace file " << qPrintable(QDir::toNativeSeparators(m_name)) << ".\n";
|
|
|
|
return false;
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
return true;
|
2013-07-15 14:45:44 +00:00
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
}
|
2013-07-15 14:45:44 +00:00
|
|
|
cout << "Cannot create file " << qPrintable(QDir::toNativeSeparators(file.fileName()))
|
|
|
|
<< ": " << qPrintable(file.errorString()) << ".\n";
|
|
|
|
file.remove();
|
|
|
|
return false;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QT_END_NAMESPACE
|