lib/scripts/isabelle-platform
author wenzelm
Wed Nov 01 17:29:14 2017 +0100 (20 months ago)
changeset 66980 8947cf58cb86
parent 66731 fe2a6ec20b4d
permissions -rw-r--r--
tuned output;
wenzelm@37012
     1
# -*- shell-script -*- :mode=shellscript:
wenzelm@36196
     2
#
wenzelm@66731
     3
# determine general hardware and operating system type for Isabelle system tools
wenzelm@36196
     4
#
wenzelm@36196
     5
wenzelm@50182
     6
ISABELLE_PLATFORM_FAMILY=""
wenzelm@48455
     7
ISABELLE_PLATFORM32=""
wenzelm@36196
     8
ISABELLE_PLATFORM64=""
wenzelm@65072
     9
ISABELLE_WINDOWS_PLATFORM32=""
wenzelm@65072
    10
ISABELLE_WINDOWS_PLATFORM64=""
wenzelm@36196
    11
wenzelm@36196
    12
case $(uname -s) in
wenzelm@36196
    13
  Linux)
wenzelm@50182
    14
    ISABELLE_PLATFORM_FAMILY="linux"
wenzelm@36196
    15
    case $(uname -m) in
wenzelm@36196
    16
      i?86)
wenzelm@48455
    17
        ISABELLE_PLATFORM32=x86-linux
wenzelm@36196
    18
        ;;
wenzelm@36196
    19
      x86_64)
wenzelm@48455
    20
        ISABELLE_PLATFORM32=x86-linux
wenzelm@36196
    21
        ISABELLE_PLATFORM64=x86_64-linux
wenzelm@36196
    22
        ;;
wenzelm@36196
    23
    esac
wenzelm@36196
    24
    ;;
wenzelm@36196
    25
  Darwin)
wenzelm@50182
    26
    ISABELLE_PLATFORM_FAMILY="macos"
wenzelm@36196
    27
    case $(uname -m) in
wenzelm@36196
    28
      i?86)
wenzelm@48455
    29
        ISABELLE_PLATFORM32=x86-darwin
wenzelm@36196
    30
        if [ "$(sysctl -n hw.optional.x86_64 2>/dev/null)" = 1 ]; then
wenzelm@36196
    31
          ISABELLE_PLATFORM64=x86_64-darwin
wenzelm@36196
    32
        fi
wenzelm@36196
    33
        ;;
wenzelm@36213
    34
      x86_64)
wenzelm@48455
    35
        ISABELLE_PLATFORM32=x86-darwin
wenzelm@36213
    36
        ISABELLE_PLATFORM64=x86_64-darwin
wenzelm@36213
    37
        ;;
wenzelm@36196
    38
    esac
wenzelm@36196
    39
    ;;
wenzelm@36196
    40
  CYGWIN_NT*)
wenzelm@50182
    41
    ISABELLE_PLATFORM_FAMILY="windows"
wenzelm@66691
    42
    if [ "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64" ]; then
wenzelm@66691
    43
      ISABELLE_WINDOWS_PLATFORM32="x86-windows"
wenzelm@66691
    44
      ISABELLE_WINDOWS_PLATFORM64="x86_64-windows"
wenzelm@66691
    45
    else
wenzelm@66691
    46
      ISABELLE_WINDOWS_PLATFORM32="x86-windows"
wenzelm@66691
    47
    fi
wenzelm@36196
    48
    case $(uname -m) in
wenzelm@66691
    49
      x86_64)
wenzelm@66691
    50
        ISABELLE_PLATFORM64=x86_64-cygwin
wenzelm@66691
    51
        ;;
wenzelm@66691
    52
      i?86)
wenzelm@48455
    53
        ISABELLE_PLATFORM32=x86-cygwin
wenzelm@36196
    54
        ;;
wenzelm@36196
    55
    esac
wenzelm@36196
    56
    ;;
wenzelm@36196
    57
esac
wenzelm@36196
    58
wenzelm@66691
    59
ISABELLE_PLATFORM="${ISABELLE_PLATFORM32:-$ISABELLE_PLATFORM64}"
wenzelm@66691
    60
ISABELLE_WINDOWS_PLATFORM="${ISABELLE_WINDOWS_PLATFORM32:-$ISABELLE_WINDOWS_PLATFORM64}"