6 APP_DIR
=`cd "$APP_DIR";pwd`; export APP_DIR
8 if [ "x$PLATFORM" = x
]; then
14 PLATFORM
=`uname -s`-"$ARCH" export PLATFORM
21 if [ "$#" = 0 ] ; then
22 DEBUGGER
="gdb --args" ; DEBUG_OPTIONS
="-n --g-fatal-warnings"
26 --valgrind) shift ; DEBUGGER
="valgrind --num-callers=8";;
27 --massif) shift ; DEBUGGER
="valgrind --tool=massif --alloc-fn=g_malloc --alloc-fn=g_realloc --alloc-fn=g_malloc0 --alloc-fn=g_try_malloc --alloc-fn=g_mem_chunk_alloc";;
28 --calltree) shift ; DEBUGGER
="calltree";;
29 --leaks) shift ; DEBUGGER
="valgrind --num-callers=8 --leak-check=yes";;
32 if [ ! -d "$APP_DIR/src" ] ; then
33 echo "ERROR from $0:" >&2
34 echo "Cannot compile - source code is missing!" >&2
37 echo "Compiling $APP_DIR... please wait..." >&2
38 if [ ! -x "$APP_DIR/src/configure" ]; then
39 echo "No 'configure' script! Trying to run autoconf..."
40 (cd "$APP_DIR/src"; autoconf
)
42 BUILDDIR
="$APP_DIR/build"
43 [ ! -d "$BUILDDIR" ] && mkdir
"$BUILDDIR"
44 rm -f "$BUILDDIR/config.cache"
45 rm -f "$APP_DIR/src/config.h" # (for upgrading)
46 cd "$BUILDDIR" && "$APP_DIR/src/configure" --enable-rox \
47 --with-platform="$PLATFORM" \
49 && make clean
&& make && echo Done
>&2 && exit 0
50 echo Compile failed
>&2
51 echo Press Return...
>&2
56 if [ -z "$XDG_DATA_DIRS" -a -d /uri
/0install
/zero-install.sourceforge.net
]; then
57 # Try to get MIME database through Zero Install, if possible
58 0refresh zero-install.sourceforge.net
/share
/mime
2003-08-07
59 XDG_DATA_DIRS
=/usr
/local
/share
/:/usr
/share
/:/uri
/0install
/zero-install.sourceforge.net
/share
63 BIN
="$APP_DIR/$PLATFORM/$PROG"
65 if [ -x "$BIN" ]; then
66 exec $DEBUGGER "$BIN" $DEBUG_OPTIONS "$@"
68 echo "ERROR from $0:" >&2
69 echo "I cannot find an executable file for your host type ($PLATFORM)." >&2
70 echo "Trying to compile..." >&2
71 if [ -n "$DISPLAY" ]; then
72 xterm
-e "$0" --compile
76 if [ -x "$BIN" ]; then