Updated for SML/NJ 110.46+
[bpt/mlt.git] / BUILDING
1 ===================
2 System requirements
3 ===================
5 Compiling the mlt tool requires a "working version" of SML/NJ. It's
6 best to use version 110.46 or later. You may have problems with any
7 version whatsoever, though, since this stuff uses some SML/NJ compiler
8 internals, and they may change often.
10 If you're using a pre-110.46 version, you'll need to, at a minimum,
11 get the SML/NJ source, make the following patches, and build it. Of
12 course, there are no promises that everything will then work with that
13 particular version. (Especially problematic are the changes in the
14 Basis library spec that aren't backwards compatible.) The patch
15 involves modifying some of the included .cm files to make a few
16 additional internal structures visible. The necessary changes to make
17 are described below, with paths given relative to your base SML/NJ
18 directory. The lines listed for each file should be added right before
19 the "is" keyword at the end of the exports list for a library. The
20 "is" is on the first non-indented line after the initial "Library"
21 line in each of these files.
23 The following lines to src/compiler/core.cm:
24 structure Types
25 structure EntityEnv
26 structure Modules
27 structure Stamps
28 structure Bindings
29 structure TypesUtil
30 structure VarCon
31 structure ModuleUtil
32 structure II
33 structure BasicTypes
34 structure PPType
35 structure Access
37 The following lines to both src/system/smlnj/compiler/current.cm
38 and src/system/smlnj/compiler/x86.cm:
39 structure Types
40 structure EntityEnv
41 structure Modules
42 structure Stamps
43 structure Bindings
44 structure TypesUtil
45 structure VarCon
46 structure ModuleUtil
47 structure II
48 structure BasicTypes
49 structure PPType
50 structure Access
51 structure Unify
53 The following line to src/compiler/Elaborator/elaborate.cm:
54 structure Unify
56 Finally, add the following line somewhere _below_ the "is" in
57 src/system/smlnj/compiler/x86.cm:
58 $smlnj/viscomp/elaborate.cm
60 After making these changes, you can rebuild and install the compiler
61 with the following sequence of commands:
63 cd $smlnjdir/src/system
64 sml
65 CM.autoload "$smlnj/cmb.cm";
66 CMB.make ();
67 <exit from sml by typing the end-of-file sequence>
68 ./makeml
69 ./installml
72 =============
73 Configuration
74 =============
76 If it is possible for you to modify a file /etc/mlt.conf, then you
77 can edit this file to set various options related to locations of
78 important files on your file system. In particular, you may want to
79 set the 'compiler', 'lib', and 'sml' options (documented in the
80 manual) if you have SML/NJ installed somewhere besides /usr/local/sml
81 or the mlt src directory somewhere besides /usr/local/share/mlt/src.
82 If you can't modify /etc/mlt.conf, then you can change the first
83 variable definition in src/config.sml to a different path, or you can
84 leave it as is and provide all configuration in the local mlt.conf
85 file for each project.
87 You should also edit the paths in the simple install script in this
88 directory if you want to install system-wide binaries and scripts to
89 somewhere besides /usr/local/bin.
91 These changes may be made for you by a fancy configuration program in
92 a future release.
95 ========
96 Building
97 ========
99 All sources may be built by running the build script in this
100 directory. It does a clean re-build of all source files and stabilizes
101 all libraries produced. The build script is not appropriate for use
102 during development. Use the standard SML/NJ CM mechanisms if you are
103 changing the code and don't want to recompile everything each time.
105 [There is probably a better way to do this, but I haven't figured one
106 out yet.]