1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#! /bin/sh
PATH="${PATH}:$(dirname $0):."
# Perl scripts pass through, otherwise run the program under valgrind
# conditionally
if [ "${1##*.}" != "pl" ]; then
if [ -n "${VALGRIND}" ]; then
valgrind="${VALGRIND+valgrind --log-file=VALGRIND-$(basename $1).log}"
if [ -n "$VALGRIND_OPTIONS" ]; then
valgrind="${valgrind} ${VALGRIND_OPTIONS}"
fi
if [ -n "$LIBTOOL" ]; then
valgrind="${LIBTOOL} --mode=execute $valgrind"
fi
$valgrind "$@"
else
"$@"
fi
else
"$@"
fi
rc=$?
exit $rc
|