1#!/usr/bin/env bash
2#
3# Copyright 2014, NICTA
4#
5# This software may be distributed and modified according to the terms of
6# the BSD 2-Clause license. Note that NO WARRANTY is provided.
7# See "LICENSE_BSD2.txt" for details.
8#
9# @TAG(NICTA_BSD)
10#
11
12DIR=$( cd "$( dirname "$BASH_SOURCE[0]}" )" && pwd)
13
14if [ -z $1 ] ; then
15 echo
16 echo "Usage: install.sh ISABELLE_BIN [-P]"
17 echo
18 echo "      ISABELLE_BIN   isabelle command proofcount should be installed to"
19 echo "      -P             attempt to patch isabelle to allow metric collection"
20 exit 1
21fi
22
23ISABELLE_TOOL="$1"
24
25export `$ISABELLE_TOOL getenv ISABELLE_PROOFCOUNT_HOME`
26export `$ISABELLE_TOOL getenv ISABELLE_HOME_USER`
27
28if [ -z "$ISABELLE_HOME_USER" ] ; then
29  echo "Missing Isabelle Home"
30  exit 1
31fi
32
33if [ -z "$ISABELLE_PROOFCOUNT_HOME" ] ; then
34  echo "init_component "$DIR/"" >> "$ISABELLE_HOME_USER/etc/settings"
35fi
36
37if [ "$2" = "-P" ] ; then
38  "$ISABELLE_TOOL" proofcount -P
39fi
40
41