sbsv2/raptor/bin/sbs
changeset 0 044383f39525
child 28 6983dbbe3d70
child 590 360bd6b35136
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 #!/bin/bash
       
     2 # Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 # All rights reserved.
       
     4 # This component and the accompanying materials are made available
       
     5 # under the terms of the License "Eclipse Public License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 #
       
    14 # Description:
       
    15 # raptor script
       
    16 # add mingw to the PATH if we are running Cygwin on Windows
       
    17 #
       
    18 
       
    19 # If SBS_HOME is not set in the environment then work it out
       
    20 # from the path to this batch file
       
    21 if [ -z "$SBS_HOME" ] ; then
       
    22 	temp=$0
       
    23 	SBS_HOME=$(cd ${temp%/*} && echo $PWD)
       
    24 	export SBS_HOME=${SBS_HOME%/bin}
       
    25 fi
       
    26 
       
    27 # Ensure that the host type is set for Raptor:
       
    28 eval $($SBS_HOME/bin/gethost.sh -e)
       
    29 
       
    30 if [ -z "$HOSTPLATFORM" ]; then
       
    31 	echo "Error: HOSTPLATFORM could not be determined." 1>&2
       
    32 	exit 1
       
    33 fi
       
    34 
       
    35 if [ ! -d "$SBS_HOME/$HOSTPLATFORM_DIR" ]; then
       
    36 cat 1>&2 <<EOERROR
       
    37 Error: sbs has not been installed with support for your platform: "${HOSTPLATFORM}".
       
    38 
       
    39 The utilites for your platform should be in "$SBS_HOME/$HOSTPLATFORM_DIR" but sbs
       
    40 cannot find them there.
       
    41 
       
    42 sbs is supported on:
       
    43 	win32
       
    44 	linux i386 libc2_3 (Redhat 4)
       
    45 
       
    46 sbs has been known to work (but is not supported) on:
       
    47 	linux x86_64 libc2_5  (e.g. Centos/Redhat 5.3 64-bit)
       
    48 	linux i386 libc2_8  (e.g. Fedora 9 32-bit)
       
    49 	linux x86_64 libc2_10 (e.g. Fedora 11 64-bit)
       
    50 
       
    51 Even with the appropriate utilities it may be necessary to install 32-bit
       
    52 compatibility versions of some libraries (e.g. glibc) on these platforms,
       
    53 particularly for 3rd party tools which are not built natively such as
       
    54 compilers.
       
    55 
       
    56 It may be possible to build and install the utilities for your platform by
       
    57 entering $SBS_HOME/util and running
       
    58 	make -k
       
    59 A full development environment is required however.
       
    60 EOERROR
       
    61 	exit 1
       
    62 fi
       
    63 
       
    64 if [ "$OSTYPE" == "cygwin" ]; then
       
    65 
       
    66 	SBS_HOME=${SBS_HOME//\\//}
       
    67 
       
    68 	__MINGW__=${SBS_MINGW:-$SBS_HOME/$HOSTPLATFORM_DIR/mingw}
       
    69 	__CYGWIN__=${SBS_CYGWIN:-$SBS_HOME/$HOSTPLATFORM_DIR/cygwin}
       
    70 	__PYTHON__=${SBS_PYTHON:-$SBS_HOME/$HOSTPLATFORM_DIR/python252/python.exe}
       
    71 
       
    72     # Command for unifying path strings. For example, "c:\some\path" and
       
    73     # "/cygdrive/c/some/path" will both be converted into "c:/some/path".
       
    74 	u="$__CYGWIN__/bin/cygpath.exe -m"
       
    75 
       
    76 	__MINGW__=$($u "$__MINGW__")
       
    77 	__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
       
    84 
       
    85 	# Tell Cygwin not to map unix security attributes to windows to
       
    86 	# prevent raptor from potentially creating read-only files:
       
    87 	export CYGWIN='nontsec nosmbntsec'
       
    88 
       
    89 else
       
    90 	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
       
    92 
       
    93 	export PATH LD_LIBRARY_PATH
       
    94 	__PYTHON__=python
       
    95 fi
       
    96 
       
    97 
       
    98 # call raptor_start.py with the arguments
       
    99 
       
   100 RAPTOR_START="$SBS_HOME/python/raptor_start.py"
       
   101 
       
   102 if [ -e "$RAPTOR_START" ]; then
       
   103 	# run the source version
       
   104 	${__PYTHON__} "$RAPTOR_START" "$@"
       
   105 elif [ -e "$RAPTOR_START"c ]; then
       
   106 	# run the compiled version
       
   107 	${__PYTHON__} "$RAPTOR_START"c "$@"
       
   108 else
       
   109 	echo "Cannot start SBSV2 - $RAPTOR_START not found." 1>&2
       
   110 	echo "Check your SBS_HOME environment variable." 1>&2
       
   111 fi