From 4078fba4ecc4879c817d513910a105444063be21 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 18 Aug 2011 13:03:12 +0200 Subject: 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 Reviewed-by: Daniel Molkentin Reviewed-by: Christian Kamm --- bin/bin.pro | 14 ++++++++++++++ bin/qtcreator.sh | 35 +++++++++++++++++++++++++++++++++++ qtcreator.pro | 1 + 3 files changed, 50 insertions(+) create mode 100644 bin/bin.pro create mode 100755 bin/qtcreator.sh 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+"$@"} diff --git a/qtcreator.pro b/qtcreator.pro index 35f8c20e46..599eed3f88 100644 --- a/qtcreator.pro +++ b/qtcreator.pro @@ -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 \ -- cgit v1.2.3