Add sbs_env.bat for Cygwin 1.7 support. wip
authorDaniel Jacobs <daniel.jacobs@nokia.com>
Thu, 18 Feb 2010 15:38:39 +0000
branchwip
changeset 335 e69156db0290
parent 330 f3b3d9f9a008
child 336 a2b6ca74ba48
Add sbs_env.bat for Cygwin 1.7 support.
sbsv2/raptor/bin/sbs_env.bat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/bin/sbs_env.bat	Thu Feb 18 15:38:39 2010 +0000
@@ -0,0 +1,70 @@
+@rem
+@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of the License "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+
+@SET HOSTPLATFORM=win 32
+@SET HOSTPLATFORM_DIR=win32
+
+@REM Automatically find SBS_HOME if it is not set
+@IF NOT "%SBS_HOME%"==""  goto foundhome
+@SET RAPTORBINDIR=%~dp0
+@SET WD=%cd%
+@cd /d %RAPTORBINDIR%\..
+@SET SBS_HOME=%cd%
+@cd /d %WD%
+:foundhome 
+
+@REM Use the python set by the environment if possible
+@SET __PYTHON__=%SBS_PYTHON%
+@IF "%__PYTHON__%"=="" SET __PYTHON__=%SBS_HOME%\win32\python264\python.exe
+@SET PYTHONPATH=%SBS_PYTHONPATH%
+@IF "%PYTHONPATH%"=="" SET PYTHONPATH=%SBS_HOME%\win32\python264
+
+@REM Use the mingw set by the environment if possible
+@SET __MINGW__=%SBS_MINGW%
+@IF "%__MINGW__%"=="" SET __MINGW__=%SBS_HOME%\win32\mingw
+
+@REM Use the cygwin set by the environment if possible
+@SET __CYGWIN__=%SBS_CYGWIN%
+@IF "%__CYGWIN__%"=="" SET __CYGWIN__=%SBS_HOME%\win32\cygwin
+
+@REM add to the search path
+@REM (make sure that we don't get into trouble if there are Path and PATH variables)
+@SET PATH_TEMP=%__MINGW__%\bin;%__CYGWIN__%\bin;%SBS_HOME%\win32\bin;%PATH%
+@SET PATH=
+@SET PATH=%PATH_TEMP%
+@SET PATH_TEMP=
+
+@REM Tell CYGWIN not to map unix security attributes to windows to
+@REM prevent raptor from potentially creating read-only files:
+@REM
+@REM
+@REM
+
+@REM Assume Cygwin 1.5 CLI.
+@SET __MOUNTOPTIONS__=-u
+@SET __UMOUNTOPTIONS__=-u
+@SET CYGWIN=nontsec nosmbntsec
+
+@REM Make sure that /tmp is not set incorrectly for sbs. 
+@umount %__UMOUNTOPTIONS__% /tmp >NUL  2>NUL
+
+@REM If this fails, that means we are using Cygwin 1.7, so change the options and redo the first umount
+@IF %ERRORLEVEL% == 1 SET CYGWIN=nodosfilewarning && SET __MOUNTOPTIONS__=-o noacl -o user && SET __UMOUNTOPTIONS__=&& umount %__UMOUNTOPTIONS__% /tmp >NUL  2>NUL
+
+@mount %__MOUNTOPTIONS__% %TEMP% /tmp >NUL 2>NUL
+@umount %__UMOUNTOPTIONS__% / >NUL  2>NUL
+@mount %__MOUNTOPTIONS__% %__CYGWIN__% / >NUL 2>NUL
+