Admin/polyml/bin/polyml-platform
author aspinall
Fri, 27 May 2005 13:51:32 +0200
changeset 16101 37471d84d353
parent 15878 8192fcf13618
child 16414 cad2cf55c851
permissions -rwxr-xr-x
Add back rudely removed and popular -X option.

#!/bin/sh
#
# $Id$
#
# polyml-platform --- determine Poly/ML's idea of current hardware and
# operating system type
#
# NOTE: platform identifiers should be kept as generic as possible,
# i.e. shared by compatible environments.

PLATFORM=""

case `uname -s` in
  SunOS)
    case `uname -r` in
      5.*)
        case `uname -p` in
          sparc)
            PLATFORM=sparc-solaris
            ;;
        esac
        ;;
    esac
    ;;
  Linux)
    case `uname -m` in
      i?86)
        PLATFORM=x86-linux
        ;;
      x86?64)
	PLATFORM=x86-linux
	;;
      Power* | power* | ppc)
        PLATFORM=ppc-linux
        ;;
    esac
    ;;
  FreeBSD|NetBSD)
    case `uname -m` in
      i?86)
        PLATFORM=x86-bsd
        ;;
    esac
    ;;
  Darwin)
    case `uname -m` in
      Power* | power* | ppc)
        PLATFORM=ppc-darwin
        ;;
    esac
    ;;
  Windows_NT)
    case `uname -m` in
      ?86)
        PLATFORM=x86-win32
        ;;
    esac
    ;;
esac


if [ -z "$PLATFORM" ]; then
  echo "Unknown Poly/ML platform" >&2
  exit 1
else
  echo "$PLATFORM"
fi