1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00
LibrePilot/ground/openpilotgcs/bin/openpilotgcs
stac 7195862d77 build: Move openpilotgcs into its own subdirectory
This will allow us to build a parent project for
qt-creator that sits above both openpilotgcs and
uavobjgenerator so that we can build both projects
at the same time.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2528 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-22 17:40:26 +00:00

37 lines
781 B
Bash

#!/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
}
if test -L "$0"; 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
me=`readlink -nf "$0"`
else
# No readlink(1), so let's try ls -l
me=`ls -l "$0" | sed 's/^.*-> //'`
base=`dirname "$0"`
me=`makeAbsolute "$me" "$base"`
fi
else
me="$0"
fi
bindir=`dirname "$me"`
libdir=`cd "${bindir}/../lib" ; pwd`
LD_LIBRARY_PATH="${libdir}/openpilotgcs:${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH
exec "${bindir}/openpilotgcs.bin" ${1+"$@"}