build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
authorwenzelm
Wed, 23 May 2012 17:57:28 +0200
changeset 47970 257fc09aa8a1
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
--- a/Admin/java/README	Wed May 23 17:06:45 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-This is JDK 1.6.0_31 for Linux from
-http://www.oracle.com/technetwork/java/javase/downloads/index.html
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/java/build_linux	Wed May 23 17:57:28 2012 +0200
@@ -0,0 +1,106 @@
+#!/usr/bin/env bash
+
+
+## diagnostics
+
+PRG="$(basename "$0")"
+THIS="$(cd $(dirname "$0"); pwd)"
+
+function usage()
+{
+  cat <<EOF
+
+Usage: $PRG [VERSION]
+
+  Build hybrid Isabelle component for JDK on x86-linux/x86_64-linux.
+
+  VERSION is 7u4 for 1.7.0_04 etc.
+EOF
+  exit 1
+}
+
+function fail()
+{
+  echo "$1" >&2
+  exit 2
+}
+
+
+## process command line
+
+# args
+
+VERSION=""
+[ "$#" -gt 0 ] && { VERSION="$1"; shift; }
+
+[ "$#" -gt 0 ] && usage
+
+case "$VERSION" in
+  *u?)
+    MAJOR="$(echo "$VERSION" | cut -du -f1)"
+    MINOR="0$(echo "$VERSION" | cut -du -f2)"
+    ;;
+  *u??)
+    MAJOR="$(echo "$VERSION" | cut -du -f1)"
+    MINOR="$(echo "$VERSION" | cut -du -f2)"
+    ;;
+  *)
+    fail "Bad version identifier: \"$VERSION\""
+    ;;
+esac
+
+FULL_VERSION="1.${MAJOR}.0_${MINOR}"
+
+
+## main
+
+DIR="jdk${FULL_VERSION}_x86-linux"
+mkdir "$DIR" || fail "Cannot create fresh directory: \"$DIR\""
+
+
+# README
+
+cat >> "$DIR/README" << EOF
+This is JDK $FULL_VERSION for x86-linux and x86_64-linux
+
+See http://www.oracle.com/technetwork/java/javase/downloads/index.html
+for the original downloads, which are covered by the Oracle Binary
+Code License Agreement for Java SE.
+EOF
+
+
+# settings
+
+mkdir "$DIR/etc"
+cat >> "$DIR/etc/settings" << EOF
+# -*- shell-script -*- :mode=shellscript:
+
+ISABELLE_JDK_HOME="\$COMPONENT/\${ISABELLE_PLATFORM64:-\$ISABELLE_PLATFORM}"
+EOF
+
+
+# content
+
+tar -C "$DIR" -x -f "jdk-$VERSION-linux-i586.tar.gz" || \
+  fail "Bad archive: \"jdk-$VERSION-linux-i586.tar.gz\""
+mv "$DIR/jdk$FULL_VERSION" "$DIR/x86-linux"
+
+tar -C "$DIR" -x -f "jdk-$VERSION-linux-x64.tar.gz" || \
+  fail "Bad archive: \"jdk-$VERSION-linux-x64.tar.gz\""
+mv "$DIR/jdk$FULL_VERSION" "$DIR/x86_64-linux"
+
+(
+  cd "$DIR/x86-linux"
+  for FILE in $(find . -type f)
+  do
+    if cmp -s "$FILE" "../x86_64-linux/$FILE"
+    then
+      ln -f "$FILE" "../x86_64-linux/$FILE"
+    fi
+  done
+)
+
+
+# create archive
+
+tar -cz -f "${DIR}.tar.gz" "$DIR" && rm -rf "$DIR"
--- a/Admin/java/etc/settings	Wed May 23 17:06:45 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-# -*- shell-script -*- :mode=shellscript:
-
-ISABELLE_JDK_HOME="$COMPONENT/jdk1.6.0_31"
-