lib/scripts/polyml-version
author haftmann
Mon, 04 Nov 2019 20:38:15 +0000
changeset 71042 400e9512f1d3
parent 41515 2b456655b077
permissions -rwxr-xr-x
proof-of-concept theory for bit operations without a constructivistic representation and a minimal common logical foundation

#!/usr/bin/env bash
#
# polyml-version --- determine Poly/ML runtime system version

if [ -x "$ML_HOME/polyml-version" ]; then
  "$ML_HOME/polyml-version"
elif [ -x "$ML_HOME/poly" ]; then
  VERSION="$(env \
    LD_LIBRARY_PATH="$ML_HOME:$ML_HOME/../lib:$LD_LIBRARY_PATH" \
    DYLD_LIBRARY_PATH="$ML_HOME:$ML_HOME/../lib:$DYLD_LIBRARY_PATH" \
    "$ML_HOME/poly" -v -H 10)"
  REGEXP='^Poly/ML.*RTS version: [^ ]*(-[^ ]*).*$'
  if [[ "$VERSION" =~ $REGEXP ]]; then
    echo "polyml${BASH_REMATCH[1]}"
  else
    echo polyml-undefined
  fi
else
  echo polyml-undefined
fi