sbsv2/raptor/bin/sbs_env.bat
branchwip
changeset 348 7e804508da51
parent 345 74a770b7bca3
child 380 db59fc762214
equal deleted inserted replaced
347:018461a64038 348:7e804508da51
     1 @rem
     1 @REM
     2 @rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     2 @REM Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3 @rem All rights reserved.
     3 @REM All rights reserved.
     4 @rem This component and the accompanying materials are made available
     4 @REM This component and the accompanying materials are made available
     5 @rem under the terms of the License "Eclipse Public License v1.0"
     5 @REM under the terms of the License "Eclipse Public License v1.0"
     6 @rem which accompanies this distribution, and is available
     6 @REM which accompanies this distribution, and is available
     7 @rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 @REM at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 @rem
     8 @REM
     9 @rem Initial Contributors:
     9 @REM Initial Contributors:
    10 @rem Nokia Corporation - initial contribution.
    10 @REM Nokia Corporation - initial contribution.
    11 @rem
    11 @REM
    12 @rem Contributors:
    12 @REM Contributors:
    13 @rem
    13 @REM
    14 @rem Description: 
    14 @REM Description: 
    15 @rem
    15 @REM
    16 
    16 
    17 @SET HOSTPLATFORM=win 32
    17 @SET HOSTPLATFORM=win 32
    18 @SET HOSTPLATFORM_DIR=win32
    18 @SET HOSTPLATFORM_DIR=win32
    19 
    19 
    20 @REM Automatically find SBS_HOME if it is not set
    20 @REM Automatically find SBS_HOME if it is not set
    21 @IF NOT "%SBS_HOME%"==""  goto foundhome
    21 @IF NOT "%SBS_HOME%"=="" GOTO foundhome
    22 @SET RAPTORBINDIR=%~dp0
    22 @SET RAPTORBINDIR=%~dp0
    23 @SET WD=%cd%
    23 @SET WD=%CD%
    24 @cd /d %RAPTORBINDIR%\..
    24 @CD /d %RAPTORBINDIR%\..
    25 @SET SBS_HOME=%cd%
    25 @SET SBS_HOME=%CD%
    26 @cd /d %WD%
    26 @CD /d %WD%
    27 :foundhome 
    27 :foundhome 
    28 
    28 
    29 @REM The python and PYTHONPATH used by Raptor are determined by, in order of precedence:
    29 @REM The python and PYTHONPATH used by Raptor are determined by, in order of precedence:
    30 @REM 1. the SBS_PYTHON and SBS_PYTHONPATH environment variables (if set)
    30 @REM 1. the SBS_PYTHON and SBS_PYTHONPATH environment variables (if set)
    31 @REM 2. the python shipped locally with Raptor (if present)
    31 @REM 2. the python shipped locally with Raptor (if present)
    50 
    50 
    51 @REM Use the mingw set by the environment if possible
    51 @REM Use the mingw set by the environment if possible
    52 @SET __MINGW__=%SBS_MINGW%
    52 @SET __MINGW__=%SBS_MINGW%
    53 @IF "%__MINGW__%"=="" SET __MINGW__=%SBS_HOME%\win32\mingw
    53 @IF "%__MINGW__%"=="" SET __MINGW__=%SBS_HOME%\win32\mingw
    54 
    54 
    55 @REM Use the cygwin set by the environment if possible
       
    56 @SET __CYGWIN__=%SBS_CYGWIN%
       
    57 @IF "%__CYGWIN__%"=="" SET __CYGWIN__=%SBS_HOME%\win32\cygwin
       
    58 
       
    59 @REM add to the search path
       
    60 @REM (make sure that we don't get into trouble if there are Path and PATH variables)
       
    61 @SET PATH_TEMP=%__MINGW__%\bin;%__CYGWIN__%\bin;%SBS_HOME%\win32\bin;%PATH%
       
    62 @SET PATH=
       
    63 @SET PATH=%PATH_TEMP%
       
    64 @SET PATH_TEMP=
       
    65 
       
    66 @REM Tell CYGWIN not to map unix security attributes to windows to
    55 @REM Tell CYGWIN not to map unix security attributes to windows to
    67 @REM prevent raptor from potentially creating read-only files.
    56 @REM prevent raptor from potentially creating read-only files.
    68 @REM Assume Cygwin 1.5 CLI.
    57 @REM Assume Cygwin 1.5 CLI.
    69 @SET __MOUNTOPTIONS__=-u
    58 @SET __MOUNTOPTIONS__=-u
    70 @SET __UMOUNTOPTIONS__=-u
    59 @SET __UMOUNTOPTIONS__=-u
    71 @SET CYGWIN=nontsec nosmbntsec
    60 @SET CYGWIN=nontsec nosmbntsec
    72 
    61 
       
    62 @REM If SBS_CYGWIN17 is set, we are using Cygwin 1.7, so change the mount/umount 
       
    63 @REM options to the 1.7 CLI and set SBS_CYGWIN to the value of SBS_CYGWIN17
       
    64 @IF NOT "%SBS_CYGWIN17%" == "" SET CYGWIN=nodosfilewarning && SET "SBS_CYGWIN=%SBS_CYGWIN17%" && SET __MOUNTOPTIONS__=-o noacl -o user && SET __UMOUNTOPTIONS__=
       
    65 
       
    66 @REM Use the Cygwin set by the environment (from SBS_CYGWIN or SBS_CYGWIN17) if possible
       
    67 @SET __CYGWIN__=%SBS_CYGWIN%
       
    68 @IF "%__CYGWIN__%"=="" SET __CYGWIN__=%SBS_HOME%\win32\cygwin
       
    69 
       
    70 @REM Add to the search path
       
    71 @REM (make sure that we don't get into trouble if there are Path and PATH variables)
       
    72 @SET PATH_TEMP=%__MINGW__%\bin;%__CYGWIN__%\bin;%SBS_HOME%\win32\bin;%PATH%
       
    73 @SET PATH=
       
    74 @SET PATH=%PATH_TEMP%
       
    75 @SET PATH_TEMP=
       
    76 
    73 @REM Make sure that /tmp is not set incorrectly for sbs. 
    77 @REM Make sure that /tmp is not set incorrectly for sbs. 
    74 @umount %__UMOUNTOPTIONS__% /tmp >NUL  2>NUL
    78 @umount %__UMOUNTOPTIONS__% /tmp >NUL  2>NUL
    75 
       
    76 @REM If this fails, that means we are using Cygwin 1.7, so change the options and redo the first umount
       
    77 @IF %ERRORLEVEL% == 1 SET CYGWIN=nodosfilewarning && SET __MOUNTOPTIONS__=-o noacl -o user && SET __UMOUNTOPTIONS__=&& umount %__UMOUNTOPTIONS__% /tmp >NUL  2>NUL
       
    78 
       
    79 @mount %__MOUNTOPTIONS__% %TEMP% /tmp >NUL 2>NUL
    79 @mount %__MOUNTOPTIONS__% %TEMP% /tmp >NUL 2>NUL
    80 @umount %__UMOUNTOPTIONS__% / >NUL  2>NUL
    80 @umount %__UMOUNTOPTIONS__% / >NUL  2>NUL
    81 @mount %__MOUNTOPTIONS__% %__CYGWIN__% / >NUL 2>NUL
    81 @mount %__MOUNTOPTIONS__% %__CYGWIN__% / >NUL 2>NUL
    82 
    82