src/HOL/Tools/Predicate_Compile/lib/scripts/swipl_version
author wenzelm
Tue, 16 Apr 2013 17:54:14 +0200
changeset 51709 19b47bfac6ef
parent 41952 c7297638599b
permissions -rwxr-xr-x
proper prolog command-line instead of hashbang, which might switch to invalid executable and thus fail (notably on lxbroy2); speculative update for yap (untested);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40243
3102b27ca03a adding a simple check to only run with a SWI-Prolog version known to work
bulwahn
parents:
diff changeset
     1
#!/usr/bin/env bash
3102b27ca03a adding a simple check to only run with a SWI-Prolog version known to work
bulwahn
parents:
diff changeset
     2
#
3102b27ca03a adding a simple check to only run with a SWI-Prolog version known to work
bulwahn
parents:
diff changeset
     3
# Author: Lukas Bulwahn, TU Muenchen, 2010
3102b27ca03a adding a simple check to only run with a SWI-Prolog version known to work
bulwahn
parents:
diff changeset
     4
#
3102b27ca03a adding a simple check to only run with a SWI-Prolog version known to work
bulwahn
parents:
diff changeset
     5
# Determine SWI-Prolog version
3102b27ca03a adding a simple check to only run with a SWI-Prolog version known to work
bulwahn
parents:
diff changeset
     6
41952
c7297638599b cleanup of former settings GHC_PATH, EXEC_GHC, EXEC_OCAML, EXEC_SWIPL, EXEC_YAP -- discontinued implicit detection;
wenzelm
parents: 41690
diff changeset
     7
if [ "$ISABELLE_SWIPL" != "" ]; then
c7297638599b cleanup of former settings GHC_PATH, EXEC_GHC, EXEC_OCAML, EXEC_SWIPL, EXEC_YAP -- discontinued implicit detection;
wenzelm
parents: 41690
diff changeset
     8
  VERSION="$("$ISABELLE_SWIPL" --version)"
41690
53b1da988e75 making the bash script swipl_version closer to Isabelle's conventional bash scripts
bulwahn
parents: 41308
diff changeset
     9
  REGEXP='^SWI-Prolog version ([0-9\.]*) for .*$'
53b1da988e75 making the bash script swipl_version closer to Isabelle's conventional bash scripts
bulwahn
parents: 41308
diff changeset
    10
  if [[ "$VERSION" =~ $REGEXP ]]; then
41952
c7297638599b cleanup of former settings GHC_PATH, EXEC_GHC, EXEC_OCAML, EXEC_SWIPL, EXEC_YAP -- discontinued implicit detection;
wenzelm
parents: 41690
diff changeset
    11
    echo -n "${BASH_REMATCH[1]}"
41690
53b1da988e75 making the bash script swipl_version closer to Isabelle's conventional bash scripts
bulwahn
parents: 41308
diff changeset
    12
  else
41952
c7297638599b cleanup of former settings GHC_PATH, EXEC_GHC, EXEC_OCAML, EXEC_SWIPL, EXEC_YAP -- discontinued implicit detection;
wenzelm
parents: 41690
diff changeset
    13
    echo -n undefined
41690
53b1da988e75 making the bash script swipl_version closer to Isabelle's conventional bash scripts
bulwahn
parents: 41308
diff changeset
    14
  fi
40243
3102b27ca03a adding a simple check to only run with a SWI-Prolog version known to work
bulwahn
parents:
diff changeset
    15
fi