summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-12-05 17:42:33 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-12-05 17:42:33 +0100
commit733ace5a7ad5b9e9f93ac87667d7d37fa5f894d5 (patch)
treea88031a8e1ac30986567070728e29ed1366d0962 /qmake
parenteaff48d3622bbb0e18e79f79aac6d1ac1b7e2760 (diff)
parent835b8213905b315645bc60ff5f2ab99340d075a2 (diff)
Merge remote-tracking branch 'origin/release' into stable
Conflicts: configure mkspecs/macx-ios-clang/features/default_post.prf tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp Change-Id: Iaba97eed2272bccf54289640b8197d40e22f7bf5
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp2
-rw-r--r--qmake/generators/makefile.cpp13
-rw-r--r--qmake/main.cpp9
3 files changed, 20 insertions, 4 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 2674f31d03..fa4a844a5d 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -1140,7 +1140,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
//###
}
- project->values("QMAKE_PBX_PRESCRIPT_BUILDPHASES").append(phase_key);
+ project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
t << "\t\t" << phase_key << " = {\n"
<< "\t\t\t" << writeSettings("name", "Copy '" + bundle_data[i] + "' Files to Bundle") << ";\n"
<< "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 3dd63b4590..946a1ee986 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3336,6 +3336,13 @@ MakefileGenerator::writePkgConfigFile()
t << endl;
}
+static QString windowsifyPath(const QString &str)
+{
+ // The paths are escaped in prl files, so every slash needs to turn into two backslashes.
+ // Then each backslash needs to be escaped for sed. And another level for C quoting here.
+ return QString(str).replace('/', "\\\\\\\\");
+}
+
QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QString &src, const QString &dst)
{
QString ret;
@@ -3348,8 +3355,12 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt
for (int r = 0; r < replace_rules.size(); ++r) {
const ProString match = project->first(ProKey(replace_rules.at(r) + ".match")),
replace = project->first(ProKey(replace_rules.at(r) + ".replace"));
- if (!match.isEmpty() /*&& match != replace*/)
+ if (!match.isEmpty() /*&& match != replace*/) {
ret += " -e " + shellQuote("s," + match + "," + replace + ",g");
+ if (isWindowsShell() && project->first(ProKey(replace_rules.at(r) + ".CONFIG")).contains("path"))
+ ret += " -e " + shellQuote("s," + windowsifyPath(match.toQString())
+ + "," + windowsifyPath(replace.toQString()) + ",gi");
+ }
}
ret += " \"" + src + "\" >\"" + dst + "\"";
}
diff --git a/qmake/main.cpp b/qmake/main.cpp
index 79e3739f56..f5116ba752 100644
--- a/qmake/main.cpp
+++ b/qmake/main.cpp
@@ -85,6 +85,7 @@ static int doSed(int argc, char **argv)
return 3;
}
QChar sep = ++j < cmd.length() ? cmd.at(j) : QChar();
+ Qt::CaseSensitivity matchcase = Qt::CaseSensitive;
bool escaped = false;
int phase = 1;
QStringList phases;
@@ -126,12 +127,16 @@ static int doSed(int argc, char **argv)
fprintf(stderr, "Error: sed s command requires three arguments (%d, %c, %s)\n", phase, sep.toLatin1(), qPrintable(curr));
return 3;
}
+ if (curr.contains(QLatin1Char('i'))) {
+ curr.remove(QLatin1Char('i'));
+ matchcase = Qt::CaseInsensitive;
+ }
if (curr != QLatin1String("g")) {
- fprintf(stderr, "Error: sed s command must be used with the g option (only)\n");
+ fprintf(stderr, "Error: sed s command supports only g & i options; g is required\n");
return 3;
}
SedSubst subst;
- subst.from = QRegExp(phases.at(0));
+ subst.from = QRegExp(phases.at(0), matchcase);
subst.to = phases.at(1);
subst.to.replace("\\\\", "\\"); // QString::replace(rx, sub) groks \1, but not \\.
substs << subst;