6 APP_DIR
=`cd "$APP_DIR";pwd`; export APP_DIR
11 --debug) shift ; DEBUGGER
=gdb
;;
12 --valgrind) shift ; DEBUGGER
="valgrind --num-callers=8";;
13 --leaks) shift ; DEBUGGER
="valgrind --num-callers=8 --leak-check=yes";;
16 if [ ! -d "$APP_DIR/src" ] ; then
17 echo "ERROR from $0:" >&2
18 echo "Cannot compile - source code is missing!" >&2
21 echo "Compiling $APP_DIR... please wait..." >&2
22 if [ ! -x "$APP_DIR/src/configure" ]; then
23 echo "No 'configure' script! Trying to run autoconf..."
24 (cd "$APP_DIR/src"; autoconf
)
26 BUILDDIR
="$APP_DIR/build"
27 [ ! -d "$BUILDDIR" ] && mkdir
"$BUILDDIR"
28 rm -f "$BUILDDIR/config.cache"
29 rm -f "$APP_DIR/src/config.h" # (for upgrading)
30 cd "$BUILDDIR" && "$APP_DIR/src/configure" "$@" \
31 && make clean
&& make && echo Done
>&2 && exit 0
32 echo Compile failed
>&2
33 echo Press Return...
>&2
40 if [ -x "$BIN" ]; then
41 exec $DEBUGGER "$BIN" "$@"
43 echo "Message from $0:" >&2
44 echo "I cannot find an executable binary." >&2
45 echo "Trying to compile..." >&2
46 if [ -n "$DISPLAY" -a -z "$TERM" ]; then
47 xterm
-e "$0" --compile
51 if [ -x "$BIN" ]; then