sbsv2/raptor/bin/sbs
author Mike Kinghan <mikek@symbian.org>
Thu, 25 Nov 2010 13:59:07 +0000
changeset 40 68f68128601f
parent 28 b8fa7dfeeaa1
permissions -rwxr-xr-x
1) Add the sbsv1 components from sftools/dev/build to make the linux_build package independent of the obsolete buildtools package. 2) Enhance romnibus.pl so that it generate the symbol file for the built rom when invoked by Raptor 3) Make the maksym.pl tool portable for Linux as well as Windows. 4) Remove the of armasm2as.pl from the e32tools component in favour of the copy now exported from sbsv1/e32util.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     1
#!/bin/bash
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     2
# Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     3
# All rights reserved.
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     4
# This component and the accompanying materials are made available
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     6
# which accompanies this distribution, and is available
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     8
#
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     9
# Initial Contributors:
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    11
#
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    12
# Contributors:
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    13
#
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    14
# Description:
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    15
# raptor script
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    16
# add mingw to the PATH if we are running Cygwin on Windows
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    17
#
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    18
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    19
# If SBS_HOME is not set in the environment then work it out
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    20
# from the path to this script
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    21
if [ -z "$SBS_HOME" ] ; then
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    22
	temp=$0
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    23
	SBS_HOME=$(cd ${temp%/*} && echo $PWD)
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    24
	export SBS_HOME=${SBS_HOME%/bin}
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    25
fi
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    26
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    27
# Ensure that the host type is set for Raptor:
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    28
eval $($SBS_HOME/bin/gethost.sh -e)
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    29
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    30
if [ -z "$HOSTPLATFORM" ]; then
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    31
	echo "Error: HOSTPLATFORM could not be determined." 1>&2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    32
	exit 1
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    33
fi
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    34
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    35
if [ ! -d "$SBS_HOME/$HOSTPLATFORM_DIR" ]; then
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    36
cat 1>&2 <<EOERROR
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    37
Error: sbs has not been installed with support for your platform: "${HOSTPLATFORM}".
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    38
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    39
The utilites for your platform should be in "$SBS_HOME/$HOSTPLATFORM_DIR" but sbs
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    40
cannot find them there.
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    41
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    42
sbs is supported on:
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    43
	win32
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    44
	linux i386 libc2_3 (Redhat 4)
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    45
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    46
sbs has been known to work (but is not supported) on:
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    47
	linux x86_64 libc2_5  (e.g. Centos/Redhat 5.3 64-bit)
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    48
	linux i386 libc2_8  (e.g. Fedora 9 32-bit)
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    49
	linux x86_64 libc2_10 (e.g. Fedora 11 64-bit)
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    50
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    51
Even with the appropriate utilities it may be necessary to install 32-bit
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    52
compatibility versions of some libraries (e.g. glibc) on these platforms,
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    53
particularly for 3rd party tools which are not built natively such as
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    54
compilers.
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    55
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    56
It may be possible to build and install the utilities for your platform by
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    57
entering $SBS_HOME/util and running
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    58
	make -k
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    59
A full development environment is required however.
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    60
EOERROR
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    61
	exit 1
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    62
fi
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    63
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    64
if [ "$OSTYPE" == "cygwin" ]; then
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    65
	__MINGW__=${SBS_MINGW:-$SBS_HOME/$HOSTPLATFORM_DIR/mingw}
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    66
	__CYGWIN__=${SBS_CYGWIN:-$SBS_HOME/$HOSTPLATFORM_DIR/cygwin}
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    67
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    68
	# Command for unifying path strings. For example, "c:\some\path" and
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    69
	# "/cygdrive/c/some/path" will both be converted into "c:/some/path".
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    70
	u="$__CYGWIN__/bin/cygpath.exe -m"
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    71
	
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    72
	SBS_HOME=${SBS_HOME//\\//}
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    73
	export SBS_HOME=$($u "$SBS_HOME")
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    74
	
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    75
	__MINGW__=$($u "$__MINGW__")
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    76
	__CYGWIN__=$($u "$__MINGW__")
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    77
	export PATH=${__MINGW__}/bin:${__CYGWIN__}/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    78
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    79
	# Tell Cygwin not to map unix security attributes to windows to
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    80
	# prevent raptor from potentially creating read-only files:
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    81
	export CYGWIN='nontsec nosmbntsec'
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    82
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    83
	# The python and PYTHONPATH used by Raptor are determined by, in order of precedence:
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    84
	#  1. the SBS_PYTHON and SBS_PYTHONPATH environment variables (if set)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    85
	#  2. the python shipped locally with Raptor (if present)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    86
	#  3. the python on the system PATH and the PYTHONPATH set in the system environment
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    87
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    88
	__LOCAL_PYTHON__=$SBS_HOME/win32/python264/python.exe
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    89
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    90
	if [ -n "$SBS_PYTHON" ]; then
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    91
		__PYTHON__=$SBS_PYTHON
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    92
	elif [ -f "$__LOCAL_PYTHON__" ]; then
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    93
		__PYTHON__=$__LOCAL_PYTHON__
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    94
		export SBS_PYTHON=$__PYTHON__
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    95
		export PYTHONPATH=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    96
	else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    97
		__PYTHON__=python.exe
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    98
	fi
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    99
	__PYTHON__=$($u "$__PYTHON__")		
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   100
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   101
	if [ -n "$SBS_PYTHONPATH" ]; then
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   102
		export PYTHONPATH=$($u "$SBS_PYTHONPATH")
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   103
	fi
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   104
else
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 13
diff changeset
   105
	PYDIR=python27 # not exported on purpose
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 13
diff changeset
   106
	export PYTHONPATH=${SBS_PYTHONPATH:-$SBS_HOME/$HOSTPLATFORM_DIR/$PYDIR/lib}
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 13
diff changeset
   107
	PATH=$SBS_HOME/$HOSTPLATFORM_DIR/$PYDIR/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 13
diff changeset
   108
	LD_LIBRARY_PATH=$SBS_HOME/$HOSTPLATFORM_DIR/$PYDIR/lib:$SBS_HOME/$HOSTPLATFORM_DIR/bv/lib:$LD_LIBRARY_PATH
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   109
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   110
	export PATH LD_LIBRARY_PATH
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   111
	__PYTHON__=python
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   112
fi
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   113
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   114
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   115
# call raptor_start.py with the arguments
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   116
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   117
RAPTOR_START="$SBS_HOME/python/raptor_start.py"
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   118
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   119
if [ -e "$RAPTOR_START" ]; then
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   120
	# run the source version
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   121
	${__PYTHON__} "$RAPTOR_START" "$@"
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   122
elif [ -e "$RAPTOR_START"c ]; then
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   123
	# run the compiled version
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   124
	${__PYTHON__} "$RAPTOR_START"c "$@"
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   125
else
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   126
	echo "Cannot start SBSV2 - $RAPTOR_START not found." 1>&2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   127
	echo "Check your SBS_HOME environment variable." 1>&2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
   128
fi