lib/scripts/polyml-platform
author wenzelm
Sat Dec 20 11:55:34 2008 +0100 (2008-12-20)
changeset 29145 b1c6f4563df7
parent 25348 510b46987886
child 36201 07d4f74abd12
permissions -rwxr-xr-x
removed Ids;
     1 #!/usr/bin/env bash
     2 #
     3 # polyml-platform --- determine Poly/ML's idea of current hardware and
     4 # operating system type
     5 #
     6 # NOTE: platform identifiers should be kept as generic as possible,
     7 # i.e. shared by compatible environments.
     8 
     9 PLATFORM="unknown-platform"
    10 
    11 case $(uname -s) in
    12   SunOS)
    13     case $(uname -r) in
    14       5.*)
    15         case $(uname -p) in
    16           sparc)
    17             PLATFORM=sparc-solaris
    18             ;;
    19           i?86)
    20             PLATFORM=x86-solaris
    21             ;;
    22         esac
    23         ;;
    24     esac
    25     ;;
    26   Linux)
    27     case $(uname -m) in
    28       i?86 | x86_64)
    29         PLATFORM=x86-linux
    30         ;;
    31       Power* | power* | ppc)
    32         PLATFORM=ppc-linux
    33         ;;
    34     esac
    35     ;;
    36   FreeBSD|NetBSD)
    37     case $(uname -m) in
    38       i?86)
    39         PLATFORM=x86-bsd
    40         ;;
    41     esac
    42     ;;
    43   Darwin)
    44     case $(uname -m) in
    45       Power* | power* | ppc)
    46         PLATFORM=ppc-darwin
    47         ;;
    48       i?86)
    49         PLATFORM=x86-darwin
    50         ;;
    51     esac
    52     ;;
    53   CYGWIN_NT*)
    54     case $(uname -m) in
    55       i?86)
    56         PLATFORM=x86-cygwin
    57         ;;
    58     esac
    59     ;;
    60   Windows_NT)
    61     case $(uname -m) in
    62       ?86)
    63         PLATFORM=x86-win32
    64         ;;
    65     esac
    66     ;;
    67 esac
    68 
    69 echo "$PLATFORM"