summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-12-03 15:54:40 -0800
committerRoland McGrath <roland@redhat.com>2008-12-03 18:35:10 -0800
commit2f62657ce707b4011253d533c0423ed8d49a3e9e (patch)
tree59b2140ae77e138d9c11ef71ded066f48989d50d
parentaad1a79ccc20268ba399f0e025f203e968978350 (diff)
downloadsystemtap-steved-2f62657ce707b4011253d533c0423ed8d49a3e9e.tar.gz
systemtap-steved-2f62657ce707b4011253d533c0423ed8d49a3e9e.tar.xz
systemtap-steved-2f62657ce707b4011253d533c0423ed8d49a3e9e.zip
PR6925: generate script to run stap from build directory
-rw-r--r--ChangeLog5
-rwxr-xr-xconfigure5
-rw-r--r--configure.ac2
-rw-r--r--run-stap.in36
4 files changed, 48 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5bb07889..a6bdc72f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-12-03 Roland McGrath <roland@redhat.com>
+ PR6925
+ * run-stap.in: New file.
+ * configure.ac: Generate run-stap from it.
+ * configure: Regenerated.
+
PR7063
* buildrun.cxx (run_pass): Obey SYSTEMTAP_STAPRUN environment variable.
diff --git a/configure b/configure
index 6161eae8..8fe89282 100755
--- a/configure
+++ b/configure
@@ -7000,6 +7000,9 @@ ac_config_files="$ac_config_files Makefile doc/Makefile doc/SystemTap_Tapset_Ref
subdirs="$subdirs testsuite"
+ac_config_files="$ac_config_files run-stap"
+
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -7643,6 +7646,7 @@ do
"man/stapprobes.socket.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.socket.5" ;;
"man/stapprobes.tcp.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.tcp.5" ;;
"man/stapprobes.udp.5") CONFIG_FILES="$CONFIG_FILES man/stapprobes.udp.5" ;;
+ "run-stap") CONFIG_FILES="$CONFIG_FILES run-stap" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
@@ -8427,6 +8431,7 @@ echo "$as_me: error: cannot create directory $as_dir" >&2;}
done
done
;;
+ "run-stap":F) chmod +x run-stap ;;
esac
done # for ac_tag
diff --git a/configure.ac b/configure.ac
index 8670d9fe..7b413293 100644
--- a/configure.ac
+++ b/configure.ac
@@ -224,6 +224,8 @@ AC_CONFIG_HEADERS([config.h:config.in])
AC_CONFIG_FILES(Makefile doc/Makefile doc/SystemTap_Tapset_Reference/Makefile stap.1 stapprobes.5 stapfuncs.5 stapvars.5 stapex.5 staprun.8 stap-server.8 man/stapprobes.iosched.5 man/stapprobes.netdev.5 man/stapprobes.nfs.5 man/stapprobes.nfsd.5 man/stapprobes.pagefault.5 man/stapprobes.process.5 man/stapprobes.rpc.5 man/stapprobes.scsi.5 man/stapprobes.signal.5 man/stapprobes.socket.5 man/stapprobes.tcp.5 man/stapprobes.udp.5)
AC_CONFIG_SUBDIRS(testsuite)
+AC_CONFIG_FILES([run-stap], [chmod +x run-stap])
+
AC_OUTPUT
if test $build_elfutils = yes; then
diff --git a/run-stap.in b/run-stap.in
new file mode 100644
index 00000000..dfb53ab2
--- /dev/null
+++ b/run-stap.in
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+srcdir='@abs_top_srcdir@'
+builddir='@abs_top_builddir@'
+
+rundir="${0%/*}"
+[ "$rundir" == "$0" ] || builddir="$rundir"
+
+# Absolutify the paths.
+case "$srcdir" in
+/*) ;;
+*) srcdir=`cd "$srcdir" && pwd` || exit ;;
+esac
+case "$builddir" in
+/*) ;;
+*) builddir=`cd "$builddir" && pwd` || exit ;;
+esac
+
+# Set all the variables to find the source and build trees.
+SYSTEMTAP_TAPSET="${srcdir}/tapset"
+SYSTEMTAP_RUNTIME="${srcdir}/runtime"
+SYSTEMTAP_STAPIO="${builddir}/stapio"
+SYSTEMTAP_STAPRUN="sudo 'SYSTEMTAP_STAPIO=$SYSTEMTAP_STAPIO' \
+ 'SYSTEMTAP_STAPRUN=${builddir}/staprun' \
+ ${builddir}/staprun"
+export SYSTEMTAP_TAPSET SYSTEMTAP_RUNTIME SYSTEMTAP_STAPRUN SYSTEMTAP_STAPIO
+
+# If there were private elfutils libs built, use them.
+if [ -d "$rundir/lib-elfutils" ]; then
+ lib_elfutils="$rundir/lib-elfutils"
+ elfutils_path="${lib_elfutils}:${lib_elfutils}/systemtap"
+ LD_LIBRARY_PATH="${elfutils_path}${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+ export LD_LIBRARY_PATH
+fi
+
+exec "${builddir}/stap" ${1+"$@"}