2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
9 SCRIPT_DIR="$(cd $(dirname $0) && pwd)"
13 NACLPORTS_URL=https://chromium.googlesource.com/external/naclports
14 NACLPORTS_SHA=0096083c0fa71c014f6218bb14d7e1742d9a6b0c
15 NACLPORTS_DIR=${OUT_DIR}/naclports
16 NACLAM_URL=https://github.com/johnmccutchan/NaClAMBase
17 NACLAM_DIR=${OUT_DIR}/NaClAMBase
18 NACLAM_SHA=0eb4647a3f99c6e66156959edc6c55d4a913468a
20 if [ -z "${NACL_SDK_ROOT:-}" ]; then
21 echo "-------------------------------------------------------------------"
22 echo "NACL_SDK_ROOT is unset."
23 echo "This environment variable needs to be pointed at some version of"
24 echo "the Native Client SDK (the directory containing toolchain/)."
25 echo "NOTE: set this to an absolute path."
26 echo "-------------------------------------------------------------------"
31 echo "######################################################################"
33 echo "######################################################################"
36 # echo a command to stdout and then execute it.
46 if [ ! -d $dir ]; then
47 LogExecute git clone $url $dir
50 LogExecute git fetch origin
55 LogExecute git checkout $sha
59 readonly OS_NAME=$(uname -s)
60 if [ $OS_NAME = "Darwin" ]; then
62 elif [ $OS_NAME = "Linux" ]; then
68 Banner Cloning naclports
69 Clone ${NACLPORTS_URL} ${NACLPORTS_DIR} ${NACLPORTS_SHA}
71 Banner Building bullet
72 pushd ${NACLPORTS_DIR}
73 make NACL_ARCH=pnacl bullet
76 Banner Cloning NaClAMBase
77 Clone ${NACLAM_URL} ${NACLAM_DIR} ${NACLAM_SHA}
79 Banner Building NaClAM
80 LogExecute cp Makefile ${NACLAM_DIR}
82 LogExecute make -j${OS_JOBS}
85 LogExecute cp ${NACLAM_DIR}/pnacl/Release/NaClAMBullet.{pexe,nmf} ${OUT_DIR}