lib/scripts/isabelle-platform
author wenzelm
Wed, 06 Jun 2018 14:50:18 +0200
changeset 68401 cd53ad6e7d96
parent 66731 fe2a6ec20b4d
child 71342 d72d4a9316c9
permissions -rw-r--r--
Added tag Isabelle2018-RC0 for changeset 194fa3d2d6a4

# -*- shell-script -*- :mode=shellscript:
#
# determine general hardware and operating system type for Isabelle system tools
#

ISABELLE_PLATFORM_FAMILY=""
ISABELLE_PLATFORM32=""
ISABELLE_PLATFORM64=""
ISABELLE_WINDOWS_PLATFORM32=""
ISABELLE_WINDOWS_PLATFORM64=""

case $(uname -s) in
  Linux)
    ISABELLE_PLATFORM_FAMILY="linux"
    case $(uname -m) in
      i?86)
        ISABELLE_PLATFORM32=x86-linux
        ;;
      x86_64)
        ISABELLE_PLATFORM32=x86-linux
        ISABELLE_PLATFORM64=x86_64-linux
        ;;
    esac
    ;;
  Darwin)
    ISABELLE_PLATFORM_FAMILY="macos"
    case $(uname -m) in
      i?86)
        ISABELLE_PLATFORM32=x86-darwin
        if [ "$(sysctl -n hw.optional.x86_64 2>/dev/null)" = 1 ]; then
          ISABELLE_PLATFORM64=x86_64-darwin
        fi
        ;;
      x86_64)
        ISABELLE_PLATFORM32=x86-darwin
        ISABELLE_PLATFORM64=x86_64-darwin
        ;;
    esac
    ;;
  CYGWIN_NT*)
    ISABELLE_PLATFORM_FAMILY="windows"
    if [ "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64" ]; then
      ISABELLE_WINDOWS_PLATFORM32="x86-windows"
      ISABELLE_WINDOWS_PLATFORM64="x86_64-windows"
    else
      ISABELLE_WINDOWS_PLATFORM32="x86-windows"
    fi
    case $(uname -m) in
      x86_64)
        ISABELLE_PLATFORM64=x86_64-cygwin
        ;;
      i?86)
        ISABELLE_PLATFORM32=x86-cygwin
        ;;
    esac
    ;;
esac

ISABELLE_PLATFORM="${ISABELLE_PLATFORM32:-$ISABELLE_PLATFORM64}"
ISABELLE_WINDOWS_PLATFORM="${ISABELLE_WINDOWS_PLATFORM32:-$ISABELLE_WINDOWS_PLATFORM64}"