sbsv2/raptor/bin/sbs
changeset 674 37ee82a83d43
parent 625 a1925fb7753a
equal deleted inserted replaced
673:7ae5f757318b 674:37ee82a83d43
    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 script
    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
    25 fi
    25 fi
    26 
    26 
    27 # Ensure that the host type is set for Raptor:
    27 # Call sbs_env script
    28 eval $($SBS_HOME/bin/gethost.sh -e)
    28 source $SBS_HOME/bin/sbs_env
    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 	__MINGW__=${SBS_MINGW:-$SBS_HOME/$HOSTPLATFORM_DIR/mingw}
       
    66 	__CYGWIN__=${SBS_CYGWIN:-$SBS_HOME/$HOSTPLATFORM_DIR/cygwin}
       
    67 
       
    68 	# Command for unifying path strings. For example, "c:\some\path" and
       
    69 	# "/cygdrive/c/some/path" will both be converted into "c:/some/path".
       
    70 	u="$__CYGWIN__/bin/cygpath.exe -m"
       
    71 	
       
    72 	SBS_HOME=${SBS_HOME//\\//}
       
    73 	export SBS_HOME=$($u "$SBS_HOME")
       
    74 	
       
    75 	__MINGW__=$($u "$__MINGW__")
       
    76 	__CYGWIN__=$($u "$__MINGW__")
       
    77 	export PATH=${__MINGW__}/bin:${__CYGWIN__}/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH
       
    78 
       
    79 	# Tell Cygwin not to map unix security attributes to windows to
       
    80 	# prevent raptor from potentially creating read-only files:
       
    81 	export CYGWIN='nontsec nosmbntsec'
       
    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
       
   104 else
       
   105 	PYDIR=python27 # not exported on purpose
       
   106 	export PYTHONPATH=${SBS_PYTHONPATH:-$SBS_HOME/$HOSTPLATFORM_DIR/$PYDIR/lib}
       
   107 	PATH=$SBS_HOME/$HOSTPLATFORM_DIR/$PYDIR/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH
       
   108 	LD_LIBRARY_PATH=$SBS_HOME/$HOSTPLATFORM_DIR/$PYDIR/lib:$SBS_HOME/$HOSTPLATFORM_DIR/bv/lib:$LD_LIBRARY_PATH
       
   109 
       
   110 	export PATH LD_LIBRARY_PATH
       
   111 	__PYTHON__=python
       
   112 fi
       
   113 
       
   114 
    29 
   115 # call raptor_start.py with the arguments
    30 # call raptor_start.py with the arguments
   116 
    31 
   117 RAPTOR_START="$SBS_HOME/python/raptor_start.py"
    32 RAPTOR_START="$SBS_HOME/python/raptor_start.py"
   118 
    33