lib/scripts/isabelle-platform
author wenzelm
Tue Feb 28 23:12:52 2017 +0100 (2017-02-28)
changeset 65072 36c650d1a90d
parent 62911 78e03d8bf1c4
child 65073 b5bf76cf2b4e
permissions -rw-r--r--
more detailed platform information;
wenzelm@37012
     1
# -*- shell-script -*- :mode=shellscript:
wenzelm@36196
     2
#
wenzelm@36196
     3
# determine general hardware and operating system type for Isabelle
wenzelm@36196
     4
#
wenzelm@36196
     5
# NOTE: The ML system or JVM may have their own idea about the platform!
wenzelm@36196
     6
wenzelm@50182
     7
ISABELLE_PLATFORM_FAMILY=""
wenzelm@48455
     8
ISABELLE_PLATFORM32=""
wenzelm@36196
     9
ISABELLE_PLATFORM64=""
wenzelm@65072
    10
ISABELLE_WINDOWS_PLATFORM32=""
wenzelm@65072
    11
ISABELLE_WINDOWS_PLATFORM64=""
wenzelm@36196
    12
wenzelm@36196
    13
case $(uname -s) in
wenzelm@36196
    14
  Linux)
wenzelm@50182
    15
    ISABELLE_PLATFORM_FAMILY="linux"
wenzelm@36196
    16
    case $(uname -m) in
wenzelm@36196
    17
      i?86)
wenzelm@48455
    18
        ISABELLE_PLATFORM32=x86-linux
wenzelm@36196
    19
        ;;
wenzelm@36196
    20
      x86_64)
wenzelm@48455
    21
        ISABELLE_PLATFORM32=x86-linux
wenzelm@36196
    22
        ISABELLE_PLATFORM64=x86_64-linux
wenzelm@36196
    23
        ;;
wenzelm@36196
    24
    esac
wenzelm@36196
    25
    ;;
wenzelm@36196
    26
  Darwin)
wenzelm@50182
    27
    ISABELLE_PLATFORM_FAMILY="macos"
wenzelm@36196
    28
    case $(uname -m) in
wenzelm@36196
    29
      i?86)
wenzelm@48455
    30
        ISABELLE_PLATFORM32=x86-darwin
wenzelm@36196
    31
        if [ "$(sysctl -n hw.optional.x86_64 2>/dev/null)" = 1 ]; then
wenzelm@36196
    32
          ISABELLE_PLATFORM64=x86_64-darwin
wenzelm@36196
    33
        fi
wenzelm@36196
    34
        ;;
wenzelm@36213
    35
      x86_64)
wenzelm@48455
    36
        ISABELLE_PLATFORM32=x86-darwin
wenzelm@36213
    37
        ISABELLE_PLATFORM64=x86_64-darwin
wenzelm@36213
    38
        ;;
wenzelm@36196
    39
    esac
wenzelm@36196
    40
    ;;
wenzelm@36196
    41
  CYGWIN_NT*)
wenzelm@50182
    42
    ISABELLE_PLATFORM_FAMILY="windows"
wenzelm@36196
    43
    case $(uname -m) in
wenzelm@36213
    44
      i?86 | x86_64)
wenzelm@48455
    45
        ISABELLE_PLATFORM32=x86-cygwin
wenzelm@65072
    46
        if [ "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64" ]; then
wenzelm@65072
    47
          ISABELLE_WINDOWS_PLATFORM64="x86_64-windows"
wenzelm@65072
    48
        else
wenzelm@65072
    49
          ISABELLE_WINDOWS_PLATFORM32="x86-windows"
wenzelm@65072
    50
        fi
wenzelm@36196
    51
        ;;
wenzelm@36196
    52
    esac
wenzelm@36196
    53
    ;;
wenzelm@42716
    54
  *BSD)
wenzelm@50182
    55
    ISABELLE_PLATFORM_FAMILY="linux"
wenzelm@36196
    56
    case $(uname -m) in
wenzelm@36213
    57
      i?86 | x86_64)
wenzelm@48455
    58
        ISABELLE_PLATFORM32=x86-linux  #cf. BSD Linux Binary Compatibility
wenzelm@36196
    59
        ;;
wenzelm@36196
    60
    esac
wenzelm@36196
    61
    ;;
wenzelm@36196
    62
esac
wenzelm@36196
    63
wenzelm@48455
    64
ISABELLE_PLATFORM="$ISABELLE_PLATFORM32"
wenzelm@48455
    65