sbsv2/raptor/bin/gethost.sh
changeset 713 7b7f0409fc00
parent 674 37ee82a83d43
--- a/sbsv2/raptor/bin/gethost.sh	Tue Nov 30 13:59:58 2010 +0800
+++ b/sbsv2/raptor/bin/gethost.sh	Tue Nov 30 14:05:41 2010 +0800
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 
-# Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of the License "Eclipse Public License v1.0"
@@ -25,20 +25,29 @@
 
 getopts de  OPT
 
-if [[ "${OSTYPE}" =~ "linux" ]]; then
+if [[ "${OSTYPE}" =~ "linux" || "${HOSTPLATFORM}" =~ "linux" ]]; then
 	ARCH=$(uname -i)
         LIBC=$(echo /lib/libc-* | sed -r 's#.*/libc-([0-9]*)\.([0-9]*)(\.([0-9]*))?.so#libc\1_\2#')
         HOSTPLATFORM="linux ${ARCH} ${LIBC}"
 
-	if [ "$LIBC" == "libc2_3" ]; then
-        	HOSTPLATFORM_DIR="linux-${ARCH}"
-	else
-        	HOSTPLATFORM_DIR="linux-${ARCH}-${LIBC}"
+	# The 32-bit platform is often compatible in the sense that
+	# a) 32-bit programs can run on the 64-bit OS.
+	# b) a 64-bit OS can tell the compiler to create 32-bit executables.
+
+       	ARCH32="i386"
+
+	# deal with ubuntu/debian:
+	if [ "$ARCH" == "unknown" ]; then
+		ARCH32="${ARCH}"
 	fi
+
+       	HOSTPLATFORM_DIR="linux-${ARCH}-${LIBC}"
+       	HOSTPLATFORM32_DIR="linux-${ARCH32}-${LIBC}"
 	
 elif [[ "$OS" == "Windows_NT" ]]; then
 	HOSTPLATFORM="win 32"
 	HOSTPLATFORM_DIR="win32"
+	HOSTPLATFORM32_DIR="win32"
 else
 	HOSTPLATFORM=unknown
 	HOSTPLATFORM_DIR=unknown
@@ -46,6 +55,7 @@
 
 if [ "$OPT" == "e" ]; then 
 	echo "export HOSTPLATFORM_DIR=$HOSTPLATFORM_DIR"
+	echo "export HOSTPLATFORM32_DIR=$HOSTPLATFORM32_DIR"
 	echo "export HOSTPLATFORM='$HOSTPLATFORM'"
 elif [ "$OPT" == "d" ]; then 
 	echo "$HOSTPLATFORM_DIR"