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 SMOOTHLIFE_URL=https://github.com/binji/smoothnacl
14 SMOOTHLIFE_DIR=${OUT_DIR}/smoothlife
15 SMOOTHLIFE_SHA=63f115f2393aa629aab1403948cbfb28acc54360
17 if [ -z "${NACL_SDK_ROOT:-}" ]; then
18 echo "-------------------------------------------------------------------"
19 echo "NACL_SDK_ROOT is unset."
20 echo "This environment variable needs to be pointed at some version of"
21 echo "the Native Client SDK (the directory containing toolchain/)."
22 echo "NOTE: set this to an absolute path."
23 echo "-------------------------------------------------------------------"
28 echo "######################################################################"
30 echo "######################################################################"
33 # echo a command to stdout and then execute it.
43 if [ ! -d $dir ]; then
44 LogExecute git clone $url $dir
47 LogExecute git fetch origin
52 LogExecute git checkout $sha
56 readonly OS_NAME=$(uname -s)
57 if [ $OS_NAME = "Darwin" ]; then
59 elif [ $OS_NAME = "Linux" ]; then
65 Banner Cloning smoothlife
66 Clone ${SMOOTHLIFE_URL} ${SMOOTHLIFE_DIR} ${SMOOTHLIFE_SHA}
68 pushd ${SMOOTHLIFE_DIR}
70 Banner Updating submodules
71 LogExecute git submodule update --init
76 Banner Building smoothlife
77 LogExecute make TOOLCHAIN=pnacl CONFIG=Release -j${OS_JOBS}
81 LogExecute cp ${SMOOTHLIFE_DIR}/pnacl/Release/smoothnacl.{pexe,nmf} ${OUT_DIR}