OLD | NEW |
1 #!/bin/bash -e | 1 #!/bin/bash -e |
2 | 2 |
3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Script to install everything needed to build chromium (well, ideally, anyway) | 7 # Script to install everything needed to build chromium (well, ideally, anyway) |
8 # See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions | 8 # See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions |
9 # and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit | 9 # and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit |
10 | 10 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 echo "To uninstall, do 'cd /usr/bin; sudo rm ld; sudo mv ld.orig ld'" | 126 echo "To uninstall, do 'cd /usr/bin; sudo rm ld; sudo mv ld.orig ld'" |
127 test -f /usr/bin/ld && sudo mv /usr/bin/ld /usr/bin/ld.orig | 127 test -f /usr/bin/ld && sudo mv /usr/bin/ld /usr/bin/ld.orig |
128 sudo strip /usr/local/gold/bin/ld | 128 sudo strip /usr/local/gold/bin/ld |
129 sudo ln -fs /usr/local/gold/bin/ld /usr/bin/ld.gold | 129 sudo ln -fs /usr/local/gold/bin/ld /usr/bin/ld.gold |
130 sudo ln -fs /usr/bin/ld.gold /usr/bin/ld | 130 sudo ln -fs /usr/bin/ld.gold /usr/bin/ld |
131 else | 131 else |
132 echo "make install failed, not installing gold" | 132 echo "make install failed, not installing gold" |
133 fi | 133 fi |
134 } | 134 } |
135 | 135 |
136 if ! egrep -q "Ubuntu 8.04|Ubuntu 8.10|Ubuntu 9.04" /etc/issue; then | 136 if ! egrep -q 'Ubuntu (8\.04|8\.10|9\.04|9\.10)' /etc/issue; then |
137 echo "Only Ubuntu 8.04, 8.10, and 9.04 are currently supported" >&2 | 137 echo "Only Ubuntu 8.04, 8.10, 9.04, and 9.10 are currently supported" >&2 |
138 exit 1 | 138 exit 1 |
139 fi | 139 fi |
140 | 140 |
141 if ! uname -m | egrep -q "i686|x86_64"; then | 141 if ! uname -m | egrep -q "i686|x86_64"; then |
142 echo "Only x86 architectures are currently supported" >&2 | 142 echo "Only x86 architectures are currently supported" >&2 |
143 exit | 143 exit |
144 fi | 144 fi |
145 | 145 |
146 if [ "x$(id -u)" != x0 ]; then | 146 if [ "x$(id -u)" != x0 ]; then |
147 echo "Running as non-root user." | 147 echo "Running as non-root user." |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 fi | 273 fi |
274 | 274 |
275 # Some operating systems already ship gold | 275 # Some operating systems already ship gold |
276 # (on Debian, you can probably do "apt-get install binutils-gold" to get it), | 276 # (on Debian, you can probably do "apt-get install binutils-gold" to get it), |
277 # but though Ubuntu toyed with shipping it, they haven't yet. | 277 # but though Ubuntu toyed with shipping it, they haven't yet. |
278 # So just install from source if it isn't the default linker. | 278 # So just install from source if it isn't the default linker. |
279 | 279 |
280 case `ld --version` in | 280 case `ld --version` in |
281 *gold*) ;; | 281 *gold*) ;; |
282 * ) | 282 * ) |
283 # FIXME: avoid installing as /usr/bin/ld | |
284 echo "Gold is a new linker that links Chrome 5x faster than ld." | 283 echo "Gold is a new linker that links Chrome 5x faster than ld." |
285 echo "Don't use it if you need to link other apps (e.g. valgrind, wine)" | 284 echo "Don't use it if you need to link other apps (e.g. valgrind, wine)" |
286 echo -n "REPLACE SYSTEM LINKER ld with gold and back up ld as ld.orig? (y/N) " | 285 echo -n "REPLACE SYSTEM LINKER ld with gold and back up ld? (y/N) " |
287 if yes_no 1; then | 286 if yes_no 1; then |
288 echo "Building binutils." | 287 # If the system provides gold, just install it. |
289 install_gold || exit 99 | 288 if apt-cache show binutils-gold >/dev/null; then |
| 289 echo "Installing binutils-gold. Backing up ld as ld.single." |
| 290 sudo apt-get install binutils-gold |
| 291 else |
| 292 # FIXME: avoid installing as /usr/bin/ld |
| 293 echo "Building binutils. Backing up ld as ld.orig." |
| 294 install_gold || exit 99 |
| 295 fi |
290 else | 296 else |
291 echo "Not installing gold." | 297 echo "Not installing gold." |
292 fi | 298 fi |
293 esac | 299 esac |
294 | 300 |
295 # Install 32bit backwards compatibility support for 64bit systems | 301 # Install 32bit backwards compatibility support for 64bit systems |
296 if [ "$(uname -m)" = "x86_64" ]; then | 302 if [ "$(uname -m)" = "x86_64" ]; then |
297 echo "Installing 32bit libraries that are not already provided by the system" | 303 echo "Installing 32bit libraries that are not already provided by the system" |
298 echo | 304 echo |
299 echo "While we only need to install a relatively small number of library" | 305 echo "While we only need to install a relatively small number of library" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 sed -e 's/[.]so[.][0-9].*/.so/' | | 426 sed -e 's/[.]so[.][0-9].*/.so/' | |
421 sort -u); do | 427 sort -u); do |
422 [ "x${i##*/}" = "xld-linux.so" ] && continue | 428 [ "x${i##*/}" = "xld-linux.so" ] && continue |
423 [ -r "$i" ] && continue | 429 [ -r "$i" ] && continue |
424 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | | 430 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | |
425 sort -n | tail -n 1)" | 431 sort -n | tail -n 1)" |
426 [ -r "$i.$j" ] || continue | 432 [ -r "$i.$j" ] || continue |
427 sudo ln -s "${i##*/}.$j" "$i" | 433 sudo ln -s "${i##*/}.$j" "$i" |
428 done | 434 done |
429 fi | 435 fi |
OLD | NEW |