src/Pure/System/isabelle_system.scala
changeset 31818 f698f76a3713
parent 31803 4aabae982988
child 31820 8199c9a42941
--- a/src/Pure/System/isabelle_system.scala	Sat Jun 27 10:26:42 2009 +0200
+++ b/src/Pure/System/isabelle_system.scala	Sat Jun 27 17:34:48 2009 +0200
@@ -237,10 +237,18 @@
     Isabelle_System.raw_execute(environment, redirect, cmdline: _*)
   }
 
-  def isabelle_tool(args: String*): (String, Int) =
+  def isabelle_tool(name: String, args: String*): (String, Int) =
   {
-    val proc = execute(true, (List(getenv_strict("ISABELLE_TOOL")) ++ args): _*)
-    Isabelle_System.process_output(proc)
+    getenv_strict("ISABELLE_TOOLS").split(":").find(dir => {
+      val file = platform_file(dir + "/" + name)
+      try { file.isFile && file.canRead && file.canExecute }
+      catch { case _: SecurityException => false }
+    }) match {
+      case Some(dir) =>
+        val proc = execute(true, (List(platform_path(dir + "/" + name)) ++ args): _*)
+        Isabelle_System.process_output(proc)
+      case None => ("Unknown Isabelle tool: " + name, 2)
+    }
   }