[M73 Dev][EFL] Fix errors to generate ninja files
[platform/framework/web/chromium-efl.git] / build / install-build-deps-android.sh
1 #!/bin/bash
2
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
5 # found in the LICENSE file.
6
7 # Script to install everything needed to build chromium on android, including
8 # items requiring sudo privileges.
9 # See https://www.chromium.org/developers/how-tos/android-build-instructions
10
11 args="$@"
12
13 if ! uname -m | egrep -q "i686|x86_64"; then
14   echo "Only x86 architectures are currently supported" >&2
15   exit
16 fi
17
18 # Exit if any commands fail.
19 set -e
20
21 lsb_release=$(lsb_release --codename --short)
22
23 # Install first the default Linux build deps.
24 "$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \
25   --no-syms --lib32 --no-arm --no-chromeos-fonts --no-nacl --no-prompt "${args}"
26
27 # Fix deps
28 sudo apt-get -f install
29
30 # common
31 sudo apt-get -y install lib32z1 lighttpd python-pexpect xvfb x11-utils
32
33 # Some binaries in the Android SDK require 32-bit libraries on the host.
34 # See https://developer.android.com/sdk/installing/index.html?pkg=tools
35 sudo apt-get -y install libncurses5:i386 libstdc++6:i386 zlib1g:i386
36
37 # Required for apk-patch-size-estimator
38 sudo apt-get -y install bsdiff
39
40 # Do our own error handling for java.
41 set +e
42
43 function IsJava8() {
44   # Arg is either "java" or "javac"
45   $1 -version 2>&1 | grep -q '1\.8'
46 }
47
48 if ! (IsJava8 java && IsJava8 javac); then
49   sudo apt-get -y install openjdk-8-jre openjdk-8-jdk
50 fi
51
52 # There can be several reasons why java8 is not default despite being installed.
53 # Just show an error and exit.
54 if ! (IsJava8 java && IsJava8 javac); then
55   echo
56   echo "Automatic java installation failed."
57   echo '`java -version` reports:'
58   java -version
59   echo
60   echo '`javac -version` reports:'
61   javac -version
62   echo
63   echo "Please ensure that JDK 8 is installed and resolves first in your PATH."
64   echo -n '`which java` reports: '
65   which java
66   echo -n '`which javac` reports: '
67   which javac
68   echo
69   echo "You might also try running:"
70   echo "    sudo update-java-alternatives -s java-1.8.0-openjdk-amd64"
71   exit 1
72 fi
73
74 echo "install-build-deps-android.sh complete."