-RCFILE=".runlttvrc"
-
-ARGS=\
-"-L lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow "\
-"-L lttv/modules/gui/controlflow/.libs -m guicontrolflow "\
-"-L lttv/modules/gui/detailedevents/.libs -m guievents "\
-"-L lttv/modules/gui/tracecontrol/.libs -m guitracecontrol "\
-"-L lttv/modules/gui/statistics/.libs -m guistatistics "\
-"-L lttv/modules/gui/resourceview/.libs -m resourceview "\
-"-L lttv/modules/gui/filter/.libs -m guifilter "\
-"-L lttv/modules/gui/interrupts/.libs -m interrupts "\
-"-L lttv/modules/gui/histogram/.libs -m guihistogram"
-
-if [ -e "lttv/lttv/.libs/lttv.real" ]; then
- LTTV_EXEC="lttv/lttv/.libs/lttv.real"
-elif [ -e "lttv/lttv/lttv.real" ]; then
- LTTV_EXEC="lttv/lttv/lttv.real"
+PROGNAME=$0
+BUILDPATH=$(dirname $0)
+RCFILE="$(dirname $0)/.runlttvrc"
+TEXTLIBS="-L ${BUILDPATH}/lttv/modules/text/.libs -m textDump"
+GRAPHLIBS="-L ${BUILDPATH}/lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow "\
+"-L ${BUILDPATH}/lttv/modules/gui/controlflow/.libs -m guicontrolflow "\
+"-L ${BUILDPATH}/lttv/modules/gui/detailedevents/.libs -m guievents "\
+"-L ${BUILDPATH}/lttv/modules/gui/tracecontrol/.libs -m guitracecontrol "\
+"-L ${BUILDPATH}/lttv/modules/gui/statistics/.libs -m guistatistics "\
+"-L ${BUILDPATH}/lttv/modules/gui/resourceview/.libs -m resourceview "\
+"-L ${BUILDPATH}/lttv/modules/gui/filter/.libs -m guifilter "\
+"-L ${BUILDPATH}/lttv/modules/gui/interrupts/.libs -m interrupts "\
+"-L ${BUILDPATH}/lttv/modules/gui/histogram/.libs -m guihistogram"
+DEFAULTMODE="gui"
+
+usage () {
+ echo "Usage: $0 [OPTION]... [TRACE]..." >/dev/stderr
+ echo "" >/dev/stderr
+ echo "Options:" >/dev/stderr
+ printf "\t-m MODE Output mode (modes: text, gui)\n" >/dev/stderr
+ printf "\t-H HELPER Invoke LTTV through a helper program\n" >/dev/stderr
+ printf "\t (helpers: gdb, valgrind, massif, strace)\n" >/dev/stderr
+ printf "\t-b OPTIONS LTTV options to specify before the module list\n" >/dev/stderr
+ printf "\t-a OPTIONS LTTV options to specify after the module list\n" >/dev/stderr
+ echo "" >/dev/stderr
+}
+
+if [ -e "${BUILDPATH}/lttv/lttv/.libs/lttv.real" ]; then
+ LTTV_EXEC="${BUILDPATH}/lttv/lttv/.libs/lttv.real"
+elif [ -e "${BUILDPATH}/lttv/lttv/lttv.real" ]; then
+ LTTV_EXEC="${BUILDPATH}/lttv/lttv/lttv.real"