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/cm/bootstrap/cmb-slave-stub.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/bootstrap/cmb-slave-stub.sml

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

revision 449, Fri Oct 22 07:35:29 1999 UTC revision 452, Mon Oct 25 08:33:25 1999 UTC
# Line 1  Line 1 
1  (*  (*
2   * This is a stub providing "slave" functionality for CMB.   * This is a stub providing "slave" functionality for CMB.
3   * (We use dynamic linking technology to avoid loading host-cmb.cm   * (We use dynamic linking technology to avoid loading target-compilers.cm
4   *  on the slave side unless it is really needed.)   *  on the slave side unless it is really needed.)
5   *   *
6   * (C) 1999 Lucent Technologies, Bell Laboratories   * (C) 1999 Lucent Technologies, Bell Laboratories
# Line 9  Line 9 
9   *)   *)
10  structure CMBSlave = struct  structure CMBSlave = struct
11      local      local
12          val initialized = ref false          val lib = "target-compilers.cm"
13            val loaded = ref false
14            val table =
15                foldl StringMap.insert' StringMap.empty
16                [("alpha32-unix", "Alpha32UnixCMB.make"),
17                 ("hppa-unix", "HppaUnixCMB.make"),
18                 ("ppc-macos", "PPCMacOSCMB.make"),
19                 ("ppc-unix", "PPCUnixCMB.make"),
20                 ("sparc-unix", "SparcUnixCMB.make"),
21                 ("x86-unix", "X86UnixCMB.make"),
22                 ("x86-win32", "X86Win32CMB.make")]
23      in      in
24          fun slave make s =          (* "load" is supposed to be CM.autoload and "touch" should be
25              (if !initialized then ()           * (Compiler.Interact.useStream o TextIO.openString) *)
26               else if make "host-cmb.cm" then initialized := true          fun slave { load, touch } arch s =
27               else raise Fail "dynamic linkage for CMB slave failed";              case StringMap.find (table, arch) of
28               CMBSlaveHook.slave s)                  NONE => NONE
29                  | SOME cmd =>
30                        (if !loaded then ()
31                         else if load lib then loaded := true
32                         else raise Fail (concat ["dynamic linkage for CMB slave ",
33                                                  arch, " failed"]);
34                         touch cmd;
35                         CMBSlaveHook.slave arch s)
36      end      end
37  end  end

Legend:
Removed from v.449  
changed lines
  Added in v.452

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