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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/cm/bootstrap/cmb-slave-stub.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 452 - (view) (download)

1 : blume 449 (*
2 :     * This is a stub providing "slave" functionality for CMB.
3 : blume 452 * (We use dynamic linking technology to avoid loading target-compilers.cm
4 : blume 449 * on the slave side unless it is really needed.)
5 :     *
6 :     * (C) 1999 Lucent Technologies, Bell Laboratories
7 :     *
8 :     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
9 :     *)
10 :     structure CMBSlave = struct
11 :     local
12 : blume 452 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 : blume 449 in
24 : blume 452 (* "load" is supposed to be CM.autoload and "touch" should be
25 :     * (Compiler.Interact.useStream o TextIO.openString) *)
26 :     fun slave { load, touch } arch s =
27 :     case StringMap.find (table, arch) of
28 :     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 : blume 449 end
37 :     end

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