1#!/bin/sh
2
3# Figure out an absolute pathname to this file, based on
4# $0 (the name of the file) and $PWD.
5
6dollarzero=$0
7if [ -h "${dollarzero}" ]; then
8   dollarzero=`readlink "${dollarzero}"`
9fi
10
11if [ "${dollarzero#/}" = "${dollarzero}" ];
12then
13   # Relative name
14   scriptname=$PWD/$dollarzero;
15else
16   # Absolute name
17   scriptname=$dollarzero;
18fi
19
20# echo "Name of this script: " $scriptname
21
22vgbasedir=`dirname $scriptname`
23
24# echo "VG base directory:   " $vgbasedir
25
26
27# We set both VALGRIND_LIB and VALGRIND_LIB_INNER to handle normal and
28# 'inner' builds.
29VALGRIND_LIB="$vgbasedir/.in_place" \
30    VALGRIND_LIB_INNER="$vgbasedir/.in_place" \
31    "$vgbasedir/coregrind/valgrind" "$@"
32
33