summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/scons
blob: c14f66658a226970bf8a43f81a6f64f9c8218a21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
#
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.


readonly SCRIPT_DIR="$(dirname "$0")"
readonly SCRIPT_DIR_ABS="$(cd "${SCRIPT_DIR}" ; pwd -P)"

# Use the batch file as an entry point if on cygwin.
if [ "x${OSTYPE}" = "xcygwin" ]; then
  # Use extended globbing (cygwin should always have it).
  shopt -s extglob
  # Filter out cygwin python (everything under /usr or /bin, or *cygwin*).
  export PATH=${PATH/#\/bin*([^:])/}
  export PATH=${PATH//:\/bin*([^:])/}
  export PATH=${PATH/#\/usr*([^:])/}
  export PATH=${PATH//:\/usr*([^:])/}
  export PATH=${PATH/#*([^:])cygwin*([^:])/}
  export PATH=${PATH//:*([^:])cygwin*([^:])/}
  "${SCRIPT_DIR_ABS}/scons.bat" $*
  exit
fi

readonly BASE_SCRIPT="${SCRIPT_DIR_ABS}/third_party/scons-2.0.1/script/scons"

export NACL_SDK_ROOT="${SCRIPT_DIR_ABS}"

export SCONS_LIB_DIR="${NACL_SDK_ROOT}/third_party/scons-2.0.1/engine"
export PYTHONPATH="${SCRIPT_DIR_ABS}/third_party/scons-2.0.1/engine:${SCRIPT_DIR_ABS}/third_party/native_client/native_client/build"
# We have to do this because scons overrides PYTHONPATH and does not preserve
# what is provided by the OS.  The custom variable name won't be overwritten.
export PYMOX="${NACL_SDK_ROOT}/third_party/pymox"

"${BASE_SCRIPT}" --file=main.scons $*