lib/scripts/polyml-version
author wenzelm
Tue Jan 11 21:52:10 2011 +0100 (2011-01-11)
changeset 41515 2b456655b077
parent 41495 f8c11067e124
permissions -rwxr-xr-x
tuned (cf. 2fe62d602681);
wenzelm@16996
     1
#!/usr/bin/env bash
wenzelm@16996
     2
#
wenzelm@16996
     3
# polyml-version --- determine Poly/ML runtime system version
wenzelm@16996
     4
wenzelm@41495
     5
if [ -x "$ML_HOME/polyml-version" ]; then
wenzelm@41495
     6
  "$ML_HOME/polyml-version"
wenzelm@41495
     7
elif [ -x "$ML_HOME/poly" ]; then
wenzelm@40546
     8
  VERSION="$(env \
wenzelm@40546
     9
    LD_LIBRARY_PATH="$ML_HOME:$ML_HOME/../lib:$LD_LIBRARY_PATH" \
wenzelm@31695
    10
    DYLD_LIBRARY_PATH="$ML_HOME:$ML_HOME/../lib:$DYLD_LIBRARY_PATH" \
wenzelm@40546
    11
    "$ML_HOME/poly" -v -H 10)"
wenzelm@40546
    12
  REGEXP='^Poly/ML.*RTS version: [^ ]*(-[^ ]*).*$'
wenzelm@40546
    13
  if [[ "$VERSION" =~ $REGEXP ]]; then
wenzelm@40546
    14
    echo "polyml${BASH_REMATCH[1]}"
wenzelm@40546
    15
  else
wenzelm@41515
    16
    echo polyml-undefined
wenzelm@40546
    17
  fi
wenzelm@40546
    18
else
wenzelm@41515
    19
  echo polyml-undefined
wenzelm@16996
    20
fi