Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/fields/run-dnorm_sml.in
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/fields/run-dnorm_sml.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 631, Thu Mar 17 00:31:24 2011 UTC revision 632, Thu Mar 17 00:32:17 2011 UTC
# Line 18  Line 18 
18      structure SS = Substring      structure SS = Substring
19    
20    (* search path for the dnorm executable *)    (* search path for the dnorm executable *)
21      val path = [      val paths = [
22              "@DIDEROT_ROOT@/bin/dnorm", "@prefix@/bin/dnorm"              "@DIDEROT_ROOT@/bin", "@prefix@/bin"
23            ]            ]
24    
25      fun findExe () = (  (* FIXME: with SML/NJ 110.73, we'll be able to use PathUtil.findExe *)
26            case List.find (fn p => OS.FileSys.access(p, [OS.FileSys.A_EXEC])) path      fun findExe () = let
27              fun isExe p = OS.FileSys.access(p, [OS.FileSys.A_EXEC])
28              in
29                case PathUtil.existsFile isExe paths "dnorm"
30             of SOME cmd => cmd             of SOME cmd => cmd
31              | NONE => raise Fail "unable to find dnorm executable"              | NONE => raise Fail "unable to find dnorm executable"
32            (* end case *))              (* end case *)
33              end
34    
35      fun run srcFile = let      fun run srcFile = let
36            val proc = Unix.execute (findExe(), ["-h", "-i", srcFile])            val proc = Unix.execute (findExe(), ["-h", "-i", srcFile])

Legend:
Removed from v.631  
changed lines
  Added in v.632

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0