Upstream version 9.38.207.0
[platform/framework/web/crosswalk.git] / src / native_client / scons
1 #!/bin/bash
2 # Copyright (c) 2011 The Native Client 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 readonly SCRIPT_DIR="$(dirname "$0")"
7 readonly SCRIPT_DIR_ABS="$(cd "${SCRIPT_DIR}" ; pwd)"
8
9 # Use the batch file as an entry point if on cygwin.
10 if [ "x${OSTYPE}" = "xcygwin" ]; then
11   # Use extended globbing (cygwin should always have it).
12   shopt -s extglob
13   # Filter out cygwin python (everything under /usr or /bin, or *cygwin*).
14   export PATH=${PATH/#\/bin*([^:])/}
15   export PATH=${PATH//:\/bin*([^:])/}
16   export PATH=${PATH/#\/usr*([^:])/}
17   export PATH=${PATH//:\/usr*([^:])/}
18   export PATH=${PATH/#*([^:])cygwin*([^:])/}
19   export PATH=${PATH//:*([^:])cygwin*([^:])/}
20   "${SCRIPT_DIR_ABS}/scons.bat" "$@"
21   exit
22 fi
23
24 readonly BASE_SCRIPT="${SCRIPT_DIR_ABS}/scons.py"
25
26 python "${BASE_SCRIPT}" "$@"
27