build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
authorwenzelm
Wed May 23 17:57:28 2012 +0200 (2012-05-23)
changeset 47970257fc09aa8a1
parent 47969 ce4345b06408
child 47971 2aea51a14200
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
Admin/java/README
Admin/java/build_linux
Admin/java/etc/settings
     1.1 --- a/Admin/java/README	Wed May 23 17:06:45 2012 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,3 +0,0 @@
     1.4 -This is JDK 1.6.0_31 for Linux from
     1.5 -http://www.oracle.com/technetwork/java/javase/downloads/index.html
     1.6 -
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/Admin/java/build_linux	Wed May 23 17:57:28 2012 +0200
     2.3 @@ -0,0 +1,106 @@
     2.4 +#!/usr/bin/env bash
     2.5 +
     2.6 +
     2.7 +## diagnostics
     2.8 +
     2.9 +PRG="$(basename "$0")"
    2.10 +THIS="$(cd $(dirname "$0"); pwd)"
    2.11 +
    2.12 +function usage()
    2.13 +{
    2.14 +  cat <<EOF
    2.15 +
    2.16 +Usage: $PRG [VERSION]
    2.17 +
    2.18 +  Build hybrid Isabelle component for JDK on x86-linux/x86_64-linux.
    2.19 +
    2.20 +  VERSION is 7u4 for 1.7.0_04 etc.
    2.21 +EOF
    2.22 +  exit 1
    2.23 +}
    2.24 +
    2.25 +function fail()
    2.26 +{
    2.27 +  echo "$1" >&2
    2.28 +  exit 2
    2.29 +}
    2.30 +
    2.31 +
    2.32 +## process command line
    2.33 +
    2.34 +# args
    2.35 +
    2.36 +VERSION=""
    2.37 +[ "$#" -gt 0 ] && { VERSION="$1"; shift; }
    2.38 +
    2.39 +[ "$#" -gt 0 ] && usage
    2.40 +
    2.41 +case "$VERSION" in
    2.42 +  *u?)
    2.43 +    MAJOR="$(echo "$VERSION" | cut -du -f1)"
    2.44 +    MINOR="0$(echo "$VERSION" | cut -du -f2)"
    2.45 +    ;;
    2.46 +  *u??)
    2.47 +    MAJOR="$(echo "$VERSION" | cut -du -f1)"
    2.48 +    MINOR="$(echo "$VERSION" | cut -du -f2)"
    2.49 +    ;;
    2.50 +  *)
    2.51 +    fail "Bad version identifier: \"$VERSION\""
    2.52 +    ;;
    2.53 +esac
    2.54 +
    2.55 +FULL_VERSION="1.${MAJOR}.0_${MINOR}"
    2.56 +
    2.57 +
    2.58 +## main
    2.59 +
    2.60 +DIR="jdk${FULL_VERSION}_x86-linux"
    2.61 +mkdir "$DIR" || fail "Cannot create fresh directory: \"$DIR\""
    2.62 +
    2.63 +
    2.64 +# README
    2.65 +
    2.66 +cat >> "$DIR/README" << EOF
    2.67 +This is JDK $FULL_VERSION for x86-linux and x86_64-linux
    2.68 +
    2.69 +See http://www.oracle.com/technetwork/java/javase/downloads/index.html
    2.70 +for the original downloads, which are covered by the Oracle Binary
    2.71 +Code License Agreement for Java SE.
    2.72 +EOF
    2.73 +
    2.74 +
    2.75 +# settings
    2.76 +
    2.77 +mkdir "$DIR/etc"
    2.78 +cat >> "$DIR/etc/settings" << EOF
    2.79 +# -*- shell-script -*- :mode=shellscript:
    2.80 +
    2.81 +ISABELLE_JDK_HOME="\$COMPONENT/\${ISABELLE_PLATFORM64:-\$ISABELLE_PLATFORM}"
    2.82 +EOF
    2.83 +
    2.84 +
    2.85 +# content
    2.86 +
    2.87 +tar -C "$DIR" -x -f "jdk-$VERSION-linux-i586.tar.gz" || \
    2.88 +  fail "Bad archive: \"jdk-$VERSION-linux-i586.tar.gz\""
    2.89 +mv "$DIR/jdk$FULL_VERSION" "$DIR/x86-linux"
    2.90 +
    2.91 +tar -C "$DIR" -x -f "jdk-$VERSION-linux-x64.tar.gz" || \
    2.92 +  fail "Bad archive: \"jdk-$VERSION-linux-x64.tar.gz\""
    2.93 +mv "$DIR/jdk$FULL_VERSION" "$DIR/x86_64-linux"
    2.94 +
    2.95 +(
    2.96 +  cd "$DIR/x86-linux"
    2.97 +  for FILE in $(find . -type f)
    2.98 +  do
    2.99 +    if cmp -s "$FILE" "../x86_64-linux/$FILE"
   2.100 +    then
   2.101 +      ln -f "$FILE" "../x86_64-linux/$FILE"
   2.102 +    fi
   2.103 +  done
   2.104 +)
   2.105 +
   2.106 +
   2.107 +# create archive
   2.108 +
   2.109 +tar -cz -f "${DIR}.tar.gz" "$DIR" && rm -rf "$DIR"
     3.1 --- a/Admin/java/etc/settings	Wed May 23 17:06:45 2012 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,4 +0,0 @@
     3.4 -# -*- shell-script -*- :mode=shellscript:
     3.5 -
     3.6 -ISABELLE_JDK_HOME="$COMPONENT/jdk1.6.0_31"
     3.7 -