#!/bin/sh
#@+leo

#@+node:0::@file AppRun
#@+body
#@@first #!/bin/sh
#@@language shell

APP_DIR=`dirname $0`
BIN=$APP_DIR/rox-tasklist
PATH="$APP_DIR:$PATH"
export PATH

roxclib=`FindROXCLibBin`

if [ -z "$LD_LIBRARY_PATH" ]; then
  LD_LIBRARY_PATH=`$roxclib/rox_run ROX-CLib --runtime`
else
  LD_LIBRARY_PATH=`$roxclib/rox_run ROX-CLib --runtime`:$LD_LIBRARY_PATH
fi
export LD_LIBRARY_PATH


cd $APP_DIR

if [ "$1" == "--compile" ]; then
  echo "Compiling $APP_DIR please wait..."
  cd $APP_DIR
  make
  if [ ! -x $BIN ]; then
    echo Compile Failed
  fi
  echo Press Return
  read WAIT
  exit 0
fi

if [ ! -x $BIN ]; then
  xterm -e "$0" --compile
fi
exec $BIN $@
#@-body
#@-node:0::@file AppRun
#@-leo
