author | Richard Taylor <richard.i.taylor@nokia.com> |
Thu, 12 Aug 2010 09:00:16 +0100 | |
changeset 625 | a1925fb7753a |
parent 591 | 22486c9c7b15 |
child 674 | 37ee82a83d43 |
permissions | -rwxr-xr-x |
591 | 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 |
EOERROR |
|
39 |
exit 1 |
|
40 |
fi |
|
41 |
||
42 |
if [ "$OSTYPE" == "cygwin" ]; then |
|
43 |
||
44 |
SBS_HOME=${SBS_HOME//\\//} |
|
45 |
||
46 |
__MINGW__=${SBS_MINGW:-$SBS_HOME/$HOSTPLATFORM_DIR/mingw} |
|
47 |
__CYGWIN__=${SBS_CYGWIN:-$SBS_HOME/$HOSTPLATFORM_DIR/cygwin} |
|
48 |
__PYTHON__=${SBS_PYTHON:-$SBS_HOME/$HOSTPLATFORM_DIR/python264/python.exe} |
|
49 |
export PYTHONPATH=${SBS_PYTHONPATH:-$SBS_HOME/$HOSTPLATFORM_DIR/python264} |
|
50 |
||
51 |
# Command for unifying path strings. For example, "c:\some\path" and |
|
52 |
# "/cygdrive/c/some/path" will both be converted into "c:/some/path". |
|
53 |
u="$__CYGWIN__/bin/cygpath.exe -m" |
|
54 |
||
55 |
__MINGW__=$($u "$__MINGW__") |
|
56 |
__CYGWIN__=$($u "$__MINGW__") |
|
57 |
__PYTHON__=$($u "$__PYTHON__") |
|
58 |
||
59 |
export SBS_HOME=$($u "$SBS_HOME") |
|
60 |
||
61 |
export PATH=${__MINGW__}/bin:${__CYGWIN__}/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH |
|
62 |
||
63 |
# Tell Cygwin not to map unix security attributes to windows to |
|
64 |
# prevent raptor from potentially creating read-only files: |
|
65 |
export CYGWIN='nontsec nosmbntsec' |
|
66 |
||
625
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
67 |
else |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
68 |
PYDIR=python27 # not exported on purpose |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
69 |
export PYTHONPATH=${SBS_PYTHONPATH:-$SBS_HOME/$HOSTPLATFORM_DIR/$PYDIR/lib} |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
70 |
PATH=$SBS_HOME/$HOSTPLATFORM_DIR/$PYDIR/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
71 |
LD_LIBRARY_PATH=$SBS_HOME/$HOSTPLATFORM_DIR/$PYDIR/lib:$SBS_HOME/$HOSTPLATFORM_DIR/bv/lib:$LD_LIBRARY_PATH |
591 | 72 |
|
73 |
export PATH LD_LIBRARY_PATH |
|
74 |
__PYTHON__=python |
|
75 |
fi |
|
76 |
||
77 |
||
78 |
# call sbs_filter.py with the arguments |
|
79 |
||
80 |
FILTER_START="$SBS_HOME/bin/sbs_filter.py" |
|
81 |
||
82 |
if [ -e "$FILTER_START" ]; then |
|
83 |
# run the source version |
|
84 |
${__PYTHON__} "$FILTER_START" "$@" |
|
85 |
elif [ -e "$FILTER_START"c ]; then |
|
86 |
# run the compiled version |
|
87 |
${__PYTHON__} "$FILTER_START"c "$@" |
|
88 |
else |
|
89 |
echo "Cannot start sbs_filter - $FILTER_START not found." 1>&2 |
|
90 |
echo "Check your SBS_HOME environment variable." 1>&2 |
|
91 |
fi |
|
92 |