summaryrefslogtreecommitdiffstats
path: root/qmake/generators/unix/unixmake2.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-01-07 14:45:46 +0100
committerLiang Qi <liang.qi@qt.io>2018-01-07 14:47:19 +0100
commit24fba6744cea1163ceee06d69d31b4eb619cd386 (patch)
tree87850fde25ac7ac662de366e3ce3be91061245ce /qmake/generators/unix/unixmake2.cpp
parent0749ba2c5eacc4822cf9c7a31edf8d70c4ef6064 (diff)
parent1c8224511dee2794553da9dc8ed484d49dc78b45 (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts: tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp Change-Id: Ib6dd965a7eb6f59103e276b3407739147ecd37b2
Diffstat (limited to 'qmake/generators/unix/unixmake2.cpp')
-rw-r--r--qmake/generators/unix/unixmake2.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 15ba4f0309..8ecfa0bf31 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -155,6 +155,20 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
}
}
+static QString rfc1034Identifier(const QString &str)
+{
+ QString s = str;
+ for (QChar &ch : s) {
+ const char c = ch.toLatin1();
+
+ const bool okChar = (c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z')
+ || (c >= 'a' && c <= 'z') || c == '-' || c == '.';
+ if (!okChar)
+ ch = QChar::fromLatin1('-');
+ }
+ return s;
+}
+
void
UnixMakefileGenerator::writeMakeParts(QTextStream &t)
{
@@ -835,7 +849,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if (bundleIdentifier.endsWith(".framework"))
bundleIdentifier.chop(10);
// replace invalid bundle id characters
- bundleIdentifier.replace('_', '-');
+ bundleIdentifier = rfc1034Identifier(bundleIdentifier);
commonSedArgs << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" ";
commonSedArgs << "-e \"s,\\$${PRODUCT_BUNDLE_IDENTIFIER}," << bundleIdentifier << ",g\" ";