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
51 if [ -x "$BIN" ]; then
52 exec $DEBUGGER "$BIN" $DEBUG_OPTIONS "$@"
54 echo "ERROR from $0:" >&2
55 echo "I cannot find an executable binary." >&2
56 echo "Trying to compile..." >&2
57 if [ -n "$DISPLAY" ]; then
58 xterm
-e "$0" --compile
62 if [ -x "$BIN" ]; then