forked from qt-creator/qt-creator
committed by
Thorbjørn Lindeijer
parent
b93562ae75
commit
a497e6693e
64
src/tools/qpatch/bootstrap.pri
Normal file
64
src/tools/qpatch/bootstrap.pri
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
CONFIG += console qtinc
|
||||||
|
CONFIG -= qt
|
||||||
|
build_all:!build_pass {
|
||||||
|
CONFIG -= build_all
|
||||||
|
CONFIG += release
|
||||||
|
}
|
||||||
|
CONFIG -= app_bundle
|
||||||
|
|
||||||
|
DEFINES += \
|
||||||
|
QT_BOOTSTRAPPED \
|
||||||
|
QT_LITE_UNICODE \
|
||||||
|
QT_TEXTCODEC \
|
||||||
|
QT_NO_CAST_FROM_ASCII \
|
||||||
|
QT_NO_CAST_TO_ASCII \
|
||||||
|
QT_NO_CODECS \
|
||||||
|
QT_NO_DATASTREAM \
|
||||||
|
QT_NO_GEOM_VARIANT \
|
||||||
|
QT_NO_LIBRARY \
|
||||||
|
QT_NO_QOBJECT \
|
||||||
|
QT_NO_STL \
|
||||||
|
QT_NO_SYSTEMLOCALE \
|
||||||
|
QT_NO_TEXTSTREAM \
|
||||||
|
QT_NO_THREAD \
|
||||||
|
QT_NO_UNICODETABLES \
|
||||||
|
QT_NO_USING_NAMESPACE
|
||||||
|
win32:DEFINES += QT_NODLL
|
||||||
|
|
||||||
|
INCLUDEPATH += $$QT_BUILD_TREE/include \
|
||||||
|
$$QT_BUILD_TREE/include/QtCore \
|
||||||
|
$$QT_BUILD_TREE/include/QtXml \
|
||||||
|
$$QT_SOURCE_TREE/src/xml
|
||||||
|
DEPENDPATH += $$INCLUDEPATH \
|
||||||
|
$$QT_SOURCE_TREE/src/corelib/global \
|
||||||
|
$$QT_SOURCE_TREE/src/corelib/kernel \
|
||||||
|
$$QT_SOURCE_TREE/src/corelib/tools \
|
||||||
|
$$QT_SOURCE_TREE/src/corelib/io \
|
||||||
|
$$QT_SOURCE_TREE/src/corelib/codecs \
|
||||||
|
$$QT_SOURCE_TREE/src/xml
|
||||||
|
|
||||||
|
hpux-acc*|hpuxi-acc* {
|
||||||
|
LIBS += $$QT_BUILD_TREE/src/tools/bootstrap/libbootstrap.a
|
||||||
|
} else {
|
||||||
|
contains(CONFIG, debug_and_release_target) {
|
||||||
|
CONFIG(debug, debug|release) {
|
||||||
|
LIBS+=-L$$QT_BUILD_TREE/src/tools/bootstrap/debug
|
||||||
|
} else {
|
||||||
|
LIBS+=-L$$QT_BUILD_TREE/src/tools/bootstrap/release
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LIBS += -L$$QT_BUILD_TREE/src/tools/bootstrap
|
||||||
|
}
|
||||||
|
LIBS += -lbootstrap
|
||||||
|
}
|
||||||
|
!contains(QT_CONFIG, zlib):!contains(QT_CONFIG, no-zlib) {
|
||||||
|
unix:LIBS += -lz
|
||||||
|
# win32:LIBS += libz.lib
|
||||||
|
}
|
||||||
|
win32:LIBS += -luser32
|
||||||
|
|
||||||
|
mac {
|
||||||
|
CONFIG -= incremental
|
||||||
|
LIBS += -framework CoreServices
|
||||||
|
}
|
||||||
|
|
@@ -1,21 +1,21 @@
|
|||||||
|
|
||||||
#include <QtCore>
|
//#include <QCoreApplication>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QVector>
|
||||||
|
#include <QTextStream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QCoreApplication app(argc, argv);
|
if (argc != 4) {
|
||||||
QStringList args = app.arguments();
|
|
||||||
args.removeFirst();
|
|
||||||
|
|
||||||
if (args.size() != 3) {
|
|
||||||
std::cerr << "Usage: qpatch file.list oldQtDir newQtDir" << std::endl;
|
std::cerr << "Usage: qpatch file.list oldQtDir newQtDir" << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString files = args.takeFirst();
|
const QByteArray files = argv[1];
|
||||||
const QByteArray qtDirPath = QFile::encodeName(args.takeFirst());
|
const QByteArray qtDirPath = argv[2];
|
||||||
const QByteArray newQtPath = QFile::encodeName(args.takeFirst());
|
const QByteArray newQtPath = argv[3];
|
||||||
|
|
||||||
if (qtDirPath.size() < newQtPath.size()) {
|
if (qtDirPath.size() < newQtPath.size()) {
|
||||||
std::cerr << "qpatch: error: newQtDir needs to be less than " << qtDirPath.size() << " characters."
|
std::cerr << "qpatch: error: newQtDir needs to be less than " << qtDirPath.size() << " characters."
|
||||||
@@ -23,7 +23,7 @@ int main(int argc, char *argv[])
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
QFile fn(files);
|
QFile fn(QFile::decodeName(files));
|
||||||
if (! fn.open(QFile::ReadOnly)) {
|
if (! fn.open(QFile::ReadOnly)) {
|
||||||
std::cerr << "qpatch: error: file not found" << std::endl;
|
std::cerr << "qpatch: error: file not found" << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
@@ -55,7 +55,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (QString fileName, filesToPatch) {
|
foreach (QString fileName, filesToPatch) {
|
||||||
QString prefix = newQtPath;
|
QString prefix = QFile::decodeName(newQtPath);
|
||||||
|
|
||||||
if (! prefix.endsWith(QLatin1Char('/')))
|
if (! prefix.endsWith(QLatin1Char('/')))
|
||||||
prefix += QLatin1Char('/');
|
prefix += QLatin1Char('/');
|
||||||
@@ -126,7 +126,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (QString fileName, textFilesToPatch) {
|
foreach (QString fileName, textFilesToPatch) {
|
||||||
QString prefix = newQtPath;
|
QString prefix = QFile::decodeName(newQtPath);
|
||||||
|
|
||||||
if (! prefix.endsWith(QLatin1Char('/')))
|
if (! prefix.endsWith(QLatin1Char('/')))
|
||||||
prefix += QLatin1Char('/');
|
prefix += QLatin1Char('/');
|
||||||
|
@@ -4,3 +4,11 @@ CONFIG += console
|
|||||||
macx:CONFIG -= app_bundle
|
macx:CONFIG -= app_bundle
|
||||||
SOURCES += qpatch.cpp
|
SOURCES += qpatch.cpp
|
||||||
|
|
||||||
|
QT_BUILD_TREE=$$fromfile($$(QTDIR)/.qmake.cache,QT_BUILD_TREE)
|
||||||
|
QT_SOURCE_TREE=$$fromfile($$(QTDIR)/.qmake.cache,QT_SOURCE_TREE)
|
||||||
|
|
||||||
|
DEFINES += QT_UIC
|
||||||
|
include(bootstrap.pri)
|
||||||
|
|
||||||
|
message($$QT_BUILD_TREE)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user