r164: Shift-clicking a symlink opens the directory that contains it.
[rox-filer/ma.git] / ROX-Filer / AppRun
blob429375d69280632d3bf672e4c79300e649098ca8
1 #!/usr/bin/env bash
3 PROG=ROX-Filer
5 set -P
6 APP_DIR=${0%/*}
7 if [ "$APP_DIR" = "$0" ] ; then APP_DIR=. ; fi
8 APP_DIR=`cd $APP_DIR;pwd`; export APP_DIR
10 PLATFORM=`unset HOSTTYPE; unset OSTYPE; bash -c 'echo $OSTYPE-$HOSTTYPE'`
12 DEBUGGER=""
13 case $1 in
14 --debug) shift ; DEBUGGER=gdb ;;
15 --compile)
16 if [ ! -d $APP_DIR/src ] ; then
17 echo "ERROR from $0:" >&2
18 echo "Cannot compile - source code is missing!" >&2
19 exit 1
21 echo "Compiling $APP_DIR... please wait..." >&2
22 rm -f $APP_DIR/src/config.cache
23 cd $APP_DIR/src && ./configure --bindir=$APP_DIR/$PLATFORM \
24 && make clean && make && echo Done >&2 && exit 0
25 echo Compile failed >&2
26 exit 1
27 esac
29 BIN=$APP_DIR/$PLATFORM/$PROG
31 if [ -x $BIN ] ; then
32 exec $DEBUGGER $BIN $*
33 else
34 echo "ERROR from $0:" >&2
35 echo "I cannot find an executable file for your host type ($PLATFORM)." >&2
36 echo "Try using the --compile option." >&2