r2762: Updated Japanese translation (UTUMI Hirosi).
[rox-filer.git] / ROX-Filer / AppRun
blob8534897dffc7804d2857cb312bc69673f08382d1
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 --valgrind) shift ; DEBUGGER=valgrind ;;
20 --compile)
21 shift
22 if [ ! -d "$APP_DIR/src" ] ; then
23 echo "ERROR from $0:" >&2
24 echo "Cannot compile - source code is missing!" >&2
25 exit 1
27 echo "Compiling $APP_DIR... please wait..." >&2
28 if [ ! -x "$APP_DIR/src/configure" ]; then
29 echo "No 'configure' script! Trying to run autoconf..."
30 (cd "$APP_DIR/src"; autoconf)
32 rm -f "$APP_DIR/src/config.cache"
33 cd "$APP_DIR/src" && ./configure --enable-rox \
34 --with-platform="$PLATFORM" \
35 "$@" \
36 && make clean && make && echo Done >&2 && exit 0
37 echo Compile failed >&2
38 echo Press Return... >&2
39 read WAIT
40 exit 1
41 esac
43 BIN="$APP_DIR/$PLATFORM/$PROG"
45 if [ -x "$BIN" ]; then
46 exec $DEBUGGER "$BIN" "$@"
47 else
48 echo "ERROR from $0:" >&2
49 echo "I cannot find an executable file for your host type ($PLATFORM)." >&2
50 echo "Trying to compile..." >&2
51 if [ -n "$DISPLAY" ]; then
52 xterm -e "$0" --compile
53 else
54 "$0" --compile
56 if [ -x "$BIN" ]; then
57 exec "$BIN" "$@"
59 exit 1