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

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

Issue 740963002: Fix g++-multilib conflict between install-build-deps scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoid unnecessary --add-architecture Created 6 years 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
« no previous file with comments | « no previous file | build/install-build-deps-android.sh » ('j') | 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
11 usage() { 11 usage() {
12 echo "Usage: $0 [--options]" 12 echo "Usage: $0 [--options]"
13 echo "Options:" 13 echo "Options:"
14 echo "--[no-]syms: enable or disable installation of debugging symbols" 14 echo "--[no-]syms: enable or disable installation of debugging symbols"
15 echo "--lib32: enable installation of 32-bit libraries, e.g. for V8 snapshot"
15 echo "--[no-]arm: enable or disable installation of arm cross toolchain" 16 echo "--[no-]arm: enable or disable installation of arm cross toolchain"
16 echo "--[no-]chromeos-fonts: enable or disable installation of Chrome OS"\ 17 echo "--[no-]chromeos-fonts: enable or disable installation of Chrome OS"\
17 "fonts" 18 "fonts"
18 echo "--[no-]nacl: enable or disable installation of prerequisites for"\ 19 echo "--[no-]nacl: enable or disable installation of prerequisites for"\
19 "building standalone NaCl and all its toolchains" 20 "building standalone NaCl and all its toolchains"
20 echo "--no-prompt: silently select standard options/defaults" 21 echo "--no-prompt: silently select standard options/defaults"
21 echo "--quick-check: quickly try to determine if dependencies are installed" 22 echo "--quick-check: quickly try to determine if dependencies are installed"
22 echo " (this avoids interactive prompts and sudo commands," 23 echo " (this avoids interactive prompts and sudo commands,"
23 echo " so might not be 100% accurate)" 24 echo " so might not be 100% accurate)"
24 echo "--unsupported: attempt installation even on unsupported systems" 25 echo "--unsupported: attempt installation even on unsupported systems"
(...skipping 12 matching lines...) Expand all
37 # mode. Developers who don't want stuff they don't need installed on their 38 # mode. Developers who don't want stuff they don't need installed on their
38 # own workstations can pass --no-arm --no-nacl when running the script. 39 # own workstations can pass --no-arm --no-nacl when running the script.
39 do_inst_arm=1 40 do_inst_arm=1
40 do_inst_nacl=1 41 do_inst_nacl=1
41 42
42 while test "$1" != "" 43 while test "$1" != ""
43 do 44 do
44 case "$1" in 45 case "$1" in
45 --syms) do_inst_syms=1;; 46 --syms) do_inst_syms=1;;
46 --no-syms) do_inst_syms=0;; 47 --no-syms) do_inst_syms=0;;
47 # TODO(phajdan.jr): Remove the lib32 flags when nothing else refers to them.
48 --lib32) do_inst_lib32=1;; 48 --lib32) do_inst_lib32=1;;
49 --no-lib32) do_inst_lib32=0;;
50 --arm) do_inst_arm=1;; 49 --arm) do_inst_arm=1;;
51 --no-arm) do_inst_arm=0;; 50 --no-arm) do_inst_arm=0;;
52 --chromeos-fonts) do_inst_chromeos_fonts=1;; 51 --chromeos-fonts) do_inst_chromeos_fonts=1;;
53 --no-chromeos-fonts) do_inst_chromeos_fonts=0;; 52 --no-chromeos-fonts) do_inst_chromeos_fonts=0;;
54 --nacl) do_inst_nacl=1;; 53 --nacl) do_inst_nacl=1;;
55 --no-nacl) do_inst_nacl=0;; 54 --no-nacl) do_inst_nacl=0;;
56 --no-prompt) do_default=1 55 --no-prompt) do_default=1
57 do_quietly="-qq --assume-yes" 56 do_quietly="-qq --assume-yes"
58 ;; 57 ;;
59 --quick-check) do_quick_check=1;; 58 --quick-check) do_quick_check=1;;
60 --unsupported) do_unsupported=1;; 59 --unsupported) do_unsupported=1;;
61 *) usage;; 60 *) usage;;
62 esac 61 esac
63 shift 62 shift
64 done 63 done
65 64
65 if test "$do_inst_arm" = "1"; then
66 do_inst_lib32=1
67 fi
68
66 # Check for lsb_release command in $PATH 69 # Check for lsb_release command in $PATH
67 if ! which lsb_release > /dev/null; then 70 if ! which lsb_release > /dev/null; then
68 echo "ERROR: lsb_release not found in \$PATH" >&2 71 echo "ERROR: lsb_release not found in \$PATH" >&2
69 exit 1; 72 exit 1;
70 fi 73 fi
71 74
72 lsb_release=$(lsb_release --codename --short) 75 lsb_release=$(lsb_release --codename --short)
73 ubuntu_codenames="(precise|quantal|raring|saucy|trusty)" 76 ubuntu_codenames="(precise|quantal|raring|saucy|trusty)"
74 if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then 77 if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then
75 if [[ ! $lsb_release =~ $ubuntu_codenames ]]; then 78 if [[ ! $lsb_release =~ $ubuntu_codenames ]]; then
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 133
131 # Debugging symbols for all of the run-time libraries 134 # Debugging symbols for all of the run-time libraries
132 dbg_list="libatk1.0-dbg libc6-dbg libcairo2-dbg libfontconfig1-dbg 135 dbg_list="libatk1.0-dbg libc6-dbg libcairo2-dbg libfontconfig1-dbg
133 libglib2.0-0-dbg libgtk2.0-0-dbg libpango1.0-0-dbg libpcre3-dbg 136 libglib2.0-0-dbg libgtk2.0-0-dbg libpango1.0-0-dbg libpcre3-dbg
134 libpixman-1-0-dbg libsqlite3-0-dbg libx11-6-dbg libxau6-dbg 137 libpixman-1-0-dbg libsqlite3-0-dbg libx11-6-dbg libxau6-dbg
135 libxcb1-dbg libxcomposite1-dbg libxcursor1-dbg libxdamage1-dbg 138 libxcb1-dbg libxcomposite1-dbg libxcursor1-dbg libxdamage1-dbg
136 libxdmcp6-dbg libxext6-dbg libxfixes3-dbg libxi6-dbg libxinerama1-dbg 139 libxdmcp6-dbg libxext6-dbg libxfixes3-dbg libxi6-dbg libxinerama1-dbg
137 libxrandr2-dbg libxrender1-dbg libxtst6-dbg zlib1g-dbg 140 libxrandr2-dbg libxrender1-dbg libxtst6-dbg zlib1g-dbg
138 libstdc++6-4.6-dbg" 141 libstdc++6-4.6-dbg"
139 142
143 # 32-bit libraries needed e.g. to compile V8 snapshot for Android or armhf
144 lib32_list="linux-libc-dev:i386"
Primiano Tucci (use gerrit) 2014/11/26 16:41:43 Can you move these lines below (near the next +++
johnme 2014/11/26 17:14:37 I don't want to move this too far from the definit
145
140 # arm cross toolchain packages needed to build chrome on armhf 146 # arm cross toolchain packages needed to build chrome on armhf
141 arm_list="libc6-dev-armhf-cross 147 arm_list="libc6-dev-armhf-cross
142 linux-libc-dev-armhf-cross 148 linux-libc-dev-armhf-cross
143 g++-arm-linux-gnueabihf 149 g++-arm-linux-gnueabihf"
144 linux-libc-dev:i386"
145 150
146 # Packages to build NaCl, its toolchains, and its ports. 151 # Packages to build NaCl, its toolchains, and its ports.
147 naclports_list="ant autoconf bison cmake gawk intltool xutils-dev xsltproc" 152 naclports_list="ant autoconf bison cmake gawk intltool xutils-dev xsltproc"
148 nacl_list="g++-mingw-w64-i686 lib32z1-dev 153 nacl_list="g++-mingw-w64-i686 lib32z1-dev
149 libasound2:i386 libcap2:i386 libelf-dev:i386 libexif12:i386 154 libasound2:i386 libcap2:i386 libelf-dev:i386 libexif12:i386
150 libfontconfig1:i386 libgconf-2-4:i386 libglib2.0-0:i386 libgpm2:i386 155 libfontconfig1:i386 libgconf-2-4:i386 libglib2.0-0:i386 libgpm2:i386
151 libgtk2.0-0:i386 libncurses5:i386 lib32ncurses5-dev 156 libgtk2.0-0:i386 libncurses5:i386 lib32ncurses5-dev
152 libnss3:i386 libpango1.0-0:i386 157 libnss3:i386 libpango1.0-0:i386
153 libssl0.9.8:i386 libtinfo-dev libtinfo-dev:i386 libtool 158 libssl0.9.8:i386 libtinfo-dev libtinfo-dev:i386 libtool
154 libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxi6:i386 159 libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxi6:i386
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 do_inst_syms=1 263 do_inst_syms=1
259 fi 264 fi
260 fi 265 fi
261 if test "$do_inst_syms" = "1"; then 266 if test "$do_inst_syms" = "1"; then
262 echo "Including debugging symbols." 267 echo "Including debugging symbols."
263 else 268 else
264 echo "Skipping debugging symbols." 269 echo "Skipping debugging symbols."
265 dbg_list= 270 dbg_list=
266 fi 271 fi
267 272
268 # When cross building for arm on 64-bit systems the host binaries 273 # When cross building for arm/Android on 64-bit systems the host binaries
269 # that are part of v8 need to be compiled with -m32 which means 274 # that are part of v8 need to be compiled with -m32 which means
270 # that basic multilib support is needed. 275 # that basic multilib support is needed.
271 if file /sbin/init | grep -q 'ELF 64-bit'; then 276 if file /sbin/init | grep -q 'ELF 64-bit'; then
272 if [ "$lsb_release" = "trusty" ]; then 277 # gcc-multilib conflicts with the arm cross compiler (at least in trusty) but
273 # gcc-multilib conflicts with the arm cross compiler in trusty but 278 # g++-X.Y-multilib gives us the 32-bit support that we need. Find out the
274 # g++-4.8-multilib gives us the 32-bit support that we need. 279 # appropriate value of X and Y by seeing what version the current
275 arm_list="$arm_list g++-4.8-multilib" 280 # distribution's g++-multilib package depends on.
276 else 281 multilib_package=$(apt-cache depends g++-multilib --important | \
277 arm_list="$arm_list g++-multilib" 282 grep -E --color=never --only-matching '\bg\+\+-[0-9.]+-multilib\b')
278 fi 283 lib32_list="$lib32_list $multilib_package"
284 fi
285
286 if test "$do_inst_lib32" = "1" ; then
287 echo "Including 32-bit libraries for ARM/Android."
288 else
289 echo "Skipping 32-bit libraries for ARM/Android."
290 lib32_list=
Primiano Tucci (use gerrit) 2014/11/26 16:41:43 Uhm there seems to be no use of this lib32_list. I
johnme 2014/11/26 17:14:37 Done.
279 fi 291 fi
280 292
281 if test "$do_inst_arm" = "1" ; then 293 if test "$do_inst_arm" = "1" ; then
282 echo "Including ARM cross toolchain." 294 echo "Including ARM cross toolchain."
283 else 295 else
284 echo "Skipping ARM cross toolchain." 296 echo "Skipping ARM cross toolchain."
285 arm_list= 297 arm_list=
286 fi 298 fi
287 299
288 if test "$do_inst_nacl" = "1"; then 300 if test "$do_inst_nacl" = "1"; then
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 fi 338 fi
327 if [ -n "${missing}" ]; then 339 if [ -n "${missing}" ]; then
328 echo "WARNING: The following packages are not installed:" 340 echo "WARNING: The following packages are not installed:"
329 echo -e "${missing}" | sed -e "s/^/ /" 341 echo -e "${missing}" | sed -e "s/^/ /"
330 fi 342 fi
331 exit 1 343 exit 1
332 fi 344 fi
333 exit 0 345 exit 0
334 fi 346 fi
335 347
348 if test "$do_inst_lib32" = "1" || test "$do_inst_nacl" = "1"; then
349 if [[ ! $lsb_release =~ (precise|quantal|raring) ]]; then
350 sudo dpkg --add-architecture i386
351 fi
352 fi
336 sudo apt-get update 353 sudo apt-get update
337 354
338 # We initially run "apt-get" with the --reinstall option and parse its output. 355 # We initially run "apt-get" with the --reinstall option and parse its output.
339 # This way, we can find all the packages that need to be newly installed 356 # This way, we can find all the packages that need to be newly installed
340 # without accidentally promoting any packages from "auto" to "manual". 357 # without accidentally promoting any packages from "auto" to "manual".
341 # We then re-run "apt-get" with just the list of missing packages. 358 # We then re-run "apt-get" with just the list of missing packages.
342 echo "Finding missing packages..." 359 echo "Finding missing packages..."
343 # Intentionally leaving $packages unquoted so it's more readable. 360 # Intentionally leaving $packages unquoted so it's more readable.
344 echo "Packages required: " $packages 361 echo "Packages required: " $packages
345 echo 362 echo
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 echo "Installing symbolic links for NaCl." 418 echo "Installing symbolic links for NaCl."
402 if [ ! -r /usr/lib/i386-linux-gnu/libcrypto.so ]; then 419 if [ ! -r /usr/lib/i386-linux-gnu/libcrypto.so ]; then
403 sudo ln -fs libcrypto.so.0.9.8 /usr/lib/i386-linux-gnu/libcrypto.so 420 sudo ln -fs libcrypto.so.0.9.8 /usr/lib/i386-linux-gnu/libcrypto.so
404 fi 421 fi
405 if [ ! -r /usr/lib/i386-linux-gnu/libssl.so ]; then 422 if [ ! -r /usr/lib/i386-linux-gnu/libssl.so ]; then
406 sudo ln -fs libssl.so.0.9.8 /usr/lib/i386-linux-gnu/libssl.so 423 sudo ln -fs libssl.so.0.9.8 /usr/lib/i386-linux-gnu/libssl.so
407 fi 424 fi
408 else 425 else
409 echo "Skipping symbolic links for NaCl." 426 echo "Skipping symbolic links for NaCl."
410 fi 427 fi
OLDNEW
« no previous file with comments | « no previous file | build/install-build-deps-android.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698