diff options
-rwxr-xr-x | tools/valgrind/build-valgrind-for-chromium.sh | 59 | ||||
-rwxr-xr-x | tools/valgrind/chrome_tests.sh | 8 |
2 files changed, 49 insertions, 18 deletions
diff --git a/tools/valgrind/build-valgrind-for-chromium.sh b/tools/valgrind/build-valgrind-for-chromium.sh index a1fef40..823e0f7 100755 --- a/tools/valgrind/build-valgrind-for-chromium.sh +++ b/tools/valgrind/build-valgrind-for-chromium.sh @@ -1,8 +1,26 @@ #!/bin/sh # Script to build valgrind for use with chromium +SVNDATE='{2009-07-15}' +SHORTSVNDATE=20090715 +TSAN_SVN_REV='1096' + THISDIR=`dirname $0` THISDIR=`cd $THISDIR && /bin/pwd` + +case x"$1" in +x|x/*) ;; +*) + echo "Usage: sh build-valgrind-for-chromium.sh [prefix]" + echo "Prefix is optional, but if present, must be the absolute path to where" + echo "you want to install valgrind's bin, include, and lib directories." + echo "Prefix defaults to /usr/local/valgrind-$SHORTSVNDATE, where" + echo "$SHORTSVNDATE is the date used when retrieving valgrind from svn." + echo "Will use sudo to do the install if you don't own the parent of prefix." + exit 1 + ;; +esac + set -x set -e @@ -22,25 +40,30 @@ then fi fi +# Desired parent directory for valgrind's bin, include, etc. +PREFIX="${1:-/usr/local/valgrind-$SHORTSVNDATE}" +parent_of_prefix="`dirname $PREFIX`" +if test ! -d "$parent_of_prefix" +then + echo "Directory $parent_of_prefix does not exist" + exit 1 +fi + # Check out latest version that following patches known to apply against -rm -rf valgrind-20090715 -svn co -r '{2009-07-15}' svn://svn.valgrind.org/valgrind/trunk valgrind-20090715 +rm -rf valgrind-$SHORTSVNDATE +svn co -r $SVNDATE svn://svn.valgrind.org/valgrind/trunk valgrind-$SHORTSVNDATE -cd valgrind-20090715 +cd valgrind-$SHORTSVNDATE -# Just in case, make sure svn gets the right version of the external VEX repo, too -cd VEX -svn update -r '{2009-07-15}' -cd .. +# Make sure svn gets the right version of the external VEX repo, too +svn update -r $SVNDATE VEX/ # Work around bug https://bugs.kde.org/show_bug.cgi?id=162848 # "fork() not handled properly" -#wget -O fork.patch "https://bugs.kde.org/attachment.cgi?id=35510" patch -p0 < "$THISDIR"/fork.patch # Work around bug https://bugs.kde.org/show_bug.cgi?id=186796 # "long suppressions truncated" -#wget -O longlines.patch "https://bugs.kde.org/attachment.cgi?id=35174" patch -p0 < "$THISDIR"/longlines.patch # Work around bug http://bugs.kde.org/186790 @@ -49,7 +72,6 @@ patch -p0 < "$THISDIR"/leak.patch # Add feature bug https://bugs.kde.org/show_bug.cgi?id=201170 # "Want --show-possible option so I can ignore the bazillion possible leaks..." -#wget -O possible.patch https://bugs.kde.org/attachment.cgi?id=35559 patch -p0 < "$THISDIR"/possible.patch if [ "$INSTALL_TSAN" = "yes" ] @@ -57,7 +79,7 @@ then # Add ThreadSanitier to the installation. # ThreadSanitizer is an experimental dynamic data race detector. # See http://code.google.com/p/data-race-test/wiki/ThreadSanitizer - svn checkout -r 1096 http://data-race-test.googlecode.com/svn/trunk/tsan tsan + svn checkout -r $TSAN_SVN_REV http://data-race-test.googlecode.com/svn/trunk/tsan tsan mkdir tsan/{docs,tests} touch tsan/{docs,tests}/Makefile.am patch -p 0 < tsan/valgrind.patch @@ -65,7 +87,7 @@ then fi sh autogen.sh -./configure --prefix=/usr/local/valgrind-20090715 +./configure --prefix="$PREFIX" make -j4 if ./vg-in-place true @@ -78,9 +100,10 @@ fi test -d $THISDIR/override_ld && rm -rf $THISDIR/override_ld -sudo make install -cd /usr -test -f bin/valgrind && sudo mv bin/valgrind bin/valgrind.orig -sudo ln -sf /usr/local/valgrind-20090715/bin/valgrind bin -test -d include/valgrind && sudo mv include/valgrind include/valgrind.orig -sudo ln -sf /usr/local/valgrind-20090715/include/valgrind include +# Don't use sudo if we own the destination +if test -w "$parent_of_prefix" +then + make install +else + sudo make install +fi diff --git a/tools/valgrind/chrome_tests.sh b/tools/valgrind/chrome_tests.sh index ff37b70..fbf45e8 100755 --- a/tools/valgrind/chrome_tests.sh +++ b/tools/valgrind/chrome_tests.sh @@ -1,4 +1,12 @@ #!/bin/sh +# Select the valgrind built by build-valgrind-for-chromium.sh by default, +# but allow users to override this default without editing scripts and +# without specifying a commandline option +# SHORTSVNDATE should track value of same var in build-valgrind-for-chromium.sh +SHORTSVNDATE=20090715 +CHROME_VALGRIND_BIN="${CHROME_VALGRIND_BIN:-/usr/local/valgrind-$SHORTSVNDATE/bin}" +PATH="${CHROME_VALGRIND_BIN}:$PATH" + export THISDIR=`dirname $0` PYTHONPATH=$THISDIR/../../webkit/tools/layout_tests/:$THISDIR/../purify:$THISDIR/../python "$THISDIR/chrome_tests.py" "$@" |