Remove the build-key from the plugin verification data

The build-key is an old mechanism to work around binary
incompatibilities in GCC 3.x versions. Modern GCC has not broken binary
compatibility since 3.4, making this mechanism obsolete.

The cache value stored now only includes Qt version, the debug/release
boolean, and the last modified time for the plugin. Old 4-value keys
will be replaced with new keys as the plugins are reloaded the first
time.

This also removes QLibraryInfo::buildKey(), which is a source-incompatible
change.

The UNIX and Windows configure tools have been updated to stop
outputting the QT_BUILD_KEY preprocessor directive.

See also:
http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-August/000892.html

Change-Id: I7d06969a370d3d2c6de413c1230d9d6789cbf195
Reviewed-on: http://codereview.qt.nokia.com/3977
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
This commit is contained in:
Bradley T. Hughes 2011-08-31 14:23:42 +02:00 committed by Qt by Nokia
parent e8192883b2
commit 7493ee1c44
10 changed files with 19 additions and 401 deletions

260
configure vendored
View File

@ -781,7 +781,6 @@ CFG_AVX=auto
CFG_REDUCE_RELOCATIONS=no
CFG_NAS=no
CFG_QWS_DEPTHS=all
CFG_USER_BUILD_KEY=
CFG_ACCESSIBILITY=auto
CFG_QT3SUPPORT=no
CFG_ENDIAN=auto
@ -1059,7 +1058,7 @@ while [ "$#" -gt 0 ]; do
shift
VAL=$1
;;
-prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-depths|-make|-nomake|-platform|-xplatform|-buildkey|-sdk|-arch|-host-arch|-mysql_config)
-prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-depths|-make|-nomake|-platform|-xplatform|-sdk|-arch|-host-arch|-mysql_config)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
shift
VAL="$1"
@ -1322,9 +1321,6 @@ while [ "$#" -gt 0 ]; do
bindir)
QT_INSTALL_BINS="$VAL"
;;
buildkey)
CFG_USER_BUILD_KEY="$VAL"
;;
sxe)
CFG_SXE="$VAL"
;;
@ -3722,7 +3718,7 @@ if [ "$OPT_HELP" = "yes" ]; then
Usage: $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir <dir>]
[-docdir <dir>] [-headerdir <dir>] [-plugindir <dir> ] [-importdir <dir>] [-datadir <dir>]
[-translationdir <dir>] [-sysconfdir <dir>] [-examplesdir <dir>]
[-buildkey <key>] [-release] [-debug] [-debug-and-release]
[-release] [-debug] [-debug-and-release]
[-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile]
[-largefile] [-no-exceptions] [-exceptions] [-no-accessibility]
[-accessibility] [-no-stl] [-stl] [-no-sql-<driver>] [-sql-<driver>]
@ -3800,12 +3796,6 @@ cat <<EOF
-examplesdir <dir> .... Examples will be installed to <dir>
(default PREFIX/examples)
You may use these options to turn on strict plugin loading.
-buildkey <key> .... Build the Qt library and plugins using the specified
<key>. When the library loads plugins, it will only
load those that have a matching key.
Configure options:
The defaults (*) are usually acceptable. A plus (+) denotes a default value
@ -7736,226 +7726,6 @@ if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" != "no" ] ; then
fi
fi
#-------------------------------------------------------------------------------
# generate QT_BUILD_KEY
#-------------------------------------------------------------------------------
# some compilers generate binary incompatible code between different versions,
# so we need to generate a build key that is different between these compilers
COMPAT_COMPILER=
case "$COMPILER" in
g++*)
# GNU C++
COMPILER_VERSION=`${QMAKE_CONF_COMPILER} -dumpversion 2>/dev/null`
case "$COMPILER_VERSION" in
*.*.*)
QT_GCC_MAJOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
QT_GCC_PATCH_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
;;
*.*)
QT_GCC_MAJOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\1,'`
QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\2,'`
QT_GCC_PATCH_VERSION=0
;;
esac
case "$COMPILER_VERSION" in
2.95.*)
COMPILER_VERSION="2.95.*"
;;
3.*)
COMPILER_VERSION="3.*"
;;
4.*)
COMPILER_VERSION="4"
;;
*)
;;
esac
[ '!' -z "$COMPILER_VERSION" ] && COMPILER="g++-${COMPILER_VERSION}"
;;
icc*)
# The Intel CC compiler on Unix systems matches the ABI of the g++
# that is found on PATH
COMPAT_COMPILER="icc"
COMPILER="g++-4"
case "`g++ -dumpversion` 2>/dev/null" in
2.95.*)
COMPILER="g++-2.95.*"
;;
3.*)
a COMPILER="g++-3.*"
;;
*)
;;
esac
;;
*)
#
;;
esac
# QT_CONFIG can contain the following:
#
# Things that affect the Qt API/ABI:
#
# Options:
# minimal-config small-config medium-config large-config full-config
#
# Different edition modules:
# gui network canvas table xml opengl sql
#
# Things that do not affect the Qt API/ABI:
# stl
# system-jpeg no-jpeg jpeg
# system-mng no-mng mng
# system-png no-png png
# system-zlib no-zlib zlib
# system-libtiff no-libtiff
# no-gif gif
# debug release
# dll staticlib
#
# nocrosscompiler
# GNUmake
# largefile
# nis
# nas
# tablet
# ipv6
#
# X11 : x11sm xinerama xcursor xfixes xrandr xrender mitshm fontconfig xkb
# Embedded: embedded qpa freetype
#
ALL_OPTIONS=
BUILD_CONFIG=
BUILD_OPTIONS=
# determine the build options
for config_option in $QMAKE_CONFIG $QT_CONFIG; do
SKIP="yes"
case "$config_option" in
*-config)
# take the last *-config setting. this is the highest config being used,
# and is the one that we will use for tagging plugins
BUILD_CONFIG="$config_option"
;;
*) # skip all other options since they don't affect the Qt API/ABI.
;;
esac
if [ "$SKIP" = "no" ]; then
BUILD_OPTIONS="$BUILD_OPTIONS $config_option"
fi
done
# put the options that we are missing into .options
rm -f .options
for opt in `echo $ALL_OPTIONS`; do
SKIP="no"
if echo $BUILD_OPTIONS | grep $opt >/dev/null 2>&1; then
SKIP="yes"
fi
if [ "$SKIP" = "no" ]; then
echo "$opt" >> .options
fi
done
# reconstruct BUILD_OPTIONS with a sorted negative feature list
# (ie. only things that are missing are will be put into the build key)
BUILD_OPTIONS=
if [ -f .options ]; then
for opt in `sort -f .options | uniq`; do
BUILD_OPTIONS="$BUILD_OPTIONS no-$opt"
done
fi
rm -f .options
# QT_NO* defines affect the Qt API (and binary compatibility). they need
# to be included in the build key
for build_option in $D_FLAGS; do
build_option=`echo $build_option | cut -d \" -f 2 -`
case "$build_option" in
QT_NO*)
echo "$build_option" >> .options
;;
*)
# skip all other compiler defines
;;
esac
done
# sort the compile time defines (helps ensure that changes in this configure
# script don't affect the QT_BUILD_KEY generation)
if [ -f .options ]; then
for opt in `sort -f .options | uniq`; do
BUILD_OPTIONS="$BUILD_OPTIONS $opt"
done
fi
rm -f .options
BUILD_OPTIONS="$BUILD_CONFIG $BUILD_OPTIONS"
# extract the operating system from the XPLATFORM
TARGET_OPERATING_SYSTEM=`echo $XPLATFORM | cut -f 2- -d/ | cut -f -1 -d-`
if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
QT_BUILD_KEY_SYSTEM_PART="Symbian"
else
QT_BUILD_KEY_SYSTEM_PART="$CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER"
fi
# when cross-compiling, don't include build-host information (build key is target specific)
QT_BUILD_KEY="$CFG_USER_BUILD_KEY $QT_BUILD_KEY_SYSTEM_PART $BUILD_OPTIONS"
if [ -n "$QT_NAMESPACE" ]; then
QT_BUILD_KEY="$QT_BUILD_KEY $QT_NAMESPACE"
fi
MAC_NEED_TWO_BUILD_KEYS="no"
if [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" ]; then
QT_BUILD_KEY_CARBON=$QT_BUILD_KEY
TARGET_OPERATING_SYSTEM="$TARGET_OPERATING_SYSTEM-cocoa"
QT_BUILD_KEY_COCOA="$CFG_USER_BUILD_KEY $CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER $BUILD_OPTIONS"
if [ "$CFG_MAC_CARBON" = "no" ]; then
QT_BUILD_KEY=$QT_BUILD_KEY_COCOA
else
MAC_NEED_TWO_BUILD_KEYS="yes"
fi
fi
# don't break loading plugins build with an older version of Qt
QT_BUILD_KEY_COMPAT=
if [ "$QT_CROSS_COMPILE" = "no" ]; then
# previous versions of Qt used a build key built from the uname
QT_BUILD_KEY_COMPAT="$CFG_USER_BUILD_KEY $UNAME_MACHINE $UNAME_SYSTEM $COMPILER $BUILD_OPTIONS"
if [ -n "$QT_NAMESPACE" ]; then
QT_BUILD_KEY_COMPAT="$QT_BUILD_KEY_COMPAT $QT_NAMESPACE"
fi
fi
# is this compiler compatible with some other "standard" build key
QT_BUILD_KEY_COMPAT_COMPILER=
if [ ! -z "$COMPAT_COMPILER" ]; then
QT_BUILD_KEY_COMPAT_COMPILER="$CFG_USER_BUILD_KEY $CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPAT_COMPILER $BUILD_OPTIONS"
if [ -n "$QT_NAMESPACE" ]; then
QT_BUILD_KEY_COMPAT_COMPILER="$QT_BUILD_KEY_COMPAT_COMPILER $QT_NAMESPACE"
fi
fi
# is this arch compatible with some other "standard" build key
QT_BUILD_KEY_COMPAT_ARCH=
if [ ! -z "$COMPAT_ARCH" ]; then
QT_BUILD_KEY_COMPAT_ARCH="$CFG_USER_BUILD_KEY $COMPAT_ARCH $TARGET_OPERATING_SYSTEM $COMPILER $BUILD_OPTIONS"
if [ -n "$QT_NAMESPACE" ]; then
QT_BUILD_KEY_COMPAT_COMPILER="$QT_BUILD_KEY_COMPAT_ARCH $QT_NAMESPACE"
fi
fi
# strip out leading/trailing/extra whitespace
QT_BUILD_KEY=`echo $QT_BUILD_KEY | sed -e "s, *, ,g" -e "s,^ *,," -e "s, *$,,"`
QT_BUILD_KEY_COMPAT=`echo $QT_BUILD_KEY_COMPAT | sed -e "s, *, ,g" -e "s,^ *,," -e "s, *$,,"`
QT_BUILD_KEY_COMPAT_COMPILER=`echo $QT_BUILD_KEY_COMPAT_COMPILER | sed -e "s, *, ,g" -e "s,^ *,," -e "s, *$,,"`
QT_BUILD_KEY_COMPAT_ARCH=`echo $QT_BUILD_KEY_COMPAT_ARCH | sed -e "s, *, ,g" -e "s,^ *,," -e "s, *$,,"`
#-------------------------------------------------------------------------------
# part of configuration information goes into qconfig.h
#-------------------------------------------------------------------------------
@ -7988,32 +7758,6 @@ cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
#define Q_LITTLE_ENDIAN 1234
EOF
if [ "$MAC_NEED_TWO_BUILD_KEYS" = "no" ]; then
echo "#define QT_BUILD_KEY \"$QT_BUILD_KEY\"" \
>> "$outpath/src/corelib/global/qconfig.h.new"
else
cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
#define QT_BUILD_KEY_CARBON "$QT_BUILD_KEY_CARBON"
#define QT_BUILD_KEY_COCOA "$QT_BUILD_KEY_COCOA"
EOF
fi
if [ -n "$QT_BUILD_KEY_COMPAT" ]; then
echo "#define QT_BUILD_KEY_COMPAT \"$QT_BUILD_KEY_COMPAT\"" \
>> "$outpath/src/corelib/global/qconfig.h.new"
fi
if [ -n "$QT_BUILD_KEY_COMPAT_COMPILER" ]; then
echo "#define QT_BUILD_KEY_COMPAT2 \"$QT_BUILD_KEY_COMPAT_COMPILER\"" \
>> "$outpath/src/corelib/global/qconfig.h.new"
fi
if [ -n "$QT_BUILD_KEY_COMPAT_ARCH" ]; then
echo "#define QT_BUILD_KEY_COMPAT3 \"$QT_BUILD_KEY_COMPAT_ARCH\"" \
>> "$outpath/src/corelib/global/qconfig.h.new"
fi
echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
echo "#ifdef QT_BOOTSTRAPPED" >>"$outpath/src/corelib/global/qconfig.h.new"
if [ "$CFG_HOST_ENDIAN" = "auto" ]; then
cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF

4
dist/changes-5.0.0 vendored
View File

@ -24,6 +24,10 @@ information about a particular change.
via QT_DISABLE_DEPRECATED_BEFORE), use
QSslCertificate::subjectAlternativeNames() instead.
- QLibraryInfo::buildKey() has been removed. Likewise, the QT_BUILD_KEY
preprocessor #define has also been removed. The build-key is obsolete
and is no longer necessary.
****************************************************************************
* General *
****************************************************************************

