Remove un-needed Valgrind binaries and strip some of the remaining.
This saves a lot of space!
Review URL: http://codereview.chromium.org/536082

git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/valgrind@36408 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
diff --git a/scripts/build-valgrind-for-chromium.sh b/scripts/build-valgrind-for-chromium.sh
index e706539..7bef332 100755
--- a/scripts/build-valgrind-for-chromium.sh
+++ b/scripts/build-valgrind-for-chromium.sh
@@ -157,6 +157,26 @@
 
   maybe_build_gdb_for_mac "$OUTPUT_DIR"
 
+  # Delete un-needed stuff from the $OUTPUT_DIR
+  # TODO(timurrrr): probably, we should just don't build the unused tools
+  cd $OUTPUT_DIR
+  rm -rf include
+  rm -rf lib/pkgconfig lib/*.a
+  rm bin/*cg_* bin/callgrind*
+  cd lib/valgrind
+  rm -rf *.a \
+    *drd* \
+    *exp-* \
+    *none* \
+    *lackey* \
+    *massif* \
+    *helgrind* \
+    *callgrind* \
+    *cachegrind*
+
+  # Strip all binaries except "vgpreload" (we do need their symbols).
+  strip `ls -1 | grep "tsan\|memcheck" | grep -v "dSYM" | grep -v "vgpreload"`
+
   # We're done
   cd $THISDIR
   # }}}