| Index: chrome-setup.sh
|
| diff --git a/chrome-setup.sh b/chrome-setup.sh
|
| new file mode 100755
|
| index 0000000000000000000000000000000000000000..68351dceafd1429dac23e253abd01ce7c7e7a2a5
|
| --- /dev/null
|
| +++ b/chrome-setup.sh
|
| @@ -0,0 +1,147 @@
|
| +#!/bin/bash
|
| +set -o nounset
|
| +set -o errexit
|
| +
|
| +#@ The typical usage for this tool is:
|
| +#@
|
| +#@ Install cross toolchain (do this only once per system)
|
| +#@
|
| +#@ chrome-setup.sh install-cross-toolchain-base
|
| +#@ chrome-setup.sh install-cross-toolchain-jail
|
| +#@
|
| +#@ build chrome with the cross toolchain
|
| +#@ chrome-setup.sh configure-chrome
|
| +#@ chrome-setup.sh make-chrome
|
| +#@ chrome-setup.sh make-nacl
|
| +#@ chrome-setup.sh package-chrome
|
| +#@ now copy the chrome tarball (chrome-arm.tgz) to your are device
|
| +
|
| +
|
| +readonly SYSROOT=$(pwd)/arm_jail
|
| +
|
| +readonly TC_URL_PREFIX=https://commondatastorage.googleapis.com/nativeclient-archive2/toolchain
|
| +readonly TC_REV=8000
|
| +
|
| +
|
| +# Packages for the host system
|
| +# NOTE: at one point we should get rid of the 4.5 packages
|
| +readonly CROSS_ARM_TC_PACKAGES="\
|
| + libc6-armel-cross \
|
| + libc6-dev-armel-cross \
|
| + libgcc1-armel-cross \
|
| + libgomp1-armel-cross \
|
| + linux-libc-dev-armel-cross \
|
| + libgcc1-dbg-armel-cross \
|
| + libgomp1-dbg-armel-cross \
|
| + binutils-arm-linux-gnueabi \
|
| + cpp-arm-linux-gnueabi \
|
| + gcc-arm-linux-gnueabi \
|
| + g++-arm-linux-gnueabi \
|
| + cpp-4.5-arm-linux-gnueabi \
|
| + gcc-4.5-arm-linux-gnueabi \
|
| + g++-4.5-arm-linux-gnueabi \
|
| + libmudflap0-dbg-armel-cross
|
| +"
|
| +
|
| +readonly GYP_DEFINES="\
|
| + sysroot=${SYSROOT} \
|
| + target_arch=arm \
|
| + armv7=1 \
|
| + arm_thumb=0 \
|
| + arm_neon=1 \
|
| + linux_breakpad=0 \
|
| + linux_use_tcmalloc=0
|
| + linux_use_gold_binary=1
|
| + linux_use_gold_flags=1
|
| +"
|
| +
|
| +######################################################################
|
| +export CXX=arm-linux-gnueabi-g++
|
| +export CC=arm-linux-gnueabi-gcc
|
| +export AR=arm-linux-gnueabi-ar
|
| +export AS=arm-linux-gnueabi-as
|
| +export RANLIB=arm-linux-gnueabi-ranlib
|
| +
|
| +export GYP_DEFINES
|
| +export SYSROOT
|
| +
|
| +######################################################################
|
| +
|
| +
|
| +#@ run this once on your system to install necessary crosstoolchain
|
| +#@ binaries - NOTE: sudo required
|
| +#@
|
| +install-cross-toolchain-base() {
|
| + sudo apt-get install ${CROSS_ARM_TC_PACKAGES}
|
| +}
|
| +
|
| +
|
| +#@ run this once for each chrome checkout inside src/
|
| +#@ (this could be shared across chrome checkouts as well)
|
| +#@
|
| +install-cross-toolchain-jail() {
|
| + local tarball=$(pwd)/jail.tgz
|
| +
|
| + curl -L \
|
| + ${TC_URL_PREFIX}/${TC_REV}/naclsdk_linux_arm-trusted.tgz \
|
| + -o ${tarball}
|
| +
|
| +
|
| + rm -rf ${SYSROOT}
|
| + mkdir -p ${SYSROOT}
|
| + tar zxf ${tarball} -C ${SYSROOT}
|
| +}
|
| +
|
| +
|
| +#@
|
| +#@
|
| +configure-chrome() {
|
| + # note this reads GYP_DEFINES
|
| + gclient runhooks
|
| +}
|
| +
|
| +
|
| +#@
|
| +#@
|
| +make-chrome() {
|
| + make V=99 BUILDTYPE=Release -j 16 chrome \
|
| + "CC.host=gcc -m32 -I/usr/lib/glib-2.0/include "\
|
| + "CXX.host= g++ -m32 -I/usr/lib/glib-2.0/include "
|
| +}
|
| +
|
| +make-nacl() {
|
| + make V=99 BUILDTYPE=Release -j 16 nacl_helper nacl_helper_bootstrap \
|
| + "CC.host=gcc -m32 -I/usr/lib/glib-2.0/include "\
|
| + "CXX.host= g++ -m32 -I/usr/lib/glib-2.0/include "
|
| +}
|
| +
|
| +package-chrome() {
|
| + tar cfvz chrome-arm.tgz out/Release/chrome \
|
| + out/Release/lib*.so \
|
| + out/Release/nacl* \
|
| + out/Release/chrome.pak \
|
| + out/Release/resources.pak \
|
| + out/Release/locales
|
| +}
|
| +
|
| +######################################################################
|
| +# DISPATCH
|
| +######################################################################
|
| +Usage() {
|
| + egrep "^#@" $0 | cut --bytes=3-
|
| +}
|
| +
|
| +
|
| +if [[ $# -eq 0 ]] ; then
|
| + echo "you must specify a mode on the commandline:"
|
| + echo
|
| + Usage
|
| + exit -1
|
| +elif [[ "$(type -t $1)" != "function" ]]; then
|
| + echo "ERROR: unknown function '$1'." >&2
|
| + echo "For help, try:"
|
| + echo " $0 help"
|
| + exit 1
|
| +else
|
| + "$@"
|
| +fi
|
|
|