View File

@ -301,9 +301,6 @@ namespace QT_NAMESPACE {}
#ifdef QT_AUTODETECT_COCOA
# ifdef Q_OS_MAC64
# define QT_MAC_USE_COCOA 1
# define QT_BUILD_KEY QT_BUILD_KEY_COCOA
# else
# define QT_BUILD_KEY QT_BUILD_KEY_CARBON
# endif
#endif
@ -1197,10 +1194,6 @@ Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max
class QDataStream;
#ifndef QT_BUILD_KEY
#define QT_BUILD_KEY "unspecified"
#endif
#if defined(Q_WS_MAC)
# ifndef QMAC_QMENUBAR_NO_EVENT
# define QMAC_QMENUBAR_NO_EVENT

View File

@ -202,21 +202,6 @@ QLibraryInfo::licensedProducts()
return QString::fromLatin1(str);
}
/*!
Returns a unique key identifying this build of Qt and its
configurations. This key is not globally unique, rather only useful
for establishing of two configurations are compatible. This can be
used to compare with the \c QT_BUILD_KEY preprocessor symbol.
\sa location()
*/
QString
QLibraryInfo::buildKey()
{
return QString::fromLatin1(QT_BUILD_KEY);
}
/*!
\since 4.6
Returns the installation date for this build of Qt. The install date will
@ -514,18 +499,6 @@ void qt_core_boilerplate()
"Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).\n"
"Contact: Nokia Corporation (qt-info@nokia.com)\n"
"\n"
"Build key: " QT_BUILD_KEY "\n"
"Compat build key: "
#ifdef QT_BUILD_KEY_COMPAT
"| " QT_BUILD_KEY_COMPAT " "
#endif
#ifdef QT_BUILD_KEY_COMPAT2
"| " QT_BUILD_KEY_COMPAT2 " "
#endif
#ifdef QT_BUILD_KEY_COMPAT3
"| " QT_BUILD_KEY_COMPAT3 " "
#endif
"|\n"
"Build date: %s\n"
"Installation prefix: %s\n"
"Library path: %s\n"

View File

@ -59,7 +59,6 @@ public:
static QString licensee();
static QString licensedProducts();
static QString buildKey();
#ifndef QT_NO_DATESTRING
static QDate buildDate();
#endif //QT_NO_DATESTRING

View File

@ -250,7 +250,7 @@ static int qt_tokenize(const char *s, ulong s_len, ulong *advance,
/*
returns true if the string s was correctly parsed, false otherwise.
*/
static bool qt_parse_pattern(const char *s, uint *version, bool *debug, QByteArray *key)
static bool qt_parse_pattern(const char *s, uint *version, bool *debug)
{
bool ret = true;
@ -282,10 +282,6 @@ static bool qt_parse_pattern(const char *s, uint *version, bool *debug, QByteArr
}
} else if (qstrncmp("debug", pinfo.results[0], pinfo.lengths[0]) == 0) {
*debug = qstrncmp("true", pinfo.results[1], pinfo.lengths[1]) == 0;
} else if (qstrncmp("buildkey", pinfo.results[0],
pinfo.lengths[0]) == 0){
// save buildkey
*key = QByteArray(pinfo.results[1], pinfo.lengths[1]);
}
} while (parse == 1 && parselen > 0);
@ -337,11 +333,11 @@ static long qt_find_pattern(const char *s, ulong s_len,
we can get the verification data without have to actually load the library.
This lets us detect mismatches more safely.
Returns false if version/key information is not present, or if the
Returns false if version information is not present, or if the
information could not be read.
Returns true if version/key information is present and successfully read.
Returns true if version information is present and successfully read.
*/
static bool qt_unix_query(const QString &library, uint *version, bool *debug, QByteArray *key, QLibraryPrivate *lib = 0)
static bool qt_unix_query(const QString &library, uint *version, bool *debug, QLibraryPrivate *lib = 0)
{
QFile file(library);
if (!file.open(QIODevice::ReadOnly)) {
@ -396,7 +392,7 @@ static bool qt_unix_query(const QString &library, uint *version, bool *debug, QB
#endif // defined(Q_OF_ELF) && defined(Q_CC_GNU)
bool ret = false;
if (pos >= 0)
ret = qt_parse_pattern(filedata + pos, version, debug, key);
ret = qt_parse_pattern(filedata + pos, version, debug);
if (!ret && lib)
lib->errorString = QLibrary::tr("Plugin verification data mismatch in '%1'").arg(library);
@ -636,7 +632,7 @@ typedef const char * __stdcall (*QtPluginQueryVerificationDataFunction)();
typedef const char * (*QtPluginQueryVerificationDataFunction)();
#endif
bool qt_get_verificationdata(QtPluginQueryVerificationDataFunction pfn, uint *qt_version, bool *debug, QByteArray *key, bool *exceptionThrown)
bool qt_get_verificationdata(QtPluginQueryVerificationDataFunction pfn, uint *qt_version, bool *debug, bool *exceptionThrown)
{
*exceptionThrown = false;
const char *szData = 0;
@ -649,7 +645,7 @@ bool qt_get_verificationdata(QtPluginQueryVerificationDataFunction pfn, uint *qt
#else
szData = pfn();
#endif
return qt_parse_pattern(szData, qt_version, debug, key);
return qt_parse_pattern(szData, qt_version, debug);
}
bool QLibraryPrivate::isPlugin(QSettings *settings)
@ -660,7 +656,6 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
#ifndef QT_NO_PLUGIN_CHECK
bool debug = !QLIBRARY_AS_DEBUG;
QByteArray key;
bool success = false;
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
@ -710,16 +705,15 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
}
reg = settings->value(regkey).toStringList();
#endif
if (reg.count() == 4 && lastModified == reg.at(3)) {
if (reg.count() == 3 && lastModified == reg.at(2)) {
qt_version = reg.at(0).toUInt(0, 16);
debug = bool(reg.at(1).toInt());
key = reg.at(2).toLatin1();
success = qt_version != 0;
} else {
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN)
if (!pHnd) {
// use unix shortcut to avoid loading the library
success = qt_unix_query(fileName, &qt_version, &debug, &key, this);
success = qt_unix_query(fileName, &qt_version, &debug, this);
} else
#endif
{
@ -767,11 +761,10 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
#endif
bool exceptionThrown = false;
bool ret = qt_get_verificationdata(qtPluginQueryVerificationDataFunction,
&qt_version, &debug, &key, &exceptionThrown);
&qt_version, &debug, &exceptionThrown);
if (!exceptionThrown) {
if (!ret) {
qt_version = 0;
key = "unknown";
if (temporary_load)
unload_sys();
} else {
@ -801,14 +794,10 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
// exception is thrown(will happen only when using a MS compiler)
}
// Qt 4.5 compatibility: stl doesn't affect binary compatibility
key.replace(" no-stl", "");
#ifndef QT_NO_SETTINGS
QStringList queried;
queried << QString::number(qt_version,16)
<< QString::number((int)debug)
<< QLatin1String(key)
<< lastModified;
settings->setValue(regkey, queried);
#endif
@ -840,31 +829,6 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
.arg((qt_version&0xff00) >> 8)
.arg(qt_version&0xff)
.arg(debug ? QLatin1String("debug") : QLatin1String("release"));
} else if (key != QT_BUILD_KEY
// we may have some compatibility keys, try them too:
#ifdef QT_BUILD_KEY_COMPAT
&& key != QT_BUILD_KEY_COMPAT
#endif
#ifdef QT_BUILD_KEY_COMPAT2
&& key != QT_BUILD_KEY_COMPAT2
#endif
#ifdef QT_BUILD_KEY_COMPAT3
&& key != QT_BUILD_KEY_COMPAT3
#endif
) {
if (qt_debug_component()) {
qWarning("In %s:\n"
" Plugin uses incompatible Qt library\n"
" expected build key \"%s\", got \"%s\"",
(const char*) QFile::encodeName(fileName),
QT_BUILD_KEY,
key.isEmpty() ? "<null>" : (const char *) key);
}
errorString = QLibrary::tr("The plugin '%1' uses incompatible Qt library."
" Expected build key \"%2\", got \"%3\"")
.arg(fileName)
.arg(QLatin1String(QT_BUILD_KEY))
.arg(key.isEmpty() ? QLatin1String("<null>") : QLatin1String((const char *) key));
#ifndef QT_NO_DEBUG_PLUGIN_CHECK
} else if(debug != QLIBRARY_AS_DEBUG) {
//don't issue a qWarning since we will hopefully find a non-debug? --Sam

View File

@ -117,8 +117,7 @@ void Q_CORE_EXPORT qRegisterStaticPluginInstanceFunction(QtPluginInstanceFunctio
static const char qt_plugin_verification_data[] = \
"pattern=""QT_PLUGIN_VERIFICATION_DATA""\n" \
"version="QT_VERSION_STR"\n" \
"debug="QPLUGIN_DEBUG_STR"\n" \
"buildkey="QT_BUILD_KEY;
"debug="QPLUGIN_DEBUG_STR;
# if defined (Q_OF_ELF) && defined (Q_CC_GNU)
# define Q_PLUGIN_VERIFICATION_SECTION \

View File

@ -56,7 +56,6 @@ const QString PI_HostAddress(QLS("HostAddress"));
const QString PI_OSName(QLS("OSName"));
const QString PI_OSVersion(QLS("OSVersion"));
const QString PI_QtVersion(QLS("QtVersion"));
const QString PI_BuildKey(QLS("BuildKey"));
const QString PI_GitCommit(QLS("GitCommit"));
const QString PI_QMakeSpec(QLS("QMakeSpec"));
const QString PI_PulseGitBranch(QLS("PulseGitBranch"));
@ -93,7 +92,6 @@ PlatformInfo PlatformInfo::localHostInfo()
pi.insert(PI_HostName, QHostInfo::localHostName());
pi.insert(PI_QtVersion, QLS(qVersion()));
pi.insert(PI_QMakeSpec, QString(QLS(QMAKESPEC)).remove(QRegExp(QLS("^.*mkspecs/"))));
pi.insert(PI_BuildKey, QLibraryInfo::buildKey());
#if defined(Q_OS_LINUX)
pi.insert(PI_OSName, QLS("Linux"));
QProcess uname;

View File

@ -61,7 +61,6 @@ extern const QString PI_HostAddress;
extern const QString PI_OSName;
extern const QString PI_OSVersion;
extern const QString PI_QtVersion;
extern const QString PI_BuildKey;
extern const QString PI_GitCommit;
extern const QString PI_QMakeSpec;
extern const QString PI_PulseGitBranch;

View File

@ -495,13 +495,6 @@ void Configure::parseCmdLine()
dictionary[ "QCONFIG" ] = configCmdLine.at(i);
}
else if (configCmdLine.at(i) == "-buildkey") {
++i;
if (i == argCount)
break;
dictionary[ "USER_BUILD_KEY" ] = configCmdLine.at(i);
}
else if (configCmdLine.at(i) == "-release") {
dictionary[ "BUILD" ] = "release";
if (dictionary[ "BUILDALL" ] == "auto")
@ -1661,11 +1654,11 @@ QString Configure::locateFile(const QString &fileName)
bool Configure::displayHelp()
{
if (dictionary[ "HELP" ] == "yes") {
desc("Usage: configure [-buildkey <key>]\n"
desc("Usage: configure\n"
// desc("Usage: configure [-prefix dir] [-bindir <dir>] [-libdir <dir>]\n"
// "[-docdir <dir>] [-headerdir <dir>] [-plugindir <dir>]\n"
// "[-importdir <dir>] [-datadir <dir>] [-translationdir <dir>]\n"
// "[-examplesdir <dir>] [-buildkey <key>]\n"
// "[-examplesdir <dir>]\n"
"[-release] [-debug] [-debug-and-release] [-shared] [-static]\n"
"[-no-fast] [-fast] [-no-exceptions] [-exceptions]\n"
"[-no-accessibility] [-accessibility] [-no-rtti] [-rtti]\n"
@ -1711,10 +1704,6 @@ bool Configure::displayHelp()
desc( "-translationdir <dir>","Translations of Qt programs will be installed to dir\n(default PREFIX/translations)\n");
desc( "-examplesdir <dir>", "Examples will be installed to dir\n(default PREFIX/examples)");
*/
desc(" You may use these options to turn on strict plugin loading:\n\n", 0, 1);
desc( "-buildkey <key>", "Build the Qt library and plugins using the specified <key>. "
"When the library loads plugins, it will only load those that have a matching <key>.\n");
desc("Configure options:\n\n");
@ -2470,53 +2459,11 @@ void Configure::generateBuildKey()
// Sorted defines that start with QT_NO_
QStringList build_defines = qmakeDefines.filter(QRegExp("^QT_NO_"));
build_defines.sort();
// Build up the QT_BUILD_KEY ifdef
QString buildKey = "QT_BUILD_KEY \"";
if (!dictionary["USER_BUILD_KEY"].isEmpty())
buildKey += dictionary["USER_BUILD_KEY"] + " ";
QString build32Key = buildKey + "Windows " + compiler + " %1 " + build_options.join(" ") + " " + build_defines.join(" ");
QString build64Key = buildKey + "Windows x64 " + compiler + " %1 " + build_options.join(" ") + " " + build_defines.join(" ");
QString buildSymbianKey = buildKey + "Symbian " + build_options.join(" ") + " " + build_defines.join(" ");
build32Key = build32Key.simplified();
build64Key = build64Key.simplified();
buildSymbianKey = buildSymbianKey.simplified();
build32Key.prepend("# define ");
build64Key.prepend("# define ");
buildSymbianKey.prepend("# define ");
QString buildkey = "#if defined(__SYMBIAN32__)\n"
+ buildSymbianKey + "\"\n"
"#else\n"
// Debug builds
"# if !defined(QT_NO_DEBUG)\n"
"# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n"
+ build64Key.arg("debug") + "\"\n"
"# else\n"
+ build32Key.arg("debug") + "\"\n"
"# endif\n"
"# else\n"
// Release builds
"# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n"
+ build64Key.arg("release") + "\"\n"
"# else\n"
+ build32Key.arg("release") + "\"\n"
"# endif\n"
"# endif\n"
"#endif\n";
dictionary["BUILD_KEY"] = buildkey;
}
void Configure::generateOutputVars()
{
// Generate variables for output
// Build key ----------------------------------------------------
if (dictionary.contains("BUILD_KEY")) {
qmakeVars += dictionary.value("BUILD_KEY");
}
QString build = dictionary[ "BUILD" ];
bool buildAll = (dictionary[ "BUILDALL" ] == "yes");
if (build == "debug") {
@ -3141,8 +3088,6 @@ void Configure::generateConfigfiles()
tmpStream << "# define QT_EDITION " << dictionary["QT_EDITION"] << endl;
tmpStream << "#endif" << endl;
tmpStream << endl;
tmpStream << dictionary["BUILD_KEY"];
tmpStream << endl;
if (dictionary["BUILDDEV"] == "yes") {
dictionary["QMAKE_INTERNAL"] = "yes";
tmpStream << "/* Used for example to export symbols for the certain autotests*/" << endl;