summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2009-08-06 11:37:15 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2009-08-06 11:37:15 (GMT)
commitf577abca43ec341ac4b96d5a9fb6fcfdc7411965 (patch)
tree0df451f4de071f2e055cd3850a1513ef9ecab2e0 /qmake
parent31f4e677256487e7d167517ffd5dd4bef6bb4dd4 (diff)
parent1b7d4d29d970405d5559c5641260ea1f09375b27 (diff)
downloadQt-f577abca43ec341ac4b96d5a9fb6fcfdc7411965.zip
Qt-f577abca43ec341ac4b96d5a9fb6fcfdc7411965.tar.gz
Qt-f577abca43ec341ac4b96d5a9fb6fcfdc7411965.tar.bz2
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
Diffstat (limited to 'qmake')
-rw-r--r--qmake/Makefile.unix9
-rw-r--r--qmake/Makefile.win3211
-rw-r--r--qmake/Makefile.win32-g++9
-rw-r--r--qmake/Makefile.win32-g++-sh9
-rw-r--r--qmake/generators/makefile.cpp70
-rw-r--r--qmake/generators/makefiledeps.cpp14
-rw-r--r--qmake/generators/metamakefile.cpp4
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp20
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp46
-rw-r--r--qmake/option.cpp15
-rw-r--r--qmake/option.h2
-rw-r--r--qmake/project.cpp14
-rw-r--r--qmake/qmake.pri4
-rw-r--r--qmake/qmake.pro1
14 files changed, 107 insertions, 121 deletions
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index c7f4dc4..6ba5b6b 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -13,7 +13,7 @@ OBJS=project.o property.o main.o makefile.o unixmake2.o unixmake.o \
symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o
#qt code
-QOBJS=qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o \
+QOBJS=qtextcodec.o qutfcodec.o qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o \
qbytearray.o qbytearraymatcher.o qdatastream.o qbuffer.o qlistdata.o qfile.o \
qfsfileengine_unix.o qfsfileengine_iterator_unix.o qfsfileengine.o \
qfsfileengine_iterator.o qregexp.o qvector.o qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o \
@@ -47,6 +47,7 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge
generators/win32/msvc_objectmodel.cpp generators/win32/msvc_nmake.cpp generators/win32/borland_bmake.cpp \
generators/symbian/symmake.cpp generators/symbian/initprojectdeploy_symbian.cpp \
generators/symbian/symmake_abld.cpp generators/symbian/symmake_sbsv2.cpp \
+ $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp \
$(SOURCE_PATH)/src/corelib/tools/qstring.cpp $(SOURCE_PATH)/src/corelib/io/qfile.cpp \
$(SOURCE_PATH)/src/corelib/io/qtextstream.cpp $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp \
$(SOURCE_PATH)/src/corelib/global/qmalloc.cpp \
@@ -165,6 +166,12 @@ qcore_mac.o: $(SOURCE_PATH)/src/corelib/kernel/qcore_mac.cpp
qurl.o: $(SOURCE_PATH)/src/corelib/io/qurl.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qurl.cpp
+qutfcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp
+
+qtextcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp
+
qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 3f4f8d4..929f950 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -110,6 +110,8 @@ QTOBJS= \
qmalloc.obj \
qmap.obj \
qregexp.obj \
+ qtextcodec.obj \
+ qutfcodec.obj \
qstring.obj \
qstringlist.obj \
qtextstream.obj \
@@ -198,6 +200,8 @@ clean::
-del qmalloc.obj
-del qmap.obj
-del qregexp.obj
+ -del qtextcodec.obj
+ -del qutfcodec.obj
-del qstring.obj
-del qstringlist.obj
-del qtextstream.obj
@@ -347,6 +351,9 @@ qbytearraymatcher.obj: $(SOURCE_PATH)\src\corelib\tools\qbytearraymatcher.cpp
qchar.obj: $(SOURCE_PATH)\src\corelib\tools\qchar.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qchar.cpp
+qutfcodec.obj: $(SOURCE_PATH)\src\corelib\codecs\qutfcodec.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\codecs\qutfcodec.cpp
+
qstring.obj: $(SOURCE_PATH)\src\corelib\tools\qstring.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qstring.cpp
@@ -389,8 +396,8 @@ qfsfileengine_iterator.obj: $(SOURCE_PATH)\src\corelib\io\qfsfileengine_iterator
qabstractfileengine.obj: $(SOURCE_PATH)\src\corelib\io\qabstractfileengine.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qabstractfileengine.cpp
-qtextcodec.obj: $(SOURCE_PATH)\src\codecs\qtextcodec.cpp
- $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\codecs\qtextcodec.cpp
+qtextcodec.obj: $(SOURCE_PATH)\src\corelib\codecs\qtextcodec.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\codecs\qtextcodec.cpp
qregexp.obj: $(SOURCE_PATH)\src\corelib\tools\qregexp.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qregexp.cpp
diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++
index 03ca6dd..c18201e 100644
--- a/qmake/Makefile.win32-g++
+++ b/qmake/Makefile.win32-g++
@@ -75,6 +75,8 @@ QTOBJS= \
qmalloc.o \
qmap.o \
qregexp.o \
+ qtextcodec.o \
+ qutfcodec.o \
qstring.o \
qstringlist.o \
qtextstream.o \
@@ -198,6 +200,9 @@ qvsnprintf.o: $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp
qbytearraymatcher.o: $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp
+qutfcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp
+
qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
@@ -237,8 +242,8 @@ qfsfileengine.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine.cpp
qfsfileengine_iterator.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp
-qtextcodec.o: $(SOURCE_PATH)/src/codecs/qtextcodec.cpp
- $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/codecs/qtextcodec.cpp
+qtextcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp
qregexp.o: $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp
diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh
index bd1b8b5..e02a021 100644
--- a/qmake/Makefile.win32-g++-sh
+++ b/qmake/Makefile.win32-g++-sh
@@ -75,6 +75,8 @@ QTOBJS= \
qmalloc.o \
qmap.o \
qregexp.o \
+ qtextcodec.o \
+ qutfcodec.o \
qstring.o \
qstringlist.o \
qtextstream.o \
@@ -197,6 +199,9 @@ qvsnprintf.o: $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp
qbytearraymatcher.o: $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp
+qutfcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp
+
qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
@@ -236,8 +241,8 @@ qfsfileengine.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine.cpp
qfsfileengine_iterator.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp
-qtextcodec.o: $(SOURCE_PATH)/src/codecs/qtextcodec.cpp
- $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/codecs/qtextcodec.cpp
+qtextcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp
qregexp.o: $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 345f999..0db24ae 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -121,7 +121,7 @@ bool MakefileGenerator::mkdir(const QString &in_path) const
QDir d;
if(path.startsWith(QDir::separator())) {
d.cd(QString(QDir::separator()));
- path = path.right(path.length() - 1);
+ path.remove(0, 1);
}
bool ret = true;
#ifdef Q_OS_WIN
@@ -129,7 +129,7 @@ bool MakefileGenerator::mkdir(const QString &in_path) const
if(!QDir::isRelativePath(path)) {
if(QFile::exists(path.left(3))) {
d.cd(path.left(3));
- path = path.right(path.length() - 3);
+ path.remove(0, 3);
} else {
warn_msg(WarnLogic, "Cannot access drive '%s' (%s)",
path.left(3).toLatin1().data(), path.toLatin1().data());
@@ -201,13 +201,13 @@ MakefileGenerator::initOutPaths()
if(Option::mkfile::do_cache && !Option::mkfile::cachefile.isEmpty() &&
v.contains("QMAKE_ABSOLUTE_SOURCE_ROOT")) {
QString root = v["QMAKE_ABSOLUTE_SOURCE_ROOT"].first();
- root = Option::fixPathToTargetOS(root);
+ root = QDir::fromNativeSeparators(root);
if(!root.isEmpty()) {
QFileInfo fi = fileInfo(Option::mkfile::cachefile);
if(!fi.makeAbsolute()) {
QString cache_r = fi.path(), pwd = Option::output_dir;
if(pwd.startsWith(cache_r) && !pwd.startsWith(root)) {
- pwd = Option::fixPathToTargetOS(root + pwd.mid(cache_r.length()));
+ pwd = root + pwd.mid(cache_r.length());
if(exists(pwd))
v.insert("QMAKE_ABSOLUTE_SOURCE_PATH", QStringList(pwd));
}
@@ -217,7 +217,7 @@ MakefileGenerator::initOutPaths()
}
if(!v["QMAKE_ABSOLUTE_SOURCE_PATH"].isEmpty()) {
QString &asp = v["QMAKE_ABSOLUTE_SOURCE_PATH"].first();
- asp = Option::fixPathToTargetOS(asp);
+ asp = QDir::fromNativeSeparators(asp);
if(asp.isEmpty() || asp == Option::output_dir) //if they're the same, why bother?
v["QMAKE_ABSOLUTE_SOURCE_PATH"].clear();
}
@@ -243,7 +243,7 @@ MakefileGenerator::initOutPaths()
if(!(dirs[x] == "DLLDESTDIR"))
#endif
{
- if(pathRef.right(Option::dir_sep.length()) != Option::dir_sep)
+ if(!pathRef.endsWith(Option::dir_sep))
pathRef += Option::dir_sep;
}
@@ -346,7 +346,7 @@ MakefileGenerator::findFilesInVPATH(QStringList l, uchar flags, const QString &v
QString real_dir = Option::fixPathToLocalOS((*vpath_it));
if(exists(real_dir + QDir::separator() + val)) {
QString dir = (*vpath_it);
- if(dir.right(Option::dir_sep.length()) != Option::dir_sep)
+ if(!dir.endsWith(Option::dir_sep))
dir += Option::dir_sep;
val = dir + val;
if(!(flags & VPATH_NoFixify))
@@ -365,7 +365,7 @@ MakefileGenerator::findFilesInVPATH(QStringList l, uchar flags, const QString &v
real_dir = dir;
if(!(flags & VPATH_NoFixify))
real_dir = fileFixify(real_dir, qmake_getpwd(), Option::output_dir);
- regex = regex.right(regex.length() - dir.length());
+ regex.remove(0, dir.length());
}
if(real_dir.isEmpty() || exists(real_dir)) {
QStringList files = QDir(real_dir).entryList(QStringList(regex));
@@ -725,14 +725,14 @@ MakefileGenerator::init()
if(project->isActiveConfig("qmake_cache")) {
QString cache_file;
if(!project->isEmpty("QMAKE_INTERNAL_CACHE_FILE")) {
- cache_file = Option::fixPathToLocalOS(project->first("QMAKE_INTERNAL_CACHE_FILE"));
+ cache_file = QDir::fromNativeSeparators(project->first("QMAKE_INTERNAL_CACHE_FILE"));
} else {
cache_file = ".qmake.internal.cache";
if(project->isActiveConfig("build_pass"))
cache_file += ".BUILD." + project->first("BUILD_PASS");
}
- if(cache_file.indexOf(QDir::separator()) == -1)
- cache_file.prepend(Option::output_dir + QDir::separator());
+ if(cache_file.indexOf('/') == -1)
+ cache_file.prepend(Option::output_dir + '/');
QMakeSourceFileInfo::setCacheFile(cache_file);
}
@@ -789,7 +789,7 @@ MakefileGenerator::init()
QString dir, regex = Option::fixPathToLocalOS((*dep_it));
if(regex.lastIndexOf(Option::dir_sep) != -1) {
dir = regex.left(regex.lastIndexOf(Option::dir_sep) + 1);
- regex = regex.right(regex.length() - dir.length());
+ regex.remove(0, dir.length());
}
QStringList files = QDir(dir).entryList(QStringList(regex));
if(files.isEmpty()) {
@@ -939,7 +939,7 @@ MakefileGenerator::writePrlFile(QTextStream &t)
QString target = project->first("TARGET");
int slsh = target.lastIndexOf(Option::dir_sep);
if(slsh != -1)
- target = target.right(target.length() - slsh - 1);
+ target.remove(0, slsh + 1);
QString bdir = Option::output_dir;
if(bdir.isEmpty())
bdir = qmake_getpwd();
@@ -1057,11 +1057,11 @@ MakefileGenerator::prlFileName(bool fixify)
ret = project->first("TARGET");
int slsh = ret.lastIndexOf(Option::dir_sep);
if(slsh != -1)
- ret = ret.right(ret.length() - slsh);
+ ret.remove(0, slsh);
if(!ret.endsWith(Option::prl_ext)) {
int dot = ret.indexOf('.');
if(dot != -1)
- ret = ret.left(dot);
+ ret.truncate(dot);
ret += Option::prl_ext;
}
if(!project->isEmpty("QMAKE_BUNDLE"))
@@ -1211,7 +1211,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
if(project->values((*it) + ".CONFIG").indexOf("no_path") == -1 &&
project->values((*it) + ".CONFIG").indexOf("dummy_install") == -1) {
dst = fileFixify(unescapeFilePath(project->values(pvar).first()), FileFixifyAbsolute, false);
- if(dst.right(1) != Option::dir_sep)
+ if(!dst.endsWith(Option::dir_sep))
dst += Option::dir_sep;
}
dst = escapeFilePath(dst);
@@ -1240,9 +1240,9 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
int slsh = filestr.lastIndexOf(Option::dir_sep);
if(slsh != -1) {
dirstr = filestr.left(slsh+1);
- filestr = filestr.right(filestr.length() - slsh - 1);
+ filestr.remove(0, slsh+1);
}
- if(dirstr.right(Option::dir_sep.length()) != Option::dir_sep)
+ if(!dirstr.endsWith(Option::dir_sep))
dirstr += Option::dir_sep;
if(exists(wild)) { //real file
QString file = wild;
@@ -1342,7 +1342,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
const QStringList &dirs = project->values(pvar);
for(QStringList::ConstIterator pit = dirs.begin(); pit != dirs.end(); ++pit) {
QString tmp_dst = fileFixify((*pit), FileFixifyAbsolute, false);
- if (!isWindowsShell() && tmp_dst.right(1) != Option::dir_sep)
+ if (!isWindowsShell() && !tmp_dst.endsWith(Option::dir_sep))
tmp_dst += Option::dir_sep;
t << mkdir_p_asstring(filePrefixRoot(root, tmp_dst)) << "\n\t";
}
@@ -2174,8 +2174,6 @@ QString MakefileGenerator::buildArgs(const QString &outdir)
ret += " -unix";
else if(Option::target_mode == Option::TARG_WIN_MODE)
ret += " -win32";
- else if(Option::target_mode == Option::TARG_QNX6_MODE)
- ret += " -qnx6";
//configs
for(QStringList::Iterator it = Option::user_configs.begin();
@@ -2277,8 +2275,8 @@ MakefileGenerator::findSubDirsSubTargets() const
st->profile = file.section(Option::dir_sep, -1) + Option::pro_ext;
st->in_directory = file;
}
- while(st->in_directory.right(1) == Option::dir_sep)
- st->in_directory = st->in_directory.left(st->in_directory.length() - 1);
+ while(st->in_directory.endsWith(Option::dir_sep))
+ st->in_directory.chop(1);
if(fileInfo(st->in_directory).isRelative())
st->out_directory = st->in_directory;
else
@@ -2358,7 +2356,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
if (!(flags & SubTargetSkipDefaultVariables)) {
QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
if(ofile.lastIndexOf(Option::dir_sep) != -1)
- ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1);
+ ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1);
t << "MAKEFILE = " << ofile << endl;
/* Calling Option::fixPathToTargetOS() is necessary for MinGW/MSYS, which requires
* back-slashes to be turned into slashes. */
@@ -2802,11 +2800,13 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q
return cacheVal;
//do the fixin'
- const QString pwd = qmake_getpwd() + "/";
+ QString pwd = qmake_getpwd();
+ if (!pwd.endsWith('/'))
+ pwd += '/';
QString orig_file = ret;
if(ret.startsWith(QLatin1Char('~'))) {
if(ret.startsWith(QLatin1String("~/")))
- ret = QDir::homePath() + Option::dir_sep + ret.mid(1);
+ ret = QDir::homePath() + ret.mid(1);
else
warn_msg(WarnLogic, "Unable to expand ~ in %s", ret.toLatin1().constData());
}
@@ -2895,13 +2895,13 @@ MakefileGenerator::checkMultipleDefinition(const QString &f, const QString &w)
QString file = f;
int slsh = f.lastIndexOf(Option::dir_sep);
if(slsh != -1)
- file = file.right(file.length() - slsh - 1);
+ file.remove(0, slsh + 1);
QStringList &l = project->values(w);
for(QStringList::Iterator val_it = l.begin(); val_it != l.end(); ++val_it) {
QString file2((*val_it));
slsh = file2.lastIndexOf(Option::dir_sep);
if(slsh != -1)
- file2 = file2.right(file2.length() - slsh - 1);
+ file2.remove(0, slsh + 1);
if(file2 == file) {
warn_msg(WarnLogic, "Found potential symbol conflict of %s (%s) in %s",
file.toLatin1().constData(), (*val_it).toLatin1().constData(), w.toLatin1().constData());
@@ -3055,7 +3055,7 @@ MakefileGenerator::openOutput(QFile &file, const QString &build) const
file.setFileName(Option::output_dir + "/" + file.fileName()); //pwd when qmake was run
QFileInfo fi(fileInfo(file.fileName()));
if(fi.isDir())
- outdir = file.fileName() + QDir::separator();
+ outdir = file.fileName() + '/';
}
if(!outdir.isEmpty() || file.fileName().isEmpty()) {
QString fname = "Makefile";
@@ -3075,7 +3075,7 @@ MakefileGenerator::openOutput(QFile &file, const QString &build) const
file.setFileName(file.fileName() + "." + build);
if(project->isEmpty("QMAKE_MAKEFILE"))
project->values("QMAKE_MAKEFILE").append(file.fileName());
- int slsh = file.fileName().lastIndexOf(Option::dir_sep);
+ int slsh = file.fileName().lastIndexOf('/');
if(slsh != -1)
mkdir(file.fileName().left(slsh));
if(file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {
@@ -3085,9 +3085,13 @@ MakefileGenerator::openOutput(QFile &file, const QString &build) const
od = fileInfo(fi.readLink()).absolutePath();
else
od = fi.path();
- od = Option::fixPathToTargetOS(od);
- if(QDir::isRelativePath(od))
- od.prepend(Option::output_dir);
+ od = QDir::fromNativeSeparators(od);
+ if(QDir::isRelativePath(od)) {
+ QString dir = Option::output_dir;
+ if (!dir.endsWith('/') && !od.isEmpty())
+ dir += '/';
+ od.prepend(dir);
+ }
Option::output_dir = od;
return true;
}
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp
index 34a5322..d907394 100644
--- a/qmake/generators/makefiledeps.cpp
+++ b/qmake/generators/makefiledeps.cpp
@@ -378,17 +378,19 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
files_changed = true;
file->dep_checked = true;
+ const QMakeLocalFileName sourceFile = fixPathForFile(file->file, true);
+
struct stat fst;
char *buffer = 0;
int buffer_len = 0;
{
int fd;
#if defined(_MSC_VER) && _MSC_VER >= 1400
- if (_sopen_s(&fd, fixPathForFile(file->file, true).local().toLatin1().constData(),
+ if (_sopen_s(&fd, sourceFile.local().toLatin1().constData(),
_O_RDONLY, _SH_DENYNO, _S_IREAD) != 0)
fd = -1;
#else
- fd = open(fixPathForFile(file->file, true).local().toLatin1().constData(), O_RDONLY);
+ fd = open(sourceFile.local().toLatin1().constData(), O_RDONLY);
#endif
if(fd == -1 || fstat(fd, &fst) || S_ISDIR(fst.st_mode))
return false;
@@ -623,12 +625,8 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
QMakeLocalFileName lfn(inc);
if(QDir::isRelativePath(lfn.real())) {
if(try_local) {
- QString dir = findFileInfo(file->file).path();
- if(QDir::isRelativePath(dir))
- dir.prepend(qmake_getpwd() + "/");
- if(!dir.endsWith("/"))
- dir += "/";
- QMakeLocalFileName f(dir + lfn.local());
+ QDir sourceDir = findFileInfo(sourceFile).dir();
+ QMakeLocalFileName f(sourceDir.absoluteFilePath(lfn.local()));
if(findFileInfo(f).exists()) {
lfn = fixPathForFile(f);
exists = true;
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index e22710d..4a9fd8d 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -294,9 +294,9 @@ SubdirsMetaMakefileGenerator::init()
init_flag = true;
if(Option::recursive) {
- QString old_output_dir = QDir::cleanPath(Option::output_dir);
+ QString old_output_dir = Option::output_dir;
QString old_output = Option::output.fileName();
- QString oldpwd = QDir::cleanPath(qmake_getpwd());
+ QString oldpwd = qmake_getpwd();
QString thispwd = oldpwd;
if(!thispwd.endsWith('/'))
thispwd += '/';
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 9d3fa67..372d902 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -49,9 +49,9 @@ QT_BEGIN_NAMESPACE
// XML Tags ---------------------------------------------------------
const char _Configuration[] = "Configuration";
const char _Configurations[] = "Configurations";
-const char _File[] = "File";
+const char q_File[] = "File";
const char _FileConfiguration[] = "FileConfiguration";
-const char _Files[] = "Files";
+const char q_Files[] = "Files";
const char _Filter[] = "Filter";
const char _Globals[] = "Globals";
const char _Platform[] = "Platform";
@@ -2402,11 +2402,11 @@ XmlOutput &operator<<(XmlOutput &xml, VCFilter &tool)
}
for (int i = 0; i < tool.Files.count(); ++i) {
const VCFilterFile &info = tool.Files.at(i);
- xml << tag(_File)
+ xml << tag(q_File)
<< attrS(_RelativePath, Option::fixPathToLocalOS(info.file))
<< data(); // In case no custom builds, to avoid "/>" endings
tool.outputFileConfig(xml, tool.Files.at(i).file);
- xml << closetag(_File);
+ xml << closetag(q_File);
}
if (!tool.Name.isEmpty())
xml << closetag(_Filter);
@@ -2442,7 +2442,7 @@ XmlOutput &operator<<(XmlOutput &xml, const VCProjectSingleConfig &tool)
<< tag(_Configurations)
<< tool.Configuration;
xml << closetag(_Configurations)
- << tag(_Files);
+ << tag(q_Files);
// Add this configuration into a multi-config project, since that's where we have the flat/tree
// XML output functionality
VCProject tempProj;
@@ -2458,7 +2458,7 @@ XmlOutput &operator<<(XmlOutput &xml, const VCProjectSingleConfig &tool)
tempProj.outputFilter(xml, tempProj.ExtraCompilers.at(x));
}
tempProj.outputFilter(xml, "RootFiles");
- xml << closetag(_Files)
+ xml << closetag(q_Files)
<< tag(_Globals)
<< data(); // No "/>" end tag
return xml;
@@ -2513,7 +2513,7 @@ void VCProject::outputFileConfigs(XmlOutput &xml,
const VCFilterFile &info,
const QString &filtername)
{
- xml << tag(_File)
+ xml << tag(q_File)
<< attrS(_RelativePath, Option::fixPathToLocalOS(info.file));
for (int i = 0; i < SingleProjects.count(); ++i) {
VCFilter filter;
@@ -2541,7 +2541,7 @@ void VCProject::outputFileConfigs(XmlOutput &xml,
if (filter.Config) // only if the filter is not empty
filter.outputFileConfig(xml, info.file);
}
- xml << closetag(_File);
+ xml << closetag(q_File);
}
// outputs a given filter for all existing configurations of a project
@@ -2636,7 +2636,7 @@ XmlOutput &operator<<(XmlOutput &xml, VCProject &tool)
for (int i = 0; i < tool.SingleProjects.count(); ++i)
xml << tool.SingleProjects.at(i).Configuration;
xml << closetag(_Configurations)
- << tag(_Files);
+ << tag(q_Files);
tool.outputFilter(xml, "Sources");
tool.outputFilter(xml, "Headers");
tool.outputFilter(xml, "GeneratedFiles");
@@ -2648,7 +2648,7 @@ XmlOutput &operator<<(XmlOutput &xml, VCProject &tool)
tool.outputFilter(xml, tool.ExtraCompilers.at(x));
}
tool.outputFilter(xml, "RootFiles");
- xml << closetag(_Files)
+ xml << closetag(q_Files)
<< tag(_Globals)
<< data(); // No "/>" end tag
return xml;
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 2b60be6..538b0e7 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -120,14 +120,7 @@ static QString readRegistryKey(HKEY parentHandle, const QString &rSubkey)
QString rSubkeyPath = keyPath(rSubkey);
HKEY handle = 0;
- LONG res;
- QT_WA( {
- res = RegOpenKeyExW(parentHandle, (WCHAR*)rSubkeyPath.utf16(),
- 0, KEY_READ, &handle);
- } , {
- res = RegOpenKeyExA(parentHandle, rSubkeyPath.toLocal8Bit(),
- 0, KEY_READ, &handle);
- } );
+ LONG res = RegOpenKeyEx(parentHandle, (wchar_t*)rSubkeyPath.utf16(), 0, KEY_READ, &handle);
if (res != ERROR_SUCCESS)
return QString();
@@ -135,11 +128,7 @@ static QString readRegistryKey(HKEY parentHandle, const QString &rSubkey)
// get the size and type of the value
DWORD dataType;
DWORD dataSize;
- QT_WA( {
- res = RegQueryValueExW(handle, (WCHAR*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize);
- }, {
- res = RegQueryValueExA(handle, rSubkeyName.toLocal8Bit(), 0, &dataType, 0, &dataSize);
- } );
+ res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize);
if (res != ERROR_SUCCESS) {
RegCloseKey(handle);
return QString();
@@ -147,13 +136,8 @@ static QString readRegistryKey(HKEY parentHandle, const QString &rSubkey)
// get the value
QByteArray data(dataSize, 0);
- QT_WA( {
- res = RegQueryValueExW(handle, (WCHAR*)rSubkeyName.utf16(), 0, 0,
- reinterpret_cast<unsigned char*>(data.data()), &dataSize);
- }, {
- res = RegQueryValueExA(handle, rSubkeyName.toLocal8Bit(), 0, 0,
- reinterpret_cast<unsigned char*>(data.data()), &dataSize);
- } );
+ res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, 0,
+ reinterpret_cast<unsigned char*>(data.data()), &dataSize);
if (res != ERROR_SUCCESS) {
RegCloseKey(handle);
return QString();
@@ -163,11 +147,7 @@ static QString readRegistryKey(HKEY parentHandle, const QString &rSubkey)
switch (dataType) {
case REG_EXPAND_SZ:
case REG_SZ: {
- QT_WA( {
- result = QString::fromUtf16(((const ushort*)data.constData()));
- }, {
- result = QString::fromLatin1(data.constData());
- } );
+ result = QString::fromWCharArray(((const wchar_t *)data.constData()));
break;
}
@@ -175,12 +155,7 @@ static QString readRegistryKey(HKEY parentHandle, const QString &rSubkey)
QStringList l;
int i = 0;
for (;;) {
- QString s;
- QT_WA( {
- s = QString::fromUtf16((const ushort*)data.constData() + i);
- }, {
- s = QString::fromLatin1(data.constData() + i);
- } );
+ QString s = QString::fromWCharArray((const wchar_t *)data.constData() + i);
i += s.length() + 1;
if (s.isEmpty())
@@ -193,11 +168,7 @@ static QString readRegistryKey(HKEY parentHandle, const QString &rSubkey)
case REG_NONE:
case REG_BINARY: {
- QT_WA( {
- result = QString::fromUtf16((const ushort*)data.constData(), data.size()/2);
- }, {
- result = QString::fromLatin1(data.constData(), data.size());
- } );
+ result = QString::fromWCharArray((const wchar_t *)data.constData(), data.size() / 2);
break;
}
@@ -1268,9 +1239,8 @@ void VcprojGenerator::initDeploymentTool()
foreach(QString item, project->values("DEPLOYMENT")) {
// get item.path
QString devicePath = project->first(item + ".path");
- // if the path does not exist, skip it
if (devicePath.isEmpty())
- continue;
+ devicePath = targetPath;
// check if item.path is relative (! either /,\ or %)
if (!(devicePath.at(0) == QLatin1Char('/')
|| devicePath.at(0) == QLatin1Char('\\')
diff --git a/qmake/option.cpp b/qmake/option.cpp
index 7f3e250..6ec61ec 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -100,8 +100,6 @@ QStringList Option::shellPath;
Option::TARG_MODE Option::target_mode = Option::TARG_WIN_MODE;
#elif defined(Q_OS_MAC)
Option::TARG_MODE Option::target_mode = Option::TARG_MACX_MODE;
-#elif defined(Q_OS_QNX6)
-Option::TARG_MODE Option::target_mode = Option::TARG_QNX6_MODE;
#else
Option::TARG_MODE Option::target_mode = Option::TARG_UNIX_MODE;
#endif
@@ -718,16 +716,9 @@ QString qmake_libraryInfoFile()
{
QString ret;
#if defined( Q_OS_WIN )
- QFileInfo filePath;
- QT_WA({
- unsigned short module_name[256];
- GetModuleFileNameW(0, reinterpret_cast<wchar_t *>(module_name), sizeof(module_name));
- filePath = QString::fromUtf16(module_name);
- }, {
- char module_name[256];
- GetModuleFileNameA(0, module_name, sizeof(module_name));
- filePath = QString::fromLocal8Bit(module_name);
- });
+ wchar_t module_name[MAX_PATH];
+ GetModuleFileName(0, module_name, MAX_PATH);
+ QFileInfo filePath = QString::fromWCharArray(module_name);
ret = filePath.filePath();
#else
QString argv0 = QFile::decodeName(QByteArray(Option::application_argv0));
diff --git a/qmake/option.h b/qmake/option.h
index e028566..b548aa5 100644
--- a/qmake/option.h
+++ b/qmake/option.h
@@ -150,7 +150,7 @@ struct Option
static int warn_level;
static bool recursive;
static QStringList before_user_vars, after_user_vars, user_configs, after_user_configs;
- enum TARG_MODE { TARG_UNIX_MODE, TARG_WIN_MODE, TARG_MACX_MODE, TARG_MAC9_MODE, TARG_QNX6_MODE };
+ enum TARG_MODE { TARG_UNIX_MODE, TARG_WIN_MODE, TARG_MACX_MODE, TARG_MAC9_MODE };
static TARG_MODE target_mode;
static QString user_template, user_template_prefix;
static QStringList shellPath;
diff --git a/qmake/project.cpp b/qmake/project.cpp
index e118c6f..6bb8b2c 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -704,10 +704,6 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0)
concat << base_concat + QDir::separator() + "mac";
concat << base_concat + QDir::separator() + "mac9";
break;
- case Option::TARG_QNX6_MODE: //also a unix
- concat << base_concat + QDir::separator() + "qnx6";
- concat << base_concat + QDir::separator() + "unix";
- break;
}
concat << base_concat;
}
@@ -1706,13 +1702,11 @@ QMakeProject::isActiveConfig(const QString &x, bool regex, QMap<QString, QString
return true;
//mkspecs
- if((Option::target_mode == Option::TARG_MACX_MODE || Option::target_mode == Option::TARG_QNX6_MODE ||
+ if((Option::target_mode == Option::TARG_MACX_MODE ||
Option::target_mode == Option::TARG_UNIX_MODE) && x == "unix")
return !isForSymbian();
else if(Option::target_mode == Option::TARG_MACX_MODE && x == "macx")
return !isForSymbian();
- else if(Option::target_mode == Option::TARG_QNX6_MODE && x == "qnx6")
- return !isForSymbian();
else if(Option::target_mode == Option::TARG_MAC9_MODE && x == "mac9")
return !isForSymbian();
else if((Option::target_mode == Option::TARG_MAC9_MODE || Option::target_mode == Option::TARG_MACX_MODE) &&
@@ -3260,9 +3254,9 @@ QStringList &QMakeProject::values(const QString &_var, QMap<QString, QStringList
ret = "Windows";
} else if(type == "name") {
DWORD name_length = 1024;
- TCHAR name[1024];
- if(GetComputerName(name, &name_length))
- ret = QString::fromUtf16((ushort*)name, name_length);
+ wchar_t name[1024];
+ if (GetComputerName(name, &name_length))
+ ret = QString::fromWCharArray(name);
} else if(type == "version" || type == "version_string") {
QSysInfo::WinVersion ver = QSysInfo::WindowsVersion;
if(type == "version")
diff --git a/qmake/qmake.pri b/qmake/qmake.pri
index f43d933..65bd7d4 100644
--- a/qmake/qmake.pri
+++ b/qmake/qmake.pri
@@ -68,6 +68,8 @@ bootstrap { #Qt code
qmap.cpp \
qmetatype.cpp \
qregexp.cpp \
+ qtextcodec.cpp \
+ qutfcodec.cpp \
qstring.cpp \
qstringlist.cpp \
qtemporaryfile.cpp \
@@ -107,6 +109,8 @@ bootstrap { #Qt code
qmap.h \
qmetatype.h \
qregexp.h \
+ qtextcodec.h \
+ qutfcodec.h \
qstring.h \
qstringlist.h \
qstringmatcher.h \
diff --git a/qmake/qmake.pro b/qmake/qmake.pro
index 594e698..acf7718 100644
--- a/qmake/qmake.pro
+++ b/qmake/qmake.pro
@@ -15,6 +15,7 @@ MOC_DIR = .
VPATH += $$QT_SOURCE_TREE/src/corelib/global \
$$QT_SOURCE_TREE/src/corelib/tools \
$$QT_SOURCE_TREE/src/corelib/kernel \
+ $$QT_SOURCE_TREE/src/corelib/codecs \
$$QT_SOURCE_TREE/src/corelib/plugin \
$$QT_SOURCE_TREE/src/corelib/io \
$$QT_SOURCE_TREE/src/corelib/xml \