merged
authorwenzelm
Fri, 27 Apr 2012 20:27:40 +0200
changeset 47804 decb1d2e2607
parent 47803 2e3821e13d67 (current diff)
parent 47801 a832454c4003 (diff)
child 47805 5d283dca6104
merged
Admin/Cygwin/exec_process.c
--- a/Admin/Cygwin/exec_process.c	Fri Apr 27 17:14:13 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*  Author:     Makarius
-
-Bash process group invocation on Cygwin.
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <process.h>
-
-
-static void fail(const char *msg)
-{
-  printf("%s\n", msg);
-  exit(2);
-}
-
-
-int main(int argc, char *argv[])
-{
-  /* args */
-
-  if (argc != 3) {
-    printf("Bad arguments\n");
-    exit(1);
-  }
-  char *pid_name = argv[1];
-  char *script = argv[2];
-
-
-  /* report pid */
-
-  FILE *pid_file;
-  pid_file = fopen(pid_name, "w");
-  if (pid_file == NULL) fail("Cannot open pid file");
-  fprintf(pid_file, "%d", getpid());
-  fclose(pid_file);
-
-
-  /* setsid */
-
-  if (getgid() == getpid()) fail("Cannot set session id");
-  setsid();
-
-
-  /* exec */
-
-  char *cmd_line[4];
-  cmd_line[0] = "/bin/bash";
-  cmd_line[1] = "-c";
-  cmd_line[2] = script;
-  cmd_line[3] = NULL;
-
-  int pid = spawnv(_P_NOWAIT, "/bin/bash", cmd_line);
-  if (pid == -1) fail("Bad process");
-  waitpid(pid);
-}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/exec_process/build	Fri Apr 27 20:27:40 2012 +0200
@@ -0,0 +1,53 @@
+#!/usr/bin/env bash
+#
+# Multi-platform build script
+
+THIS="$(cd "$(dirname "$0")"; pwd)"
+PRG="$(basename "$0")"
+
+
+# diagnostics
+
+function usage()
+{
+  echo
+  echo "Usage: $PRG TARGET"
+  echo
+  exit 1
+}
+
+function fail()
+{
+  echo "$1" >&2
+  exit 2
+}
+
+
+# command line args
+
+[ "$#" -eq 0 ] && usage
+TARGET="$1"; shift
+
+[ "$#" -eq 0 ] || usage
+
+
+# main
+
+mkdir -p "$TARGET"
+
+case "$TARGET" in
+  x86_64-linux | x86_64-darwin)
+    cc -m64 exec_process.c -o "$TARGET/exec_process"
+    ;;
+  x86-linux | x86-darwin)
+    cc -m32 exec_process.c -o "$TARGET/exec_process"
+    ;;
+  x86-cygwin)
+    cc exec_process.c -o "$TARGET/exec_process.exe"
+    ;;
+  *)
+    cc exec_process.c -o "$TARGET/exec_process"
+    ;;
+esac
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/exec_process/etc/settings	Fri Apr 27 20:27:40 2012 +0200
@@ -0,0 +1,3 @@
+# -*- shell-script -*- :mode=shellscript:
+
+EXEC_PROCESS="$COMPONENT/${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM}/exec_process"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/exec_process/exec_process.c	Fri Apr 27 20:27:40 2012 +0200
@@ -0,0 +1,57 @@
+/*  Author:     Makarius
+
+Bash process group invocation.
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+
+static void fail(const char *msg)
+{
+  fprintf(stderr, "%s\n", msg);
+  exit(2);
+}
+
+
+int main(int argc, char *argv[])
+{
+  /* args */
+
+  if (argc != 3) {
+    fprintf(stderr, "Bad arguments\n");
+    exit(1);
+  }
+  char *pid_name = argv[1];
+  char *script = argv[2];
+
+
+  /* report pid */
+
+  FILE *pid_file;
+  pid_file = fopen(pid_name, "w");
+  if (pid_file == NULL) fail("Cannot open pid file");
+  fprintf(pid_file, "%d", getpid());
+  fclose(pid_file);
+
+
+  /* setsid */
+
+  if (getgid() == getpid()) fail("Cannot set session id");
+  setsid();
+
+
+  /* exec */
+
+  char *cmd_line[4];
+  cmd_line[0] = "/bin/bash";
+  cmd_line[1] = "-c";
+  cmd_line[2] = script;
+  cmd_line[3] = NULL;
+
+  execv("/bin/bash", cmd_line);
+  fail("Cannot exec process");
+}
+
--- a/README	Fri Apr 27 17:14:13 2012 +0200
+++ b/README	Fri Apr 27 20:27:40 2012 +0200
@@ -7,29 +7,19 @@
    See the NEWS file in the distribution for details on user-relevant
    changes.
 
-System requirements
-
-   Isabelle requires a regular Unix-style platform (e.g. Linux,
-   Windows with Cygwin, Mac OS X) and depends on the following main
-   add-on tools:
+Installation
 
-     * The Poly/ML compiler and runtime system (version 5.2.1 or later).
-     * The GNU bash shell (version 3.x or 2.x).
-     * Perl (version 5.x).
-     * Java 1.6.x from Oracle or Apple -- for Scala and jEdit.
-     * GNU Emacs (version 23 or 24) -- for the Proof General 4.x interface.
-     * A complete LaTeX installation -- for document preparation.
-
-Installation
+   Isabelle work on the three main platform families: Linux, Mac OS X,
+   and Windows (via Cygwin).
 
    Completely integrated bundles including the full Isabelle sources,
    documentation, add-on tools and precompiled logic images for
    several platforms are available from the Isabelle web page.
 
-   Further background information may be found in the Isabelle System
+   Some background information may be found in the Isabelle System
    Manual, distributed with the sources (directory doc).
 
-User interface
+User interfaces
 
    Isabelle/jEdit is an emerging Prover IDE based on advanced
    technology of Isabelle/Scala.  It provides a metaphor of continuous