OLD | NEW |
| (Empty) |
1 #!/bin/bash | |
2 # | |
3 # Copyright (c) 2011 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 readonly SCRIPT_DIR="$(dirname "$0")" | |
8 readonly SCRIPT_DIR_ABS="$(cd "${SCRIPT_DIR}" ; pwd -P)" | |
9 readonly SRC_DIR="$(dirname $(dirname $(dirname ${SCRIPT_DIR_ABS})))" | |
10 | |
11 # NACL_SDK_ROOT must be set. | |
12 if [ x"${NACL_SDK_ROOT}"x == "xx" ] ; then | |
13 echo "Error: NACL_SDK_ROOT is not set." | |
14 exit 1; | |
15 fi | |
16 | |
17 # NACL_TARGET_PLATFORM is really the name of a folder with the base dir - | |
18 # usually NACL_SDK_ROOT - within which the toolchain for the target platform | |
19 # are found. | |
20 # Replace the platform with the name of your target platform. For example, to | |
21 # build applications that target the pepper_17 API, set | |
22 # NACL_TARGET_PLATFORM="pepper_17" | |
23 if [ x"${NACL_TARGET_PLATFORM}"x == "xx" ] ; then | |
24 export NACL_TARGET_PLATFORM="pepper_17" | |
25 fi | |
26 | |
27 readonly NACL_PLATFORM_DIR="${NACL_SDK_ROOT}/${NACL_TARGET_PLATFORM}" | |
28 | |
29 SCONS_DIR="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1" | |
30 | |
31 if [ ! -f ${SCONS_DIR}/script/scons ]; then | |
32 SCONS_DIR="${SRC_DIR}/third_party/scons-2.0.1" | |
33 fi | |
34 | |
35 BASE_SCRIPT="${SCONS_DIR}/script/scons" | |
36 | |
37 export SCONS_LIB_DIR="${SCONS_DIR}/engine" | |
38 export PYTHONPATH="${SCONS_LIB_DIR}" | |
39 export PYTHONPATH="${PYTHONPATH}:${NACL_PLATFORM_DIR}/build_tools" | |
40 | |
41 # We have to do this because scons overrides PYTHONPATH and does not preserve | |
42 # what is provided by the OS. The custom variable name won't be overwritten. | |
43 export PYMOX="${NACL_PLATFORM_DIR}/third_party/pymox/src" | |
44 | |
45 "${BASE_SCRIPT}" --file=build.scons \ | |
46 --site-dir="${SCRIPT_DIR_ABS}/../build_tools/nacl_sdk_scons" \ | |
47 $* | |
OLD | NEW |