mirror of
https://github.com/worldforge/ember
synced 2026-08-13 16:23:06 -04:00
The "cd -P" will resolve symlinks. Also for debugging, I have added automatically executed commands: it will execute in gdb: run, backtrace, then automatcally quit. So the user will not need to understand gdb console, everything is automatic. And the user gets automatically backtrace.
36 lines
744 B
Bash
Executable file
36 lines
744 B
Bash
Executable file
#!/bin/bash
|
|
|
|
bindir="$( cd -P "$( dirname "$0" )" && pwd )"
|
|
prefix="$( cd -P "$( dirname "$0" )/.." && pwd )"
|
|
export LD_LIBRARY_PATH=$prefix/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
|
|
|
|
|
|
homedata="$HOME/.ember"
|
|
|
|
debugging=0
|
|
|
|
echo "According to my calculations Ember should be installed in $prefix"
|
|
|
|
case "$1" in
|
|
--home)
|
|
shift
|
|
homedata="$@"
|
|
;;
|
|
--debug)
|
|
shift
|
|
debugging=1
|
|
;;
|
|
esac
|
|
|
|
cd $bindir
|
|
|
|
if [ $debugging == 1 ] ; then
|
|
# Execute real ember binary
|
|
echo "Starting Ember in debugger...."
|
|
gdb --batch -ex "run" -ex "backtrace" -ex "quit" \
|
|
--args $bindir/ember.bin --prefix $prefix --home $homedata "$@"
|
|
else
|
|
# Execute real ember binary
|
|
echo "Starting Ember...."
|
|
$bindir/ember.bin --prefix $prefix --home $homedata "$@"
|
|
fi
|