lib/scripts/polyml-version
author wenzelm
Fri, 08 May 2015 10:19:44 +0200
changeset 60274 c2837a39da01
parent 41515 2b456655b077
permissions -rwxr-xr-x
more conservative Document_Model.init: avoid Document.Node.Clear due to change of token marker (e.g. due to change of jEdit mode properties); clarified Isabelle.buffer_token_marker;

#!/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