6 APP_DIR
=`cd "$APP_DIR";pwd`; export APP_DIR
10 if [ "x$MAKE" = x
]; then
16 if [ "$#" = 0 ] ; then
17 DEBUGGER
="gdb --args" ; DEBUG_OPTIONS
="-n --g-fatal-warnings"
21 --valgrind) shift ; DEBUGGER
="valgrind --num-callers=8";;
22 --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";;
23 --calltree) shift ; DEBUGGER
="calltree";;
24 --leaks) shift ; DEBUGGER
="valgrind --num-callers=8 --leak-check=yes";;
27 if [ ! -d "$APP_DIR/src" ] ; then
28 echo "ERROR from $0:" >&2
29 echo "Cannot compile - source code is missing!" >&2
32 echo "Compiling $APP_DIR... please wait..." >&2
33 if [ ! -x "$APP_DIR/src/configure" ]; then
34 echo "No 'configure' script! Trying to run autoconf..."
35 (cd "$APP_DIR/src"; autoconf
)
37 BUILDDIR
="$APP_DIR/build"
38 [ ! -d "$BUILDDIR" ] && mkdir
"$BUILDDIR"
39 rm -f "$BUILDDIR/config.cache"
40 rm -f "$APP_DIR/src/config.h" # (for upgrading)
41 cd "$BUILDDIR" && "$APP_DIR/src/configure" "$@" \
42 && $MAKE clean
&& $MAKE && echo Done
>&2 && exit 0
43 echo Compile failed
>&2
44 echo Press Return...
>&2
49 if [ -z "$XDG_DATA_DIRS" -a -d /uri
/0install
/zero-install.sourceforge.net
]; then
50 # Try to get MIME database through Zero Install, if possible
51 0refresh zero-install.sourceforge.net
/share
/mime
2003-08-07
52 XDG_DATA_DIRS
=/usr
/local
/share
/:/usr
/share
/:/uri
/0install
/zero-install.sourceforge.net
/share
58 if [ -x "$BIN" ]; then
59 exec $DEBUGGER "$BIN" $DEBUG_OPTIONS "$@"
61 echo "ERROR from $0:" >&2
62 echo "I cannot find an executable binary." >&2
63 echo "Trying to compile..." >&2
64 if [ -n "$DISPLAY" ]; then
65 xterm
-e "$0" --compile
69 if [ -x "$BIN" ]; then