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

Side by Side Diff: build/install-build-deps.sh

Issue 151113: Don't screw up /usr/bin/ld if you can't write to current dir as root.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Name: svn:eol-style
+ LF
OLDNEW
1 #!/bin/bash -e 1 #!/bin/bash -e
2 2
3 # Script to install everything needed to build chromium (well, ideally, anyway) 3 # Script to install everything needed to build chromium (well, ideally, anyway)
4 # See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions 4 # See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions
5 # and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit 5 # and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit
6 6
7 install_gold() { 7 install_gold() {
8 # Gold is optional; it's a faster replacement for ld, 8 # Gold is optional; it's a faster replacement for ld,
9 # and makes life on 2GB machines much more pleasant. 9 # and makes life on 2GB machines much more pleasant.
10 10
11 # First make sure root can access this directory, as that's tripped up some fo lks.
12 if sudo touch xyz.$$
13 then
14 sudo rm xyz.$$
15 else
16 echo root cannot write to the current directory, not installing gold
17 return
18 fi
19
11 BINUTILS=binutils-2.19.1 20 BINUTILS=binutils-2.19.1
12 BINUTILS_URL=http://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.bz2 21 BINUTILS_URL=http://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.bz2
13 BINUTILS_SHA1=88c91e36cde93433e4c4c2b2e3417777aad84526 22 BINUTILS_SHA1=88c91e36cde93433e4c4c2b2e3417777aad84526
14 23
15 test -f $BINUTILS.tar.bz2 || wget $BINUTILS_URL 24 test -f $BINUTILS.tar.bz2 || wget $BINUTILS_URL
16 if `sha1sum $BINUTILS.tar.bz2` != $BINUTILS_SHA1 25 if `sha1sum $BINUTILS.tar.bz2` != $BINUTILS_SHA1
17 then 26 then
18 echo Bad sha1sum for $BINUTILS.tar.bz2 27 echo Bad sha1sum for $BINUTILS.tar.bz2
19 exit 1 28 exit 1
20 fi 29 fi
(...skipping 18 matching lines...) Expand all
39 this->failed_ = true; 48 this->failed_ = true;
40 } 49 }
41 50
42 __EOF__ 51 __EOF__
43 52
44 tar -xjvf $BINUTILS.tar.bz2 53 tar -xjvf $BINUTILS.tar.bz2
45 cd $BINUTILS 54 cd $BINUTILS
46 patch -p1 < ../binutils-fix.patch 55 patch -p1 < ../binutils-fix.patch
47 ./configure --prefix=/usr/local/gold --enable-gold 56 ./configure --prefix=/usr/local/gold --enable-gold
48 make -j3 57 make -j3
49 sudo make install 58 if sudo make install
50 59 then
51 # Still need to figure out graceful way of pointing gyp to use 60 # Still need to figure out graceful way of pointing gyp to use
52 # /usr/local/gold/bin/ld without requiring him to set environment 61 # /usr/local/gold/bin/ld without requiring him to set environment
53 # variables. That will go into bootstrap-linux.sh when it's ready. 62 # variables. That will go into bootstrap-linux.sh when it's ready.
54 echo "Installing gold as /usr/bin/ld." 63 echo "Installing gold as /usr/bin/ld."
55 echo "To uninstall, do 'cd /usr/bin; sudo rm ld; sudo mv ld.orig ld'" 64 echo "To uninstall, do 'cd /usr/bin; sudo rm ld; sudo mv ld.orig ld'"
56 test -f /usr/bin/ld && sudo mv /usr/bin/ld /usr/bin/ld.orig 65 test -f /usr/bin/ld && sudo mv /usr/bin/ld /usr/bin/ld.orig
57 sudo ln -fs /usr/local/gold/bin/ld /usr/bin/ld.gold 66 sudo ln -fs /usr/local/gold/bin/ld /usr/bin/ld.gold
58 sudo ln -fs /usr/bin/ld.gold /usr/bin/ld 67 sudo ln -fs /usr/bin/ld.gold /usr/bin/ld
68 else
69 make install failed, not installing gold
Paweł Hajdan Jr. 2009/06/30 23:36:12 Shouldn't that be echo?
70 fi
59 } 71 }
60 72
61 if ! egrep -q "Ubuntu 8.04|Ubuntu 8.10|Ubuntu 9.04" /etc/issue; then 73 if ! egrep -q "Ubuntu 8.04|Ubuntu 8.10|Ubuntu 9.04" /etc/issue; then
62 echo "Only Ubuntu 8.04, 8.10, and 9.04 are currently supported" >&2 74 echo "Only Ubuntu 8.04, 8.10, and 9.04 are currently supported" >&2
63 exit 1 75 exit 1
64 fi 76 fi
65 77
66 if ! uname -m | egrep -q "i686|x86_64"; then 78 if ! uname -m | egrep -q "i686|x86_64"; then
67 echo "Only x86 architectures are currently supported" >&2 79 echo "Only x86 architectures are currently supported" >&2
68 exit 80 exit
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 touch "${tmp}/status" 221 touch "${tmp}/status"
210 222
211 [ -r /etc/apt/apt.conf ] && cp /etc/apt/apt.conf "${tmp}/apt/" 223 [ -r /etc/apt/apt.conf ] && cp /etc/apt/apt.conf "${tmp}/apt/"
212 cat >>"${tmp}/apt/apt.conf" <<-EOF 224 cat >>"${tmp}/apt/apt.conf" <<-EOF
213 Apt::Architecture "i386"; 225 Apt::Architecture "i386";
214 Dir::Cache "${tmp}/cache"; 226 Dir::Cache "${tmp}/cache";
215 Dir::Cache::Archives "${tmp}/"; 227 Dir::Cache::Archives "${tmp}/";
216 Dir::State::Lists "${tmp}/apt/lists/"; 228 Dir::State::Lists "${tmp}/apt/lists/";
217 Dir::State::status "${tmp}/status"; 229 Dir::State::status "${tmp}/status";
218 EOF 230 EOF
219 231
220 # Download 32bit packages 232 # Download 32bit packages
221 echo "Computing list of available 32bit packages..." 233 echo "Computing list of available 32bit packages..."
222 apt-get -c="${tmp}/apt/apt.conf" update 234 apt-get -c="${tmp}/apt/apt.conf" update
223 235
224 echo "Downloading available 32bit packages..." 236 echo "Downloading available 32bit packages..."
225 apt-get -c="${tmp}/apt/apt.conf" \ 237 apt-get -c="${tmp}/apt/apt.conf" \
226 --yes --download-only --force-yes --reinstall install \ 238 --yes --download-only --force-yes --reinstall install \
227 ${lib_list} ${dbg_list} 239 ${lib_list} ${dbg_list}
228 240
229 # Open packages, remove everything that is not a library, move the 241 # Open packages, remove everything that is not a library, move the
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 sed -e 's/[.]so[.][0-9].*/.so/' | 326 sed -e 's/[.]so[.][0-9].*/.so/' |
315 sort -u); do 327 sort -u); do
316 [ "x${i##*/}" = "xld-linux.so" ] && continue 328 [ "x${i##*/}" = "xld-linux.so" ] && continue
317 [ -r "$i" ] && continue 329 [ -r "$i" ] && continue
318 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | 330 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' |
319 sort -n | tail -n 1)" 331 sort -n | tail -n 1)"
320 [ -r "$i.$j" ] || continue 332 [ -r "$i.$j" ] || continue
321 sudo ln -s "${i##*/}.$j" "$i" 333 sudo ln -s "${i##*/}.$j" "$i"
322 done 334 done
323 fi 335 fi
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698