Don't compile MD4, MD5, SHA-2 and SHA-3 into qmake
We just need one digest algorithm, any algorithm, to generate a somewhat unique identifier. SHA-1 will suffice. Change-Id: I3cb26bf866d616df3ef32feace10934f19daa1a6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
parent
a8467780fb
commit
d5ed6936be
@ -92,7 +92,8 @@ CPPFLAGS = -g $(EXTRA_CPPFLAGS) \
|
||||
-I$(SOURCE_PATH)/tools/shared \
|
||||
-DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DPROEVALUATOR_DEBUG \
|
||||
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \
|
||||
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM
|
||||
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
|
||||
-DQT_CRYPTOGRAPHICHASH_ONLY_SHA1
|
||||
|
||||
CXXFLAGS = $(EXTRA_CXXFLAGS) $(CPPFLAGS)
|
||||
|
||||
|
@ -41,7 +41,7 @@ CFLAGS_BARE = -c -Fo./ \
|
||||
-DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DPROEVALUATOR_DEBUG \
|
||||
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \
|
||||
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
|
||||
-DUNICODE
|
||||
-DUNICODE -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1
|
||||
CFLAGS = -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch $(CFLAGS_BARE) $(CFLAGS) $(EXTRA_CPPFLAGS)
|
||||
|
||||
CXXFLAGS_BARE = $(CFLAGS_BARE)
|
||||
|
@ -44,7 +44,6 @@
|
||||
#include "meta.h"
|
||||
#include <qdir.h>
|
||||
#include <qregexp.h>
|
||||
#include <qcryptographichash.h>
|
||||
#include <qdebug.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
@ -66,9 +66,9 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
using namespace QMakeInternal;
|
||||
|
||||
static QString qtMD5(const QByteArray &src)
|
||||
static QString qtSha1(const QByteArray &src)
|
||||
{
|
||||
QByteArray digest = QCryptographicHash::hash(src, QCryptographicHash::Md5);
|
||||
QByteArray digest = QCryptographicHash::hash(src, QCryptographicHash::Sha1);
|
||||
return QString::fromLatin1(digest.toHex());
|
||||
}
|
||||
|
||||
@ -1545,7 +1545,7 @@ ProjectBuilderMakefileGenerator::keyFor(const QString &block)
|
||||
#endif
|
||||
QString ret;
|
||||
if(!keys.contains(block)) {
|
||||
ret = qtMD5(block.toUtf8()).left(24).toUpper();
|
||||
ret = qtSha1(block.toUtf8()).left(24).toUpper();
|
||||
keys.insert(block, ret);
|
||||
} else {
|
||||
ret = keys[block];
|
||||
|
@ -340,7 +340,7 @@ QUuid VcprojGenerator::getProjectUUID(const QString &filename)
|
||||
// If none, create one based on the MD5 of absolute project path
|
||||
if(uuid.isNull() || !filename.isEmpty()) {
|
||||
QString abspath = Option::fixPathToLocalOS(filename.isEmpty()?project->first("QMAKE_MAKEFILE").toQString():filename);
|
||||
QByteArray digest = QCryptographicHash::hash(abspath.toUtf8(), QCryptographicHash::Md5);
|
||||
QByteArray digest = QCryptographicHash::hash(abspath.toUtf8(), QCryptographicHash::Sha1);
|
||||
memcpy((unsigned char*)(&uuid), digest.constData(), sizeof(QUuid));
|
||||
validUUID = !uuid.isNull();
|
||||
uuid.data4[0] = (uuid.data4[0] & 0x3F) | 0x80; // UV_DCE variant
|
||||
|
@ -147,7 +147,7 @@ bootstrap { #Qt code
|
||||
CFLAGS += -fhonor-std
|
||||
LFLAGS += -lcpp
|
||||
}
|
||||
DEFINES *= QT_NO_QOBJECT
|
||||
DEFINES *= QT_NO_QOBJECT QT_CRYPTOGRAPHICHASH_ONLY_SHA1
|
||||
} else {
|
||||
CONFIG += qt
|
||||
QT = core
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include "../../3rdparty/sha1/sha1.cpp"
|
||||
|
||||
#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
|
||||
// qdoc only needs SHA-1
|
||||
// qdoc and qmake only need SHA-1
|
||||
#include "../../3rdparty/md5/md5.h"
|
||||
#include "../../3rdparty/md5/md5.cpp"
|
||||
#include "../../3rdparty/md4/md4.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user