Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/system/IntSys/boot-env-fn.sml
ViewVC logotype

Diff of /sml/trunk/src/system/IntSys/boot-env-fn.sml

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

revision 536, Fri Feb 18 16:51:54 2000 UTC revision 537, Fri Feb 18 17:20:16 2000 UTC
# Line 7  Line 7 
7   *       (M. Blume, 7/1999)   *       (M. Blume, 7/1999)
8   *)   *)
9  signature BOOTENV = sig  signature BOOTENV = sig
10      val init: unit -> { heapfile: string, procCmdLine: (unit -> unit) option }      val init:
11            string -> { heapfile: string, procCmdLine: (unit -> unit) option }
12  end  end
13    
14  functor BootEnvF (datatype envrequest = AUTOLOAD | BARE  functor BootEnvF (datatype envrequest = AUTOLOAD | BARE
# Line 52  Line 53 
53          end          end
54      end      end
55    
56      fun init () = let      fun init bootdir = let
57          (* grab relevant command line arguments... *)          (* grab relevant command line arguments... *)
58          fun vArg (prefix, arg) =          fun vArg (prefix, arg) =
59              if String.isPrefix prefix arg then              if String.isPrefix prefix arg then
60                  SOME (String.extract (arg, size prefix, NONE))                  SOME (String.extract (arg, size prefix, NONE))
61              else NONE              else NONE
62          fun bootArgs ([], bootdir, newbindir, heapfile, er) =          fun bootArgs ([], newbindir, heapfile, er) = (newbindir, heapfile, er)
63              (bootdir, newbindir, heapfile, er)            | bootArgs ("@SMLbare" :: rest, newbindir, heapfile, _) =
64            | bootArgs ("@SMLbare" :: rest, bootdir, newbindir, heapfile, _) =              bootArgs (rest, newbindir, heapfile, BARE)
65              bootArgs (rest, bootdir, newbindir, heapfile, BARE)            | bootArgs (head :: rest, newbindir, heapfile, er) =
           | bootArgs (head :: rest, bootdir, newbindir, heapfile, er) =  
             (case vArg ("@SMLboot=", head) of  
                  SOME bootdir =>  
                      bootArgs (rest, bootdir, newbindir, heapfile, er)  
                | NONE =>  
66                       (case vArg ("@SMLrebuild=", head) of                       (case vArg ("@SMLrebuild=", head) of
67                            newbindir as SOME _ =>                   nbd as SOME _ => bootArgs (rest, nbd, heapfile, er)
                               bootArgs (rest, bootdir, newbindir, heapfile, er)  
68                          | NONE =>                          | NONE =>
69                                (case vArg ("@SMLheap=", head) of                                (case vArg ("@SMLheap=", head) of
70                                     SOME heapfile =>                            SOME hf => bootArgs (rest, newbindir, hf, er)
71                                         bootArgs (rest, bootdir, newbindir,                          | NONE => bootArgs (rest, newbindir, heapfile, er)))
                                                  heapfile, er)  
                                  | NONE =>  
                                        bootArgs (rest, bootdir, newbindir,  
                                                  heapfile, er))))  
72    
73          val (bootdir, newbindir, heapfile, er) =          val (newbindir, heapfile, er) =
74              bootArgs (SMLofNJ.getAllArgs (),              bootArgs (SMLofNJ.getAllArgs (),
                       "comp.boot." ^ architecture,  
75                        NONE,                        NONE,
76                        "sml." ^ architecture,                        "sml." ^ architecture,
77                        AUTOLOAD)                        AUTOLOAD)
         val bootdir = OS.Path.mkCanonical bootdir  
78          val newbindir = Option.map OS.Path.mkCanonical newbindir          val newbindir = Option.map OS.Path.mkCanonical newbindir
79      in      in
80          case newbindir of          case newbindir of

Legend:
Removed from v.536  
changed lines
  Added in v.537

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