diff options
author | Evan Huus <eapache@gmail.com> | 2013-08-16 01:52:51 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-08-16 01:52:51 +0000 |
commit | 5d8b79cff5a9a3939876330046c1d75cd3ca4e55 (patch) | |
tree | 948ba04f9a69612a479fd69d2725d6c202ee649a /tools/valgrind-wireshark.sh | |
parent | 6538787c92075f207749da7a3c8a566ec703d0ea (diff) |
Try to use smarter path resolution and detection in order to work in
environments that are not the build tree (namely the fuzz-bot, but this might
make normal out-of-tree builds easier too).
svn path=/trunk/; revision=51387
Diffstat (limited to 'tools/valgrind-wireshark.sh')
-rwxr-xr-x | tools/valgrind-wireshark.sh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/valgrind-wireshark.sh b/tools/valgrind-wireshark.sh index bfd88843ce..84f823e5a6 100755 --- a/tools/valgrind-wireshark.sh +++ b/tools/valgrind-wireshark.sh @@ -89,4 +89,17 @@ export WIRESHARK_DEBUG_SE_NO_CHUNKS= export WIRESHARK_DEBUG_WMEM_OVERRIDE=simple export G_SLICE=always-malloc # or debug-blocks -./libtool --mode=execute valgrind $TOOL $VERBOSE $LEAK_CHECK $REACHABLE $TRACK_ORIGINS $BIN_DIR/$COMMAND $COMMAND_ARGS $PCAP $COMMAND_ARGS2 > /dev/null +COMMAND="$BIN_DIR/$COMMAND" + +if file $COMMAND | grep -q "ASCII text"; then + if [ -x "`dirname $0`/../libtool" ]; then + LIBTOOL="`dirname $0`/../libtool" + else + LIBTOOL="libtool" + fi + LIBTOOL="$LIBTOOL --mode=execute" +else + LIBTOOL="" +fi + +$LIBTOOL valgrind $TOOL $VERBOSE $LEAK_CHECK $REACHABLE $TRACK_ORIGINS $COMMAND $COMMAND_ARGS $PCAP $COMMAND_ARGS2 > /dev/null |