summaryrefslogtreecommitdiffstats
path: root/qmake/generators/unix
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-06-05 16:12:02 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-09-17 16:35:55 +0000
commit78f6229222cd67316e18bf5bbeaed28d9a4056a5 (patch)
tree8fd8b38caecf354aa3ffbf653ba799719547ab2c /qmake/generators/unix
parent554f365322cd38bd9df2c339a18bd8ba553cabf3 (diff)
fix relative rpaths on linux
$ORIGIN (or $LIB) needs to be escaped to survive the trip through make and the shell. this shouldn't break anything, as there was simply no way to get it right so far. Change-Id: I86337c5994d10dae2e80dd2f858f74874b14bca7 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'qmake/generators/unix')
-rw-r--r--qmake/generators/unix/unixmake.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index c4750cb8a4..03196fbc3a 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -140,7 +140,9 @@ UnixMakefileGenerator::init()
const ProStringList &rpathdirs = project->values("QMAKE_RPATHDIR");
for (int i = 0; i < rpathdirs.size(); ++i) {
QString rpathdir = rpathdirs[i].toQString();
- if (!rpathdir.startsWith('@') && !rpathdir.startsWith('$'))
+ if (rpathdir.length() > 1 && rpathdir.at(0) == '$' && rpathdir.at(1) != '(')
+ rpathdir.replace(0, 1, "\\$$"); // Escape from make and the shell
+ else if (!rpathdir.startsWith('@'))
rpathdir = QFileInfo(rpathdir).absoluteFilePath();
project->values("QMAKE_LFLAGS") += var("QMAKE_LFLAGS_RPATH") + escapeFilePath(rpathdir);
}