Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / native_client_sdk / src / gonacl_appengine / src / lua / build.sh
1 #!/bin/bash
2 # Copyright (c) 2012 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.
5
6 set -o nounset
7 set -o errexit
8
9 SCRIPT_DIR="$(cd $(dirname $0) && pwd)"
10 cd ${SCRIPT_DIR}
11
12 OUT_DIR=out
13 NACLPORTS_URL=https://chromium.googlesource.com/external/naclports.git
14 NACLPORTS_REV=e53078c33d99b0b3cbadbbbbb92cccf7a48d5dc1
15 NACLPORTS_DIR=${OUT_DIR}/naclports
16
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 "-------------------------------------------------------------------"
24   exit -1
25 fi
26
27 Banner() {
28   echo "######################################################################"
29   echo $*
30   echo "######################################################################"
31 }
32
33 # echo a command to stdout and then execute it.
34 LogExecute() {
35   echo $*
36   $*
37 }
38
39 Banner Cloning naclports
40 if [ -d ${NACLPORTS_DIR} -a ! -d ${NACLPORTS_DIR}/src/.git ]; then
41   rm -rf ${NACLPORTS_DIR}
42 fi
43
44 if [ ! -d ${NACLPORTS_DIR} ]; then
45   mkdir -p ${NACLPORTS_DIR}
46   pushd ${NACLPORTS_DIR}
47   gclient config --name=src ${NACLPORTS_URL}
48   popd
49 fi
50
51 pushd ${NACLPORTS_DIR}
52 gclient sync -r ${NACLPORTS_REV}
53 popd
54
55
56 Banner Building lua
57 pushd ${NACLPORTS_DIR}/src
58 # Do a 'clean' first, since previous lua build from the naclports bundle
59 # building might be installed in the toolchain, and that one is built
60 # without readline support.
61 make TOOLCHAIN=pnacl clean
62 make TOOLCHAIN=pnacl lua-ppapi
63 popd
64
65 Banner Done!