#!/bin/sh
# #####################################################################
# OpenText Exceed onDemand Client 8
# Copyright (c) 1997-2012 Open Text Corporation. All Rights Reserved.
# #####################################################################
# oteod_platform
# Adding supports for platform requirements 
# $Revision: 7613 $
# #####################################################################

getThisPlatform()
{
  osAix=aix
  osLinux=linux
  osSolaris=solaris
  osHPUX=hpux

  archPpc=ppc
  archi586=i586
  archx86_64=x86_64
  archSparc=sparc
  archParisc=parisc
  
  unknown=unknown
  
  thisOS=${unknown}
  thisArch=${unknown}
  
  thisUname=`uname`
 
  fgrepOptions="-c -i"
  optionL="-L"

  hasi86=`uname -a | grep ${fgrepOptions} i386`
  
  if [ ${hasi86} = "0" ] ; then
    hasi86=`uname -a | grep ${fgrepOptions} i686`
  fi

  isx86_64=`uname -a | grep ${fgrepOptions} x86_64`
  
  if [ ${hasi86} = "0" ] ; then
    if [ ! ${isx86_64} = "0" ] ; then
      thisArch=${archx86_64}    
    fi
  else
    thisArch=${archi586}
  fi
  
  case ${thisUname} in
    AIX )
      thisOS=${osAix}
      thisArch=${archPpc}   
      
    ;;
    
    Linux )
      thisOS=${osLinux}   
      isItSUSELinux
    ;;

    SunOS )
      thisOS=${osSolaris}     
          
      if [ ${hasi86}=0 ] ; then
        thisArch=${archSparc}
        optionL="-h"
      fi
    ;;
  
    HP-UX )
      thisOS=${osHPUX}      
      thisArch=${archParisc}  
    ;;

    * )
    ;;
  esac
}

