Created
April 2, 2012 21:03
-
-
Save ryan-blunden/2287179 to your computer and use it in GitHub Desktop.
Valgrind install script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Valgrind install - inspired by http://c.learncodethehardway.org/book/learn-c-the-hard-waych5.html | |
# Ryan Blunden, 2012 | |
# Update as Valgrind is updated | |
version="3.7.0" | |
verified_checksum="a855fda56edf05614f099dca316d1775" | |
# 1) Change into tmp | |
cwd=`pwd` | |
cd /tmp | |
# 2) Download it to | |
curl -0 "http://valgrind.org/downloads/valgrind-$version.tar.bz2" -o "valgrind-$version.tar.bz2" | |
# Check md5sum to make sure it matches the one on the site | |
file_checksum=`md5 "./valgrind-$version.tar.bz2" | awk '{ print $4 }'` | |
if [ $verified_checksum != $file_checksum ]; then | |
echo "md5 checksum mismatch, aborting" | |
exit | |
fi | |
# 2) Unpack | |
tar -xjvf "./valgrind-$version.tar.bz2" | |
# cd into newly created directory | |
cd "./valgrind-$version" | |
# 3) Configure | |
./configure | |
# 4) make | |
make | |
# 5) install it | |
sudo make install | |
# 6) Finish | |
cd ../ | |
rm -fr "./valgrind-$version" | |
unlink "./valgrind-$version.tar.bz2" | |
cd $cwd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment