Remove some duplicate code in the build system
[lttv.git] / runlttv
CommitLineData
94e22cd1 1#!/bin/sh
2# Released under the GPL
3# pmf - 2008/07/31
4
eb9ab977 5# This script runs LTTV in place in the compile directory without need for
6# installing it with make install.
94e22cd1 7#
8# The .runlttvrc file can be used to control its behavior.
9# - by setting the TRACEFILE variable, a trace can be automatically loaded
10# ex: TRACEFILE="-t /tmp/traces/dijkstra-20071212"
11# - by setting the ARGS variable, a different set of plugins can be loaded
12# for an example see the ARGS= line below
8bd9d9a7 13# - the LTTV_ARGS environment variable may be used to add additional arguments to lttv
94e22cd1 14#
eb9ab977 15# In order for icons to display correctly, it might be necessary to create a
16# symlink:
94e22cd1 17# $ ln -s ./lttv/modules/gui/lttvwindow/pixmaps
18# while in the same directory as this script.
19
20RCFILE=".runlttvrc"
21
22ARGS="-L lttv/modules/gui/controlflow/.libs -m guicontrolflow -L lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow -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"
f034e1cb 23LTTV_EXEC="lttv/lttv/.libs/lttv.real"
24
25if [ ! -e "$LTTV_EXEC" ]; then
26 echo "error: LTTV should be compiled before running this script." >/dev/stderr
27 exit 1
28fi
94e22cd1 29
8bd9d9a7
PMF
30for a in $@; do
31 eval $(echo $a)"=1"
32done
33
94e22cd1 34if [ -e "$RCFILE" ]; then
35 source "$RCFILE";
36fi
37
8bd9d9a7
PMF
38ARGS="$ARGS $LTTV_ARGS"
39
40echo $dbg
41
42if [ -n "$dbg" ]; then
f034e1cb 43 LD_LIBRARY_PATH=ltt/.libs gdb --args $LTTV_EXEC $ARGS $TRACEFILE
8bd9d9a7 44elif [ -n "$valgrind" ]; then
2a65ba6e 45 LD_LIBRARY_PATH=ltt/.libs valgrind --track-origins=yes --show-reachable=yes --leak-check=full --error-limit=no $LTTV_EXEC $ARGS $TRACEFILE
8bd9d9a7 46elif [ -n "$strace" ]; then
f034e1cb 47 LD_LIBRARY_PATH=ltt/.libs strace $LTTV_EXEC $ARGS $TRACEFILE
94e22cd1 48else
f034e1cb 49 LD_LIBRARY_PATH=ltt/.libs $LTTV_EXEC $ARGS $TRACEFILE
94e22cd1 50fi
This page took 0.02926 seconds and 4 git commands to generate.