summaryrefslogtreecommitdiffstats
path: root/qmake/generators
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-07-09 11:03:54 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-07-09 11:03:54 (GMT)
commit8bc84e2180e1d5819b372f4cd8c236b853145803 (patch)
tree6c5e6a8b6a1750e2484fd34f48be662fcf51959f /qmake/generators
parentd641198fa71fadd243e84dfdf02b9a0536a27b3f (diff)
parent3b1e30bb1d6651a626aba1f6b8883f5524598ed3 (diff)
downloadQt-8bc84e2180e1d5819b372f4cd8c236b853145803.zip
Qt-8bc84e2180e1d5819b372f4cd8c236b853145803.tar.gz
Qt-8bc84e2180e1d5819b372f4cd8c236b853145803.tar.bz2
Merge commit 'origin/master' into 4.6-merged
Conflicts: src/corelib/kernel/qcoreevent.cpp src/corelib/tools/qdumper.cpp src/gui/kernel/qwidget.cpp src/gui/kernel/qwidget_p.h src/gui/kernel/qwidget_s60.cpp src/gui/text/qfontdatabase.cpp src/network/access/qnetworkreplyimpl.cpp src/sql/drivers/ibase/qsql_ibase.cpp src/testlib/qtestcase.cpp src/testlib/testlib.pro tests/auto/network-settings.h tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp tests/auto/qobjectrace/tst_qobjectrace.cpp tests/auto/qsqldatabase/tst_qsqldatabase.cpp tools/configure/configureapp.cpp translations/qt_ru.ts
Diffstat (limited to 'qmake/generators')
-rw-r--r--qmake/generators/symbian/symmake.cpp80
-rw-r--r--qmake/generators/symbian/symmake.h5
-rw-r--r--qmake/generators/symbian/symmake_abld.cpp64
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp72
4 files changed, 108 insertions, 113 deletions
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index f1e9165..374d058 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -581,8 +581,15 @@ bool SymbianMakefileGenerator::initMmpVariables() {
for(int j = 0; j < incpaths.size(); ++j) {
QString includepath = canonizePath(incpaths.at(j));
appendIfnotExist(sysincspaths, includepath);
+ // As a workaround for Symbian toolchain insistence to treat include
+ // statements as relative to source file rather than the file they appear in,
+ // we generate extra temporary include directories to make
+ // relative include paths used in various headers to work properly.
+ // Note that this is not a fix-all solution; it's just a stop-gap measure
+ // to make Qt itself build until toolchain can support relative includes in
+ // a way that Qt expects.
if (!includepath.contains(epocPath)) // No temp dirs for epoc includes
- appendIfnotExist(sysincspaths, includepath + QString("/tmp"));
+ appendIfnotExist(sysincspaths, includepath + QString("/" QT_EXTRA_INCLUDE_DIR));
}
// remove duplicate include path entries
@@ -687,7 +694,9 @@ bool SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symb
}
t << endl;
- writeMmpFileLibraryPart(t);
+ if (!project->values("CONFIG").contains("static") && !project->values("CONFIG").contains("staticlib")) {
+ writeMmpFileLibraryPart(t);
+ }
writeMmpFileCapabilityPart(t);
@@ -1605,12 +1614,13 @@ QString SymbianMakefileGenerator::removeTrailingPathSeparators(QString &file)
return ret;
}
-bool SymbianMakefileGenerator::generateCleanCommands(QTextStream& t,
+void SymbianMakefileGenerator::generateCleanCommands(QTextStream& t,
const QStringList& toClean,
const QString& cmd,
const QString& cmdOptions,
const QString& itemPrefix,
- const QString& itemSuffix) {
+ const QString& itemSuffix)
+{
for (int i = 0; i < toClean.size(); ++i) {
QString item = toClean.at(i);
item.prepend(itemPrefix).append(itemSuffix);
@@ -1622,11 +1632,10 @@ bool SymbianMakefileGenerator::generateCleanCommands(QTextStream& t,
t << cmd << " " << cmdOptions << " " << QDir::toNativeSeparators(item) << "; fi" << endl;
#endif
}
-
- return true;
}
-QString SymbianMakefileGenerator::getWithoutSpecialCharacters(QString& str) {
+QString SymbianMakefileGenerator::getWithoutSpecialCharacters(QString& str)
+{
QString tmp = str;
tmp.replace(QString("/"), QString("_"));
@@ -1638,7 +1647,8 @@ QString SymbianMakefileGenerator::getWithoutSpecialCharacters(QString& str) {
return tmp;
}
-void SymbianMakefileGenerator::removeSpecialCharacters(QString& str) {
+void SymbianMakefileGenerator::removeSpecialCharacters(QString& str)
+{
str.replace(QString("/"), QString("_"));
str.replace(QString("\\"), QString("_"));
str.replace(QString("-"), QString("_"));
@@ -1646,3 +1656,57 @@ void SymbianMakefileGenerator::removeSpecialCharacters(QString& str) {
str.replace(QString("."), QString("_"));
str.replace(QString(" "), QString("_"));
}
+
+void SymbianMakefileGenerator::generateDistcleanTargets(QTextStream& t)
+{
+ t << "dodistclean:" << endl;
+ foreach(QString item, project->values("SUBDIRS")) {
+ bool fromFile = false;
+ QString fixedItem;
+ if(!project->isEmpty(item + ".file")) {
+ fixedItem = project->first(item + ".file");
+ fromFile = true;
+ } else if(!project->isEmpty(item + ".subdir")) {
+ fixedItem = project->first(item + ".subdir");
+ fromFile = false;
+ } else {
+ fromFile = item.endsWith(Option::pro_ext);
+ fixedItem = item;
+ }
+ QFileInfo fi(fileInfo(fixedItem));
+ if (!fromFile) {
+ t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fi.absoluteFilePath() + "/Makefile") << "\" dodistclean" << endl;
+ } else {
+ QString itemName = fi.fileName();
+ int extIndex = itemName.lastIndexOf(Option::pro_ext);
+ if (extIndex)
+ fixedItem = fi.absolutePath() + "/" + QString("Makefile.") + itemName.mid(0,extIndex);
+ t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fixedItem) << "\" dodistclean" << endl;
+ }
+
+ }
+
+ generatedFiles << Option::fixPathToTargetOS(fileInfo(Option::output.fileName()).absoluteFilePath()); // bld.inf
+ generatedFiles << project->values("QMAKE_INTERNAL_PRL_FILE"); // Add generated prl files for cleanup
+ generatedFiles << project->values("QMAKE_DISTCLEAN"); // Add any additional files marked for distclean
+ QStringList fixedFiles;
+ QStringList fixedDirs;
+ foreach(QString item, generatedFiles) {
+ QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath());
+ if (!fixedFiles.contains(fixedItem)) {
+ fixedFiles << fixedItem;
+ }
+ }
+ foreach(QString item, generatedDirs) {
+ QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath());
+ if (!fixedDirs.contains(fixedItem)) {
+ fixedDirs << fixedItem;
+ }
+ }
+ generateCleanCommands(t, fixedFiles, "$(DEL_FILE)", "", "", "");
+ generateCleanCommands(t, fixedDirs, "$(DEL_DIR)", "", "", "");
+ t << endl;
+
+ t << "distclean: clean dodistclean" << endl;
+ t << endl;
+} \ No newline at end of file
diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h
index 037faff..52c3c4d 100644
--- a/qmake/generators/symbian/symmake.h
+++ b/qmake/generators/symbian/symmake.h
@@ -57,6 +57,8 @@ QT_BEGIN_NAMESPACE
#define BLD_INF_FILENAME "bld.inf"
#define MAKEFILE_DEPENDENCY_SEPARATOR " \\\n\t"
+#define QT_EXTRA_INCLUDE_DIR "tmp"
+
class SymbianMakefileGenerator : public MakefileGenerator {
protected:
@@ -127,13 +129,14 @@ protected:
QString removePathSeparators(QString &file);
QString removeTrailingPathSeparators(QString &file);
- bool generateCleanCommands(QTextStream& t,
+ void generateCleanCommands(QTextStream& t,
const QStringList& toClean,
const QString& cmd,
const QString& cmdOptions,
const QString& itemPrefix,
const QString& itemSuffix);
+ void generateDistcleanTargets(QTextStream& t);
bool writeCustomDefFile();
diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp
index 8501224..ccda9f2 100644
--- a/qmake/generators/symbian/symmake_abld.cpp
+++ b/qmake/generators/symbian/symmake_abld.cpp
@@ -293,11 +293,16 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
t << CREATE_TEMPS_TARGET ":" << endl;
// generate command lines like this ...
// -@ if NOT EXIST ".\somedir" mkdir ".\somedir"
+ QStringList dirsToClean;
for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
QStringList values = it.value();
for (int i = 0; i < values.size(); ++i) {
- t << "\t-@ if NOT EXIST \"" << QDir::toNativeSeparators(values.at(i)) << "\\tmp\" mkdir \""
- << QDir::toNativeSeparators(values.at(i)) << "\\tmp\"" << endl;
+ if (values.at(i).endsWith("/" QT_EXTRA_INCLUDE_DIR)) {
+ QString fixedValue(QDir::toNativeSeparators(values.at(i)));
+ dirsToClean << fixedValue;
+ t << "\t-@ if NOT EXIST \"" << fixedValue << "\" mkdir \""
+ << fixedValue << "\"" << endl;
+ }
}
}
t << endl;
@@ -305,10 +310,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
// Note: EXTENSION_CLEAN will get called many times when doing reallyclean
// This is why the "2> NUL" gets appended to generated clean targets in makefile.cpp.
t << EXTENSION_CLEAN ": " COMPILER_CLEAN_TARGET << endl;
- for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
- QStringList dirsToClean = it.value();
- generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_DIR"), " /S /Q ", "", "/tmp");
- }
+ generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_DIR"), " /S /Q ", "", "");
t << endl;
t << PRE_TARGETDEPS_TARGET ":"
@@ -356,56 +358,8 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
writeDeploymentTargets(t);
- t << "dodistclean:" << endl;
- foreach(QString item, project->values("SUBDIRS")) {
- bool fromFile = false;
- QString fixedItem;
- if(!project->isEmpty(item + ".file")) {
- fixedItem = project->first(item + ".file");
- fromFile = true;
- } else if(!project->isEmpty(item + ".subdir")) {
- fixedItem = project->first(item + ".subdir");
- fromFile = false;
- } else {
- fromFile = item.endsWith(Option::pro_ext);
- fixedItem = item;
- }
- QFileInfo fi(fileInfo(fixedItem));
- if (!fromFile) {
- t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fi.canonicalFilePath()) << "\\Makefile\" dodistclean" << endl;
- } else {
- QString itemName = fi.fileName();
- int extIndex = itemName.lastIndexOf(Option::pro_ext);
- if (extIndex)
- fixedItem = fi.canonicalPath() + "/" + QString("Makefile.") + itemName.mid(0,extIndex);
- t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fixedItem) << "\" dodistclean" << endl;
- }
-
- }
+ generateDistcleanTargets(t);
- generatedFiles << Option::fixPathToTargetOS(fileInfo(Option::output.fileName()).canonicalFilePath()); // bld.inf
- generatedFiles << project->values("QMAKE_INTERNAL_PRL_FILE"); // Add generated prl files for cleanup
- generatedFiles << project->values("QMAKE_DISTCLEAN"); // Add any additional files marked for distclean
- QStringList fixedFiles;
- QStringList fixedDirs;
- foreach(QString item, generatedFiles) {
- QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).canonicalFilePath());
- if (!fixedFiles.contains(fixedItem)) {
- fixedFiles << fixedItem;
- }
- }
- foreach(QString item, generatedDirs) {
- QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).canonicalFilePath());
- if (!fixedDirs.contains(fixedItem)) {
- fixedDirs << fixedItem;
- }
- }
- generateCleanCommands(t, fixedFiles, "$(DEL_FILE)", "", "", "");
- generateCleanCommands(t, fixedDirs, "$(DEL_DIR)", "", "", "");
- t << endl;
-
- t << "distclean: clean dodistclean" << endl;
- t << endl;
t << "clean: $(ABLD)" << endl;
t << "\t-$(ABLD)" << testClause << " reallyclean" << endl;
t << "\t-bldmake clean" << endl;
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index 7b739c7..0266bac 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -220,56 +220,8 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
qDeleteAll(subtargets);
}
- t << "dodistclean:" << endl;
- foreach(QString item, project->values("SUBDIRS")) {
- bool fromFile = false;
- QString fixedItem;
- if(!project->isEmpty(item + ".file")) {
- fixedItem = project->first(item + ".file");
- fromFile = true;
- } else if(!project->isEmpty(item + ".subdir")) {
- fixedItem = project->first(item + ".subdir");
- fromFile = false;
- } else {
- fromFile = item.endsWith(Option::pro_ext);
- fixedItem = item;
- }
- QFileInfo fi(fileInfo(fixedItem));
- if (!fromFile) {
- t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fi.absoluteFilePath() + "/Makefile") << "\" dodistclean" << endl;
- } else {
- QString itemName = fi.fileName();
- int extIndex = itemName.lastIndexOf(Option::pro_ext);
- if (extIndex)
- fixedItem = fi.absolutePath() + "/" + QString("Makefile.") + itemName.mid(0,extIndex);
- t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fixedItem) << "\" dodistclean" << endl;
- }
-
- }
+ generateDistcleanTargets(t);
- generatedFiles << Option::fixPathToTargetOS(fileInfo(Option::output.fileName()).absoluteFilePath()); // bld.inf
- generatedFiles << project->values("QMAKE_INTERNAL_PRL_FILE"); // Add generated prl files for cleanup
- generatedFiles << project->values("QMAKE_DISTCLEAN"); // Add any additional files marked for distclean
- QStringList fixedFiles;
- QStringList fixedDirs;
- foreach(QString item, generatedFiles) {
- QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath());
- if (!fixedFiles.contains(fixedItem)) {
- fixedFiles << fixedItem;
- }
- }
- foreach(QString item, generatedDirs) {
- QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath());
- if (!fixedDirs.contains(fixedItem)) {
- fixedDirs << fixedItem;
- }
- }
- generateCleanCommands(t, fixedFiles, "$(DEL_FILE)", "", "", "");
- generateCleanCommands(t, fixedDirs, "$(DEL_DIR)", "", "", "");
- t << endl;
-
- t << "distclean: clean dodistclean" << endl;
- t << endl;
t << "clean: " << BLD_INF_FILENAME << endl;
t << "\t-$(SBS) reallyclean" << endl;
t << endl;
@@ -433,6 +385,28 @@ bool SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
t << "END" << endl;
}
+ // Generate temp dirs
+ QString tempDirs;
+ for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ QString value = values.at(i);
+ if (value.endsWith("/" QT_EXTRA_INCLUDE_DIR)) {
+ value = fileInfo(value).absoluteFilePath();
+ tempDirs.append(value);
+ tempDirs.append(" ");
+ }
+ }
+ }
+
+ if (tempDirs.size())
+ tempDirs.chop(1); // Remove final space
+
+ t << "START EXTENSION qt/qmake_generate_temp_dirs" << endl;
+ t << "OPTION DIRS " << tempDirs << endl;
+ t << "END" << endl;
+ t << endl;
+
t << endl;
return true;