lib/scripts/polyml-platform
changeset 36201 07d4f74abd12
parent 29145 b1c6f4563df7
equal deleted inserted replaced
36200:4949ae210c38 36201:07d4f74abd12
     1 #!/usr/bin/env bash
     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 
     2 
     9 PLATFORM="unknown-platform"
     3 echo "### Legacy feature: polyml-platform script is superseded by ISABELLE_PLATFORM" >&2
    10 
     4 echo "$ISABELLE_PLATFORM"
    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"