summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorPulse Build System <qt-info@nokia.com>2010-01-22 01:08:17 (GMT)
committerPulse Build System <qt-info@nokia.com>2010-01-22 01:08:17 (GMT)
commite7566980e349f163cd45e84406f69f3a5a1a1649 (patch)
tree9b16c29305f70df85cee16383649618cfc8ec84b /qmake
parent8e65adce9ced8f3b1d42b938e4d65e1af4768c33 (diff)
parenta4de5dc69634b90b2fc6c8bd65d936fe80a5afd9 (diff)
downloadQt-e7566980e349f163cd45e84406f69f3a5a1a1649.zip
Qt-e7566980e349f163cd45e84406f69f3a5a1a1649.tar.gz
Qt-e7566980e349f163cd45e84406f69f3a5a1a1649.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into master-integration
* 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public: Fixed the host detection in qmake profiles. Improving parts of commit 2d8d855d. qmake: add Linux host support to Symbian generator Fixed indentation. Add Linux host support to Symbian mkspecs. Linux support for platform specific commands in .pro files. Add createpackage.bat equivalent for Unix systems. Make all Symbian #includes lower case. mkspecs: fix warning when calling qmake Fix portability problems in bin/createpackage.pl.
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/makefile.cpp10
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.cpp10
-rw-r--r--qmake/generators/symbian/symmake.cpp14
-rw-r--r--qmake/generators/symbian/symmake_abld.cpp48
4 files changed, 59 insertions, 23 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 7424d1d..0f5bdcd 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -65,6 +65,12 @@
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef Q_OS_WIN32
+#define NO_STDERR "2> NUL"
+#else
+#define NO_STDERR "2>/dev/null"
+#endif
+
QT_BEGIN_NAMESPACE
// Well, Windows doesn't have this, so here's the macro
@@ -1796,7 +1802,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
if(tmp_clean.indexOf("${QMAKE_") == -1) {
t << "\n\t" << "-$(DEL_FILE) " << tmp_clean;
if (isForSymbian())
- t << " 2> NUL"; // Eliminate unnecessary warnings
+ t << " " << NO_STDERR; // Eliminate unnecessary warnings
wrote_clean = true;
}
if(!wrote_clean_cmds || !wrote_clean) {
@@ -1826,7 +1832,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
if(!cleans.isEmpty())
if (isForSymbian())
- t << valGlue(cleans, "\n\t" + del_statement, " 2> NUL\n\t" + del_statement, " 2> NUL");
+ t << valGlue(cleans, "\n\t" + del_statement, " " NO_STDERR "\n\t" + del_statement, " " NO_STDERR);
else
t << valGlue(cleans, "\n\t" + del_statement, "\n\t" + del_statement, "");
if(!wrote_clean_cmds) {
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
index f3e3c3a..7ccce00 100644
--- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
@@ -175,12 +175,12 @@ static void createPluginStub(const QFileInfo& info,
QStringList& generatedDirs,
QStringList& generatedFiles)
{
- QDir().mkpath(QLatin1String(PLUGIN_STUB_DIR "\\"));
+ QDir().mkpath(PLUGIN_STUB_DIR);
if (!generatedDirs.contains(PLUGIN_STUB_DIR))
generatedDirs << PLUGIN_STUB_DIR;
// Plugin stubs must have different name from the actual plugins, because
// the toolchain for creating ROM images cannot handle non-binary .dll files properly.
- QFile stubFile(QLatin1String(PLUGIN_STUB_DIR "\\") + info.completeBaseName() + "." SUFFIX_QTPLUGIN);
+ QFile stubFile(QDir(PLUGIN_STUB_DIR).filePath(info.completeBaseName() + "." SUFFIX_QTPLUGIN));
if (stubFile.open(QIODevice::WriteOnly)) {
if (!generatedFiles.contains(stubFile.fileName()))
generatedFiles << stubFile.fileName();
@@ -329,12 +329,12 @@ void initProjectDeploySymbian(QMakeProject* project,
if (isBinary(info)) {
if (deployBinaries) {
// Executables and libraries are deployed to \sys\bin
- QFileInfo releasePath(epocRoot() + "epoc32\\release\\" + platform + "\\" + build + "\\");
+ QFileInfo releasePath(epocRoot() + QDir::toNativeSeparators("epoc32/release/" + platform + "/" + build + "/"));
if(devicePathHasDriveLetter) {
- deploymentList.append(CopyItem(Option::fixPathToLocalOS(releasePath.absolutePath() + "\\" + info.fileName(), false, true),
+ deploymentList.append(CopyItem(Option::fixPathToLocalOS(QDir(releasePath.absolutePath()).filePath(info.fileName()), false, true),
Option::fixPathToLocalOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "\\") + info.fileName())));
} else {
- deploymentList.append(CopyItem(Option::fixPathToLocalOS(releasePath.absolutePath() + "\\" + info.fileName(), false, true),
+ deploymentList.append(CopyItem(Option::fixPathToLocalOS(QDir(releasePath.absolutePath()).filePath(info.fileName()), false, true),
Option::fixPathToLocalOS(deploymentDrive + QLatin1String(SYSBIN_DIR "\\") + info.fileName())));
}
}
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index 20e2d0e..2c1ce18 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -49,11 +49,17 @@
#include <stdlib.h>
#include <qdebug.h>
+#ifdef Q_OS_WIN
+#define SCRIPT_EXT ".bat"
+#else
+#define SCRIPT_EXT ".sh"
+#endif
+
#define RESOURCE_DIRECTORY_MMP "/resource/apps"
#define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\"
#define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps"
#define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def"
-#define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonU.def"
+#define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonu.def"
#define BLD_INF_FILENAME_LEN (sizeof(BLD_INF_FILENAME) - 1)
#define BLD_INF_RULES_BASE "BLD_INF_RULES."
@@ -407,7 +413,7 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, Deployme
for (int i = 0; i < depList.size(); ++i) {
t << QString("\"%1\" - \"%2\"")
.arg(QString(depList.at(i).from).replace('\\','/'))
- .arg(depList.at(i).to) << endl;
+ .arg(QString(depList.at(i).to).replace('/','\\')) << endl;
}
t << endl;
@@ -1762,7 +1768,7 @@ void SymbianMakefileGenerator::generateCleanCommands(QTextStream& t,
t << "\t-@ if EXIST \"" << QDir::toNativeSeparators(item) << "\" ";
t << cmd << " " << cmdOptions << " \"" << QDir::toNativeSeparators(item) << "\"" << endl;
#else
- t << "\t-if test -f " << QDir::toNativeSeparators(item) << "; then ";
+ t << "\t-if test -e " << QDir::toNativeSeparators(item) << "; then ";
t << cmd << " " << cmdOptions << " " << QDir::toNativeSeparators(item) << "; fi" << endl;
#endif
}
@@ -1801,7 +1807,7 @@ void SymbianMakefileGenerator::writeSisTargets(QTextStream &t)
t << OK_SIS_TARGET ":" << endl;
- QString pkgcommand = QString("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \
+ QString pkgcommand = QString("\tcreatepackage" SCRIPT_EXT " $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \
"$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)")
.arg(fixedTarget)
.arg("pkg");
diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp
index d1e63cb..9954783 100644
--- a/qmake/generators/symbian/symmake_abld.cpp
+++ b/qmake/generators/symbian/symmake_abld.cpp
@@ -195,16 +195,21 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
t << "MOVE = " << var("QMAKE_MOVE") << endl;
+#ifdef Q_OS_WIN32
t << "XCOPY = xcopy /d /f /h /r /y /i" << endl;
t << "ABLD = ABLD.BAT" << endl;
+#else
+ t << "XCOPY = cp -u -v" << endl;
+ t << "ABLD = abld" << endl;
+#endif
t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl;
t << "RELEASE_PLATFORMS = " << releasePlatforms.join(" ") << endl;
t << "MAKE = make" << endl;
t << endl;
t << "ifeq (WINS,$(findstring WINS, $(PLATFORM)))" << endl;
- t << "ZDIR=$(EPOCROOT)epoc32\\release\\$(PLATFORM)\\$(CFG)\\Z" << endl;
+ t << "ZDIR=$(EPOCROOT)" << QDir::toNativeSeparators("epoc32/release/$(PLATFORM)/$(CFG)/z") << endl;
t << "else" << endl;
- t << "ZDIR=$(EPOCROOT)epoc32\\data\\z" << endl;
+ t << "ZDIR=$(EPOCROOT)" << QDir::toNativeSeparators("epoc32/data/z") << endl;
t << "endif" << endl;
t << endl;
t << "DEFINES" << '\t' << " = "
@@ -304,8 +309,13 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
if (values.at(i).endsWith("/" QT_EXTRA_INCLUDE_DIR)) {
QString fixedValue(QDir::toNativeSeparators(values.at(i)));
dirsToClean << fixedValue;
+#ifdef Q_OS_WIN32
t << "\t-@ if NOT EXIST \"" << fixedValue << "\" mkdir \""
<< fixedValue << "\"" << endl;
+#else
+ t << "\t-@ if test ! -d \"" << fixedValue << "\"; then mkdir \""
+ << fixedValue << "\"" << "; fi" <<endl;
+#endif
}
}
}
@@ -314,7 +324,11 @@ 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;
+#ifdef Q_OS_WIN32
generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_DIR"), " /S /Q ", "", "");
+#else
+ generateCleanCommands(t, dirsToClean, "rm", " -rf ", "", "");
+#endif
t << endl;
t << PRE_TARGETDEPS_TARGET ":"
@@ -441,21 +455,31 @@ bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t)
void SymbianAbldMakefileGenerator::writeStoreBuildTarget(QTextStream &t)
{
+#ifdef Q_OS_WIN
+#define HASH "#"
+#define EMPTYECHO "."
+#else
+#define HASH "\\#"
+#define EMPTYECHO
+#endif
+
t << STORE_BUILD_TARGET ":" << endl;
- t << "\t@echo # ============================================================================== > " MAKE_CACHE_NAME << endl;
- t << "\t@echo # This file is generated by make and should not be modified by the user >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo # Name : " << MAKE_CACHE_NAME << " >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo # Part of : " << project->values("TARGET").join(" ") << " >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo # Description : This file is used to cache last build target for >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo # make sis target. >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo # Version : >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo # >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo # ============================================================================== >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo. >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " ============================================================================== > " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " This file is generated by make and should not be modified by the user >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " Name : " << MAKE_CACHE_NAME << " >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " Part of : " << project->values("TARGET").join(" ") << " >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " Description : This file is used to cache last build target for >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " make sis target. >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " Version : >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " ============================================================================== >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo" EMPTYECHO " >> " MAKE_CACHE_NAME << endl;
t << "\t@echo QT_SIS_TARGET ?= $(QT_SIS_TARGET) >> " MAKE_CACHE_NAME << endl;
t << endl;
generatedFiles << MAKE_CACHE_NAME;
+#undef HASH
+#undef EMPTYECHO
}
void SymbianAbldMakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension)