Files
qt-creator/bin/qtcreator.sh
Oswald Buddenhagen 3ff007d573 don't detect readlink a-priori
it's pointless and causes an unnecessary delay.
what's worse, we wouldn't actually know whether we found a compatible
(gnu) readlink, so the fallback would never get activated. this would be
the case on macos (the problem wasn't noticed so far, because on macos
we build a bundle which doesn't need the wrapper in the first place).

Change-Id: Ibf4c370d5d9e25064e80faeaf12eb5fa1bc68c20
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-09-27 13:06:53 +00:00

45 lines
1.1 KiB
Bash
Executable File

#! /bin/sh
# Use this script if you add paths to LD_LIBRARY_PATH
# that contain libraries that conflict with the
# libraries that Qt Creator depends on.
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 GNU readlink(1)
nme=`readlink -nf "$me" 2>/dev/null`
if test -n "$nme"; then
me=$nme
else
# No GNU readlink(1), so let's try ls -l
base=`dirname "$me"`
me=`ls -l "$me" | sed 's/^.*-> //'`
me=`makeAbsolute "$me" "$base"`
fi
fi
bindir=`dirname "$me"`
libdir=`cd "$bindir/../lib" ; pwd`
# Add path to deployed Qt libraries in package
qtlibdir=$libdir/Qt/lib
if test -d "$qtlibdir"; then
qtlibpath=:$qtlibdir
fi
# Add Qt Creator library path
LD_LIBRARY_PATH=$libdir:$libdir/qtcreator$qtlibpath${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
exec "$bindir/qtcreator" ${1+"$@"}