summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-08-18 13:03:12 +0200
committerDaniel Molkentin <daniel.molkentin@nokia.com>2011-08-18 15:40:11 +0200
commit4078fba4ecc4879c817d513910a105444063be21 (patch)
treed66798f82cc42fe0dd69ea2ea231b0a8152518bc /bin
parent89e284cb1a344d51cb474ef4b1e8442d09b1eb39 (diff)
downloadqt-creator-4078fba4ecc4879c817d513910a105444063be21.tar.gz
re-add LD_LIBRARY_PATH script
we need to override RUNPATHs from possible plugins. due to d7d23226, this should not re-introduce QTCREATORBUG-1646. unlike in the previous incarnation, we don't replace the binary with the script, but give the script an extension. this is nicer for packagers and less confusing in creator's own run configurations. the .desktop files created by our installers need to be adjusted for that. Task-number: QTCREATORBUG-5565 Change-Id: Icd2fa55456754a05257376b8288e8bdf423c62db Reviewed-on: http://codereview.qt.nokia.com/3180 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Daniel Molkentin <daniel.molkentin@nokia.com> Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
Diffstat (limited to 'bin')
-rw-r--r--bin/bin.pro14
-rwxr-xr-xbin/qtcreator.sh35
2 files changed, 49 insertions, 0 deletions
diff --git a/bin/bin.pro b/bin/bin.pro
new file mode 100644
index 0000000000..14bbb6b36e
--- /dev/null
+++ b/bin/bin.pro
@@ -0,0 +1,14 @@
+TEMPLATE = app
+TARGET = qtcreator.sh
+OBJECTS_DIR =
+
+PRE_TARGETDEPS = $$PWD/qtcreator.sh
+
+QMAKE_LINK = cp $$PWD/qtcreator.sh $@ && : IGNORE REST OF LINE:
+
+QMAKE_CLEAN = qtcreator.sh
+
+target.path = /bin
+INSTALLS += target
+
+OTHER_FILES = $$PWD/qtcreator.sh
diff --git a/bin/qtcreator.sh b/bin/qtcreator.sh
new file mode 100755
index 0000000000..aca30f5b9e
--- /dev/null
+++ b/bin/qtcreator.sh
@@ -0,0 +1,35 @@
+#! /bin/sh
+
+makeAbsolute() {
+ case $1 in
+ /*)
+ # already absolute, return it
+ echo "$1"
+ ;;
+ *)
+ # relative, prepend $2 made absolute
+ echo `makeAbsolute "$2" "$PWD"`/"$1" | sed 's,/\.$,,'
+ ;;
+ esac
+}
+
+me=`which "$0"` # Search $PATH if necessary
+if test -L "$me"; then
+ # Try readlink(1)
+ readlink=`type readlink 2>/dev/null` || readlink=
+ if test -n "$readlink"; then
+ # We have readlink(1), so we can use it. Assuming GNU readlink (for -f).
+ me=`readlink -nf "$me"`
+ else
+ # No readlink(1), so let's try ls -l
+ me=`ls -l "$me" | sed 's/^.*-> //'`
+ base=`dirname "$me"`
+ me=`makeAbsolute "$me" "$base"`
+ fi
+fi
+
+bindir=`dirname "$me"`
+libdir=`cd "$bindir/../lib" ; pwd`
+LD_LIBRARY_PATH=$libdir:$libdir/qtcreator${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+export LD_LIBRARY_PATH
+exec "$bindir/qtcreator" ${1+"$@"}