r593: Rewrote the file info box. Looks a bit nicer, and it's easier to add extra
[rox-filer.git] / ROX-Filer / AppRun
blobf9a19c53c56df580d3dc5a071bf41e351278b059
1 #!/bin/sh
3 PROG=ROX-Filer
5 APP_DIR=`dirname $0`
6 APP_DIR=`cd $APP_DIR;pwd`; export APP_DIR
8 ARCH=`uname -m`
9 case $ARCH in
10 i?86) ARCH=ix86 ;;
11 esac
13 PLATFORM=`uname -s`-$ARCH
15 DEBUGGER=""
17 case $1 in
18 --debug) shift ; DEBUGGER=gdb ;;
19 --compile)
20 shift
21 if [ ! -d $APP_DIR/src ] ; then
22 echo "ERROR from $0:" >&2
23 echo "Cannot compile - source code is missing!" >&2
24 exit 1
26 echo "Compiling $APP_DIR... please wait..." >&2
27 if [ ! -x "$APP_DIR/src/configure" ]; then
28 echo "No 'configure' script! Trying to run autoconf..."
29 (cd $APP_DIR/src; autoconf)
31 rm -f $APP_DIR/src/config.cache
32 cd $APP_DIR/src && ./configure --enable-rox \
33 --bindir=$APP_DIR/$PLATFORM \
34 "$@" \
35 && make clean && make && echo Done >&2 && exit 0
36 echo Compile failed >&2
37 echo Press Return... >&2
38 read WAIT
39 exit 1
40 esac
42 BIN=$APP_DIR/$PLATFORM/$PROG
44 if [ -x $BIN ]; then
45 exec $DEBUGGER $BIN "$@"
46 else
47 echo "ERROR from $0:" >&2
48 echo "I cannot find an executable file for your host type ($PLATFORM)." >&2
49 echo "Trying to compile..." >&2
50 if [ -n "$DISPLAY" ]; then
51 xterm -e $0 --compile
52 else
53 $0 --compile
55 if [ -x $BIN ]; then
56 exec $BIN "$@"
58 exit 1