make Isabelle logic images for current platform;
authorwenzelm
Tue Sep 26 17:05:01 2000 +0200 (2000-09-26)
changeset 100827c2021b7c664
parent 10081 352412857003
child 10083 5c669ab41d8e
make Isabelle logic images for current platform;
Admin/makebin
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Admin/makebin	Tue Sep 26 17:05:01 2000 +0200
     1.3 @@ -0,0 +1,101 @@
     1.4 +#!/bin/bash
     1.5 +#
     1.6 +# $Id$
     1.7 +#
     1.8 +# makebin -- make Isabelle logic images for current platform.
     1.9 +
    1.10 +
    1.11 +## global settings
    1.12 +
    1.13 +FAKE_BUILD=""
    1.14 +DISTBASE=~/tmp/isadist
    1.15 +TMP="/tmp/isabelle-makebin$$"
    1.16 +
    1.17 +TAR=tar
    1.18 +type -path gtar >/dev/null && TAR=gtar
    1.19 +
    1.20 +
    1.21 +## diagnostics
    1.22 +
    1.23 +PRG=$(basename "$0")
    1.24 +
    1.25 +function usage()
    1.26 +{
    1.27 +  echo
    1.28 +  echo "Usage: $PRG ARCHIVE"
    1.29 +  echo
    1.30 +  echo "  Make Isabelle logic images for current platform."
    1.31 +  echo
    1.32 +  exit 1
    1.33 +}
    1.34 +
    1.35 +function fail()
    1.36 +{
    1.37 +  echo "$1" >&2
    1.38 +  exit 2
    1.39 +}
    1.40 +
    1.41 +
    1.42 +## process command line
    1.43 +
    1.44 +[ "$#" -gt 1 ] && usage
    1.45 +
    1.46 +ARCHIVE="$1"; shift
    1.47 +
    1.48 +
    1.49 +## main
    1.50 +
    1.51 +[ ! -f "$ARCHIVE" ] && fail "Bad archive file $ARCHIVE"
    1.52 +ARCHIVE_BASE=$(basename "$ARCHIVE")
    1.53 +ARCHIVE_DIR=$(cd $(dirname "$ARCHIVE"); echo "$PWD")
    1.54 +ARCHIVE_FULL="$ARCHIVE_DIR/$ARCHIVE_BASE"
    1.55 +
    1.56 +ISABELLE_NAME=$(basename "$ARCHIVE_BASE" .tar.gz)
    1.57 +ISABELLE_HOME="$TMP/$ISABELLE_NAME"
    1.58 +
    1.59 +
    1.60 +# build logics
    1.61 +
    1.62 +mkdir "$TMP" || fail "Cannot create directory $TMP"
    1.63 +
    1.64 +cd "$TMP"
    1.65 +tar -xzf "$ARCHIVE_FULL"
    1.66 +cd "$ISABELLE_NAME"
    1.67 +
    1.68 +ISABELLE_HOME_USER=$(./bin/isatool getenv -b ISABELLE_HOME_USER)
    1.69 +[ -f "$ISABELLE_HOME_USER/etc/settings" ] && \
    1.70 +  echo "### WARNING!  Personal Isabelle settings present. " >&2
    1.71 +
    1.72 +COMPILER=$(./bin/isatool getenv -b ML_IDENTIFIER)
    1.73 +PLATFORM=$(./bin/isatool getenv -b ML_PLATFORM)
    1.74 +
    1.75 +if [ -n "$FAKE_BUILD" ]; then
    1.76 +  mkdir -p "heaps/$COMPILER"
    1.77 +  touch "heaps/$COMPILER/HOL"
    1.78 +  touch "heaps/$COMPILER/HOL-Real"
    1.79 +  touch "heaps/$COMPILER/ZF"
    1.80 +else
    1.81 +  ./build -b -m HOL-Real HOL
    1.82 +  ./build -b ZF
    1.83 +  rm -f "heaps/$COMPILER/Pure" "heaps/$COMPILER/FOL"
    1.84 +fi
    1.85 +
    1.86 +
    1.87 +# prepare result
    1.88 +
    1.89 +cd "$TMP"
    1.90 +
    1.91 +chmod -R g=o "$TMP"
    1.92 +chgrp -R isabelle "$TMP"
    1.93 +
    1.94 +for IMG in HOL HOL-Real ZF
    1.95 +do
    1.96 +  "$TAR" cf "${IMG}_$PLATFORM.tar" "$ISABELLE_NAME/heaps/$COMPILER/$IMG"
    1.97 +  gzip "${IMG}_$PLATFORM.tar"
    1.98 +  cp -f "${IMG}_$PLATFORM.tar.gz" "$DISTBASE"
    1.99 +done
   1.100 +
   1.101 +
   1.102 +# clean up
   1.103 +cd /tmp
   1.104 +rm -rf "$TMP"