lib/scripts/isabelle-platform
author wenzelm
Tue, 05 Nov 2019 14:28:00 +0100
changeset 71047 87c132cf5860
parent 66731 fe2a6ec20b4d
child 71342 d72d4a9316c9
permissions -rw-r--r--
more options;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37012
106c56e916f8 enable shell script editor mode;
wenzelm
parents: 36213
diff changeset
     1
# -*- shell-script -*- :mode=shellscript:
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
     2
#
66731
fe2a6ec20b4d discontinued rudiments of BSD support;
wenzelm
parents: 66691
diff changeset
     3
# determine general hardware and operating system type for Isabelle system tools
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
     4
#
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
     5
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 48455
diff changeset
     6
ISABELLE_PLATFORM_FAMILY=""
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
     7
ISABELLE_PLATFORM32=""
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
     8
ISABELLE_PLATFORM64=""
65072
36c650d1a90d more detailed platform information;
wenzelm
parents: 62911
diff changeset
     9
ISABELLE_WINDOWS_PLATFORM32=""
36c650d1a90d more detailed platform information;
wenzelm
parents: 62911
diff changeset
    10
ISABELLE_WINDOWS_PLATFORM64=""
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    11
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    12
case $(uname -s) in
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    13
  Linux)
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 48455
diff changeset
    14
    ISABELLE_PLATFORM_FAMILY="linux"
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    15
    case $(uname -m) in
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    16
      i?86)
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    17
        ISABELLE_PLATFORM32=x86-linux
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    18
        ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    19
      x86_64)
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    20
        ISABELLE_PLATFORM32=x86-linux
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    21
        ISABELLE_PLATFORM64=x86_64-linux
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    22
        ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    23
    esac
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    24
    ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    25
  Darwin)
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 48455
diff changeset
    26
    ISABELLE_PLATFORM_FAMILY="macos"
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    27
    case $(uname -m) in
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    28
      i?86)
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    29
        ISABELLE_PLATFORM32=x86-darwin
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    30
        if [ "$(sysctl -n hw.optional.x86_64 2>/dev/null)" = 1 ]; then
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    31
          ISABELLE_PLATFORM64=x86_64-darwin
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    32
        fi
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    33
        ;;
36213
4df49260bd82 accept x86_64 results gracefully -- NB: Mac OS does report that if booted in 64 bit mode;
wenzelm
parents: 36196
diff changeset
    34
      x86_64)
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    35
        ISABELLE_PLATFORM32=x86-darwin
36213
4df49260bd82 accept x86_64 results gracefully -- NB: Mac OS does report that if booted in 64 bit mode;
wenzelm
parents: 36196
diff changeset
    36
        ISABELLE_PLATFORM64=x86_64-darwin
4df49260bd82 accept x86_64 results gracefully -- NB: Mac OS does report that if booted in 64 bit mode;
wenzelm
parents: 36196
diff changeset
    37
        ;;
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    38
    esac
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    39
    ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    40
  CYGWIN_NT*)
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 48455
diff changeset
    41
    ISABELLE_PLATFORM_FAMILY="windows"
66691
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    42
    if [ "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64" ]; then
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    43
      ISABELLE_WINDOWS_PLATFORM32="x86-windows"
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    44
      ISABELLE_WINDOWS_PLATFORM64="x86_64-windows"
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    45
    else
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    46
      ISABELLE_WINDOWS_PLATFORM32="x86-windows"
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    47
    fi
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    48
    case $(uname -m) in
66691
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    49
      x86_64)
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    50
        ISABELLE_PLATFORM64=x86_64-cygwin
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    51
        ;;
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    52
      i?86)
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    53
        ISABELLE_PLATFORM32=x86-cygwin
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    54
        ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    55
    esac
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    56
    ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    57
esac
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    58
66691
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    59
ISABELLE_PLATFORM="${ISABELLE_PLATFORM32:-$ISABELLE_PLATFORM64}"
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    60
ISABELLE_WINDOWS_PLATFORM="${ISABELLE_WINDOWS_PLATFORM32:-$ISABELLE_WINDOWS_PLATFORM64}"