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>
This commit is contained in:
Oswald Buddenhagen
2011-08-18 13:03:12 +02:00
committed by Daniel Molkentin
parent 89e284cb1a
commit 4078fba4ec
3 changed files with 50 additions and 0 deletions
+14
View File
@@ -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
+35
View File
@@ -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+"$@"}
+1
View File
@@ -12,6 +12,7 @@ TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS = src share lib/qtcreator/qtcomponents
unix:!macx:!isEmpty(copydata):SUBDIRS += bin
OTHER_FILES += dist/copyright_template.txt \
dist/changes-1.1.0 \