sbsv2/raptor/bin/sbs
changeset 590 360bd6b35136
parent 0 044383f39525
child 625 a1925fb7753a
equal deleted inserted replaced
588:c7c26511138f 590:360bd6b35136
     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/python252/python.exe}
       
    71 
    67 
    72     # Command for unifying path strings. For example, "c:\some\path" and
    68 	# Command for unifying path strings. For example, "c:\some\path" and
    73     # "/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".
    74 	u="$__CYGWIN__/bin/cygpath.exe -m"
    70 	u="$__CYGWIN__/bin/cygpath.exe -m"
    75 
    71 	
       
    72 	SBS_HOME=${SBS_HOME//\\//}
       
    73 	export SBS_HOME=$($u "$SBS_HOME")
       
    74 	
    76 	__MINGW__=$($u "$__MINGW__")
    75 	__MINGW__=$($u "$__MINGW__")
    77 	__CYGWIN__=$($u "$__MINGW__")
    76 	__CYGWIN__=$($u "$__MINGW__")
    78 	__PYTHON__=$($u "$__PYTHON__")
       
    79 
       
    80 	export SBS_HOME=$($u "$SBS_HOME")
       
    81 	export EPOCROOT=$($u "$EPOCROOT")
       
    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 SBS_PYTHON=$__PYTHON__
       
    95 		export PYTHONPATH=
       
    96 	else
       
    97 		__PYTHON__=python.exe
       
    98 	fi
       
    99 	__PYTHON__=$($u "$__PYTHON__")		
       
   100 
       
   101 	if [ -n "$SBS_PYTHONPATH" ]; then
       
   102 		export PYTHONPATH=$($u "$SBS_PYTHONPATH")
       
   103 	fi
    89 else
   104 else
       
   105 	export PYTHONPATH=${SBS_PYTHONPATH:-$SBS_HOME/$HOSTPLATFORM_DIR/python262/lib}
    90 	PATH=$SBS_HOME/$HOSTPLATFORM_DIR/python262/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH
   106 	PATH=$SBS_HOME/$HOSTPLATFORM_DIR/python262/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH
    91 	LD_LIBRARY_PATH=$SBS_HOME/$HOSTPLATFORM_DIR/python262/lib:$SBS_HOME/$HOSTPLATFORM_DIR/bv/lib:$LD_LIBRARY_PATH
   107 	LD_LIBRARY_PATH=$SBS_HOME/$HOSTPLATFORM_DIR/python262/lib:$SBS_HOME/$HOSTPLATFORM_DIR/bv/lib:$LD_LIBRARY_PATH
    92 
   108 
    93 	export PATH LD_LIBRARY_PATH
   109 	export PATH LD_LIBRARY_PATH
    94 	__PYTHON__=python
   110 	__PYTHON__=python