lib/scripts/isabelle-platform
author wenzelm
Wed, 31 Mar 2021 11:24:46 +0200
changeset 73772 d3f2038198ae
parent 73333 bf573ed376ef
child 73928 7404f2e1d092
permissions -rw-r--r--
clarified (again): local tip could be actually more recent;
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: 66693
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=""
73241
f6051c13bffa support ISABELLE_APPLE_PLATFORM64 (Apple Silicon);
wenzelm
parents: 72603
diff changeset
     9
ISABELLE_APPLE_PLATFORM64=""
65072
36c650d1a90d more detailed platform information;
wenzelm
parents: 62911
diff changeset
    10
ISABELLE_WINDOWS_PLATFORM32=""
36c650d1a90d more detailed platform information;
wenzelm
parents: 62911
diff changeset
    11
ISABELLE_WINDOWS_PLATFORM64=""
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    12
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    13
case $(uname -s) in
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    14
  Linux)
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 48455
diff changeset
    15
    ISABELLE_PLATFORM_FAMILY="linux"
72577
728da67527b9 detect arm64-linux platform;
wenzelm
parents: 71551
diff changeset
    16
    case $(uname -m) in
728da67527b9 detect arm64-linux platform;
wenzelm
parents: 71551
diff changeset
    17
      aarch64)
728da67527b9 detect arm64-linux platform;
wenzelm
parents: 71551
diff changeset
    18
        ISABELLE_PLATFORM64=arm64-linux
728da67527b9 detect arm64-linux platform;
wenzelm
parents: 71551
diff changeset
    19
        ;;
72603
e25c0a6cc335 detect/guess arm32 platform (unsupported);
wenzelm
parents: 72577
diff changeset
    20
      arm*)
e25c0a6cc335 detect/guess arm32 platform (unsupported);
wenzelm
parents: 72577
diff changeset
    21
        ISABELLE_PLATFORM32=arm32-linux
e25c0a6cc335 detect/guess arm32 platform (unsupported);
wenzelm
parents: 72577
diff changeset
    22
        ;;
72577
728da67527b9 detect arm64-linux platform;
wenzelm
parents: 71551
diff changeset
    23
      *)
728da67527b9 detect arm64-linux platform;
wenzelm
parents: 71551
diff changeset
    24
        ISABELLE_PLATFORM32=x86-linux
728da67527b9 detect arm64-linux platform;
wenzelm
parents: 71551
diff changeset
    25
        ISABELLE_PLATFORM64=x86_64-linux
728da67527b9 detect arm64-linux platform;
wenzelm
parents: 71551
diff changeset
    26
        ;;
728da67527b9 detect arm64-linux platform;
wenzelm
parents: 71551
diff changeset
    27
    esac
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    28
    ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    29
  Darwin)
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 48455
diff changeset
    30
    ISABELLE_PLATFORM_FAMILY="macos"
71551
d72d4a9316c9 updated platform situation: 32bit variants are marginal or absent;
wenzelm
parents: 66731
diff changeset
    31
    case $(sw_vers -productVersion) in
d72d4a9316c9 updated platform situation: 32bit variants are marginal or absent;
wenzelm
parents: 66731
diff changeset
    32
      10.10*|10.11*|10.12*|10.13*|10.14*)
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    33
        ISABELLE_PLATFORM32=x86-darwin
71551
d72d4a9316c9 updated platform situation: 32bit variants are marginal or absent;
wenzelm
parents: 66731
diff changeset
    34
        ISABELLE_PLATFORM64=x86_64-darwin
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    35
        ;;
71551
d72d4a9316c9 updated platform situation: 32bit variants are marginal or absent;
wenzelm
parents: 66731
diff changeset
    36
      *)
36213
4df49260bd82 accept x86_64 results gracefully -- NB: Mac OS does report that if booted in 64 bit mode;
wenzelm
parents: 36196
diff changeset
    37
        ISABELLE_PLATFORM64=x86_64-darwin
73333
bf573ed376ef detect arm64-darwin more reliably: uname could be in x86_64 mode, e.g. within app bundle;
wenzelm
parents: 73241
diff changeset
    38
        case $(uname -a) in
bf573ed376ef detect arm64-darwin more reliably: uname could be in x86_64 mode, e.g. within app bundle;
wenzelm
parents: 73241
diff changeset
    39
          *arm64*|*ARM64*)
73241
f6051c13bffa support ISABELLE_APPLE_PLATFORM64 (Apple Silicon);
wenzelm
parents: 72603
diff changeset
    40
            ISABELLE_APPLE_PLATFORM64=arm64-darwin
f6051c13bffa support ISABELLE_APPLE_PLATFORM64 (Apple Silicon);
wenzelm
parents: 72603
diff changeset
    41
            ;;
f6051c13bffa support ISABELLE_APPLE_PLATFORM64 (Apple Silicon);
wenzelm
parents: 72603
diff changeset
    42
          *)
f6051c13bffa support ISABELLE_APPLE_PLATFORM64 (Apple Silicon);
wenzelm
parents: 72603
diff changeset
    43
            ;;
f6051c13bffa support ISABELLE_APPLE_PLATFORM64 (Apple Silicon);
wenzelm
parents: 72603
diff changeset
    44
        esac
36213
4df49260bd82 accept x86_64 results gracefully -- NB: Mac OS does report that if booted in 64 bit mode;
wenzelm
parents: 36196
diff changeset
    45
        ;;
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    46
    esac
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    47
    ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    48
  CYGWIN_NT*)
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 48455
diff changeset
    49
    ISABELLE_PLATFORM_FAMILY="windows"
71551
d72d4a9316c9 updated platform situation: 32bit variants are marginal or absent;
wenzelm
parents: 66731
diff changeset
    50
    ISABELLE_WINDOWS_PLATFORM32="x86-windows"
d72d4a9316c9 updated platform situation: 32bit variants are marginal or absent;
wenzelm
parents: 66731
diff changeset
    51
    ISABELLE_WINDOWS_PLATFORM64="x86_64-windows"
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    52
    case $(uname -m) in
66693
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    53
      x86_64)
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    54
        ISABELLE_PLATFORM64=x86_64-cygwin
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    55
        ;;
a8703e8ee1d3 basic support for x86_64-cygwin;
wenzelm
parents: 65073
diff changeset
    56
      i?86)
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    57
        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
    58
        ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    59
    esac
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    60
    ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    61
esac