From 5d8b79cff5a9a3939876330046c1d75cd3ca4e55 Mon Sep 17 00:00:00 2001 From: Evan Huus Date: Fri, 16 Aug 2013 01:52:51 +0000 Subject: 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 --- tools/fuzz-test.sh | 2 +- tools/valgrind-wireshark.sh | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/fuzz-test.sh b/tools/fuzz-test.sh index bc876d9bdf..c471777770 100755 --- a/tools/fuzz-test.sh +++ b/tools/fuzz-test.sh @@ -73,7 +73,7 @@ shift $(($OPTIND - 1)) ### usually you won't have to change anything below this line ### if [ $VALGRIND -eq 1 ]; then - RUNNER="$BIN_DIR/tools/valgrind-wireshark.sh" + RUNNER="`dirname $0`/valgrind-wireshark.sh" declare -a RUNNER_ARGS=("${CONFIG_PROFILE}${TWO_PASS}" "${CONFIG_PROFILE}${TWO_PASS}-T") else # Not using valgrind, use regular tshark. 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 -- cgit v1.2.3