# HG changeset patch # User wenzelm # Date 1381173884 -7200 # Node ID da2e6282a4f51da43bdeda157c8f6c26ba769b29 # Parent d6121362d705b5fa213f2189cf4dc91c280efbac native executable even for Linux, to avoid surprises with file managers opening executable script as text file; diff -r d6121362d705 -r da2e6282a4f5 Admin/Linux/Isabelle --- a/Admin/Linux/Isabelle Mon Oct 07 17:55:01 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# -# Author: Makarius -# -# Main Isabelle application wrapper. - -# dereference executable -if [ -L "$0" ]; then - TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')" - exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@" -fi - - -# minimal Isabelle environment - -ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; pwd)" -source "$ISABELLE_HOME/lib/scripts/isabelle-platform" - - -# main - -#paranoia setting -- avoid problems of Java/Swing versus XIM/IBus etc. -unset XMODIFIERS - -exec "$ISABELLE_HOME/contrib/jdk/${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM32}/bin/java" \ - "-Disabelle.home=$ISABELLE_HOME" \ - {JAVA_ARGS} \ - -classpath "{CLASSPATH}" \ - isabelle.Main "$@" - diff -r d6121362d705 -r da2e6282a4f5 Admin/Linux/Isabelle.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Admin/Linux/Isabelle.c Mon Oct 07 21:24:44 2013 +0200 @@ -0,0 +1,39 @@ +/* Author: Makarius + +Main Isabelle application executable. +*/ + +#include +#include +#include +#include +#include + + +static void fail(const char *msg) +{ + fprintf(stderr, "%s\n", msg); + exit(2); +} + + +int main(int argc, char *argv[]) +{ + char **cmd_line = NULL; + int i = 0; + + cmd_line = malloc(sizeof(char *) * argc); + if (cmd_line == NULL) fail("Failed to allocate command line"); + + cmd_line[0] = malloc(strlen(argv[0]) + 5); + if (cmd_line[0] == NULL) fail("Failed to allocate command line"); + + strcpy(cmd_line[0], argv[0]); + strcat(cmd_line[0], ".run"); + + for (i = 1; i < argc; i++) cmd_line[i] = argv[i]; + + execvp(cmd_line[0], cmd_line); + fail("Failed to execute application script"); +} + diff -r d6121362d705 -r da2e6282a4f5 Admin/Linux/Isabelle.run --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Admin/Linux/Isabelle.run Mon Oct 07 21:24:44 2013 +0200 @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# Author: Makarius +# +# Main Isabelle application script. + +# dereference executable +if [ -L "$0" ]; then + TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')" + exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@" +fi + + +# minimal Isabelle environment + +ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; pwd)" +source "$ISABELLE_HOME/lib/scripts/isabelle-platform" + + +# main + +#paranoia setting -- avoid problems of Java/Swing versus XIM/IBus etc. +unset XMODIFIERS + +exec "$ISABELLE_HOME/contrib/jdk/${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM32}/bin/java" \ + "-Disabelle.home=$ISABELLE_HOME" \ + {JAVA_ARGS} \ + -classpath "{CLASSPATH}" \ + isabelle.Main "$@" + diff -r d6121362d705 -r da2e6282a4f5 Admin/Linux/build --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Admin/Linux/build Mon Oct 07 21:24:44 2013 +0200 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +cc -static -m32 Isabelle.c -o Isabelle +