lib/scripts/isabelle-platform
author wenzelm
Mon, 24 Oct 2016 14:05:22 +0200
changeset 64371 213cf4215b40
parent 62911 78e03d8bf1c4
child 65072 36c650d1a90d
permissions -rw-r--r--
more robust;
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
#
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
     3
# determine general hardware and operating system type for Isabelle
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
# NOTE: The ML system or JVM may have their own idea about the platform!
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
     6
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 48455
diff changeset
     7
ISABELLE_PLATFORM_FAMILY=""
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
     8
ISABELLE_PLATFORM32=""
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
     9
ISABELLE_PLATFORM64=""
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    10
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    11
case $(uname -s) in
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    12
  Linux)
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 48455
diff changeset
    13
    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
    14
    case $(uname -m) in
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    15
      i?86)
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    16
        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
    17
        ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    18
      x86_64)
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    19
        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
    20
        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
    21
        ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    22
    esac
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    23
    ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    24
  Darwin)
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 48455
diff changeset
    25
    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
    26
    case $(uname -m) in
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    27
      i?86)
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    28
        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
    29
        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
    30
          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
    31
        fi
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    32
        ;;
36213
4df49260bd82 accept x86_64 results gracefully -- NB: Mac OS does report that if booted in 64 bit mode;
wenzelm
parents: 36196
diff changeset
    33
      x86_64)
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    34
        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
    35
        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
    36
        ;;
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    37
    esac
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    38
    ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    39
  CYGWIN_NT*)
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 48455
diff changeset
    40
    ISABELLE_PLATFORM_FAMILY="windows"
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    41
    case $(uname -m) in
36213
4df49260bd82 accept x86_64 results gracefully -- NB: Mac OS does report that if booted in 64 bit mode;
wenzelm
parents: 36196
diff changeset
    42
      i?86 | x86_64)
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    43
        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
    44
        ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    45
    esac
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    46
    ;;
42716
45eb6829dde2 pretend that all versions of BSD are Linux, which might actually work due to binary compatibilty mode of these obsolete platforms;
wenzelm
parents: 37012
diff changeset
    47
  *BSD)
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 48455
diff changeset
    48
    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
    49
    case $(uname -m) in
36213
4df49260bd82 accept x86_64 results gracefully -- NB: Mac OS does report that if booted in 64 bit mode;
wenzelm
parents: 36196
diff changeset
    50
      i?86 | x86_64)
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    51
        ISABELLE_PLATFORM32=x86-linux  #cf. BSD Linux Binary Compatibility
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    52
        ;;
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
diff changeset
    53
    esac
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
48455
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    57
ISABELLE_PLATFORM="$ISABELLE_PLATFORM32"
a509f19d4cc6 provide explicit ISABELLE_PLATFORM32 as well;
wenzelm
parents: 42716
diff changeset
    58