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

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

Issue 298863006: Use lsb_release in install-build-deps.sh to determine linux distro. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 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')
OLDNEW
1 #!/bin/bash -e 1 #!/bin/bash -e
2 2
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 --no-prompt) do_default=1 56 --no-prompt) do_default=1
57 do_quietly="-qq --assume-yes" 57 do_quietly="-qq --assume-yes"
58 ;; 58 ;;
59 --quick-check) do_quick_check=1;; 59 --quick-check) do_quick_check=1;;
60 --unsupported) do_unsupported=1;; 60 --unsupported) do_unsupported=1;;
61 *) usage;; 61 *) usage;;
62 esac 62 esac
63 shift 63 shift
64 done 64 done
65 65
66 ubuntu_versions="12\.04|12\.10|13\.04|13\.10|14\.04" 66 # Check for lsb_release command in $PATH
67 ubuntu_codenames="precise|quantal|raring|saucy|trusty" 67 if ! which lsb_release > /dev/null; then
68 ubuntu_issue="Ubuntu ($ubuntu_versions|$ubuntu_codenames)" 68 echo "ERROR: lsb_release not found in \$PATH" >&2
69 # GCEL is an Ubuntu-derived VM image used on Google Compute Engine; /etc/issue 69 exit 1;
70 # doesn't contain a version number so just trust that the user knows what 70 fi
71 # they're doing.
72 gcel_issue="^GCEL"
73 71
72 lsb_release=$(lsb_release --codename --short)
73 ubuntu_codenames="(precise|quantal|raring|saucy|trusty)"
74 if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then 74 if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then
75 if ! egrep -q "($ubuntu_issue|$gcel_issue)" /etc/issue; then 75 if [[ ! $lsb_release =~ $ubuntu_codenames ]]; then
76 echo "ERROR: Only Ubuntu 12.04 (precise) through 14.04 (trusty) are"\ 76 echo "ERROR: Only Ubuntu 12.04 (precise) through 14.04 (trusty) are"\
77 "currently supported" >&2 77 "currently supported" >&2
78 exit 1 78 exit 1
79 fi 79 fi
80 80
81 if ! uname -m | egrep -q "i686|x86_64"; then 81 if ! uname -m | egrep -q "i686|x86_64"; then
82 echo "Only x86 architectures are currently supported" >&2 82 echo "Only x86 architectures are currently supported" >&2
83 exit 83 exit
84 fi 84 fi
85 fi 85 fi
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 echo "Including debugging symbols." 236 echo "Including debugging symbols."
237 else 237 else
238 echo "Skipping debugging symbols." 238 echo "Skipping debugging symbols."
239 dbg_list= 239 dbg_list=
240 fi 240 fi
241 241
242 # When cross building for arm on 64-bit systems the host binaries 242 # When cross building for arm on 64-bit systems the host binaries
243 # that are part of v8 need to be compiled with -m32 which means 243 # that are part of v8 need to be compiled with -m32 which means
244 # that basic multilib support is needed. 244 # that basic multilib support is needed.
245 if file /sbin/init | grep -q 'ELF 64-bit'; then 245 if file /sbin/init | grep -q 'ELF 64-bit'; then
246 # TODO(thestig): Use lsb_release rather than looking /etc/issue. 246 if [ "$lsb_release" = "trusty" ]; then
247 if ! egrep -q "trusty" /etc/issue; then
248 # gcc-multilib conflicts with the arm cross compiler in trusty but 247 # gcc-multilib conflicts with the arm cross compiler in trusty but
249 # g++-4.8-multilib gives us the 32-bit support that we need. 248 # g++-4.8-multilib gives us the 32-bit support that we need.
250 arm_list="$arm_list g++-4.8-multilib" 249 arm_list="$arm_list g++-4.8-multilib"
251 else 250 else
252 arm_list="$arm_list g++-multilib" 251 arm_list="$arm_list g++-multilib"
253 fi 252 fi
254 fi 253 fi
255 254
256 if test "$do_inst_arm" = "1" ; then 255 if test "$do_inst_arm" = "1" ; then
257 echo "Including ARM cross toolchain." 256 echo "Including ARM cross toolchain."
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 sed -e 's/[.]so[.][0-9].*/.so/' | 576 sed -e 's/[.]so[.][0-9].*/.so/' |
578 sort -u); do 577 sort -u); do
579 [ "x${i##*/}" = "xld-linux.so" ] && continue 578 [ "x${i##*/}" = "xld-linux.so" ] && continue
580 [ -r "$i" ] && continue 579 [ -r "$i" ] && continue
581 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | 580 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' |
582 sort -n | tail -n 1)" 581 sort -n | tail -n 1)"
583 [ -r "$i.$j" ] || continue 582 [ -r "$i.$j" ] || continue
584 sudo ln -s "${i##*/}.$j" "$i" 583 sudo ln -s "${i##*/}.$j" "$i"
585 done 584 done
586 fi 585 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