6 APP_DIR
=`cd "$APP_DIR";pwd`; export APP_DIR
12 if [ "$#" = 0 ] ; then
13 DEBUGGER
="gdb --args" ; DEBUG_OPTIONS
="-n --g-fatal-warnings"
17 --valgrind) shift ; DEBUGGER
="valgrind --num-callers=8";;
18 --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";;
19 --calltree) shift ; DEBUGGER
="calltree";;
20 --leaks) shift ; DEBUGGER
="valgrind --num-callers=8 --leak-check=yes";;
23 if [ ! -d "$APP_DIR/src" ] ; then
24 echo "ERROR from $0:" >&2
25 echo "Cannot compile - source code is missing!" >&2
28 echo "Compiling $APP_DIR... please wait..." >&2
29 if [ ! -x "$APP_DIR/src/configure" ]; then
30 echo "No 'configure' script! Trying to run autoconf..."
31 (cd "$APP_DIR/src"; autoconf
)
33 BUILDDIR
="$APP_DIR/build"
34 [ ! -d "$BUILDDIR" ] && mkdir
"$BUILDDIR"
35 rm -f "$BUILDDIR/config.cache"
36 rm -f "$APP_DIR/src/config.h" # (for upgrading)
37 cd "$BUILDDIR" && "$APP_DIR/src/configure" "$@" \
38 && make clean
&& make && echo Done
>&2 && exit 0
39 echo Compile failed
>&2
40 echo Press Return...
>&2
45 if [ -z "$XDG_DATA_DIRS" -a -d /uri
/0install
/zero-install.sourceforge.net
]; then
46 # Try to get MIME database through Zero Install, if possible
47 0refresh zero-install.sourceforge.net
/share
/mime
2003-08-07
48 XDG_DATA_DIRS
=/usr
/local
/share
/:/usr
/share
/:/uri
/0install
/zero-install.sourceforge.net
/share
54 if [ -x "$BIN" ]; then
55 exec $DEBUGGER "$BIN" $DEBUG_OPTIONS "$@"
57 echo "ERROR from $0:" >&2
58 echo "I cannot find an executable binary." >&2
59 echo "Trying to compile..." >&2
60 if [ -n "$DISPLAY" ]; then
61 xterm
-e "$0" --compile
65 if [ -x "$BIN" ]; then