1@echo off
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
6setlocal
7
8:: If this batch file is run directly thru cygwin, we will get the wrong
9:: version of python. To avoid this, if we detect cygwin, we need to then
10:: invoke the shell script which will then re-invoke this batch file with
11:: cygwin stripped out of the path.
12:: Detect cygwin by trying to run bash.
13bash --version >NUL 2>&1
14if %ERRORLEVEL% == 0 (
15    bash "%~dp0\scons" %* || exit 1
16    goto end
17)
18
19:: Preserve a copy of the PATH (in case we need it later, mainly for cygwin).
20set PRESCONS_PATH=%PATH%
21
22:: Stop incessant CYGWIN complains about "MS-DOS style path"
23set CYGWIN=nodosfilewarning %CYGWIN%
24
25:: Run the included copy of scons.
26python "%~dp0\scons.py" %*
27
28:end
29