SCM Repository
[diderot] Diff of /branches/pure-cfg/src/compiler/fields/run-dnorm_sml.in
Diff of /branches/pure-cfg/src/compiler/fields/run-dnorm_sml.in
Parent Directory
|
Revision Log
|
Patch
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 |
|
|