3 srcdir
='@abs_top_srcdir@'
4 builddir
='@abs_top_builddir@'
7 [ "$rundir" == "$0" ] || builddir
="$rundir"
9 # Absolutify the paths.
12 *) srcdir
=`cd "$srcdir" && pwd` ||
exit ;;
16 *) builddir
=`cd "$builddir" && pwd` ||
exit ;;
19 # Set all the variables to find the source and build trees.
20 SYSTEMTAP_TAPSET
="${srcdir}/tapset"
21 SYSTEMTAP_RUNTIME
="${srcdir}/runtime"
22 SYSTEMTAP_STAPRUN
="${builddir}/runtime/staprun/run-staprun"
23 export SYSTEMTAP_TAPSET SYSTEMTAP_RUNTIME SYSTEMTAP_STAPRUN
25 # If there were private elfutils libs built, use them.
26 if [ -d "$rundir/lib-elfutils" ]; then
27 lib_elfutils
="$rundir/lib-elfutils"
28 elfutils_path
="${lib_elfutils}:${lib_elfutils}/systemtap"
29 LD_LIBRARY_PATH
="${elfutils_path}${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
30 export LD_LIBRARY_PATH
33 if [ -z "$DEBUG_STAP" ]; then
34 exec "${builddir}/stap" ${1+"$@"}
36 exec gdb
--args "${builddir}/stap" ${1+"$@"}