Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1224)

Unified Diff: build/install-build-deps.sh

Issue 115140: Add script to check out chromium source tree and invoke install-build-deps.sh... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/bootstrap-linux.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/install-build-deps.sh
===================================================================
--- build/install-build-deps.sh (revision 15573)
+++ build/install-build-deps.sh (working copy)
@@ -4,6 +4,59 @@
# See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions
# and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit
+install_gold() {
+ # Gold is optional; it's a faster replacement for ld,
+ # and makes life on 2GB machines much more pleasant.
+
+ BINUTILS=binutils-2.19.1
+ BINUTILS_URL=http://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.bz2
+ BINUTILS_SHA1=88c91e36cde93433e4c4c2b2e3417777aad84526
+
+ test -f $BINUTILS.tar.bz2 || wget $BINUTILS_URL
+ if `sha1sum $BINUTILS.tar.bz2` != $BINUTILS_SHA1
+ then
+ echo Bad sha1sum for $BINUTILS.tar.bz2
+ exit 1
+ fi
+ cat > binutils-fix.patch <<__EOF__
+--- binutils-2.19.1/gold/reduced_debug_output.h.orig 2009-05-10 14:44:52.000000000 -0700
++++ binutils-2.19.1/gold/reduced_debug_output.h 2009-05-10 14:46:51.000000000 -0700
+@@ -64,7 +64,7 @@
+ void
+ failed(std::string reason)
+ {
+- gold_warning(reason.c_str());
++ gold_warning("%s", reason.c_str());
+ failed_ = true;
+ }
+
+@@ -110,7 +110,7 @@
+ void
+ failed(std::string reason)
+ {
+- gold_warning(reason.c_str());
++ gold_warning("%s", reason.c_str());
+ this->failed_ = true;
+ }
+
+__EOF__
+
+ tar -xjvf $BINUTILS.tar.bz2
+ cd $BINUTILS
+ patch -p1 < ../binutils-fix.patch
+ ./configure --prefix=/usr/local/gold --enable-gold
+ make -j3
+ sudo make install
+
+ # Still need to figure out graceful way of pointing gyp to use
+ # /usr/local/gold/bin/ld without requiring him to set environment
+ # variables. That will go into bootstrap-linux.sh when it's ready.
+ echo "Installing gold as /usr/bin/ld."
+ echo "To uninstall, do 'cd /usr/bin; sudo rm ld; sudo mv ld.orig ld'"
+ test -f /usr/bin/ld && sudo mv /usr/bin/ld /usr/bin/ld.orig
+ sudo ln -s /usr/local/gold/bin/ld /usr/bin/ld
+}
+
if ! egrep -q "Ubuntu 8.04|Ubuntu 8.10|Ubuntu 9.04" /etc/issue; then
echo "Only Ubuntu 8.04, 8.10, and 9.04 are currently supported" >&2
exit 1
@@ -82,7 +135,8 @@
done
}
-echo "This script installs all required libraries for building Chromium."
+echo "This script installs all tools and libraries needed to build Chromium."
+echo ""
echo "For most of the libraries, it can also install debugging symbols, which"
echo "will allow you to debug code in the system libraries. Most developers"
echo "won't need these symbols."
@@ -111,6 +165,24 @@
echo "Installing missing packages..."
sudo apt-get install ${new_list}
+# Some operating systems already ship gold
+# (on Debian, you can probably do "apt-get install binutils-gold" to get it)
+# Ubuntu toyed with that, but it doesn't seem to be in any version I've tried.
+# So just install from source if it isn't the default linker.
+
+case `ld --version` in
+*gold*) ;;
+* )
+ # FIXME: avoid installing as /usr/bin/ld
+ echo -n "Install gold from binutils-2.19.1 as ld? It's 5x faster (y/N) "
+ if yes_no 1; then
+ echo "Building binutils."
+ install_gold || exit 99
+ else
+ echo "Not installing gold."
+ fi
+esac
+
# Install 32bit backwards compatibility support for 64bit systems
if [ "$(uname -m)" = x86_64 ]; then
echo "Installing 32bit libraries that are not already provided by the system"
« no previous file with comments | « build/bootstrap-linux.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698