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