bart | 004dc0b | 2008-04-27 07:42:52 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
sewardj | 79df8ee | 2008-11-05 12:05:14 +0000 | [diff] [blame] | 3 | # Figure out an absolute pathname to this file, based on |
| 4 | # $0 (the name of the file) and $PWD. |
| 5 | |
| 6 | dollarzero=$0 |
bart | d7899f7 | 2011-02-03 17:49:07 +0000 | [diff] [blame] | 7 | if [ -h "${dollarzero}" ]; then |
| 8 | dollarzero=`readlink "${dollarzero}"` |
| 9 | fi |
sewardj | 79df8ee | 2008-11-05 12:05:14 +0000 | [diff] [blame] | 10 | |
sewardj | 8fff3ec | 2008-11-08 15:11:03 +0000 | [diff] [blame] | 11 | if [ "${dollarzero#/}" = "${dollarzero}" ]; |
sewardj | 79df8ee | 2008-11-05 12:05:14 +0000 | [diff] [blame] | 12 | then |
| 13 | # Relative name |
| 14 | scriptname=$PWD/$dollarzero; |
| 15 | else |
| 16 | # Absolute name |
| 17 | scriptname=$dollarzero; |
bart | 5b16147 | 2008-11-04 17:49:58 +0000 | [diff] [blame] | 18 | fi |
njn | 7bbc8d6 | 2007-02-19 04:09:24 +0000 | [diff] [blame] | 19 | |
sewardj | 79df8ee | 2008-11-05 12:05:14 +0000 | [diff] [blame] | 20 | # echo "Name of this script: " $scriptname |
| 21 | |
| 22 | vgbasedir=`dirname $scriptname` |
| 23 | |
| 24 | # echo "VG base directory: " $vgbasedir |
| 25 | |
| 26 | |
njn | a7a16eb | 2007-02-19 04:16:09 +0000 | [diff] [blame] | 27 | # We set both VALGRIND_LIB and VALGRIND_LIB_INNER to handle normal and |
| 28 | # 'inner' builds. |
sewardj | 79df8ee | 2008-11-05 12:05:14 +0000 | [diff] [blame] | 29 | VALGRIND_LIB="$vgbasedir/.in_place" \ |
| 30 | VALGRIND_LIB_INNER="$vgbasedir/.in_place" \ |
| 31 | "$vgbasedir/coregrind/valgrind" "$@" |
njn | 7bbc8d6 | 2007-02-19 04:09:24 +0000 | [diff] [blame] | 32 | |