#!/bin/sh
#
#		Copyright (c) 1995 by
#		Advanced Visual Systems Inc.
#		All Rights Reserved
#
#	This software comprises unpublished confidential information of
#	Advanced Visual Systems Inc. and may not be used, copied or made
#	available to anyone, except in accordance with the license
#	under which it is furnished.
#
#	This file is under Perforce control
#	$Id: //depot/express/fcs70/build/xp_mach.sh#1 $
#

SYS_NAME=`uname -s`

if [ "$SYS_NAME" = "SunOS" ] ; then
   VERSION=`uname -r | sed -e 's/\..*$//'` 
   if [ "$VERSION" = "5" ] ; then
      MINOR=`uname -r | cut -f2 -d.`
      if [ "$MINOR" = "5" -o "$MINOR" = "6" ] ; then
         echo s2
      elif [ "$MINOR" = "7" ] ; then
         echo s7
      else
         echo s8
      fi
   else
      echo echo "OS-name: $SYS_NAME is unknown"
   fi
elif [ "$SYS_NAME" = "HP-UX" ] ; then
   MAJOR_VERSION=`uname -r | sed -e 's/B\.//' -e 's/\..*$//'`
   if [ "$MAJOR_VERSION" = "10" ] ; then
      echo hp1020
   elif [ "$MAJOR_VERSION" = "11" ] ; then
      echo hp11
   else
      echo "OS-name: $SYS_NAME is unknown"
   fi
elif [ "$SYS_NAME" = "IRIX" ] ; then
   echo sgN32
elif [ "$SYS_NAME" = "IRIX64" ] ; then
   echo sg6
elif [ "$SYS_NAME" = "AIX" ] ; then
   echo ibm
elif [ "$SYS_NAME" = "OSF1" ] ; then
   echo alpha
elif [ "$SYS_NAME" = "Linux" ] ; then
   if [ `uname --machine` = "ia64" ] ; then
      # Intel Itanium
      echo linux_ia64
   elif [ `uname --machine` = "x86_64" ] ; then
      # AMD64, Intel EM64T
      echo linux_64
   else
      # Standard 32-bit x86.
      # Use the compiler to make a guess as to which version of Red Hat
      COMPILER_VERSION=`gcc --version | grep -c 3.2`
      if [ "$COMPILER_VERSION" -ge 1 ] ; then
         # Linux Red Hat 8.0 or compatible detected
         echo linux
      else
         COMPILER_VERSION=`gcc --version | grep -c 2.96`
         if [ "$COMPILER_VERSION" -ge 1 ] ; then
            # Linux Red Hat 7.0 or compatible detected
            echo linux_rh7
         else
            echo Unknown C compiler, assuming platform Linux Red Hat 8.0 or compatible
         fi
      fi
   fi
elif [ "$SYS_NAME" = "Darwin" ] ; then
   echo darwin
else
   echo "OS-name: $SYS_NAME is unknown"
fi
