sbsv2/raptor/bin/sbs
branchfix
changeset 276 e80c44f576df
parent 212 18372202b584
child 299 2257b1af191f
equal deleted inserted replaced
275:b30e816f1d39 276:e80c44f576df
     1 #!/bin/bash
     1 #!/bin/bash
     2 # Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 # Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 # All rights reserved.
     3 # All rights reserved.
     4 # This component and the accompanying materials are made available
     4 # This component and the accompanying materials are made available
     5 # under the terms of the License "Eclipse Public License v1.0"
     5 # under the terms of the License "Eclipse Public License v1.0"
     6 # which accompanies this distribution, and is available
     6 # which accompanies this distribution, and is available
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
    15 # raptor script
    15 # raptor script
    16 # add mingw to the PATH if we are running Cygwin on Windows
    16 # add mingw to the PATH if we are running Cygwin on Windows
    17 #
    17 #
    18 
    18 
    19 # If SBS_HOME is not set in the environment then work it out
    19 # If SBS_HOME is not set in the environment then work it out
    20 # from the path to this batch file
    20 # from the path to this script
    21 if [ -z "$SBS_HOME" ] ; then
    21 if [ -z "$SBS_HOME" ] ; then
    22 	temp=$0
    22 	temp=$0
    23 	SBS_HOME=$(cd ${temp%/*} && echo $PWD)
    23 	SBS_HOME=$(cd ${temp%/*} && echo $PWD)
    24 	export SBS_HOME=${SBS_HOME%/bin}
    24 	export SBS_HOME=${SBS_HOME%/bin}
    25 fi
    25 fi
    60 EOERROR
    60 EOERROR
    61 	exit 1
    61 	exit 1
    62 fi
    62 fi
    63 
    63 
    64 if [ "$OSTYPE" == "cygwin" ]; then
    64 if [ "$OSTYPE" == "cygwin" ]; then
    65 
       
    66 	SBS_HOME=${SBS_HOME//\\//}
       
    67 
       
    68 	__MINGW__=${SBS_MINGW:-$SBS_HOME/$HOSTPLATFORM_DIR/mingw}
    65 	__MINGW__=${SBS_MINGW:-$SBS_HOME/$HOSTPLATFORM_DIR/mingw}
    69 	__CYGWIN__=${SBS_CYGWIN:-$SBS_HOME/$HOSTPLATFORM_DIR/cygwin}
    66 	__CYGWIN__=${SBS_CYGWIN:-$SBS_HOME/$HOSTPLATFORM_DIR/cygwin}
    70 	__PYTHON__=${SBS_PYTHON:-$SBS_HOME/$HOSTPLATFORM_DIR/python264/python.exe}
       
    71 	export PYTHONPATH=${SBS_PYTHONPATH:-$SBS_HOME/$HOSTPLATFORM_DIR/python264}
       
    72 
    67 
    73     # Command for unifying path strings. For example, "c:\some\path" and
    68 	# Command for unifying path strings. For example, "c:\some\path" and
    74     # "/cygdrive/c/some/path" will both be converted into "c:/some/path".
    69 	# "/cygdrive/c/some/path" will both be converted into "c:/some/path".
    75 	u="$__CYGWIN__/bin/cygpath.exe -m"
    70 	u="$__CYGWIN__/bin/cygpath.exe -m"
    76 
    71 	
       
    72 	SBS_HOME=${SBS_HOME//\\//}
       
    73 	export SBS_HOME=$($u "$SBS_HOME")
       
    74 	
    77 	__MINGW__=$($u "$__MINGW__")
    75 	__MINGW__=$($u "$__MINGW__")
    78 	__CYGWIN__=$($u "$__MINGW__")
    76 	__CYGWIN__=$($u "$__MINGW__")
    79 	__PYTHON__=$($u "$__PYTHON__")
       
    80 
       
    81 	export SBS_HOME=$($u "$SBS_HOME")
       
    82 
       
    83 	export PATH=${__MINGW__}/bin:${__CYGWIN__}/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH
    77 	export PATH=${__MINGW__}/bin:${__CYGWIN__}/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH
    84 
    78 
    85 	# Tell Cygwin not to map unix security attributes to windows to
    79 	# Tell Cygwin not to map unix security attributes to windows to
    86 	# prevent raptor from potentially creating read-only files:
    80 	# prevent raptor from potentially creating read-only files:
    87 	export CYGWIN='nontsec nosmbntsec'
    81 	export CYGWIN='nontsec nosmbntsec'
    88 
    82 
       
    83 	# The python and PYTHONPATH used by Raptor are determined by, in order of precedence:
       
    84 	#  1. the SBS_PYTHON and SBS_PYTHONPATH environment variables (if set)
       
    85 	#  2. the python shipped locally with Raptor (if present)
       
    86 	#  3. the python on the system PATH and the PYTHONPATH set in the system environment
       
    87 
       
    88 	__LOCAL_PYTHON__=$SBS_HOME/win32/python264/python.exe
       
    89 
       
    90 	if [ -n "$SBS_PYTHON" ]; then
       
    91 		__PYTHON__=$SBS_PYTHON
       
    92 	elif [ -f "$__LOCAL_PYTHON__" ]; then
       
    93 		__PYTHON__=$__LOCAL_PYTHON__
       
    94 		export PYTHONPATH=
       
    95 	else
       
    96 		__PYTHON__=python.exe
       
    97 	fi
       
    98 	__PYTHON__=$($u "$__PYTHON__")		
       
    99 
       
   100 	if [ -n "$SBS_PYTHONPATH" ]; then
       
   101 		export PYTHONPATH=$($u "$SBS_PYTHONPATH")
       
   102 	fi
    89 else
   103 else
    90 	export PYTHONPATH=${SBS_PYTHONPATH:-$SBS_HOME/$HOSTPLATFORM_DIR/python262/lib}
   104 	export PYTHONPATH=${SBS_PYTHONPATH:-$SBS_HOME/$HOSTPLATFORM_DIR/python262/lib}
    91 	PATH=$SBS_HOME/$HOSTPLATFORM_DIR/python262/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH
   105 	PATH=$SBS_HOME/$HOSTPLATFORM_DIR/python262/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH
    92 	LD_LIBRARY_PATH=$SBS_HOME/$HOSTPLATFORM_DIR/python262/lib:$SBS_HOME/$HOSTPLATFORM_DIR/bv/lib:$LD_LIBRARY_PATH
   106 	LD_LIBRARY_PATH=$SBS_HOME/$HOSTPLATFORM_DIR/python262/lib:$SBS_HOME/$HOSTPLATFORM_DIR/bv/lib:$LD_LIBRARY_PATH
    93 
   107