#!/bin/sh

# Output the platform for PVS: consists of the architecture-os
# currently redhat4, redhat5, or solaris.
# In each case, we try to work out the arch, os, and os_version.
# This is driven by the operating system (uname -s), since the machine type
# (uname -m) is just a number for AIX systems.

# --------------------------------------------------------------------
# PVS
# Copyright (C) 2006, SRI International.  All Rights Reserved.

# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
# --------------------------------------------------------------------

case `uname -s` in
  SunOS) case `uname -m` in
	   sun4*) arch=sun4;;
	   sun3*) arch=sun3;;
	   *)     arch=`uname -m`;;
	 esac
	 os=SunOS
         os_version=`uname -r | cut -d"." -f1`;;
  Linux|FreeBSD) arch=linux
		 os=Linux;;
  AIX) arch=powerpc-ibm
       os=AIX
       os_version=`uname -r`;;
  Darwin) case `uname -p` in
            powerpc) arch=powerpc;;
	    i*86) arch=ix86;;
	    *) arch=`uname -p`;;
	  esac
          os=MacOSX
	  # os_version=`uname -r | cut -d"." -f1`
	  os_version=;;
  *)   arch=`uname -m`
       os=`uname -s`
       os_version=`uname -r | cut -d"." -f1`;;
esac
echo "${arch}-${os}${os_version}"
