1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

Changed to Unix-Format.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1210 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
erhard 2010-08-05 17:22:24 +00:00 committed by erhard
parent 2bd5f71444
commit 89dba4002d

View File

@ -1,36 +1,36 @@
#!/bin/sh #!/bin/sh
makeAbsolute() { makeAbsolute() {
case "$1" in case "$1" in
/*) /*)
# already absolute, return it # already absolute, return it
echo "$1" echo "$1"
;; ;;
*) *)
# relative, prepend $2 made absolute # relative, prepend $2 made absolute
echo `makeAbsolute "$2" "$PWD"`/"$1" | sed 's,/\.$,,' echo `makeAbsolute "$2" "$PWD"`/"$1" | sed 's,/\.$,,'
;; ;;
esac esac
} }
if test -L "$0"; then if test -L "$0"; then
# Try readlink(1) # Try readlink(1)
readlink=`type readlink 2>/dev/null` || readlink= readlink=`type readlink 2>/dev/null` || readlink=
if test -n "$readlink"; then if test -n "$readlink"; then
# We have readlink(1), so we can use it # We have readlink(1), so we can use it
me=`readlink -nf "$0"` me=`readlink -nf "$0"`
else else
# No readlink(1), so let's try ls -l # No readlink(1), so let's try ls -l
me=`ls -l "$0" | sed 's/^.*-> //'` me=`ls -l "$0" | sed 's/^.*-> //'`
base=`dirname "$0"` base=`dirname "$0"`
me=`makeAbsolute "$me" "$base"` me=`makeAbsolute "$me" "$base"`
fi fi
else else
me="$0" me="$0"
fi fi
bindir=`dirname "$me"` bindir=`dirname "$me"`
libdir=`cd "${bindir}/../lib" ; pwd` libdir=`cd "${bindir}/../lib" ; pwd`
LD_LIBRARY_PATH="${libdir}/openpilotgcs:${LD_LIBRARY_PATH}" LD_LIBRARY_PATH="${libdir}/openpilotgcs:${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH export LD_LIBRARY_PATH
exec "${bindir}/openpilotgcs.bin" ${1+"$@"} exec "${bindir}/openpilotgcs.bin" ${1+"$@"}